@marimo-team/frontend 0.23.16-dev5 → 0.23.16-dev51

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 (704) hide show
  1. package/dist/assets/{CellStatus-BalYv0pK.js → CellStatus-DciB5rbr.js} +1 -1
  2. package/dist/assets/{ConnectedDataExplorerComponent-DI7mV-Gw.js → ConnectedDataExplorerComponent-CXp99aFw.js} +1 -1
  3. package/dist/assets/{ErrorBoundary-C7_5jjWi.js → ErrorBoundary-DzTD8LVq.js} +1 -1
  4. package/dist/assets/{ImperativeModal-BIavOiUv.js → ImperativeModal-fY-ZfT0b.js} +1 -1
  5. package/dist/assets/JsonOutput-BM3vve9F.js +53 -0
  6. package/dist/assets/LazyAnyLanguageCodeMirror-DPOEues4.js +2 -0
  7. package/dist/assets/{MarimoErrorOutput-DO2k2fA5.js → MarimoErrorOutput-Bh0y53Du.js} +4 -4
  8. package/dist/assets/{RSPContexts-CgC81f0I.js → RSPContexts-WiCgGm__.js} +1 -1
  9. package/dist/assets/RenderHTML-B9jx7Dsm.js +1 -0
  10. package/dist/assets/{RunButton-BKRupqr7.js → RunButton-DMtHbFuA.js} +1 -1
  11. package/dist/assets/{add-cell-with-ai-CEZtaZCK.js → add-cell-with-ai-BcRYriMM.js} +35 -35
  12. package/dist/assets/add-connection-dialog-syjRSNPT.js +178 -0
  13. package/dist/assets/{agent-panel-CHB6t7Zy.js → agent-panel-B31W_VwU.js} +5 -5
  14. package/dist/assets/ai-model-dropdown-B3D05oQh.js +5 -0
  15. package/dist/assets/{alert-dialog-BXegNC0I.js → alert-dialog-Bb8Lz8ko.js} +1 -1
  16. package/dist/assets/{any-language-editor-DCpZRrpx.js → any-language-editor-BDvoKhJM.js} +1 -1
  17. package/dist/assets/apl-B-7blH-b.js +1 -0
  18. package/dist/assets/app-config-button-D_mjovwU.js +1 -0
  19. package/dist/assets/{arc-CfUZAQDm.js → arc-CezuXhk_.js} +1 -1
  20. package/dist/assets/{architecture-7HQA4BMR-Bvqj37EA.js → architecture-7HQA4BMR-Dy7zkjw8.js} +1 -1
  21. package/dist/assets/{architectureDiagram-VXUJARFQ-sx_yisiZ.js → architectureDiagram-VXUJARFQ-BmOSh2SW.js} +1 -1
  22. package/dist/assets/asciiarmor-D3K8amZ9.js +1 -0
  23. package/dist/assets/asn1-UGGn98tp.js +1 -0
  24. package/dist/assets/blob-BJREJiQp.js +1 -0
  25. package/dist/assets/{blockDiagram-VD42YOAC-KexI-fgH.js → blockDiagram-VD42YOAC-DHO0ifdn.js} +1 -1
  26. package/dist/assets/brainfuck-B4y4U3tg.js +1 -0
  27. package/dist/assets/{button-eIihcbUw.js → button-DDGiD1NW.js} +1 -1
  28. package/dist/assets/{c4Diagram-YG6GDRKO-d8NrlxRF.js → c4Diagram-YG6GDRKO-ByToYMes.js} +1 -1
  29. package/dist/assets/{cache-panel-wllSTlbM.js → cache-panel-Bvnkzrzd.js} +1 -1
  30. package/dist/assets/{capabilities-B09j1Eor.js → capabilities-DoEg0XwL.js} +1 -1
  31. package/dist/assets/{cell-editor-B5JVq7_q.js → cell-editor-BOhZHoLm.js} +17 -17
  32. package/dist/assets/cell-link-DqNEv3f9.js +1 -0
  33. package/dist/assets/cells-Jr-5Pc9f.js +235 -0
  34. package/dist/assets/channel-hYe4T32r.js +1 -0
  35. package/dist/assets/{chat-display-BG08ltQ3.js → chat-display-Djy1Jt6b.js} +1 -1
  36. package/dist/assets/{chat-panel-P2CzCtXJ.js → chat-panel-B2nYSE_l.js} +4 -4
  37. package/dist/assets/{chat-ui-fAJZAoTD.js → chat-ui-DlG0En7w.js} +4 -4
  38. package/dist/assets/{chunk-4BX2VUAB-fhh1HlXH.js → chunk-4BX2VUAB-BsEakQWN.js} +1 -1
  39. package/dist/assets/chunk-55IACEB6-DkGbQmsa.js +1 -0
  40. package/dist/assets/{chunk-5FQGJX7Z-Cp0LZT-a.js → chunk-5FQGJX7Z-BEbM01OT.js} +2 -2
  41. package/dist/assets/{chunk-ABZYJK2D-BtK4zInQ.js → chunk-ABZYJK2D-CCNXe-E2.js} +3 -3
  42. package/dist/assets/{chunk-ATLVNIR6-YZDenslF.js → chunk-ATLVNIR6-yY0weiRB.js} +1 -1
  43. package/dist/assets/{chunk-B4BG7PRW-DYIZwDbt.js → chunk-B4BG7PRW-DtjHcIBO.js} +1 -1
  44. package/dist/assets/{chunk-CVBHYZKI-CIyHeK0Q.js → chunk-CVBHYZKI-D1ar3Zzb.js} +1 -1
  45. package/dist/assets/{chunk-DI55MBZ5-TodwBGEN.js → chunk-DI55MBZ5-BxB9Lmc6.js} +1 -1
  46. package/dist/assets/{chunk-EXTU4WIE-C76bF1UD.js → chunk-EXTU4WIE-Do43HMrz.js} +1 -1
  47. package/dist/assets/{chunk-FMBD7UC4-Yq65IDPA.js → chunk-FMBD7UC4-FWkYBdS7.js} +1 -1
  48. package/dist/assets/{chunk-HN2XXSSU-CcbN4n6W.js → chunk-HN2XXSSU-nVY6M8Me.js} +1 -1
  49. package/dist/assets/{chunk-JA3XYJ7Z-CPXEu7AX.js → chunk-JA3XYJ7Z-52dYwyoT.js} +1 -1
  50. package/dist/assets/{chunk-JZLCHNYA-D8q1z6Py.js → chunk-JZLCHNYA-BHSouLxk.js} +1 -1
  51. package/dist/assets/{chunk-MI3HLSF2-bmomnexd.js → chunk-MI3HLSF2-BwgHEi3_.js} +1 -1
  52. package/dist/assets/{chunk-N4CR4FBY-BhsjB2qn.js → chunk-N4CR4FBY-BkAnRh0J.js} +2 -2
  53. package/dist/assets/{chunk-QN33PNHL-ngvPqyQ0.js → chunk-QN33PNHL-DWzHlkYI.js} +1 -1
  54. package/dist/assets/{chunk-QXUST7PY-C4c0Sjmn.js → chunk-QXUST7PY-CjtWgrZg.js} +1 -1
  55. package/dist/assets/{chunk-QZHKN3VN-CkbwBDOS.js → chunk-QZHKN3VN-CmAwpNoC.js} +1 -1
  56. package/dist/assets/{chunk-S3R3BYOJ-Bt2NnquF.js → chunk-S3R3BYOJ-DcZAYEft.js} +1 -1
  57. package/dist/assets/{chunk-TZMSLE5B-Dysko1OC.js → chunk-TZMSLE5B-D2-o8-XQ.js} +1 -1
  58. package/dist/assets/classDiagram-2ON5EDUG-DapsPtpH.js +1 -0
  59. package/dist/assets/classDiagram-v2-WZHVMYZB-Oa2f7U6n.js +1 -0
  60. package/dist/assets/{clike-DKPr2D1_.js → clike-BAN6KopO.js} +1 -1
  61. package/dist/assets/clojure-BAZ-ejkG.js +1 -0
  62. package/dist/assets/cmake-jWn0xN9y.js +1 -0
  63. package/dist/assets/cobol-XqY9jaWP.js +1 -0
  64. package/dist/assets/{code-block-37QAKDTI-DlENujeV.js → code-block-37QAKDTI-DdMTHZGu.js} +1 -1
  65. package/dist/assets/coffeescript-DI1jfZHX.js +1 -0
  66. package/dist/assets/{column-preview-Dne1dIt0.js → column-preview-BUHlI5va.js} +1 -1
  67. package/dist/assets/{command-CAJLPEBq.js → command-Dqxie4gq.js} +1 -1
  68. package/dist/assets/{command-palette-iOCqUIs1.js → command-palette-rEJmXCZM.js} +1 -1
  69. package/dist/assets/{common-CD6Mj8n6.js → common-CZc3fQI4.js} +1 -1
  70. package/dist/assets/commonlisp-UKb01OlU.js +1 -0
  71. package/dist/assets/components-GAYCj6Mx.js +1 -0
  72. package/dist/assets/config-B-Q7J_6d.js +1 -0
  73. package/dist/assets/{config-COUOIPEq.js → config-BJVx3eBW.js} +1 -1
  74. package/dist/assets/{copy-BtTOqPTS.js → copy-Bxb1_Gtw.js} +1 -1
  75. package/dist/assets/{copy-icon-C2pG0ZNK.js → copy-icon-neDQUo4Q.js} +1 -1
  76. package/dist/assets/{cose-bilkent-S5V4N54A-BlMw4-M9.js → cose-bilkent-S5V4N54A-B4-5phSs.js} +1 -1
  77. package/dist/assets/{createReducer-C7kZ8zEe.js → createReducer-DGx5Af-C.js} +1 -1
  78. package/dist/assets/crystal-DOvjTBWA.js +1 -0
  79. package/dist/assets/{css-DsUcFZz8.js → css-DWLxGm3Z.js} +1 -1
  80. package/dist/assets/cypher-CLDhu2ae.js +1 -0
  81. package/dist/assets/d-C0ecUZk9.js +1 -0
  82. package/dist/assets/{dagre-6UL2VRFP-kJ4x17JK.js → dagre-6UL2VRFP-2XhH1Ri-.js} +1 -1
  83. package/dist/assets/{data-grid-overlay-editor-DbobQcVo.js → data-grid-overlay-editor-B4LrPNw9.js} +1 -1
  84. package/dist/assets/{datasource-ySAiC9gr.js → datasource-AWkkAeiS.js} +2 -2
  85. package/dist/assets/{dates-D-kIKDYA.js → dates-C2LWzsCZ.js} +1 -1
  86. package/dist/assets/{dependency-graph-panel-BF23EwcD.js → dependency-graph-panel-wcqTPq6b.js} +3 -3
  87. package/dist/assets/{diagram-PSM6KHXK-d-5aQNHk.js → diagram-PSM6KHXK-CAqt0euW.js} +1 -1
  88. package/dist/assets/{diagram-QEK2KX5R-CO-PXq75.js → diagram-QEK2KX5R-D5cgX3Vp.js} +1 -1
  89. package/dist/assets/{diagram-S2PKOQOG-Dv7pcvYC.js → diagram-S2PKOQOG-ibWavdR5.js} +1 -1
  90. package/dist/assets/{dialog-D1DEsRZ2.js → dialog-BCVepWLJ.js} +1 -1
  91. package/dist/assets/diff-657cCCVc.js +1 -0
  92. package/dist/assets/{dist-CRrIf3gB.js → dist-7L5iW3e_.js} +1 -1
  93. package/dist/assets/{dist-ByVeMWkr.js → dist-BLN8PNJV.js} +1 -1
  94. package/dist/assets/{dist-R1kU4nzJ.js → dist-Bcpo9599.js} +1 -1
  95. package/dist/assets/{dist-DQNaXfK1.js → dist-BrZHhdmA.js} +1 -1
  96. package/dist/assets/dist-C00gHjPp.js +1 -0
  97. package/dist/assets/{dist-0QUuSoRx.js → dist-C4El4p_-.js} +1 -1
  98. package/dist/assets/{dist-BsphJPAV.js → dist-CIYjZ11d.js} +1 -1
  99. package/dist/assets/{dist-Du-wcJyR.js → dist-COTjOJlM.js} +1 -1
  100. package/dist/assets/dist-CWNfBqYo.js +1 -0
  101. package/dist/assets/dist-Cck3fpDq.js +1 -0
  102. package/dist/assets/dist-CiVShZKM.js +2 -0
  103. package/dist/assets/{dist-CECF_J8y.js → dist-DIQO2yAn.js} +1 -1
  104. package/dist/assets/{dist-BMOD2Pyh.js → dist-DabFEfar.js} +1 -1
  105. package/dist/assets/dist-f5euh_Pv.js +1 -0
  106. package/dist/assets/{dist-CDUl-YL4.js → dist-ryTWanRP.js} +1 -1
  107. package/dist/assets/{dist-6c4zOh78.js → dist-sg9T7Ulw.js} +1 -1
  108. package/dist/assets/{dist-sPfKr-vH.js → dist-wSuqFvon.js} +1 -1
  109. package/dist/assets/{dockerfile-C2PznFWk.js → dockerfile-kqVBOcIP.js} +1 -1
  110. package/dist/assets/{documentation-panel-e9Fi9R7e.js → documentation-panel-Eu8MIkoU.js} +1 -1
  111. package/dist/assets/download-CQ7iZFJL.js +9 -0
  112. package/dist/assets/{dropdown-menu-BFZLnWeO.js → dropdown-menu-dHmZR8bI.js} +1 -1
  113. package/dist/assets/dtd-DSiK7Qgi.js +1 -0
  114. package/dist/assets/dylan-07d5-7Q9.js +1 -0
  115. package/dist/assets/ecl-CSTUHiwq.js +1 -0
  116. package/dist/assets/{edit-page-7X3HYey7.js → edit-page-Cw7nN6HC.js} +6 -6
  117. package/dist/assets/eiffel-DR99GcsM.js +1 -0
  118. package/dist/assets/elm-Cmh0iW6J.js +1 -0
  119. package/dist/assets/{erDiagram-Q2GNP2WA-BQ8HfnRu.js → erDiagram-Q2GNP2WA-BaY7iomT.js} +1 -1
  120. package/dist/assets/erlang-CS9Yc6UC.js +1 -0
  121. package/dist/assets/{error-banner-B6eIlxzg.js → error-banner-BSxEOIn2.js} +1 -1
  122. package/dist/assets/error-entries-Cr8uVukN.js +8 -0
  123. package/dist/assets/{error-panel-DdsUL6b7.js → error-panel-BZzr0PA1.js} +1 -1
  124. package/dist/assets/{es-1D83cgiu.js → es-gYgfF8y5.js} +1 -1
  125. package/dist/assets/{esm-BL7jQmzn.js → esm-B30N1GS0.js} +1 -1
  126. package/dist/assets/{esm-Cmv0Nuxi.js → esm-DqItXpGT.js} +1 -1
  127. package/dist/assets/{factor-DMrXrOH8.js → factor-D96xahcJ.js} +1 -1
  128. package/dist/assets/factor-DjB27Lcf.js +1 -0
  129. package/dist/assets/{field-BeZbVzXA.js → field-BsxD35VE.js} +1 -1
  130. package/dist/assets/file-explorer-panel-C1W7g_Wp.js +26 -0
  131. package/dist/assets/{file-icons-Cb54mIL8.js → file-icons-BAqZR08W.js} +1 -1
  132. package/dist/assets/{file-name-input-BWFcK1ey.js → file-name-input-0MiZVw5r.js} +1 -1
  133. package/dist/assets/{fileToBase64-C2Yy-YXq.js → fileToBase64-Dgfa7TRQ.js} +1 -1
  134. package/dist/assets/floating-outline-C6g75zrP.js +1 -0
  135. package/dist/assets/{flowDiagram-NV44I4VS-xBOzhlfg.js → flowDiagram-NV44I4VS-C_6PGGE6.js} +1 -1
  136. package/dist/assets/focus-C0HXXg3V.js +1 -0
  137. package/dist/assets/form-C051zAev.js +1 -0
  138. package/dist/assets/{form-B6BkSCJb.js → form-DT44Rmhp.js} +2 -2
  139. package/dist/assets/{formats-ClEFGPy-.js → formats-DzmLpc9A.js} +1 -1
  140. package/dist/assets/{formatting-B_41gSF5.js → formatting-DQX9QUSf.js} +1 -1
  141. package/dist/assets/forth-UwTUu7NY.js +1 -0
  142. package/dist/assets/fortran-cptiB4gJ.js +1 -0
  143. package/dist/assets/{fullscreen-dUjPYOmm.js → fullscreen-CTDqNQr6.js} +1 -1
  144. package/dist/assets/{gallery-page-CWQQAYpa.js → gallery-page-CL1y8LXc.js} +1 -1
  145. package/dist/assets/{ganttDiagram-JELNMOA3-D2O_k-Zg.js → ganttDiagram-JELNMOA3-CJFyE5hs.js} +1 -1
  146. package/dist/assets/gas-ajMbd9Us.js +1 -0
  147. package/dist/assets/gherkin-ClYkalzE.js +1 -0
  148. package/dist/assets/{gitGraph-G5XIXVHT-8HJwNcdU.js → gitGraph-G5XIXVHT-BP96QVP9.js} +1 -1
  149. package/dist/assets/{gitGraphDiagram-V2S2FVAM-Nk4Ll9GY.js → gitGraphDiagram-V2S2FVAM-CGQPWKR8.js} +1 -1
  150. package/dist/assets/{glide-data-editor-lMARFWHS.js → glide-data-editor-Badziq3Y.js} +4 -4
  151. package/dist/assets/groovy-BY-gt7AW.js +1 -0
  152. package/dist/assets/haskell-D1BeJ7SR.js +1 -0
  153. package/dist/assets/haxe-QOq5WFXx.js +1 -0
  154. package/dist/assets/home-page-CJz9IHZ2.js +4 -0
  155. package/dist/assets/{html-to-image-CwmX28T9.js → html-to-image-CfjhKLA4.js} +2 -2
  156. package/dist/assets/idl-3-UcEGx7.js +1 -0
  157. package/dist/assets/index-CrEgp1mR.js +38 -0
  158. package/dist/assets/index-D6Dp_PFj.css +2 -0
  159. package/dist/assets/{info-VBDWY6EO-rfe3WPvd.js → info-VBDWY6EO-B7aeNYNu.js} +1 -1
  160. package/dist/assets/infoDiagram-HS3SLOUP-BT7ISZ3J.js +2 -0
  161. package/dist/assets/{input-CqrUjynb.js → input-JxFwu-3G.js} +1 -1
  162. package/dist/assets/javascript-CorD44JN.js +1 -0
  163. package/dist/assets/{journeyDiagram-XKPGCS4Q-D61FGivn.js → journeyDiagram-XKPGCS4Q-DhyWkFu7.js} +1 -1
  164. package/dist/assets/julia-BYqTtTAl.js +1 -0
  165. package/dist/assets/{kanban-definition-3W4ZIXB7-Bnv0X0Tu.js → kanban-definition-3W4ZIXB7-B2A0FPA_.js} +1 -1
  166. package/dist/assets/katex-BnxSCReZ.js +1 -0
  167. package/dist/assets/kiosk-mode-CWGEgpon.js +1 -0
  168. package/dist/assets/{label-BElwWzf0.js → label-CqjrpwRC.js} +1 -1
  169. package/dist/assets/{layout-CUlZijwG.js → layout-D4bpsgVD.js} +5 -5
  170. package/dist/assets/{line-DNm2phYo.js → line-1dURhxkp.js} +1 -1
  171. package/dist/assets/{linear-CTQqNbVX.js → linear-gmSPLe7o.js} +1 -1
  172. package/dist/assets/{links-CToBjIIj.js → links-CiT7FeSM.js} +1 -1
  173. package/dist/assets/livescript-qYgfNnNE.js +1 -0
  174. package/dist/assets/logs-panel-CsaY3O1m.js +1 -0
  175. package/dist/assets/{loro_wasm_bg-Duqr-kJ2.js → loro_wasm_bg-DWuCVDfB.js} +1 -1
  176. package/dist/assets/lua-BCqCjdfz.js +1 -0
  177. package/dist/assets/{markdown-renderer-QvXG0CRk.js → markdown-renderer-BgqeO4JR.js} +3 -3
  178. package/dist/assets/mathematica-XKwMfn0d.js +1 -0
  179. package/dist/assets/mbox-BnkeOnif.js +1 -0
  180. package/dist/assets/{menu-items-DbSLBfXR.js → menu-items-CCi6aOPm.js} +1 -1
  181. package/dist/assets/{mermaid-4DMBBIKO-CDGmT6YQ.js → mermaid-4DMBBIKO-DxfSuOnE.js} +1 -1
  182. package/dist/assets/{mermaid-Bh0flEIb.js → mermaid-Dfx05w1B.js} +3 -3
  183. package/dist/assets/{mermaid-parser.core-Dz2GMGqQ.js → mermaid-parser.core-OagDSIIt.js} +2 -2
  184. package/dist/assets/{mhchem-CIWniJp4.js → mhchem-Dka9kRKN.js} +1 -1
  185. package/dist/assets/{mindmap-definition-VGOIOE7T-C-YaKmEU.js → mindmap-definition-VGOIOE7T-torqqISZ.js} +1 -1
  186. package/dist/assets/mirc-ipoElhai.js +1 -0
  187. package/dist/assets/mllike-DmouQ5Dp.js +1 -0
  188. package/dist/assets/modelica-BtmmVsUf.js +1 -0
  189. package/dist/assets/mscgen-BHZmHZgz.js +1 -0
  190. package/dist/assets/mumps-oKfoFTl_.js +1 -0
  191. package/dist/assets/{name-cell-input-C6cukQ9k.js → name-cell-input-DcU8Rfrz.js} +1 -1
  192. package/dist/assets/node-sql-parser-Dpr10aqR.js +68 -0
  193. package/dist/assets/nsis-DDOPnuAW.js +1 -0
  194. package/dist/assets/{nsis-Ccvd1gbp.js → nsis-gzbsJ5t0.js} +1 -1
  195. package/dist/assets/ntriples-Dsyl_sOF.js +1 -0
  196. package/dist/assets/{number-overlay-editor-BQ9P6yP7.js → number-overlay-editor-DlQjqV32.js} +1 -1
  197. package/dist/assets/{numbers-CeeaFKqu.js → numbers-rmawRqQP.js} +1 -1
  198. package/dist/assets/octave-CI5RGMPa.js +1 -0
  199. package/dist/assets/{ordinal-DyTNGK17.js → ordinal-W4TcDjiJ.js} +1 -1
  200. package/dist/assets/{outline-panel-BPlg9_CE.js → outline-panel-D-CHPZQM.js} +1 -1
  201. package/dist/assets/oz-D01pKAWx.js +1 -0
  202. package/dist/assets/{packages-panel-BzQF60rG.js → packages-panel-dq7QVZl1.js} +1 -1
  203. package/dist/assets/{packet-DYOGHKS2-DTVloLa7.js → packet-DYOGHKS2-B2FlK_cc.js} +1 -1
  204. package/dist/assets/pair-with-agent-modal-D2vO1D8g.js +4 -0
  205. package/dist/assets/panels-DWoniKhE.js +4 -0
  206. package/dist/assets/pascal-DGXfnIFD.js +1 -0
  207. package/dist/assets/perl-gZ7qIkF-.js +1 -0
  208. package/dist/assets/{pie-VRWISCQL-Bmght6JF.js → pie-VRWISCQL-rtCNhZhm.js} +1 -1
  209. package/dist/assets/{pieDiagram-ADFJNKIX-DlFYL0BN.js → pieDiagram-ADFJNKIX-vSo1I9sb.js} +1 -1
  210. package/dist/assets/pig-Cb90ayl-.js +1 -0
  211. package/dist/assets/{popover-DrHQ3KEt.js → popover-Bcz1Zikb.js} +1 -1
  212. package/dist/assets/powershell-_YxddSL3.js +1 -0
  213. package/dist/assets/process-output-NbwnUu05.js +1 -0
  214. package/dist/assets/properties-sU50dmvt.js +1 -0
  215. package/dist/assets/protobuf-DFdF-yfo.js +1 -0
  216. package/dist/assets/{pug-BtXi5KiX.js → pug-CfBtO6QD.js} +1 -1
  217. package/dist/assets/pug-DwUB-C24.js +1 -0
  218. package/dist/assets/puppet-DtKzwiZ6.js +1 -0
  219. package/dist/assets/python-BMLOKYmk.js +1 -0
  220. package/dist/assets/q-BF1zXMdP.js +1 -0
  221. package/dist/assets/{quadrantDiagram-AYHSOK5B-BpJug2BH.js → quadrantDiagram-AYHSOK5B-DonUSsuk.js} +1 -1
  222. package/dist/assets/r-BQiKhVSI.js +1 -0
  223. package/dist/assets/{radar-ZZBFDIW7-CYwWzRgW.js → radar-ZZBFDIW7-CRVupj1O.js} +1 -1
  224. package/dist/assets/{radio-group-CLBjGkt5.js → radio-group-rhQpGwU-.js} +1 -1
  225. package/dist/assets/{react-vega-TNCk_eWj.js → react-vega-Bd66vLSZ.js} +1 -1
  226. package/dist/assets/{readonly-code-display-D63oRtBP.js → readonly-code-display-CVY2f7EZ.js} +1 -1
  227. package/dist/assets/{readonly-python-code-CW_G5e4E.js → readonly-python-code-Q_1Y3VyZ.js} +1 -1
  228. package/dist/assets/{renderShortcut-BZLr8D7H.js → renderShortcut-Bl8_FVn8.js} +1 -1
  229. package/dist/assets/{requirementDiagram-UZGBJVZJ-Bd-1eny8.js → requirementDiagram-UZGBJVZJ-D8rJ1Dg-.js} +1 -1
  230. package/dist/assets/{reveal-component-BLMTmd8T.js → reveal-component-CedpDwM8.js} +60 -60
  231. package/dist/assets/rpm-v7UTuaHo.js +1 -0
  232. package/dist/assets/ruby-Cw43FpG3.js +1 -0
  233. package/dist/assets/{run-page-B6pgDYEJ.js → run-page-CGoux5cj.js} +1 -1
  234. package/dist/assets/{runs-D51Xwrsk.js → runs-CZN8py6x.js} +1 -1
  235. package/dist/assets/{sankeyDiagram-TZEHDZUN-CDWAE6GV.js → sankeyDiagram-TZEHDZUN-Bufh177s.js} +1 -1
  236. package/dist/assets/sas-BIKscqlp.js +1 -0
  237. package/dist/assets/scheme-CGic3hSV.js +1 -0
  238. package/dist/assets/scratchpad-panel-BLuF25yR.js +1 -0
  239. package/dist/assets/{scroll-to-bottom-button-Cgr10kaJ.js → scroll-to-bottom-button-C8yfT4wq.js} +1 -1
  240. package/dist/assets/{secrets-panel-Cc5KDBk6.js → secrets-panel-4Qy7R-wy.js} +1 -1
  241. package/dist/assets/{select-B5TFNjmU.js → select-BP75_5jJ.js} +1 -1
  242. package/dist/assets/{sequenceDiagram-WL72ISMW-B6hjDGBF.js → sequenceDiagram-WL72ISMW-DOsQdDD2.js} +1 -1
  243. package/dist/assets/{session-CEFnN9Cq.js → session-BmukRjSi.js} +1 -1
  244. package/dist/assets/session-panel-OIot3eyB.js +1 -0
  245. package/dist/assets/{share-CYpcX4N4.js → share-852X_cqy.js} +1 -1
  246. package/dist/assets/shell-DAh545tm.js +1 -0
  247. package/dist/assets/sieve-bGkng63-.js +1 -0
  248. package/dist/assets/{skeleton-D3QPxqWC.js → skeleton-BRvjFlRu.js} +1 -1
  249. package/dist/assets/slides-DkEgzTJB.css +1 -0
  250. package/dist/assets/smalltalk-fIw53lm8.js +1 -0
  251. package/dist/assets/{snippets-panel-CXpGflMO.js → snippets-panel-YFyH2hUM.js} +1 -1
  252. package/dist/assets/sparql-CHbJrAY_.js +1 -0
  253. package/dist/assets/{spec-CzqcmYQk.js → spec-C7opZZRp.js} +1 -1
  254. package/dist/assets/{src-CIOdyciO.js → src-BSYB0gI9.js} +1 -1
  255. package/dist/assets/state-DB_fxbhn.js +3 -0
  256. package/dist/assets/{state-WBgc7MiA.js → state-DDag0B_B.js} +1 -1
  257. package/dist/assets/{state-BvdK8eiw.js → state-DFeun9PF.js} +1 -1
  258. package/dist/assets/{state-DBzEQtWz.js → state-bHyw5u3R.js} +1 -1
  259. package/dist/assets/{stateDiagram-FKZM4ZOC-Bzv6j99z.js → stateDiagram-FKZM4ZOC-z2ks4r_9.js} +1 -1
  260. package/dist/assets/stateDiagram-v2-4FDKWEC3-BApjXiT0.js +1 -0
  261. package/dist/assets/{step-CDlhJj9-.js → step-DIOVHicC.js} +1 -1
  262. package/dist/assets/{strings-Djnbwmfl.js → strings--BknHX9C.js} +1 -1
  263. package/dist/assets/stylus-3Q5WfXqT.js +1 -0
  264. package/dist/assets/swift-MKxc2knl.js +1 -0
  265. package/dist/assets/{swiper-component-DInvCxhI.js → swiper-component-C0ieyDzn.js} +1 -1
  266. package/dist/assets/switch-OVajJBPR.js +1 -0
  267. package/dist/assets/tcl-D3fKhQc_.js +1 -0
  268. package/dist/assets/{terminal-D3IQBBYo.js → terminal-D4sGJYRn.js} +1 -1
  269. package/dist/assets/textarea-DZB2bzVL.js +1 -0
  270. package/dist/assets/textile-Bi_LEJQ3.js +1 -0
  271. package/dist/assets/{time-BuRlxEhE.js → time-NXrJfoDM.js} +1 -1
  272. package/dist/assets/{timeline-definition-IT6M3QCI-DXwdU1og.js → timeline-definition-IT6M3QCI-BRuA290T.js} +1 -1
  273. package/dist/assets/toml-Dt-PBqwt.js +1 -0
  274. package/dist/assets/{tooltip-CFX4fYHU.js → tooltip-4bZlU7jl.js} +1 -1
  275. package/dist/assets/{tooltip-HLb6RxVp.js → tooltip-B7U4xkIN.js} +1 -1
  276. package/dist/assets/{tracing-CKn3gWHw.js → tracing-CDMM1BB2.js} +1 -1
  277. package/dist/assets/{tracing-panel-BU-o_LCd.js → tracing-panel-BH5Zbvl9.js} +2 -2
  278. package/dist/assets/{tree-actions-CsC2XmGo.js → tree-actions-DDveUIHK.js} +1 -1
  279. package/dist/assets/{treemap-GDKQZRPO-4Cm6HMmj.js → treemap-GDKQZRPO-DIzBBPQD.js} +1 -1
  280. package/dist/assets/troff-BSU-rxoD.js +1 -0
  281. package/dist/assets/ttcn-BmLjonVM.js +1 -0
  282. package/dist/assets/ttcn-cfg-TPTcP0Eh.js +1 -0
  283. package/dist/assets/turtle-HafmShQq.js +1 -0
  284. package/dist/assets/{useBoolean-D89u30n-.js → useBoolean-CFj86iac.js} +1 -1
  285. package/dist/assets/useCellActionButton-D5ix_g2a.js +1 -0
  286. package/dist/assets/{useDeleteCell-EPH4kcG7.js → useDeleteCell-BIopCngo.js} +1 -1
  287. package/dist/assets/{useDependencyPanelTab-CZnK7N2L.js → useDependencyPanelTab-snM337f9.js} +1 -1
  288. package/dist/assets/useEventListener-C0195JsF.js +1 -0
  289. package/dist/assets/{useHotkey-DIuRH8Wu.js → useHotkey-DLZvrRZT.js} +1 -1
  290. package/dist/assets/{useIframeCapabilities-Ccb4fvKc.js → useIframeCapabilities-j6fR_dBA.js} +1 -1
  291. package/dist/assets/{useInstallPackage-BRbUAUFn.js → useInstallPackage-WiYBwhUO.js} +1 -1
  292. package/dist/assets/{useInterval-CC0vKpWm.js → useInterval-Be6s6idX.js} +1 -1
  293. package/dist/assets/useNotebookActions-CsZfWFKy.js +12 -0
  294. package/dist/assets/{useRunCells-CSSF_mJ0.js → useRunCells-CF_V8X2K.js} +1 -1
  295. package/dist/assets/{useSplitCell-9Qz93yPZ.js → useSplitCell-BTmKY1CU.js} +1 -1
  296. package/dist/assets/{useTheme-KXqAyDPC.js → useTheme-Bxv9B31g.js} +1 -1
  297. package/dist/assets/{utils-Z80SV4_d.js → utils-BWBBpCkT.js} +1 -1
  298. package/dist/assets/vb-CUif5uGR.js +1 -0
  299. package/dist/assets/vbscript-DWVPFl59.js +1 -0
  300. package/dist/assets/{vega-component-Cie3ag_T.js → vega-component-BYd6AACD.js} +1 -1
  301. package/dist/assets/{vega-embed-container-hDAVOOba.js → vega-embed-container-CRADa99b.js} +1 -1
  302. package/dist/assets/velocity-BJl8UzB4.js +1 -0
  303. package/dist/assets/verilog-B4LUPYXy.js +1 -0
  304. package/dist/assets/vhdl-C91h3ipk.js +1 -0
  305. package/dist/assets/webidl-DOay1zbU.js +1 -0
  306. package/dist/assets/write-secret-modal-D-p66LIx.js +2 -0
  307. package/dist/assets/xquery-Cez7jD_4.js +1 -0
  308. package/dist/assets/{xychartDiagram-PRI3JC2R-Cb0exSKs.js → xychartDiagram-PRI3JC2R-BX6ICxcN.js} +1 -1
  309. package/dist/assets/yacas-CSQEXB_S.js +1 -0
  310. package/dist/assets/z80-CJbYj7Wr.js +1 -0
  311. package/dist/index.html +74 -73
  312. package/package.json +3 -4
  313. package/src/__mocks__/requests.ts +45 -4
  314. package/src/components/data-table/__tests__/__snapshots__/chart-spec-model.test.ts.snap +174 -21
  315. package/src/components/data-table/__tests__/chart-spec-model.test.ts +102 -1
  316. package/src/components/data-table/column-summary/chart-spec-model.tsx +163 -103
  317. package/src/components/data-table/column-summary/legacy-chart-spec.ts +15 -7
  318. package/src/components/data-table/column-summary/utils.ts +26 -7
  319. package/src/components/data-table/types.ts +1 -1
  320. package/src/components/editor/__tests__/viewer-banner.test.tsx +14 -0
  321. package/src/components/editor/actions/__tests__/pair-with-agent-commands.test.ts +99 -18
  322. package/src/components/editor/actions/__tests__/pdf-export.test.ts +32 -13
  323. package/src/components/editor/actions/pair-with-agent-commands.ts +21 -10
  324. package/src/components/editor/actions/pair-with-agent-modal.tsx +2 -2
  325. package/src/components/editor/actions/pdf-export.ts +11 -14
  326. package/src/components/editor/actions/useNotebookActions.tsx +18 -18
  327. package/src/components/editor/cell/code/__tests__/cell-editor-activity-lifecycle.test.ts +250 -0
  328. package/src/components/editor/cell/code/cell-editor.tsx +13 -7
  329. package/src/components/editor/chrome/panels/__tests__/logs-panel.test.tsx +25 -0
  330. package/src/components/editor/chrome/panels/logs-panel.tsx +12 -2
  331. package/src/components/editor/chrome/panels/write-secret-modal.tsx +40 -12
  332. package/src/components/editor/connections/__tests__/json-credentials.test.ts +114 -0
  333. package/src/components/editor/connections/__tests__/paths.test.ts +39 -0
  334. package/src/components/editor/connections/components.tsx +6 -2
  335. package/src/components/editor/connections/database/__tests__/__snapshots__/as-code.test.ts.snap +21 -5
  336. package/src/components/editor/connections/database/__tests__/as-code.test.ts +17 -0
  337. package/src/components/editor/connections/database/as-code.ts +16 -2
  338. package/src/components/editor/connections/database/schemas.ts +6 -5
  339. package/src/components/editor/connections/form-renderers.tsx +99 -1
  340. package/src/components/editor/connections/json-credentials.ts +57 -0
  341. package/src/components/editor/connections/paths.ts +21 -0
  342. package/src/components/editor/connections/secret-combobox.tsx +41 -20
  343. package/src/components/editor/connections/storage/__tests__/__snapshots__/as-code.test.ts.snap +88 -2
  344. package/src/components/editor/connections/storage/__tests__/as-code.test.ts +128 -8
  345. package/src/components/editor/connections/storage/as-code.ts +79 -36
  346. package/src/components/editor/connections/storage/schemas.ts +85 -44
  347. package/src/components/editor/file-tree/__tests__/renderers.test.ts +31 -0
  348. package/src/components/editor/file-tree/file-viewer.tsx +11 -7
  349. package/src/components/editor/file-tree/renderers.tsx +21 -0
  350. package/src/components/editor/renderers/vertical-layout/vertical-layout.tsx +1 -1
  351. package/src/components/editor/viewer-banner.tsx +6 -1
  352. package/src/components/forms/options.ts +2 -1
  353. package/src/components/slides/__tests__/cell-output-block.test.tsx +40 -0
  354. package/src/components/slides/__tests__/slide-cell-view.test.tsx +33 -0
  355. package/src/components/slides/__tests__/slide-scroll-hint.test.tsx +198 -0
  356. package/src/components/slides/reveal-component.tsx +25 -19
  357. package/src/components/slides/slide-cell-view.tsx +1 -1
  358. package/src/components/slides/slide-scroll-hint.tsx +161 -0
  359. package/src/components/slides/slides.css +4 -2
  360. package/src/components/static-html/share-modal.tsx +1 -1
  361. package/src/components/ui/input.tsx +1 -1
  362. package/src/core/ai/context/providers/file.ts +8 -29
  363. package/src/core/cells/__tests__/cells.test.ts +12 -2
  364. package/src/core/cells/__tests__/logs.test.ts +5 -5
  365. package/src/core/cells/cells.ts +17 -4
  366. package/src/core/cells/document-changes.ts +1 -0
  367. package/src/core/cells/logs.ts +14 -4
  368. package/src/core/codemirror/copilot/__tests__/language-server.test.ts +396 -100
  369. package/src/core/codemirror/copilot/__tests__/transport.test.ts +128 -540
  370. package/src/core/codemirror/copilot/language-server.ts +182 -70
  371. package/src/core/codemirror/copilot/transport.ts +15 -207
  372. package/src/core/codemirror/copilot/types.ts +9 -2
  373. package/src/core/codemirror/find-replace/__tests__/navigate.test.ts +42 -30
  374. package/src/core/codemirror/find-replace/navigate.ts +2 -0
  375. package/src/core/codemirror/go-to-definition/__tests__/commands.test.ts +24 -3
  376. package/src/core/codemirror/go-to-definition/commands.ts +3 -0
  377. package/src/core/codemirror/keymaps/__tests__/keymaps.test.ts +31 -2
  378. package/src/core/codemirror/keymaps/keymaps.ts +12 -0
  379. package/src/core/codemirror/language/__tests__/sql.test.ts +443 -61
  380. package/src/core/codemirror/language/languages/python.ts +23 -11
  381. package/src/core/codemirror/language/languages/sql/completion-store.ts +5 -1
  382. package/src/core/codemirror/language/languages/sql/sql.ts +210 -3
  383. package/src/core/codemirror/lsp/__tests__/federated-lsp.test.ts +161 -0
  384. package/src/core/codemirror/lsp/__tests__/log-messages.test.ts +53 -0
  385. package/src/core/codemirror/lsp/__tests__/normalize-markdown-math.test.ts +25 -0
  386. package/src/core/codemirror/lsp/__tests__/notebook-lsp.test.ts +598 -156
  387. package/src/core/codemirror/lsp/__tests__/transports.test.ts +112 -0
  388. package/src/core/codemirror/lsp/federated-lsp.ts +76 -23
  389. package/src/core/codemirror/lsp/log-messages.ts +37 -0
  390. package/src/core/codemirror/lsp/normalize-markdown-math.ts +8 -4
  391. package/src/core/codemirror/lsp/notebook-lsp.ts +220 -56
  392. package/src/core/codemirror/lsp/transports.ts +8 -1
  393. package/src/core/codemirror/lsp/types.ts +68 -8
  394. package/src/core/codemirror/lsp/utils.ts +14 -0
  395. package/src/core/codemirror/utils.ts +28 -0
  396. package/src/core/edit-app.tsx +1 -2
  397. package/src/core/export/__tests__/hooks.test.ts +2 -4
  398. package/src/core/export/hooks.ts +4 -3
  399. package/src/core/hotkeys/hotkeys.ts +0 -2
  400. package/src/core/islands/__tests__/bridge.test.ts +107 -0
  401. package/src/core/islands/bridge.ts +16 -0
  402. package/src/core/lsp/__tests__/transport.test.ts +509 -337
  403. package/src/core/lsp/transport.ts +304 -132
  404. package/src/core/mode.ts +10 -0
  405. package/src/core/network/__tests__/api.test.ts +42 -0
  406. package/src/core/network/__tests__/connection.test.ts +45 -0
  407. package/src/core/network/__tests__/requests-lazy.test.ts +32 -1
  408. package/src/core/network/__tests__/requests-network.test.ts +21 -0
  409. package/src/core/network/api.ts +27 -0
  410. package/src/core/network/connection.ts +15 -0
  411. package/src/core/network/requests-lazy.ts +1 -0
  412. package/src/core/network/requests-network.ts +14 -8
  413. package/src/core/network/requests-static.ts +1 -0
  414. package/src/core/network/requests-toasting.tsx +1 -0
  415. package/src/core/network/types.ts +22 -6
  416. package/src/core/rtc/state.ts +9 -0
  417. package/src/core/static/download-html.ts +5 -14
  418. package/src/core/wasm/bridge.ts +4 -2
  419. package/src/core/wasm/worker/types.ts +5 -2
  420. package/src/css/app/codemirror.css +16 -2
  421. package/src/plugins/impl/FormPlugin.tsx +1 -1
  422. package/src/plugins/impl/__tests__/FormPlugin.test.tsx +162 -0
  423. package/src/stories/log-viewer.stories.tsx +12 -6
  424. package/src/utils/__tests__/blob.test.ts +27 -1
  425. package/src/utils/__tests__/download.test.tsx +44 -4
  426. package/src/utils/blob.ts +24 -1
  427. package/src/utils/download.ts +14 -15
  428. package/dist/assets/JsonOutput-CkCD-FgM.js +0 -53
  429. package/dist/assets/LazyAnyLanguageCodeMirror-sVm_hz8A.js +0 -2
  430. package/dist/assets/RenderHTML-BCvU9dYz.js +0 -1
  431. package/dist/assets/add-connection-dialog-B-jCRNTN.js +0 -170
  432. package/dist/assets/ai-model-dropdown-DXgLphFa.js +0 -5
  433. package/dist/assets/apl-DTwRFDps.js +0 -1
  434. package/dist/assets/app-config-button-NrM9ywXA.js +0 -1
  435. package/dist/assets/asciiarmor-CiqkDK0s.js +0 -1
  436. package/dist/assets/asn1-RTvH5MEs.js +0 -1
  437. package/dist/assets/blob-C3EfaMOb.js +0 -1
  438. package/dist/assets/brainfuck-szH_VGzd.js +0 -1
  439. package/dist/assets/cell-link-DqBkyAFe.js +0 -1
  440. package/dist/assets/cells-Cf7bHHq3.js +0 -229
  441. package/dist/assets/channel-D-k8o3T1.js +0 -1
  442. package/dist/assets/chunk-55IACEB6-xhaY4LU6.js +0 -1
  443. package/dist/assets/classDiagram-2ON5EDUG-C-rIg7EQ.js +0 -1
  444. package/dist/assets/classDiagram-v2-WZHVMYZB-MBAsRLae.js +0 -1
  445. package/dist/assets/clojure-CyEbLmch.js +0 -1
  446. package/dist/assets/cmake-Dk8f7QuI.js +0 -1
  447. package/dist/assets/cobol-BJJRqW1D.js +0 -1
  448. package/dist/assets/coffeescript-BDuWJ9WO.js +0 -1
  449. package/dist/assets/commonlisp-CVHm2VSp.js +0 -1
  450. package/dist/assets/components-BH6gDVv6.js +0 -1
  451. package/dist/assets/config-BbOTTCYY.js +0 -1
  452. package/dist/assets/crystal-C2Fgr79A.js +0 -1
  453. package/dist/assets/cypher-CUlCm6vR.js +0 -1
  454. package/dist/assets/d-4ANEHA6q.js +0 -1
  455. package/dist/assets/diff-C-W-5V8L.js +0 -1
  456. package/dist/assets/dist-BCMBu0rO.js +0 -2
  457. package/dist/assets/dist-CCAhuqF-.js +0 -1
  458. package/dist/assets/dist-DGhK0kPE.js +0 -1
  459. package/dist/assets/dist-SVDIDTM2.js +0 -1
  460. package/dist/assets/dist-xSLg7wNV.js +0 -1
  461. package/dist/assets/download-BomYt3nl.js +0 -9
  462. package/dist/assets/dtd-D9h-tL8G.js +0 -1
  463. package/dist/assets/dylan-D3MC56xy.js +0 -1
  464. package/dist/assets/ecl-B6UC4tME.js +0 -1
  465. package/dist/assets/eiffel-CjvEov4k.js +0 -1
  466. package/dist/assets/elm-DvSbvRWe.js +0 -1
  467. package/dist/assets/erlang-DJYaGXyq.js +0 -1
  468. package/dist/assets/error-entries-Birw-8VX.js +0 -8
  469. package/dist/assets/factor-CUQCrkTo.js +0 -1
  470. package/dist/assets/file-explorer-panel-Ntq1-VbF.js +0 -26
  471. package/dist/assets/floating-outline-wz-WSRgP.js +0 -1
  472. package/dist/assets/focus-DiEyfiAG.js +0 -1
  473. package/dist/assets/forth-D9xegiCO.js +0 -1
  474. package/dist/assets/fortran-B0Oe0U8s.js +0 -1
  475. package/dist/assets/gas-jLjj-PIq.js +0 -1
  476. package/dist/assets/gherkin-3Ig8Crit.js +0 -1
  477. package/dist/assets/groovy-NKpNVJ-n.js +0 -1
  478. package/dist/assets/haskell-OPE4bAjk.js +0 -1
  479. package/dist/assets/haxe-DEAZF8L3.js +0 -1
  480. package/dist/assets/home-page-DJ4jJsZj.js +0 -4
  481. package/dist/assets/idl-BM6265Xl.js +0 -1
  482. package/dist/assets/index-A71LAt6h.css +0 -2
  483. package/dist/assets/index-CMZzy-dF.js +0 -38
  484. package/dist/assets/infoDiagram-HS3SLOUP-DQnMjKYJ.js +0 -2
  485. package/dist/assets/javascript-CZ9vDpAy.js +0 -1
  486. package/dist/assets/julia-BrY9TQnt.js +0 -1
  487. package/dist/assets/katex-C-lfa1AM.js +0 -1
  488. package/dist/assets/kiosk-mode-ABm3oYgq.js +0 -1
  489. package/dist/assets/livescript-CNahkUp5.js +0 -1
  490. package/dist/assets/logs-panel-iFV4ZJ9b.js +0 -1
  491. package/dist/assets/lua-Skr4TVu_.js +0 -1
  492. package/dist/assets/mathematica-BXxhrpeY.js +0 -1
  493. package/dist/assets/mbox-BRrQCVe9.js +0 -1
  494. package/dist/assets/mirc-CffYPE4R.js +0 -1
  495. package/dist/assets/mllike-C1DLZhEI.js +0 -1
  496. package/dist/assets/modelica-CvAyRRNV.js +0 -1
  497. package/dist/assets/mscgen-uMZWtMZv.js +0 -1
  498. package/dist/assets/mumps-DFJehEx7.js +0 -1
  499. package/dist/assets/node-sql-parser-BWgUjcfV.js +0 -68
  500. package/dist/assets/nsis-BVI9YULz.js +0 -1
  501. package/dist/assets/ntriples-Bcdh7b2H.js +0 -1
  502. package/dist/assets/octave-CdAKz6YS.js +0 -1
  503. package/dist/assets/oz-DSySeR-W.js +0 -1
  504. package/dist/assets/pair-with-agent-modal-CKOYwOYw.js +0 -4
  505. package/dist/assets/panels-Dj45fW-v.js +0 -4
  506. package/dist/assets/pascal-DefziIUN.js +0 -1
  507. package/dist/assets/perl-BOOloBPk.js +0 -1
  508. package/dist/assets/pig-f0nBb-5x.js +0 -1
  509. package/dist/assets/powershell-DToQjbK9.js +0 -1
  510. package/dist/assets/process-output-BEhIGfkO.js +0 -1
  511. package/dist/assets/properties-BRob-nyj.js +0 -1
  512. package/dist/assets/protobuf-DZyC6051.js +0 -1
  513. package/dist/assets/pug-pVoM8FRt.js +0 -1
  514. package/dist/assets/puppet-9fuYG07F.js +0 -1
  515. package/dist/assets/python-_Mr8fyXP.js +0 -1
  516. package/dist/assets/q-D73s4Y77.js +0 -1
  517. package/dist/assets/r-BOEjz92e.js +0 -1
  518. package/dist/assets/rpm-LpXWTM5t.js +0 -1
  519. package/dist/assets/ruby-DodgSDfF.js +0 -1
  520. package/dist/assets/sas-D9KCtUmL.js +0 -1
  521. package/dist/assets/scheme-p8UJxmJw.js +0 -1
  522. package/dist/assets/scratchpad-panel-B0mEqBNk.js +0 -1
  523. package/dist/assets/session-panel-Y0Oon0sD.js +0 -1
  524. package/dist/assets/shell-BWdqyqwL.js +0 -1
  525. package/dist/assets/sieve-CLwJmtiQ.js +0 -1
  526. package/dist/assets/slides-MCbMDtlY.css +0 -1
  527. package/dist/assets/smalltalk-D3KV-Qah.js +0 -1
  528. package/dist/assets/sparql-D9Jz2mBw.js +0 -1
  529. package/dist/assets/state-BZQc7xxL.js +0 -3
  530. package/dist/assets/stateDiagram-v2-4FDKWEC3-CA1l0rNa.js +0 -1
  531. package/dist/assets/stylus-ClN4l_XO.js +0 -1
  532. package/dist/assets/swift-Dvd_9xBv.js +0 -1
  533. package/dist/assets/switch-CvweaCXq.js +0 -1
  534. package/dist/assets/tcl-DR2p8cyi.js +0 -1
  535. package/dist/assets/textarea-CpFfEUet.js +0 -1
  536. package/dist/assets/textile-D6S27_J2.js +0 -1
  537. package/dist/assets/toml-B-YuQ2Id.js +0 -1
  538. package/dist/assets/troff-HSk8AoRF.js +0 -1
  539. package/dist/assets/ttcn-CehzlVdx.js +0 -1
  540. package/dist/assets/ttcn-cfg-CLEPwk1s.js +0 -1
  541. package/dist/assets/turtle-DQLHkbOu.js +0 -1
  542. package/dist/assets/useCellActionButton-CRfIEVB5.js +0 -1
  543. package/dist/assets/useEventListener-B_w3A283.js +0 -1
  544. package/dist/assets/useNotebookActions-DTXAoukG.js +0 -12
  545. package/dist/assets/vb-o1EHrS4z.js +0 -1
  546. package/dist/assets/vbscript-BS8yUFpf.js +0 -1
  547. package/dist/assets/velocity-u_oGPFaA.js +0 -1
  548. package/dist/assets/verilog-CSmDH7su.js +0 -1
  549. package/dist/assets/vhdl-BCaWLcjw.js +0 -1
  550. package/dist/assets/webidl-Bf6dokXM.js +0 -1
  551. package/dist/assets/write-secret-modal-DEEn7sZV.js +0 -1
  552. package/dist/assets/xquery-Di0kkiXg.js +0 -1
  553. package/dist/assets/yacas-DB8tPtyp.js +0 -1
  554. package/dist/assets/z80-DFUvlWxk.js +0 -1
  555. /package/dist/assets/{ImageComparisonComponent-Cz3xVDLH.js → ImageComparisonComponent-HnxpPJnM.js} +0 -0
  556. /package/dist/assets/{Inputs-B8-VCb_j.js → Inputs-BhvqLBkk.js} +0 -0
  557. /package/dist/assets/{Plot-X2G47XHf.js → Plot-Df7XX6zz.js} +0 -0
  558. /package/dist/assets/{apl-DVqFAlEd.js → apl-CPlG1HX3.js} +0 -0
  559. /package/dist/assets/{array-Ddg9CgJT.js → array-DkMvCrqF.js} +0 -0
  560. /package/dist/assets/{asciiarmor-B45BhOLj.js → asciiarmor-DV_pcocJ.js} +0 -0
  561. /package/dist/assets/{asn1-C4T2ctU6.js → asn1-DPxWcGvG.js} +0 -0
  562. /package/dist/assets/{asterisk-9U_4Kgke.js → asterisk-Di-nanOd.js} +0 -0
  563. /package/dist/assets/{azure-nN8APleF.js → azure-BjL5s4-w.js} +0 -0
  564. /package/dist/assets/{brainfuck-kVh8Eud4.js → brainfuck-CGDdBVNO.js} +0 -0
  565. /package/dist/assets/{card-VUBaYDpT.js → card-DIbLM4TA.js} +0 -0
  566. /package/dist/assets/{chunk-4F5CHEZ2-ClSh5rxG.js → chunk-4F5CHEZ2-yOSqdjGN.js} +0 -0
  567. /package/dist/assets/{chunk-B2363JML-cit0ouFv.js → chunk-B2363JML-BqlxcdFI.js} +0 -0
  568. /package/dist/assets/{chunk-DR5Q36YT-Bsu9Glc0.js → chunk-DR5Q36YT-9bsCT1tL.js} +0 -0
  569. /package/dist/assets/{chunk-FRFDVMJY--Re1QfFE.js → chunk-FRFDVMJY-DW58IWII.js} +0 -0
  570. /package/dist/assets/{chunk-PL6DKKU2-CAwRAr-p.js → chunk-PL6DKKU2-CiPkyomE.js} +0 -0
  571. /package/dist/assets/{chunk-SJTYNZTY-G1spWesO.js → chunk-SJTYNZTY-UJLIXgY2.js} +0 -0
  572. /package/dist/assets/{chunk-TQ3KTPDO-DBwra5xv.js → chunk-TQ3KTPDO-DQFcRP5c.js} +0 -0
  573. /package/dist/assets/{chunk-UMXZTB3W-A5RvYDPE.js → chunk-UMXZTB3W-cibob28z.js} +0 -0
  574. /package/dist/assets/{clear-button-DQtvx6eq.js → clear-button-Bsxh4lx1.js} +0 -0
  575. /package/dist/assets/{click-outside-container-CrWZsAF5.js → click-outside-container-LfSB2_ne.js} +0 -0
  576. /package/dist/assets/{clike-O0gwXilc.js → clike-D91DrsBh.js} +0 -0
  577. /package/dist/assets/{clojure-CsbMWxp9.js → clojure-B0eb_-2q.js} +0 -0
  578. /package/dist/assets/{cmake-FpJvOdyj.js → cmake-COzUvjiS.js} +0 -0
  579. /package/dist/assets/{cobol-Duxbpsru.js → cobol-DW4FSnmb.js} +0 -0
  580. /package/dist/assets/{coffeescript-D-Unz9IP.js → coffeescript-CommR2mv.js} +0 -0
  581. /package/dist/assets/{colors-C_0lIznd.js → colors-CyQT5OPu.js} +0 -0
  582. /package/dist/assets/{common-keywords-PqH2GDfH.js → common-keywords-Bk-0jOKl.js} +0 -0
  583. /package/dist/assets/{commonlisp-_nR12oc7.js → commonlisp-FR_N9RJL.js} +0 -0
  584. /package/dist/assets/{crystal-dj3W4b1A.js → crystal-CAN7bz25.js} +0 -0
  585. /package/dist/assets/{css-0BG6A_BC.js → css-DmLg8a0m.js} +0 -0
  586. /package/dist/assets/{cypher-CKPokaoH.js → cypher-BzSJn05x.js} +0 -0
  587. /package/dist/assets/{cytoscape.esm-DzUNSF80.js → cytoscape.esm-CVhOSlMZ.js} +0 -0
  588. /package/dist/assets/{d-BrbqzVa2.js → d-UpmnByGo.js} +0 -0
  589. /package/dist/assets/{diff-BmdR9FsO.js → diff-DRpitNo9.js} +0 -0
  590. /package/dist/assets/{dist-CM-lWxt3.js → dist-1DJkf78n.js} +0 -0
  591. /package/dist/assets/{dist-ByK00N0T.js → dist-6KRysbQA.js} +0 -0
  592. /package/dist/assets/{dist-98K4fusX.js → dist-8H9kNP92.js} +0 -0
  593. /package/dist/assets/{dist-OgwOt8T2.js → dist-8lZYHUSx.js} +0 -0
  594. /package/dist/assets/{dist-DNGKAtWk.js → dist-B4sFEC9P.js} +0 -0
  595. /package/dist/assets/{dist-BaKJ0-Tb.js → dist-B5BlmbY-.js} +0 -0
  596. /package/dist/assets/{dist-CpbbK4-I.js → dist-BDUj3vkc.js} +0 -0
  597. /package/dist/assets/{dist-3N7-WLqi.js → dist-C13NfWpP.js} +0 -0
  598. /package/dist/assets/{dist-DokId-qM.js → dist-C3XTRycV.js} +0 -0
  599. /package/dist/assets/{dist-56ul6-mm.js → dist-C6uSSUmH.js} +0 -0
  600. /package/dist/assets/{dist-D5ToCtv8.js → dist-CDFlR-dv.js} +0 -0
  601. /package/dist/assets/{dist-DzAAhYcW.js → dist-CaADT3TK.js} +0 -0
  602. /package/dist/assets/{dist-B8g3pNYJ.js → dist-CbTMGxEf.js} +0 -0
  603. /package/dist/assets/{dist-O5-NiN3f.js → dist-CjpCHqUI.js} +0 -0
  604. /package/dist/assets/{dist-D9sE1udr.js → dist-D0BTeZL0.js} +0 -0
  605. /package/dist/assets/{dist-DrtRBAn8.js → dist-DE4Vb9tO.js} +0 -0
  606. /package/dist/assets/{dist-D35OyUMQ.js → dist-DYsXEge_.js} +0 -0
  607. /package/dist/assets/{dist-C5kf6g-d.js → dist-lCLEUACp.js} +0 -0
  608. /package/dist/assets/{dtd-DbCXDVgi.js → dtd-CQV9N2ok.js} +0 -0
  609. /package/dist/assets/{duckdb-keywords-mPlR0SxW.js → duckdb-keywords-CqO5LWsh.js} +0 -0
  610. /package/dist/assets/{dylan-CLLzL2Js.js → dylan-Bp98yT5y.js} +0 -0
  611. /package/dist/assets/{ebnf-Cnws41cu.js → ebnf-DoGvzVmX.js} +0 -0
  612. /package/dist/assets/{ecl-BC7x2nzk.js → ecl-BgtQ3zu5.js} +0 -0
  613. /package/dist/assets/{eiffel-CDU836rz.js → eiffel-Cu14O7Gi.js} +0 -0
  614. /package/dist/assets/{elm-D-_bXARs.js → elm-Dp1dn40k.js} +0 -0
  615. /package/dist/assets/{empty-state-CqJvEFRk.js → empty-state-yX2_pzkH.js} +0 -0
  616. /package/dist/assets/{erlang-CwDZk2zM.js → erlang-DdogJjdp.js} +0 -0
  617. /package/dist/assets/{esm-D6WfbcL3.js → esm-DZILy413.js} +0 -0
  618. /package/dist/assets/{fcl-CwkPc-_9.js → fcl-CTs4ROWI.js} +0 -0
  619. /package/dist/assets/{forth-D6FsO_8x.js → forth-Dd0r86IP.js} +0 -0
  620. /package/dist/assets/{fortran-D4BMbIkG.js → fortran-4qvtlW4z.js} +0 -0
  621. /package/dist/assets/{gas-JFjzcgdY.js → gas-DqwqZHXy.js} +0 -0
  622. /package/dist/assets/{gherkin-Cyu-qGaF.js → gherkin-DMxJEDh5.js} +0 -0
  623. /package/dist/assets/{github-_JH-0hIO.js → github-kTVN-x1m.js} +0 -0
  624. /package/dist/assets/{groovy-CZaE9eN-.js → groovy-DA_MxBua.js} +0 -0
  625. /package/dist/assets/{haskell-Dc6o0IGr.js → haskell-B_hi8VEK.js} +0 -0
  626. /package/dist/assets/{haxe-Bsf0tzqs.js → haxe-D-I6YeRN.js} +0 -0
  627. /package/dist/assets/{http-BQNSD-HR.js → http-Ci3E2pzn.js} +0 -0
  628. /package/dist/assets/{idl-1W91kQ8_.js → idl-CteRrHSs.js} +0 -0
  629. /package/dist/assets/{init-nx27Zb9l.js → init-CYoUL2Ak.js} +0 -0
  630. /package/dist/assets/{javascript-BZ81-2rO.js → javascript-Cq9DsvSW.js} +0 -0
  631. /package/dist/assets/{julia-BZOsq0r_.js → julia-bHGj6eLp.js} +0 -0
  632. /package/dist/assets/{katex-CvZ3kCGk.js → katex-BKFLE8En.js} +0 -0
  633. /package/dist/assets/{livescript-CNZfmikk.js → livescript-C72YlTeO.js} +0 -0
  634. /package/dist/assets/{loro_wasm_bg-RNUly1SE.js → loro_wasm_bg-aCH66ryB.js} +0 -0
  635. /package/dist/assets/{lua-DXGRliwd.js → lua-DAtJrHXr.js} +0 -0
  636. /package/dist/assets/{marimo-icons-C_nFooxr.js → marimo-icons-Bq_N9GGs.js} +0 -0
  637. /package/dist/assets/{math-CLO4uoaP.js → math-D6WZfqI3.js} +0 -0
  638. /package/dist/assets/{mathematica-BoUj8M7D.js → mathematica-DGp7b8Lx.js} +0 -0
  639. /package/dist/assets/{mbox-DLVP8LAe.js → mbox-C35KjfEV.js} +0 -0
  640. /package/dist/assets/{mirc-kI4d5fMu.js → mirc-BRCHEPv1.js} +0 -0
  641. /package/dist/assets/{mllike-CD9vBc_2.js → mllike-D7ajla-U.js} +0 -0
  642. /package/dist/assets/{modelica-DgfsLJuF.js → modelica-0RGVL4ie.js} +0 -0
  643. /package/dist/assets/{mscgen-B1HDwshJ.js → mscgen-C7Ohs4Tl.js} +0 -0
  644. /package/dist/assets/{multi-icon-nrKPWjDU.js → multi-icon-C2ijLyOs.js} +0 -0
  645. /package/dist/assets/{mumps-D_-b9TZD.js → mumps-Cgag5Xef.js} +0 -0
  646. /package/dist/assets/{nginx-Cm282mo8.js → nginx-k5GTB7o1.js} +0 -0
  647. /package/dist/assets/{ntriples-COX9JFZ8.js → ntriples-oQv5c69K.js} +0 -0
  648. /package/dist/assets/{octave-BejycR79.js → octave-BMTXs4lo.js} +0 -0
  649. /package/dist/assets/{oz-CFFivrGn.js → oz-CuHYwo8r.js} +0 -0
  650. /package/dist/assets/{panel-context-CH75ubGG.js → panel-context-CmeYEpWr.js} +0 -0
  651. /package/dist/assets/{pascal-B_p9jkCs.js → pascal-eFKoVV2p.js} +0 -0
  652. /package/dist/assets/{path-Bz_hIzg5.js → path-BcLO3NWe.js} +0 -0
  653. /package/dist/assets/{pathUtils-Bfcp5m-a.js → pathUtils-BbJtW9Mp.js} +0 -0
  654. /package/dist/assets/{perl-C-SFBTly.js → perl-B1OqOW8w.js} +0 -0
  655. /package/dist/assets/{pig-BhxDMp2k.js → pig-gIrBDx27.js} +0 -0
  656. /package/dist/assets/{powershell-c59M-9N2.js → powershell-3fQF2XND.js} +0 -0
  657. /package/dist/assets/{properties-D1JNwCKy.js → properties-D4HHpZmU.js} +0 -0
  658. /package/dist/assets/{protobuf-DQS7ex8R.js → protobuf-DFSTKR0L.js} +0 -0
  659. /package/dist/assets/{puppet-DaQvhvew.js → puppet-BAISgXk9.js} +0 -0
  660. /package/dist/assets/{python-XHl3eRTS.js → python-mPctBCbA.js} +0 -0
  661. /package/dist/assets/{q-DppnoRE3.js → q-CYeV5Dbb.js} +0 -0
  662. /package/dist/assets/{r-D8-F_FWj.js → r-Ds4UrjIV.js} +0 -0
  663. /package/dist/assets/{request-registry-DHocQ_4I.js → request-registry-CEkYnwgr.js} +0 -0
  664. /package/dist/assets/{requests-DYeT4CEe.js → requests-CIR84T8A.js} +0 -0
  665. /package/dist/assets/{rpm-CegJhNNO.js → rpm-DV5-r6dM.js} +0 -0
  666. /package/dist/assets/{ruby-YMIxufV1.js → ruby-B9qrycrI.js} +0 -0
  667. /package/dist/assets/{sas-wTtX9UIQ.js → sas-Cd7L1ZOe.js} +0 -0
  668. /package/dist/assets/{scheme-BGenom3k.js → scheme-L6Kva-Kc.js} +0 -0
  669. /package/dist/assets/{semaphore-DtBYRzWS.js → semaphore-YOr3WMiw.js} +0 -0
  670. /package/dist/assets/{shell-Bu1sLaiP.js → shell-Ck42V1Kn.js} +0 -0
  671. /package/dist/assets/{sieve-ffe6rUQh.js → sieve-DfSJcUfS.js} +0 -0
  672. /package/dist/assets/{simple-mode-DBSzUJLA.js → simple-mode-CfoR0Lvg.js} +0 -0
  673. /package/dist/assets/{smalltalk-NU5EGjHp.js → smalltalk-CT418Iph.js} +0 -0
  674. /package/dist/assets/{solr-ptw1yIqO.js → solr-DfAVBX8L.js} +0 -0
  675. /package/dist/assets/{sparql-uqVktnwO.js → sparql-BlJ_cLEt.js} +0 -0
  676. /package/dist/assets/{spreadsheet-VEzeu_mb.js → spreadsheet-Qy1VjLDU.js} +0 -0
  677. /package/dist/assets/{sql-tYjnWETe.js → sql-BAkD7JGK.js} +0 -0
  678. /package/dist/assets/{src-BshXgZd4.js → src-Dlf0iGaF.js} +0 -0
  679. /package/dist/assets/{stylus-B2E6Ulaz.js → stylus-92qIiGm1.js} +0 -0
  680. /package/dist/assets/{swift-Rmnn7ATv.js → swift-gZzicbJu.js} +0 -0
  681. /package/dist/assets/{tcl-ZPWCn2nn.js → tcl-CtgoBYkk.js} +0 -0
  682. /package/dist/assets/{textile-uhA33kFk.js → textile-Du3RzJ2D.js} +0 -0
  683. /package/dist/assets/{tiddlywiki-CPkGLyXH.js → tiddlywiki-CL3W3RpP.js} +0 -0
  684. /package/dist/assets/{tiki-BtjLo8OF.js → tiki-2L3jCwab.js} +0 -0
  685. /package/dist/assets/{timer-VYMLXPue.js → timer-DLLzXmjF.js} +0 -0
  686. /package/dist/assets/{toml-BFZv2Mv7.js → toml-HcF44TVB.js} +0 -0
  687. /package/dist/assets/{treemap-Bca0xNNq.js → treemap-BdaAyoGw.js} +0 -0
  688. /package/dist/assets/{troff-B5eayHop.js → troff-xbwT4huN.js} +0 -0
  689. /package/dist/assets/{ttcn-cfg-CfbkL3Q_.js → ttcn-cfg-jWDg1i50.js} +0 -0
  690. /package/dist/assets/{ttcn-BM0Yp8NY.js → ttcn-phKysj_0.js} +0 -0
  691. /package/dist/assets/{turtle-DvetLxrv.js → turtle-CPC48wcy.js} +0 -0
  692. /package/dist/assets/{types-Da7lA5YC.js → types-C7hjolXC.js} +0 -0
  693. /package/dist/assets/{use-vega-container-remeasure-CbKTb_jy.js → use-vega-container-remeasure-0GBen_rR.js} +0 -0
  694. /package/dist/assets/{vb-i5Z8scch.js → vb-BTubZ2rB.js} +0 -0
  695. /package/dist/assets/{vbscript-BiPYgIyi.js → vbscript-B52mDFWM.js} +0 -0
  696. /package/dist/assets/{velocity-Dw3R3YoX.js → velocity-BO3M1iFD.js} +0 -0
  697. /package/dist/assets/{verilog-B8FhJcX6.js → verilog-CBz90JJu.js} +0 -0
  698. /package/dist/assets/{vhdl-BqPEoXdJ.js → vhdl-CeQ1lGlV.js} +0 -0
  699. /package/dist/assets/{web-vitals-CwE0GGzl.js → web-vitals-Q0-_CtWm.js} +0 -0
  700. /package/dist/assets/{webidl-mMO-qW5Q.js → webidl-CRtF5pmu.js} +0 -0
  701. /package/dist/assets/{ws-BmTnbVEi.js → ws-CNqquaud.js} +0 -0
  702. /package/dist/assets/{xquery-DvqNwq7L.js → xquery-CFnbrHav.js} +0 -0
  703. /package/dist/assets/{yacas-Dku9Z6Kf.js → yacas-KIC_JO6M.js} +0 -0
  704. /package/dist/assets/{z80-DvazU5Tr.js → z80-kGpw5_me.js} +0 -0
@@ -1,229 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./esm-D6WfbcL3.js","./chunk-LvLJmgfZ.js","./dist-D6Iobl3P.js","./dist-DI1-Z60I.js","./dist-DYEuVkEX.js","./dist-12S8I4CH.js","./dist-DGhK0kPE.js","./dist-D5ToCtv8.js","./dist-Bfm9U3vp.js","./dist-BJZAIIze.js","./dist-CECF_J8y.js","./dist-D35OyUMQ.js","./dist-Csf5i4KY.js","./dist-DnjsPBRJ.js","./dist-aRc_dRed.js","./dist-xSLg7wNV.js","./dist-ByK00N0T.js","./dist-DrBqBDHF.js","./dist-BMOD2Pyh.js","./dist-DokId-qM.js","./dist-CDUl-YL4.js","./dist-C5kf6g-d.js","./dist-sPfKr-vH.js","./dist-98K4fusX.js","./dist-CRrIf3gB.js","./dist-OgwOt8T2.js","./dist-CvWC93qL.js","./dist-DcwTQG1A.js","./dist-R1kU4nzJ.js","./dist-BaKJ0-Tb.js","./dist-DsfPGbgk.js","./dist-CPjTeT8p.js","./dist-CCAhuqF-.js","./dist-DNGKAtWk.js","./dist-0QUuSoRx.js","./dist-56ul6-mm.js","./dist-SVDIDTM2.js","./dist-CpbbK4-I.js","./dist-BsphJPAV.js","./dist-3N7-WLqi.js","./dist-6c4zOh78.js","./dist-CM-lWxt3.js","./apl-DTwRFDps.js","./apl-DVqFAlEd.js","./asciiarmor-CiqkDK0s.js","./asciiarmor-B45BhOLj.js","./asn1-RTvH5MEs.js","./asn1-C4T2ctU6.js","./brainfuck-szH_VGzd.js","./brainfuck-kVh8Eud4.js","./cobol-BJJRqW1D.js","./cobol-Duxbpsru.js","./clike-DKPr2D1_.js","./clike-O0gwXilc.js","./clojure-CyEbLmch.js","./clojure-CsbMWxp9.js","./css-DsUcFZz8.js","./css-0BG6A_BC.js","./cmake-Dk8f7QuI.js","./cmake-FpJvOdyj.js","./coffeescript-BDuWJ9WO.js","./coffeescript-D-Unz9IP.js","./commonlisp-CVHm2VSp.js","./commonlisp-_nR12oc7.js","./cypher-CUlCm6vR.js","./cypher-CKPokaoH.js","./python-_Mr8fyXP.js","./python-XHl3eRTS.js","./crystal-C2Fgr79A.js","./crystal-dj3W4b1A.js","./d-4ANEHA6q.js","./d-BrbqzVa2.js","./diff-C-W-5V8L.js","./diff-BmdR9FsO.js","./dockerfile-C2PznFWk.js","./simple-mode-DBSzUJLA.js","./dtd-D9h-tL8G.js","./dtd-DbCXDVgi.js","./dylan-D3MC56xy.js","./dylan-CLLzL2Js.js","./ecl-B6UC4tME.js","./ecl-BC7x2nzk.js","./eiffel-CjvEov4k.js","./eiffel-CDU836rz.js","./elm-DvSbvRWe.js","./elm-D-_bXARs.js","./erlang-DJYaGXyq.js","./erlang-CwDZk2zM.js","./factor-CUQCrkTo.js","./factor-DMrXrOH8.js","./forth-D9xegiCO.js","./forth-D6FsO_8x.js","./fortran-B0Oe0U8s.js","./fortran-D4BMbIkG.js","./mllike-C1DLZhEI.js","./mllike-CD9vBc_2.js","./gas-jLjj-PIq.js","./gas-JFjzcgdY.js","./gherkin-3Ig8Crit.js","./gherkin-Cyu-qGaF.js","./groovy-NKpNVJ-n.js","./groovy-CZaE9eN-.js","./haskell-OPE4bAjk.js","./haskell-Dc6o0IGr.js","./haxe-DEAZF8L3.js","./haxe-Bsf0tzqs.js","./idl-BM6265Xl.js","./idl-1W91kQ8_.js","./javascript-CZ9vDpAy.js","./javascript-BZ81-2rO.js","./julia-BrY9TQnt.js","./julia-BZOsq0r_.js","./livescript-CNahkUp5.js","./livescript-CNZfmikk.js","./lua-Skr4TVu_.js","./lua-DXGRliwd.js","./mirc-CffYPE4R.js","./mirc-kI4d5fMu.js","./mathematica-BXxhrpeY.js","./mathematica-BoUj8M7D.js","./modelica-CvAyRRNV.js","./modelica-DgfsLJuF.js","./mumps-DFJehEx7.js","./mumps-D_-b9TZD.js","./mbox-BRrQCVe9.js","./mbox-DLVP8LAe.js","./nsis-BVI9YULz.js","./nsis-Ccvd1gbp.js","./ntriples-Bcdh7b2H.js","./ntriples-COX9JFZ8.js","./octave-CdAKz6YS.js","./octave-BejycR79.js","./oz-DSySeR-W.js","./oz-CFFivrGn.js","./pascal-DefziIUN.js","./pascal-B_p9jkCs.js","./perl-BOOloBPk.js","./perl-C-SFBTly.js","./pig-f0nBb-5x.js","./pig-BhxDMp2k.js","./powershell-DToQjbK9.js","./powershell-c59M-9N2.js","./properties-BRob-nyj.js","./properties-D1JNwCKy.js","./protobuf-DZyC6051.js","./protobuf-DQS7ex8R.js","./pug-pVoM8FRt.js","./pug-BtXi5KiX.js","./puppet-9fuYG07F.js","./puppet-DaQvhvew.js","./q-D73s4Y77.js","./q-DppnoRE3.js","./r-BOEjz92e.js","./r-D8-F_FWj.js","./rpm-LpXWTM5t.js","./rpm-CegJhNNO.js","./ruby-DodgSDfF.js","./ruby-YMIxufV1.js","./sas-D9KCtUmL.js","./sas-wTtX9UIQ.js","./scheme-p8UJxmJw.js","./scheme-BGenom3k.js","./shell-BWdqyqwL.js","./shell-Bu1sLaiP.js","./sieve-CLwJmtiQ.js","./sieve-ffe6rUQh.js","./smalltalk-D3KV-Qah.js","./smalltalk-NU5EGjHp.js","./sparql-D9Jz2mBw.js","./sparql-uqVktnwO.js","./stylus-ClN4l_XO.js","./stylus-B2E6Ulaz.js","./swift-Dvd_9xBv.js","./swift-Rmnn7ATv.js","./stex-pjf-hOob.js","./stex-FMMSUPAS.js","./verilog-CSmDH7su.js","./verilog-B8FhJcX6.js","./tcl-DR2p8cyi.js","./tcl-ZPWCn2nn.js","./textile-D6S27_J2.js","./textile-uhA33kFk.js","./toml-B-YuQ2Id.js","./toml-BFZv2Mv7.js","./troff-HSk8AoRF.js","./troff-B5eayHop.js","./ttcn-CehzlVdx.js","./ttcn-BM0Yp8NY.js","./ttcn-cfg-CLEPwk1s.js","./ttcn-cfg-CfbkL3Q_.js","./turtle-DQLHkbOu.js","./turtle-DvetLxrv.js","./webidl-Bf6dokXM.js","./webidl-mMO-qW5Q.js","./vb-o1EHrS4z.js","./vb-i5Z8scch.js","./vbscript-BS8yUFpf.js","./vbscript-BiPYgIyi.js","./velocity-u_oGPFaA.js","./velocity-Dw3R3YoX.js","./vhdl-BCaWLcjw.js","./vhdl-BqPEoXdJ.js","./xquery-Di0kkiXg.js","./xquery-DvqNwq7L.js","./yacas-DB8tPtyp.js","./yacas-Dku9Z6Kf.js","./z80-DFUvlWxk.js","./z80-DvazU5Tr.js","./mscgen-uMZWtMZv.js","./mscgen-B1HDwshJ.js","./dist-DQNaXfK1.js","./dist-B8g3pNYJ.js","./dist-DzAAhYcW.js","./node-sql-parser-BWgUjcfV.js"])))=>i.map(i=>d[i]);
2
- var UI=Object.defineProperty;var KI=(ga,kr,si)=>kr in ga?UI(ga,kr,{enumerable:!0,configurable:!0,writable:!0,value:si}):ga[kr]=si;var we=(ga,kr,si)=>KI(ga,typeof kr!="symbol"?kr+"":kr,si);import{a as QI,n as Xw,o as GI,r as JI,s as Hu,t as rt}from"./chunk-LvLJmgfZ.js";import{c as Yw,i as Te,l as Zw,p as Ee,r as XI,s as YI,u as rn}from"./useEvent-D91BmmQi.js";import{t as $u}from"./react-Bj1aDYRI.js";import{t as e_}from"./react-dom-CSu739Rf.js";import{B as ZI,N as e8,P as t_,R as n_,T as r_,k as t8,w as n8}from"./zod-H_cgTO0M.js";import{t as Bn}from"./compiler-runtime-B3qBwwSJ.js";import{t as Zh}from"./debounce-OiXznToA.js";import{d as a_,f as r8,g as _e,o as Wu}from"./useEventListener-B_w3A283.js";import{t as Pr}from"./objects-BlG0ZrO0.js";import{t as an}from"./invariant-CkiqGLcK.js";import{b as a8,g as i8,h as i_,t as o_}from"./utils-Z80SV4_d.js";import{S as o8,T as Uu,r as s8}from"./config-BbOTTCYY.js";import{n as l8,t as Nr}from"./cn-DYvqRARy.js";import{t as c8}from"./jsx-runtime-Blw4afVn.js";import{C as s_,T as u8,b as d8,d as f8,g as Ku,h as p8,p as h8,v as l_,w as da,x as rr,y as c_}from"./fullscreen-dUjPYOmm.js";import{l as u_,o as m8}from"./dist-ByVeMWkr.js";import{d as g8}from"./menu-items-DbSLBfXR.js";import{a as y8,c as v8,i as em,m as b8,n as w8,o as d_,r as _8,s as x8,t as k8}from"./select-B5TFNjmU.js";import{i as C8,t as tm}from"./tooltip-CFX4fYHU.js";import{t as f_}from"./button-eIihcbUw.js";import{$t as Ji,A as S8,C as E8,D as T8,Gt as Il,H as nm,Ht as Qu,I as p_,Jt as h_,K as I8,Kt as m_,Nt as rm,Pt as g_,Qt as ei,Rt as y_,S as L8,T as v_,Tt as fa,U as O8,Ut as $t,W as A8,Wt as R8,X as Gu,Yt as Ll,Zt as _r,_t as M8,at as En,b as b_,bt as w_,ct as __,dt as P8,en as cs,f as x_,it as k_,jt as us,k as N8,kt as C_,l as te,ot as D8,p as j8,pt as z8,q as q8,qt as Ju,st as wt,u as S_,ut as Dr,wt as am,z as E_}from"./dist-12S8I4CH.js";import{C as F8,D as B8,L as V8,O as H8,T as $8,b as W8,d as T_,f as U8,g as K8,h as Q8,k as G8,n as J8,o as im,p as X8,s as Y8,t as Z8,u as eL,w as tL,x as nL}from"./dist-BCMBu0rO.js";import{a as Ol,i as om,n as rL,p as sm,r as I_}from"./arrays-DbOq36rN.js";import{n as ar}from"./once-CGKw_kwj.js";import{t as aL}from"./capabilities-B09j1Eor.js";import{t as iL}from"./cjs-D5tzp-Y6.js";import{t as ds}from"./createReducer-C7kZ8zEe.js";import{d as L_,l as O_,n as oL,o as A_,p as sL,r as Xu}from"./dist-DYEuVkEX.js";import{t as R_}from"./main-BNL5rxQw.js";import{n as Yu,t as lL}from"./useNonce-CbdaHKzX.js";import{i as fs,r as cL,t as uL}from"./strings-Djnbwmfl.js";import{t as ir}from"./requests-9-v2bhoi.js";import{a as dL,c as fL,d as pL,f as M_,i as hL,l as mL,n as gL,o as lm,r as yL,s as Zu,t as vL,u as bL}from"./dist-DI1-Z60I.js";import{t as ot}from"./createLucideIcon-w-Qo9n0R.js";import{a as cm,i as wL,o as _L,r as xL,t as kL}from"./useLifecycle-lLOBhc-1.js";import{t as CL}from"./check-rzLRd0j9.js";import{t as SL}from"./x-C-Eq0ag8.js";import{t as EL,u as TL}from"./toDate-Ct2FT81-.js";import{t as um}from"./database-zap-CKO8g4BU.js";import{n as IL,t as Al}from"./DeferredRequestRegistry-C8EV1PoE.js";import{t as Vn}from"./badge-B92a4ePY.js";import{t as ne}from"./preload-helper-TXkS1QI3.js";import{a as P_,s as LL}from"./dist-DcwTQG1A.js";import{a as N_,i as dm,n as OL,r as D_,t as AL}from"./dist-CPjTeT8p.js";import{n as RL}from"./stex-FMMSUPAS.js";import{t as Rl}from"./use-toast-BwJoaaDM.js";import{n as j_}from"./paths-BKO-pHK6.js";import{n as ML}from"./useTheme-KXqAyDPC.js";import{t as fm}from"./purify.es-CWmnYhGI.js";let pm,z_,q_,F_,hm,B_,mm,gm,ym,V_,H_,$_,W_,U_,K_,Q_,vm,Ml,bm,Hn,G_,Pl,J_,wm,_m,X_,ps,Y_,xm,ed,Z_,ex,Nl,tx,km,Cm,nx,td,Sm,Em,Tm,hs,ti,rx,ax,ix,Im,ox,nd,Lm,Om,rd,ni,sx,ad,lx,Dl,ms,Am,cx,or,ux,dx,Xi,jl,fx,Rm,Mm,Pm,px,hx,ri,mx,Nm,gx,yx,ai,id,Dm,jm,vx,gs,bx,zm,wx,qm,ii,_x,xx,Fm,$n,od,Bm,kx,Wn,Cx,sd,Sx,ld,Ex,Tx,zl,cd,ys,ud,Ix,ql,Lx,Ox,Ax,Vm,Rx,Mx,dd,Px,Nx,gn,Fl,Dx,Hm,$m,jx,Wm,fd,pd,Um,zx,qx,Bl,jr,Fx,Km,hd,Bx,md,Vx,Qm,pa,Gm,Jm,Hx,Xm,$x,Ym,gd,Wx,Ux,Kx,Qx,Zm,Yi,Gx,Jx,e0,Xx,Yx,Zx,yd,t0,n0,Vl,r0,Tn,ek,a0,tk,i0,nk,rk,o0,s0,ak,ik,Hl,ok,l0,c0,sk,u0,d0,f0,lk,vd,ck,ha,p0,uk,dk,fk,h0,bd,m0,wd,pk,hk,_d,g0,y0,v0,xd,mk,b0,kd,gk,Cd,yk,vk,Zi,bk,Sd,Un,eo,Ed,Td,Id,wk,_k,xk,kk,Ck,Ld,Sk,Ek,Tk,w0,_0,x0,k0,C0,S0,Ik,Lk,Od,st,Ok,$l,E0,Ak,T0,I0,Rk,oi,L0,Mk,vs,ma,Pk,Ad,Nk,Dk,Rd,O0,jk,zk,A0,qk,R0,Wl,M0,P0,Fk,Ul,Bk,Md,Vk,Hk,to,Pd,no,$k,Xe,Nd,Wk,N0,xr,Uk,bs,Dd,Kk,jd,PL=(async()=>{var Fr,fr,Gf,vi;let ga,kr,si;ga=rt((e=>{function t(oe,le){var G=oe.length;oe.push(le);e:for(;0<G;){var Oe=G-1>>>1,He=oe[Oe];if(0<s(He,le))oe[Oe]=le,oe[G]=He,G=Oe;else break e}}function a(oe){return oe.length===0?null:oe[0]}function o(oe){if(oe.length===0)return null;var le=oe[0],G=oe.pop();if(G!==le){oe[0]=G;e:for(var Oe=0,He=oe.length,et=He>>>1;Oe<et;){var Fe=2*(Oe+1)-1,Ne=oe[Fe],Le=Fe+1,De=oe[Le];if(0>s(Ne,G))Le<He&&0>s(De,Ne)?(oe[Oe]=De,oe[Le]=G,Oe=Le):(oe[Oe]=Ne,oe[Fe]=G,Oe=Fe);else if(Le<He&&0>s(De,G))oe[Oe]=De,oe[Le]=G,Oe=Le;else break e}}return le}function s(oe,le){var G=oe.sortIndex-le.sortIndex;return G===0?oe.id-le.id:G}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var f=Date,d=f.now();e.unstable_now=function(){return f.now()-d}}var m=[],b=[],w=1,x=null,S=3,E=!1,T=!1,M=!1,z=!1,B=typeof setTimeout=="function"?setTimeout:null,V=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;function X(oe){for(var le=a(b);le!==null;){if(le.callback===null)o(b);else if(le.startTime<=oe)o(b),le.sortIndex=le.expirationTime,t(m,le);else break;le=a(b)}}function ce(oe){if(M=!1,X(oe),!T)if(a(m)!==null)T=!0,A||(A=!0,ve());else{var le=a(b);le!==null&&be(ce,le.startTime-oe)}}var A=!1,q=-1,$=5,ie=-1;function fe(){return z?!0:!(e.unstable_now()-ie<$)}function me(){if(z=!1,A){var oe=e.unstable_now();ie=oe;var le=!0;try{e:{T=!1,M&&(M=!1,V(q),q=-1),E=!0;var G=S;try{t:{for(X(oe),x=a(m);x!==null&&!(x.expirationTime>oe&&fe());){var Oe=x.callback;if(typeof Oe=="function"){x.callback=null,S=x.priorityLevel;var He=Oe(x.expirationTime<=oe);if(oe=e.unstable_now(),typeof He=="function"){x.callback=He,X(oe),le=!0;break t}x===a(m)&&o(m),X(oe)}else o(m);x=a(m)}if(x!==null)le=!0;else{var et=a(b);et!==null&&be(ce,et.startTime-oe),le=!1}}break e}finally{x=null,S=G,E=!1}le=void 0}}finally{le?ve():A=!1}}}var ve;if(typeof N=="function")ve=function(){N(me)};else if(typeof MessageChannel<"u"){var ae=new MessageChannel,de=ae.port2;ae.port1.onmessage=me,ve=function(){de.postMessage(null)}}else ve=function(){B(me,0)};function be(oe,le){q=B(function(){oe(e.unstable_now())},le)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(oe){oe.callback=null},e.unstable_forceFrameRate=function(oe){0>oe||125<oe?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):$=0<oe?Math.floor(1e3/oe):5},e.unstable_getCurrentPriorityLevel=function(){return S},e.unstable_next=function(oe){switch(S){case 1:case 2:case 3:var le=3;break;default:le=S}var G=S;S=le;try{return oe()}finally{S=G}},e.unstable_requestPaint=function(){z=!0},e.unstable_runWithPriority=function(oe,le){switch(oe){case 1:case 2:case 3:case 4:case 5:break;default:oe=3}var G=S;S=oe;try{return le()}finally{S=G}},e.unstable_scheduleCallback=function(oe,le,G){var Oe=e.unstable_now();switch(typeof G=="object"&&G?(G=G.delay,G=typeof G=="number"&&0<G?Oe+G:Oe):G=Oe,oe){case 1:var He=-1;break;case 2:He=250;break;case 5:He=1073741823;break;case 4:He=1e4;break;default:He=5e3}return He=G+He,oe={id:w++,callback:le,priorityLevel:oe,startTime:G,expirationTime:He,sortIndex:-1},G>Oe?(oe.sortIndex=G,t(b,oe),a(m)===null&&oe===a(b)&&(M?(V(q),q=-1):M=!0,be(ce,G-Oe))):(oe.sortIndex=He,t(m,oe),T||E||(T=!0,A||(A=!0,ve()))),oe},e.unstable_shouldYield=fe,e.unstable_wrapCallback=function(oe){var le=S;return function(){var G=S;S=le;try{return oe.apply(this,arguments)}finally{S=G}}}})),kr=rt(((e,t)=>{t.exports=ga()})),si=rt((e=>{var t=kr(),a=$u(),o=e_();function s(n){var r="https://react.dev/errors/"+n;if(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)r+="&args[]="+encodeURIComponent(arguments[i])}return"Minified React error #"+n+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function c(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}function f(n){var r=n,i=n;if(n.alternate)for(;r.return;)r=r.return;else{n=r;do r=n,r.flags&4098&&(i=r.return),n=r.return;while(n)}return r.tag===3?i:null}function d(n){if(n.tag===13){var r=n.memoizedState;if(r===null&&(n=n.alternate,n!==null&&(r=n.memoizedState)),r!==null)return r.dehydrated}return null}function m(n){if(n.tag===31){var r=n.memoizedState;if(r===null&&(n=n.alternate,n!==null&&(r=n.memoizedState)),r!==null)return r.dehydrated}return null}function b(n){if(f(n)!==n)throw Error(s(188))}function w(n){var r=n.alternate;if(!r){if(r=f(n),r===null)throw Error(s(188));return r===n?n:null}for(var i=n,l=r;;){var p=i.return;if(p===null)break;var g=p.alternate;if(g===null){if(l=p.return,l!==null){i=l;continue}break}if(p.child===g.child){for(g=p.child;g;){if(g===i)return b(p),n;if(g===l)return b(p),r;g=g.sibling}throw Error(s(188))}if(i.return!==l.return)i=p,l=g;else{for(var C=!1,L=p.child;L;){if(L===i){C=!0,i=p,l=g;break}if(L===l){C=!0,l=p,i=g;break}L=L.sibling}if(!C){for(L=g.child;L;){if(L===i){C=!0,i=g,l=p;break}if(L===l){C=!0,l=g,i=p;break}L=L.sibling}if(!C)throw Error(s(189))}}if(i.alternate!==l)throw Error(s(190))}if(i.tag!==3)throw Error(s(188));return i.stateNode.current===i?n:r}function x(n){var r=n.tag;if(r===5||r===26||r===27||r===6)return n;for(n=n.child;n!==null;){if(r=x(n),r!==null)return r;n=n.sibling}return null}var S=Object.assign,E=Symbol.for("react.element"),T=Symbol.for("react.transitional.element"),M=Symbol.for("react.portal"),z=Symbol.for("react.fragment"),B=Symbol.for("react.strict_mode"),V=Symbol.for("react.profiler"),N=Symbol.for("react.consumer"),X=Symbol.for("react.context"),ce=Symbol.for("react.forward_ref"),A=Symbol.for("react.suspense"),q=Symbol.for("react.suspense_list"),$=Symbol.for("react.memo"),ie=Symbol.for("react.lazy"),fe=Symbol.for("react.activity"),me=Symbol.for("react.memo_cache_sentinel"),ve=Symbol.iterator;function ae(n){return typeof n!="object"||!n?null:(n=ve&&n[ve]||n["@@iterator"],typeof n=="function"?n:null)}var de=Symbol.for("react.client.reference");function be(n){if(n==null)return null;if(typeof n=="function")return n.$$typeof===de?null:n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case z:return"Fragment";case V:return"Profiler";case B:return"StrictMode";case A:return"Suspense";case q:return"SuspenseList";case fe:return"Activity"}if(typeof n=="object")switch(n.$$typeof){case M:return"Portal";case X:return n.displayName||"Context";case N:return(n._context.displayName||"Context")+".Consumer";case ce:var r=n.render;return n=n.displayName,n||(n=(n=r.displayName||r.name||"",n===""?"ForwardRef":"ForwardRef("+n+")")),n;case $:return r=n.displayName||null,r===null?be(n.type)||"Memo":r;case ie:r=n._payload,n=n._init;try{return be(n(r))}catch{}}return null}var oe=Array.isArray,le=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G=o.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Oe={pending:!1,data:null,method:null,action:null},He=[],et=-1;function Fe(n){return{current:n}}function Ne(n){0>et||(n.current=He[et],He[et]=null,et--)}function Le(n,r){et++,He[et]=n.current,n.current=r}var De=Fe(null),Tt=Fe(null),Mt=Fe(null),Ca=Fe(null);function xo(n,r){switch(Le(Mt,r),Le(Tt,n),Le(De,null),r.nodeType){case 9:case 11:n=(n=r.documentElement)&&(n=n.namespaceURI)?kw(n):0;break;default:if(n=r.tagName,r=r.namespaceURI)r=kw(r),n=Cw(r,n);else switch(n){case"svg":n=1;break;case"math":n=2;break;default:n=0}}Ne(De),Le(De,n)}function An(){Ne(De),Ne(Tt),Ne(Mt)}function Br(n){n.memoizedState!==null&&Le(Ca,n);var r=De.current,i=Cw(r,n.type);r!==i&&(Le(Tt,n),Le(De,i))}function bi(n){Tt.current===n&&(Ne(De),Ne(Tt)),Ca.current===n&&(Ne(Ca),Cl._currentValue=Oe)}var ko,Rs;function mt(n){if(ko===void 0)try{throw Error()}catch(i){var r=i.stack.trim().match(/\n( *(at )?)/);ko=r&&r[1]||"",Rs=-1<i.stack.indexOf(`
3
- at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
4
- `+ko+n+Rs}var Ms=!1;function vn(n,r){if(!n||Ms)return"";Ms=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(r){var pe=function(){throw Error()};if(Object.defineProperty(pe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(pe,[])}catch(re){var Z=re}Reflect.construct(n,[],pe)}else{try{pe.call()}catch(re){Z=re}n.call(pe.prototype)}}else{try{throw Error()}catch(re){Z=re}(pe=n())&&typeof pe.catch=="function"&&pe.catch(function(){})}}catch(re){if(re&&Z&&typeof re.stack=="string")return[re.stack,Z.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var p=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");p&&p.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var g=l.DetermineComponentFrameRoot(),C=g[0],L=g[1];if(C&&L){var F=C.split(`
5
- `),J=L.split(`
6
- `);for(p=l=0;l<F.length&&!F[l].includes("DetermineComponentFrameRoot");)l++;for(;p<J.length&&!J[p].includes("DetermineComponentFrameRoot");)p++;if(l===F.length||p===J.length)for(l=F.length-1,p=J.length-1;1<=l&&0<=p&&F[l]!==J[p];)p--;for(;1<=l&&0<=p;l--,p--)if(F[l]!==J[p]){if(l!==1||p!==1)do if(l--,p--,0>p||F[l]!==J[p]){var se=`
7
- `+F[l].replace(" at new "," at ");return n.displayName&&se.includes("<anonymous>")&&(se=se.replace("<anonymous>",n.displayName)),se}while(1<=l&&0<=p);break}}}finally{Ms=!1,Error.prepareStackTrace=i}return(i=n?n.displayName||n.name:"")?mt(i):""}function Jf(n,r){switch(n.tag){case 26:case 27:case 5:return mt(n.type);case 16:return mt("Lazy");case 13:return n.child!==r&&r!==null?mt("Suspense Fallback"):mt("Suspense");case 19:return mt("SuspenseList");case 0:case 15:return vn(n.type,!1);case 11:return vn(n.type.render,!1);case 1:return vn(n.type,!0);case 31:return mt("Activity");default:return""}}function xc(n){try{var r="",i=null;do r+=Jf(n,i),i=n,n=n.return;while(n);return r}catch(l){return`
8
- Error generating stack: `+l.message+`
9
- `+l.stack}}var Co=Object.prototype.hasOwnProperty,pr=t.unstable_scheduleCallback,bn=t.unstable_cancelCallback,Xf=t.unstable_shouldYield,kc=t.unstable_requestPaint,Jt=t.unstable_now,Yf=t.unstable_getCurrentPriorityLevel,Vr=t.unstable_ImmediatePriority,Cc=t.unstable_UserBlockingPriority,Pt=t.unstable_NormalPriority,So=t.unstable_LowPriority,Ct=t.unstable_IdlePriority,Zf=t.log,ep=t.unstable_setDisableYieldValue,wi=null,ln=null;function Qe(n){if(typeof Zf=="function"&&ep(n),ln&&typeof ln.setStrictMode=="function")try{ln.setStrictMode(wi,n)}catch{}}var gt=Math.clz32?Math.clz32:Tr,_t=Math.log,Xt=Math.LN2;function Tr(n){return n>>>=0,n===0?32:31-(_t(n)/Xt|0)|0}var _i=256,It=262144,Sa=4194304;function Hr(n){var r=n&42;if(r!==0)return r;switch(n&-n){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return n&261888;case 262144:case 524288:case 1048576:case 2097152:return n&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return n&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return n}}function Eo(n,r,i){var l=n.pendingLanes;if(l===0)return 0;var p=0,g=n.suspendedLanes,C=n.pingedLanes;n=n.warmLanes;var L=l&134217727;return L===0?(L=l&~g,L===0?C===0?i||(i=l&~n,i!==0&&(p=Hr(i))):p=Hr(C):p=Hr(L)):(l=L&~g,l===0?(C&=L,C===0?i||(i=L&~n,i!==0&&(p=Hr(i))):p=Hr(C)):p=Hr(l)),p===0?0:r!==0&&r!==p&&(r&g)===0&&(g=p&-p,i=r&-r,g>=i||g===32&&i&4194048)?r:p}function Ea(n,r){return(n.pendingLanes&~(n.suspendedLanes&~n.pingedLanes)&r)===0}function Sc(n,r){switch(n){case 1:case 2:case 4:case 8:case 64:return r+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return r+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ec(){var n=Sa;return Sa<<=1,!(Sa&62914560)&&(Sa=4194304),n}function Ps(n){for(var r=[],i=0;31>i;i++)r.push(n);return r}function xi(n,r){n.pendingLanes|=r,r!==268435456&&(n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0)}function tp(n,r,i,l,p,g){var C=n.pendingLanes;n.pendingLanes=i,n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0,n.expiredLanes&=i,n.entangledLanes&=i,n.errorRecoveryDisabledLanes&=i,n.shellSuspendCounter=0;var L=n.entanglements,F=n.expirationTimes,J=n.hiddenUpdates;for(i=C&~i;0<i;){var se=31-gt(i),pe=1<<se;L[se]=0,F[se]=-1;var Z=J[se];if(Z!==null)for(J[se]=null,se=0;se<Z.length;se++){var re=Z[se];re!==null&&(re.lane&=-536870913)}i&=~pe}l!==0&&$r(n,l,0),g!==0&&p===0&&n.tag!==0&&(n.suspendedLanes|=g&~(C&~r))}function $r(n,r,i){n.pendingLanes|=r,n.suspendedLanes&=~r;var l=31-gt(r);n.entangledLanes|=r,n.entanglements[l]=n.entanglements[l]|1073741824|i&261930}function To(n,r){var i=n.entangledLanes|=r;for(n=n.entanglements;i;){var l=31-gt(i),p=1<<l;p&r|n[l]&r&&(n[l]|=r),i&=~p}}function Tc(n,r){var i=r&-r;return i=i&42?1:Rn(i),(i&(n.suspendedLanes|r))===0?i:0}function Rn(n){switch(n){case 2:n=1;break;case 8:n=4;break;case 32:n=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:n=128;break;case 268435456:n=134217728;break;default:n=0}return n}function Ns(n){return n&=-n,2<n?8<n?n&134217727?32:268435456:8:2}function Ic(){var n=G.p;return n===0?(n=window.event,n===void 0?32:Ww(n.type)):n}function Mn(n,r){var i=G.p;try{return G.p=n,r()}finally{G.p=i}}var Kn=Math.random().toString(36).slice(2),Bt="__reactFiber$"+Kn,Yt="__reactProps$"+Kn,Ta="__reactContainer$"+Kn,Ds="__reactEvents$"+Kn,Lc="__reactListeners$"+Kn,np="__reactHandles$"+Kn,js="__reactResources$"+Kn,ki="__reactMarker$"+Kn;function Io(n){delete n[Bt],delete n[Yt],delete n[Ds],delete n[Lc],delete n[np]}function Ir(n){var r=n[Bt];if(r)return r;for(var i=n.parentNode;i;){if(r=i[Ta]||i[Bt]){if(i=r.alternate,r.child!==null||i!==null&&i.child!==null)for(n=Aw(n);n!==null;){if(i=n[Bt])return i;n=Aw(n)}return r}n=i,i=n.parentNode}return null}function Ia(n){if(n=n[Bt]||n[Ta]){var r=n.tag;if(r===5||r===6||r===13||r===31||r===26||r===27||r===3)return n}return null}function fn(n){var r=n.tag;if(r===5||r===26||r===27||r===6)return n.stateNode;throw Error(s(33))}function La(n){var r=n[js];return r||(r=n[js]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function Lt(n){n[ki]=!0}var zs=new Set,Oc={};function Lr(n,r){Oa(n,r),Oa(n+"Capture",r)}function Oa(n,r){for(Oc[n]=r,n=0;n<r.length;n++)zs.add(r[n])}var rp=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),wn={},Ac={};function ap(n){return Co.call(Ac,n)?!0:Co.call(wn,n)?!1:rp.test(n)?Ac[n]=!0:(wn[n]=!0,!1)}function Ci(n,r,i){if(ap(r))if(i===null)n.removeAttribute(r);else{switch(typeof i){case"undefined":case"function":case"symbol":n.removeAttribute(r);return;case"boolean":var l=r.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){n.removeAttribute(r);return}}n.setAttribute(r,""+i)}}function Si(n,r,i){if(i===null)n.removeAttribute(r);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(r);return}n.setAttribute(r,""+i)}}function hr(n,r,i,l){if(l===null)n.removeAttribute(i);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(i);return}n.setAttributeNS(r,i,""+l)}}function pn(n){switch(typeof n){case"bigint":case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function Rc(n){var r=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function Mc(n,r,i){var l=Object.getOwnPropertyDescriptor(n.constructor.prototype,r);if(!n.hasOwnProperty(r)&&l!==void 0&&typeof l.get=="function"&&typeof l.set=="function"){var p=l.get,g=l.set;return Object.defineProperty(n,r,{configurable:!0,get:function(){return p.call(this)},set:function(C){i=""+C,g.call(this,C)}}),Object.defineProperty(n,r,{enumerable:l.enumerable}),{getValue:function(){return i},setValue:function(C){i=""+C},stopTracking:function(){n._valueTracker=null,delete n[r]}}}}function qs(n){if(!n._valueTracker){var r=Rc(n)?"checked":"value";n._valueTracker=Mc(n,r,""+n[r])}}function Fs(n){if(!n)return!1;var r=n._valueTracker;if(!r)return!0;var i=r.getValue(),l="";return n&&(l=Rc(n)?n.checked?"true":"false":n.value),n=l,n===i?!1:(r.setValue(n),!0)}function cn(n){if(n||(n=typeof document<"u"?document:void 0),n===void 0)return null;try{return n.activeElement||n.body}catch{return n.body}}var Je=/[\n"\\]/g;function Pn(n){return n.replace(Je,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function Aa(n,r,i,l,p,g,C,L){n.name="",C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"?n.type=C:n.removeAttribute("type"),r==null?C!=="submit"&&C!=="reset"||n.removeAttribute("value"):C==="number"?(r===0&&n.value===""||n.value!=r)&&(n.value=""+pn(r)):n.value!==""+pn(r)&&(n.value=""+pn(r)),r==null?i==null?l!=null&&n.removeAttribute("value"):Wr(n,C,pn(i)):Wr(n,C,pn(r)),p==null&&g!=null&&(n.defaultChecked=!!g),p!=null&&(n.checked=p&&typeof p!="function"&&typeof p!="symbol"),L!=null&&typeof L!="function"&&typeof L!="symbol"&&typeof L!="boolean"?n.name=""+pn(L):n.removeAttribute("name")}function Pc(n,r,i,l,p,g,C,L){if(g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(n.type=g),r!=null||i!=null){if(!(g!=="submit"&&g!=="reset"||r!=null)){qs(n);return}i=i==null?"":""+pn(i),r=r==null?i:""+pn(r),L||r===n.value||(n.value=r),n.defaultValue=r}l??(l=p),l=typeof l!="function"&&typeof l!="symbol"&&!!l,n.checked=L?n.checked:!!l,n.defaultChecked=!!l,C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"&&(n.name=C),qs(n)}function Wr(n,r,i){r==="number"&&cn(n.ownerDocument)===n||n.defaultValue===""+i||(n.defaultValue=""+i)}function Ra(n,r,i,l){if(n=n.options,r){r={};for(var p=0;p<i.length;p++)r["$"+i[p]]=!0;for(i=0;i<n.length;i++)p=r.hasOwnProperty("$"+n[i].value),n[i].selected!==p&&(n[i].selected=p),p&&l&&(n[i].defaultSelected=!0)}else{for(i=""+pn(i),r=null,p=0;p<n.length;p++){if(n[p].value===i){n[p].selected=!0,l&&(n[p].defaultSelected=!0);return}r!==null||n[p].disabled||(r=n[p])}r!==null&&(r.selected=!0)}}function Ma(n,r,i){if(r!=null&&(r=""+pn(r),r!==n.value&&(n.value=r),i==null)){n.defaultValue!==r&&(n.defaultValue=r);return}n.defaultValue=i==null?"":""+pn(i)}function Lo(n,r,i,l){if(r==null){if(l!=null){if(i!=null)throw Error(s(92));if(oe(l)){if(1<l.length)throw Error(s(93));l=l[0]}i=l}i??(i=""),r=i}i=pn(r),n.defaultValue=i,l=n.textContent,l===i&&l!==""&&l!==null&&(n.value=l),qs(n)}function Ur(n,r){if(r){var i=n.firstChild;if(i&&i===n.lastChild&&i.nodeType===3){i.nodeValue=r;return}}n.textContent=r}var ip=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Kr(n,r,i){var l=r.indexOf("--")===0;i==null||typeof i=="boolean"||i===""?l?n.setProperty(r,""):r==="float"?n.cssFloat="":n[r]="":l?n.setProperty(r,i):typeof i!="number"||i===0||ip.has(r)?r==="float"?n.cssFloat=i:n[r]=(""+i).trim():n[r]=i+"px"}function Nc(n,r,i){if(r!=null&&typeof r!="object")throw Error(s(62));if(n=n.style,i!=null){for(var l in i)!i.hasOwnProperty(l)||r!=null&&r.hasOwnProperty(l)||(l.indexOf("--")===0?n.setProperty(l,""):l==="float"?n.cssFloat="":n[l]="");for(var p in r)l=r[p],r.hasOwnProperty(p)&&i[p]!==l&&Kr(n,p,l)}else for(var g in r)r.hasOwnProperty(g)&&Kr(n,g,r[g])}function Ei(n){if(n.indexOf("-")===-1)return!1;switch(n){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Oo=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Dc=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Ao(n){return Dc.test(""+n)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":n}function Qn(){}var Kt=null;function Bs(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var hn=null,Or=null;function jc(n){var r=Ia(n);if(r&&(n=r.stateNode)){var i=n[Yt]||null;e:switch(n=r.stateNode,r.type){case"input":if(Aa(n,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name),r=i.name,i.type==="radio"&&r!=null){for(i=n;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll('input[name="'+Pn(""+r)+'"][type="radio"]'),r=0;r<i.length;r++){var l=i[r];if(l!==n&&l.form===n.form){var p=l[Yt]||null;if(!p)throw Error(s(90));Aa(l,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name)}}for(r=0;r<i.length;r++)l=i[r],l.form===n.form&&Fs(l)}break e;case"textarea":Ma(n,i.value,i.defaultValue);break e;case"select":r=i.value,r!=null&&Ra(n,!!i.multiple,r,!1)}}}var Vs=!1;function zc(n,r,i){if(Vs)return n(r,i);Vs=!0;try{return n(r)}finally{if(Vs=!1,(hn!==null||Or!==null)&&(xu(),hn&&(r=hn,n=Or,Or=hn=null,jc(r),n)))for(r=0;r<n.length;r++)jc(n[r])}}function Ti(n,r){var i=n.stateNode;if(i===null)return null;var l=i[Yt]||null;if(l===null)return null;i=l[r];e:switch(r){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(n=n.type,l=!(n==="button"||n==="input"||n==="select"||n==="textarea")),n=!l;break e;default:n=!1}if(n)return null;if(i&&typeof i!="function")throw Error(s(231,r,typeof i));return i}var mr=!(typeof window>"u"||window.document===void 0||window.document.createElement===void 0),Hs=!1;if(mr)try{var Ii={};Object.defineProperty(Ii,"passive",{get:function(){Hs=!0}}),window.addEventListener("test",Ii,Ii),window.removeEventListener("test",Ii,Ii)}catch{Hs=!1}var gr=null,Ro=null,Li=null;function $s(){if(Li)return Li;var n,r=Ro,i=r.length,l,p="value"in gr?gr.value:gr.textContent,g=p.length;for(n=0;n<i&&r[n]===p[n];n++);var C=i-n;for(l=1;l<=C&&r[i-l]===p[g-l];l++);return Li=p.slice(n,1<l?1-l:void 0)}function Oi(n){var r=n.keyCode;return"charCode"in n?(n=n.charCode,n===0&&r===13&&(n=13)):n=r,n===10&&(n=13),32<=n||n===13?n:0}function Ai(){return!0}function Ws(){return!1}function Qt(n){function r(i,l,p,g,C){for(var L in this._reactName=i,this._targetInst=p,this.type=l,this.nativeEvent=g,this.target=C,this.currentTarget=null,n)n.hasOwnProperty(L)&&(i=n[L],this[L]=i?i(g):g[L]);return this.isDefaultPrevented=(g.defaultPrevented==null?g.returnValue===!1:g.defaultPrevented)?Ai:Ws,this.isPropagationStopped=Ws,this}return S(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=Ai)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=Ai)},persist:function(){},isPersistent:Ai}),r}var Qr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},u=Qt(Qr),h=S({},Qr,{view:0,detail:0}),y=Qt(h),v,_,k,I=S({},h,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Me,button:0,buttons:0,relatedTarget:function(n){return n.relatedTarget===void 0?n.fromElement===n.srcElement?n.toElement:n.fromElement:n.relatedTarget},movementX:function(n){return"movementX"in n?n.movementX:(n!==k&&(k&&n.type==="mousemove"?(v=n.screenX-k.screenX,_=n.screenY-k.screenY):_=v=0,k=n),v)},movementY:function(n){return"movementY"in n?n.movementY:_}}),O=Qt(I),R=Qt(S({},I,{dataTransfer:0})),j=Qt(S({},h,{relatedTarget:0})),D=Qt(S({},Qr,{animationName:0,elapsedTime:0,pseudoElement:0})),ee=Qt(S({},Qr,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}})),Y=Qt(S({},Qr,{data:0})),U={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},K={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},ye={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ge(n){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(n):(n=ye[n])?!!r[n]:!1}function Me(){return ge}var ke=Qt(S({},h,{key:function(n){if(n.key){var r=U[n.key]||n.key;if(r!=="Unidentified")return r}return n.type==="keypress"?(n=Oi(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?K[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Me,charCode:function(n){return n.type==="keypress"?Oi(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?Oi(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}})),Ae=Qt(S({},I,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Ye=Qt(S({},h,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Me})),Be=Qt(S({},Qr,{propertyName:0,elapsedTime:0,pseudoElement:0})),dt=Qt(S({},I,{deltaX:function(n){return"deltaX"in n?n.deltaX:"wheelDeltaX"in n?-n.wheelDeltaX:0},deltaY:function(n){return"deltaY"in n?n.deltaY:"wheelDeltaY"in n?-n.wheelDeltaY:"wheelDelta"in n?-n.wheelDelta:0},deltaZ:0,deltaMode:0})),yt=Qt(S({},Qr,{newState:0,oldState:0})),je=[9,13,27,32],Pe=mr&&"CompositionEvent"in window,xt=null;mr&&"documentMode"in document&&(xt=document.documentMode);var Nt=mr&&"TextEvent"in window&&!xt,Vt=mr&&(!Pe||xt&&8<xt&&11>=xt),Ri=" ",qc=!1;function Fc(n,r){switch(n){case"keyup":return je.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Mo(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var Po=!1;function f6(n,r){switch(n){case"compositionend":return Mo(r);case"keypress":return r.which===32?(qc=!0,Ri):null;case"textInput":return n=r.data,n===Ri&&qc?null:n;default:return null}}function p6(n,r){if(Po)return n==="compositionend"||!Pe&&Fc(n,r)?(n=$s(),Li=Ro=gr=null,Po=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return Vt&&r.locale!=="ko"?null:r.data;default:return null}}var h6={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Dv(n){var r=n&&n.nodeName&&n.nodeName.toLowerCase();return r==="input"?!!h6[n.type]:r==="textarea"}function jv(n,r,i,l){hn?Or?Or.push(l):Or=[l]:hn=l,r=Lu(r,"onChange"),0<r.length&&(i=new u("onChange","change",null,i,l),n.push({event:i,listeners:r}))}var Us=null,Ks=null;function m6(n){gw(n,0)}function Bc(n){if(Fs(fn(n)))return n}function zv(n,r){if(n==="change")return r}var qv=!1;if(mr){var op;if(mr){var sp="oninput"in document;if(!sp){var Fv=document.createElement("div");Fv.setAttribute("oninput","return;"),sp=typeof Fv.oninput=="function"}op=sp}else op=!1;qv=op&&(!document.documentMode||9<document.documentMode)}function Bv(){Us&&(Us.detachEvent("onpropertychange",Vv),Ks=Us=null)}function Vv(n){if(n.propertyName==="value"&&Bc(Ks)){var r=[];jv(r,Ks,n,Bs(n)),zc(m6,r)}}function g6(n,r,i){n==="focusin"?(Bv(),Us=r,Ks=i,Us.attachEvent("onpropertychange",Vv)):n==="focusout"&&Bv()}function y6(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return Bc(Ks)}function v6(n,r){if(n==="click")return Bc(r)}function b6(n,r){if(n==="input"||n==="change")return Bc(r)}function w6(n,r){return n===r&&(n!==0||1/n==1/r)||n!==n&&r!==r}var Nn=typeof Object.is=="function"?Object.is:w6;function Qs(n,r){if(Nn(n,r))return!0;if(typeof n!="object"||!n||typeof r!="object"||!r)return!1;var i=Object.keys(n),l=Object.keys(r);if(i.length!==l.length)return!1;for(l=0;l<i.length;l++){var p=i[l];if(!Co.call(r,p)||!Nn(n[p],r[p]))return!1}return!0}function Hv(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function $v(n,r){var i=Hv(n);n=0;for(var l;i;){if(i.nodeType===3){if(l=n+i.textContent.length,n<=r&&l>=r)return{node:i,offset:r-n};n=l}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=Hv(i)}}function Wv(n,r){return n&&r?n===r?!0:n&&n.nodeType===3?!1:r&&r.nodeType===3?Wv(n,r.parentNode):"contains"in n?n.contains(r):n.compareDocumentPosition?!!(n.compareDocumentPosition(r)&16):!1:!1}function Uv(n){n=n!=null&&n.ownerDocument!=null&&n.ownerDocument.defaultView!=null?n.ownerDocument.defaultView:window;for(var r=cn(n.document);r instanceof n.HTMLIFrameElement;){try{var i=typeof r.contentWindow.location.href=="string"}catch{i=!1}if(i)n=r.contentWindow;else break;r=cn(n.document)}return r}function lp(n){var r=n&&n.nodeName&&n.nodeName.toLowerCase();return r&&(r==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||r==="textarea"||n.contentEditable==="true")}var _6=mr&&"documentMode"in document&&11>=document.documentMode,No=null,cp=null,Gs=null,up=!1;function Kv(n,r,i){var l=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;up||No==null||No!==cn(l)||(l=No,"selectionStart"in l&&lp(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),Gs&&Qs(Gs,l)||(Gs=l,l=Lu(cp,"onSelect"),0<l.length&&(r=new u("onSelect","select",null,r,i),n.push({event:r,listeners:l}),r.target=No)))}function Mi(n,r){var i={};return i[n.toLowerCase()]=r.toLowerCase(),i["Webkit"+n]="webkit"+r,i["Moz"+n]="moz"+r,i}var Do={animationend:Mi("Animation","AnimationEnd"),animationiteration:Mi("Animation","AnimationIteration"),animationstart:Mi("Animation","AnimationStart"),transitionrun:Mi("Transition","TransitionRun"),transitionstart:Mi("Transition","TransitionStart"),transitioncancel:Mi("Transition","TransitionCancel"),transitionend:Mi("Transition","TransitionEnd")},dp={},Qv={};mr&&(Qv=document.createElement("div").style,"AnimationEvent"in window||(delete Do.animationend.animation,delete Do.animationiteration.animation,delete Do.animationstart.animation),"TransitionEvent"in window||delete Do.transitionend.transition);function Pi(n){if(dp[n])return dp[n];if(!Do[n])return n;var r=Do[n],i;for(i in r)if(r.hasOwnProperty(i)&&i in Qv)return dp[n]=r[i];return n}var Gv=Pi("animationend"),Jv=Pi("animationiteration"),Xv=Pi("animationstart"),x6=Pi("transitionrun"),k6=Pi("transitionstart"),C6=Pi("transitioncancel"),Yv=Pi("transitionend"),Zv=new Map,fp="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");fp.push("scrollEnd");function yr(n,r){Zv.set(n,r),Lr(r,[n])}var Vc=typeof reportError=="function"?reportError:function(n){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof n=="object"&&n&&typeof n.message=="string"?String(n.message):String(n),error:n});if(!window.dispatchEvent(r))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",n);return}console.error(n)},Gn=[],jo=0,pp=0;function Hc(){for(var n=jo,r=pp=jo=0;r<n;){var i=Gn[r];Gn[r++]=null;var l=Gn[r];Gn[r++]=null;var p=Gn[r];Gn[r++]=null;var g=Gn[r];if(Gn[r++]=null,l!==null&&p!==null){var C=l.pending;C===null?p.next=p:(p.next=C.next,C.next=p),l.pending=p}g!==0&&eb(i,p,g)}}function $c(n,r,i,l){Gn[jo++]=n,Gn[jo++]=r,Gn[jo++]=i,Gn[jo++]=l,pp|=l,n.lanes|=l,n=n.alternate,n!==null&&(n.lanes|=l)}function hp(n,r,i,l){return $c(n,r,i,l),Wc(n)}function Ni(n,r){return $c(n,null,null,r),Wc(n)}function eb(n,r,i){n.lanes|=i;var l=n.alternate;l!==null&&(l.lanes|=i);for(var p=!1,g=n.return;g!==null;)g.childLanes|=i,l=g.alternate,l!==null&&(l.childLanes|=i),g.tag===22&&(n=g.stateNode,n===null||n._visibility&1||(p=!0)),n=g,g=g.return;return n.tag===3?(g=n.stateNode,p&&r!==null&&(p=31-gt(i),n=g.hiddenUpdates,l=n[p],l===null?n[p]=[r]:l.push(r),r.lane=i|536870912),g):null}function Wc(n){if(50<yl)throw yl=0,kh=null,Error(s(185));for(var r=n.return;r!==null;)n=r,r=n.return;return n.tag===3?n.stateNode:null}var zo={};function S6(n,r,i,l){this.tag=n,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Dn(n,r,i,l){return new S6(n,r,i,l)}function mp(n){return n=n.prototype,!(!n||!n.isReactComponent)}function Gr(n,r){var i=n.alternate;return i===null?(i=Dn(n.tag,r,n.key,n.mode),i.elementType=n.elementType,i.type=n.type,i.stateNode=n.stateNode,i.alternate=n,n.alternate=i):(i.pendingProps=r,i.type=n.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=n.flags&65011712,i.childLanes=n.childLanes,i.lanes=n.lanes,i.child=n.child,i.memoizedProps=n.memoizedProps,i.memoizedState=n.memoizedState,i.updateQueue=n.updateQueue,r=n.dependencies,i.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},i.sibling=n.sibling,i.index=n.index,i.ref=n.ref,i.refCleanup=n.refCleanup,i}function tb(n,r){n.flags&=65011714;var i=n.alternate;return i===null?(n.childLanes=0,n.lanes=r,n.child=null,n.subtreeFlags=0,n.memoizedProps=null,n.memoizedState=null,n.updateQueue=null,n.dependencies=null,n.stateNode=null):(n.childLanes=i.childLanes,n.lanes=i.lanes,n.child=i.child,n.subtreeFlags=0,n.deletions=null,n.memoizedProps=i.memoizedProps,n.memoizedState=i.memoizedState,n.updateQueue=i.updateQueue,n.type=i.type,r=i.dependencies,n.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),n}function Uc(n,r,i,l,p,g){var C=0;if(l=n,typeof n=="function")mp(n)&&(C=1);else if(typeof n=="string")C=AI(n,i,De.current)?26:n==="html"||n==="head"||n==="body"?27:5;else e:switch(n){case fe:return n=Dn(31,i,r,p),n.elementType=fe,n.lanes=g,n;case z:return Di(i.children,p,g,r);case B:C=8,p|=24;break;case V:return n=Dn(12,i,r,p|2),n.elementType=V,n.lanes=g,n;case A:return n=Dn(13,i,r,p),n.elementType=A,n.lanes=g,n;case q:return n=Dn(19,i,r,p),n.elementType=q,n.lanes=g,n;default:if(typeof n=="object"&&n)switch(n.$$typeof){case X:C=10;break e;case N:C=9;break e;case ce:C=11;break e;case $:C=14;break e;case ie:C=16,l=null;break e}C=29,i=Error(s(130,n===null?"null":typeof n,"")),l=null}return r=Dn(C,i,r,p),r.elementType=n,r.type=l,r.lanes=g,r}function Di(n,r,i,l){return n=Dn(7,n,l,r),n.lanes=i,n}function gp(n,r,i){return n=Dn(6,n,null,r),n.lanes=i,n}function nb(n){var r=Dn(18,null,null,0);return r.stateNode=n,r}function yp(n,r,i){return r=Dn(4,n.children===null?[]:n.children,n.key,r),r.lanes=i,r.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},r}var rb=new WeakMap;function Jn(n,r){if(typeof n=="object"&&n){var i=rb.get(n);return i===void 0?(r={value:n,source:r,stack:xc(r)},rb.set(n,r),r):i}return{value:n,source:r,stack:xc(r)}}var qo=[],Fo=0,Kc=null,Js=0,Xn=[],Yn=0,Pa=null,Ar=1,Rr="";function Jr(n,r){qo[Fo++]=Js,qo[Fo++]=Kc,Kc=n,Js=r}function ab(n,r,i){Xn[Yn++]=Ar,Xn[Yn++]=Rr,Xn[Yn++]=Pa,Pa=n;var l=Ar;n=Rr;var p=32-gt(l)-1;l&=~(1<<p),i+=1;var g=32-gt(r)+p;if(30<g){var C=p-p%5;g=(l&(1<<C)-1).toString(32),l>>=C,p-=C,Ar=1<<32-gt(r)+p|i<<p|l,Rr=g+n}else Ar=1<<g|i<<p|l,Rr=n}function vp(n){n.return!==null&&(Jr(n,1),ab(n,1,0))}function bp(n){for(;n===Kc;)Kc=qo[--Fo],qo[Fo]=null,Js=qo[--Fo],qo[Fo]=null;for(;n===Pa;)Pa=Xn[--Yn],Xn[Yn]=null,Rr=Xn[--Yn],Xn[Yn]=null,Ar=Xn[--Yn],Xn[Yn]=null}function ib(n,r){Xn[Yn++]=Ar,Xn[Yn++]=Rr,Xn[Yn++]=Pa,Ar=r.id,Rr=r.overflow,Pa=n}var Zt=null,vt=null,Ge=!1,Na=null,Zn=!1,wp=Error(s(519));function Da(n){throw Xs(Jn(Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML","")),n)),wp}function ob(n){var r=n.stateNode,i=n.type,l=n.memoizedProps;switch(r[Bt]=n,r[Yt]=l,i){case"dialog":We("cancel",r),We("close",r);break;case"iframe":case"object":case"embed":We("load",r);break;case"video":case"audio":for(i=0;i<bl.length;i++)We(bl[i],r);break;case"source":We("error",r);break;case"img":case"image":case"link":We("error",r),We("load",r);break;case"details":We("toggle",r);break;case"input":We("invalid",r),Pc(r,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":We("invalid",r);break;case"textarea":We("invalid",r),Lo(r,l.value,l.defaultValue,l.children)}i=l.children,typeof i!="string"&&typeof i!="number"&&typeof i!="bigint"||r.textContent===""+i||l.suppressHydrationWarning===!0||_w(r.textContent,i)?(l.popover!=null&&(We("beforetoggle",r),We("toggle",r)),l.onScroll!=null&&We("scroll",r),l.onScrollEnd!=null&&We("scrollend",r),l.onClick!=null&&(r.onclick=Qn),r=!0):r=!1,r||Da(n,!0)}function sb(n){for(Zt=n.return;Zt;)switch(Zt.tag){case 5:case 31:case 13:Zn=!1;return;case 27:case 3:Zn=!0;return;default:Zt=Zt.return}}function Bo(n){if(n!==Zt)return!1;if(!Ge)return sb(n),Ge=!0,!1;var r=n.tag,i;if((i=r!==3&&r!==27)&&((i=r===5)&&(i=n.type,i=!(i!=="form"&&i!=="button")||jh(n.type,n.memoizedProps)),i=!i),i&&vt&&Da(n),sb(n),r===13){if(n=n.memoizedState,n=n===null?null:n.dehydrated,!n)throw Error(s(317));vt=Ow(n)}else if(r===31){if(n=n.memoizedState,n=n===null?null:n.dehydrated,!n)throw Error(s(317));vt=Ow(n)}else r===27?(r=vt,Qa(n.type)?(n=Vh,Vh=null,vt=n):vt=r):vt=Zt?tr(n.stateNode.nextSibling):null;return!0}function ji(){vt=Zt=null,Ge=!1}function _p(){var n=Na;return n!==null&&(Cn===null?Cn=n:Cn.push.apply(Cn,n),Na=null),n}function Xs(n){Na===null?Na=[n]:Na.push(n)}var xp=Fe(null),zi=null,Xr=null;function ja(n,r,i){Le(xp,r._currentValue),r._currentValue=i}function Yr(n){n._currentValue=xp.current,Ne(xp)}function kp(n,r,i){for(;n!==null;){var l=n.alternate;if((n.childLanes&r)===r?l!==null&&(l.childLanes&r)!==r&&(l.childLanes|=r):(n.childLanes|=r,l!==null&&(l.childLanes|=r)),n===i)break;n=n.return}}function Cp(n,r,i,l){var p=n.child;for(p!==null&&(p.return=n);p!==null;){var g=p.dependencies;if(g!==null){var C=p.child;g=g.firstContext;e:for(;g!==null;){var L=g;g=p;for(var F=0;F<r.length;F++)if(L.context===r[F]){g.lanes|=i,L=g.alternate,L!==null&&(L.lanes|=i),kp(g.return,i,n),l||(C=null);break e}g=L.next}}else if(p.tag===18){if(C=p.return,C===null)throw Error(s(341));C.lanes|=i,g=C.alternate,g!==null&&(g.lanes|=i),kp(C,i,n),C=null}else C=p.child;if(C!==null)C.return=p;else for(C=p;C!==null;){if(C===n){C=null;break}if(p=C.sibling,p!==null){p.return=C.return,C=p;break}C=C.return}p=C}}function Vo(n,r,i,l){n=null;for(var p=r,g=!1;p!==null;){if(!g){if(p.flags&524288)g=!0;else if(p.flags&262144)break}if(p.tag===10){var C=p.alternate;if(C===null)throw Error(s(387));if(C=C.memoizedProps,C!==null){var L=p.type;Nn(p.pendingProps.value,C.value)||(n===null?n=[L]:n.push(L))}}else if(p===Ca.current){if(C=p.alternate,C===null)throw Error(s(387));C.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(n===null?n=[Cl]:n.push(Cl))}p=p.return}n!==null&&Cp(r,n,i,l),r.flags|=262144}function Qc(n){for(n=n.firstContext;n!==null;){if(!Nn(n.context._currentValue,n.memoizedValue))return!0;n=n.next}return!1}function qi(n){zi=n,Xr=null,n=n.dependencies,n!==null&&(n.firstContext=null)}function en(n){return lb(zi,n)}function Gc(n,r){return zi===null&&qi(n),lb(n,r)}function lb(n,r){var i=r._currentValue;if(r={context:r,memoizedValue:i,next:null},Xr===null){if(n===null)throw Error(s(308));Xr=r,n.dependencies={lanes:0,firstContext:r},n.flags|=524288}else Xr=Xr.next=r;return i}var E6=typeof AbortController<"u"?AbortController:function(){var n=[],r=this.signal={aborted:!1,addEventListener:function(i,l){n.push(l)}};this.abort=function(){r.aborted=!0,n.forEach(function(i){return i()})}},T6=t.unstable_scheduleCallback,I6=t.unstable_NormalPriority,Dt={$$typeof:X,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Sp(){return{controller:new E6,data:new Map,refCount:0}}function Ys(n){n.refCount--,n.refCount===0&&T6(I6,function(){n.controller.abort()})}var Zs=null,Ep=0,Ho=0,$o=null;function L6(n,r){if(Zs===null){var i=Zs=[];Ep=0,Ho=Lh(),$o={status:"pending",value:void 0,then:function(l){i.push(l)}}}return Ep++,r.then(cb,cb),r}function cb(){if(--Ep===0&&Zs!==null){$o!==null&&($o.status="fulfilled");var n=Zs;Zs=null,Ho=0,$o=null;for(var r=0;r<n.length;r++)(0,n[r])()}}function O6(n,r){var i=[],l={status:"pending",value:null,reason:null,then:function(p){i.push(p)}};return n.then(function(){l.status="fulfilled",l.value=r;for(var p=0;p<i.length;p++)(0,i[p])(r)},function(p){for(l.status="rejected",l.reason=p,p=0;p<i.length;p++)(0,i[p])(void 0)}),l}var ub=le.S;le.S=function(n,r){$2=Jt(),typeof r=="object"&&r&&typeof r.then=="function"&&L6(n,r),ub!==null&&ub(n,r)};var Fi=Fe(null);function Tp(){var n=Fi.current;return n===null?ft.pooledCache:n}function Jc(n,r){r===null?Le(Fi,Fi.current):Le(Fi,r.pool)}function db(){var n=Tp();return n===null?null:{parent:Dt._currentValue,pool:n}}var Wo=Error(s(460)),Ip=Error(s(474)),Xc=Error(s(542)),Yc={then:function(){}};function fb(n){return n=n.status,n==="fulfilled"||n==="rejected"}function pb(n,r,i){switch(i=n[i],i===void 0?n.push(r):i!==r&&(r.then(Qn,Qn),r=i),r.status){case"fulfilled":return r.value;case"rejected":throw n=r.reason,mb(n),n;default:if(typeof r.status=="string")r.then(Qn,Qn);else{if(n=ft,n!==null&&100<n.shellSuspendCounter)throw Error(s(482));n=r,n.status="pending",n.then(function(l){if(r.status==="pending"){var p=r;p.status="fulfilled",p.value=l}},function(l){if(r.status==="pending"){var p=r;p.status="rejected",p.reason=l}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw n=r.reason,mb(n),n}throw Vi=r,Wo}}function Bi(n){try{var r=n._init;return r(n._payload)}catch(i){throw typeof i=="object"&&i&&typeof i.then=="function"?(Vi=i,Wo):i}}var Vi=null;function hb(){if(Vi===null)throw Error(s(459));var n=Vi;return Vi=null,n}function mb(n){if(n===Wo||n===Xc)throw Error(s(483))}var Uo=null,el=0;function Zc(n){var r=el;return el+=1,Uo===null&&(Uo=[]),pb(Uo,n,r)}function tl(n,r){r=r.props.ref,n.ref=r===void 0?null:r}function eu(n,r){throw r.$$typeof===E?Error(s(525)):(n=Object.prototype.toString.call(r),Error(s(31,n==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":n)))}function gb(n){function r(W,H){if(n){var Q=W.deletions;Q===null?(W.deletions=[H],W.flags|=16):Q.push(H)}}function i(W,H){if(!n)return null;for(;H!==null;)r(W,H),H=H.sibling;return null}function l(W){for(var H=new Map;W!==null;)W.key===null?H.set(W.index,W):H.set(W.key,W),W=W.sibling;return H}function p(W,H){return W=Gr(W,H),W.index=0,W.sibling=null,W}function g(W,H,Q){return W.index=Q,n?(Q=W.alternate,Q===null?(W.flags|=67108866,H):(Q=Q.index,Q<H?(W.flags|=67108866,H):Q)):(W.flags|=1048576,H)}function C(W){return n&&W.alternate===null&&(W.flags|=67108866),W}function L(W,H,Q,ue){return H===null||H.tag!==6?(H=gp(Q,W.mode,ue),H.return=W,H):(H=p(H,Q),H.return=W,H)}function F(W,H,Q,ue){var Ie=Q.type;return Ie===z?se(W,H,Q.props.children,ue,Q.key):H!==null&&(H.elementType===Ie||typeof Ie=="object"&&Ie&&Ie.$$typeof===ie&&Bi(Ie)===H.type)?(H=p(H,Q.props),tl(H,Q),H.return=W,H):(H=Uc(Q.type,Q.key,Q.props,null,W.mode,ue),tl(H,Q),H.return=W,H)}function J(W,H,Q,ue){return H===null||H.tag!==4||H.stateNode.containerInfo!==Q.containerInfo||H.stateNode.implementation!==Q.implementation?(H=yp(Q,W.mode,ue),H.return=W,H):(H=p(H,Q.children||[]),H.return=W,H)}function se(W,H,Q,ue,Ie){return H===null||H.tag!==7?(H=Di(Q,W.mode,ue,Ie),H.return=W,H):(H=p(H,Q),H.return=W,H)}function pe(W,H,Q){if(typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint")return H=gp(""+H,W.mode,Q),H.return=W,H;if(typeof H=="object"&&H){switch(H.$$typeof){case T:return Q=Uc(H.type,H.key,H.props,null,W.mode,Q),tl(Q,H),Q.return=W,Q;case M:return H=yp(H,W.mode,Q),H.return=W,H;case ie:return H=Bi(H),pe(W,H,Q)}if(oe(H)||ae(H))return H=Di(H,W.mode,Q,null),H.return=W,H;if(typeof H.then=="function")return pe(W,Zc(H),Q);if(H.$$typeof===X)return pe(W,Gc(W,H),Q);eu(W,H)}return null}function Z(W,H,Q,ue){var Ie=H===null?null:H.key;if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return Ie===null?L(W,H,""+Q,ue):null;if(typeof Q=="object"&&Q){switch(Q.$$typeof){case T:return Q.key===Ie?F(W,H,Q,ue):null;case M:return Q.key===Ie?J(W,H,Q,ue):null;case ie:return Q=Bi(Q),Z(W,H,Q,ue)}if(oe(Q)||ae(Q))return Ie===null?se(W,H,Q,ue,null):null;if(typeof Q.then=="function")return Z(W,H,Zc(Q),ue);if(Q.$$typeof===X)return Z(W,H,Gc(W,Q),ue);eu(W,Q)}return null}function re(W,H,Q,ue,Ie){if(typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint")return W=W.get(Q)||null,L(H,W,""+ue,Ie);if(typeof ue=="object"&&ue){switch(ue.$$typeof){case T:return W=W.get(ue.key===null?Q:ue.key)||null,F(H,W,ue,Ie);case M:return W=W.get(ue.key===null?Q:ue.key)||null,J(H,W,ue,Ie);case ie:return ue=Bi(ue),re(W,H,Q,ue,Ie)}if(oe(ue)||ae(ue))return W=W.get(Q)||null,se(H,W,ue,Ie,null);if(typeof ue.then=="function")return re(W,H,Q,Zc(ue),Ie);if(ue.$$typeof===X)return re(W,H,Q,Gc(H,ue),Ie);eu(H,ue)}return null}function Ce(W,H,Q,ue){for(var Ie=null,nt=null,Se=H,qe=H=0,Ke=null;Se!==null&&qe<Q.length;qe++){Se.index>qe?(Ke=Se,Se=null):Ke=Se.sibling;var Ze=Z(W,Se,Q[qe],ue);if(Ze===null){Se===null&&(Se=Ke);break}n&&Se&&Ze.alternate===null&&r(W,Se),H=g(Ze,H,qe),nt===null?Ie=Ze:nt.sibling=Ze,nt=Ze,Se=Ke}if(qe===Q.length)return i(W,Se),Ge&&Jr(W,qe),Ie;if(Se===null){for(;qe<Q.length;qe++)Se=pe(W,Q[qe],ue),Se!==null&&(H=g(Se,H,qe),nt===null?Ie=Se:nt.sibling=Se,nt=Se);return Ge&&Jr(W,qe),Ie}for(Se=l(Se);qe<Q.length;qe++)Ke=re(Se,W,qe,Q[qe],ue),Ke!==null&&(n&&Ke.alternate!==null&&Se.delete(Ke.key===null?qe:Ke.key),H=g(Ke,H,qe),nt===null?Ie=Ke:nt.sibling=Ke,nt=Ke);return n&&Se.forEach(function(Za){return r(W,Za)}),Ge&&Jr(W,qe),Ie}function Re(W,H,Q,ue){if(Q==null)throw Error(s(151));for(var Ie=null,nt=null,Se=H,qe=H=0,Ke=null,Ze=Q.next();Se!==null&&!Ze.done;qe++,Ze=Q.next()){Se.index>qe?(Ke=Se,Se=null):Ke=Se.sibling;var Za=Z(W,Se,Ze.value,ue);if(Za===null){Se===null&&(Se=Ke);break}n&&Se&&Za.alternate===null&&r(W,Se),H=g(Za,H,qe),nt===null?Ie=Za:nt.sibling=Za,nt=Za,Se=Ke}if(Ze.done)return i(W,Se),Ge&&Jr(W,qe),Ie;if(Se===null){for(;!Ze.done;qe++,Ze=Q.next())Ze=pe(W,Ze.value,ue),Ze!==null&&(H=g(Ze,H,qe),nt===null?Ie=Ze:nt.sibling=Ze,nt=Ze);return Ge&&Jr(W,qe),Ie}for(Se=l(Se);!Ze.done;qe++,Ze=Q.next())Ze=re(Se,W,qe,Ze.value,ue),Ze!==null&&(n&&Ze.alternate!==null&&Se.delete(Ze.key===null?qe:Ze.key),H=g(Ze,H,qe),nt===null?Ie=Ze:nt.sibling=Ze,nt=Ze);return n&&Se.forEach(function(WI){return r(W,WI)}),Ge&&Jr(W,qe),Ie}function ut(W,H,Q,ue){if(typeof Q=="object"&&Q&&Q.type===z&&Q.key===null&&(Q=Q.props.children),typeof Q=="object"&&Q){switch(Q.$$typeof){case T:e:{for(var Ie=Q.key;H!==null;){if(H.key===Ie){if(Ie=Q.type,Ie===z){if(H.tag===7){i(W,H.sibling),ue=p(H,Q.props.children),ue.return=W,W=ue;break e}}else if(H.elementType===Ie||typeof Ie=="object"&&Ie&&Ie.$$typeof===ie&&Bi(Ie)===H.type){i(W,H.sibling),ue=p(H,Q.props),tl(ue,Q),ue.return=W,W=ue;break e}i(W,H);break}else r(W,H);H=H.sibling}Q.type===z?(ue=Di(Q.props.children,W.mode,ue,Q.key),ue.return=W,W=ue):(ue=Uc(Q.type,Q.key,Q.props,null,W.mode,ue),tl(ue,Q),ue.return=W,W=ue)}return C(W);case M:e:{for(Ie=Q.key;H!==null;){if(H.key===Ie)if(H.tag===4&&H.stateNode.containerInfo===Q.containerInfo&&H.stateNode.implementation===Q.implementation){i(W,H.sibling),ue=p(H,Q.children||[]),ue.return=W,W=ue;break e}else{i(W,H);break}else r(W,H);H=H.sibling}ue=yp(Q,W.mode,ue),ue.return=W,W=ue}return C(W);case ie:return Q=Bi(Q),ut(W,H,Q,ue)}if(oe(Q))return Ce(W,H,Q,ue);if(ae(Q)){if(Ie=ae(Q),typeof Ie!="function")throw Error(s(150));return Q=Ie.call(Q),Re(W,H,Q,ue)}if(typeof Q.then=="function")return ut(W,H,Zc(Q),ue);if(Q.$$typeof===X)return ut(W,H,Gc(W,Q),ue);eu(W,Q)}return typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint"?(Q=""+Q,H!==null&&H.tag===6?(i(W,H.sibling),ue=p(H,Q),ue.return=W,W=ue):(i(W,H),ue=gp(Q,W.mode,ue),ue.return=W,W=ue),C(W)):i(W,H)}return function(W,H,Q,ue){try{el=0;var Ie=ut(W,H,Q,ue);return Uo=null,Ie}catch(Se){if(Se===Wo||Se===Xc)throw Se;var nt=Dn(29,Se,null,W.mode);return nt.lanes=ue,nt.return=W,nt}}}var Hi=gb(!0),yb=gb(!1),za=!1;function Lp(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Op(n,r){n=n.updateQueue,r.updateQueue===n&&(r.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,callbacks:null})}function $i(n){return{lane:n,tag:0,payload:null,callback:null,next:null}}function Wi(n,r,i){var l=n.updateQueue;if(l===null)return null;if(l=l.shared,tt&2){var p=l.pending;return p===null?r.next=r:(r.next=p.next,p.next=r),l.pending=r,r=Wc(n),eb(n,null,i),r}return $c(n,l,r,i),Wc(n)}function nl(n,r,i){if(r=r.updateQueue,r!==null&&(r=r.shared,i&4194048)){var l=r.lanes;l&=n.pendingLanes,i|=l,r.lanes=i,To(n,i)}}function Ap(n,r){var i=n.updateQueue,l=n.alternate;if(l!==null&&(l=l.updateQueue,i===l)){var p=null,g=null;if(i=i.firstBaseUpdate,i!==null){do{var C={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};g===null?p=g=C:g=g.next=C,i=i.next}while(i!==null);g===null?p=g=r:g=g.next=r}else p=g=r;i={baseState:l.baseState,firstBaseUpdate:p,lastBaseUpdate:g,shared:l.shared,callbacks:l.callbacks},n.updateQueue=i;return}n=i.lastBaseUpdate,n===null?i.firstBaseUpdate=r:n.next=r,i.lastBaseUpdate=r}var Rp=!1;function rl(){if(Rp){var n=$o;if(n!==null)throw n}}function al(n,r,i,l){Rp=!1;var p=n.updateQueue;za=!1;var g=p.firstBaseUpdate,C=p.lastBaseUpdate,L=p.shared.pending;if(L!==null){p.shared.pending=null;var F=L,J=F.next;F.next=null,C===null?g=J:C.next=J,C=F;var se=n.alternate;se!==null&&(se=se.updateQueue,L=se.lastBaseUpdate,L!==C&&(L===null?se.firstBaseUpdate=J:L.next=J,se.lastBaseUpdate=F))}if(g!==null){var pe=p.baseState;C=0,se=J=F=null,L=g;do{var Z=L.lane&-536870913,re=Z!==L.lane;if(re?(Ue&Z)===Z:(l&Z)===Z){Z!==0&&Z===Ho&&(Rp=!0),se!==null&&(se=se.next={lane:0,tag:L.tag,payload:L.payload,callback:null,next:null});e:{var Ce=n,Re=L;Z=r;var ut=i;switch(Re.tag){case 1:if(Ce=Re.payload,typeof Ce=="function"){pe=Ce.call(ut,pe,Z);break e}pe=Ce;break e;case 3:Ce.flags=Ce.flags&-65537|128;case 0:if(Ce=Re.payload,Z=typeof Ce=="function"?Ce.call(ut,pe,Z):Ce,Z==null)break e;pe=S({},pe,Z);break e;case 2:za=!0}}Z=L.callback,Z!==null&&(n.flags|=64,re&&(n.flags|=8192),re=p.callbacks,re===null?p.callbacks=[Z]:re.push(Z))}else re={lane:Z,tag:L.tag,payload:L.payload,callback:L.callback,next:null},se===null?(J=se=re,F=pe):se=se.next=re,C|=Z;if(L=L.next,L===null){if(L=p.shared.pending,L===null)break;re=L,L=re.next,re.next=null,p.lastBaseUpdate=re,p.shared.pending=null}}while(!0);se===null&&(F=pe),p.baseState=F,p.firstBaseUpdate=J,p.lastBaseUpdate=se,g===null&&(p.shared.lanes=0),Ha|=C,n.lanes=C,n.memoizedState=pe}}function vb(n,r){if(typeof n!="function")throw Error(s(191,n));n.call(r)}function bb(n,r){var i=n.callbacks;if(i!==null)for(n.callbacks=null,n=0;n<i.length;n++)vb(i[n],r)}var Ko=Fe(null),tu=Fe(0);function wb(n,r){n=sa,Le(tu,n),Le(Ko,r),sa=n|r.baseLanes}function Mp(){Le(tu,sa),Le(Ko,Ko.current)}function Pp(){sa=tu.current,Ne(Ko),Ne(tu)}var jn=Fe(null),vr=null;function qa(n){var r=n.alternate;Le(Ot,Ot.current&1),Le(jn,n),vr===null&&(r===null||Ko.current!==null||r.memoizedState!==null)&&(vr=n)}function Np(n){Le(Ot,Ot.current),Le(jn,n),vr===null&&(vr=n)}function _b(n){n.tag===22?(Le(Ot,Ot.current),Le(jn,n),vr===null&&(vr=n)):Fa(n)}function Fa(){Le(Ot,Ot.current),Le(jn,jn.current)}function zn(n){Ne(jn),vr===n&&(vr=null),Ne(Ot)}var Ot=Fe(0);function nu(n){for(var r=n;r!==null;){if(r.tag===13){var i=r.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||Fh(i)||Bh(i)))return r}else if(r.tag===19&&(r.memoizedProps.revealOrder==="forwards"||r.memoizedProps.revealOrder==="backwards"||r.memoizedProps.revealOrder==="unstable_legacy-backwards"||r.memoizedProps.revealOrder==="together")){if(r.flags&128)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===n)break;for(;r.sibling===null;){if(r.return===null||r.return===n)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var Zr=0,ze=null,lt=null,jt=null,ru=!1,Qo=!1,Ui=!1,au=0,il=0,Go=null,A6=0;function St(){throw Error(s(321))}function Dp(n,r){if(r===null)return!1;for(var i=0;i<r.length&&i<n.length;i++)if(!Nn(n[i],r[i]))return!1;return!0}function jp(n,r,i,l,p,g){return Zr=g,ze=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,le.H=n===null||n.memoizedState===null?a2:Yp,Ui=!1,g=i(l,p),Ui=!1,Qo&&(g=kb(r,i,l,p)),xb(n),g}function xb(n){le.H=ll;var r=lt!==null&&lt.next!==null;if(Zr=0,jt=lt=ze=null,ru=!1,il=0,Go=null,r)throw Error(s(300));n===null||zt||(n=n.dependencies,n!==null&&Qc(n)&&(zt=!0))}function kb(n,r,i,l){ze=n;var p=0;do{if(Qo&&(Go=null),il=0,Qo=!1,25<=p)throw Error(s(301));if(p+=1,jt=lt=null,n.updateQueue!=null){var g=n.updateQueue;g.lastEffect=null,g.events=null,g.stores=null,g.memoCache!=null&&(g.memoCache.index=0)}le.H=i2,g=r(i,l)}while(Qo);return g}function R6(){var n=le.H,r=n.useState()[0];return r=typeof r.then=="function"?ol(r):r,n=n.useState()[0],(lt===null?null:lt.memoizedState)!==n&&(ze.flags|=1024),r}function zp(){var n=au!==0;return au=0,n}function qp(n,r,i){r.updateQueue=n.updateQueue,r.flags&=-2053,n.lanes&=~i}function Fp(n){if(ru){for(n=n.memoizedState;n!==null;){var r=n.queue;r!==null&&(r.pending=null),n=n.next}ru=!1}Zr=0,jt=lt=ze=null,Qo=!1,il=au=0,Go=null}function mn(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return jt===null?ze.memoizedState=jt=n:jt=jt.next=n,jt}function At(){if(lt===null){var n=ze.alternate;n=n===null?null:n.memoizedState}else n=lt.next;var r=jt===null?ze.memoizedState:jt.next;if(r!==null)jt=r,lt=n;else{if(n===null)throw ze.alternate===null?Error(s(467)):Error(s(310));lt=n,n={memoizedState:lt.memoizedState,baseState:lt.baseState,baseQueue:lt.baseQueue,queue:lt.queue,next:null},jt===null?ze.memoizedState=jt=n:jt=jt.next=n}return jt}function iu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ol(n){var r=il;return il+=1,Go===null&&(Go=[]),n=pb(Go,n,r),r=ze,(jt===null?r.memoizedState:jt.next)===null&&(r=r.alternate,le.H=r===null||r.memoizedState===null?a2:Yp),n}function ou(n){if(typeof n=="object"&&n){if(typeof n.then=="function")return ol(n);if(n.$$typeof===X)return en(n)}throw Error(s(438,String(n)))}function Bp(n){var r=null,i=ze.updateQueue;if(i!==null&&(r=i.memoCache),r==null){var l=ze.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(r={data:l.data.map(function(p){return p.slice()}),index:0})))}if(r??(r={data:[],index:0}),i===null&&(i=iu(),ze.updateQueue=i),i.memoCache=r,i=r.data[r.index],i===void 0)for(i=r.data[r.index]=Array(n),l=0;l<n;l++)i[l]=me;return r.index++,i}function ea(n,r){return typeof r=="function"?r(n):r}function su(n){return Vp(At(),lt,n)}function Vp(n,r,i){var l=n.queue;if(l===null)throw Error(s(311));l.lastRenderedReducer=i;var p=n.baseQueue,g=l.pending;if(g!==null){if(p!==null){var C=p.next;p.next=g.next,g.next=C}r.baseQueue=p=g,l.pending=null}if(g=n.baseState,p===null)n.memoizedState=g;else{r=p.next;var L=C=null,F=null,J=r,se=!1;do{var pe=J.lane&-536870913;if(pe===J.lane?(Zr&pe)===pe:(Ue&pe)===pe){var Z=J.revertLane;if(Z===0)F!==null&&(F=F.next={lane:0,revertLane:0,gesture:null,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null}),pe===Ho&&(se=!0);else if((Zr&Z)===Z){J=J.next,Z===Ho&&(se=!0);continue}else pe={lane:0,revertLane:J.revertLane,gesture:null,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null},F===null?(L=F=pe,C=g):F=F.next=pe,ze.lanes|=Z,Ha|=Z;pe=J.action,Ui&&i(g,pe),g=J.hasEagerState?J.eagerState:i(g,pe)}else Z={lane:pe,revertLane:J.revertLane,gesture:J.gesture,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null},F===null?(L=F=Z,C=g):F=F.next=Z,ze.lanes|=pe,Ha|=pe;J=J.next}while(J!==null&&J!==r);if(F===null?C=g:F.next=L,!Nn(g,n.memoizedState)&&(zt=!0,se&&(i=$o,i!==null)))throw i;n.memoizedState=g,n.baseState=C,n.baseQueue=F,l.lastRenderedState=g}return p===null&&(l.lanes=0),[n.memoizedState,l.dispatch]}function Hp(n){var r=At(),i=r.queue;if(i===null)throw Error(s(311));i.lastRenderedReducer=n;var l=i.dispatch,p=i.pending,g=r.memoizedState;if(p!==null){i.pending=null;var C=p=p.next;do g=n(g,C.action),C=C.next;while(C!==p);Nn(g,r.memoizedState)||(zt=!0),r.memoizedState=g,r.baseQueue===null&&(r.baseState=g),i.lastRenderedState=g}return[g,l]}function Cb(n,r,i){var l=ze,p=At(),g=Ge;if(g){if(i===void 0)throw Error(s(407));i=i()}else i=r();var C=!Nn((lt||p).memoizedState,i);if(C&&(p.memoizedState=i,zt=!0),p=p.queue,Up(Tb.bind(null,l,p,n),[n]),p.getSnapshot!==r||C||jt!==null&&jt.memoizedState.tag&1){if(l.flags|=2048,Jo(9,{destroy:void 0},Eb.bind(null,l,p,i,r),null),ft===null)throw Error(s(349));g||Zr&127||Sb(l,r,i)}return i}function Sb(n,r,i){n.flags|=16384,n={getSnapshot:r,value:i},r=ze.updateQueue,r===null?(r=iu(),ze.updateQueue=r,r.stores=[n]):(i=r.stores,i===null?r.stores=[n]:i.push(n))}function Eb(n,r,i,l){r.value=i,r.getSnapshot=l,Ib(r)&&Lb(n)}function Tb(n,r,i){return i(function(){Ib(r)&&Lb(n)})}function Ib(n){var r=n.getSnapshot;n=n.value;try{var i=r();return!Nn(n,i)}catch{return!0}}function Lb(n){var r=Ni(n,2);r!==null&&Sn(r,n,2)}function $p(n){var r=mn();if(typeof n=="function"){var i=n;if(n=i(),Ui){Qe(!0);try{i()}finally{Qe(!1)}}}return r.memoizedState=r.baseState=n,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ea,lastRenderedState:n},r}function Ob(n,r,i,l){return n.baseState=i,Vp(n,lt,typeof l=="function"?l:ea)}function M6(n,r,i,l,p){if(uu(n))throw Error(s(485));if(n=r.action,n!==null){var g={payload:p,action:n,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(C){g.listeners.push(C)}};le.T===null?g.isTransition=!1:i(!0),l(g),i=r.pending,i===null?(g.next=r.pending=g,Ab(r,g)):(g.next=i.next,r.pending=i.next=g)}}function Ab(n,r){var i=r.action,l=r.payload,p=n.state;if(r.isTransition){var g=le.T,C={};le.T=C;try{var L=i(p,l),F=le.S;F!==null&&F(C,L),Rb(n,r,L)}catch(J){Wp(n,r,J)}finally{g!==null&&C.types!==null&&(g.types=C.types),le.T=g}}else try{g=i(p,l),Rb(n,r,g)}catch(J){Wp(n,r,J)}}function Rb(n,r,i){typeof i=="object"&&i&&typeof i.then=="function"?i.then(function(l){Mb(n,r,l)},function(l){return Wp(n,r,l)}):Mb(n,r,i)}function Mb(n,r,i){r.status="fulfilled",r.value=i,Pb(r),n.state=i,r=n.pending,r!==null&&(i=r.next,i===r?n.pending=null:(i=i.next,r.next=i,Ab(n,i)))}function Wp(n,r,i){var l=n.pending;if(n.pending=null,l!==null){l=l.next;do r.status="rejected",r.reason=i,Pb(r),r=r.next;while(r!==l)}n.action=null}function Pb(n){n=n.listeners;for(var r=0;r<n.length;r++)(0,n[r])()}function Nb(n,r){return r}function Db(n,r){if(Ge){var i=ft.formState;if(i!==null){e:{var l=ze;if(Ge){if(vt){t:{for(var p=vt,g=Zn;p.nodeType!==8;){if(!g){p=null;break t}if(p=tr(p.nextSibling),p===null){p=null;break t}}g=p.data,p=g==="F!"||g==="F"?p:null}if(p){vt=tr(p.nextSibling),l=p.data==="F!";break e}}Da(l)}l=!1}l&&(r=i[0])}}return i=mn(),i.memoizedState=i.baseState=r,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Nb,lastRenderedState:r},i.queue=l,i=t2.bind(null,ze,l),l.dispatch=i,l=$p(!1),g=Xp.bind(null,ze,!1,l.queue),l=mn(),p={state:r,dispatch:null,action:n,pending:null},l.queue=p,i=M6.bind(null,ze,p,g,i),p.dispatch=i,l.memoizedState=n,[r,i,!1]}function jb(n){return zb(At(),lt,n)}function zb(n,r,i){if(r=Vp(n,r,Nb)[0],n=su(ea)[0],typeof r=="object"&&r&&typeof r.then=="function")try{var l=ol(r)}catch(C){throw C===Wo?Xc:C}else l=r;r=At();var p=r.queue,g=p.dispatch;return i!==r.memoizedState&&(ze.flags|=2048,Jo(9,{destroy:void 0},P6.bind(null,p,i),null)),[l,g,n]}function P6(n,r){n.action=r}function qb(n){var r=At(),i=lt;if(i!==null)return zb(r,i,n);At(),r=r.memoizedState,i=At();var l=i.queue.dispatch;return i.memoizedState=n,[r,l,!1]}function Jo(n,r,i,l){return n={tag:n,create:i,deps:l,inst:r,next:null},r=ze.updateQueue,r===null&&(r=iu(),ze.updateQueue=r),i=r.lastEffect,i===null?r.lastEffect=n.next=n:(l=i.next,i.next=n,n.next=l,r.lastEffect=n),n}function Fb(){return At().memoizedState}function lu(n,r,i,l){var p=mn();ze.flags|=n,p.memoizedState=Jo(1|r,{destroy:void 0},i,l===void 0?null:l)}function cu(n,r,i,l){var p=At();l=l===void 0?null:l;var g=p.memoizedState.inst;lt!==null&&l!==null&&Dp(l,lt.memoizedState.deps)?p.memoizedState=Jo(r,g,i,l):(ze.flags|=n,p.memoizedState=Jo(1|r,g,i,l))}function Bb(n,r){lu(8390656,8,n,r)}function Up(n,r){cu(2048,8,n,r)}function N6(n){ze.flags|=4;var r=ze.updateQueue;if(r===null)r=iu(),ze.updateQueue=r,r.events=[n];else{var i=r.events;i===null?r.events=[n]:i.push(n)}}function Vb(n){var r=At().memoizedState;return N6({ref:r,nextImpl:n}),function(){if(tt&2)throw Error(s(440));return r.impl.apply(void 0,arguments)}}function Hb(n,r){return cu(4,2,n,r)}function $b(n,r){return cu(4,4,n,r)}function Wb(n,r){if(typeof r=="function"){n=n();var i=r(n);return function(){typeof i=="function"?i():r(null)}}if(r!=null)return n=n(),r.current=n,function(){r.current=null}}function Ub(n,r,i){i=i==null?null:i.concat([n]),cu(4,4,Wb.bind(null,r,n),i)}function Kp(){}function Kb(n,r){var i=At();r=r===void 0?null:r;var l=i.memoizedState;return r!==null&&Dp(r,l[1])?l[0]:(i.memoizedState=[n,r],n)}function Qb(n,r){var i=At();r=r===void 0?null:r;var l=i.memoizedState;if(r!==null&&Dp(r,l[1]))return l[0];if(l=n(),Ui){Qe(!0);try{n()}finally{Qe(!1)}}return i.memoizedState=[l,r],l}function Qp(n,r,i){return i===void 0||Zr&1073741824&&!(Ue&261930)?n.memoizedState=r:(n.memoizedState=i,n=U2(),ze.lanes|=n,Ha|=n,i)}function Gb(n,r,i,l){return Nn(i,r)?i:Ko.current===null?!(Zr&42)||Zr&1073741824&&!(Ue&261930)?(zt=!0,n.memoizedState=i):(n=U2(),ze.lanes|=n,Ha|=n,r):(n=Qp(n,i,l),Nn(n,r)||(zt=!0),n)}function Jb(n,r,i,l,p){var g=G.p;G.p=g!==0&&8>g?g:8;var C=le.T,L={};le.T=L,Xp(n,!1,r,i);try{var F=p(),J=le.S;J!==null&&J(L,F),typeof F=="object"&&F&&typeof F.then=="function"?sl(n,r,O6(F,l),er(n)):sl(n,r,l,er(n))}catch(se){sl(n,r,{then:function(){},status:"rejected",reason:se},er())}finally{G.p=g,C!==null&&L.types!==null&&(C.types=L.types),le.T=C}}function D6(){}function Gp(n,r,i,l){if(n.tag!==5)throw Error(s(476));var p=Xb(n).queue;Jb(n,p,r,Oe,i===null?D6:function(){return Yb(n),i(l)})}function Xb(n){var r=n.memoizedState;if(r!==null)return r;r={memoizedState:Oe,baseState:Oe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ea,lastRenderedState:Oe},next:null};var i={};return r.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ea,lastRenderedState:i},next:null},n.memoizedState=r,n=n.alternate,n!==null&&(n.memoizedState=r),r}function Yb(n){var r=Xb(n);r.next===null&&(r=n.alternate.memoizedState),sl(n,r.next.queue,{},er())}function Jp(){return en(Cl)}function Zb(){return At().memoizedState}function e2(){return At().memoizedState}function j6(n){for(var r=n.return;r!==null;){switch(r.tag){case 24:case 3:var i=er();n=$i(i);var l=Wi(r,n,i);l!==null&&(Sn(l,r,i),nl(l,r,i)),r={cache:Sp()},n.payload=r;return}r=r.return}}function z6(n,r,i){var l=er();i={lane:l,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},uu(n)?n2(r,i):(i=hp(n,r,i,l),i!==null&&(Sn(i,n,l),r2(i,r,l)))}function t2(n,r,i){sl(n,r,i,er())}function sl(n,r,i,l){var p={lane:l,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(uu(n))n2(r,p);else{var g=n.alternate;if(n.lanes===0&&(g===null||g.lanes===0)&&(g=r.lastRenderedReducer,g!==null))try{var C=r.lastRenderedState,L=g(C,i);if(p.hasEagerState=!0,p.eagerState=L,Nn(L,C))return $c(n,r,p,0),ft===null&&Hc(),!1}catch{}if(i=hp(n,r,p,l),i!==null)return Sn(i,n,l),r2(i,r,l),!0}return!1}function Xp(n,r,i,l){if(l={lane:2,revertLane:Lh(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},uu(n)){if(r)throw Error(s(479))}else r=hp(n,i,l,2),r!==null&&Sn(r,n,2)}function uu(n){var r=n.alternate;return n===ze||r!==null&&r===ze}function n2(n,r){Qo=ru=!0;var i=n.pending;i===null?r.next=r:(r.next=i.next,i.next=r),n.pending=r}function r2(n,r,i){if(i&4194048){var l=r.lanes;l&=n.pendingLanes,i|=l,r.lanes=i,To(n,i)}}var ll={readContext:en,use:ou,useCallback:St,useContext:St,useEffect:St,useImperativeHandle:St,useLayoutEffect:St,useInsertionEffect:St,useMemo:St,useReducer:St,useRef:St,useState:St,useDebugValue:St,useDeferredValue:St,useTransition:St,useSyncExternalStore:St,useId:St,useHostTransitionStatus:St,useFormState:St,useActionState:St,useOptimistic:St,useMemoCache:St,useCacheRefresh:St};ll.useEffectEvent=St;var a2={readContext:en,use:ou,useCallback:function(n,r){return mn().memoizedState=[n,r===void 0?null:r],n},useContext:en,useEffect:Bb,useImperativeHandle:function(n,r,i){i=i==null?null:i.concat([n]),lu(4194308,4,Wb.bind(null,r,n),i)},useLayoutEffect:function(n,r){return lu(4194308,4,n,r)},useInsertionEffect:function(n,r){lu(4,2,n,r)},useMemo:function(n,r){var i=mn();r=r===void 0?null:r;var l=n();if(Ui){Qe(!0);try{n()}finally{Qe(!1)}}return i.memoizedState=[l,r],l},useReducer:function(n,r,i){var l=mn();if(i!==void 0){var p=i(r);if(Ui){Qe(!0);try{i(r)}finally{Qe(!1)}}}else p=r;return l.memoizedState=l.baseState=p,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:p},l.queue=n,n=n.dispatch=z6.bind(null,ze,n),[l.memoizedState,n]},useRef:function(n){var r=mn();return n={current:n},r.memoizedState=n},useState:function(n){n=$p(n);var r=n.queue,i=t2.bind(null,ze,r);return r.dispatch=i,[n.memoizedState,i]},useDebugValue:Kp,useDeferredValue:function(n,r){return Qp(mn(),n,r)},useTransition:function(){var n=$p(!1);return n=Jb.bind(null,ze,n.queue,!0,!1),mn().memoizedState=n,[!1,n]},useSyncExternalStore:function(n,r,i){var l=ze,p=mn();if(Ge){if(i===void 0)throw Error(s(407));i=i()}else{if(i=r(),ft===null)throw Error(s(349));Ue&127||Sb(l,r,i)}p.memoizedState=i;var g={value:i,getSnapshot:r};return p.queue=g,Bb(Tb.bind(null,l,g,n),[n]),l.flags|=2048,Jo(9,{destroy:void 0},Eb.bind(null,l,g,i,r),null),i},useId:function(){var n=mn(),r=ft.identifierPrefix;if(Ge){var i=Rr,l=Ar;i=(l&~(1<<32-gt(l)-1)).toString(32)+i,r="_"+r+"R_"+i,i=au++,0<i&&(r+="H"+i.toString(32)),r+="_"}else i=A6++,r="_"+r+"r_"+i.toString(32)+"_";return n.memoizedState=r},useHostTransitionStatus:Jp,useFormState:Db,useActionState:Db,useOptimistic:function(n){var r=mn();r.memoizedState=r.baseState=n;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=i,r=Xp.bind(null,ze,!0,i),i.dispatch=r,[n,r]},useMemoCache:Bp,useCacheRefresh:function(){return mn().memoizedState=j6.bind(null,ze)},useEffectEvent:function(n){var r=mn(),i={impl:n};return r.memoizedState=i,function(){if(tt&2)throw Error(s(440));return i.impl.apply(void 0,arguments)}}},Yp={readContext:en,use:ou,useCallback:Kb,useContext:en,useEffect:Up,useImperativeHandle:Ub,useInsertionEffect:Hb,useLayoutEffect:$b,useMemo:Qb,useReducer:su,useRef:Fb,useState:function(){return su(ea)},useDebugValue:Kp,useDeferredValue:function(n,r){return Gb(At(),lt.memoizedState,n,r)},useTransition:function(){var n=su(ea)[0],r=At().memoizedState;return[typeof n=="boolean"?n:ol(n),r]},useSyncExternalStore:Cb,useId:Zb,useHostTransitionStatus:Jp,useFormState:jb,useActionState:jb,useOptimistic:function(n,r){return Ob(At(),lt,n,r)},useMemoCache:Bp,useCacheRefresh:e2};Yp.useEffectEvent=Vb;var i2={readContext:en,use:ou,useCallback:Kb,useContext:en,useEffect:Up,useImperativeHandle:Ub,useInsertionEffect:Hb,useLayoutEffect:$b,useMemo:Qb,useReducer:Hp,useRef:Fb,useState:function(){return Hp(ea)},useDebugValue:Kp,useDeferredValue:function(n,r){var i=At();return lt===null?Qp(i,n,r):Gb(i,lt.memoizedState,n,r)},useTransition:function(){var n=Hp(ea)[0],r=At().memoizedState;return[typeof n=="boolean"?n:ol(n),r]},useSyncExternalStore:Cb,useId:Zb,useHostTransitionStatus:Jp,useFormState:qb,useActionState:qb,useOptimistic:function(n,r){var i=At();return lt===null?(i.baseState=n,[n,i.queue.dispatch]):Ob(i,lt,n,r)},useMemoCache:Bp,useCacheRefresh:e2};i2.useEffectEvent=Vb;function Zp(n,r,i,l){r=n.memoizedState,i=i(l,r),i=i==null?r:S({},r,i),n.memoizedState=i,n.lanes===0&&(n.updateQueue.baseState=i)}var eh={enqueueSetState:function(n,r,i){n=n._reactInternals;var l=er(),p=$i(l);p.payload=r,i!=null&&(p.callback=i),r=Wi(n,p,l),r!==null&&(Sn(r,n,l),nl(r,n,l))},enqueueReplaceState:function(n,r,i){n=n._reactInternals;var l=er(),p=$i(l);p.tag=1,p.payload=r,i!=null&&(p.callback=i),r=Wi(n,p,l),r!==null&&(Sn(r,n,l),nl(r,n,l))},enqueueForceUpdate:function(n,r){n=n._reactInternals;var i=er(),l=$i(i);l.tag=2,r!=null&&(l.callback=r),r=Wi(n,l,i),r!==null&&(Sn(r,n,i),nl(r,n,i))}};function o2(n,r,i,l,p,g,C){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(l,g,C):r.prototype&&r.prototype.isPureReactComponent?!Qs(i,l)||!Qs(p,g):!0}function s2(n,r,i,l){n=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(i,l),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(i,l),r.state!==n&&eh.enqueueReplaceState(r,r.state,null)}function Ki(n,r){var i=r;if("ref"in r)for(var l in i={},r)l!=="ref"&&(i[l]=r[l]);if(n=n.defaultProps)for(var p in i===r&&(i=S({},i)),n)i[p]===void 0&&(i[p]=n[p]);return i}function q6(n){Vc(n)}function F6(n){console.error(n)}function B6(n){Vc(n)}function du(n,r){try{var i=n.onUncaughtError;i(r.value,{componentStack:r.stack})}catch(l){setTimeout(function(){throw l})}}function l2(n,r,i){try{var l=n.onCaughtError;l(i.value,{componentStack:i.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(p){setTimeout(function(){throw p})}}function th(n,r,i){return i=$i(i),i.tag=3,i.payload={element:null},i.callback=function(){du(n,r)},i}function c2(n){return n=$i(n),n.tag=3,n}function u2(n,r,i,l){var p=i.type.getDerivedStateFromError;if(typeof p=="function"){var g=l.value;n.payload=function(){return p(g)},n.callback=function(){l2(r,i,l)}}var C=i.stateNode;C!==null&&typeof C.componentDidCatch=="function"&&(n.callback=function(){l2(r,i,l),typeof p!="function"&&($a===null?$a=new Set([this]):$a.add(this));var L=l.stack;this.componentDidCatch(l.value,{componentStack:L===null?"":L})})}function V6(n,r,i,l,p){if(i.flags|=32768,typeof l=="object"&&l&&typeof l.then=="function"){if(r=i.alternate,r!==null&&Vo(r,i,p,!0),i=jn.current,i!==null){switch(i.tag){case 31:case 13:return vr===null?ku():i.alternate===null&&Et===0&&(Et=3),i.flags&=-257,i.flags|=65536,i.lanes=p,l===Yc?i.flags|=16384:(r=i.updateQueue,r===null?i.updateQueue=new Set([l]):r.add(l),Eh(n,l,p)),!1;case 22:return i.flags|=65536,l===Yc?i.flags|=16384:(r=i.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([l])},i.updateQueue=r):(i=r.retryQueue,i===null?r.retryQueue=new Set([l]):i.add(l)),Eh(n,l,p)),!1}throw Error(s(435,i.tag))}return Eh(n,l,p),ku(),!1}if(Ge)return r=jn.current,r===null?(l!==wp&&(r=Error(s(423),{cause:l}),Xs(Jn(r,i))),n=n.current.alternate,n.flags|=65536,p&=-p,n.lanes|=p,l=Jn(l,i),p=th(n.stateNode,l,p),Ap(n,p),Et!==4&&(Et=2)):(!(r.flags&65536)&&(r.flags|=256),r.flags|=65536,r.lanes=p,l!==wp&&(n=Error(s(422),{cause:l}),Xs(Jn(n,i)))),!1;var g=Error(s(520),{cause:l});if(g=Jn(g,i),gl===null?gl=[g]:gl.push(g),Et!==4&&(Et=2),r===null)return!0;l=Jn(l,i),i=r;do{switch(i.tag){case 3:return i.flags|=65536,n=p&-p,i.lanes|=n,n=th(i.stateNode,l,n),Ap(i,n),!1;case 1:if(r=i.type,g=i.stateNode,!(i.flags&128)&&(typeof r.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&($a===null||!$a.has(g))))return i.flags|=65536,p&=-p,i.lanes|=p,p=c2(p),u2(p,n,i,l),Ap(i,p),!1}i=i.return}while(i!==null);return!1}var nh=Error(s(461)),zt=!1;function tn(n,r,i,l){r.child=n===null?yb(r,null,i,l):Hi(r,n.child,i,l)}function d2(n,r,i,l,p){i=i.render;var g=r.ref;if("ref"in l){var C={};for(var L in l)L!=="ref"&&(C[L]=l[L])}else C=l;return qi(r),l=jp(n,r,i,C,g,p),L=zp(),n!==null&&!zt?(qp(n,r,p),ta(n,r,p)):(Ge&&L&&vp(r),r.flags|=1,tn(n,r,l,p),r.child)}function f2(n,r,i,l,p){if(n===null){var g=i.type;return typeof g=="function"&&!mp(g)&&g.defaultProps===void 0&&i.compare===null?(r.tag=15,r.type=g,p2(n,r,g,l,p)):(n=Uc(i.type,null,l,r,r.mode,p),n.ref=r.ref,n.return=r,r.child=n)}if(g=n.child,!uh(n,p)){var C=g.memoizedProps;if(i=i.compare,i=i===null?Qs:i,i(C,l)&&n.ref===r.ref)return ta(n,r,p)}return r.flags|=1,n=Gr(g,l),n.ref=r.ref,n.return=r,r.child=n}function p2(n,r,i,l,p){if(n!==null){var g=n.memoizedProps;if(Qs(g,l)&&n.ref===r.ref)if(zt=!1,r.pendingProps=l=g,uh(n,p))n.flags&131072&&(zt=!0);else return r.lanes=n.lanes,ta(n,r,p)}return rh(n,r,i,l,p)}function h2(n,r,i,l){var p=l.children,g=n===null?null:n.memoizedState;if(n===null&&r.stateNode===null&&(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if(r.flags&128){if(g=g===null?i:g.baseLanes|i,n!==null){for(l=r.child=n.child,p=0;l!==null;)p=p|l.lanes|l.childLanes,l=l.sibling;l=p&~g}else l=0,r.child=null;return m2(n,r,g,i,l)}if(i&536870912)r.memoizedState={baseLanes:0,cachePool:null},n!==null&&Jc(r,g===null?null:g.cachePool),g===null?Mp():wb(r,g),_b(r);else return l=r.lanes=536870912,m2(n,r,g===null?i:g.baseLanes|i,i,l)}else g===null?(n!==null&&Jc(r,null),Mp(),Fa(r)):(Jc(r,g.cachePool),wb(r,g),Fa(r),r.memoizedState=null);return tn(n,r,p,i),r.child}function cl(n,r){return n!==null&&n.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function m2(n,r,i,l,p){var g=Tp();return g=g===null?null:{parent:Dt._currentValue,pool:g},r.memoizedState={baseLanes:i,cachePool:g},n!==null&&Jc(r,null),Mp(),_b(r),n!==null&&Vo(n,r,l,!0),r.childLanes=p,null}function fu(n,r){return r=hu({mode:r.mode,children:r.children},n.mode),r.ref=n.ref,n.child=r,r.return=n,r}function g2(n,r,i){return Hi(r,n.child,null,i),n=fu(r,r.pendingProps),n.flags|=2,zn(r),r.memoizedState=null,n}function H6(n,r,i){var l=r.pendingProps,p=(r.flags&128)!=0;if(r.flags&=-129,n===null){if(Ge){if(l.mode==="hidden")return n=fu(r,l),r.lanes=536870912,cl(null,n);if(Np(r),(n=vt)?(n=Lw(n,Zn),n=n!==null&&n.data==="&"?n:null,n!==null&&(r.memoizedState={dehydrated:n,treeContext:Pa===null?null:{id:Ar,overflow:Rr},retryLane:536870912,hydrationErrors:null},i=nb(n),i.return=r,r.child=i,Zt=r,vt=null)):n=null,n===null)throw Da(r);return r.lanes=536870912,null}return fu(r,l)}var g=n.memoizedState;if(g!==null){var C=g.dehydrated;if(Np(r),p)if(r.flags&256)r.flags&=-257,r=g2(n,r,i);else if(r.memoizedState!==null)r.child=n.child,r.flags|=128,r=null;else throw Error(s(558));else if(zt||Vo(n,r,i,!1),p=(i&n.childLanes)!==0,zt||p){if(l=ft,l!==null&&(C=Tc(l,i),C!==0&&C!==g.retryLane))throw g.retryLane=C,Ni(n,C),Sn(l,n,C),nh;ku(),r=g2(n,r,i)}else n=g.treeContext,vt=tr(C.nextSibling),Zt=r,Ge=!0,Na=null,Zn=!1,n!==null&&ib(r,n),r=fu(r,l),r.flags|=4096;return r}return n=Gr(n.child,{mode:l.mode,children:l.children}),n.ref=r.ref,r.child=n,n.return=r,n}function pu(n,r){var i=r.ref;if(i===null)n!==null&&n.ref!==null&&(r.flags|=4194816);else{if(typeof i!="function"&&typeof i!="object")throw Error(s(284));(n===null||n.ref!==i)&&(r.flags|=4194816)}}function rh(n,r,i,l,p){return qi(r),i=jp(n,r,i,l,void 0,p),l=zp(),n!==null&&!zt?(qp(n,r,p),ta(n,r,p)):(Ge&&l&&vp(r),r.flags|=1,tn(n,r,i,p),r.child)}function y2(n,r,i,l,p,g){return qi(r),r.updateQueue=null,i=kb(r,l,i,p),xb(n),l=zp(),n!==null&&!zt?(qp(n,r,g),ta(n,r,g)):(Ge&&l&&vp(r),r.flags|=1,tn(n,r,i,g),r.child)}function v2(n,r,i,l,p){if(qi(r),r.stateNode===null){var g=zo,C=i.contextType;typeof C=="object"&&C&&(g=en(C)),g=new i(l,g),r.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,g.updater=eh,r.stateNode=g,g._reactInternals=r,g=r.stateNode,g.props=l,g.state=r.memoizedState,g.refs={},Lp(r),C=i.contextType,g.context=typeof C=="object"&&C?en(C):zo,g.state=r.memoizedState,C=i.getDerivedStateFromProps,typeof C=="function"&&(Zp(r,i,C,l),g.state=r.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof g.getSnapshotBeforeUpdate=="function"||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(C=g.state,typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount(),C!==g.state&&eh.enqueueReplaceState(g,g.state,null),al(r,l,g,p),rl(),g.state=r.memoizedState),typeof g.componentDidMount=="function"&&(r.flags|=4194308),l=!0}else if(n===null){g=r.stateNode;var L=r.memoizedProps,F=Ki(i,L);g.props=F;var J=g.context,se=i.contextType;C=zo,typeof se=="object"&&se&&(C=en(se));var pe=i.getDerivedStateFromProps;se=typeof pe=="function"||typeof g.getSnapshotBeforeUpdate=="function",L=r.pendingProps!==L,se||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(L||J!==C)&&s2(r,g,l,C),za=!1;var Z=r.memoizedState;g.state=Z,al(r,l,g,p),rl(),J=r.memoizedState,L||Z!==J||za?(typeof pe=="function"&&(Zp(r,i,pe,l),J=r.memoizedState),(F=za||o2(r,i,F,l,Z,J,C))?(se||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount()),typeof g.componentDidMount=="function"&&(r.flags|=4194308)):(typeof g.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=l,r.memoizedState=J),g.props=l,g.state=J,g.context=C,l=F):(typeof g.componentDidMount=="function"&&(r.flags|=4194308),l=!1)}else{g=r.stateNode,Op(n,r),C=r.memoizedProps,se=Ki(i,C),g.props=se,pe=r.pendingProps,Z=g.context,J=i.contextType,F=zo,typeof J=="object"&&J&&(F=en(J)),L=i.getDerivedStateFromProps,(J=typeof L=="function"||typeof g.getSnapshotBeforeUpdate=="function")||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(C!==pe||Z!==F)&&s2(r,g,l,F),za=!1,Z=r.memoizedState,g.state=Z,al(r,l,g,p),rl();var re=r.memoizedState;C!==pe||Z!==re||za||n!==null&&n.dependencies!==null&&Qc(n.dependencies)?(typeof L=="function"&&(Zp(r,i,L,l),re=r.memoizedState),(se=za||o2(r,i,se,l,Z,re,F)||n!==null&&n.dependencies!==null&&Qc(n.dependencies))?(J||typeof g.UNSAFE_componentWillUpdate!="function"&&typeof g.componentWillUpdate!="function"||(typeof g.componentWillUpdate=="function"&&g.componentWillUpdate(l,re,F),typeof g.UNSAFE_componentWillUpdate=="function"&&g.UNSAFE_componentWillUpdate(l,re,F)),typeof g.componentDidUpdate=="function"&&(r.flags|=4),typeof g.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof g.componentDidUpdate!="function"||C===n.memoizedProps&&Z===n.memoizedState||(r.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||C===n.memoizedProps&&Z===n.memoizedState||(r.flags|=1024),r.memoizedProps=l,r.memoizedState=re),g.props=l,g.state=re,g.context=F,l=se):(typeof g.componentDidUpdate!="function"||C===n.memoizedProps&&Z===n.memoizedState||(r.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||C===n.memoizedProps&&Z===n.memoizedState||(r.flags|=1024),l=!1)}return g=l,pu(n,r),l=(r.flags&128)!=0,g||l?(g=r.stateNode,i=l&&typeof i.getDerivedStateFromError!="function"?null:g.render(),r.flags|=1,n!==null&&l?(r.child=Hi(r,n.child,null,p),r.child=Hi(r,null,i,p)):tn(n,r,i,p),r.memoizedState=g.state,n=r.child):n=ta(n,r,p),n}function b2(n,r,i,l){return ji(),r.flags|=256,tn(n,r,i,l),r.child}var ah={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function ih(n){return{baseLanes:n,cachePool:db()}}function oh(n,r,i){return n=n===null?0:n.childLanes&~i,r&&(n|=Fn),n}function w2(n,r,i){var l=r.pendingProps,p=!1,g=(r.flags&128)!=0,C;if((C=g)||(C=n!==null&&n.memoizedState===null?!1:(Ot.current&2)!=0),C&&(p=!0,r.flags&=-129),C=(r.flags&32)!=0,r.flags&=-33,n===null){if(Ge){if(p?qa(r):Fa(r),(n=vt)?(n=Lw(n,Zn),n=n!==null&&n.data!=="&"?n:null,n!==null&&(r.memoizedState={dehydrated:n,treeContext:Pa===null?null:{id:Ar,overflow:Rr},retryLane:536870912,hydrationErrors:null},i=nb(n),i.return=r,r.child=i,Zt=r,vt=null)):n=null,n===null)throw Da(r);return Bh(n)?r.lanes=32:r.lanes=536870912,null}var L=l.children;return l=l.fallback,p?(Fa(r),p=r.mode,L=hu({mode:"hidden",children:L},p),l=Di(l,p,i,null),L.return=r,l.return=r,L.sibling=l,r.child=L,l=r.child,l.memoizedState=ih(i),l.childLanes=oh(n,C,i),r.memoizedState=ah,cl(null,l)):(qa(r),sh(r,L))}var F=n.memoizedState;if(F!==null&&(L=F.dehydrated,L!==null)){if(g)r.flags&256?(qa(r),r.flags&=-257,r=lh(n,r,i)):r.memoizedState===null?(Fa(r),L=l.fallback,p=r.mode,l=hu({mode:"visible",children:l.children},p),L=Di(L,p,i,null),L.flags|=2,l.return=r,L.return=r,l.sibling=L,r.child=l,Hi(r,n.child,null,i),l=r.child,l.memoizedState=ih(i),l.childLanes=oh(n,C,i),r.memoizedState=ah,r=cl(null,l)):(Fa(r),r.child=n.child,r.flags|=128,r=null);else if(qa(r),Bh(L)){if(C=L.nextSibling&&L.nextSibling.dataset,C)var J=C.dgst;C=J,l=Error(s(419)),l.stack="",l.digest=C,Xs({value:l,source:null,stack:null}),r=lh(n,r,i)}else if(zt||Vo(n,r,i,!1),C=(i&n.childLanes)!==0,zt||C){if(C=ft,C!==null&&(l=Tc(C,i),l!==0&&l!==F.retryLane))throw F.retryLane=l,Ni(n,l),Sn(C,n,l),nh;Fh(L)||ku(),r=lh(n,r,i)}else Fh(L)?(r.flags|=192,r.child=n.child,r=null):(n=F.treeContext,vt=tr(L.nextSibling),Zt=r,Ge=!0,Na=null,Zn=!1,n!==null&&ib(r,n),r=sh(r,l.children),r.flags|=4096);return r}return p?(Fa(r),L=l.fallback,p=r.mode,F=n.child,J=F.sibling,l=Gr(F,{mode:"hidden",children:l.children}),l.subtreeFlags=F.subtreeFlags&65011712,J===null?(L=Di(L,p,i,null),L.flags|=2):L=Gr(J,L),L.return=r,l.return=r,l.sibling=L,r.child=l,cl(null,l),l=r.child,L=n.child.memoizedState,L===null?L=ih(i):(p=L.cachePool,p===null?p=db():(F=Dt._currentValue,p=p.parent===F?p:{parent:F,pool:F}),L={baseLanes:L.baseLanes|i,cachePool:p}),l.memoizedState=L,l.childLanes=oh(n,C,i),r.memoizedState=ah,cl(n.child,l)):(qa(r),i=n.child,n=i.sibling,i=Gr(i,{mode:"visible",children:l.children}),i.return=r,i.sibling=null,n!==null&&(C=r.deletions,C===null?(r.deletions=[n],r.flags|=16):C.push(n)),r.child=i,r.memoizedState=null,i)}function sh(n,r){return r=hu({mode:"visible",children:r},n.mode),r.return=n,n.child=r}function hu(n,r){return n=Dn(22,n,null,r),n.lanes=0,n}function lh(n,r,i){return Hi(r,n.child,null,i),n=sh(r,r.pendingProps.children),n.flags|=2,r.memoizedState=null,n}function _2(n,r,i){n.lanes|=r;var l=n.alternate;l!==null&&(l.lanes|=r),kp(n.return,r,i)}function ch(n,r,i,l,p,g){var C=n.memoizedState;C===null?n.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:l,tail:i,tailMode:p,treeForkCount:g}:(C.isBackwards=r,C.rendering=null,C.renderingStartTime=0,C.last=l,C.tail=i,C.tailMode=p,C.treeForkCount=g)}function x2(n,r,i){var l=r.pendingProps,p=l.revealOrder,g=l.tail;l=l.children;var C=Ot.current,L=(C&2)!=0;if(L?(C=C&1|2,r.flags|=128):C&=1,Le(Ot,C),tn(n,r,l,i),l=Ge?Js:0,!L&&n!==null&&n.flags&128)e:for(n=r.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&_2(n,i,r);else if(n.tag===19)_2(n,i,r);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===r)break e;for(;n.sibling===null;){if(n.return===null||n.return===r)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}switch(p){case"forwards":for(i=r.child,p=null;i!==null;)n=i.alternate,n!==null&&nu(n)===null&&(p=i),i=i.sibling;i=p,i===null?(p=r.child,r.child=null):(p=i.sibling,i.sibling=null),ch(r,!1,p,i,g,l);break;case"backwards":case"unstable_legacy-backwards":for(i=null,p=r.child,r.child=null;p!==null;){if(n=p.alternate,n!==null&&nu(n)===null){r.child=p;break}n=p.sibling,p.sibling=i,i=p,p=n}ch(r,!0,i,null,g,l);break;case"together":ch(r,!1,null,null,void 0,l);break;default:r.memoizedState=null}return r.child}function ta(n,r,i){if(n!==null&&(r.dependencies=n.dependencies),Ha|=r.lanes,(i&r.childLanes)===0)if(n!==null){if(Vo(n,r,i,!1),(i&r.childLanes)===0)return null}else return null;if(n!==null&&r.child!==n.child)throw Error(s(153));if(r.child!==null){for(n=r.child,i=Gr(n,n.pendingProps),r.child=i,i.return=r;n.sibling!==null;)n=n.sibling,i=i.sibling=Gr(n,n.pendingProps),i.return=r;i.sibling=null}return r.child}function uh(n,r){return(n.lanes&r)===0?(n=n.dependencies,!!(n!==null&&Qc(n))):!0}function $6(n,r,i){switch(r.tag){case 3:xo(r,r.stateNode.containerInfo),ja(r,Dt,n.memoizedState.cache),ji();break;case 27:case 5:Br(r);break;case 4:xo(r,r.stateNode.containerInfo);break;case 10:ja(r,r.type,r.memoizedProps.value);break;case 31:if(r.memoizedState!==null)return r.flags|=128,Np(r),null;break;case 13:var l=r.memoizedState;if(l!==null)return l.dehydrated===null?(i&r.child.childLanes)===0?(qa(r),n=ta(n,r,i),n===null?null:n.sibling):w2(n,r,i):(qa(r),r.flags|=128,null);qa(r);break;case 19:var p=(n.flags&128)!=0;if(l=(i&r.childLanes)!==0,l||(l=(Vo(n,r,i,!1),(i&r.childLanes)!==0)),p){if(l)return x2(n,r,i);r.flags|=128}if(p=r.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),Le(Ot,Ot.current),l)break;return null;case 22:return r.lanes=0,h2(n,r,i,r.pendingProps);case 24:ja(r,Dt,n.memoizedState.cache)}return ta(n,r,i)}function k2(n,r,i){if(n!==null)if(n.memoizedProps!==r.pendingProps)zt=!0;else{if(!uh(n,i)&&!(r.flags&128))return zt=!1,$6(n,r,i);zt=!!(n.flags&131072)}else zt=!1,Ge&&r.flags&1048576&&ab(r,Js,r.index);switch(r.lanes=0,r.tag){case 16:e:{var l=r.pendingProps;if(n=Bi(r.elementType),r.type=n,typeof n=="function")mp(n)?(l=Ki(n,l),r.tag=1,r=v2(null,r,n,l,i)):(r.tag=0,r=rh(null,r,n,l,i));else{if(n!=null){var p=n.$$typeof;if(p===ce){r.tag=11,r=d2(null,r,n,l,i);break e}else if(p===$){r.tag=14,r=f2(null,r,n,l,i);break e}}throw r=be(n)||n,Error(s(306,r,""))}}return r;case 0:return rh(n,r,r.type,r.pendingProps,i);case 1:return l=r.type,p=Ki(l,r.pendingProps),v2(n,r,l,p,i);case 3:e:{if(xo(r,r.stateNode.containerInfo),n===null)throw Error(s(387));l=r.pendingProps;var g=r.memoizedState;p=g.element,Op(n,r),al(r,l,null,i);var C=r.memoizedState;if(l=C.cache,ja(r,Dt,l),l!==g.cache&&Cp(r,[Dt],i,!0),rl(),l=C.element,g.isDehydrated)if(g={element:l,isDehydrated:!1,cache:C.cache},r.updateQueue.baseState=g,r.memoizedState=g,r.flags&256){r=b2(n,r,l,i);break e}else if(l!==p){p=Jn(Error(s(424)),r),Xs(p),r=b2(n,r,l,i);break e}else for((n=r.stateNode.containerInfo,n.nodeType)===9?n=n.body:n=n.nodeName==="HTML"?n.ownerDocument.body:n,vt=tr(n.firstChild),Zt=r,Ge=!0,Na=null,Zn=!0,i=yb(r,null,l,i),r.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling;else{if(ji(),l===p){r=ta(n,r,i);break e}tn(n,r,l,i)}r=r.child}return r;case 26:return pu(n,r),n===null?(i=Nw(r.type,null,r.pendingProps,null))?r.memoizedState=i:Ge||(i=r.type,n=r.pendingProps,l=Ou(Mt.current).createElement(i),l[Bt]=r,l[Yt]=n,nn(l,i,n),Lt(l),r.stateNode=l):r.memoizedState=Nw(r.type,n.memoizedProps,r.pendingProps,n.memoizedState),null;case 27:return Br(r),n===null&&Ge&&(l=r.stateNode=Rw(r.type,r.pendingProps,Mt.current),Zt=r,Zn=!0,p=vt,Qa(r.type)?(Vh=p,vt=tr(l.firstChild)):vt=p),tn(n,r,r.pendingProps.children,i),pu(n,r),n===null&&(r.flags|=4194304),r.child;case 5:return n===null&&Ge&&((p=l=vt)&&(l=vI(l,r.type,r.pendingProps,Zn),l===null?p=!1:(r.stateNode=l,Zt=r,vt=tr(l.firstChild),Zn=!1,p=!0)),p||Da(r)),Br(r),p=r.type,g=r.pendingProps,C=n===null?null:n.memoizedProps,l=g.children,jh(p,g)?l=null:C!==null&&jh(p,C)&&(r.flags|=32),r.memoizedState!==null&&(p=jp(n,r,R6,null,null,i),Cl._currentValue=p),pu(n,r),tn(n,r,l,i),r.child;case 6:return n===null&&Ge&&((n=i=vt)&&(i=bI(i,r.pendingProps,Zn),i===null?n=!1:(r.stateNode=i,Zt=r,vt=null,n=!0)),n||Da(r)),null;case 13:return w2(n,r,i);case 4:return xo(r,r.stateNode.containerInfo),l=r.pendingProps,n===null?r.child=Hi(r,null,l,i):tn(n,r,l,i),r.child;case 11:return d2(n,r,r.type,r.pendingProps,i);case 7:return tn(n,r,r.pendingProps,i),r.child;case 8:return tn(n,r,r.pendingProps.children,i),r.child;case 12:return tn(n,r,r.pendingProps.children,i),r.child;case 10:return l=r.pendingProps,ja(r,r.type,l.value),tn(n,r,l.children,i),r.child;case 9:return p=r.type._context,l=r.pendingProps.children,qi(r),p=en(p),l=l(p),r.flags|=1,tn(n,r,l,i),r.child;case 14:return f2(n,r,r.type,r.pendingProps,i);case 15:return p2(n,r,r.type,r.pendingProps,i);case 19:return x2(n,r,i);case 31:return H6(n,r,i);case 22:return h2(n,r,i,r.pendingProps);case 24:return qi(r),l=en(Dt),n===null?(p=Tp(),p===null&&(p=ft,g=Sp(),p.pooledCache=g,g.refCount++,g!==null&&(p.pooledCacheLanes|=i),p=g),r.memoizedState={parent:l,cache:p},Lp(r),ja(r,Dt,p)):((n.lanes&i)!==0&&(Op(n,r),al(r,null,null,i),rl()),p=n.memoizedState,g=r.memoizedState,p.parent===l?(l=g.cache,ja(r,Dt,l),l!==p.cache&&Cp(r,[Dt],i,!0)):(p={parent:l,cache:l},r.memoizedState=p,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=p),ja(r,Dt,l))),tn(n,r,r.pendingProps.children,i),r.child;case 29:throw r.pendingProps}throw Error(s(156,r.tag))}function na(n){n.flags|=4}function dh(n,r,i,l,p){if((r=(n.mode&32)!=0)&&(r=!1),r){if(n.flags|=16777216,(p&335544128)===p)if(n.stateNode.complete)n.flags|=8192;else if(J2())n.flags|=8192;else throw Vi=Yc,Ip}else n.flags&=-16777217}function C2(n,r){if(r.type!=="stylesheet"||r.state.loading&4)n.flags&=-16777217;else if(n.flags|=16777216,!Fw(r))if(J2())n.flags|=8192;else throw Vi=Yc,Ip}function mu(n,r){r!==null&&(n.flags|=4),n.flags&16384&&(r=n.tag===22?536870912:Ec(),n.lanes|=r,es|=r)}function ul(n,r){if(!Ge)switch(n.tailMode){case"hidden":r=n.tail;for(var i=null;r!==null;)r.alternate!==null&&(i=r),r=r.sibling;i===null?n.tail=null:i.sibling=null;break;case"collapsed":i=n.tail;for(var l=null;i!==null;)i.alternate!==null&&(l=i),i=i.sibling;l===null?r||n.tail===null?n.tail=null:n.tail.sibling=null:l.sibling=null}}function bt(n){var r=n.alternate!==null&&n.alternate.child===n.child,i=0,l=0;if(r)for(var p=n.child;p!==null;)i|=p.lanes|p.childLanes,l|=p.subtreeFlags&65011712,l|=p.flags&65011712,p.return=n,p=p.sibling;else for(p=n.child;p!==null;)i|=p.lanes|p.childLanes,l|=p.subtreeFlags,l|=p.flags,p.return=n,p=p.sibling;return n.subtreeFlags|=l,n.childLanes=i,r}function W6(n,r,i){var l=r.pendingProps;switch(bp(r),r.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return bt(r),null;case 1:return bt(r),null;case 3:return i=r.stateNode,l=null,n!==null&&(l=n.memoizedState.cache),r.memoizedState.cache!==l&&(r.flags|=2048),Yr(Dt),An(),i.pendingContext&&(i.pendingContext=(i.context=i.pendingContext,null)),(n===null||n.child===null)&&(Bo(r)?na(r):n===null||n.memoizedState.isDehydrated&&!(r.flags&256)||(r.flags|=1024,_p())),bt(r),null;case 26:var p=r.type,g=r.memoizedState;return n===null?(na(r),g===null?(bt(r),dh(r,p,null,l,i)):(bt(r),C2(r,g))):g?g===n.memoizedState?(bt(r),r.flags&=-16777217):(na(r),bt(r),C2(r,g)):(n=n.memoizedProps,n!==l&&na(r),bt(r),dh(r,p,n,l,i)),null;case 27:if(bi(r),i=Mt.current,p=r.type,n!==null&&r.stateNode!=null)n.memoizedProps!==l&&na(r);else{if(!l){if(r.stateNode===null)throw Error(s(166));return bt(r),null}n=De.current,Bo(r)?ob(r,n):(n=Rw(p,l,i),r.stateNode=n,na(r))}return bt(r),null;case 5:if(bi(r),p=r.type,n!==null&&r.stateNode!=null)n.memoizedProps!==l&&na(r);else{if(!l){if(r.stateNode===null)throw Error(s(166));return bt(r),null}if(g=De.current,Bo(r))ob(r,g);else{var C=Ou(Mt.current);switch(g){case 1:g=C.createElementNS("http://www.w3.org/2000/svg",p);break;case 2:g=C.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;default:switch(p){case"svg":g=C.createElementNS("http://www.w3.org/2000/svg",p);break;case"math":g=C.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;case"script":g=C.createElement("div"),g.innerHTML="<script><\/script>",g=g.removeChild(g.firstChild);break;case"select":g=typeof l.is=="string"?C.createElement("select",{is:l.is}):C.createElement("select"),l.multiple?g.multiple=!0:l.size&&(g.size=l.size);break;default:g=typeof l.is=="string"?C.createElement(p,{is:l.is}):C.createElement(p)}}g[Bt]=r,g[Yt]=l;e:for(C=r.child;C!==null;){if(C.tag===5||C.tag===6)g.appendChild(C.stateNode);else if(C.tag!==4&&C.tag!==27&&C.child!==null){C.child.return=C,C=C.child;continue}if(C===r)break e;for(;C.sibling===null;){if(C.return===null||C.return===r)break e;C=C.return}C.sibling.return=C.return,C=C.sibling}r.stateNode=g;e:switch(nn(g,p,l),p){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&na(r)}}return bt(r),dh(r,r.type,n===null?null:n.memoizedProps,r.pendingProps,i),null;case 6:if(n&&r.stateNode!=null)n.memoizedProps!==l&&na(r);else{if(typeof l!="string"&&r.stateNode===null)throw Error(s(166));if(n=Mt.current,Bo(r)){if(n=r.stateNode,i=r.memoizedProps,l=null,p=Zt,p!==null)switch(p.tag){case 27:case 5:l=p.memoizedProps}n[Bt]=r,n=!!(n.nodeValue===i||l!==null&&l.suppressHydrationWarning===!0||_w(n.nodeValue,i)),n||Da(r,!0)}else n=Ou(n).createTextNode(l),n[Bt]=r,r.stateNode=n}return bt(r),null;case 31:if(i=r.memoizedState,n===null||n.memoizedState!==null){if(l=Bo(r),i!==null){if(n===null){if(!l)throw Error(s(318));if(n=r.memoizedState,n=n===null?null:n.dehydrated,!n)throw Error(s(557));n[Bt]=r}else ji(),!(r.flags&128)&&(r.memoizedState=null),r.flags|=4;bt(r),n=!1}else i=_p(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=i),n=!0;if(!n)return r.flags&256?(zn(r),r):(zn(r),null);if(r.flags&128)throw Error(s(558))}return bt(r),null;case 13:if(l=r.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(p=Bo(r),l!==null&&l.dehydrated!==null){if(n===null){if(!p)throw Error(s(318));if(p=r.memoizedState,p=p===null?null:p.dehydrated,!p)throw Error(s(317));p[Bt]=r}else ji(),!(r.flags&128)&&(r.memoizedState=null),r.flags|=4;bt(r),p=!1}else p=_p(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=p),p=!0;if(!p)return r.flags&256?(zn(r),r):(zn(r),null)}return zn(r),r.flags&128?(r.lanes=i,r):(i=l!==null,n=n!==null&&n.memoizedState!==null,i&&(l=r.child,p=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(p=l.alternate.memoizedState.cachePool.pool),g=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(g=l.memoizedState.cachePool.pool),g!==p&&(l.flags|=2048)),i!==n&&i&&(r.child.flags|=8192),mu(r,r.updateQueue),bt(r),null);case 4:return An(),n===null&&yw(r.stateNode.containerInfo),bt(r),null;case 10:return Yr(r.type),bt(r),null;case 19:if(Ne(Ot),l=r.memoizedState,l===null)return bt(r),null;if(p=(r.flags&128)!=0,g=l.rendering,g===null)if(p)ul(l,!1);else{if(Et!==0||n!==null&&n.flags&128)for(n=r.child;n!==null;){if(g=nu(n),g!==null){for(r.flags|=128,ul(l,!1),n=g.updateQueue,r.updateQueue=n,mu(r,n),r.subtreeFlags=0,n=i,i=r.child;i!==null;)tb(i,n),i=i.sibling;return Le(Ot,Ot.current&1|2),Ge&&Jr(r,l.treeForkCount),r.child}n=n.sibling}l.tail!==null&&Jt()>wu&&(r.flags|=128,p=!0,ul(l,!1),r.lanes=4194304)}else{if(!p)if(n=nu(g),n!==null){if(r.flags|=128,p=!0,n=n.updateQueue,r.updateQueue=n,mu(r,n),ul(l,!0),l.tail===null&&l.tailMode==="hidden"&&!g.alternate&&!Ge)return bt(r),null}else 2*Jt()-l.renderingStartTime>wu&&i!==536870912&&(r.flags|=128,p=!0,ul(l,!1),r.lanes=4194304);l.isBackwards?(g.sibling=r.child,r.child=g):(n=l.last,n===null?r.child=g:n.sibling=g,l.last=g)}return l.tail===null?(bt(r),null):(n=l.tail,l.rendering=n,l.tail=n.sibling,l.renderingStartTime=Jt(),n.sibling=null,i=Ot.current,Le(Ot,p?i&1|2:i&1),Ge&&Jr(r,l.treeForkCount),n);case 22:case 23:return zn(r),Pp(),l=r.memoizedState!==null,n===null?l&&(r.flags|=8192):n.memoizedState!==null!==l&&(r.flags|=8192),l?i&536870912&&!(r.flags&128)&&(bt(r),r.subtreeFlags&6&&(r.flags|=8192)):bt(r),i=r.updateQueue,i!==null&&mu(r,i.retryQueue),i=null,n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(i=n.memoizedState.cachePool.pool),l=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(l=r.memoizedState.cachePool.pool),l!==i&&(r.flags|=2048),n!==null&&Ne(Fi),null;case 24:return i=null,n!==null&&(i=n.memoizedState.cache),r.memoizedState.cache!==i&&(r.flags|=2048),Yr(Dt),bt(r),null;case 25:return null;case 30:return null}throw Error(s(156,r.tag))}function U6(n,r){switch(bp(r),r.tag){case 1:return n=r.flags,n&65536?(r.flags=n&-65537|128,r):null;case 3:return Yr(Dt),An(),n=r.flags,n&65536&&!(n&128)?(r.flags=n&-65537|128,r):null;case 26:case 27:case 5:return bi(r),null;case 31:if(r.memoizedState!==null){if(zn(r),r.alternate===null)throw Error(s(340));ji()}return n=r.flags,n&65536?(r.flags=n&-65537|128,r):null;case 13:if(zn(r),n=r.memoizedState,n!==null&&n.dehydrated!==null){if(r.alternate===null)throw Error(s(340));ji()}return n=r.flags,n&65536?(r.flags=n&-65537|128,r):null;case 19:return Ne(Ot),null;case 4:return An(),null;case 10:return Yr(r.type),null;case 22:case 23:return zn(r),Pp(),n!==null&&Ne(Fi),n=r.flags,n&65536?(r.flags=n&-65537|128,r):null;case 24:return Yr(Dt),null;case 25:return null;default:return null}}function S2(n,r){switch(bp(r),r.tag){case 3:Yr(Dt),An();break;case 26:case 27:case 5:bi(r);break;case 4:An();break;case 31:r.memoizedState!==null&&zn(r);break;case 13:zn(r);break;case 19:Ne(Ot);break;case 10:Yr(r.type);break;case 22:case 23:zn(r),Pp(),n!==null&&Ne(Fi);break;case 24:Yr(Dt)}}function dl(n,r){try{var i=r.updateQueue,l=i===null?null:i.lastEffect;if(l!==null){var p=l.next;i=p;do{if((i.tag&n)===n){l=void 0;var g=i.create,C=i.inst;l=g(),C.destroy=l}i=i.next}while(i!==p)}}catch(L){it(r,r.return,L)}}function Ba(n,r,i){try{var l=r.updateQueue,p=l===null?null:l.lastEffect;if(p!==null){var g=p.next;l=g;do{if((l.tag&n)===n){var C=l.inst,L=C.destroy;if(L!==void 0){C.destroy=void 0,p=r;var F=i,J=L;try{J()}catch(se){it(p,F,se)}}}l=l.next}while(l!==g)}}catch(se){it(r,r.return,se)}}function E2(n){var r=n.updateQueue;if(r!==null){var i=n.stateNode;try{bb(r,i)}catch(l){it(n,n.return,l)}}}function T2(n,r,i){i.props=Ki(n.type,n.memoizedProps),i.state=n.memoizedState;try{i.componentWillUnmount()}catch(l){it(n,r,l)}}function fl(n,r){try{var i=n.ref;if(i!==null){switch(n.tag){case 26:case 27:case 5:var l=n.stateNode;break;case 30:l=n.stateNode;break;default:l=n.stateNode}typeof i=="function"?n.refCleanup=i(l):i.current=l}}catch(p){it(n,r,p)}}function Mr(n,r){var i=n.ref,l=n.refCleanup;if(i!==null)if(typeof l=="function")try{l()}catch(p){it(n,r,p)}finally{n.refCleanup=null,n=n.alternate,n!=null&&(n.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(p){it(n,r,p)}else i.current=null}function I2(n){var r=n.type,i=n.memoizedProps,l=n.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":i.autoFocus&&l.focus();break e;case"img":i.src?l.src=i.src:i.srcSet&&(l.srcset=i.srcSet)}}catch(p){it(n,n.return,p)}}function fh(n,r,i){try{var l=n.stateNode;fI(l,n.type,i,r),l[Yt]=r}catch(p){it(n,n.return,p)}}function L2(n){return n.tag===5||n.tag===3||n.tag===26||n.tag===27&&Qa(n.type)||n.tag===4}function ph(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||L2(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.tag===27&&Qa(n.type)||n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function hh(n,r,i){var l=n.tag;if(l===5||l===6)n=n.stateNode,r?(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i).insertBefore(n,r):(r=i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,r.appendChild(n),i=i._reactRootContainer,i!=null||r.onclick!==null||(r.onclick=Qn));else if(l!==4&&(l===27&&Qa(n.type)&&(i=n.stateNode,r=null),n=n.child,n!==null))for(hh(n,r,i),n=n.sibling;n!==null;)hh(n,r,i),n=n.sibling}function gu(n,r,i){var l=n.tag;if(l===5||l===6)n=n.stateNode,r?i.insertBefore(n,r):i.appendChild(n);else if(l!==4&&(l===27&&Qa(n.type)&&(i=n.stateNode),n=n.child,n!==null))for(gu(n,r,i),n=n.sibling;n!==null;)gu(n,r,i),n=n.sibling}function O2(n){var r=n.stateNode,i=n.memoizedProps;try{for(var l=n.type,p=r.attributes;p.length;)r.removeAttributeNode(p[0]);nn(r,l,i),r[Bt]=n,r[Yt]=i}catch(g){it(n,n.return,g)}}var ra=!1,qt=!1,mh=!1,A2=typeof WeakSet=="function"?WeakSet:Set,Gt=null;function K6(n,r){if(n=n.containerInfo,Nh=ju,n=Uv(n),lp(n)){if("selectionStart"in n)var i={start:n.selectionStart,end:n.selectionEnd};else e:{i=(i=n.ownerDocument)&&i.defaultView||window;var l=i.getSelection&&i.getSelection();if(l&&l.rangeCount!==0){i=l.anchorNode;var p=l.anchorOffset,g=l.focusNode;l=l.focusOffset;try{i.nodeType,g.nodeType}catch{i=null;break e}var C=0,L=-1,F=-1,J=0,se=0,pe=n,Z=null;t:for(;;){for(var re;pe!==i||p!==0&&pe.nodeType!==3||(L=C+p),pe!==g||l!==0&&pe.nodeType!==3||(F=C+l),pe.nodeType===3&&(C+=pe.nodeValue.length),(re=pe.firstChild)!==null;)Z=pe,pe=re;for(;;){if(pe===n)break t;if(Z===i&&++J===p&&(L=C),Z===g&&++se===l&&(F=C),(re=pe.nextSibling)!==null)break;pe=Z,Z=pe.parentNode}pe=re}i=L===-1||F===-1?null:{start:L,end:F}}else i=null}i||(i={start:0,end:0})}else i=null;for(Dh={focusedElem:n,selectionRange:i},ju=!1,Gt=r;Gt!==null;)if(r=Gt,n=r.child,r.subtreeFlags&1028&&n!==null)n.return=r,Gt=n;else for(;Gt!==null;){switch(r=Gt,g=r.alternate,n=r.flags,r.tag){case 0:if(n&4&&(n=r.updateQueue,n=n===null?null:n.events,n!==null))for(i=0;i<n.length;i++)p=n[i],p.ref.impl=p.nextImpl;break;case 11:case 15:break;case 1:if(n&1024&&g!==null){n=void 0,i=r,p=g.memoizedProps,g=g.memoizedState,l=i.stateNode;try{var Ce=Ki(i.type,p);n=l.getSnapshotBeforeUpdate(Ce,g),l.__reactInternalSnapshotBeforeUpdate=n}catch(Re){it(i,i.return,Re)}}break;case 3:if(n&1024){if(n=r.stateNode.containerInfo,i=n.nodeType,i===9)qh(n);else if(i===1)switch(n.nodeName){case"HEAD":case"HTML":case"BODY":qh(n);break;default:n.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(n&1024)throw Error(s(163))}if(n=r.sibling,n!==null){n.return=r.return,Gt=n;break}Gt=r.return}}function R2(n,r,i){var l=i.flags;switch(i.tag){case 0:case 11:case 15:ia(n,i),l&4&&dl(5,i);break;case 1:if(ia(n,i),l&4)if(n=i.stateNode,r===null)try{n.componentDidMount()}catch(C){it(i,i.return,C)}else{var p=Ki(i.type,r.memoizedProps);r=r.memoizedState;try{n.componentDidUpdate(p,r,n.__reactInternalSnapshotBeforeUpdate)}catch(C){it(i,i.return,C)}}l&64&&E2(i),l&512&&fl(i,i.return);break;case 3:if(ia(n,i),l&64&&(n=i.updateQueue,n!==null)){if(r=null,i.child!==null)switch(i.child.tag){case 27:case 5:r=i.child.stateNode;break;case 1:r=i.child.stateNode}try{bb(n,r)}catch(C){it(i,i.return,C)}}break;case 27:r===null&&l&4&&O2(i);case 26:case 5:ia(n,i),r===null&&l&4&&I2(i),l&512&&fl(i,i.return);break;case 12:ia(n,i);break;case 31:ia(n,i),l&4&&N2(n,i);break;case 13:ia(n,i),l&4&&D2(n,i),l&64&&(n=i.memoizedState,n!==null&&(n=n.dehydrated,n!==null&&(i=nI.bind(null,i),wI(n,i))));break;case 22:if(l=i.memoizedState!==null||ra,!l){r=r!==null&&r.memoizedState!==null||qt,p=ra;var g=qt;ra=l,(qt=r)&&!g?oa(n,i,(i.subtreeFlags&8772)!=0):ia(n,i),ra=p,qt=g}break;case 30:break;default:ia(n,i)}}function M2(n){var r=n.alternate;r!==null&&(n.alternate=null,M2(r)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(r=n.stateNode,r!==null&&Io(r)),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}var kt=null,_n=!1;function aa(n,r,i){for(i=i.child;i!==null;)P2(n,r,i),i=i.sibling}function P2(n,r,i){if(ln&&typeof ln.onCommitFiberUnmount=="function")try{ln.onCommitFiberUnmount(wi,i)}catch{}switch(i.tag){case 26:qt||Mr(i,r),aa(n,r,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:qt||Mr(i,r);var l=kt,p=_n;Qa(i.type)&&(kt=i.stateNode,_n=!1),aa(n,r,i),_l(i.stateNode),kt=l,_n=p;break;case 5:qt||Mr(i,r);case 6:if(l=kt,p=_n,kt=null,aa(n,r,i),kt=l,_n=p,kt!==null)if(_n)try{(kt.nodeType===9?kt.body:kt.nodeName==="HTML"?kt.ownerDocument.body:kt).removeChild(i.stateNode)}catch(g){it(i,r,g)}else try{kt.removeChild(i.stateNode)}catch(g){it(i,r,g)}break;case 18:kt!==null&&(_n?(n=kt,Tw(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,i.stateNode),ls(n)):Tw(kt,i.stateNode));break;case 4:l=kt,p=_n,kt=i.stateNode.containerInfo,_n=!0,aa(n,r,i),kt=l,_n=p;break;case 0:case 11:case 14:case 15:Ba(2,i,r),qt||Ba(4,i,r),aa(n,r,i);break;case 1:qt||(Mr(i,r),l=i.stateNode,typeof l.componentWillUnmount=="function"&&T2(i,r,l)),aa(n,r,i);break;case 21:aa(n,r,i);break;case 22:qt=(l=qt)||i.memoizedState!==null,aa(n,r,i),qt=l;break;default:aa(n,r,i)}}function N2(n,r){if(r.memoizedState===null&&(n=r.alternate,n!==null&&(n=n.memoizedState,n!==null))){n=n.dehydrated;try{ls(n)}catch(i){it(r,r.return,i)}}}function D2(n,r){if(r.memoizedState===null&&(n=r.alternate,n!==null&&(n=n.memoizedState,n!==null&&(n=n.dehydrated,n!==null))))try{ls(n)}catch(i){it(r,r.return,i)}}function Q6(n){switch(n.tag){case 31:case 13:case 19:var r=n.stateNode;return r===null&&(r=n.stateNode=new A2),r;case 22:return n=n.stateNode,r=n._retryCache,r===null&&(r=n._retryCache=new A2),r;default:throw Error(s(435,n.tag))}}function yu(n,r){var i=Q6(n);r.forEach(function(l){if(!i.has(l)){i.add(l);var p=rI.bind(null,n,l);l.then(p,p)}})}function xn(n,r){var i=r.deletions;if(i!==null)for(var l=0;l<i.length;l++){var p=i[l],g=n,C=r,L=C;e:for(;L!==null;){switch(L.tag){case 27:if(Qa(L.type)){kt=L.stateNode,_n=!1;break e}break;case 5:kt=L.stateNode,_n=!1;break e;case 3:case 4:kt=L.stateNode.containerInfo,_n=!0;break e}L=L.return}if(kt===null)throw Error(s(160));P2(g,C,p),kt=null,_n=!1,g=p.alternate,g!==null&&(g.return=null),p.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)j2(r,n),r=r.sibling}var br=null;function j2(n,r){var i=n.alternate,l=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:xn(r,n),kn(n),l&4&&(Ba(3,n,n.return),dl(3,n),Ba(5,n,n.return));break;case 1:xn(r,n),kn(n),l&512&&(qt||i===null||Mr(i,i.return)),l&64&&ra&&(n=n.updateQueue,n!==null&&(l=n.callbacks,l!==null&&(i=n.shared.hiddenCallbacks,n.shared.hiddenCallbacks=i===null?l:i.concat(l))));break;case 26:var p=br;if(xn(r,n),kn(n),l&512&&(qt||i===null||Mr(i,i.return)),l&4){var g=i===null?null:i.memoizedState;if(l=n.memoizedState,i===null)if(l===null)if(n.stateNode===null){e:{l=n.type,i=n.memoizedProps,p=p.ownerDocument||p;t:switch(l){case"title":g=p.getElementsByTagName("title")[0],(!g||g[ki]||g[Bt]||g.namespaceURI==="http://www.w3.org/2000/svg"||g.hasAttribute("itemprop"))&&(g=p.createElement(l),p.head.insertBefore(g,p.querySelector("head > title"))),nn(g,l,i),g[Bt]=n,Lt(g),l=g;break e;case"link":var C=zw("link","href",p).get(l+(i.href||""));if(C){for(var L=0;L<C.length;L++)if(g=C[L],g.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&g.getAttribute("rel")===(i.rel==null?null:i.rel)&&g.getAttribute("title")===(i.title==null?null:i.title)&&g.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){C.splice(L,1);break t}}g=p.createElement(l),nn(g,l,i),p.head.appendChild(g);break;case"meta":if(C=zw("meta","content",p).get(l+(i.content||""))){for(L=0;L<C.length;L++)if(g=C[L],g.getAttribute("content")===(i.content==null?null:""+i.content)&&g.getAttribute("name")===(i.name==null?null:i.name)&&g.getAttribute("property")===(i.property==null?null:i.property)&&g.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&g.getAttribute("charset")===(i.charSet==null?null:i.charSet)){C.splice(L,1);break t}}g=p.createElement(l),nn(g,l,i),p.head.appendChild(g);break;default:throw Error(s(468,l))}g[Bt]=n,Lt(g),l=g}n.stateNode=l}else qw(p,n.type,n.stateNode);else n.stateNode=jw(p,l,n.memoizedProps);else g===l?l===null&&n.stateNode!==null&&fh(n,n.memoizedProps,i.memoizedProps):(g===null?i.stateNode!==null&&(i=i.stateNode,i.parentNode.removeChild(i)):g.count--,l===null?qw(p,n.type,n.stateNode):jw(p,l,n.memoizedProps))}break;case 27:xn(r,n),kn(n),l&512&&(qt||i===null||Mr(i,i.return)),i!==null&&l&4&&fh(n,n.memoizedProps,i.memoizedProps);break;case 5:if(xn(r,n),kn(n),l&512&&(qt||i===null||Mr(i,i.return)),n.flags&32){p=n.stateNode;try{Ur(p,"")}catch(Ce){it(n,n.return,Ce)}}l&4&&n.stateNode!=null&&(p=n.memoizedProps,fh(n,p,i===null?p:i.memoizedProps)),l&1024&&(mh=!0);break;case 6:if(xn(r,n),kn(n),l&4){if(n.stateNode===null)throw Error(s(162));l=n.memoizedProps,i=n.stateNode;try{i.nodeValue=l}catch(Ce){it(n,n.return,Ce)}}break;case 3:if(Mu=null,p=br,br=Au(r.containerInfo),xn(r,n),br=p,kn(n),l&4&&i!==null&&i.memoizedState.isDehydrated)try{ls(r.containerInfo)}catch(Ce){it(n,n.return,Ce)}mh&&(mh=!1,z2(n));break;case 4:l=br,br=Au(n.stateNode.containerInfo),xn(r,n),kn(n),br=l;break;case 12:xn(r,n),kn(n);break;case 31:xn(r,n),kn(n),l&4&&(l=n.updateQueue,l!==null&&(n.updateQueue=null,yu(n,l)));break;case 13:xn(r,n),kn(n),n.child.flags&8192&&n.memoizedState!==null!=(i!==null&&i.memoizedState!==null)&&(bu=Jt()),l&4&&(l=n.updateQueue,l!==null&&(n.updateQueue=null,yu(n,l)));break;case 22:p=n.memoizedState!==null;var F=i!==null&&i.memoizedState!==null,J=ra,se=qt;if(ra=J||p,qt=se||F,xn(r,n),qt=se,ra=J,kn(n),l&8192)e:for(r=n.stateNode,r._visibility=p?r._visibility&-2:r._visibility|1,p&&(i===null||F||ra||qt||Qi(n)),i=null,r=n;;){if(r.tag===5||r.tag===26){if(i===null){F=i=r;try{if(g=F.stateNode,p)C=g.style,typeof C.setProperty=="function"?C.setProperty("display","none","important"):C.display="none";else{L=F.stateNode;var pe=F.memoizedProps.style,Z=pe!=null&&pe.hasOwnProperty("display")?pe.display:null;L.style.display=Z==null||typeof Z=="boolean"?"":(""+Z).trim()}}catch(Ce){it(F,F.return,Ce)}}}else if(r.tag===6){if(i===null){F=r;try{F.stateNode.nodeValue=p?"":F.memoizedProps}catch(Ce){it(F,F.return,Ce)}}}else if(r.tag===18){if(i===null){F=r;try{var re=F.stateNode;p?Iw(re,!0):Iw(F.stateNode,!1)}catch(Ce){it(F,F.return,Ce)}}}else if((r.tag!==22&&r.tag!==23||r.memoizedState===null||r===n)&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===n)break e;for(;r.sibling===null;){if(r.return===null||r.return===n)break e;i===r&&(i=null),r=r.return}i===r&&(i=null),r.sibling.return=r.return,r=r.sibling}l&4&&(l=n.updateQueue,l!==null&&(i=l.retryQueue,i!==null&&(l.retryQueue=null,yu(n,i))));break;case 19:xn(r,n),kn(n),l&4&&(l=n.updateQueue,l!==null&&(n.updateQueue=null,yu(n,l)));break;case 30:break;case 21:break;default:xn(r,n),kn(n)}}function kn(n){var r=n.flags;if(r&2){try{for(var i,l=n.return;l!==null;){if(L2(l)){i=l;break}l=l.return}if(i==null)throw Error(s(160));switch(i.tag){case 27:var p=i.stateNode;gu(n,ph(n),p);break;case 5:var g=i.stateNode;i.flags&32&&(Ur(g,""),i.flags&=-33),gu(n,ph(n),g);break;case 3:case 4:var C=i.stateNode.containerInfo;hh(n,ph(n),C);break;default:throw Error(s(161))}}catch(L){it(n,n.return,L)}n.flags&=-3}r&4096&&(n.flags&=-4097)}function z2(n){if(n.subtreeFlags&1024)for(n=n.child;n!==null;){var r=n;z2(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),n=n.sibling}}function ia(n,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)R2(n,r.alternate,r),r=r.sibling}function Qi(n){for(n=n.child;n!==null;){var r=n;switch(r.tag){case 0:case 11:case 14:case 15:Ba(4,r,r.return),Qi(r);break;case 1:Mr(r,r.return);var i=r.stateNode;typeof i.componentWillUnmount=="function"&&T2(r,r.return,i),Qi(r);break;case 27:_l(r.stateNode);case 26:case 5:Mr(r,r.return),Qi(r);break;case 22:r.memoizedState===null&&Qi(r);break;case 30:Qi(r);break;default:Qi(r)}n=n.sibling}}function oa(n,r,i){for(i&&(i=(r.subtreeFlags&8772)!=0),r=r.child;r!==null;){var l=r.alternate,p=n,g=r,C=g.flags;switch(g.tag){case 0:case 11:case 15:oa(p,g,i),dl(4,g);break;case 1:if(oa(p,g,i),l=g,p=l.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(J){it(l,l.return,J)}if(l=g,p=l.updateQueue,p!==null){var L=l.stateNode;try{var F=p.shared.hiddenCallbacks;if(F!==null)for(p.shared.hiddenCallbacks=null,p=0;p<F.length;p++)vb(F[p],L)}catch(J){it(l,l.return,J)}}i&&C&64&&E2(g),fl(g,g.return);break;case 27:O2(g);case 26:case 5:oa(p,g,i),i&&l===null&&C&4&&I2(g),fl(g,g.return);break;case 12:oa(p,g,i);break;case 31:oa(p,g,i),i&&C&4&&N2(p,g);break;case 13:oa(p,g,i),i&&C&4&&D2(p,g);break;case 22:g.memoizedState===null&&oa(p,g,i),fl(g,g.return);break;case 30:break;default:oa(p,g,i)}r=r.sibling}}function gh(n,r){var i=null;n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(i=n.memoizedState.cachePool.pool),n=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(n=r.memoizedState.cachePool.pool),n!==i&&(n!=null&&n.refCount++,i!=null&&Ys(i))}function yh(n,r){n=null,r.alternate!==null&&(n=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==n&&(r.refCount++,n!=null&&Ys(n))}function wr(n,r,i,l){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)q2(n,r,i,l),r=r.sibling}function q2(n,r,i,l){var p=r.flags;switch(r.tag){case 0:case 11:case 15:wr(n,r,i,l),p&2048&&dl(9,r);break;case 1:wr(n,r,i,l);break;case 3:wr(n,r,i,l),p&2048&&(n=null,r.alternate!==null&&(n=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==n&&(r.refCount++,n!=null&&Ys(n)));break;case 12:if(p&2048){wr(n,r,i,l),n=r.stateNode;try{var g=r.memoizedProps,C=g.id,L=g.onPostCommit;typeof L=="function"&&L(C,r.alternate===null?"mount":"update",n.passiveEffectDuration,-0)}catch(F){it(r,r.return,F)}}else wr(n,r,i,l);break;case 31:wr(n,r,i,l);break;case 13:wr(n,r,i,l);break;case 23:break;case 22:g=r.stateNode,C=r.alternate,r.memoizedState===null?g._visibility&2?wr(n,r,i,l):(g._visibility|=2,Xo(n,r,i,l,(r.subtreeFlags&10256)!=0||!1)):g._visibility&2?wr(n,r,i,l):pl(n,r),p&2048&&gh(C,r);break;case 24:wr(n,r,i,l),p&2048&&yh(r.alternate,r);break;default:wr(n,r,i,l)}}function Xo(n,r,i,l,p){for(p&&(p=(r.subtreeFlags&10256)!=0||!1),r=r.child;r!==null;){var g=n,C=r,L=i,F=l,J=C.flags;switch(C.tag){case 0:case 11:case 15:Xo(g,C,L,F,p),dl(8,C);break;case 23:break;case 22:var se=C.stateNode;C.memoizedState===null?(se._visibility|=2,Xo(g,C,L,F,p)):se._visibility&2?Xo(g,C,L,F,p):pl(g,C),p&&J&2048&&gh(C.alternate,C);break;case 24:Xo(g,C,L,F,p),p&&J&2048&&yh(C.alternate,C);break;default:Xo(g,C,L,F,p)}r=r.sibling}}function pl(n,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var i=n,l=r,p=l.flags;switch(l.tag){case 22:pl(i,l),p&2048&&gh(l.alternate,l);break;case 24:pl(i,l),p&2048&&yh(l.alternate,l);break;default:pl(i,l)}r=r.sibling}}var hl=8192;function Yo(n,r,i){if(n.subtreeFlags&hl)for(n=n.child;n!==null;)F2(n,r,i),n=n.sibling}function F2(n,r,i){switch(n.tag){case 26:Yo(n,r,i),n.flags&hl&&n.memoizedState!==null&&RI(i,br,n.memoizedState,n.memoizedProps);break;case 5:Yo(n,r,i);break;case 3:case 4:var l=br;br=Au(n.stateNode.containerInfo),Yo(n,r,i),br=l;break;case 22:n.memoizedState===null&&(l=n.alternate,l!==null&&l.memoizedState!==null?(l=hl,hl=16777216,Yo(n,r,i),hl=l):Yo(n,r,i));break;default:Yo(n,r,i)}}function B2(n){var r=n.alternate;if(r!==null&&(n=r.child,n!==null)){r.child=null;do r=n.sibling,n.sibling=null,n=r;while(n!==null)}}function ml(n){var r=n.deletions;if(n.flags&16){if(r!==null)for(var i=0;i<r.length;i++){var l=r[i];Gt=l,H2(l,n)}B2(n)}if(n.subtreeFlags&10256)for(n=n.child;n!==null;)V2(n),n=n.sibling}function V2(n){switch(n.tag){case 0:case 11:case 15:ml(n),n.flags&2048&&Ba(9,n,n.return);break;case 3:ml(n);break;case 12:ml(n);break;case 22:var r=n.stateNode;n.memoizedState!==null&&r._visibility&2&&(n.return===null||n.return.tag!==13)?(r._visibility&=-3,vu(n)):ml(n);break;default:ml(n)}}function vu(n){var r=n.deletions;if(n.flags&16){if(r!==null)for(var i=0;i<r.length;i++){var l=r[i];Gt=l,H2(l,n)}B2(n)}for(n=n.child;n!==null;){switch(r=n,r.tag){case 0:case 11:case 15:Ba(8,r,r.return),vu(r);break;case 22:i=r.stateNode,i._visibility&2&&(i._visibility&=-3,vu(r));break;default:vu(r)}n=n.sibling}}function H2(n,r){for(;Gt!==null;){var i=Gt;switch(i.tag){case 0:case 11:case 15:Ba(8,i,r);break;case 23:case 22:if(i.memoizedState!==null&&i.memoizedState.cachePool!==null){var l=i.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:Ys(i.memoizedState.cache)}if(l=i.child,l!==null)l.return=i,Gt=l;else e:for(i=n;Gt!==null;){l=Gt;var p=l.sibling,g=l.return;if(M2(l),l===i){Gt=null;break e}if(p!==null){p.return=g,Gt=p;break e}Gt=g}}}var G6={getCacheForType:function(n){var r=en(Dt),i=r.data.get(n);return i===void 0&&(i=n(),r.data.set(n,i)),i},cacheSignal:function(){return en(Dt).controller.signal}},J6=typeof WeakMap=="function"?WeakMap:Map,tt=0,ft=null,$e=null,Ue=0,at=0,qn=null,Va=!1,Zo=!1,vh=!1,sa=0,Et=0,Ha=0,Gi=0,bh=0,Fn=0,es=0,gl=null,Cn=null,wh=!1,bu=0,$2=0,wu=1/0,_u=null,$a=null,Ht=0,Wa=null,ts=null,la=0,_h=0,xh=null,W2=null,yl=0,kh=null;function er(){return tt&2&&Ue!==0?Ue&-Ue:le.T===null?Ic():Lh()}function U2(){if(Fn===0)if(!(Ue&536870912)||Ge){var n=It;It<<=1,!(It&3932160)&&(It=262144),Fn=n}else Fn=536870912;return n=jn.current,n!==null&&(n.flags|=32),Fn}function Sn(n,r,i){(n===ft&&(at===2||at===9)||n.cancelPendingCommit!==null)&&(ns(n,0),Ua(n,Ue,Fn,!1)),xi(n,i),(!(tt&2)||n!==ft)&&(n===ft&&(!(tt&2)&&(Gi|=i),Et===4&&Ua(n,Ue,Fn,!1)),ca(n))}function K2(n,r,i){if(tt&6)throw Error(s(327));var l=!i&&(r&127)==0&&(r&n.expiredLanes)===0||Ea(n,r),p=l?Z6(n,r):Sh(n,r,!0),g=l;do{if(p===0){Zo&&!l&&Ua(n,r,0,!1);break}else{if(i=n.current.alternate,g&&!X6(i)){p=Sh(n,r,!1),g=!1;continue}if(p===2){if(g=r,n.errorRecoveryDisabledLanes&g)var C=0;else C=n.pendingLanes&-536870913,C=C===0?C&536870912?536870912:0:C;if(C!==0){r=C;e:{var L=n;p=gl;var F=L.current.memoizedState.isDehydrated;if(F&&(ns(L,C).flags|=256),C=Sh(L,C,!1),C!==2){if(vh&&!F){L.errorRecoveryDisabledLanes|=g,Gi|=g,p=4;break e}g=Cn,Cn=p,g!==null&&(Cn===null?Cn=g:Cn.push.apply(Cn,g))}p=C}if(g=!1,p!==2)continue}}if(p===1){ns(n,0),Ua(n,r,0,!0);break}e:{switch(l=n,g=p,g){case 0:case 1:throw Error(s(345));case 4:if((r&4194048)!==r)break;case 6:Ua(l,r,Fn,!Va);break e;case 2:Cn=null;break;case 3:case 5:break;default:throw Error(s(329))}if((r&62914560)===r&&(p=bu+300-Jt(),10<p)){if(Ua(l,r,Fn,!Va),Eo(l,0,!0)!==0)break e;la=r,l.timeoutHandle=Sw(Q2.bind(null,l,i,Cn,_u,wh,r,Fn,Gi,es,Va,g,"Throttled",-0,0),p);break e}Q2(l,i,Cn,_u,wh,r,Fn,Gi,es,Va,g,null,-0,0)}}break}while(!0);ca(n)}function Q2(n,r,i,l,p,g,C,L,F,J,se,pe,Z,re){if(n.timeoutHandle=-1,pe=r.subtreeFlags,pe&8192||(pe&16785408)==16785408){pe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Qn},F2(r,g,pe);var Ce=(g&62914560)===g?bu-Jt():(g&4194048)===g?$2-Jt():0;if(Ce=MI(pe,Ce),Ce!==null){la=g,n.cancelPendingCommit=Ce(nw.bind(null,n,r,g,i,l,p,C,L,F,se,pe,null,Z,re)),Ua(n,g,C,!J);return}}nw(n,r,g,i,l,p,C,L,F)}function X6(n){for(var r=n;;){var i=r.tag;if((i===0||i===11||i===15)&&r.flags&16384&&(i=r.updateQueue,i!==null&&(i=i.stores,i!==null)))for(var l=0;l<i.length;l++){var p=i[l],g=p.getSnapshot;p=p.value;try{if(!Nn(g(),p))return!1}catch{return!1}}if(i=r.child,r.subtreeFlags&16384&&i!==null)i.return=r,r=i;else{if(r===n)break;for(;r.sibling===null;){if(r.return===null||r.return===n)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function Ua(n,r,i,l){r&=~bh,r&=~Gi,n.suspendedLanes|=r,n.pingedLanes&=~r,l&&(n.warmLanes|=r),l=n.expirationTimes;for(var p=r;0<p;){var g=31-gt(p),C=1<<g;l[g]=-1,p&=~C}i!==0&&$r(n,i,r)}function xu(){return tt&6?!0:(vl(0,!1),!1)}function Ch(){if($e!==null){if(at===0)var n=$e.return;else n=$e,Xr=zi=null,Fp(n),Uo=null,el=0,n=$e;for(;n!==null;)S2(n.alternate,n),n=n.return;$e=null}}function ns(n,r){var i=n.timeoutHandle;i!==-1&&(n.timeoutHandle=-1,mI(i)),i=n.cancelPendingCommit,i!==null&&(n.cancelPendingCommit=null,i()),la=0,Ch(),ft=n,$e=i=Gr(n.current,null),Ue=r,at=0,qn=null,Va=!1,Zo=Ea(n,r),vh=!1,es=Fn=bh=Gi=Ha=Et=0,Cn=gl=null,wh=!1,r&8&&(r|=r&32);var l=n.entangledLanes;if(l!==0)for(n=n.entanglements,l&=r;0<l;){var p=31-gt(l),g=1<<p;r|=n[p],l&=~g}return sa=r,Hc(),i}function G2(n,r){ze=null,le.H=ll,r===Wo||r===Xc?(r=hb(),at=3):r===Ip?(r=hb(),at=4):at=r===nh?8:typeof r=="object"&&r&&typeof r.then=="function"?6:1,qn=r,$e===null&&(Et=1,du(n,Jn(r,n.current)))}function J2(){var n=jn.current;return n===null?!0:(Ue&4194048)===Ue?vr===null:(Ue&62914560)===Ue||Ue&536870912?n===vr:!1}function X2(){var n=le.H;return le.H=ll,n===null?ll:n}function Y2(){var n=le.A;return le.A=G6,n}function ku(){Et=4,Va||(Ue&4194048)!==Ue&&jn.current!==null||(Zo=!0),!(Ha&134217727)&&!(Gi&134217727)||ft===null||Ua(ft,Ue,Fn,!1)}function Sh(n,r,i){var l=tt;tt|=2;var p=X2(),g=Y2();(ft!==n||Ue!==r)&&(_u=null,ns(n,r)),r=!1;var C=Et;e:do try{if(at!==0&&$e!==null){var L=$e,F=qn;switch(at){case 8:Ch(),C=6;break e;case 3:case 2:case 9:case 6:jn.current===null&&(r=!0);var J=at;if(at=0,qn=null,rs(n,L,F,J),i&&Zo){C=0;break e}break;default:J=at,at=0,qn=null,rs(n,L,F,J)}}Y6(),C=Et;break}catch(se){G2(n,se)}while(!0);return r&&n.shellSuspendCounter++,Xr=zi=null,tt=l,le.H=p,le.A=g,$e===null&&(ft=null,Ue=0,Hc()),C}function Y6(){for(;$e!==null;)Z2($e)}function Z6(n,r){var i=tt;tt|=2;var l=X2(),p=Y2();ft!==n||Ue!==r?(_u=null,wu=Jt()+500,ns(n,r)):Zo=Ea(n,r);e:do try{if(at!==0&&$e!==null){r=$e;var g=qn;t:switch(at){case 1:at=0,qn=null,rs(n,r,g,1);break;case 2:case 9:if(fb(g)){at=0,qn=null,ew(r);break}r=function(){at!==2&&at!==9||ft!==n||(at=7),ca(n)},g.then(r,r);break e;case 3:at=7;break e;case 4:at=5;break e;case 7:fb(g)?(at=0,qn=null,ew(r)):(at=0,qn=null,rs(n,r,g,7));break;case 5:var C=null;switch($e.tag){case 26:C=$e.memoizedState;case 5:case 27:var L=$e;if(C?Fw(C):L.stateNode.complete){at=0,qn=null;var F=L.sibling;if(F!==null)$e=F;else{var J=L.return;J===null?$e=null:($e=J,Cu(J))}break t}}at=0,qn=null,rs(n,r,g,5);break;case 6:at=0,qn=null,rs(n,r,g,6);break;case 8:Ch(),Et=6;break e;default:throw Error(s(462))}}eI();break}catch(se){G2(n,se)}while(!0);return Xr=zi=null,le.H=l,le.A=p,tt=i,$e===null?(ft=null,Ue=0,Hc(),Et):0}function eI(){for(;$e!==null&&!Xf();)Z2($e)}function Z2(n){var r=k2(n.alternate,n,sa);n.memoizedProps=n.pendingProps,r===null?Cu(n):$e=r}function ew(n){var r=n,i=r.alternate;switch(r.tag){case 15:case 0:r=y2(i,r,r.pendingProps,r.type,void 0,Ue);break;case 11:r=y2(i,r,r.pendingProps,r.type.render,r.ref,Ue);break;case 5:Fp(r);default:S2(i,r),r=$e=tb(r,sa),r=k2(i,r,sa)}n.memoizedProps=n.pendingProps,r===null?Cu(n):$e=r}function rs(n,r,i,l){Xr=zi=null,Fp(r),Uo=null,el=0;var p=r.return;try{if(V6(n,p,r,i,Ue)){Et=1,du(n,Jn(i,n.current)),$e=null;return}}catch(g){if(p!==null)throw $e=p,g;Et=1,du(n,Jn(i,n.current)),$e=null;return}r.flags&32768?(Ge||l===1?n=!0:Zo||Ue&536870912?n=!1:(Va=n=!0,(l===2||l===9||l===3||l===6)&&(l=jn.current,l!==null&&l.tag===13&&(l.flags|=16384))),tw(r,n)):Cu(r)}function Cu(n){var r=n;do{if(r.flags&32768){tw(r,Va);return}n=r.return;var i=W6(r.alternate,r,sa);if(i!==null){$e=i;return}if(r=r.sibling,r!==null){$e=r;return}$e=r=n}while(r!==null);Et===0&&(Et=5)}function tw(n,r){do{var i=U6(n.alternate,n);if(i!==null){i.flags&=32767,$e=i;return}if(i=n.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!r&&(n=n.sibling,n!==null)){$e=n;return}$e=n=i}while(n!==null);Et=6,$e=null}function nw(n,r,i,l,p,g,C,L,F){n.cancelPendingCommit=null;do Su();while(Ht!==0);if(tt&6)throw Error(s(327));if(r!==null){if(r===n.current)throw Error(s(177));if(g=r.lanes|r.childLanes,g|=pp,tp(n,i,g,C,L,F),n===ft&&($e=ft=null,Ue=0),ts=r,Wa=n,la=i,_h=g,xh=p,W2=l,r.subtreeFlags&10256||r.flags&10256?(n.callbackNode=null,n.callbackPriority=0,aI(Pt,function(){return sw(),null})):(n.callbackNode=null,n.callbackPriority=0),l=(r.flags&13878)!=0,r.subtreeFlags&13878||l){l=le.T,le.T=null,p=G.p,G.p=2,C=tt,tt|=4;try{K6(n,r,i)}finally{tt=C,G.p=p,le.T=l}}Ht=1,rw(),aw(),iw()}}function rw(){if(Ht===1){Ht=0;var n=Wa,r=ts,i=(r.flags&13878)!=0;if(r.subtreeFlags&13878||i){i=le.T,le.T=null;var l=G.p;G.p=2;var p=tt;tt|=4;try{j2(r,n);var g=Dh,C=Uv(n.containerInfo),L=g.focusedElem,F=g.selectionRange;if(C!==L&&L&&L.ownerDocument&&Wv(L.ownerDocument.documentElement,L)){if(F!==null&&lp(L)){var J=F.start,se=F.end;if(se===void 0&&(se=J),"selectionStart"in L)L.selectionStart=J,L.selectionEnd=Math.min(se,L.value.length);else{var pe=L.ownerDocument||document,Z=pe&&pe.defaultView||window;if(Z.getSelection){var re=Z.getSelection(),Ce=L.textContent.length,Re=Math.min(F.start,Ce),ut=F.end===void 0?Re:Math.min(F.end,Ce);!re.extend&&Re>ut&&(C=ut,ut=Re,Re=C);var W=$v(L,Re),H=$v(L,ut);if(W&&H&&(re.rangeCount!==1||re.anchorNode!==W.node||re.anchorOffset!==W.offset||re.focusNode!==H.node||re.focusOffset!==H.offset)){var Q=pe.createRange();Q.setStart(W.node,W.offset),re.removeAllRanges(),Re>ut?(re.addRange(Q),re.extend(H.node,H.offset)):(Q.setEnd(H.node,H.offset),re.addRange(Q))}}}}for(pe=[],re=L;re=re.parentNode;)re.nodeType===1&&pe.push({element:re,left:re.scrollLeft,top:re.scrollTop});for(typeof L.focus=="function"&&L.focus(),L=0;L<pe.length;L++){var ue=pe[L];ue.element.scrollLeft=ue.left,ue.element.scrollTop=ue.top}}ju=!!Nh,Dh=Nh=null}finally{tt=p,G.p=l,le.T=i}}n.current=r,Ht=2}}function aw(){if(Ht===2){Ht=0;var n=Wa,r=ts,i=(r.flags&8772)!=0;if(r.subtreeFlags&8772||i){i=le.T,le.T=null;var l=G.p;G.p=2;var p=tt;tt|=4;try{R2(n,r.alternate,r)}finally{tt=p,G.p=l,le.T=i}}Ht=3}}function iw(){if(Ht===4||Ht===3){Ht=0,kc();var n=Wa,r=ts,i=la,l=W2;r.subtreeFlags&10256||r.flags&10256?Ht=5:(Ht=0,ts=Wa=null,ow(n,n.pendingLanes));var p=n.pendingLanes;if(p===0&&($a=null),Ns(i),r=r.stateNode,ln&&typeof ln.onCommitFiberRoot=="function")try{ln.onCommitFiberRoot(wi,r,void 0,(r.current.flags&128)==128)}catch{}if(l!==null){r=le.T,p=G.p,G.p=2,le.T=null;try{for(var g=n.onRecoverableError,C=0;C<l.length;C++){var L=l[C];g(L.value,{componentStack:L.stack})}}finally{le.T=r,G.p=p}}la&3&&Su(),ca(n),p=n.pendingLanes,i&261930&&p&42?n===kh?yl++:(yl=0,kh=n):yl=0,vl(0,!1)}}function ow(n,r){(n.pooledCacheLanes&=r)===0&&(r=n.pooledCache,r!=null&&(n.pooledCache=null,Ys(r)))}function Su(){return rw(),aw(),iw(),sw()}function sw(){if(Ht!==5)return!1;var n=Wa,r=_h;_h=0;var i=Ns(la),l=le.T,p=G.p;try{G.p=32>i?32:i,le.T=null,i=xh,xh=null;var g=Wa,C=la;if(Ht=0,ts=Wa=null,la=0,tt&6)throw Error(s(331));var L=tt;if(tt|=4,V2(g.current),q2(g,g.current,C,i),tt=L,vl(0,!1),ln&&typeof ln.onPostCommitFiberRoot=="function")try{ln.onPostCommitFiberRoot(wi,g)}catch{}return!0}finally{G.p=p,le.T=l,ow(n,r)}}function lw(n,r,i){r=Jn(i,r),r=th(n.stateNode,r,2),n=Wi(n,r,2),n!==null&&(xi(n,2),ca(n))}function it(n,r,i){if(n.tag===3)lw(n,n,i);else for(;r!==null;){if(r.tag===3){lw(r,n,i);break}else if(r.tag===1){var l=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&($a===null||!$a.has(l))){n=Jn(i,n),i=c2(2),l=Wi(r,i,2),l!==null&&(u2(i,l,r,n),xi(l,2),ca(l));break}}r=r.return}}function Eh(n,r,i){var l=n.pingCache;if(l===null){l=n.pingCache=new J6;var p=new Set;l.set(r,p)}else p=l.get(r),p===void 0&&(p=new Set,l.set(r,p));p.has(i)||(vh=!0,p.add(i),n=tI.bind(null,n,r,i),r.then(n,n))}function tI(n,r,i){var l=n.pingCache;l!==null&&l.delete(r),n.pingedLanes|=n.suspendedLanes&i,n.warmLanes&=~i,ft===n&&(Ue&i)===i&&(Et===4||Et===3&&(Ue&62914560)===Ue&&300>Jt()-bu?!(tt&2)&&ns(n,0):bh|=i,es===Ue&&(es=0)),ca(n)}function cw(n,r){r===0&&(r=Ec()),n=Ni(n,r),n!==null&&(xi(n,r),ca(n))}function nI(n){var r=n.memoizedState,i=0;r!==null&&(i=r.retryLane),cw(n,i)}function rI(n,r){var i=0;switch(n.tag){case 31:case 13:var l=n.stateNode,p=n.memoizedState;p!==null&&(i=p.retryLane);break;case 19:l=n.stateNode;break;case 22:l=n.stateNode._retryCache;break;default:throw Error(s(314))}l!==null&&l.delete(r),cw(n,i)}function aI(n,r){return pr(n,r)}var Eu=null,as=null,Th=!1,Tu=!1,Ih=!1,Ka=0;function ca(n){n!==as&&n.next===null&&(as===null?Eu=as=n:as=as.next=n),Tu=!0,Th||(Th=!0,oI())}function vl(n,r){if(!Ih&&Tu){Ih=!0;do for(var i=!1,l=Eu;l!==null;){if(!r)if(n!==0){var p=l.pendingLanes;if(p===0)var g=0;else{var C=l.suspendedLanes,L=l.pingedLanes;g=(1<<31-gt(42|n)+1)-1,g&=p&~(C&~L),g=g&201326741?g&201326741|1:g?g|2:0}g!==0&&(i=!0,pw(l,g))}else g=Ue,g=Eo(l,l===ft?g:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),!(g&3)||Ea(l,g)||(i=!0,pw(l,g));l=l.next}while(i);Ih=!1}}function iI(){uw()}function uw(){Tu=Th=!1;var n=0;Ka!==0&&hI()&&(n=Ka);for(var r=Jt(),i=null,l=Eu;l!==null;){var p=l.next,g=dw(l,r);g===0?(l.next=null,i===null?Eu=p:i.next=p,p===null&&(as=i)):(i=l,(n!==0||g&3)&&(Tu=!0)),l=p}Ht!==0&&Ht!==5||vl(n,!1),Ka!==0&&(Ka=0)}function dw(n,r){for(var i=n.suspendedLanes,l=n.pingedLanes,p=n.expirationTimes,g=n.pendingLanes&-62914561;0<g;){var C=31-gt(g),L=1<<C,F=p[C];F===-1?((L&i)===0||(L&l)!==0)&&(p[C]=Sc(L,r)):F<=r&&(n.expiredLanes|=L),g&=~L}if(r=ft,i=Ue,i=Eo(n,n===r?i:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),l=n.callbackNode,i===0||n===r&&(at===2||at===9)||n.cancelPendingCommit!==null)return l!==null&&l!==null&&bn(l),n.callbackNode=null,n.callbackPriority=0;if(!(i&3)||Ea(n,i)){if(r=i&-i,r===n.callbackPriority)return r;switch(l!==null&&bn(l),Ns(i)){case 2:case 8:i=Cc;break;case 32:i=Pt;break;case 268435456:i=Ct;break;default:i=Pt}return l=fw.bind(null,n),i=pr(i,l),n.callbackPriority=r,n.callbackNode=i,r}return l!==null&&l!==null&&bn(l),n.callbackPriority=2,n.callbackNode=null,2}function fw(n,r){if(Ht!==0&&Ht!==5)return n.callbackNode=null,n.callbackPriority=0,null;var i=n.callbackNode;if(Su()&&n.callbackNode!==i)return null;var l=Ue;return l=Eo(n,n===ft?l:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),l===0?null:(K2(n,l,r),dw(n,Jt()),n.callbackNode!=null&&n.callbackNode===i?fw.bind(null,n):null)}function pw(n,r){if(Su())return null;K2(n,r,!0)}function oI(){gI(function(){tt&6?pr(Vr,iI):uw()})}function Lh(){if(Ka===0){var n=Ho;n===0&&(n=_i,_i<<=1,!(_i&261888)&&(_i=256)),Ka=n}return Ka}function hw(n){return n==null||typeof n=="symbol"||typeof n=="boolean"?null:typeof n=="function"?n:Ao(""+n)}function mw(n,r){var i=r.ownerDocument.createElement("input");return i.name=r.name,i.value=r.value,n.id&&i.setAttribute("form",n.id),r.parentNode.insertBefore(i,r),n=new FormData(n),i.parentNode.removeChild(i),n}function sI(n,r,i,l,p){if(r==="submit"&&i&&i.stateNode===p){var g=hw((p[Yt]||null).action),C=l.submitter;C&&(r=(r=C[Yt]||null)?hw(r.formAction):C.getAttribute("formAction"),r!==null&&(g=r,C=null));var L=new u("action","action",null,l,p);n.push({event:L,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(Ka!==0){var F=C?mw(p,C):new FormData(p);Gp(i,{pending:!0,data:F,method:p.method,action:g},null,F)}}else typeof g=="function"&&(L.preventDefault(),F=C?mw(p,C):new FormData(p),Gp(i,{pending:!0,data:F,method:p.method,action:g},g,F))},currentTarget:p}]})}}for(var Oh=0;Oh<fp.length;Oh++){var Ah=fp[Oh];yr(Ah.toLowerCase(),"on"+(Ah[0].toUpperCase()+Ah.slice(1)))}yr(Gv,"onAnimationEnd"),yr(Jv,"onAnimationIteration"),yr(Xv,"onAnimationStart"),yr("dblclick","onDoubleClick"),yr("focusin","onFocus"),yr("focusout","onBlur"),yr(x6,"onTransitionRun"),yr(k6,"onTransitionStart"),yr(C6,"onTransitionCancel"),yr(Yv,"onTransitionEnd"),Oa("onMouseEnter",["mouseout","mouseover"]),Oa("onMouseLeave",["mouseout","mouseover"]),Oa("onPointerEnter",["pointerout","pointerover"]),Oa("onPointerLeave",["pointerout","pointerover"]),Lr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Lr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Lr("onBeforeInput",["compositionend","keypress","textInput","paste"]),Lr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Lr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Lr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var bl="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),lI=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(bl));function gw(n,r){r=(r&4)!=0;for(var i=0;i<n.length;i++){var l=n[i],p=l.event;l=l.listeners;e:{var g=void 0;if(r)for(var C=l.length-1;0<=C;C--){var L=l[C],F=L.instance,J=L.currentTarget;if(L=L.listener,F!==g&&p.isPropagationStopped())break e;g=L,p.currentTarget=J;try{g(p)}catch(se){Vc(se)}p.currentTarget=null,g=F}else for(C=0;C<l.length;C++){if(L=l[C],F=L.instance,J=L.currentTarget,L=L.listener,F!==g&&p.isPropagationStopped())break e;g=L,p.currentTarget=J;try{g(p)}catch(se){Vc(se)}p.currentTarget=null,g=F}}}}function We(n,r){var i=r[Ds];i===void 0&&(i=r[Ds]=new Set);var l=n+"__bubble";i.has(l)||(vw(r,n,2,!1),i.add(l))}function Rh(n,r,i){var l=0;r&&(l|=4),vw(i,n,l,r)}var Iu="_reactListening"+Math.random().toString(36).slice(2);function yw(n){if(!n[Iu]){n[Iu]=!0,zs.forEach(function(i){i!=="selectionchange"&&(lI.has(i)||Rh(i,!1,n),Rh(i,!0,n))});var r=n.nodeType===9?n:n.ownerDocument;r===null||r[Iu]||(r[Iu]=!0,Rh("selectionchange",!1,r))}}function vw(n,r,i,l){switch(Ww(r)){case 2:var p=zI;break;case 8:p=qI;break;default:p=Kh}i=p.bind(null,r,i,n),p=void 0,!Hs||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(p=!0),l?p===void 0?n.addEventListener(r,i,!0):n.addEventListener(r,i,{capture:!0,passive:p}):p===void 0?n.addEventListener(r,i,!1):n.addEventListener(r,i,{passive:p})}function Mh(n,r,i,l,p){var g=l;if(!(r&1)&&!(r&2)&&l!==null)e:for(;;){if(l===null)return;var C=l.tag;if(C===3||C===4){var L=l.stateNode.containerInfo;if(L===p)break;if(C===4)for(C=l.return;C!==null;){var F=C.tag;if((F===3||F===4)&&C.stateNode.containerInfo===p)return;C=C.return}for(;L!==null;){if(C=Ir(L),C===null)return;if(F=C.tag,F===5||F===6||F===26||F===27){l=g=C;continue e}L=L.parentNode}}l=l.return}zc(function(){var J=g,se=Bs(i),pe=[];e:{var Z=Zv.get(n);if(Z!==void 0){var re=u,Ce=n;switch(n){case"keypress":if(Oi(i)===0)break e;case"keydown":case"keyup":re=ke;break;case"focusin":Ce="focus",re=j;break;case"focusout":Ce="blur",re=j;break;case"beforeblur":case"afterblur":re=j;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":re=O;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":re=R;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":re=Ye;break;case Gv:case Jv:case Xv:re=D;break;case Yv:re=Be;break;case"scroll":case"scrollend":re=y;break;case"wheel":re=dt;break;case"copy":case"cut":case"paste":re=ee;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":re=Ae;break;case"toggle":case"beforetoggle":re=yt}var Re=(r&4)!=0,ut=!Re&&(n==="scroll"||n==="scrollend"),W=Re?Z===null?null:Z+"Capture":Z;Re=[];for(var H=J,Q;H!==null;){var ue=H;if(Q=ue.stateNode,ue=ue.tag,ue!==5&&ue!==26&&ue!==27||Q===null||W===null||(ue=Ti(H,W),ue!=null&&Re.push(wl(H,ue,Q))),ut)break;H=H.return}0<Re.length&&(Z=new re(Z,Ce,null,i,se),pe.push({event:Z,listeners:Re}))}}if(!(r&7)){e:{if(Z=n==="mouseover"||n==="pointerover",re=n==="mouseout"||n==="pointerout",Z&&i!==Kt&&(Ce=i.relatedTarget||i.fromElement)&&(Ir(Ce)||Ce[Ta]))break e;if((re||Z)&&(Z=se.window===se?se:(Z=se.ownerDocument)?Z.defaultView||Z.parentWindow:window,re?(Ce=i.relatedTarget||i.toElement,re=J,Ce=Ce?Ir(Ce):null,Ce!==null&&(ut=f(Ce),Re=Ce.tag,Ce!==ut||Re!==5&&Re!==27&&Re!==6)&&(Ce=null)):(re=null,Ce=J),re!==Ce)){if(Re=O,ue="onMouseLeave",W="onMouseEnter",H="mouse",(n==="pointerout"||n==="pointerover")&&(Re=Ae,ue="onPointerLeave",W="onPointerEnter",H="pointer"),ut=re==null?Z:fn(re),Q=Ce==null?Z:fn(Ce),Z=new Re(ue,H+"leave",re,i,se),Z.target=ut,Z.relatedTarget=Q,ue=null,Ir(se)===J&&(Re=new Re(W,H+"enter",Ce,i,se),Re.target=Q,Re.relatedTarget=ut,ue=Re),ut=ue,re&&Ce)t:{for(Re=cI,W=re,H=Ce,Q=0,ue=W;ue;ue=Re(ue))Q++;ue=0;for(var Ie=H;Ie;Ie=Re(Ie))ue++;for(;0<Q-ue;)W=Re(W),Q--;for(;0<ue-Q;)H=Re(H),ue--;for(;Q--;){if(W===H||H!==null&&W===H.alternate){Re=W;break t}W=Re(W),H=Re(H)}Re=null}else Re=null;re!==null&&bw(pe,Z,re,Re,!1),Ce!==null&&ut!==null&&bw(pe,ut,Ce,Re,!0)}}e:{if(Z=J?fn(J):window,re=Z.nodeName&&Z.nodeName.toLowerCase(),re==="select"||re==="input"&&Z.type==="file")var nt=zv;else if(Dv(Z))if(qv)nt=b6;else{nt=y6;var Se=g6}else re=Z.nodeName,!re||re.toLowerCase()!=="input"||Z.type!=="checkbox"&&Z.type!=="radio"?J&&Ei(J.elementType)&&(nt=zv):nt=v6;if(nt&&(nt=nt(n,J))){jv(pe,nt,i,se);break e}Se&&Se(n,Z,J),n==="focusout"&&J&&Z.type==="number"&&J.memoizedProps.value!=null&&Wr(Z,"number",Z.value)}switch(Se=J?fn(J):window,n){case"focusin":(Dv(Se)||Se.contentEditable==="true")&&(No=Se,cp=J,Gs=null);break;case"focusout":Gs=cp=No=null;break;case"mousedown":up=!0;break;case"contextmenu":case"mouseup":case"dragend":up=!1,Kv(pe,i,se);break;case"selectionchange":if(_6)break;case"keydown":case"keyup":Kv(pe,i,se)}var qe;if(Pe)e:{switch(n){case"compositionstart":var Ke="onCompositionStart";break e;case"compositionend":Ke="onCompositionEnd";break e;case"compositionupdate":Ke="onCompositionUpdate";break e}Ke=void 0}else Po?Fc(n,i)&&(Ke="onCompositionEnd"):n==="keydown"&&i.keyCode===229&&(Ke="onCompositionStart");Ke&&(Vt&&i.locale!=="ko"&&(Po||Ke!=="onCompositionStart"?Ke==="onCompositionEnd"&&Po&&(qe=$s()):(gr=se,Ro="value"in gr?gr.value:gr.textContent,Po=!0)),Se=Lu(J,Ke),0<Se.length&&(Ke=new Y(Ke,n,null,i,se),pe.push({event:Ke,listeners:Se}),qe?Ke.data=qe:(qe=Mo(i),qe!==null&&(Ke.data=qe)))),(qe=Nt?f6(n,i):p6(n,i))&&(Ke=Lu(J,"onBeforeInput"),0<Ke.length&&(Se=new Y("onBeforeInput","beforeinput",null,i,se),pe.push({event:Se,listeners:Ke}),Se.data=qe)),sI(pe,n,J,i,se)}gw(pe,r)})}function wl(n,r,i){return{instance:n,listener:r,currentTarget:i}}function Lu(n,r){for(var i=r+"Capture",l=[];n!==null;){var p=n,g=p.stateNode;if(p=p.tag,p!==5&&p!==26&&p!==27||g===null||(p=Ti(n,i),p!=null&&l.unshift(wl(n,p,g)),p=Ti(n,r),p!=null&&l.push(wl(n,p,g))),n.tag===3)return l;n=n.return}return[]}function cI(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5&&n.tag!==27);return n||null}function bw(n,r,i,l,p){for(var g=r._reactName,C=[];i!==null&&i!==l;){var L=i,F=L.alternate,J=L.stateNode;if(L=L.tag,F!==null&&F===l)break;L!==5&&L!==26&&L!==27||J===null||(F=J,p?(J=Ti(i,g),J!=null&&C.unshift(wl(i,J,F))):p||(J=Ti(i,g),J!=null&&C.push(wl(i,J,F)))),i=i.return}C.length!==0&&n.push({event:r,listeners:C})}var uI=/\r\n?/g,dI=/\u0000|\uFFFD/g;function ww(n){return(typeof n=="string"?n:""+n).replace(uI,`
10
- `).replace(dI,"")}function _w(n,r){return r=ww(r),ww(n)===r}function ct(n,r,i,l,p,g){switch(i){case"children":typeof l=="string"?r==="body"||r==="textarea"&&l===""||Ur(n,l):(typeof l=="number"||typeof l=="bigint")&&r!=="body"&&Ur(n,""+l);break;case"className":Si(n,"class",l);break;case"tabIndex":Si(n,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":Si(n,i,l);break;case"style":Nc(n,l,g);break;case"data":if(r!=="object"){Si(n,"data",l);break}case"src":case"href":if(l===""&&(r!=="a"||i!=="href")){n.removeAttribute(i);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){n.removeAttribute(i);break}l=Ao(""+l),n.setAttribute(i,l);break;case"action":case"formAction":if(typeof l=="function"){n.setAttribute(i,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof g=="function"&&(i==="formAction"?(r!=="input"&&ct(n,r,"name",p.name,p,null),ct(n,r,"formEncType",p.formEncType,p,null),ct(n,r,"formMethod",p.formMethod,p,null),ct(n,r,"formTarget",p.formTarget,p,null)):(ct(n,r,"encType",p.encType,p,null),ct(n,r,"method",p.method,p,null),ct(n,r,"target",p.target,p,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){n.removeAttribute(i);break}l=Ao(""+l),n.setAttribute(i,l);break;case"onClick":l!=null&&(n.onclick=Qn);break;case"onScroll":l!=null&&We("scroll",n);break;case"onScrollEnd":l!=null&&We("scrollend",n);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(s(61));if(i=l.__html,i!=null){if(p.children!=null)throw Error(s(60));n.innerHTML=i}}break;case"multiple":n.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":n.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){n.removeAttribute("xlink:href");break}i=Ao(""+l),n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",i);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":l!=null&&typeof l!="function"&&typeof l!="symbol"?n.setAttribute(i,""+l):n.removeAttribute(i);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":l&&typeof l!="function"&&typeof l!="symbol"?n.setAttribute(i,""):n.removeAttribute(i);break;case"capture":case"download":l===!0?n.setAttribute(i,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?n.setAttribute(i,l):n.removeAttribute(i);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?n.setAttribute(i,l):n.removeAttribute(i);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?n.removeAttribute(i):n.setAttribute(i,l);break;case"popover":We("beforetoggle",n),We("toggle",n),Ci(n,"popover",l);break;case"xlinkActuate":hr(n,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":hr(n,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":hr(n,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":hr(n,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":hr(n,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":hr(n,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":hr(n,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":hr(n,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":hr(n,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":Ci(n,"is",l);break;case"innerText":case"textContent":break;default:(!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(i=Oo.get(i)||i,Ci(n,i,l))}}function Ph(n,r,i,l,p,g){switch(i){case"style":Nc(n,l,g);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(s(61));if(i=l.__html,i!=null){if(p.children!=null)throw Error(s(60));n.innerHTML=i}}break;case"children":typeof l=="string"?Ur(n,l):(typeof l=="number"||typeof l=="bigint")&&Ur(n,""+l);break;case"onScroll":l!=null&&We("scroll",n);break;case"onScrollEnd":l!=null&&We("scrollend",n);break;case"onClick":l!=null&&(n.onclick=Qn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Oc.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(p=i.endsWith("Capture"),r=i.slice(2,p?i.length-7:void 0),g=n[Yt]||null,g=g==null?null:g[i],typeof g=="function"&&n.removeEventListener(r,g,p),typeof l=="function")){typeof g!="function"&&g!==null&&(i in n?n[i]=null:n.hasAttribute(i)&&n.removeAttribute(i)),n.addEventListener(r,l,p);break e}i in n?n[i]=l:l===!0?n.setAttribute(i,""):Ci(n,i,l)}}}function nn(n,r,i){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":We("error",n),We("load",n);var l=!1,p=!1,g;for(g in i)if(i.hasOwnProperty(g)){var C=i[g];if(C!=null)switch(g){case"src":l=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,r));default:ct(n,r,g,C,i,null)}}p&&ct(n,r,"srcSet",i.srcSet,i,null),l&&ct(n,r,"src",i.src,i,null);return;case"input":We("invalid",n);var L=g=C=p=null,F=null,J=null;for(l in i)if(i.hasOwnProperty(l)){var se=i[l];if(se!=null)switch(l){case"name":p=se;break;case"type":C=se;break;case"checked":F=se;break;case"defaultChecked":J=se;break;case"value":g=se;break;case"defaultValue":L=se;break;case"children":case"dangerouslySetInnerHTML":if(se!=null)throw Error(s(137,r));break;default:ct(n,r,l,se,i,null)}}Pc(n,g,L,F,J,C,p,!1);return;case"select":for(p in We("invalid",n),l=C=g=null,i)if(i.hasOwnProperty(p)&&(L=i[p],L!=null))switch(p){case"value":g=L;break;case"defaultValue":C=L;break;case"multiple":l=L;default:ct(n,r,p,L,i,null)}r=g,i=C,n.multiple=!!l,r==null?i!=null&&Ra(n,!!l,i,!0):Ra(n,!!l,r,!1);return;case"textarea":for(C in We("invalid",n),g=p=l=null,i)if(i.hasOwnProperty(C)&&(L=i[C],L!=null))switch(C){case"value":l=L;break;case"defaultValue":p=L;break;case"children":g=L;break;case"dangerouslySetInnerHTML":if(L!=null)throw Error(s(91));break;default:ct(n,r,C,L,i,null)}Lo(n,l,p,g);return;case"option":for(F in i)i.hasOwnProperty(F)&&(l=i[F],l!=null)&&(F==="selected"?n.selected=l&&typeof l!="function"&&typeof l!="symbol":ct(n,r,F,l,i,null));return;case"dialog":We("beforetoggle",n),We("toggle",n),We("cancel",n),We("close",n);break;case"iframe":case"object":We("load",n);break;case"video":case"audio":for(l=0;l<bl.length;l++)We(bl[l],n);break;case"image":We("error",n),We("load",n);break;case"details":We("toggle",n);break;case"embed":case"source":case"link":We("error",n),We("load",n);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(J in i)if(i.hasOwnProperty(J)&&(l=i[J],l!=null))switch(J){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,r));default:ct(n,r,J,l,i,null)}return;default:if(Ei(r)){for(se in i)i.hasOwnProperty(se)&&(l=i[se],l!==void 0&&Ph(n,r,se,l,i,void 0));return}}for(L in i)i.hasOwnProperty(L)&&(l=i[L],l!=null&&ct(n,r,L,l,i,null))}function fI(n,r,i,l){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var p=null,g=null,C=null,L=null,F=null,J=null,se=null;for(re in i){var pe=i[re];if(i.hasOwnProperty(re)&&pe!=null)switch(re){case"checked":break;case"value":break;case"defaultValue":F=pe;default:l.hasOwnProperty(re)||ct(n,r,re,null,l,pe)}}for(var Z in l){var re=l[Z];if(pe=i[Z],l.hasOwnProperty(Z)&&(re!=null||pe!=null))switch(Z){case"type":g=re;break;case"name":p=re;break;case"checked":J=re;break;case"defaultChecked":se=re;break;case"value":C=re;break;case"defaultValue":L=re;break;case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(s(137,r));break;default:re!==pe&&ct(n,r,Z,re,l,pe)}}Aa(n,C,L,F,J,se,g,p);return;case"select":for(g in re=C=L=Z=null,i)if(F=i[g],i.hasOwnProperty(g)&&F!=null)switch(g){case"value":break;case"multiple":re=F;default:l.hasOwnProperty(g)||ct(n,r,g,null,l,F)}for(p in l)if(g=l[p],F=i[p],l.hasOwnProperty(p)&&(g!=null||F!=null))switch(p){case"value":Z=g;break;case"defaultValue":L=g;break;case"multiple":C=g;default:g!==F&&ct(n,r,p,g,l,F)}r=L,i=C,l=re,Z==null?!!l!=!!i&&(r==null?Ra(n,!!i,i?[]:"",!1):Ra(n,!!i,r,!0)):Ra(n,!!i,Z,!1);return;case"textarea":for(L in re=Z=null,i)if(p=i[L],i.hasOwnProperty(L)&&p!=null&&!l.hasOwnProperty(L))switch(L){case"value":break;case"children":break;default:ct(n,r,L,null,l,p)}for(C in l)if(p=l[C],g=i[C],l.hasOwnProperty(C)&&(p!=null||g!=null))switch(C){case"value":Z=p;break;case"defaultValue":re=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(s(91));break;default:p!==g&&ct(n,r,C,p,l,g)}Ma(n,Z,re);return;case"option":for(var Ce in i)Z=i[Ce],i.hasOwnProperty(Ce)&&Z!=null&&!l.hasOwnProperty(Ce)&&(Ce==="selected"?n.selected=!1:ct(n,r,Ce,null,l,Z));for(F in l)Z=l[F],re=i[F],l.hasOwnProperty(F)&&Z!==re&&(Z!=null||re!=null)&&(F==="selected"?n.selected=Z&&typeof Z!="function"&&typeof Z!="symbol":ct(n,r,F,Z,l,re));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Re in i)Z=i[Re],i.hasOwnProperty(Re)&&Z!=null&&!l.hasOwnProperty(Re)&&ct(n,r,Re,null,l,Z);for(J in l)if(Z=l[J],re=i[J],l.hasOwnProperty(J)&&Z!==re&&(Z!=null||re!=null))switch(J){case"children":case"dangerouslySetInnerHTML":if(Z!=null)throw Error(s(137,r));break;default:ct(n,r,J,Z,l,re)}return;default:if(Ei(r)){for(var ut in i)Z=i[ut],i.hasOwnProperty(ut)&&Z!==void 0&&!l.hasOwnProperty(ut)&&Ph(n,r,ut,void 0,l,Z);for(se in l)Z=l[se],re=i[se],!l.hasOwnProperty(se)||Z===re||Z===void 0&&re===void 0||Ph(n,r,se,Z,l,re);return}}for(var W in i)Z=i[W],i.hasOwnProperty(W)&&Z!=null&&!l.hasOwnProperty(W)&&ct(n,r,W,null,l,Z);for(pe in l)Z=l[pe],re=i[pe],!l.hasOwnProperty(pe)||Z===re||Z==null&&re==null||ct(n,r,pe,Z,l,re)}function xw(n){switch(n){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function pI(){if(typeof performance.getEntriesByType=="function"){for(var n=0,r=0,i=performance.getEntriesByType("resource"),l=0;l<i.length;l++){var p=i[l],g=p.transferSize,C=p.initiatorType,L=p.duration;if(g&&L&&xw(C)){for(C=0,L=p.responseEnd,l+=1;l<i.length;l++){var F=i[l],J=F.startTime;if(J>L)break;var se=F.transferSize,pe=F.initiatorType;se&&xw(pe)&&(F=F.responseEnd,C+=se*(F<L?1:(L-J)/(F-J)))}if(--l,r+=8*(g+C)/(p.duration/1e3),n++,10<n)break}}if(0<n)return r/n/1e6}return navigator.connection&&(n=navigator.connection.downlink,typeof n=="number")?n:5}var Nh=null,Dh=null;function Ou(n){return n.nodeType===9?n:n.ownerDocument}function kw(n){switch(n){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Cw(n,r){if(n===0)switch(r){case"svg":return 1;case"math":return 2;default:return 0}return n===1&&r==="foreignObject"?0:n}function jh(n,r){return n==="textarea"||n==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.children=="bigint"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var zh=null;function hI(){var n=window.event;return n&&n.type==="popstate"?n===zh?!1:(zh=n,!0):(zh=null,!1)}var Sw=typeof setTimeout=="function"?setTimeout:void 0,mI=typeof clearTimeout=="function"?clearTimeout:void 0,Ew=typeof Promise=="function"?Promise:void 0,gI=typeof queueMicrotask=="function"?queueMicrotask:Ew===void 0?Sw:function(n){return Ew.resolve(null).then(n).catch(yI)};function yI(n){setTimeout(function(){throw n})}function Qa(n){return n==="head"}function Tw(n,r){var i=r,l=0;do{var p=i.nextSibling;if(n.removeChild(i),p&&p.nodeType===8)if(i=p.data,i==="/$"||i==="/&"){if(l===0){n.removeChild(p),ls(r);return}l--}else if(i==="$"||i==="$?"||i==="$~"||i==="$!"||i==="&")l++;else if(i==="html")_l(n.ownerDocument.documentElement);else if(i==="head"){i=n.ownerDocument.head,_l(i);for(var g=i.firstChild;g;){var C=g.nextSibling,L=g.nodeName;g[ki]||L==="SCRIPT"||L==="STYLE"||L==="LINK"&&g.rel.toLowerCase()==="stylesheet"||i.removeChild(g),g=C}}else i==="body"&&_l(n.ownerDocument.body);i=p}while(i);ls(r)}function Iw(n,r){var i=n;n=0;do{var l=i.nextSibling;if(i.nodeType===1?r?(i._stashedDisplay=i.style.display,i.style.display="none"):(i.style.display=i._stashedDisplay||"",i.getAttribute("style")===""&&i.removeAttribute("style")):i.nodeType===3&&(r?(i._stashedText=i.nodeValue,i.nodeValue=""):i.nodeValue=i._stashedText||""),l&&l.nodeType===8)if(i=l.data,i==="/$"){if(n===0)break;n--}else i!=="$"&&i!=="$?"&&i!=="$~"&&i!=="$!"||n++;i=l}while(i)}function qh(n){var r=n.firstChild;for(r&&r.nodeType===10&&(r=r.nextSibling);r;){var i=r;switch(r=r.nextSibling,i.nodeName){case"HTML":case"HEAD":case"BODY":qh(i),Io(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}n.removeChild(i)}}function vI(n,r,i,l){for(;n.nodeType===1;){var p=i;if(n.nodeName.toLowerCase()!==r.toLowerCase()){if(!l&&(n.nodeName!=="INPUT"||n.type!=="hidden"))break}else if(l){if(!n[ki])switch(r){case"meta":if(!n.hasAttribute("itemprop"))break;return n;case"link":if(g=n.getAttribute("rel"),g==="stylesheet"&&n.hasAttribute("data-precedence")||g!==p.rel||n.getAttribute("href")!==(p.href==null||p.href===""?null:p.href)||n.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin)||n.getAttribute("title")!==(p.title==null?null:p.title))break;return n;case"style":if(n.hasAttribute("data-precedence"))break;return n;case"script":if(g=n.getAttribute("src"),(g!==(p.src==null?null:p.src)||n.getAttribute("type")!==(p.type==null?null:p.type)||n.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin))&&g&&n.hasAttribute("async")&&!n.hasAttribute("itemprop"))break;return n;default:return n}}else if(r==="input"&&n.type==="hidden"){var g=p.name==null?null:""+p.name;if(p.type==="hidden"&&n.getAttribute("name")===g)return n}else return n;if(n=tr(n.nextSibling),n===null)break}return null}function bI(n,r,i){if(r==="")return null;for(;n.nodeType!==3;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!i||(n=tr(n.nextSibling),n===null))return null;return n}function Lw(n,r){for(;n.nodeType!==8;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!r||(n=tr(n.nextSibling),n===null))return null;return n}function Fh(n){return n.data==="$?"||n.data==="$~"}function Bh(n){return n.data==="$!"||n.data==="$?"&&n.ownerDocument.readyState!=="loading"}function wI(n,r){var i=n.ownerDocument;if(n.data==="$~")n._reactRetry=r;else if(n.data!=="$?"||i.readyState!=="loading")r();else{var l=function(){r(),i.removeEventListener("DOMContentLoaded",l)};i.addEventListener("DOMContentLoaded",l),n._reactRetry=l}}function tr(n){for(;n!=null;n=n.nextSibling){var r=n.nodeType;if(r===1||r===3)break;if(r===8){if(r=n.data,r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"||r==="F!"||r==="F")break;if(r==="/$"||r==="/&")return null}}return n}var Vh=null;function Ow(n){n=n.nextSibling;for(var r=0;n;){if(n.nodeType===8){var i=n.data;if(i==="/$"||i==="/&"){if(r===0)return tr(n.nextSibling);r--}else i!=="$"&&i!=="$!"&&i!=="$?"&&i!=="$~"&&i!=="&"||r++}n=n.nextSibling}return null}function Aw(n){n=n.previousSibling;for(var r=0;n;){if(n.nodeType===8){var i=n.data;if(i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"){if(r===0)return n;r--}else i!=="/$"&&i!=="/&"||r++}n=n.previousSibling}return null}function Rw(n,r,i){switch(r=Ou(i),n){case"html":if(n=r.documentElement,!n)throw Error(s(452));return n;case"head":if(n=r.head,!n)throw Error(s(453));return n;case"body":if(n=r.body,!n)throw Error(s(454));return n;default:throw Error(s(451))}}function _l(n){for(var r=n.attributes;r.length;)n.removeAttributeNode(r[0]);Io(n)}var nr=new Map,Mw=new Set;function Au(n){return typeof n.getRootNode=="function"?n.getRootNode():n.nodeType===9?n:n.ownerDocument}var ua=G.d;G.d={f:_I,r:xI,D:kI,C:CI,L:SI,m:EI,X:II,S:TI,M:LI};function _I(){var n=ua.f(),r=xu();return n||r}function xI(n){var r=Ia(n);r!==null&&r.tag===5&&r.type==="form"?Yb(r):ua.r(n)}var is=typeof document>"u"?null:document;function Pw(n,r,i){var l=is;if(l&&typeof r=="string"&&r){var p=Pn(r);p='link[rel="'+n+'"][href="'+p+'"]',typeof i=="string"&&(p+='[crossorigin="'+i+'"]'),Mw.has(p)||(Mw.add(p),n={rel:n,crossOrigin:i,href:r},l.querySelector(p)===null&&(r=l.createElement("link"),nn(r,"link",n),Lt(r),l.head.appendChild(r)))}}function kI(n){ua.D(n),Pw("dns-prefetch",n,null)}function CI(n,r){ua.C(n,r),Pw("preconnect",n,r)}function SI(n,r,i){ua.L(n,r,i);var l=is;if(l&&n&&r){var p='link[rel="preload"][as="'+Pn(r)+'"]';r==="image"&&i&&i.imageSrcSet?(p+='[imagesrcset="'+Pn(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(p+='[imagesizes="'+Pn(i.imageSizes)+'"]')):p+='[href="'+Pn(n)+'"]';var g=p;switch(r){case"style":g=os(n);break;case"script":g=ss(n)}nr.has(g)||(n=S({rel:"preload",href:r==="image"&&i&&i.imageSrcSet?void 0:n,as:r},i),nr.set(g,n),l.querySelector(p)!==null||r==="style"&&l.querySelector(xl(g))||r==="script"&&l.querySelector(kl(g))||(r=l.createElement("link"),nn(r,"link",n),Lt(r),l.head.appendChild(r)))}}function EI(n,r){ua.m(n,r);var i=is;if(i&&n){var l=r&&typeof r.as=="string"?r.as:"script",p='link[rel="modulepreload"][as="'+Pn(l)+'"][href="'+Pn(n)+'"]',g=p;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":g=ss(n)}if(!nr.has(g)&&(n=S({rel:"modulepreload",href:n},r),nr.set(g,n),i.querySelector(p)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(kl(g)))return}l=i.createElement("link"),nn(l,"link",n),Lt(l),i.head.appendChild(l)}}}function TI(n,r,i){ua.S(n,r,i);var l=is;if(l&&n){var p=La(l).hoistableStyles,g=os(n);r||(r="default");var C=p.get(g);if(!C){var L={loading:0,preload:null};if(C=l.querySelector(xl(g)))L.loading=5;else{n=S({rel:"stylesheet",href:n,"data-precedence":r},i),(i=nr.get(g))&&Hh(n,i);var F=C=l.createElement("link");Lt(F),nn(F,"link",n),F._p=new Promise(function(J,se){F.onload=J,F.onerror=se}),F.addEventListener("load",function(){L.loading|=1}),F.addEventListener("error",function(){L.loading|=2}),L.loading|=4,Ru(C,r,l)}C={type:"stylesheet",instance:C,count:1,state:L},p.set(g,C)}}}function II(n,r){ua.X(n,r);var i=is;if(i&&n){var l=La(i).hoistableScripts,p=ss(n),g=l.get(p);g||(g=i.querySelector(kl(p)),g||(n=S({src:n,async:!0},r),(r=nr.get(p))&&$h(n,r),g=i.createElement("script"),Lt(g),nn(g,"link",n),i.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},l.set(p,g))}}function LI(n,r){ua.M(n,r);var i=is;if(i&&n){var l=La(i).hoistableScripts,p=ss(n),g=l.get(p);g||(g=i.querySelector(kl(p)),g||(n=S({src:n,async:!0,type:"module"},r),(r=nr.get(p))&&$h(n,r),g=i.createElement("script"),Lt(g),nn(g,"link",n),i.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},l.set(p,g))}}function Nw(n,r,i,l){var p=(p=Mt.current)?Au(p):null;if(!p)throw Error(s(446));switch(n){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(r=os(i.href),i=La(p).hoistableStyles,l=i.get(r),l||(l={type:"style",instance:null,count:0,state:null},i.set(r,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(i.rel==="stylesheet"&&typeof i.href=="string"&&typeof i.precedence=="string"){n=os(i.href);var g=La(p).hoistableStyles,C=g.get(n);if(C||(p=p.ownerDocument||p,C={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},g.set(n,C),(g=p.querySelector(xl(n)))&&!g._p&&(C.instance=g,C.state.loading=5),nr.has(n)||(i={rel:"preload",as:"style",href:i.href,crossOrigin:i.crossOrigin,integrity:i.integrity,media:i.media,hrefLang:i.hrefLang,referrerPolicy:i.referrerPolicy},nr.set(n,i),g||OI(p,n,i,C.state))),r&&l===null)throw Error(s(528,""));return C}if(r&&l!==null)throw Error(s(529,""));return null;case"script":return r=i.async,i=i.src,typeof i=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(r=ss(i),i=La(p).hoistableScripts,l=i.get(r),l||(l={type:"script",instance:null,count:0,state:null},i.set(r,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,n))}}function os(n){return'href="'+Pn(n)+'"'}function xl(n){return'link[rel="stylesheet"]['+n+"]"}function Dw(n){return S({},n,{"data-precedence":n.precedence,precedence:null})}function OI(n,r,i,l){n.querySelector('link[rel="preload"][as="style"]['+r+"]")?l.loading=1:(r=n.createElement("link"),l.preload=r,r.addEventListener("load",function(){return l.loading|=1}),r.addEventListener("error",function(){return l.loading|=2}),nn(r,"link",i),Lt(r),n.head.appendChild(r))}function ss(n){return'[src="'+Pn(n)+'"]'}function kl(n){return"script[async]"+n}function jw(n,r,i){if(r.count++,r.instance===null)switch(r.type){case"style":var l=n.querySelector('style[data-href~="'+Pn(i.href)+'"]');if(l)return r.instance=l,Lt(l),l;var p=S({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return l=(n.ownerDocument||n).createElement("style"),Lt(l),nn(l,"style",p),Ru(l,i.precedence,n),r.instance=l;case"stylesheet":p=os(i.href);var g=n.querySelector(xl(p));if(g)return r.state.loading|=4,r.instance=g,Lt(g),g;l=Dw(i),(p=nr.get(p))&&Hh(l,p),g=(n.ownerDocument||n).createElement("link"),Lt(g);var C=g;return C._p=new Promise(function(L,F){C.onload=L,C.onerror=F}),nn(g,"link",l),r.state.loading|=4,Ru(g,i.precedence,n),r.instance=g;case"script":return g=ss(i.src),(p=n.querySelector(kl(g)))?(r.instance=p,Lt(p),p):(l=i,(p=nr.get(g))&&(l=S({},i),$h(l,p)),n=n.ownerDocument||n,p=n.createElement("script"),Lt(p),nn(p,"link",l),n.head.appendChild(p),r.instance=p);case"void":return null;default:throw Error(s(443,r.type))}else r.type==="stylesheet"&&!(r.state.loading&4)&&(l=r.instance,r.state.loading|=4,Ru(l,i.precedence,n));return r.instance}function Ru(n,r,i){for(var l=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=l.length?l[l.length-1]:null,g=p,C=0;C<l.length;C++){var L=l[C];if(L.dataset.precedence===r)g=L;else if(g!==p)break}g?g.parentNode.insertBefore(n,g.nextSibling):(r=i.nodeType===9?i.head:i,r.insertBefore(n,r.firstChild))}function Hh(n,r){n.crossOrigin??(n.crossOrigin=r.crossOrigin),n.referrerPolicy??(n.referrerPolicy=r.referrerPolicy),n.title??(n.title=r.title)}function $h(n,r){n.crossOrigin??(n.crossOrigin=r.crossOrigin),n.referrerPolicy??(n.referrerPolicy=r.referrerPolicy),n.integrity??(n.integrity=r.integrity)}var Mu=null;function zw(n,r,i){if(Mu===null){var l=new Map,p=Mu=new Map;p.set(i,l)}else p=Mu,l=p.get(i),l||(l=new Map,p.set(i,l));if(l.has(n))return l;for(l.set(n,null),i=i.getElementsByTagName(n),p=0;p<i.length;p++){var g=i[p];if(!(g[ki]||g[Bt]||n==="link"&&g.getAttribute("rel")==="stylesheet")&&g.namespaceURI!=="http://www.w3.org/2000/svg"){var C=g.getAttribute(r)||"";C=n+C;var L=l.get(C);L?L.push(g):l.set(C,[g])}}return l}function qw(n,r,i){n=n.ownerDocument||n,n.head.insertBefore(i,r==="title"?n.querySelector("head > title"):null)}function AI(n,r,i){if(i===1||r.itemProp!=null)return!1;switch(n){case"meta":case"title":return!0;case"style":if(typeof r.precedence!="string"||typeof r.href!="string"||r.href==="")break;return!0;case"link":if(typeof r.rel!="string"||typeof r.href!="string"||r.href===""||r.onLoad||r.onError)break;return r.rel==="stylesheet"?(n=r.disabled,typeof r.precedence=="string"&&n==null):!0;case"script":if(r.async&&typeof r.async!="function"&&typeof r.async!="symbol"&&!r.onLoad&&!r.onError&&r.src&&typeof r.src=="string")return!0}return!1}function Fw(n){return!(n.type==="stylesheet"&&!(n.state.loading&3))}function RI(n,r,i,l){if(i.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&!(i.state.loading&4)){if(i.instance===null){var p=os(l.href),g=r.querySelector(xl(p));if(g){r=g._p,typeof r=="object"&&r&&typeof r.then=="function"&&(n.count++,n=Pu.bind(n),r.then(n,n)),i.state.loading|=4,i.instance=g,Lt(g);return}g=r.ownerDocument||r,l=Dw(l),(p=nr.get(p))&&Hh(l,p),g=g.createElement("link"),Lt(g);var C=g;C._p=new Promise(function(L,F){C.onload=L,C.onerror=F}),nn(g,"link",l),i.instance=g}n.stylesheets===null&&(n.stylesheets=new Map),n.stylesheets.set(i,r),(r=i.state.preload)&&!(i.state.loading&3)&&(n.count++,i=Pu.bind(n),r.addEventListener("load",i),r.addEventListener("error",i))}}var Wh=0;function MI(n,r){return n.stylesheets&&n.count===0&&Du(n,n.stylesheets),0<n.count||0<n.imgCount?function(i){var l=setTimeout(function(){if(n.stylesheets&&Du(n,n.stylesheets),n.unsuspend){var g=n.unsuspend;n.unsuspend=null,g()}},6e4+r);0<n.imgBytes&&Wh===0&&(Wh=62500*pI());var p=setTimeout(function(){if(n.waitingForImages=!1,n.count===0&&(n.stylesheets&&Du(n,n.stylesheets),n.unsuspend)){var g=n.unsuspend;n.unsuspend=null,g()}},(n.imgBytes>Wh?50:800)+r);return n.unsuspend=i,function(){n.unsuspend=null,clearTimeout(l),clearTimeout(p)}}:null}function Pu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Du(this,this.stylesheets);else if(this.unsuspend){var n=this.unsuspend;this.unsuspend=null,n()}}}var Nu=null;function Du(n,r){n.stylesheets=null,n.unsuspend!==null&&(n.count++,Nu=new Map,r.forEach(PI,n),Nu=null,Pu.call(n))}function PI(n,r){if(!(r.state.loading&4)){var i=Nu.get(n);if(i)var l=i.get(null);else{i=new Map,Nu.set(n,i);for(var p=n.querySelectorAll("link[data-precedence],style[data-precedence]"),g=0;g<p.length;g++){var C=p[g];(C.nodeName==="LINK"||C.getAttribute("media")!=="not all")&&(i.set(C.dataset.precedence,C),l=C)}l&&i.set(null,l)}p=r.instance,C=p.getAttribute("data-precedence"),g=i.get(C)||l,g===l&&i.set(null,p),i.set(C,p),this.count++,l=Pu.bind(this),p.addEventListener("load",l),p.addEventListener("error",l),g?g.parentNode.insertBefore(p,g.nextSibling):(n=n.nodeType===9?n.head:n,n.insertBefore(p,n.firstChild)),r.state.loading|=4}}var Cl={$$typeof:X,Provider:null,Consumer:null,_currentValue:Oe,_currentValue2:Oe,_threadCount:0};function NI(n,r,i,l,p,g,C,L,F){this.tag=1,this.containerInfo=n,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ps(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ps(0),this.hiddenUpdates=Ps(null),this.identifierPrefix=l,this.onUncaughtError=p,this.onCaughtError=g,this.onRecoverableError=C,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=F,this.incompleteTransitions=new Map}function DI(n,r,i,l,p,g,C,L,F,J,se,pe){return n=new NI(n,r,i,C,F,J,se,pe,L),r=1,g===!0&&(r|=24),g=Dn(3,null,null,r),n.current=g,g.stateNode=n,r=Sp(),r.refCount++,n.pooledCache=r,r.refCount++,g.memoizedState={element:l,isDehydrated:i,cache:r},Lp(g),n}function jI(n){return n?(n=zo,n):zo}function Bw(n,r,i,l,p,g){p=jI(p),l.context===null?l.context=p:l.pendingContext=p,l=$i(r),l.payload={element:i},g=g===void 0?null:g,g!==null&&(l.callback=g),i=Wi(n,l,r),i!==null&&(Sn(i,n,r),nl(i,n,r))}function Vw(n,r){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var i=n.retryLane;n.retryLane=i!==0&&i<r?i:r}}function Uh(n,r){Vw(n,r),(n=n.alternate)&&Vw(n,r)}function Hw(n){if(n.tag===13||n.tag===31){var r=Ni(n,67108864);r!==null&&Sn(r,n,67108864),Uh(n,67108864)}}function $w(n){if(n.tag===13||n.tag===31){var r=er();r=Rn(r);var i=Ni(n,r);i!==null&&Sn(i,n,r),Uh(n,r)}}var ju=!0;function zI(n,r,i,l){var p=le.T;le.T=null;var g=G.p;try{G.p=2,Kh(n,r,i,l)}finally{G.p=g,le.T=p}}function qI(n,r,i,l){var p=le.T;le.T=null;var g=G.p;try{G.p=8,Kh(n,r,i,l)}finally{G.p=g,le.T=p}}function Kh(n,r,i,l){if(ju){var p=Qh(l);if(p===null)Mh(n,r,l,zu,i),Uw(n,l);else if(BI(p,n,r,i,l))l.stopPropagation();else if(Uw(n,l),r&4&&-1<FI.indexOf(n)){for(;p!==null;){var g=Ia(p);if(g!==null)switch(g.tag){case 3:if(g=g.stateNode,g.current.memoizedState.isDehydrated){var C=Hr(g.pendingLanes);if(C!==0){var L=g;for(L.pendingLanes|=2,L.entangledLanes|=2;C;){var F=1<<31-gt(C);L.entanglements[1]|=F,C&=~F}ca(g),!(tt&6)&&(wu=Jt()+500,vl(0,!1))}}break;case 31:case 13:L=Ni(g,2),L!==null&&Sn(L,g,2),xu(),Uh(g,2)}if(g=Qh(l),g===null&&Mh(n,r,l,zu,i),g===p)break;p=g}p!==null&&l.stopPropagation()}else Mh(n,r,l,null,i)}}function Qh(n){return n=Bs(n),Gh(n)}var zu=null;function Gh(n){if(zu=null,n=Ir(n),n!==null){var r=f(n);if(r===null)n=null;else{var i=r.tag;if(i===13){if(n=d(r),n!==null)return n;n=null}else if(i===31){if(n=m(r),n!==null)return n;n=null}else if(i===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;n=null}else r!==n&&(n=null)}}return zu=n,null}function Ww(n){switch(n){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Yf()){case Vr:return 2;case Cc:return 8;case Pt:case So:return 32;case Ct:return 268435456;default:return 32}default:return 32}}var Jh=!1,Ga=null,Ja=null,Xa=null,Sl=new Map,El=new Map,Ya=[],FI="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Uw(n,r){switch(n){case"focusin":case"focusout":Ga=null;break;case"dragenter":case"dragleave":Ja=null;break;case"mouseover":case"mouseout":Xa=null;break;case"pointerover":case"pointerout":Sl.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":El.delete(r.pointerId)}}function Tl(n,r,i,l,p,g){return n===null||n.nativeEvent!==g?(n={blockedOn:r,domEventName:i,eventSystemFlags:l,nativeEvent:g,targetContainers:[p]},r!==null&&(r=Ia(r),r!==null&&Hw(r)),n):(n.eventSystemFlags|=l,r=n.targetContainers,p!==null&&r.indexOf(p)===-1&&r.push(p),n)}function BI(n,r,i,l,p){switch(r){case"focusin":return Ga=Tl(Ga,n,r,i,l,p),!0;case"dragenter":return Ja=Tl(Ja,n,r,i,l,p),!0;case"mouseover":return Xa=Tl(Xa,n,r,i,l,p),!0;case"pointerover":var g=p.pointerId;return Sl.set(g,Tl(Sl.get(g)||null,n,r,i,l,p)),!0;case"gotpointercapture":return g=p.pointerId,El.set(g,Tl(El.get(g)||null,n,r,i,l,p)),!0}return!1}function Kw(n){var r=Ir(n.target);if(r!==null){var i=f(r);if(i!==null){if(r=i.tag,r===13){if(r=d(i),r!==null){n.blockedOn=r,Mn(n.priority,function(){$w(i)});return}}else if(r===31){if(r=m(i),r!==null){n.blockedOn=r,Mn(n.priority,function(){$w(i)});return}}else if(r===3&&i.stateNode.current.memoizedState.isDehydrated){n.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}n.blockedOn=null}function qu(n){if(n.blockedOn!==null)return!1;for(var r=n.targetContainers;0<r.length;){var i=Qh(n.nativeEvent);if(i===null){i=n.nativeEvent;var l=new i.constructor(i.type,i);Kt=l,i.target.dispatchEvent(l),Kt=null}else return r=Ia(i),r!==null&&Hw(r),n.blockedOn=i,!1;r.shift()}return!0}function Qw(n,r,i){qu(n)&&i.delete(r)}function VI(){Jh=!1,Ga!==null&&qu(Ga)&&(Ga=null),Ja!==null&&qu(Ja)&&(Ja=null),Xa!==null&&qu(Xa)&&(Xa=null),Sl.forEach(Qw),El.forEach(Qw)}function Fu(n,r){n.blockedOn===r&&(n.blockedOn=null,Jh||(Jh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,VI)))}var Bu=null;function Gw(n){Bu!==n&&(Bu=n,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Bu===n&&(Bu=null);for(var r=0;r<n.length;r+=3){var i=n[r],l=n[r+1],p=n[r+2];if(typeof l!="function"){if(Gh(l||i)===null)continue;break}var g=Ia(i);g!==null&&(n.splice(r,3),r-=3,Gp(g,{pending:!0,data:p,method:i.method,action:l},l,p))}}))}function ls(n){function r(F){return Fu(F,n)}Ga!==null&&Fu(Ga,n),Ja!==null&&Fu(Ja,n),Xa!==null&&Fu(Xa,n),Sl.forEach(r),El.forEach(r);for(var i=0;i<Ya.length;i++){var l=Ya[i];l.blockedOn===n&&(l.blockedOn=null)}for(;0<Ya.length&&(i=Ya[0],i.blockedOn===null);)Kw(i),i.blockedOn===null&&Ya.shift();if(i=(n.ownerDocument||n).$$reactFormReplay,i!=null)for(l=0;l<i.length;l+=3){var p=i[l],g=i[l+1],C=p[Yt]||null;if(typeof g=="function")C||Gw(i);else if(C){var L=null;if(g&&g.hasAttribute("formAction")){if(p=g,C=g[Yt]||null)L=C.formAction;else if(Gh(p)!==null)continue}else L=C.action;typeof L=="function"?i[l+1]=L:(i.splice(l,3),l-=3),Gw(i)}}}function HI(){function n(g){g.canIntercept&&g.info==="react-transition"&&g.intercept({handler:function(){return new Promise(function(C){return p=C})},focusReset:"manual",scroll:"manual"})}function r(){p!==null&&(p(),p=null),l||setTimeout(i,20)}function i(){if(!l&&!navigation.transition){var g=navigation.currentEntry;g&&g.url!=null&&navigation.navigate(g.url,{state:g.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,p=null;return navigation.addEventListener("navigate",n),navigation.addEventListener("navigatesuccess",r),navigation.addEventListener("navigateerror",r),setTimeout(i,100),function(){l=!0,navigation.removeEventListener("navigate",n),navigation.removeEventListener("navigatesuccess",r),navigation.removeEventListener("navigateerror",r),p!==null&&(p(),p=null)}}}function Xh(n){this._internalRoot=n}Yh.prototype.render=Xh.prototype.render=function(n){var r=this._internalRoot;if(r===null)throw Error(s(409));var i=r.current;Bw(i,er(),n,r,null,null)},Yh.prototype.unmount=Xh.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var r=n.containerInfo;Bw(n.current,2,null,n,null,null),xu(),r[Ta]=null}};function Yh(n){this._internalRoot=n}Yh.prototype.unstable_scheduleHydration=function(n){if(n){var r=Ic();n={blockedOn:null,target:n,priority:r};for(var i=0;i<Ya.length&&r!==0&&r<Ya[i].priority;i++);Ya.splice(i,0,n),i===0&&Kw(n)}};var Jw=a.version;if(Jw!=="19.2.4")throw Error(s(527,Jw,"19.2.4"));G.findDOMNode=function(n){var r=n._reactInternals;if(r===void 0)throw typeof n.render=="function"?Error(s(188)):(n=Object.keys(n).join(","),Error(s(268,n)));return n=w(r),n=n===null?null:x(n),n=n===null?null:n.stateNode,n};var $I={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:le,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Vu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Vu.isDisabled&&Vu.supportsFiber)try{wi=Vu.inject($I),ln=Vu}catch{}}e.createRoot=function(n,r){if(!c(n))throw Error(s(299));var i=!1,l="",p=q6,g=F6,C=B6;return r!=null&&(r.unstable_strictMode===!0&&(i=!0),r.identifierPrefix!==void 0&&(l=r.identifierPrefix),r.onUncaughtError!==void 0&&(p=r.onUncaughtError),r.onCaughtError!==void 0&&(g=r.onCaughtError),r.onRecoverableError!==void 0&&(C=r.onRecoverableError)),r=DI(n,1,!1,null,null,i,l,null,p,g,C,HI),n[Ta]=r.current,yw(n),new Xh(r)}})),Rd=rt(((e,t)=>{function a(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(o){console.error(o)}}a(),t.exports=si()})),xd=function(e,t){if(e==null)throw Error(t||`Expected value but got ${e}`)},BigInt.prototype.toJSON=function(){return JSON.rawJSON(this.toString())},T0=function(e){try{return JSON.parse(e,(t,a)=>qd(a))}catch{}if(e==null||e==="")return{};try{return e??(e=""),e=e.replaceAll(new RegExp(`(?<=\\s|^|\\[|,|:)(NaN|-Infinity|Infinity)(?=(?:[^"'\\\\]*(\\\\.|'([^'\\\\]*\\\\.)*[^'\\\\]*'|"([^"\\\\]*\\\\.)*[^"\\\\]*"))*[^"']*$)`,"g"),'"\u25D0$1\u25D0"'),JSON.parse(e,(t,a)=>typeof a=="string"?a==="\u25D0NaN\u25D0"?NaN:a==="\u25D0Infinity\u25D0"?1/0:a==="\u25D0-Infinity\u25D0"?-1/0:qd(a):qd(a))}catch{return{}}},Jx=function(e){if(e.length===0)return"";let t=Object.keys(e[0]);return[`| ${t.join(" | ")} |`,`|${t.map(()=>"---").join("|")}|`,...e.map(a=>`| ${t.map(o=>Xk(a[o])).join(" | ")} |`)].join(`
11
- `)};function Xk(e){if(e==null)return"";if(Array.isArray(e)||typeof e=="object")return j0(JSON.stringify(e));let t=String(e),a=/\[([^\]]+)]\((https?:\/\/[^)]+)\)/g,o=new Map,s=0;t=t.replaceAll(a,c=>{let f=`__MDLINK_${s++}__`;return o.set(f,c),f}),t=t.replaceAll(/(https?:\/\/\S+)/g,"[$1]($1)");for(let[c,f]of o)t=t.replace(c,f);return j0(t)}function j0(e){return e.replaceAll("\\","\\\\").replaceAll("|","\\|").replaceAll(`
12
- `," ").replaceAll("\r","")}function qd(e){return typeof e=="object"&&e&&"$bigint"in e&&typeof e.$bigint=="string"?BigInt(e.$bigint):e}Xm="object-id",_k="random-id";var z0="abcdefghijklmnopqrstuvwxyz",q0=z0+z0.toUpperCase(),F0=new Set;vs="__scratch__",Un="setup",ii={create(){let e=0,t;do{let a="";for(let o=0;o<4;o++)a+=q0[Math.floor(Math.random()*q0.length)];t=a,e++}while(F0.has(t)&&e<100);if(e>=100)throw Error("Failed to generate unique CellId after 100 attempts");return F0.add(t),t}},Tn={create(e){return an(e!=null,"cellId is required"),`cell-${e}`},parse(e){return e.slice(5)},findElement(e){return e.closest('div[id^="cell-"]')},findElementThroughShadowDOMs(e){let t=e;for(;t;){let a=Tn.findElement(t);if(a)return a;let o=t.getRootNode();if(t=o instanceof ShadowRoot?o.host:t.parentElement,t===o)break}return null}},ck=function(e){let t=null,a=Tn.findElementThroughShadowDOMs(e);return a&&(t=Tn.parse(a.id)),t},Od={parse(e){return e.getAttribute(Xm)},parseOrThrow(e){let t=Od.parse(e);return an(t,"<marimo-ui-element/> missing object-id attribute"),t}},z_={create(e){return`output-${e}`}},Km=new class{getFilename(){return this.getSearchParam("filename")}setFilename(e){this.setSearchParam("filename",e)}getCodeFromSearchParam(){return this.getSearchParam("code")}getCodeFromHash(){let e=window.location.hash;return e.startsWith("#code/")?e.slice(6):null}setCodeForHash(e){window.location.hash=`#code/${e}`}setSearchParam(e,t){let a=new URL(window.location.href);a.searchParams.set(e,t),window.history.replaceState({},"",a.toString())}getSearchParam(e){return new URL(window.location.href).searchParams.get(e)}},rd=function(e){return T0(e??"")},zx=function(e){return Pr.mapValues(e.dataset,t=>typeof t=="string"?rd(t):t)},jx=function(e,t){let a=e.parentElement?Od.parse(e.parentElement):void 0;return a&&t.has(a)?t.lookupValue(a):rd(e.dataset.initialValue)},k0=function(){if(o_())return document.title||null;if(Uu()){let a=Km.getFilename();if(a)return a}let e=document.querySelector("marimo-filename");xd(e,"marimo-filename tag not found");let t=e.innerHTML;return t.length===0?null:t};var xe=Hu($u(),1),P=Hu(c8(),1),Kl="Checkbox",[Yk,NL]=s_(Kl),[Zk,Fd]=Yk(Kl);function eC(e){let{__scopeCheckbox:t,checked:a,children:o,defaultChecked:s,disabled:c,form:f,name:d,onCheckedChange:m,required:b,value:w="on",internal_do_not_use_render:x}=e,[S,E]=c_({prop:a,defaultProp:s??!1,onChange:m,caller:Kl}),[T,M]=xe.useState(null),[z,B]=xe.useState(null),V=xe.useRef(!1),N=T?!!f||!!T.closest("form"):!0,X={checked:S,disabled:c,setChecked:E,control:T,setControl:M,name:d,form:f,value:w,hasConsumerStoppedPropagationRef:V,required:b,defaultChecked:ya(s)?!1:s,isFormControl:N,bubbleInput:z,setBubbleInput:B};return(0,P.jsx)(Zk,{scope:t,...X,children:tC(x)?x(X):o})}var B0="CheckboxTrigger",V0=xe.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:a,...o},s)=>{let{control:c,value:f,disabled:d,checked:m,required:b,setControl:w,setChecked:x,hasConsumerStoppedPropagationRef:S,isFormControl:E,bubbleInput:T}=Fd(B0,e),M=Wu(s,w),z=xe.useRef(m);return xe.useEffect(()=>{let B=c==null?void 0:c.form;if(B){let V=()=>x(z.current);return B.addEventListener("reset",V),()=>B.removeEventListener("reset",V)}},[c,x]),(0,P.jsx)(da.button,{type:"button",role:"checkbox","aria-checked":ya(m)?"mixed":m,"aria-required":b,"data-state":K0(m),"data-disabled":d?"":void 0,disabled:d,value:f,...o,ref:M,onKeyDown:rr(t,B=>{B.key==="Enter"&&B.preventDefault()}),onClick:rr(a,B=>{x(V=>ya(V)?!0:!V),T&&E&&(S.current=B.isPropagationStopped(),S.current||B.stopPropagation())})})});V0.displayName=B0;var Bd=xe.forwardRef((e,t)=>{let{__scopeCheckbox:a,name:o,checked:s,defaultChecked:c,required:f,disabled:d,value:m,onCheckedChange:b,form:w,...x}=e;return(0,P.jsx)(eC,{__scopeCheckbox:a,checked:s,defaultChecked:c,disabled:d,required:f,onCheckedChange:b,name:o,form:w,value:m,internal_do_not_use_render:({isFormControl:S})=>(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(V0,{...x,ref:t,__scopeCheckbox:a}),S&&(0,P.jsx)(U0,{__scopeCheckbox:a})]})})});Bd.displayName=Kl;var H0="CheckboxIndicator",$0=xe.forwardRef((e,t)=>{let{__scopeCheckbox:a,forceMount:o,...s}=e,c=Fd(H0,a);return(0,P.jsx)(l_,{present:o||ya(c.checked)||c.checked===!0,children:(0,P.jsx)(da.span,{"data-state":K0(c.checked),"data-disabled":c.disabled?"":void 0,...s,ref:t,style:{pointerEvents:"none",...e.style}})})});$0.displayName=H0;var W0="CheckboxBubbleInput",U0=xe.forwardRef(({__scopeCheckbox:e,...t},a)=>{let{control:o,hasConsumerStoppedPropagationRef:s,checked:c,defaultChecked:f,required:d,disabled:m,name:b,value:w,form:x,bubbleInput:S,setBubbleInput:E}=Fd(W0,e),T=Wu(a,E),M=b8(c),z=m8(o);xe.useEffect(()=>{let V=S;if(!V)return;let N=window.HTMLInputElement.prototype,X=Object.getOwnPropertyDescriptor(N,"checked").set,ce=!s.current;if(M!==c&&X){let A=new Event("click",{bubbles:ce});V.indeterminate=ya(c),X.call(V,ya(c)?!1:c),V.dispatchEvent(A)}},[S,M,c,s]);let B=xe.useRef(ya(c)?!1:c);return(0,P.jsx)(da.input,{type:"checkbox","aria-hidden":!0,defaultChecked:f??B.current,required:d,disabled:m,name:b,value:w,form:x,...t,tabIndex:-1,ref:T,style:{...t.style,...z,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});U0.displayName=W0;function tC(e){return typeof e=="function"}function ya(e){return e==="indeterminate"}function K0(e){return ya(e)?"indeterminate":e?"checked":"unchecked"}var nC=Hu(e_(),1),Vd="ToastProvider",[Hd,rC,aC]=g8("Toast"),[Q0,DL]=s_("Toast",[aC]),[iC,Ql]=Q0(Vd),G0=e=>{let{__scopeToast:t,label:a="Notification",duration:o=5e3,swipeDirection:s="right",swipeThreshold:c=50,children:f}=e,[d,m]=xe.useState(null),[b,w]=xe.useState(0),x=xe.useRef(!1),S=xe.useRef(!1);return a.trim()||console.error(`Invalid prop \`label\` supplied to \`${Vd}\`. Expected non-empty \`string\`.`),(0,P.jsx)(Hd.Provider,{scope:t,children:(0,P.jsx)(iC,{scope:t,label:a,duration:o,swipeDirection:s,swipeThreshold:c,toastCount:b,viewport:d,onViewportChange:m,onToastAdd:xe.useCallback(()=>w(E=>E+1),[]),onToastRemove:xe.useCallback(()=>w(E=>E-1),[]),isFocusedToastEscapeKeyDownRef:x,isClosePausedRef:S,children:f})})};G0.displayName=Vd;var J0="ToastViewport",oC=["F8"],$d="toast.viewportPause",Wd="toast.viewportResume",X0=xe.forwardRef((e,t)=>{let{__scopeToast:a,hotkey:o=oC,label:s="Notifications ({hotkey})",...c}=e,f=Ql(J0,a),d=rC(a),m=xe.useRef(null),b=xe.useRef(null),w=xe.useRef(null),x=xe.useRef(null),S=Wu(t,x,f.onViewportChange),E=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),T=f.toastCount>0;xe.useEffect(()=>{let z=B=>{var V;o.length!==0&&o.every(N=>B[N]||B.code===N)&&((V=x.current)==null||V.focus())};return document.addEventListener("keydown",z),()=>document.removeEventListener("keydown",z)},[o]),xe.useEffect(()=>{let z=m.current,B=x.current;if(T&&z&&B){let V=()=>{if(!f.isClosePausedRef.current){let A=new CustomEvent($d);B.dispatchEvent(A),f.isClosePausedRef.current=!0}},N=()=>{if(f.isClosePausedRef.current){let A=new CustomEvent(Wd);B.dispatchEvent(A),f.isClosePausedRef.current=!1}},X=A=>{z.contains(A.relatedTarget)||N()},ce=()=>{z.contains(document.activeElement)||N()};return z.addEventListener("focusin",V),z.addEventListener("focusout",X),z.addEventListener("pointermove",V),z.addEventListener("pointerleave",ce),window.addEventListener("blur",V),window.addEventListener("focus",N),()=>{z.removeEventListener("focusin",V),z.removeEventListener("focusout",X),z.removeEventListener("pointermove",V),z.removeEventListener("pointerleave",ce),window.removeEventListener("blur",V),window.removeEventListener("focus",N)}}},[T,f.isClosePausedRef]);let M=xe.useCallback(({tabbingDirection:z})=>{let B=d().map(V=>{let N=V.ref.current,X=[N,...bC(N)];return z==="forwards"?X:X.reverse()});return(z==="forwards"?B.reverse():B).flat()},[d]);return xe.useEffect(()=>{let z=x.current;if(z){let B=V=>{var X,ce,A;let N=V.altKey||V.ctrlKey||V.metaKey;if(V.key==="Tab"&&!N){let q=document.activeElement,$=V.shiftKey;if(V.target===z&&$){(X=b.current)==null||X.focus();return}let ie=M({tabbingDirection:$?"backwards":"forwards"}),fe=ie.findIndex(me=>me===q);Qd(ie.slice(fe+1))?V.preventDefault():$?(ce=b.current)==null||ce.focus():(A=w.current)==null||A.focus()}};return z.addEventListener("keydown",B),()=>z.removeEventListener("keydown",B)}},[d,M]),(0,P.jsxs)(h8,{ref:m,role:"region","aria-label":s.replace("{hotkey}",E),tabIndex:-1,style:{pointerEvents:T?void 0:"none"},children:[T&&(0,P.jsx)(Ud,{ref:b,onFocusFromOutsideViewport:()=>{Qd(M({tabbingDirection:"forwards"}))}}),(0,P.jsx)(Hd.Slot,{scope:a,children:(0,P.jsx)(da.ol,{tabIndex:-1,...c,ref:S})}),T&&(0,P.jsx)(Ud,{ref:w,onFocusFromOutsideViewport:()=>{Qd(M({tabbingDirection:"backwards"}))}})]})});X0.displayName=J0;var Y0="ToastFocusProxy",Ud=xe.forwardRef((e,t)=>{let{__scopeToast:a,onFocusFromOutsideViewport:o,...s}=e,c=Ql(Y0,a);return(0,P.jsx)(u_,{tabIndex:0,...s,ref:t,style:{position:"fixed"},onFocus:f=>{var m;let d=f.relatedTarget;(m=c.viewport)!=null&&m.contains(d)||o()}})});Ud.displayName=Y0;var ws="Toast",sC="toast.swipeStart",lC="toast.swipeMove",cC="toast.swipeCancel",uC="toast.swipeEnd",Z0=xe.forwardRef((e,t)=>{let{forceMount:a,open:o,defaultOpen:s,onOpenChange:c,...f}=e,[d,m]=c_({prop:o,defaultProp:s??!0,onChange:c,caller:ws});return(0,P.jsx)(l_,{present:a||d,children:(0,P.jsx)(pC,{open:d,...f,ref:t,onClose:()=>m(!1),onPause:Ku(e.onPause),onResume:Ku(e.onResume),onSwipeStart:rr(e.onSwipeStart,b=>{b.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:rr(e.onSwipeMove,b=>{let{x:w,y:x}=b.detail.delta;b.currentTarget.setAttribute("data-swipe","move"),b.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${w}px`),b.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${x}px`)}),onSwipeCancel:rr(e.onSwipeCancel,b=>{b.currentTarget.setAttribute("data-swipe","cancel"),b.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),b.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),b.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),b.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:rr(e.onSwipeEnd,b=>{let{x:w,y:x}=b.detail.delta;b.currentTarget.setAttribute("data-swipe","end"),b.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),b.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),b.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${w}px`),b.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${x}px`),m(!1)})})})});Z0.displayName=ws;var[dC,fC]=Q0(ws,{onClose(){}}),pC=xe.forwardRef((e,t)=>{let{__scopeToast:a,type:o="foreground",duration:s,open:c,onClose:f,onEscapeKeyDown:d,onPause:m,onResume:b,onSwipeStart:w,onSwipeMove:x,onSwipeCancel:S,onSwipeEnd:E,...T}=e,M=Ql(ws,a),[z,B]=xe.useState(null),V=Wu(t,de=>B(de)),N=xe.useRef(null),X=xe.useRef(null),ce=s||M.duration,A=xe.useRef(0),q=xe.useRef(ce),$=xe.useRef(0),{onToastAdd:ie,onToastRemove:fe}=M,me=Ku(()=>{var de;z!=null&&z.contains(document.activeElement)&&((de=M.viewport)==null||de.focus()),f()}),ve=xe.useCallback(de=>{!de||de===1/0||(window.clearTimeout($.current),A.current=new Date().getTime(),$.current=window.setTimeout(me,de))},[me]);xe.useEffect(()=>{let de=M.viewport;if(de){let be=()=>{ve(q.current),b==null||b()},oe=()=>{let le=new Date().getTime()-A.current;q.current-=le,window.clearTimeout($.current),m==null||m()};return de.addEventListener($d,oe),de.addEventListener(Wd,be),()=>{de.removeEventListener($d,oe),de.removeEventListener(Wd,be)}}},[M.viewport,ce,m,b,ve]),xe.useEffect(()=>{c&&!M.isClosePausedRef.current&&ve(ce)},[c,ce,M.isClosePausedRef,ve]),xe.useEffect(()=>(ie(),()=>fe()),[ie,fe]);let ae=xe.useMemo(()=>z?og(z):null,[z]);return M.viewport?(0,P.jsxs)(P.Fragment,{children:[ae&&(0,P.jsx)(hC,{__scopeToast:a,role:"status","aria-live":o==="foreground"?"assertive":"polite",children:ae}),(0,P.jsx)(dC,{scope:a,onClose:me,children:nC.createPortal((0,P.jsx)(Hd.ItemSlot,{scope:a,children:(0,P.jsx)(p8,{asChild:!0,onEscapeKeyDown:rr(d,()=>{M.isFocusedToastEscapeKeyDownRef.current||me(),M.isFocusedToastEscapeKeyDownRef.current=!1}),children:(0,P.jsx)(da.li,{tabIndex:0,"data-state":c?"open":"closed","data-swipe-direction":M.swipeDirection,...T,ref:V,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:rr(e.onKeyDown,de=>{de.key==="Escape"&&(d==null||d(de.nativeEvent),de.nativeEvent.defaultPrevented||(M.isFocusedToastEscapeKeyDownRef.current=!0,me()))}),onPointerDown:rr(e.onPointerDown,de=>{de.button===0&&(N.current={x:de.clientX,y:de.clientY})}),onPointerMove:rr(e.onPointerMove,de=>{if(!N.current)return;let be=de.clientX-N.current.x,oe=de.clientY-N.current.y,le=!!X.current,G=["left","right"].includes(M.swipeDirection),Oe=["left","up"].includes(M.swipeDirection)?Math.min:Math.max,He=G?Oe(0,be):0,et=G?0:Oe(0,oe),Fe=de.pointerType==="touch"?10:2,Ne={x:He,y:et},Le={originalEvent:de,delta:Ne};le?(X.current=Ne,Gl(lC,x,Le,{discrete:!1})):sg(Ne,M.swipeDirection,Fe)?(X.current=Ne,Gl(sC,w,Le,{discrete:!1}),de.target.setPointerCapture(de.pointerId)):(Math.abs(be)>Fe||Math.abs(oe)>Fe)&&(N.current=null)}),onPointerUp:rr(e.onPointerUp,de=>{let be=X.current,oe=de.target;if(oe.hasPointerCapture(de.pointerId)&&oe.releasePointerCapture(de.pointerId),X.current=null,N.current=null,be){let le=de.currentTarget,G={originalEvent:de,delta:be};sg(be,M.swipeDirection,M.swipeThreshold)?Gl(uC,E,G,{discrete:!0}):Gl(cC,S,G,{discrete:!0}),le.addEventListener("click",Oe=>Oe.preventDefault(),{once:!0})}})})})}),M.viewport)})]}):null}),hC=e=>{let{__scopeToast:t,children:a,...o}=e,s=Ql(ws,t),[c,f]=xe.useState(!1),[d,m]=xe.useState(!1);return yC(()=>f(!0)),xe.useEffect(()=>{let b=window.setTimeout(()=>m(!0),1e3);return()=>window.clearTimeout(b)},[]),d?null:(0,P.jsx)(f8,{asChild:!0,children:(0,P.jsx)(u_,{...o,children:c&&(0,P.jsxs)(P.Fragment,{children:[s.label," ",a]})})})},mC="ToastTitle",eg=xe.forwardRef((e,t)=>{let{__scopeToast:a,...o}=e;return(0,P.jsx)(da.div,{...o,ref:t})});eg.displayName=mC;var gC="ToastDescription",tg=xe.forwardRef((e,t)=>{let{__scopeToast:a,...o}=e;return(0,P.jsx)(da.div,{...o,ref:t})});tg.displayName=gC;var ng="ToastAction",rg=xe.forwardRef((e,t)=>{let{altText:a,...o}=e;return a.trim()?(0,P.jsx)(ig,{altText:a,asChild:!0,children:(0,P.jsx)(Kd,{...o,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${ng}\`. Expected non-empty \`string\`.`),null)});rg.displayName=ng;var ag="ToastClose",Kd=xe.forwardRef((e,t)=>{let{__scopeToast:a,...o}=e,s=fC(ag,a);return(0,P.jsx)(ig,{asChild:!0,children:(0,P.jsx)(da.button,{type:"button",...o,ref:t,onClick:rr(e.onClick,s.onClose)})})});Kd.displayName=ag;var ig=xe.forwardRef((e,t)=>{let{__scopeToast:a,altText:o,...s}=e;return(0,P.jsx)(da.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":o||void 0,...s,ref:t})});function og(e){let t=[];return Array.from(e.childNodes).forEach(a=>{if(a.nodeType===a.TEXT_NODE&&a.textContent&&t.push(a.textContent),vC(a)){let o=a.ariaHidden||a.hidden||a.style.display==="none",s=a.dataset.radixToastAnnounceExclude==="";if(!o)if(s){let c=a.dataset.radixToastAnnounceAlt;c&&t.push(c)}else t.push(...og(a))}}),t}function Gl(e,t,a,{discrete:o}){let s=a.originalEvent.currentTarget,c=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:a});t&&s.addEventListener(e,t,{once:!0}),o?u8(s,c):s.dispatchEvent(c)}var sg=(e,t,a=0)=>{let o=Math.abs(e.x),s=Math.abs(e.y),c=o>s;return t==="left"||t==="right"?c&&o>a:!c&&s>a};function yC(e=()=>{}){let t=Ku(e);d8(()=>{let a=0,o=0;return a=window.requestAnimationFrame(()=>o=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(a),window.cancelAnimationFrame(o)}},[t])}function vC(e){return e.nodeType===e.ELEMENT_NODE}function bC(e){let t=[],a=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{let s=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||s?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;a.nextNode();)t.push(a.currentNode);return t}function Qd(e){let t=document.activeElement;return e.some(a=>a===t?!0:(a.focus(),document.activeElement!==t))}var wC=G0,lg=X0,cg=Z0,ug=eg,dg=tg,fg=rg,pg=Kd,_C=Symbol("");nx=function(e,t){return Ee(e,function(a,o,s){o(this,t(a(this),s))})};function Gd(e,t){let a=null,o=new Map,s=new Set,c=d=>{let m;if(t===void 0)m=o.get(d);else for(let[w,x]of o)if(t(w,d)){m=x;break}if(m!==void 0)if(a!=null&&a(m[1],d))c.remove(d);else return m[0];let b=e(d);return o.set(d,[b,Date.now()]),f("CREATE",d,b),b},f=(d,m,b)=>{for(let w of s)w({type:d,param:m,atom:b})};return c.unstable_listen=d=>(s.add(d),()=>{s.delete(d)}),c.getParams=()=>o.keys(),c.remove=d=>{if(t===void 0){if(!o.has(d))return;let[m]=o.get(d);o.delete(d),f("REMOVE",d,m)}else for(let[m,[b]]of o)if(t(m,d)){o.delete(m),f("REMOVE",m,b);break}},c.setShouldRemove=d=>{if(a=d,a)for(let[m,[b,w]]of o)a(w,m)&&(o.delete(m),f("REMOVE",m,b))},c}var Jd=(e,t,a)=>(t.has(a)?t:t.set(a,e())).get(a),xC=new WeakMap,kC=(e,t,a,o)=>Jd(e,Jd(()=>new WeakMap,Jd(()=>new WeakMap,xC,t),a),o);function CC(e,t,a=Object.is){return kC(()=>{let o=Symbol(),s=([f,d])=>{if(d===o)return t(f);let m=t(f,d);return a(d,m)?d:m},c=Ee(f=>{let d=f(c);return s([f(e),d])});return c.init=o,c},e,t,a)}var hg=(e,t,a)=>(t.has(a)?t:t.set(a,e())).get(a),SC=new WeakMap,EC=(e,t,a)=>hg(e,hg(()=>new WeakMap,SC,t),a),TC={},mg=e=>!!e.write,IC=e=>typeof e=="function";function LC(e,t){return EC(()=>{let a=new WeakMap,o=(f,d)=>{let m=a.get(f);if(m)return m;let b=d&&a.get(d),w=[],x=[];return f.forEach((S,E)=>{let T=t?t(S):E;x[E]=T;let M=b&&b.atomList[b.keyList.indexOf(T)];if(M){w[E]=M;return}let z=B=>{let V=B(s),N=B(e),X=o(N,V==null?void 0:V.arr).keyList.indexOf(T);if(X<0||X>=N.length){let ce=f[o(f).keyList.indexOf(T)];if(ce)return ce;throw Error("splitAtom: index out of bounds for read")}return N[X]};w[E]=mg(e)?Ee(z,(B,V,N)=>{let X=B(s),ce=B(e),A=o(ce,X==null?void 0:X.arr).keyList.indexOf(T);if(A<0||A>=ce.length)throw Error("splitAtom: index out of bounds for write");let q=IC(N)?N(ce[A]):N;Object.is(ce[A],q)||V(e,[...ce.slice(0,A),q,...ce.slice(A+1)])}):Ee(z)}),m=b&&b.keyList.length===x.length&&b.keyList.every((S,E)=>S===x[E])?b:{arr:f,atomList:w,keyList:x},a.set(f,m),m},s=Ee(f=>{let d=f(s);return o(f(e),d==null?void 0:d.arr)});s.init=void 0;let c=mg(e)?Ee(f=>f(s).atomList,(f,d,m)=>{switch(m.type){case"remove":{let b=f(c).indexOf(m.atom);if(b>=0){let w=f(e);d(e,[...w.slice(0,b),...w.slice(b+1)])}break}case"insert":{let b=m.before?f(c).indexOf(m.before):f(c).length;if(b>=0){let w=f(e);d(e,[...w.slice(0,b),m.value,...w.slice(b)])}break}case"move":{let b=f(c).indexOf(m.atom),w=m.before?f(c).indexOf(m.before):f(c).length;if(b>=0&&w>=0){let x=f(e);b<w?d(e,[...x.slice(0,b),...x.slice(b+1,w),x[b],...x.slice(w)]):d(e,[...x.slice(0,w),x[b],...x.slice(w,b),...x.slice(b+1)])}break}}}):Ee(f=>f(s).atomList);return c},e,t||TC)}var gg=e=>typeof(e==null?void 0:e.then)=="function";function yg(e=()=>{try{return window.localStorage}catch{return}},t){var d;let a,o,s={getItem:(m,b)=>{var S;let w=E=>{if(E||(E=""),a!==E){try{o=JSON.parse(E,t==null?void 0:t.reviver)}catch{return b}a=E}return o},x=((S=e())==null?void 0:S.getItem(m))??null;return gg(x)?x.then(w):w(x)},setItem:(m,b)=>{var w;return(w=e())==null?void 0:w.setItem(m,JSON.stringify(b,t==null?void 0:t.replacer))},removeItem:m=>{var b;return(b=e())==null?void 0:b.removeItem(m)}},c=m=>(b,w,x)=>m(b,S=>{let E;try{E=JSON.parse(S||"")}catch{E=x}w(E)}),f;try{f=(d=e())==null?void 0:d.subscribe}catch{}return!f&&typeof window<"u"&&typeof window.addEventListener=="function"&&window.Storage&&(f=(m,b)=>{if(!(e()instanceof window.Storage))return()=>{};let w=x=>{x.storageArea===e()&&x.key===m&&b(x.newValue)};return window.addEventListener("storage",w),()=>{window.removeEventListener("storage",w)}}),f&&(s.subscribe=c(f)),s}var OC=yg();Dl=function(e,t,a=OC,o){let s=Ee(o!=null&&o.getOnInit?a.getItem(e,t):t);return s.onMount=c=>{c(a.getItem(e,t));let f;return a.subscribe&&(f=a.subscribe(e,c,t)),f},Ee(c=>c(s),(c,f,d)=>{let m=typeof d=="function"?d(c(s)):d;return m===_C?(f(s,t),a.removeItem(e)):gg(m)?m.then(b=>(f(s,b),a.setItem(e,b))):(f(s,m),a.setItem(e,m))})},gn=function(e){let t,a,o;return typeof e=="object"?(t=e.hashFunction,a=e.expiring,o=e.tags):t=e,(s,c,f)=>{if(f.value!=null)f.value=vg(f.value,t,a,o);else if(f.get!=null)f.get=vg(f.get,t,a,o);else throw"Only put a Memoize() decorator on a method or get accessor."}};var Xd=new Map;function vg(e,t,a=0,o){let s=Symbol("__memoized_map__");return function(...c){let f;this.hasOwnProperty(s)||Object.defineProperty(this,s,{configurable:!1,enumerable:!1,writable:!1,value:new Map});let d=this[s];if(Array.isArray(o))for(let m of o)Xd.has(m)?Xd.get(m).push(d):Xd.set(m,[d]);if(t||c.length>0||a>0){let m;m=t===!0?c.map(x=>x.toString()).join("!"):t?t.apply(this,c):c[0];let b=`${m}__timestamp`,w=!1;if(a>0)if(!d.has(b))w=!0;else{let x=d.get(b);w=Date.now()-x>a}d.has(m)&&!w?f=d.get(m):(f=e.apply(this,c),d.set(m,f),a>0&&d.set(b,Date.now()))}else{let m=this;d.has(m)?f=d.get(m):(f=e.apply(this,c),d.set(m,f))}return f}}hs=Ee(k0()),Rx=Ee(null),ql=Ee(null),$_=Ee(void 0);var AC=class{constructor(){we(this,"store",new Map)}get length(){return this.store.size}clear(){this.store.clear()}getItem(e){return this.store.get(e)||null}key(e){return[...this.store.keys()][e]||null}removeItem(e){this.store.delete(e)}setItem(e,t){this.store.set(e,t)}};function RC(){let{hasLocalStorage:e,hasSessionStorage:t}=aL();return e?window.localStorage:t?window.sessionStorage:new AC}bs=RC();let va;ux=class{constructor(e,t=bs){this.defaultValue=e,this.storage=t}get(e){try{let t=this.storage.getItem(e);return t?JSON.parse(t):this.defaultValue}catch{return this.defaultValue}}set(e,t){this.storage.setItem(e,JSON.stringify(t))}remove(e){this.storage.removeItem(e)}},od=class{constructor(e,t,a=bs){this.schema=e,this.getDefaultValue=t,this.storage=a}get(e){try{let t=this.storage.getItem(e);if(t==null)return this.getDefaultValue();let a=this.schema.safeParse(JSON.parse(t));return a.success?a.data:(_e.warn("Error parsing zod local storage",a.error),this.getDefaultValue())}catch(t){return _e.warn("Error getting zod local storage",t),this.getDefaultValue()}}set(e,t){this.storage.setItem(e,JSON.stringify(t))}remove(e){this.storage.removeItem(e)}},Im=class extends od{constructor(e,t,a){let o=Te.get(hs);super(t,a),this.filename=o;try{this.unsubscribeFromFilename=Te.sub(hs,()=>{let s=Te.get(hs);this.handleFilenameChange(e,s)})}catch{this.unsubscribeFromFilename=null}}get(e){return super.get(this.createScopedKey(e,this.filename))}set(e,t){super.set(this.createScopedKey(e,this.filename),t)}remove(e){super.remove(this.createScopedKey(e,this.filename))}createScopedKey(e,t){return t?`${e}:${t}`:e}handleFilenameChange(e,t){if(t&&t!==this.filename){let a=this.get(e);this.remove(e),this.filename=t,this.set(e,a)}}dispose(){this.unsubscribeFromFilename&&(this.unsubscribeFromFilename=(this.unsubscribeFromFilename(),null))}},va="marimo:notebook-col-sizes";function MC(){return{widths:[]}}var ao=new Im(va,t_({widths:n8(ZI([e8(),t8("contentWidth")]).default("contentWidth"))}),MC);ex={getColumnWidth:e=>ao.get(va).widths[e]??"contentWidth",saveColumnWidth:(e,t)=>{let a=ao.get(va).widths;if(a[e])a[e]=t;else{for(;a.length<=e;)a.push("contentWidth");a[e]=t}ao.set(va,{widths:a})},clearStorage:()=>{ao.remove(va)}};function PC(e,t){let a=ao.get(va).widths,o=Ol(a,e,t);ao.set(va,{widths:o})}var bg,wg,_g,sr,xg,kg,Cg,Sg,yn,Eg,Tg,Ig,Lg,Og,Ag,Rt;function In(e,t,a,o,s){var c={};return Object.keys(o).forEach(function(f){c[f]=o[f]}),c.enumerable=!!c.enumerable,c.configurable=!!c.configurable,("value"in c||c.initializer)&&(c.writable=!0),c=a.slice().reverse().reduce(function(f,d){return d(e,t,f)||f},c),s&&c.initializer!==void 0&&(c.value=c.initializer?c.initializer.call(s):void 0,c.initializer=void 0),c.initializer===void 0?(Object.defineProperty(e,t,c),null):c}let li=(bg=gn(),wg=gn(),_g=gn(),sr=class{constructor(e,t,a){this.value=e,this.isCollapsed=t,this.children=a}geDescendantCount(){let e=0,t=[...this.children];for(;t.length>0;){let a=t.pop();e++;for(let o=a.children.length-1;o>=0;o--)t.push(a.children[o])}return e}getDescendants(){let e=[],t=[...this.children];for(;t.length>0;){let a=t.pop();e.push(a.value);for(let o=a.children.length-1;o>=0;o--)t.push(a.children[o])}return e}get inOrderIds(){let e=[],t=a=>{e.push(a.value);for(let o of a.children)t(o)};for(let a of this.children)t(a);return e}toString(){return this.isCollapsed?`${this.value} (collapsed)`:String(this.value)}equals(e){return this.value===e.value}},In(sr.prototype,"geDescendantCount",[bg],Object.getOwnPropertyDescriptor(sr.prototype,"geDescendantCount"),sr.prototype),In(sr.prototype,"getDescendants",[wg],Object.getOwnPropertyDescriptor(sr.prototype,"getDescendants"),sr.prototype),In(sr.prototype,"inOrderIds",[_g],Object.getOwnPropertyDescriptor(sr.prototype,"inOrderIds"),sr.prototype),sr);var NC=0;let io;io=(xg=gn(),kg=gn(),Cg=gn(),Sg=gn(),yn=class ro{constructor(t,a){this.nodes=t,this.id=a}static from(t){let a=`tree_${NC++}`;return new ro(t.map(o=>new li(o,!1,[])),a)}static fromWithPreviousShape(t,a){var c;if(!a)return ro.from(t);let o=a.id,s=new ro(t.map(f=>new li(f,!1,[])),o);for(let f of t)if(a.isCollapsed(f)){let d=((c=a._nodeMap.get(f))==null?void 0:c.children)??[];for(let m=d.length-1;m>=0;m--){let b=d[m];if(s._nodeMap.has(b.value)){s=s.collapse(f,b.value);break}}}return s}withNodes(t){return new ro(t,this.id)}get topLevelIds(){return this.nodes.map(t=>t.value)}get inOrderIds(){return this.nodes.flatMap(t=>[t.value,...t.inOrderIds])}get idSet(){return new Set(this.inOrderIds)}get length(){return this.nodes.length}get _nodeMap(){let t=new Map;for(let a of this.nodes)t.set(a.value,a);return t}getDescendants(t){let a=this._nodeMap.get(t);return a?a.getDescendants():(_e.warn(`Node ${t} not found in tree. Valid ids: ${this.topLevelIds}`),[])}isCollapsed(t){let a=this._nodeMap.get(t);return a?a.isCollapsed:(_e.warn(`Node ${t} not found in tree. Valid ids: ${this.topLevelIds}`),!1)}indexOfOrThrow(t){let a=this.nodes.findIndex(o=>o.value===t);if(a===-1)throw Error(`Node ${t} not found in tree. Valid ids: ${this.topLevelIds}`);return a}slice(t,a){return this.nodes.slice(t,a).map(o=>o.value)}moveToFront(t){let a=this.indexOfOrThrow(t);return this.withNodes(Ol(this.nodes,a,0))}moveToBack(t){let a=this.indexOfOrThrow(t);return this.withNodes(Ol(this.nodes,a,this.nodes.length-1))}collapse(t,a){let o=this.nodes.findIndex(m=>m.value===t);if(o===-1)throw Error(`Node ${t} not found in tree. Valid ids: ${this.topLevelIds}`);let s=a===void 0?this.nodes.length:this.nodes.findIndex(m=>m.value===a);if(s===-1)throw Error(`Node ${a} not found in tree`);if(s<o)throw Error(`Node ${a} is before node ${t}`);let c=[...this.nodes],f=c[o];if(f.isCollapsed)throw Error(`Node ${t} is already collapsed`);let d=c.splice(o+1,s-o);return c[o]=new li(f.value,!0,d),this.withNodes(c)}collapseAll(t){let a=[...this.nodes];if(t.length===0)throw Error("No collapse ranges provided");if(t.length!==a.length)throw Error(`Collapse ranges length ${t.length} does not match tree length ${a.length}`);let o=a.length-1;for(;o>=0;){let s=a[o],c=t[o];if(!s.isCollapsed&&c){let{id:f,until:d}=c;if(f!==s.value)throw Error(`Node ${s.value} does not match collapse range id ${f}`);let m=d===void 0?a.length:a.findIndex(w=>w.value===d);if(m===-1)throw Error(`Node ${d} not found in tree`);if(m<o)throw Error(`Node ${d} is before node ${f}`);let b=a.splice(o+1,m-o);a[o]=new li(s.value,!0,b),o--}else o--}return this.withNodes(a)}expand(t){let a=this.nodes.findIndex(c=>c.value===t);if(a===-1)throw Error(`Node ${t} not found in tree. Valid ids: ${this.topLevelIds}`);let o=[...this.nodes],s=o[a];return s.isCollapsed?(o[a]=new li(s.value,!1,[]),o=om(o,a+1,s.children),this.withNodes(o)):this}expandAll(){let t=[...this.nodes],a=0;for(;a<t.length;){let o=t[a];o.isCollapsed&&(t[a]=new li(o.value,!1,[]),t=om(t,a+1,o.children)),a++}return this.withNodes(t)}move(t,a){return this.withNodes(Ol(this.nodes,t,a))}at(t){var a;return(a=this.nodes.at(t))==null?void 0:a.value}atOrThrow(t){let a=this.nodes.at(t);if(a===void 0)throw Error(`Node at index ${t} not found in tree`);return a.value}first(){return this.atOrThrow(0)}last(){return this.atOrThrow(this.nodes.length-1)}after(t){let a=this.indexOfOrThrow(t);if(a!==this.nodes.length-1)return this.at(a+1)}before(t){let a=this.indexOfOrThrow(t);if(a!==0)return this.at(a-1)}insert(t,a){return this.withNodes(I_(this.nodes,a,new li(t,!1,[])))}insertAtEnd(t){return this.insert(t,this.nodes.length)}insertAtStart(t){return this.insert(t,0)}deleteAtIndex(t){let a=this.atOrThrow(t),o=this.expand(a);return o.withNodes(rL(o.nodes,t))}delete(t){let a=this.indexOfOrThrow(t);return this.deleteAtIndex(a)}getCount(t){var a;return((a=this._nodeMap.get(t))==null?void 0:a.geDescendantCount())??0}findAndExpandDeep(t){let a=this.find(t);return a.length===0?this:a.reduce((o,s)=>o.expand(s),this)}find(t){function a(o,s){for(let c of o){if(c.value===t)return[...s,t];let f=a(c.children,[...s,c.value]);if(f.length>0)return f}return[]}return a(this.nodes,[])}split(t){let a=this.nodes.findIndex(c=>c.value===t);if(a===-1)throw Error(`Node ${t} not found in tree`);let o=this.nodes.slice(0,a),s=this.nodes.slice(a);return o.length===0?[ro.from([]),this.withNodes(s)]:[this.withNodes(o),ro.from([]).withNodes(s)]}equals(t){return this.nodes.length===t.nodes.length&&this.nodes.every((a,o)=>a.value===t.nodes[o].value)}toString(){let t=0,a="",o=s=>{for(let c of s)a+=`${" ".repeat(t*2)}${c.toString()}
13
- `,t+=1,o(c.children),--t};return o(this.nodes),a}},In(yn.prototype,"topLevelIds",[xg],Object.getOwnPropertyDescriptor(yn.prototype,"topLevelIds"),yn.prototype),In(yn.prototype,"inOrderIds",[kg],Object.getOwnPropertyDescriptor(yn.prototype,"inOrderIds"),yn.prototype),In(yn.prototype,"idSet",[Cg],Object.getOwnPropertyDescriptor(yn.prototype,"idSet"),yn.prototype),In(yn.prototype,"_nodeMap",[Sg],Object.getOwnPropertyDescriptor(yn.prototype,"_nodeMap"),yn.prototype),yn),gs=(Eg=gn(),Tg=gn(),Ig=gn(),Lg=gn(),Og=gn(),Ag=gn(),Rt=class on{constructor(t){this.columns=t,t.length===0&&(this.columns=[io.from([])])}static from(t){return new on(t.map(a=>io.from(a)))}static fromWithPreviousShape(t,a){if(!a)return on.from([t]);let o=a.getColumns(),s=Array.from({length:o.length},()=>[]),c=0;for(let f of t){let d=o.findIndex(m=>m.idSet.has(f));d===-1?s[c].push(f):(c=d,s[d].push(f))}return new on(s.map((f,d)=>io.fromWithPreviousShape(f,o[d])))}isEmpty(){return this.columns.length===0?!0:this.columns.every(t=>t.nodes.length===0)}static fromIdsAndColumns(t){let a=Math.max(1,...t.map(([,c])=>(c??0)+1)),o=Array.from({length:a},()=>[]),s=0;for(let[c,f]of t)f==null||f<0?o[s].push(c):(o[f].push(c),s=f);return on.from(o)}get topLevelIds(){return this.columns.map(t=>t.topLevelIds)}get iterateTopLevelIds(){let t=this.columns;function*a(){for(let o of t)for(let s of o.topLevelIds)yield s}return a()}get inOrderIds(){return this.columns.flatMap(t=>t.inOrderIds)}get colLength(){return this.columns.length}get idLength(){return this.columns.reduce((t,a)=>t+a.nodes.length,0)}get _columnMap(){return new Map(this.columns.map(t=>[t.id,t]))}at(t){return this.columns[t]}get(t){return this._columnMap.get(t)}atOrThrow(t){let a=this.columns[t];if(!a)throw Error(`Column ${t} not found`);return a}hasOnlyOneColumn(){return this.columns.length===1}getColumns(){return this.columns}hasOnlyOneId(){return this.idLength===1}getColumnIds(){return this.columns.map(t=>t.id)}indexOf(t){return this.columns.indexOf(t)}addColumn(t,a=[]){return new on(this.columns.flatMap(o=>o.id===t?[o,io.from(a)]:[o]))}insertBreakpoint(t){let a=this.findWithId(t),[o,s]=a.split(t);return new on(this.columns.flatMap(c=>c===a?[o,s].filter(Boolean):[c]))}delete(t){if(this.columns.length<=1)return this;let a=this.indexOfOrThrow(t),o=a===0?1:a-1,s=[...this.columns],c=s[a];return s[o]=c.withNodes([...s[o].nodes,...c.nodes]),s.splice(a,1),new on(s)}mergeAllColumns(){if(this.columns.length<=1)return this;let t=this.columns.flatMap(o=>o.nodes),a=this.columns[0];return new on([a.withNodes(t)])}moveWithinColumn(t,a,o){return this.transform(t,s=>s.move(a,o))}moveAcrossColumns(t,a,o,s){let c=this.indexOfOrThrow(t),f=this.indexOfOrThrow(o),d=[...this.columns],m=d[c],b=m.nodes.findIndex(S=>S.value===a);if(b===-1)throw Error(`Node ${a} not found in column ${t}`);let w=m.nodes[b];d[c]=m.withNodes(m.nodes.filter((S,E)=>E!==b));let x=d[f];if(s){let S=x.indexOfOrThrow(s);d[f]=x.withNodes(I_(x.nodes,S,w))}else d[f]=x.withNodes([w,...x.nodes]);return new on(d)}moveCellsRelativeTo(t,a,o){if(t.length===0)return this;let s=new Set(t),c=this.findWithId(a),f=this.indexOfOrThrow(c.id),d=[];for(let S of t){let E=this.findWithId(S),T=E.nodes.find(M=>M.value===S);if(!T)throw Error(`Node ${S} not found in column ${E.id}`);d.push(T)}let m=this.columns.map(S=>S.withNodes(S.nodes.filter(E=>!s.has(E.value)))),b=m[f],w=b.nodes.findIndex(S=>S.value===a);w===-1?w=b.nodes.length:o==="after"&&(w+=1);let x=om(b.nodes,w,d);return m[f]=b.withNodes(x),new on(m)}indexOfOrThrow(t){let a=this.columns.findIndex(o=>o.id===t);if(a===-1)throw Error(`Column ${t} not found. Possible values: ${this.getColumnIds().join(", ")}`);return a}moveColumn(t,a){if(t===a)return this;let o=this.indexOfOrThrow(t),s=a==="_left_"?o-1:a==="_right_"?o+1:this.indexOfOrThrow(a);return PC(o,s),new on(Ol([...this.columns],o,s))}moveToNewColumn(t){let a=this.findWithId(t),o=this.columns.map(c=>c.id===a.id?c.delete(t):c),s=io.from([t]);return new on([...o,s])}findWithId(t){let a=this.columns.find(o=>o.inOrderIds.includes(t));if(!a)throw _e.log(`Possible values: ${this.columns.map(o=>o.inOrderIds).join(", ")}`),Error(`Cell ${t} not found in any column`);return a}transformWithCellId(t,a){let o=!1,s=this.columns.map(c=>{if(c.inOrderIds.includes(t)){let f=a(c);return c!==f&&(o=!0),f}return c});return o?new on(s):this}setupCellExists(){return this.columns.some(t=>t.topLevelIds.includes(Un))}insertId(t,a,o){return this.transform(a,s=>s.insert(t,o))}deleteById(t){return this.transformWithCellId(t,a=>a.delete(t))}placeCells(t){if(t.length===0)return this;let a=this.deleteById(t[0].id);for(let{id:s}of t.slice(1))a=a.deleteById(s);let o=[...t].toSorted((s,c)=>s.columnId===c.columnId?s.index-c.index:s.columnId.localeCompare(c.columnId));for(let{id:s,columnId:c,index:f}of o)a=a.insertId(s,c,f);return a}compact(){return this.columns.length===1||!this.columns.some(t=>t.nodes.length===0)?this:new on(this.columns.filter(t=>t.nodes.length>0))}transform(t,a){let o=this._columnMap.get(t);if(!o)return _e.warn(`Column ${t} not found`),this;let s=a(o);return o===s?this:new on(this.columns.map(c=>c.id===t?s:c))}transformAll(t){let a=!1,o=this.columns.map(s=>{let c=t(s);return s.equals(c)||(a=!0),c});return a?new on(o):this}},In(Rt.prototype,"isEmpty",[Eg],Object.getOwnPropertyDescriptor(Rt.prototype,"isEmpty"),Rt.prototype),In(Rt.prototype,"topLevelIds",[Tg],Object.getOwnPropertyDescriptor(Rt.prototype,"topLevelIds"),Rt.prototype),In(Rt.prototype,"inOrderIds",[Ig],Object.getOwnPropertyDescriptor(Rt.prototype,"inOrderIds"),Rt.prototype),In(Rt.prototype,"idLength",[Lg],Object.getOwnPropertyDescriptor(Rt.prototype,"idLength"),Rt.prototype),In(Rt.prototype,"_columnMap",[Og],Object.getOwnPropertyDescriptor(Rt.prototype,"_columnMap"),Rt.prototype),In(Rt.prototype,"getColumnIds",[Ag],Object.getOwnPropertyDescriptor(Rt.prototype,"getColumnIds"),Rt.prototype),Rt);let Yd,Zd,ef,Rg,tf,Mg,Pg,Ng,Dg,nf,rf,jg,af,of;Yd=rt((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Doctype=e.CDATA=e.Tag=e.Style=e.Script=e.Comment=e.Directive=e.Text=e.Root=e.isTag=e.ElementType=void 0;var t;(function(o){o.Root="root",o.Text="text",o.Directive="directive",o.Comment="comment",o.Script="script",o.Style="style",o.Tag="tag",o.CDATA="cdata",o.Doctype="doctype"})(t=e.ElementType||(e.ElementType={}));function a(o){return o.type===t.Tag||o.type===t.Script||o.type===t.Style}e.isTag=a,e.Root=t.Root,e.Text=t.Text,e.Directive=t.Directive,e.Comment=t.Comment,e.Script=t.Script,e.Style=t.Style,e.Tag=t.Tag,e.CDATA=t.CDATA,e.Doctype=t.Doctype})),Zd=rt((e=>{var t=e&&e.__extends||(function(){var A=function(q,$){return A=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(ie,fe){ie.__proto__=fe}||function(ie,fe){for(var me in fe)Object.prototype.hasOwnProperty.call(fe,me)&&(ie[me]=fe[me])},A(q,$)};return function(q,$){if(typeof $!="function"&&$!==null)throw TypeError("Class extends value "+String($)+" is not a constructor or null");A(q,$);function ie(){this.constructor=q}q.prototype=$===null?Object.create($):(ie.prototype=$.prototype,new ie)}})(),a=e&&e.__assign||function(){return a=Object.assign||function(A){for(var q,$=1,ie=arguments.length;$<ie;$++)for(var fe in q=arguments[$],q)Object.prototype.hasOwnProperty.call(q,fe)&&(A[fe]=q[fe]);return A},a.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.cloneNode=e.hasChildren=e.isDocument=e.isDirective=e.isComment=e.isText=e.isCDATA=e.isTag=e.Element=e.Document=e.CDATA=e.NodeWithChildren=e.ProcessingInstruction=e.Comment=e.Text=e.DataNode=e.Node=void 0;var o=Yd(),s=(function(){function A(){this.parent=null,this.prev=null,this.next=null,this.startIndex=null,this.endIndex=null}return Object.defineProperty(A.prototype,"parentNode",{get:function(){return this.parent},set:function(q){this.parent=q},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"previousSibling",{get:function(){return this.prev},set:function(q){this.prev=q},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"nextSibling",{get:function(){return this.next},set:function(q){this.next=q},enumerable:!1,configurable:!0}),A.prototype.cloneNode=function(q){return q===void 0&&(q=!1),X(this,q)},A})();e.Node=s;var c=(function(A){t(q,A);function q($){var ie=A.call(this)||this;return ie.data=$,ie}return Object.defineProperty(q.prototype,"nodeValue",{get:function(){return this.data},set:function($){this.data=$},enumerable:!1,configurable:!0}),q})(s);e.DataNode=c;var f=(function(A){t(q,A);function q(){var $=A!==null&&A.apply(this,arguments)||this;return $.type=o.ElementType.Text,$}return Object.defineProperty(q.prototype,"nodeType",{get:function(){return 3},enumerable:!1,configurable:!0}),q})(c);e.Text=f;var d=(function(A){t(q,A);function q(){var $=A!==null&&A.apply(this,arguments)||this;return $.type=o.ElementType.Comment,$}return Object.defineProperty(q.prototype,"nodeType",{get:function(){return 8},enumerable:!1,configurable:!0}),q})(c);e.Comment=d;var m=(function(A){t(q,A);function q($,ie){var fe=A.call(this,ie)||this;return fe.name=$,fe.type=o.ElementType.Directive,fe}return Object.defineProperty(q.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),q})(c);e.ProcessingInstruction=m;var b=(function(A){t(q,A);function q($){var ie=A.call(this)||this;return ie.children=$,ie}return Object.defineProperty(q.prototype,"firstChild",{get:function(){return this.children[0]??null},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"lastChild",{get:function(){return this.children.length>0?this.children[this.children.length-1]:null},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"childNodes",{get:function(){return this.children},set:function($){this.children=$},enumerable:!1,configurable:!0}),q})(s);e.NodeWithChildren=b;var w=(function(A){t(q,A);function q(){var $=A!==null&&A.apply(this,arguments)||this;return $.type=o.ElementType.CDATA,$}return Object.defineProperty(q.prototype,"nodeType",{get:function(){return 4},enumerable:!1,configurable:!0}),q})(b);e.CDATA=w;var x=(function(A){t(q,A);function q(){var $=A!==null&&A.apply(this,arguments)||this;return $.type=o.ElementType.Root,$}return Object.defineProperty(q.prototype,"nodeType",{get:function(){return 9},enumerable:!1,configurable:!0}),q})(b);e.Document=x;var S=(function(A){t(q,A);function q($,ie,fe,me){fe===void 0&&(fe=[]),me===void 0&&(me=$==="script"?o.ElementType.Script:$==="style"?o.ElementType.Style:o.ElementType.Tag);var ve=A.call(this,fe)||this;return ve.name=$,ve.attribs=ie,ve.type=me,ve}return Object.defineProperty(q.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"tagName",{get:function(){return this.name},set:function($){this.name=$},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"attributes",{get:function(){var $=this;return Object.keys(this.attribs).map(function(ie){var fe,me;return{name:ie,value:$.attribs[ie],namespace:(fe=$["x-attribsNamespace"])==null?void 0:fe[ie],prefix:(me=$["x-attribsPrefix"])==null?void 0:me[ie]}})},enumerable:!1,configurable:!0}),q})(b);e.Element=S;function E(A){return(0,o.isTag)(A)}e.isTag=E;function T(A){return A.type===o.ElementType.CDATA}e.isCDATA=T;function M(A){return A.type===o.ElementType.Text}e.isText=M;function z(A){return A.type===o.ElementType.Comment}e.isComment=z;function B(A){return A.type===o.ElementType.Directive}e.isDirective=B;function V(A){return A.type===o.ElementType.Root}e.isDocument=V;function N(A){return Object.prototype.hasOwnProperty.call(A,"children")}e.hasChildren=N;function X(A,q){q===void 0&&(q=!1);var $;if(M(A))$=new f(A.data);else if(z(A))$=new d(A.data);else if(E(A)){var ie=q?ce(A.children):[],fe=new S(A.name,a({},A.attribs),ie);ie.forEach(function(de){return de.parent=fe}),A.namespace!=null&&(fe.namespace=A.namespace),A["x-attribsNamespace"]&&(fe["x-attribsNamespace"]=a({},A["x-attribsNamespace"])),A["x-attribsPrefix"]&&(fe["x-attribsPrefix"]=a({},A["x-attribsPrefix"])),$=fe}else if(T(A)){var ie=q?ce(A.children):[],me=new w(ie);ie.forEach(function(be){return be.parent=me}),$=me}else if(V(A)){var ie=q?ce(A.children):[],ve=new x(ie);ie.forEach(function(be){return be.parent=ve}),A["x-mode"]&&(ve["x-mode"]=A["x-mode"]),$=ve}else if(B(A)){var ae=new m(A.name,A.data);A["x-name"]!=null&&(ae["x-name"]=A["x-name"],ae["x-publicId"]=A["x-publicId"],ae["x-systemId"]=A["x-systemId"]),$=ae}else throw Error(`Not implemented yet: ${A.type}`);return $.startIndex=A.startIndex,$.endIndex=A.endIndex,A.sourceCodeLocation!=null&&($.sourceCodeLocation=A.sourceCodeLocation),$}e.cloneNode=X;function ce(A){for(var q=A.map(function(ie){return X(ie,!0)}),$=1;$<q.length;$++)q[$].prev=q[$-1],q[$-1].next=q[$];return q}})),ef=rt((e=>{var t=e&&e.__createBinding||(Object.create?(function(d,m,b,w){w===void 0&&(w=b);var x=Object.getOwnPropertyDescriptor(m,b);(!x||("get"in x?!m.__esModule:x.writable||x.configurable))&&(x={enumerable:!0,get:function(){return m[b]}}),Object.defineProperty(d,w,x)}):(function(d,m,b,w){w===void 0&&(w=b),d[w]=m[b]})),a=e&&e.__exportStar||function(d,m){for(var b in d)b!=="default"&&!Object.prototype.hasOwnProperty.call(m,b)&&t(m,d,b)};Object.defineProperty(e,"__esModule",{value:!0}),e.DomHandler=void 0;var o=Yd(),s=Zd();a(Zd(),e);var c={withStartIndices:!1,withEndIndices:!1,xmlMode:!1},f=(function(){function d(m,b,w){this.dom=[],this.root=new s.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null,typeof b=="function"&&(w=b,b=c),typeof m=="object"&&(b=m,m=void 0),this.callback=m??null,this.options=b??c,this.elementCB=w??null}return d.prototype.onparserinit=function(m){this.parser=m},d.prototype.onreset=function(){this.dom=[],this.root=new s.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null},d.prototype.onend=function(){this.done||(this.done=!0,this.parser=null,this.handleCallback(null))},d.prototype.onerror=function(m){this.handleCallback(m)},d.prototype.onclosetag=function(){this.lastNode=null;var m=this.tagStack.pop();this.options.withEndIndices&&(m.endIndex=this.parser.endIndex),this.elementCB&&this.elementCB(m)},d.prototype.onopentag=function(m,b){var w=this.options.xmlMode?o.ElementType.Tag:void 0,x=new s.Element(m,b,void 0,w);this.addNode(x),this.tagStack.push(x)},d.prototype.ontext=function(m){var b=this.lastNode;if(b&&b.type===o.ElementType.Text)b.data+=m,this.options.withEndIndices&&(b.endIndex=this.parser.endIndex);else{var w=new s.Text(m);this.addNode(w),this.lastNode=w}},d.prototype.oncomment=function(m){if(this.lastNode&&this.lastNode.type===o.ElementType.Comment){this.lastNode.data+=m;return}var b=new s.Comment(m);this.addNode(b),this.lastNode=b},d.prototype.oncommentend=function(){this.lastNode=null},d.prototype.oncdatastart=function(){var m=new s.Text(""),b=new s.CDATA([m]);this.addNode(b),m.parent=b,this.lastNode=m},d.prototype.oncdataend=function(){this.lastNode=null},d.prototype.onprocessinginstruction=function(m,b){var w=new s.ProcessingInstruction(m,b);this.addNode(w)},d.prototype.handleCallback=function(m){if(typeof this.callback=="function")this.callback(m,this.dom);else if(m)throw m},d.prototype.addNode=function(m){var b=this.tagStack[this.tagStack.length-1],w=b.children[b.children.length-1];this.options.withStartIndices&&(m.startIndex=this.parser.startIndex),this.options.withEndIndices&&(m.endIndex=this.parser.endIndex),b.children.push(m),w&&(m.prev=w,w.next=m),m.parent=b,this.lastNode=null},d})();e.DomHandler=f,e.default=f})),Rg=rt((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CARRIAGE_RETURN_PLACEHOLDER_REGEX=e.CARRIAGE_RETURN_PLACEHOLDER=e.CARRIAGE_RETURN_REGEX=e.CARRIAGE_RETURN=e.CASE_SENSITIVE_TAG_NAMES_MAP=e.CASE_SENSITIVE_TAG_NAMES=void 0,e.CASE_SENSITIVE_TAG_NAMES="animateMotion.animateTransform.clipPath.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDropShadow.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.foreignObject.linearGradient.radialGradient.textPath".split("."),e.CASE_SENSITIVE_TAG_NAMES_MAP=e.CASE_SENSITIVE_TAG_NAMES.reduce(function(t,a){return t[a.toLowerCase()]=a,t},{}),e.CARRIAGE_RETURN="\r",e.CARRIAGE_RETURN_REGEX=new RegExp(e.CARRIAGE_RETURN,"g"),e.CARRIAGE_RETURN_PLACEHOLDER=`__HTML_DOM_PARSER_CARRIAGE_RETURN_PLACEHOLDER_${Date.now()}__`,e.CARRIAGE_RETURN_PLACEHOLDER_REGEX=new RegExp(e.CARRIAGE_RETURN_PLACEHOLDER,"g")})),tf=rt((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatAttributes=s,e.escapeSpecialCharacters=f,e.revertEscapedCharacters=d,e.formatDOM=m;var t=ef(),a=Rg();function o(b){return a.CASE_SENSITIVE_TAG_NAMES_MAP[b]}function s(b){for(var w={},x=0,S=b.length;x<S;x++){var E=b[x];w[E.name]=E.value}return w}function c(b){return b=b.toLowerCase(),o(b)||b}function f(b){return b.replace(a.CARRIAGE_RETURN_REGEX,a.CARRIAGE_RETURN_PLACEHOLDER)}function d(b){return b.replace(a.CARRIAGE_RETURN_PLACEHOLDER_REGEX,a.CARRIAGE_RETURN)}function m(b,w,x){w===void 0&&(w=null);for(var S=[],E,T=0,M=b.length;T<M;T++){var z=b[T];switch(z.nodeType){case 1:var B=c(z.nodeName);E=new t.Element(B,s(z.attributes)),E.children=m(B==="template"?z.content.childNodes:z.childNodes,E);break;case 3:E=new t.Text(d(z.nodeValue));break;case 8:E=new t.Comment(z.nodeValue);break;default:continue}var V=S[T-1]||null;V&&(V.next=E),E.parent=w,E.prev=V,E.next=null,S.push(E)}return x&&(E=new t.ProcessingInstruction(x.substring(0,x.indexOf(" ")).toLowerCase(),x),E.next=S[0]||null,E.parent=w,S.unshift(E),S[1]&&(S[1].prev=S[0])),S}})),Mg=rt((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=z;var t=tf(),a="html",o="head",s="body",c=/<([a-zA-Z]+[0-9]?)/,f=/<head[^]*>/i,d=/<body[^]*>/i,m=function(B,V){throw Error("This browser does not support `document.implementation.createHTMLDocument`")},b=function(B,V){throw Error("This browser does not support `DOMParser.prototype.parseFromString`")},w=typeof window=="object"&&window.DOMParser;if(typeof w=="function"){var x=new w,S="text/html";b=function(B,V){return V&&(B=`<${V}>${B}</${V}>`),x.parseFromString(B,S)},m=b}if(typeof document=="object"&&document.implementation){var E=document.implementation.createHTMLDocument();m=function(B,V){if(V){var N=E.documentElement.querySelector(V);return N&&(N.innerHTML=B),E}return E.documentElement.innerHTML=B,E}}var T=typeof document=="object"&&document.createElement("template"),M;T&&T.content&&(M=function(B){return T.innerHTML=B,T.content.childNodes});function z(B){var V,N;B=(0,t.escapeSpecialCharacters)(B);var X=B.match(c),ce=X&&X[1]?X[1].toLowerCase():"";switch(ce){case a:var A=b(B);if(!f.test(B)){var $=A.querySelector(o);(V=$==null?void 0:$.parentNode)==null||V.removeChild($)}if(!d.test(B)){var $=A.querySelector(s);(N=$==null?void 0:$.parentNode)==null||N.removeChild($)}return A.querySelectorAll(a);case o:case s:var q=m(B).querySelectorAll(ce);return d.test(B)&&f.test(B)?q[0].parentNode.childNodes:q;default:if(M)return M(B);var $=m(B,s).querySelector(s);return $.childNodes}}})),Pg=rt((e=>{var t=e&&e.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=c;var a=t(Mg()),o=tf(),s=/<(![a-zA-Z\s]+)>/;function c(f){if(typeof f!="string")throw TypeError("First argument must be a string");if(!f)return[];var d=f.match(s),m=d?d[1]:void 0;return(0,o.formatDOM)((0,a.default)(f),null,m)}})),Ng=rt((e=>{e.SAME=0,e.CAMELCASE=1,e.possibleStandardNames={accept:0,acceptCharset:1,"accept-charset":"acceptCharset",accessKey:1,action:0,allowFullScreen:1,alt:0,as:0,async:0,autoCapitalize:1,autoComplete:1,autoCorrect:1,autoFocus:1,autoPlay:1,autoSave:1,capture:0,cellPadding:1,cellSpacing:1,challenge:0,charSet:1,checked:0,children:0,cite:0,class:"className",classID:1,className:1,cols:0,colSpan:1,content:0,contentEditable:1,contextMenu:1,controls:0,controlsList:1,coords:0,crossOrigin:1,dangerouslySetInnerHTML:1,data:0,dateTime:1,default:0,defaultChecked:1,defaultValue:1,defer:0,dir:0,disabled:0,disablePictureInPicture:1,disableRemotePlayback:1,download:0,draggable:0,encType:1,enterKeyHint:1,for:"htmlFor",form:0,formMethod:1,formAction:1,formEncType:1,formNoValidate:1,formTarget:1,frameBorder:1,headers:0,height:0,hidden:0,high:0,href:0,hrefLang:1,htmlFor:1,httpEquiv:1,"http-equiv":"httpEquiv",icon:0,id:0,innerHTML:1,inputMode:1,integrity:0,is:0,itemID:1,itemProp:1,itemRef:1,itemScope:1,itemType:1,keyParams:1,keyType:1,kind:0,label:0,lang:0,list:0,loop:0,low:0,manifest:0,marginWidth:1,marginHeight:1,max:0,maxLength:1,media:0,mediaGroup:1,method:0,min:0,minLength:1,multiple:0,muted:0,name:0,noModule:1,nonce:0,noValidate:1,open:0,optimum:0,pattern:0,placeholder:0,playsInline:1,poster:0,preload:0,profile:0,radioGroup:1,readOnly:1,referrerPolicy:1,rel:0,required:0,reversed:0,role:0,rows:0,rowSpan:1,sandbox:0,scope:0,scoped:0,scrolling:0,seamless:0,selected:0,shape:0,size:0,sizes:0,span:0,spellCheck:1,src:0,srcDoc:1,srcLang:1,srcSet:1,start:0,step:0,style:0,summary:0,tabIndex:1,target:0,title:0,type:0,useMap:1,value:0,width:0,wmode:0,wrap:0,about:0,accentHeight:1,"accent-height":"accentHeight",accumulate:0,additive:0,alignmentBaseline:1,"alignment-baseline":"alignmentBaseline",allowReorder:1,alphabetic:0,amplitude:0,arabicForm:1,"arabic-form":"arabicForm",ascent:0,attributeName:1,attributeType:1,autoReverse:1,azimuth:0,baseFrequency:1,baselineShift:1,"baseline-shift":"baselineShift",baseProfile:1,bbox:0,begin:0,bias:0,by:0,calcMode:1,capHeight:1,"cap-height":"capHeight",clip:0,clipPath:1,"clip-path":"clipPath",clipPathUnits:1,clipRule:1,"clip-rule":"clipRule",color:0,colorInterpolation:1,"color-interpolation":"colorInterpolation",colorInterpolationFilters:1,"color-interpolation-filters":"colorInterpolationFilters",colorProfile:1,"color-profile":"colorProfile",colorRendering:1,"color-rendering":"colorRendering",contentScriptType:1,contentStyleType:1,cursor:0,cx:0,cy:0,d:0,datatype:0,decelerate:0,descent:0,diffuseConstant:1,direction:0,display:0,divisor:0,dominantBaseline:1,"dominant-baseline":"dominantBaseline",dur:0,dx:0,dy:0,edgeMode:1,elevation:0,enableBackground:1,"enable-background":"enableBackground",end:0,exponent:0,externalResourcesRequired:1,fill:0,fillOpacity:1,"fill-opacity":"fillOpacity",fillRule:1,"fill-rule":"fillRule",filter:0,filterRes:1,filterUnits:1,floodOpacity:1,"flood-opacity":"floodOpacity",floodColor:1,"flood-color":"floodColor",focusable:0,fontFamily:1,"font-family":"fontFamily",fontSize:1,"font-size":"fontSize",fontSizeAdjust:1,"font-size-adjust":"fontSizeAdjust",fontStretch:1,"font-stretch":"fontStretch",fontStyle:1,"font-style":"fontStyle",fontVariant:1,"font-variant":"fontVariant",fontWeight:1,"font-weight":"fontWeight",format:0,from:0,fx:0,fy:0,g1:0,g2:0,glyphName:1,"glyph-name":"glyphName",glyphOrientationHorizontal:1,"glyph-orientation-horizontal":"glyphOrientationHorizontal",glyphOrientationVertical:1,"glyph-orientation-vertical":"glyphOrientationVertical",glyphRef:1,gradientTransform:1,gradientUnits:1,hanging:0,horizAdvX:1,"horiz-adv-x":"horizAdvX",horizOriginX:1,"horiz-origin-x":"horizOriginX",ideographic:0,imageRendering:1,"image-rendering":"imageRendering",in2:0,in:0,inlist:0,intercept:0,k1:0,k2:0,k3:0,k4:0,k:0,kernelMatrix:1,kernelUnitLength:1,kerning:0,keyPoints:1,keySplines:1,keyTimes:1,lengthAdjust:1,letterSpacing:1,"letter-spacing":"letterSpacing",lightingColor:1,"lighting-color":"lightingColor",limitingConeAngle:1,local:0,markerEnd:1,"marker-end":"markerEnd",markerHeight:1,markerMid:1,"marker-mid":"markerMid",markerStart:1,"marker-start":"markerStart",markerUnits:1,markerWidth:1,mask:0,maskContentUnits:1,maskUnits:1,mathematical:0,mode:0,numOctaves:1,offset:0,opacity:0,operator:0,order:0,orient:0,orientation:0,origin:0,overflow:0,overlinePosition:1,"overline-position":"overlinePosition",overlineThickness:1,"overline-thickness":"overlineThickness",paintOrder:1,"paint-order":"paintOrder",panose1:0,"panose-1":"panose1",pathLength:1,patternContentUnits:1,patternTransform:1,patternUnits:1,pointerEvents:1,"pointer-events":"pointerEvents",points:0,pointsAtX:1,pointsAtY:1,pointsAtZ:1,prefix:0,preserveAlpha:1,preserveAspectRatio:1,primitiveUnits:1,property:0,r:0,radius:0,refX:1,refY:1,renderingIntent:1,"rendering-intent":"renderingIntent",repeatCount:1,repeatDur:1,requiredExtensions:1,requiredFeatures:1,resource:0,restart:0,result:0,results:0,rotate:0,rx:0,ry:0,scale:0,security:0,seed:0,shapeRendering:1,"shape-rendering":"shapeRendering",slope:0,spacing:0,specularConstant:1,specularExponent:1,speed:0,spreadMethod:1,startOffset:1,stdDeviation:1,stemh:0,stemv:0,stitchTiles:1,stopColor:1,"stop-color":"stopColor",stopOpacity:1,"stop-opacity":"stopOpacity",strikethroughPosition:1,"strikethrough-position":"strikethroughPosition",strikethroughThickness:1,"strikethrough-thickness":"strikethroughThickness",string:0,stroke:0,strokeDasharray:1,"stroke-dasharray":"strokeDasharray",strokeDashoffset:1,"stroke-dashoffset":"strokeDashoffset",strokeLinecap:1,"stroke-linecap":"strokeLinecap",strokeLinejoin:1,"stroke-linejoin":"strokeLinejoin",strokeMiterlimit:1,"stroke-miterlimit":"strokeMiterlimit",strokeWidth:1,"stroke-width":"strokeWidth",strokeOpacity:1,"stroke-opacity":"strokeOpacity",suppressContentEditableWarning:1,suppressHydrationWarning:1,surfaceScale:1,systemLanguage:1,tableValues:1,targetX:1,targetY:1,textAnchor:1,"text-anchor":"textAnchor",textDecoration:1,"text-decoration":"textDecoration",textLength:1,textRendering:1,"text-rendering":"textRendering",to:0,transform:0,typeof:0,u1:0,u2:0,underlinePosition:1,"underline-position":"underlinePosition",underlineThickness:1,"underline-thickness":"underlineThickness",unicode:0,unicodeBidi:1,"unicode-bidi":"unicodeBidi",unicodeRange:1,"unicode-range":"unicodeRange",unitsPerEm:1,"units-per-em":"unitsPerEm",unselectable:0,vAlphabetic:1,"v-alphabetic":"vAlphabetic",values:0,vectorEffect:1,"vector-effect":"vectorEffect",version:0,vertAdvY:1,"vert-adv-y":"vertAdvY",vertOriginX:1,"vert-origin-x":"vertOriginX",vertOriginY:1,"vert-origin-y":"vertOriginY",vHanging:1,"v-hanging":"vHanging",vIdeographic:1,"v-ideographic":"vIdeographic",viewBox:1,viewTarget:1,visibility:0,vMathematical:1,"v-mathematical":"vMathematical",vocab:0,widths:0,wordSpacing:1,"word-spacing":"wordSpacing",writingMode:1,"writing-mode":"writingMode",x1:0,x2:0,x:0,xChannelSelector:1,xHeight:1,"x-height":"xHeight",xlinkActuate:1,"xlink:actuate":"xlinkActuate",xlinkArcrole:1,"xlink:arcrole":"xlinkArcrole",xlinkHref:1,"xlink:href":"xlinkHref",xlinkRole:1,"xlink:role":"xlinkRole",xlinkShow:1,"xlink:show":"xlinkShow",xlinkTitle:1,"xlink:title":"xlinkTitle",xlinkType:1,"xlink:type":"xlinkType",xmlBase:1,"xml:base":"xmlBase",xmlLang:1,"xml:lang":"xmlLang",xmlns:0,"xml:space":"xmlSpace",xmlnsXlink:1,"xmlns:xlink":"xmlnsXlink",xmlSpace:1,y1:0,y2:0,y:0,yChannelSelector:1,z:0,zoomAndPan:1}})),Dg=rt((e=>{var t=0,a=1,o=2,s=3,c=4,f=5,d=6;function m(N){return w.hasOwnProperty(N)?w[N]:null}function b(N,X,ce,A,q,$,ie){this.acceptsBooleans=X===o||X===s||X===c,this.attributeName=A,this.attributeNamespace=q,this.mustUseProperty=ce,this.propertyName=N,this.type=X,this.sanitizeURL=$,this.removeEmptyString=ie}var w={};["children","dangerouslySetInnerHTML","defaultValue","defaultChecked","innerHTML","suppressContentEditableWarning","suppressHydrationWarning","style"].forEach(N=>{w[N]=new b(N,t,!1,N,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(([N,X])=>{w[N]=new b(N,a,!1,X,null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(N=>{w[N]=new b(N,o,!1,N.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(N=>{w[N]=new b(N,o,!1,N,null,!1,!1)}),["allowFullScreen","async","autoFocus","autoPlay","controls","default","defer","disabled","disablePictureInPicture","disableRemotePlayback","formNoValidate","hidden","loop","noModule","noValidate","open","playsInline","readOnly","required","reversed","scoped","seamless","itemScope"].forEach(N=>{w[N]=new b(N,s,!1,N.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(N=>{w[N]=new b(N,s,!0,N,null,!1,!1)}),["capture","download"].forEach(N=>{w[N]=new b(N,c,!1,N,null,!1,!1)}),["cols","rows","size","span"].forEach(N=>{w[N]=new b(N,d,!1,N,null,!1,!1)}),["rowSpan","start"].forEach(N=>{w[N]=new b(N,f,!1,N.toLowerCase(),null,!1,!1)});var x=/[\-\:]([a-z])/g,S=N=>N[1].toUpperCase();"accent-height.alignment-baseline.arabic-form.baseline-shift.cap-height.clip-path.clip-rule.color-interpolation.color-interpolation-filters.color-profile.color-rendering.dominant-baseline.enable-background.fill-opacity.fill-rule.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.glyph-name.glyph-orientation-horizontal.glyph-orientation-vertical.horiz-adv-x.horiz-origin-x.image-rendering.letter-spacing.lighting-color.marker-end.marker-mid.marker-start.overline-position.overline-thickness.paint-order.panose-1.pointer-events.rendering-intent.shape-rendering.stop-color.stop-opacity.strikethrough-position.strikethrough-thickness.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke-width.text-anchor.text-decoration.text-rendering.underline-position.underline-thickness.unicode-bidi.unicode-range.units-per-em.v-alphabetic.v-hanging.v-ideographic.v-mathematical.vector-effect.vert-adv-y.vert-origin-x.vert-origin-y.word-spacing.writing-mode.xmlns:xlink.x-height".split(".").forEach(N=>{let X=N.replace(x,S);w[X]=new b(X,a,!1,N,null,!1,!1)}),["xlink:actuate","xlink:arcrole","xlink:role","xlink:show","xlink:title","xlink:type"].forEach(N=>{let X=N.replace(x,S);w[X]=new b(X,a,!1,N,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(N=>{let X=N.replace(x,S);w[X]=new b(X,a,!1,N,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(N=>{w[N]=new b(N,a,!1,N.toLowerCase(),null,!1,!1)});var E="xlinkHref";w[E]=new b("xlinkHref",a,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(N=>{w[N]=new b(N,a,!1,N.toLowerCase(),null,!0,!0)});var{CAMELCASE:T,SAME:M,possibleStandardNames:z}=Ng(),B=RegExp.prototype.test.bind(RegExp("^(data|aria)-[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$")),V=Object.keys(z).reduce((N,X)=>{let ce=z[X];return ce===M?N[X]=X:ce===T?N[X.toLowerCase()]=X:N[X]=ce,N},{});e.BOOLEAN=s,e.BOOLEANISH_STRING=o,e.NUMERIC=f,e.OVERLOADED_BOOLEAN=c,e.POSITIVE_NUMERIC=d,e.RESERVED=t,e.STRING=a,e.getPropertyInfo=m,e.isCustomAttribute=B,e.possibleStandardNames=V})),nf=rt((e=>{var t=e&&e.__importDefault||function(m){return m&&m.__esModule?m:{default:m}};Object.defineProperty(e,"__esModule",{value:!0}),e.returnFirstArg=e.canTextBeChildOfNode=e.ELEMENTS_WITH_NO_TEXT_CHILDREN=e.PRESERVE_CUSTOM_ATTRIBUTES=void 0,e.isCustomComponent=c,e.setStyleProp=d;var a=$u(),o=t(iL()),s=new Set(["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"]);function c(m,b){return m.includes("-")?!s.has(m):!!(b&&typeof b.is=="string")}var f={reactCompat:!0};function d(m,b){if(typeof m=="string"){if(!m.trim()){b.style={};return}try{b.style=(0,o.default)(m,f)}catch{b.style={}}}}e.PRESERVE_CUSTOM_ATTRIBUTES=Number(a.version.split(".")[0])>=16,e.ELEMENTS_WITH_NO_TEXT_CHILDREN=new Set(["tr","tbody","thead","tfoot","colgroup","table","head","html","frameset"]),e.canTextBeChildOfNode=function(m){return!e.ELEMENTS_WITH_NO_TEXT_CHILDREN.has(m.name)},e.returnFirstArg=function(m){return m}})),rf=rt((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=f;var t=Dg(),a=nf(),o=["checked","value"],s=["input","select","textarea"],c={reset:!0,submit:!0};function f(m,b){m===void 0&&(m={});var w={},x=!!(m.type&&c[m.type]);for(var S in m){var E=m[S];if((0,t.isCustomAttribute)(S)){w[S]=E;continue}var T=S.toLowerCase(),M=d(T);if(M){var z=(0,t.getPropertyInfo)(M);switch(o.includes(M)&&s.includes(b)&&!x&&(M=d("default"+T)),w[M]=E,z&&z.type){case t.BOOLEAN:w[M]=!0;break;case t.OVERLOADED_BOOLEAN:E===""&&(w[M]=!0);break}continue}a.PRESERVE_CUSTOM_ATTRIBUTES&&(w[S]=E)}return(0,a.setStyleProp)(m.style,w),w}function d(m){return t.possibleStandardNames[m]}})),jg=rt((e=>{var t=e&&e.__importDefault||function(m){return m&&m.__esModule?m:{default:m}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=f;var a=$u(),o=t(rf()),s=nf(),c={cloneElement:a.cloneElement,createElement:a.createElement,isValidElement:a.isValidElement};function f(m,b){b===void 0&&(b={});for(var w=[],x=typeof b.replace=="function",S=b.transform||s.returnFirstArg,E=b.library||c,T=E.cloneElement,M=E.createElement,z=E.isValidElement,B=m.length,V=0;V<B;V++){var N=m[V];if(x){var X=b.replace(N,V);if(z(X)){B>1&&(X=T(X,{key:X.key||V})),w.push(S(X,N,V));continue}}if(N.type==="text"){var ce=!N.data.trim().length;if(ce&&N.parent&&!(0,s.canTextBeChildOfNode)(N.parent)||b.trim&&ce)continue;w.push(S(N.data,N,V));continue}var A=N,q={};d(A)?((0,s.setStyleProp)(A.attribs.style,A.attribs),q=A.attribs):A.attribs&&(q=(0,o.default)(A.attribs,A.name));var $=void 0;switch(N.type){case"script":case"style":N.children[0]&&(q.dangerouslySetInnerHTML={__html:N.children[0].data});break;case"tag":N.name==="textarea"&&N.children[0]?q.defaultValue=N.children[0].data:N.children&&N.children.length&&($=f(N.children,b));break;default:continue}B>1&&(q.key=V),w.push(S(M(N.name,q,$),N,V))}return w.length===1?w[0]:w}function d(m){return s.PRESERVE_CUSTOM_ATTRIBUTES&&m.type==="tag"&&(0,s.isCustomComponent)(m.name,m.attribs)}})),af=rt((e=>{var t=e&&e.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(e,"__esModule",{value:!0}),e.htmlToDOM=e.domToReact=e.attributesToProps=e.Text=e.ProcessingInstruction=e.Element=e.Comment=void 0,e.default=f;var a=t(Pg());e.htmlToDOM=a.default,e.attributesToProps=t(rf()).default;var o=t(jg());e.domToReact=o.default;var s=ef();Object.defineProperty(e,"Comment",{enumerable:!0,get:function(){return s.Comment}}),Object.defineProperty(e,"Element",{enumerable:!0,get:function(){return s.Element}}),Object.defineProperty(e,"ProcessingInstruction",{enumerable:!0,get:function(){return s.ProcessingInstruction}}),Object.defineProperty(e,"Text",{enumerable:!0,get:function(){return s.Text}});var c={lowerCaseAttributeNames:!1};function f(d,m){if(typeof d!="string")throw TypeError("First argument must be a string");return d?(0,o.default)((0,a.default)(d,(m==null?void 0:m.htmlparser2)||c),m):[]}})),of=Hu(af(),1),ri=af(),Rm=of.default.default||of.default;let Jl;Jl=(e,t)=>{let[a,...o]=t.split("."),s=(e.attribs.class||"").split(" ");return e.tagName===a&&o.every(c=>s.includes(c))},hk=e=>{var t;return e&&Jl(e,"span.nb")&&e.firstChild instanceof ri.Text&&((t=e.firstChild.nodeValue)==null?void 0:t.includes("__marimo__"))},h0=function(e){var t,a,o;if(e instanceof ri.Element&&e.firstChild instanceof ri.Text&&Jl(e,"span.nb")){let s=e.next;if(s&&s instanceof ri.Text){let c=s.next;if(c&&c instanceof ri.Element&&c.firstChild instanceof ri.Text&&Jl(c,"span.m")){let f=Number.parseInt(c.firstChild.nodeValue||"0",10);if((t=e.firstChild.nodeValue)!=null&&t.includes("__marimo__")){let d=(a=/__marimo__cell_(\w+)_/.exec(e.firstChild.nodeValue))==null?void 0:a[1];if(d&&f)return{kind:"cell",cellId:d,lineNumber:f}}else{let d=(o=/"(.+?)"/.exec(e.firstChild.nodeValue))==null?void 0:o[1];if(d&&f)return{kind:"file",filePath:d,lineNumber:f}}}}}return null},mm=function(e){let t=[];return Rm(e,{replace:a=>{let o=h0(a);if(o)return t.push(o),"dummy"}}),t};function zg(e){return t=>{let a=!1;for(let o of t)o&&(a=e(o)||a);return a}}const DC=zg(L8),jC=zg(O8);let sf,qg,oo,Fg,so,Bg;sf=rt(((e,t)=>{var a=typeof Reflect=="object"?Reflect:null,o=a&&typeof a.apply=="function"?a.apply:function(A,q,$){return Function.prototype.apply.call(A,q,$)},s=a&&typeof a.ownKeys=="function"?a.ownKeys:Object.getOwnPropertySymbols?function(A){return Object.getOwnPropertyNames(A).concat(Object.getOwnPropertySymbols(A))}:function(A){return Object.getOwnPropertyNames(A)};function c(A){console&&console.warn&&console.warn(A)}var f=Number.isNaN||function(A){return A!==A};function d(){d.init.call(this)}t.exports=d,t.exports.once=N,d.EventEmitter=d,d.prototype._events=void 0,d.prototype._eventsCount=0,d.prototype._maxListeners=void 0;var m=10;function b(A){if(typeof A!="function")throw TypeError('The "listener" argument must be of type Function. Received type '+typeof A)}Object.defineProperty(d,"defaultMaxListeners",{enumerable:!0,get:function(){return m},set:function(A){if(typeof A!="number"||A<0||f(A))throw RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+A+".");m=A}}),d.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},d.prototype.setMaxListeners=function(A){if(typeof A!="number"||A<0||f(A))throw RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+A+".");return this._maxListeners=A,this};function w(A){return A._maxListeners===void 0?d.defaultMaxListeners:A._maxListeners}d.prototype.getMaxListeners=function(){return w(this)},d.prototype.emit=function(A){for(var q=[],$=1;$<arguments.length;$++)q.push(arguments[$]);var ie=A==="error",fe=this._events;if(fe!==void 0)ie&&(ie=fe.error===void 0);else if(!ie)return!1;if(ie){var me;if(q.length>0&&(me=q[0]),me instanceof Error)throw me;var ve=Error("Unhandled error."+(me?" ("+me.message+")":""));throw ve.context=me,ve}var ae=fe[A];if(ae===void 0)return!1;if(typeof ae=="function")o(ae,this,q);else for(var de=ae.length,be=z(ae,de),$=0;$<de;++$)o(be[$],this,q);return!0};function x(A,q,$,ie){var fe,me,ve;if(b($),me=A._events,me===void 0?(me=A._events=Object.create(null),A._eventsCount=0):(me.newListener!==void 0&&(A.emit("newListener",q,$.listener?$.listener:$),me=A._events),ve=me[q]),ve===void 0)ve=me[q]=$,++A._eventsCount;else if(typeof ve=="function"?ve=me[q]=ie?[$,ve]:[ve,$]:ie?ve.unshift($):ve.push($),fe=w(A),fe>0&&ve.length>fe&&!ve.warned){ve.warned=!0;var ae=Error("Possible EventEmitter memory leak detected. "+ve.length+" "+String(q)+" listeners added. Use emitter.setMaxListeners() to increase limit");ae.name="MaxListenersExceededWarning",ae.emitter=A,ae.type=q,ae.count=ve.length,c(ae)}return A}d.prototype.addListener=function(A,q){return x(this,A,q,!1)},d.prototype.on=d.prototype.addListener,d.prototype.prependListener=function(A,q){return x(this,A,q,!0)};function S(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function E(A,q,$){var ie={fired:!1,wrapFn:void 0,target:A,type:q,listener:$},fe=S.bind(ie);return fe.listener=$,ie.wrapFn=fe,fe}d.prototype.once=function(A,q){return b(q),this.on(A,E(this,A,q)),this},d.prototype.prependOnceListener=function(A,q){return b(q),this.prependListener(A,E(this,A,q)),this},d.prototype.removeListener=function(A,q){var $,ie,fe,me,ve;if(b(q),ie=this._events,ie===void 0||($=ie[A],$===void 0))return this;if($===q||$.listener===q)--this._eventsCount===0?this._events=Object.create(null):(delete ie[A],ie.removeListener&&this.emit("removeListener",A,$.listener||q));else if(typeof $!="function"){for(fe=-1,me=$.length-1;me>=0;me--)if($[me]===q||$[me].listener===q){ve=$[me].listener,fe=me;break}if(fe<0)return this;fe===0?$.shift():B($,fe),$.length===1&&(ie[A]=$[0]),ie.removeListener!==void 0&&this.emit("removeListener",A,ve||q)}return this},d.prototype.off=d.prototype.removeListener,d.prototype.removeAllListeners=function(A){var q,$=this._events,ie;if($===void 0)return this;if($.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):$[A]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete $[A]),this;if(arguments.length===0){var fe=Object.keys($),me;for(ie=0;ie<fe.length;++ie)me=fe[ie],me!=="removeListener"&&this.removeAllListeners(me);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(q=$[A],typeof q=="function")this.removeListener(A,q);else if(q!==void 0)for(ie=q.length-1;ie>=0;ie--)this.removeListener(A,q[ie]);return this};function T(A,q,$){var ie=A._events;if(ie===void 0)return[];var fe=ie[q];return fe===void 0?[]:typeof fe=="function"?$?[fe.listener||fe]:[fe]:$?V(fe):z(fe,fe.length)}d.prototype.listeners=function(A){return T(this,A,!0)},d.prototype.rawListeners=function(A){return T(this,A,!1)},d.listenerCount=function(A,q){return typeof A.listenerCount=="function"?A.listenerCount(q):M.call(A,q)},d.prototype.listenerCount=M;function M(A){var q=this._events;if(q!==void 0){var $=q[A];if(typeof $=="function")return 1;if($!==void 0)return $.length}return 0}d.prototype.eventNames=function(){return this._eventsCount>0?s(this._events):[]};function z(A,q){for(var $=Array(q),ie=0;ie<q;++ie)$[ie]=A[ie];return $}function B(A,q){for(;q+1<A.length;q++)A[q]=A[q+1];A.pop()}function V(A){for(var q=Array(A.length),$=0;$<q.length;++$)q[$]=A[$].listener||A[$];return q}function N(A,q){return new Promise(function($,ie){function fe(ve){A.removeListener(q,me),ie(ve)}function me(){typeof A.removeListener=="function"&&A.removeListener("error",fe),$([].slice.call(arguments))}ce(A,q,me,{once:!0}),q!=="error"&&X(A,fe,{once:!0})})}function X(A,q,$){typeof A.on=="function"&&ce(A,"error",q,$)}function ce(A,q,$,ie){if(typeof A.on=="function")ie.once?A.once(q,$):A.on(q,$);else if(typeof A.addEventListener=="function")A.addEventListener(q,function fe(me){ie.once&&A.removeEventListener(q,fe),$(me)});else throw TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof A)}})),qg=rt((e=>{var t=e&&e.__awaiter||function(s,c,f,d){function m(b){return b instanceof f?b:new f(function(w){w(b)})}return new(f||(f=Promise))(function(b,w){function x(T){try{E(d.next(T))}catch(M){w(M)}}function S(T){try{E(d.throw(T))}catch(M){w(M)}}function E(T){T.done?b(T.value):m(T.value).then(x,S)}E((d=d.apply(s,c||[])).next())})},a=e&&e.__generator||function(s,c){var f={label:0,sent:function(){if(b[0]&1)throw b[1];return b[1]},trys:[],ops:[]},d,m,b,w;return w={next:x(0),throw:x(1),return:x(2)},typeof Symbol=="function"&&(w[Symbol.iterator]=function(){return this}),w;function x(E){return function(T){return S([E,T])}}function S(E){if(d)throw TypeError("Generator is already executing.");for(;f;)try{if(d=1,m&&(b=E[0]&2?m.return:E[0]?m.throw||((b=m.return)&&b.call(m),0):m.next)&&!(b=b.call(m,E[1])).done)return b;switch(m=0,b&&(E=[E[0]&2,b.value]),E[0]){case 0:case 1:b=E;break;case 4:return f.label++,{value:E[1],done:!1};case 5:f.label++,m=E[1],E=[0];continue;case 7:E=f.ops.pop(),f.trys.pop();continue;default:if(b=f.trys,!(b=b.length>0&&b[b.length-1])&&(E[0]===6||E[0]===2)){f=0;continue}if(E[0]===3&&(!b||E[1]>b[0]&&E[1]<b[3])){f.label=E[1];break}if(E[0]===6&&f.label<b[1]){f.label=b[1],b=E;break}if(b&&f.label<b[2]){f.label=b[2],f.ops.push(E);break}b[2]&&f.ops.pop(),f.trys.pop();continue}E=c.call(s,f)}catch(T){E=[6,T],m=0}finally{d=b=0}if(E[0]&5)throw E[1];return{value:E[0]?E[1]:void 0,done:!0}}};Object.defineProperty(e,"__esModule",{value:!0}),e.defaultNextRequest=void 0;var o=sf();e.defaultNextRequest=function(){var s=-1;return function(){return++s}},e.default=(function(){function s(c,f){f===void 0&&(f=e.defaultNextRequest()),this.batch=[],this.batchStarted=!1,this.lastId=-1,this.transports=c,this.requests={},this.connectPromise=this.connect(),this.requestChannel=new o.EventEmitter,this.nextID=f}return s.prototype.connect=function(){var c=this;return Promise.all(this.transports.map(function(f){return t(c,void 0,void 0,function(){return a(this,function(d){switch(d.label){case 0:return f.subscribe("error",this.handleError.bind(this)),f.subscribe("notification",this.handleNotification.bind(this)),[4,f.connect()];case 1:return d.sent(),[2]}})})}))},s.prototype.getPrimaryTransport=function(){return this.transports[0]},s.prototype.request=function(c,f,d){return f===void 0&&(f=!1),t(this,void 0,void 0,function(){var m,b,w,x,S=this;return a(this,function(E){return m=this.nextID().toString(),b=f?null:m,w={request:this.makeRequest(c.method,c.params||[],b),internalID:m},this.batchStarted?(x=new Promise(function(T,M){S.batch.push({resolve:T,reject:M,request:w})}),[2,x]):[2,this.getPrimaryTransport().sendData(w,d)]})})},s.prototype.close=function(){this.requestChannel.removeAllListeners(),this.transports.forEach(function(c){c.unsubscribe(),c.close()})},s.prototype.startBatch=function(){this.batchStarted=!0},s.prototype.stopBatch=function(){if(this.batchStarted===!1)throw Error("cannot end that which has never started");if(this.batch.length===0){this.batchStarted=!1;return}this.getPrimaryTransport().sendData(this.batch),this.batch=[],this.batchStarted=!1},s.prototype.makeRequest=function(c,f,d){return d?{jsonrpc:"2.0",id:d,method:c,params:f}:{jsonrpc:"2.0",method:c,params:f}},s.prototype.handleError=function(c){this.requestChannel.emit("error",c)},s.prototype.handleNotification=function(c){this.requestChannel.emit("notification",c)},s})()})),oo=rt((e=>{var t=e&&e.__extends||(function(){var o=function(s,c){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,d){f.__proto__=d}||function(f,d){for(var m in d)d.hasOwnProperty(m)&&(f[m]=d[m])},o(s,c)};return function(s,c){o(s,c);function f(){this.constructor=s}s.prototype=c===null?Object.create(c):(f.prototype=c.prototype,new f)}})();Object.defineProperty(e,"__esModule",{value:!0}),e.convertJSONToRPCError=e.JSONRPCError=e.ERR_UNKNOWN=e.ERR_MISSIING_ID=e.ERR_TIMEOUT=void 0,e.ERR_TIMEOUT=7777,e.ERR_MISSIING_ID=7878,e.ERR_UNKNOWN=7979;var a=(function(o){t(s,o);function s(c,f,d){var m=this.constructor,b=o.call(this,c)||this;return b.message=c,b.code=f,b.data=d,Object.setPrototypeOf(b,m.prototype),b}return s})(Error);e.JSONRPCError=a,e.convertJSONToRPCError=function(o){if(o.error){var s=o.error,c=s.message,f=s.code,d=s.data;return new a(c,f,d)}return new a("Unknown error",e.ERR_UNKNOWN,o)}})),Fg=rt((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TransportRequestManager=void 0;var t=sf(),a=oo();e.TransportRequestManager=(function(){function o(){this.pendingRequest={},this.pendingBatchRequest={},this.transportEventChannel=new t.EventEmitter}return o.prototype.addRequest=function(s,c){return this.transportEventChannel.emit("pending",s),s instanceof Array?(this.addBatchReq(s,c),Promise.resolve()):this.addReq(s.internalID,c)},o.prototype.settlePendingRequest=function(s,c){var f=this;s.forEach(function(d){var m=f.pendingRequest[d.internalID];if(delete f.pendingBatchRequest[d.internalID],m!==void 0){if(c){m.reject(c);return}m.resolve(),(d.request.id===null||d.request.id===void 0)&&delete f.pendingRequest[d.internalID]}})},o.prototype.isPendingRequest=function(s){return this.pendingRequest.hasOwnProperty(s)},o.prototype.resolveResponse=function(s,c){c===void 0&&(c=!0);var f=s;try{return f=JSON.parse(s),this.checkJSONRPC(f)===!1?void 0:f instanceof Array?this.resolveBatch(f,c):this.resolveRes(f,c)}catch{var d=new a.JSONRPCError("Bad response format",a.ERR_UNKNOWN,s);return c&&this.transportEventChannel.emit("error",d),d}},o.prototype.addBatchReq=function(s,c){var f=this;return s.forEach(function(d){var m=d.resolve,b=d.reject,w=d.request.internalID;f.pendingBatchRequest[w]=!0,f.pendingRequest[w]={resolve:m,reject:b}}),Promise.resolve()},o.prototype.addReq=function(s,c){var f=this;return new Promise(function(d,m){c!==null&&c&&f.setRequestTimeout(s,c,m),f.pendingRequest[s]={resolve:d,reject:m}})},o.prototype.checkJSONRPC=function(s){var c=[s];return s instanceof Array&&(c=s),c.every(function(f){return f.result!==void 0||f.error!==void 0||f.method!==void 0})},o.prototype.processResult=function(s,c){if(s.error){var f=a.convertJSONToRPCError(s);c.reject(f);return}c.resolve(s.result)},o.prototype.resolveBatch=function(s,c){var f=this,d=s.map(function(m){return f.resolveRes(m,c)}).filter(function(m){return m});if(d.length>0)return d[0]},o.prototype.resolveRes=function(s,c){var f=s.id,d=s.error,m=this.pendingRequest[f];if(m){delete this.pendingRequest[f],this.processResult(s,m),this.transportEventChannel.emit("response",s);return}if(f===void 0&&d===void 0){this.transportEventChannel.emit("notification",s);return}var b;return d&&(b=a.convertJSONToRPCError(s)),c&&d&&b&&this.transportEventChannel.emit("error",b),b},o.prototype.setRequestTimeout=function(s,c,f){var d=this;setTimeout(function(){delete d.pendingRequest[s],f(new a.JSONRPCError("Request timeout request took longer than "+c+" ms to resolve",a.ERR_TIMEOUT))},c)},o})()})),ai=rt((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Transport=void 0;var t=Fg();e.Transport=(function(){function a(){this.transportRequestManager=new t.TransportRequestManager,this.transportRequestManager.transportEventChannel.on("error",function(){})}return a.prototype.subscribe=function(o,s){this.transportRequestManager.transportEventChannel.addListener(o,s)},a.prototype.unsubscribe=function(o,s){if(!o)return this.transportRequestManager.transportEventChannel.removeAllListeners();o&&s&&this.transportRequestManager.transportEventChannel.removeListener(o,s)},a.prototype.parseData=function(o){return o instanceof Array?o.map(function(s){return s.request.request}):o.request},a})()})),so=rt((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getNotifications=e.getBatchRequests=e.isNotification=void 0,e.isNotification=function(t){return t.request.id===void 0||t.request.id===null},e.getBatchRequests=function(t){return t instanceof Array?t.filter(function(a){return a.request.request.id!=null}).map(function(a){return a.request}):[]},e.getNotifications=function(t){return t instanceof Array?t.filter(function(a){return e.isNotification(a.request)}).map(function(a){return a.request}):e.isNotification(t)?[t]:[]}})),Bg=rt((e=>{var t=e&&e.__extends||(function(){var c=function(f,d){return c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(m,b){m.__proto__=b}||function(m,b){for(var w in b)b.hasOwnProperty(w)&&(m[w]=b[w])},c(f,d)};return function(f,d){c(f,d);function m(){this.constructor=f}f.prototype=d===null?Object.create(d):(m.prototype=d.prototype,new m)}})();Object.defineProperty(e,"__esModule",{value:!0});var a=ai(),o=so(),s=oo();e.default=(function(c){t(f,c);function f(d,m,b){var w=c.call(this)||this;return w.connection=d,w.reqUri=m,w.resUri=b,w}return f.prototype.connect=function(){var d=this;return this.connection.on(this.resUri,function(m){d.transportRequestManager.resolveResponse(m)}),Promise.resolve()},f.prototype.sendData=function(d,m){m===void 0&&(m=null);var b=this.transportRequestManager.addRequest(d,m),w=o.getNotifications(d),x=this.parseData(d);try{return this.connection.emit(this.reqUri,x),this.transportRequestManager.settlePendingRequest(w),b}catch(E){var S=new s.JSONRPCError(E.message,s.ERR_UNKNOWN,E);return this.transportRequestManager.settlePendingRequest(w,S),Promise.reject(S)}},f.prototype.close=function(){this.connection.removeAllListeners()},f})(a.Transport)}));function zC(e){return e&&DataView.prototype.isPrototypeOf(e)}function lo(e){if(typeof e!="string"&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||e==="")throw TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function lf(e){return typeof e!="string"&&(e=String(e)),e}function cf(e){var t={next:function(){var a=e.shift();return{done:a===void 0,value:a}}};return sn.iterable&&(t[Symbol.iterator]=function(){return t}),t}function Ft(e){this.map={},e instanceof Ft?e.forEach(function(t,a){this.append(a,t)},this):Array.isArray(e)?e.forEach(function(t){if(t.length!=2)throw TypeError("Headers constructor: expected name/value pair to be length 2, found"+t.length);this.append(t[0],t[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function uf(e){if(!e._noBody){if(e.bodyUsed)return Promise.reject(TypeError("Already read"));e.bodyUsed=!0}}function Vg(e){return new Promise(function(t,a){e.onload=function(){t(e.result)},e.onerror=function(){a(e.error)}})}function qC(e){var t=new FileReader,a=Vg(t);return t.readAsArrayBuffer(e),a}function FC(e){var t=new FileReader,a=Vg(t),o=/charset=([A-Za-z0-9_-]+)/.exec(e.type),s=o?o[1]:"utf-8";return t.readAsText(e,s),a}function BC(e){for(var t=new Uint8Array(e),a=Array(t.length),o=0;o<t.length;o++)a[o]=String.fromCharCode(t[o]);return a.join("")}function Hg(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function $g(){return this.bodyUsed=!1,this._initBody=function(e){this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?typeof e=="string"?this._bodyText=e:sn.blob&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:sn.formData&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:sn.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():sn.arrayBuffer&&sn.blob&&zC(e)?(this._bodyArrayBuffer=Hg(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):sn.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||Kg(e))?this._bodyArrayBuffer=Hg(e):this._bodyText=e=Object.prototype.toString.call(e):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||(typeof e=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):sn.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},sn.blob&&(this.blob=function(){var e=uf(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer)return uf(this)||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer));if(sn.blob)return this.blob().then(qC);throw Error("could not read as ArrayBuffer")},this.text=function(){var e=uf(this);if(e)return e;if(this._bodyBlob)return FC(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(BC(this._bodyArrayBuffer));if(this._bodyFormData)throw Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},sn.formData&&(this.formData=function(){return this.text().then(HC)}),this.json=function(){return this.text().then(JSON.parse)},this}function VC(e){var t=e.toUpperCase();return Qg.indexOf(t)>-1?t:e}function ci(e,t){if(!(this instanceof ci))throw TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');t||(t={});var a=t.body;if(e instanceof ci){if(e.bodyUsed)throw TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new Ft(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,!a&&e._bodyInit!=null&&(a=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",(t.headers||!this.headers)&&(this.headers=new Ft(t.headers)),this.method=VC(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal||(function(){if("AbortController"in Wt)return new AbortController().signal})(),this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&a)throw TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(a),(this.method==="GET"||this.method==="HEAD")&&(t.cache==="no-store"||t.cache==="no-cache")){var o=/([?&])_=[^&]*/;o.test(this.url)?this.url=this.url.replace(o,"$1_="+new Date().getTime()):this.url+=(/\?/.test(this.url)?"&":"?")+"_="+new Date().getTime()}}function HC(e){var t=new FormData;return e.trim().split("&").forEach(function(a){if(a){var o=a.split("="),s=o.shift().replace(/\+/g," "),c=o.join("=").replace(/\+/g," ");t.append(decodeURIComponent(s),decodeURIComponent(c))}}),t}function $C(e){var t=new Ft;return e.replace(/\r?\n[\t ]+/g," ").split("\r").map(function(a){return a.indexOf(`
14
- `)===0?a.substr(1,a.length):a}).forEach(function(a){var o=a.split(":"),s=o.shift().trim();if(s){var c=o.join(":").trim();try{t.append(s,c)}catch(f){console.warn("Response "+f.message)}}}),t}function Cr(e,t){if(!(this instanceof Cr))throw TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(t||(t={}),this.type="default",this.status=t.status===void 0?200:t.status,this.status<200||this.status>599)throw RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=t.statusText===void 0?"":""+t.statusText,this.headers=new Ft(t.headers),this.url=t.url||"",this._initBody(e)}function Wg(e,t){return new Promise(function(a,o){var s=new ci(e,t);if(s.signal&&s.signal.aborted)return o(new ba("Aborted","AbortError"));var c=new XMLHttpRequest;function f(){c.abort()}c.onload=function(){var b={statusText:c.statusText,headers:$C(c.getAllResponseHeaders()||"")};s.url.indexOf("file://")===0&&(c.status<200||c.status>599)?b.status=200:b.status=c.status,b.url="responseURL"in c?c.responseURL:b.headers.get("X-Request-URL");var w="response"in c?c.response:c.responseText;setTimeout(function(){a(new Cr(w,b))},0)},c.onerror=function(){setTimeout(function(){o(TypeError("Network request failed"))},0)},c.ontimeout=function(){setTimeout(function(){o(TypeError("Network request timed out"))},0)},c.onabort=function(){setTimeout(function(){o(new ba("Aborted","AbortError"))},0)};function d(b){try{return b===""&&Wt.location.href?Wt.location.href:b}catch{return b}}if(c.open(s.method,d(s.url),!0),s.credentials==="include"?c.withCredentials=!0:s.credentials==="omit"&&(c.withCredentials=!1),"responseType"in c&&(sn.blob?c.responseType="blob":sn.arrayBuffer&&(c.responseType="arraybuffer")),t&&typeof t.headers=="object"&&!(t.headers instanceof Ft||Wt.Headers&&t.headers instanceof Wt.Headers)){var m=[];Object.getOwnPropertyNames(t.headers).forEach(function(b){m.push(lo(b)),c.setRequestHeader(b,lf(t.headers[b]))}),s.headers.forEach(function(b,w){m.indexOf(w)===-1&&c.setRequestHeader(w,b)})}else s.headers.forEach(function(b,w){c.setRequestHeader(w,b)});s.signal&&(s.signal.addEventListener("abort",f),c.onreadystatechange=function(){c.readyState===4&&s.signal.removeEventListener("abort",f)}),c.send(s._bodyInit===void 0?null:s._bodyInit)})}let Wt,sn,Ug,Kg,Qg,Gg,ba,Jg,Xg,Yg,Zg,ui,ey,ty,ny,ry,ay,iy;Jg=Xw((()=>{Wt=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof global<"u"&&global||{},sn={searchParams:"URLSearchParams"in Wt,iterable:"Symbol"in Wt&&"iterator"in Symbol,blob:"FileReader"in Wt&&"Blob"in Wt&&(function(){try{return new Blob,!0}catch{return!1}})(),formData:"FormData"in Wt,arrayBuffer:"ArrayBuffer"in Wt},sn.arrayBuffer&&(Ug=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],Kg=ArrayBuffer.isView||function(e){return e&&Ug.indexOf(Object.prototype.toString.call(e))>-1}),Ft.prototype.append=function(e,t){e=lo(e),t=lf(t);var a=this.map[e];this.map[e]=a?a+", "+t:t},Ft.prototype.delete=function(e){delete this.map[lo(e)]},Ft.prototype.get=function(e){return e=lo(e),this.has(e)?this.map[e]:null},Ft.prototype.has=function(e){return this.map.hasOwnProperty(lo(e))},Ft.prototype.set=function(e,t){this.map[lo(e)]=lf(t)},Ft.prototype.forEach=function(e,t){for(var a in this.map)this.map.hasOwnProperty(a)&&e.call(t,this.map[a],a,this)},Ft.prototype.keys=function(){var e=[];return this.forEach(function(t,a){e.push(a)}),cf(e)},Ft.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),cf(e)},Ft.prototype.entries=function(){var e=[];return this.forEach(function(t,a){e.push([a,t])}),cf(e)},sn.iterable&&(Ft.prototype[Symbol.iterator]=Ft.prototype.entries),Qg=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"],ci.prototype.clone=function(){return new ci(this,{body:this._bodyInit})},$g.call(ci.prototype),$g.call(Cr.prototype),Cr.prototype.clone=function(){return new Cr(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new Ft(this.headers),url:this.url})},Cr.error=function(){var e=new Cr(null,{status:200,statusText:""});return e.ok=!1,e.status=0,e.type="error",e},Gg=[301,302,303,307,308],Cr.redirect=function(e,t){if(Gg.indexOf(t)===-1)throw RangeError("Invalid status code");return new Cr(null,{status:t,headers:{location:e}})},ba=Wt.DOMException;try{new ba}catch{ba=function(e,t){this.message=e,this.name=t,this.stack=Error(e).stack},ba.prototype=Object.create(Error.prototype),ba.prototype.constructor=ba}Wg.polyfill=!0,Wt.fetch||(Wt.fetch=Wg,Wt.Headers=Ft,Wt.Request=ci,Wt.Response=Cr)})),Xg=rt(((e,t)=>{Jg(),t.exports=self.fetch.bind(self)})),Yg=rt((e=>{var t=e&&e.__extends||(function(){var w=function(x,S){return w=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(E,T){E.__proto__=T}||function(E,T){for(var M in T)T.hasOwnProperty(M)&&(E[M]=T[M])},w(x,S)};return function(x,S){w(x,S);function E(){this.constructor=x}x.prototype=S===null?Object.create(S):(E.prototype=S.prototype,new E)}})(),a=e&&e.__awaiter||function(w,x,S,E){function T(M){return M instanceof S?M:new S(function(z){z(M)})}return new(S||(S=Promise))(function(M,z){function B(X){try{N(E.next(X))}catch(ce){z(ce)}}function V(X){try{N(E.throw(X))}catch(ce){z(ce)}}function N(X){X.done?M(X.value):T(X.value).then(B,V)}N((E=E.apply(w,x||[])).next())})},o=e&&e.__generator||function(w,x){var S={label:0,sent:function(){if(M[0]&1)throw M[1];return M[1]},trys:[],ops:[]},E,T,M,z;return z={next:B(0),throw:B(1),return:B(2)},typeof Symbol=="function"&&(z[Symbol.iterator]=function(){return this}),z;function B(N){return function(X){return V([N,X])}}function V(N){if(E)throw TypeError("Generator is already executing.");for(;S;)try{if(E=1,T&&(M=N[0]&2?T.return:N[0]?T.throw||((M=T.return)&&M.call(T),0):T.next)&&!(M=M.call(T,N[1])).done)return M;switch(T=0,M&&(N=[N[0]&2,M.value]),N[0]){case 0:case 1:M=N;break;case 4:return S.label++,{value:N[1],done:!1};case 5:S.label++,T=N[1],N=[0];continue;case 7:N=S.ops.pop(),S.trys.pop();continue;default:if(M=S.trys,!(M=M.length>0&&M[M.length-1])&&(N[0]===6||N[0]===2)){S=0;continue}if(N[0]===3&&(!M||N[1]>M[0]&&N[1]<M[3])){S.label=N[1];break}if(N[0]===6&&S.label<M[1]){S.label=M[1],M=N;break}if(M&&S.label<M[2]){S.label=M[2],S.ops.push(N);break}M[2]&&S.ops.pop(),S.trys.pop();continue}N=x.call(w,S)}catch(X){N=[6,X],T=0}finally{E=M=0}if(N[0]&5)throw N[1];return{value:N[0]?N[1]:void 0,done:!0}}},s=e&&e.__importDefault||function(w){return w&&w.__esModule?w:{default:w}};Object.defineProperty(e,"__esModule",{value:!0}),e.HTTPTransport=void 0;var c=s(Xg()),f=ai(),d=so(),m=oo(),b=(function(w){t(x,w);function x(S,E){var T=w.call(this)||this;return T.onlyNotifications=function(M){return M instanceof Array?M.every(function(z){return z.request.request.id===null||z.request.request.id===void 0}):M.request.id===null||M.request.id===void 0},T.uri=S,T.credentials=E&&E.credentials,T.headers=x.setupHeaders(E&&E.headers),T.injectedFetcher=E==null?void 0:E.fetcher,T}return x.prototype.connect=function(){return Promise.resolve()},x.prototype.sendData=function(S,E){return E===void 0&&(E=null),a(this,void 0,void 0,function(){var T,M,z,B,V,N,ce,X,ce;return o(this,function(A){switch(A.label){case 0:T=this.transportRequestManager.addRequest(S,E),M=d.getNotifications(S),z=d.getBatchRequests(S),B=this.injectedFetcher||c.default,A.label=1;case 1:return A.trys.push([1,4,,5]),[4,B(this.uri,{method:"POST",headers:this.headers,body:JSON.stringify(this.parseData(S)),credentials:this.credentials})];case 2:return V=A.sent(),this.transportRequestManager.settlePendingRequest(M),this.onlyNotifications(S)?[2,Promise.resolve()]:[4,V.text()];case 3:return N=A.sent(),ce=this.transportRequestManager.resolveResponse(N),ce?(this.transportRequestManager.settlePendingRequest(z,ce),[2,Promise.reject(ce)]):[3,5];case 4:return X=A.sent(),ce=new m.JSONRPCError(X.message,m.ERR_UNKNOWN,X),this.transportRequestManager.settlePendingRequest(M,ce),this.transportRequestManager.settlePendingRequest(d.getBatchRequests(S),ce),[2,Promise.reject(ce)];case 5:return[2,T]}})})},x.prototype.close=function(){},x.setupHeaders=function(S){var E=new Headers(S);return E.set("Content-Type","application/json"),E},x})(f.Transport);e.HTTPTransport=b,e.default=b})),Zg=JI({default:()=>ey},1),ty=Xw((()=>{ui=null,typeof WebSocket<"u"?ui=WebSocket:typeof MozWebSocket<"u"?ui=MozWebSocket:typeof global<"u"?ui=global.WebSocket||global.MozWebSocket:typeof window<"u"?ui=window.WebSocket||window.MozWebSocket:typeof self<"u"&&(ui=self.WebSocket||self.MozWebSocket),ey=ui})),ny=rt((e=>{var t=e&&e.__extends||(function(){var b=function(w,x){return b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(S,E){S.__proto__=E}||function(S,E){for(var T in E)E.hasOwnProperty(T)&&(S[T]=E[T])},b(w,x)};return function(w,x){b(w,x);function S(){this.constructor=w}w.prototype=x===null?Object.create(x):(S.prototype=x.prototype,new S)}})(),a=e&&e.__awaiter||function(b,w,x,S){function E(T){return T instanceof x?T:new x(function(M){M(T)})}return new(x||(x=Promise))(function(T,M){function z(N){try{V(S.next(N))}catch(X){M(X)}}function B(N){try{V(S.throw(N))}catch(X){M(X)}}function V(N){N.done?T(N.value):E(N.value).then(z,B)}V((S=S.apply(b,w||[])).next())})},o=e&&e.__generator||function(b,w){var x={label:0,sent:function(){if(T[0]&1)throw T[1];return T[1]},trys:[],ops:[]},S,E,T,M;return M={next:z(0),throw:z(1),return:z(2)},typeof Symbol=="function"&&(M[Symbol.iterator]=function(){return this}),M;function z(V){return function(N){return B([V,N])}}function B(V){if(S)throw TypeError("Generator is already executing.");for(;x;)try{if(S=1,E&&(T=V[0]&2?E.return:V[0]?E.throw||((T=E.return)&&T.call(E),0):E.next)&&!(T=T.call(E,V[1])).done)return T;switch(E=0,T&&(V=[V[0]&2,T.value]),V[0]){case 0:case 1:T=V;break;case 4:return x.label++,{value:V[1],done:!1};case 5:x.label++,E=V[1],V=[0];continue;case 7:V=x.ops.pop(),x.trys.pop();continue;default:if(T=x.trys,!(T=T.length>0&&T[T.length-1])&&(V[0]===6||V[0]===2)){x=0;continue}if(V[0]===3&&(!T||V[1]>T[0]&&V[1]<T[3])){x.label=V[1];break}if(V[0]===6&&x.label<T[1]){x.label=T[1],T=V;break}if(T&&x.label<T[2]){x.label=T[2],x.ops.push(V);break}T[2]&&x.ops.pop(),x.trys.pop();continue}V=w.call(b,x)}catch(N){V=[6,N],E=0}finally{S=T=0}if(V[0]&5)throw V[1];return{value:V[0]?V[1]:void 0,done:!0}}},s=e&&e.__importDefault||function(b){return b&&b.__esModule?b:{default:b}};Object.defineProperty(e,"__esModule",{value:!0});var c=s((ty(),QI(Zg))),f=ai(),d=so(),m=oo();e.default=(function(b){t(w,b);function w(x){var S=b.call(this)||this;return S.uri=x,S.connection=new c.default(x),S}return w.prototype.connect=function(){var x=this;return new Promise(function(S,E){var T=function(){x.connection.removeEventListener("open",T),S()};x.connection.addEventListener("open",T),x.connection.addEventListener("message",function(M){var z=M.data;x.transportRequestManager.resolveResponse(z)})})},w.prototype.sendData=function(x,S){return S===void 0&&(S=5e3),a(this,void 0,void 0,function(){var E,T,M;return o(this,function(z){E=this.transportRequestManager.addRequest(x,S),T=d.getNotifications(x);try{this.connection.send(JSON.stringify(this.parseData(x))),this.transportRequestManager.settlePendingRequest(T)}catch(B){M=new m.JSONRPCError(B.message,m.ERR_UNKNOWN,B),this.transportRequestManager.settlePendingRequest(T,M),this.transportRequestManager.settlePendingRequest(d.getBatchRequests(x),M),E=Promise.reject(M)}return[2,E]})})},w.prototype.close=function(){this.connection.close()},w})(f.Transport)})),ry=rt((e=>{var t=e&&e.__extends||(function(){var d=function(m,b){return d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,x){w.__proto__=x}||function(w,x){for(var S in x)x.hasOwnProperty(S)&&(w[S]=x[S])},d(m,b)};return function(m,b){d(m,b);function w(){this.constructor=m}m.prototype=b===null?Object.create(b):(w.prototype=b.prototype,new w)}})(),a=e&&e.__awaiter||function(d,m,b,w){function x(S){return S instanceof b?S:new b(function(E){E(S)})}return new(b||(b=Promise))(function(S,E){function T(B){try{z(w.next(B))}catch(V){E(V)}}function M(B){try{z(w.throw(B))}catch(V){E(V)}}function z(B){B.done?S(B.value):x(B.value).then(T,M)}z((w=w.apply(d,m||[])).next())})},o=e&&e.__generator||function(d,m){var b={label:0,sent:function(){if(S[0]&1)throw S[1];return S[1]},trys:[],ops:[]},w,x,S,E;return E={next:T(0),throw:T(1),return:T(2)},typeof Symbol=="function"&&(E[Symbol.iterator]=function(){return this}),E;function T(z){return function(B){return M([z,B])}}function M(z){if(w)throw TypeError("Generator is already executing.");for(;b;)try{if(w=1,x&&(S=z[0]&2?x.return:z[0]?x.throw||((S=x.return)&&S.call(x),0):x.next)&&!(S=S.call(x,z[1])).done)return S;switch(x=0,S&&(z=[z[0]&2,S.value]),z[0]){case 0:case 1:S=z;break;case 4:return b.label++,{value:z[1],done:!1};case 5:b.label++,x=z[1],z=[0];continue;case 7:z=b.ops.pop(),b.trys.pop();continue;default:if(S=b.trys,!(S=S.length>0&&S[S.length-1])&&(z[0]===6||z[0]===2)){b=0;continue}if(z[0]===3&&(!S||z[1]>S[0]&&z[1]<S[3])){b.label=z[1];break}if(z[0]===6&&b.label<S[1]){b.label=S[1],S=z;break}if(S&&b.label<S[2]){b.label=S[2],b.ops.push(z);break}S[2]&&b.ops.pop(),b.trys.pop();continue}z=m.call(d,b)}catch(B){z=[6,B],x=0}finally{w=S=0}if(z[0]&5)throw z[1];return{value:z[0]?z[1]:void 0,done:!0}}};Object.defineProperty(e,"__esModule",{value:!0});var s=ai(),c=so(),f=function(d){var m=400,b=window.screen.height;return window.open(d,"inspector:popup","left=0,top=0,width="+m+",height="+b+",resizable,scrollbars=yes,status=1")};e.default=(function(d){t(m,d);function m(b){var w=d.call(this)||this;return w.messageHandler=function(x){w.transportRequestManager.resolveResponse(JSON.stringify(x.data))},w.uri=b,w.postMessageID="post-message-transport-"+Math.random(),w}return m.prototype.createWindow=function(b){return new Promise(function(w,x){var S=f(b);setTimeout(function(){w(S)},3e3)})},m.prototype.connect=function(){var b=this,w=/^(http|https):\/\/.*$/;return new Promise(function(x,S){return a(b,void 0,void 0,function(){var E;return o(this,function(T){switch(T.label){case 0:return w.test(this.uri)||S(Error("Bad URI")),E=this,[4,this.createWindow(this.uri)];case 1:return E.frame=T.sent(),window.addEventListener("message",this.messageHandler),x(),[2]}})})})},m.prototype.sendData=function(b,w){return w===void 0&&(w=5e3),a(this,void 0,void 0,function(){var x,S;return o(this,function(E){return x=this.transportRequestManager.addRequest(b,null),S=c.getNotifications(b),this.frame&&(this.frame.postMessage(b.request,this.uri),this.transportRequestManager.settlePendingRequest(S)),[2,x]})})},m.prototype.close=function(){this.frame&&(window.removeEventListener("message",this.messageHandler),this.frame.close())},m})(s.Transport)})),ay=rt((e=>{var t=e&&e.__extends||(function(){var f=function(d,m){return f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,w){b.__proto__=w}||function(b,w){for(var x in w)w.hasOwnProperty(x)&&(b[x]=w[x])},f(d,m)};return function(d,m){f(d,m);function b(){this.constructor=d}d.prototype=m===null?Object.create(m):(b.prototype=m.prototype,new b)}})(),a=e&&e.__awaiter||function(f,d,m,b){function w(x){return x instanceof m?x:new m(function(S){S(x)})}return new(m||(m=Promise))(function(x,S){function E(z){try{M(b.next(z))}catch(B){S(B)}}function T(z){try{M(b.throw(z))}catch(B){S(B)}}function M(z){z.done?x(z.value):w(z.value).then(E,T)}M((b=b.apply(f,d||[])).next())})},o=e&&e.__generator||function(f,d){var m={label:0,sent:function(){if(x[0]&1)throw x[1];return x[1]},trys:[],ops:[]},b,w,x,S;return S={next:E(0),throw:E(1),return:E(2)},typeof Symbol=="function"&&(S[Symbol.iterator]=function(){return this}),S;function E(M){return function(z){return T([M,z])}}function T(M){if(b)throw TypeError("Generator is already executing.");for(;m;)try{if(b=1,w&&(x=M[0]&2?w.return:M[0]?w.throw||((x=w.return)&&x.call(w),0):w.next)&&!(x=x.call(w,M[1])).done)return x;switch(w=0,x&&(M=[M[0]&2,x.value]),M[0]){case 0:case 1:x=M;break;case 4:return m.label++,{value:M[1],done:!1};case 5:m.label++,w=M[1],M=[0];continue;case 7:M=m.ops.pop(),m.trys.pop();continue;default:if(x=m.trys,!(x=x.length>0&&x[x.length-1])&&(M[0]===6||M[0]===2)){m=0;continue}if(M[0]===3&&(!x||M[1]>x[0]&&M[1]<x[3])){m.label=M[1];break}if(M[0]===6&&m.label<x[1]){m.label=x[1],x=M;break}if(x&&m.label<x[2]){m.label=x[2],m.ops.push(M);break}x[2]&&m.ops.pop(),m.trys.pop();continue}M=d.call(f,m)}catch(z){M=[6,z],w=0}finally{b=x=0}if(M[0]&5)throw M[1];return{value:M[0]?M[1]:void 0,done:!0}}};Object.defineProperty(e,"__esModule",{value:!0});var s=ai(),c=so();e.default=(function(f){t(d,f);function d(m){var b=f.call(this)||this;return b.messageHandler=function(w){b.transportRequestManager.resolveResponse(JSON.stringify(w.data))},b.uri=m,b.postMessageID="post-message-transport-"+Math.random(),b}return d.prototype.createWindow=function(m){var b=this;return new Promise(function(w,x){var S,E=document.createElement("iframe");E.setAttribute("id",b.postMessageID),E.setAttribute("width","0px"),E.setAttribute("height","0px"),E.setAttribute("style","visiblity:hidden;border:none;outline:none;"),E.addEventListener("load",function(){w(S)}),E.setAttribute("src",m),window.document.body.appendChild(E),S=E.contentWindow})},d.prototype.connect=function(){var m=this,b=/^(http|https):\/\/.*$/;return new Promise(function(w,x){return a(m,void 0,void 0,function(){var S;return o(this,function(E){switch(E.label){case 0:return b.test(this.uri)||x(Error("Bad URI")),S=this,[4,this.createWindow(this.uri)];case 1:return S.frame=E.sent(),window.addEventListener("message",this.messageHandler),w(),[2]}})})})},d.prototype.sendData=function(m,b){return b===void 0&&(b=5e3),a(this,void 0,void 0,function(){var w,x;return o(this,function(S){return w=this.transportRequestManager.addRequest(m,null),x=c.getNotifications(m),this.frame&&(this.frame.postMessage(m.request,"*"),this.transportRequestManager.settlePendingRequest(x)),[2,w]})})},d.prototype.close=function(){var m;(m=document.getElementById(this.postMessageID))==null||m.remove(),window.removeEventListener("message",this.messageHandler)},d})(s.Transport)})),iy=rt((e=>{var t=e&&e.__awaiter||function(o,s,c,f){function d(m){return m instanceof c?m:new c(function(b){b(m)})}return new(c||(c=Promise))(function(m,b){function w(E){try{S(f.next(E))}catch(T){b(T)}}function x(E){try{S(f.throw(E))}catch(T){b(T)}}function S(E){E.done?m(E.value):d(E.value).then(w,x)}S((f=f.apply(o,s||[])).next())})},a=e&&e.__generator||function(o,s){var c={label:0,sent:function(){if(m[0]&1)throw m[1];return m[1]},trys:[],ops:[]},f,d,m,b;return b={next:w(0),throw:w(1),return:w(2)},typeof Symbol=="function"&&(b[Symbol.iterator]=function(){return this}),b;function w(S){return function(E){return x([S,E])}}function x(S){if(f)throw TypeError("Generator is already executing.");for(;c;)try{if(f=1,d&&(m=S[0]&2?d.return:S[0]?d.throw||((m=d.return)&&m.call(d),0):d.next)&&!(m=m.call(d,S[1])).done)return m;switch(d=0,m&&(S=[S[0]&2,m.value]),S[0]){case 0:case 1:m=S;break;case 4:return c.label++,{value:S[1],done:!1};case 5:c.label++,d=S[1],S=[0];continue;case 7:S=c.ops.pop(),c.trys.pop();continue;default:if(m=c.trys,!(m=m.length>0&&m[m.length-1])&&(S[0]===6||S[0]===2)){c=0;continue}if(S[0]===3&&(!m||S[1]>m[0]&&S[1]<m[3])){c.label=S[1];break}if(S[0]===6&&c.label<m[1]){c.label=m[1],m=S;break}if(m&&c.label<m[2]){c.label=m[2],c.ops.push(S);break}m[2]&&c.ops.pop(),c.trys.pop();continue}S=s.call(o,c)}catch(E){S=[6,E],d=0}finally{f=m=0}if(S[0]&5)throw S[1];return{value:S[0]?S[1]:void 0,done:!0}}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=(function(){function o(s){this.requestManager=s}return o.prototype.startBatch=function(){return this.requestManager.startBatch()},o.prototype.stopBatch=function(){return this.requestManager.stopBatch()},o.prototype.request=function(s,c){return t(this,void 0,void 0,function(){return a(this,function(f){switch(f.label){case 0:return this.requestManager.connectPromise?[4,this.requestManager.connectPromise]:[3,2];case 1:f.sent(),f.label=2;case 2:return[2,this.requestManager.request(s,!1,c)]}})})},o.prototype.notify=function(s){return t(this,void 0,void 0,function(){return a(this,function(c){switch(c.label){case 0:return this.requestManager.connectPromise?[4,this.requestManager.connectPromise]:[3,2];case 1:c.sent(),c.label=2;case 2:return[2,this.requestManager.request(s,!0,null)]}})})},o.prototype.onNotification=function(s){this.requestManager.requestChannel.addListener("notification",s)},o.prototype.onError=function(s){this.requestManager.requestChannel.addListener("error",s)},o.prototype.close=function(){this.requestManager.close()},o})()})),Pl=rt((e=>{var t=e&&e.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(e,"__esModule",{value:!0}),e.PostMessageIframeTransport=e.PostMessageWindowTransport=e.JSONRPCError=e.WebSocketTransport=e.EventEmitterTransport=e.HTTPTransport=e.RequestManager=e.Client=void 0,e.RequestManager=t(qg()).default,e.EventEmitterTransport=t(Bg()).default,e.HTTPTransport=t(Yg()).default,e.WebSocketTransport=t(ny()).default,e.PostMessageWindowTransport=t(ry()).default,e.PostMessageIframeTransport=t(ay()).default;var a=oo();Object.defineProperty(e,"JSONRPCError",{enumerable:!0,get:function(){return a.JSONRPCError}});var o=t(iy());e.Client=o.default,e.default=o.default}));function Ut(e,t){if(t.line>=e.lines)return t.character===0?e.length:void 0;let a=e.line(t.line+1).from+t.character;if(!(a>e.length))return a}function lr(e,t){return Ut(e,t)||0}function wa(e,t){let a=e.lineAt(t);return{character:t-a.from,line:a.number-1}}var Xl=new Yu.Renderer,WC=Xl.code;Xl.code=e=>e.text.trim()?WC.call(Xl,e):"";function oy(e){return Yu(e,{async:!1,gfm:!0,breaks:!0,renderer:Xl})}function cr(e,t=oy){if(!e)return"";if(GC(e)){let a=e.value;return e.kind==="markdown"&&(a=t(a.trim())),a}return Array.isArray(e)?e.map(a=>cr(a,t)).filter(Boolean).join(`
15
-
16
- `):typeof e=="string"?e:""}function UC(e){if(e.length===0)return"";if(e.length===1)return e[0]||"";e.sort();let t=e[0]||"",a=e[e.length-1]||"",o=0;for(;o<t.length&&t[o]===a[o];)o++;return t.substring(0,o)}function KC(e){if(e.length===0)return;let t=UC(e.map(s=>{var c;return((c=s.textEdit)==null?void 0:c.newText)||s.label}));if(t==="")return;let a=[];for(let s=0;s<t.length;s++){let c=t.slice(0,s+1);if(c.length>0){let f=c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");a.push(f)}}let o=a.join("|");return RegExp(`(${o})$`)}function QC(e){return(e==null?void 0:e.range)!==void 0}function GC(e){return e.kind!==void 0}function Ln(e,t){let a=document.createElement("div");a.className="cm-error-message",a.style.cssText=`
17
- position: absolute;
18
- padding: 8px;
19
- background: #fee;
20
- border: 1px solid #fcc;
21
- border-radius: 4px;
22
- color: #c00;
23
- font-size: 14px;
24
- z-index: 100;
25
- max-width: 300px;
26
- box-shadow: 0 2px 8px rgba(0,0,0,.15);
27
- `,a.textContent=t;let o=e.coordsAtPos(e.state.selection.main.head);o&&(a.style.left=`${o.left}px`,a.style.top=`${o.bottom+5}px`),document.body.appendChild(a),setTimeout(()=>{a.style.opacity="0",a.style.transition="opacity 0.2s",setTimeout(()=>a.remove(),200)},3e3)}function Yl(e){if(e==null)return!0;if(Array.isArray(e))return e.length===0||e.every(Yl);if(typeof e=="string")return sy(e);let t=e.value;return typeof t=="string"?sy(t):!1}function sy(e){return e==null?!0:typeof e=="string"?e.trim()===""||/^[\s\n`]*$/.test(e):!1}function JC(e,t){let a=[];return t.iterChanges((o,s,c,f,d)=>{let m=d.toString();if(o===0&&s===e.length){a.push({text:m});return}let b=wa(e,o),w=wa(e,s);a.push({range:{start:b,end:w},text:m})}),a.sort((o,s)=>{if(!o.range)return 1;if(!s.range)return-1;let c=o.range.start.line??-1,f=s.range.start.line??-1;if(c!==f)return f-c;let d=o.range.start.character??-1;return(s.range.start.character??-1)-d}),a}var XC=R_(),YC=Object.fromEntries(Object.entries(XC.CompletionItemKind).map(([e,t])=>[t,e])),ly;(function(e){e.PlainText=1,e.Snippet=2})(ly||(ly={}));function ZC(e){return e.replaceAll(/\\\\/g,"").replaceAll(/(\$(\d+))/g,(t,a,o)=>"${"+o+"}")}function eS(e,t){let{detail:a,labelDetails:o,label:s,kind:c,textEdit:f,insertText:d,documentation:m,additionalTextEdits:b,insertTextFormat:w}=e,x={label:s,detail:(o==null?void 0:o.detail)||a,apply(S,E,T,M){if(f&&QC(f)?S.dispatch(L_(S.state,f.newText,lr(S.state.doc,f.range.start),lr(S.state.doc,f.range.end))):d&&w===ly.Snippet&&t.useSnippetOnCompletion?sL(ZC(d))(S,null,T,M):S.dispatch(L_(S.state,d||s,T,M)),!b)return;let z=b.sort(({range:{end:B}},{range:{end:V}})=>lr(S.state.doc,B)<lr(S.state.doc,V)?1:lr(S.state.doc,B)>lr(S.state.doc,V)?-1:0);for(let B of z)S.dispatch(S.state.update({changes:{from:lr(S.state.doc,B.range.start),to:Ut(S.state.doc,B.range.end),insert:B.newText}}))},type:c&&YC[c].toLowerCase()};return t.hasResolveProvider&&t.resolveItem?x.info=async()=>{var S;try{let E=await((S=t.resolveItem)==null?void 0:S.call(t,e)),T=document.createElement("div");T.classList.add("documentation");let M=(E==null?void 0:E.documentation)||m;return!M||Yl(M)?null:(t.allowHTMLContent?T.innerHTML=cr(M,t.markdownRenderer):T.textContent=cr(M,t.markdownRenderer),T)}catch(E){if(console.error("Failed to resolve completion item:",E),Yl(m))return null;if(m){let T=document.createElement("div");return T.classList.add("documentation"),t.allowHTMLContent?T.innerHTML=cr(m,t.markdownRenderer):T.textContent=cr(m,t.markdownRenderer),T}return null}}:m&&(x.info=()=>{let S=document.createElement("div");return S.classList.add("documentation"),t.allowHTMLContent?S.innerHTML=cr(m,t.markdownRenderer):S.textContent=cr(m,t.markdownRenderer),S}),x}function tS(e,t,a){let o=[t?nS(t):rS,a==="python"?aS:void 0].filter(Boolean),s=e;if(t){let c=t.toLowerCase();/^\w+$/.test(c)&&(s=s.filter(({label:f,filterText:d})=>(d??f).toLowerCase().startsWith(c)))}for(let c of o)s.sort(c);return s}function nS(e){return(t,a)=>{let o=t.sortText??t.label,s=a.sortText??a.label;switch(!0){case(o.startsWith(e)&&!s.startsWith(e)):return-1;case(!o.startsWith(e)&&s.startsWith(e)):return 1}return o.localeCompare(s)}}function rS(e,t){let a=e.sortText??e.label,o=t.sortText??t.label;return a.localeCompare(o)}function aS(e,t){let a=e.label.endsWith("="),o=t.label.endsWith("=");return a&&!o?-1:!a&&o?1:0}function cy(e){let t=new Proxy({},{get(){throw Error(e)}});return function(a){return a.at(-1)??t}}const uy=Il.define({combine:cy("No document URI provided. Either pass a one into the extension or use documentUri.of().")}),iS=Il.define({combine:cy("No language ID provided. Either pass a one into the extension or use languageId.of().")});let df,dy;df=Pl(),dy=1e4,ps=class{constructor({rootUri:e,workspaceFolders:t,transport:a,initializationOptions:o,capabilities:s,timeout:c=dy,getWorkspaceConfiguration:f}){we(this,"ready");we(this,"capabilities");we(this,"initializePromise");we(this,"rootUri");we(this,"workspaceFolders");we(this,"timeout");we(this,"transport");we(this,"requestManager");we(this,"client");we(this,"initializationOptions");we(this,"clientCapabilities");we(this,"notificationListeners",new Set);this.rootUri=e,this.workspaceFolders=t,this.transport=a,this.initializationOptions=o,this.clientCapabilities=s,this.timeout=c,this.ready=!1,this.capabilities=null,this.requestManager=new df.RequestManager([this.transport]),this.client=new df.Client(this.requestManager),this.client.onNotification(m=>{this.processNotification(m)});let d=this.transport;d!=null&&d.connection&&d.connection.addEventListener("message",m=>{let b=JSON.parse(m.data);b.method==="workspace/configuration"&&f?d.connection.send(JSON.stringify({jsonrpc:"2.0",id:b.id,result:f(b.params)})):b.method&&b.id&&d.connection.send(JSON.stringify({jsonrpc:"2.0",id:b.id,result:null}))}),this.initializePromise=this.initialize()}getInitializationOptions(){let e={textDocument:{hover:{dynamicRegistration:!0,contentFormat:["markdown","plaintext"]},moniker:{},synchronization:{dynamicRegistration:!0,willSave:!1,didSave:!1,willSaveWaitUntil:!1},codeAction:{dynamicRegistration:!0,codeActionLiteralSupport:{codeActionKind:{valueSet:["","quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}},resolveSupport:{properties:["edit"]}},completion:{dynamicRegistration:!0,completionItem:{snippetSupport:!0,commitCharactersSupport:!0,documentationFormat:["markdown","plaintext"],deprecatedSupport:!1,preselectSupport:!1},contextSupport:!1},signatureHelp:{dynamicRegistration:!0,signatureInformation:{documentationFormat:["markdown","plaintext"]}},declaration:{dynamicRegistration:!0,linkSupport:!0},definition:{dynamicRegistration:!0,linkSupport:!0},typeDefinition:{dynamicRegistration:!0,linkSupport:!0},implementation:{dynamicRegistration:!0,linkSupport:!0},rename:{dynamicRegistration:!0,prepareSupport:!0}},workspace:{didChangeConfiguration:{dynamicRegistration:!0}}};return{capabilities:this.clientCapabilities?typeof this.clientCapabilities=="function"?this.clientCapabilities(e):this.clientCapabilities:e,initializationOptions:this.initializationOptions,processId:null,rootUri:this.rootUri,workspaceFolders:this.workspaceFolders}}async initialize(){let{capabilities:e}=await this.request("initialize",this.getInitializationOptions(),this.timeout*3);this.capabilities=e,this.notify("initialized",{}),this.ready=!0}close(){this.client.close()}textDocumentDidOpen(e){return this.notify("textDocument/didOpen",e)}textDocumentDidChange(e){return this.notify("textDocument/didChange",e)}async textDocumentHover(e){return await this.request("textDocument/hover",e,this.timeout)}async textDocumentCompletion(e){return await this.request("textDocument/completion",e,this.timeout)}async completionItemResolve(e){return await this.request("completionItem/resolve",e,this.timeout)}async textDocumentDefinition(e){return await this.request("textDocument/definition",e,this.timeout)}async textDocumentCodeAction(e){return await this.request("textDocument/codeAction",e,this.timeout)}async textDocumentRename(e){return await this.request("textDocument/rename",e,this.timeout)}async textDocumentPrepareRename(e){return await this.request("textDocument/prepareRename",e,this.timeout)}async textDocumentSignatureHelp(e){return await this.request("textDocument/signatureHelp",e,this.timeout)}onNotification(e){return this.notificationListeners.add(e),()=>this.notificationListeners.delete(e)}request(e,t,a){return this.client.request({method:e,params:t},a)}notify(e,t){return this.client.notify({method:e,params:t})}processNotification(e){this.notificationListeners.forEach(t=>t(e))}},Pl();var _a=R_(),fy=console.log;function oS(){return String(Date.now()+Math.random())}let ff;Ul=_r.define(),zl=ei.define({create:()=>null,update(e,t){for(let a of t.effects)if(a.is(Ul))return a.value;if(e&&t.docChanged){let a=t.changes.mapPos(e.pos),o=e.end==null?void 0:t.changes.mapPos(e.end);return{...e,pos:a,end:o}}return e},provide:e=>g_.from(e)}),ff=y_.define();var sS=20,lS=class{constructor(e){we(this,"documentVersion");we(this,"pluginId");we(this,"client");we(this,"documentUri");we(this,"languageId");we(this,"view");we(this,"allowHTMLContent");we(this,"useSnippetOnCompletion");we(this,"sendIncrementalChanges");we(this,"featureOptions");we(this,"onGoToDefinition");we(this,"markdownRenderer");we(this,"disposeListener");we(this,"lastSeenDiagnosticsVersion",0);let{client:t,documentUri:a,languageId:o,view:s,featureOptions:c,sendIncrementalChanges:f=!0,allowHTMLContent:d=!1,useSnippetOnCompletion:m=!1,onGoToDefinition:b,markdownRenderer:w=oy}=e;this.documentVersion=0,this.pluginId=oS(),this.client=t,this.documentUri=a,this.languageId=o,this.view=s,this.allowHTMLContent=d,this.useSnippetOnCompletion=m,this.sendIncrementalChanges=f,this.featureOptions=c,this.onGoToDefinition=b,this.markdownRenderer=w,this.disposeListener=t.onNotification(this.processNotification.bind(this)),this.initialize({documentText:this.view.state.doc.toString()})}update({state:e,docChanged:t,startState:{doc:a},changes:o}){t&&(this.sendIncrementalChanges?this.sendChanges(JC(a,o)):this.sendChanges([{text:e.doc.toString()}]))}destroy(){var e;(e=this.disposeListener)==null||e.call(this)}async initialize({documentText:e}){this.client.initializePromise&&await this.client.initializePromise,await this.client.textDocumentDidOpen({textDocument:{uri:this.documentUri,languageId:this.languageId,text:e,version:this.documentVersion}})}async sendChanges(e){if(this.client.ready)try{await this.client.textDocumentDidChange({textDocument:{uri:this.documentUri,version:++this.documentVersion},contentChanges:e})}catch(t){console.error(t)}}requestDiagnostics(e){this.sendChanges([{text:e.state.doc.toString()}])}async requestHoverTooltip(e,{line:t,character:a}){var b;if(!this.featureOptions.hoverEnabled||!(this.client.ready&&((b=this.client.capabilities)!=null&&b.hoverProvider)))return null;let o=await this.client.textDocumentHover({textDocument:{uri:this.documentUri},position:{line:t,character:a}});if(!o)return null;let{contents:s,range:c}=o,f=Ut(e.state.doc,{line:t,character:a}),d;if(c&&(f=Ut(e.state.doc,c.start),d=Ut(e.state.doc,c.end)),f==null||Yl(s))return null;let m=document.createElement("div");return m.classList.add("documentation","cm-lsp-hover-tooltip"),this.allowHTMLContent?m.innerHTML=cr(s,this.markdownRenderer):m.textContent=cr(s,this.markdownRenderer),{pos:f,end:d,create:w=>({dom:m}),above:!0}}async requestCompletion(e,{line:t,character:a},{triggerKind:o,triggerCharacter:s}){var S;if(!this.featureOptions.completionEnabled||!(this.client.ready&&((S=this.client.capabilities)!=null&&S.completionProvider)))return null;let c=await this.client.textDocumentCompletion({textDocument:{uri:this.documentUri},position:{line:t,character:a},context:{triggerKind:o,triggerCharacter:s}});if(!c)return null;let f="items"in c?c.items:c,d=KC(f),m=d?e.matchBefore(d)??e.matchBefore(/[a-zA-Z0-9_]+/):e.matchBefore(/[a-zA-Z0-9_]+/),{pos:b}=e,w=tS(f,m==null?void 0:m.text,this.languageId);m&&(b=m.from);let x=w.map(E=>{var T,M;return eS(E,{allowHTMLContent:this.allowHTMLContent,useSnippetOnCompletion:this.useSnippetOnCompletion,hasResolveProvider:((M=(T=this.client.capabilities)==null?void 0:T.completionProvider)==null?void 0:M.resolveProvider)??!1,resolveItem:this.client.completionItemResolve.bind(this.client)})});return{from:b,options:x,filter:!1}}async requestDefinition(e,{line:t,character:a}){var w;if(!this.featureOptions.definitionEnabled||!(this.client.ready&&((w=this.client.capabilities)!=null&&w.definitionProvider)))return;let o=await this.client.textDocumentDefinition({textDocument:{uri:this.documentUri},position:{line:t,character:a}});if(!o)return;let s=Array.isArray(o)?o:[o];if(s.length===0)return;let c=s[0];if(!c)return;let f="uri"in c?c.uri:c.targetUri,d="range"in c?c.range:c.targetRange,m=f!==this.documentUri,b={uri:f,range:d,isExternalDocument:m};return m||e.dispatch(e.state.update({selection:{anchor:lr(e.state.doc,d.start),head:Ut(e.state.doc,d.end)}})),this.onGoToDefinition&&this.onGoToDefinition(b),b}processNotification(e){try{e.method==="textDocument/publishDiagnostics"&&this.processDiagnostics(e.params)}catch(t){fy(t)}}async processDiagnostics(e){if(e.uri!==this.documentUri)return;if(e.version!=null&&e.version>this.lastSeenDiagnosticsVersion&&(this.lastSeenDiagnosticsVersion=e.version,this.clearDiagnostics()),!this.featureOptions.diagnosticsEnabled){this.clearDiagnostics();return}let t={[_a.DiagnosticSeverity.Error]:"error",[_a.DiagnosticSeverity.Warning]:"warning",[_a.DiagnosticSeverity.Information]:"info",[_a.DiagnosticSeverity.Hint]:"info"},a=e.diagnostics.map(async({range:s,message:c,severity:f,code:d,source:m})=>{var w;let b=(w=await this.requestCodeActions(s,[d]))==null?void 0:w.map(x=>{var S;return{name:"command"in x&&typeof x.command=="object"&&((S=x.command)==null?void 0:S.title)||x.title,apply:async()=>{var E;if("edit"in x&&((E=x.edit)!=null&&E.changes)){let T=x.edit.changes[this.documentUri];if(!T)return;for(let M of T)this.view.dispatch(this.view.state.update({changes:{from:lr(this.view.state.doc,M.range.start),to:Ut(this.view.state.doc,M.range.end),insert:M.newText}}))}"command"in x&&x.command&&fy("Executing command:",x.command)}}});return{from:lr(this.view.state.doc,s.start),to:lr(this.view.state.doc,s.end),severity:t[f??_a.DiagnosticSeverity.Error],message:c,renderMessage:()=>{let x=document.createElement("div");return x.innerHTML=this.markdownRenderer(c),x},source:m||this.languageId,markClass:this.pluginId,actions:b}}),o=await Promise.all(a);this.addDiagnostics(o)}addDiagnostics(e){if(e.length===0)return;let t=this.view.state,a=[];Y8(t,c=>(a.push(c),!0));let o=new Set(e.map(c=>c.source).filter(Boolean)),s=e.filter(c=>!o.has(c.source));this.view.dispatch(T_(t,[...s,...e]))}clearDiagnostics(){this.view.dispatch(T_(this.view.state,[]))}async requestCodeActions(e,t){var a;return!this.featureOptions.codeActionsEnabled||!(this.client.ready&&((a=this.client.capabilities)!=null&&a.codeActionProvider))?null:await this.client.textDocumentCodeAction({textDocument:{uri:this.documentUri},range:e,context:{diagnostics:[{range:e,code:t[0],source:this.languageId,message:""}]}})}async requestRename(e,{line:t,character:a}){var o;if(this.featureOptions.renameEnabled){if(!this.client.ready){Ln(e,"Language server not ready");return}if(!((o=this.client.capabilities)!=null&&o.renameProvider)){Ln(e,"Rename not supported by language server");return}try{let s=await this.client.textDocumentPrepareRename({textDocument:{uri:this.documentUri},position:{line:t,character:a}}).catch(()=>this.prepareRenameFallback(e,{line:t,character:a}));if(!s||"defaultBehavior"in s){Ln(e,"Cannot rename this symbol");return}let c=document.createElement("div");c.className="cm-rename-popup",c.style.cssText="position: absolute; padding: 4px; background: white; border: 1px solid #ddd; box-shadow: 0 2px 8px rgba(0,0,0,.15); z-index: 99;";let f=document.createElement("input");f.type="text",f.style.cssText="width: 200px; padding: 4px; border: 1px solid #ddd;";let d="range"in s?s.range:s,m=Ut(e.state.doc,d.start);if(m==null)return;let b=Ut(e.state.doc,d.end);f.value=e.state.doc.sliceString(m,b),c.appendChild(f);let w=e.coordsAtPos(m);if(!w)return;c.style.left=`${w.left}px`,c.style.top=`${w.bottom+5}px`;let x=async()=>{let E=f.value.trim();if(!E){Ln(e,"New name cannot be empty"),c.remove();return}if(E===f.defaultValue){c.remove();return}try{let T=await this.client.textDocumentRename({textDocument:{uri:this.documentUri},position:{line:t,character:a},newName:E});await this.applyRenameEdit(e,T)}catch(T){Ln(e,`Rename failed: ${T instanceof Error?T.message:"Unknown error"}`)}finally{c.remove()}};f.addEventListener("keydown",E=>{E.key==="Enter"?x():E.key==="Escape"&&c.remove(),E.stopPropagation()});let S=E=>{c.contains(E.target)||(c.remove(),document.removeEventListener("mousedown",S))};document.addEventListener("mousedown",S),document.body.appendChild(c),f.focus(),f.select()}catch(s){Ln(e,`Rename failed: ${s instanceof Error?s.message:"Unknown error"}`)}}}async requestSignatureHelp(e,{line:t,character:a},o=void 0){var s,c,f;if(!(this.featureOptions.signatureHelpEnabled&&this.client.ready&&((s=this.client.capabilities)!=null&&s.signatureHelpProvider)))return null;try{let d=await this.client.textDocumentSignatureHelp({textDocument:{uri:this.documentUri},position:{line:t,character:a},context:{isRetrigger:!1,triggerKind:1,triggerCharacter:o}});if(!(d!=null&&d.signatures)||d.signatures.length===0)return null;let m=this.createTooltipContainer(),b=d.activeSignature??0,w=d.signatures[b]||d.signatures[0];if(!w)return null;let x=d.activeParameter??w.activeParameter??0,S=this.createSignatureElement(w,x);m.appendChild(S),w.documentation&&m.appendChild(this.createDocumentationElement(w.documentation));let E=(c=w.parameters)==null?void 0:c[x];E!=null&&E.documentation&&m.appendChild(this.createParameterDocElement(E.documentation));let T=Ut(e.state.doc,{line:t,character:a});return T==null?null:{pos:T,end:T,create:M=>({dom:m}),above:((f=this.featureOptions.signatureHelpOptions)==null?void 0:f.position)==="above"}}catch(d){return console.error("Signature help error:",d),null}}async showSignatureHelpTooltip(e,t,a){let o=await this.requestSignatureHelp(e,wa(e.state.doc,t),a);e.dispatch({effects:Ul.of(o)})}createTooltipContainer(){let e=document.createElement("div");return e.classList.add("cm-signature-help"),e.style.cssText="padding: 6px; max-width: 400px;",e}createSignatureElement(e,t){let a=document.createElement("div");if(a.classList.add("cm-signature"),a.style.cssText="font-family: monospace; margin-bottom: 4px;",!e.label||typeof e.label!="string")return a.textContent="Signature information unavailable",a;let o=e.label,s=e.parameters||[];if(s.length===0||!s[t])return a.textContent=o,a;let c=s[t].label;return typeof c=="string"?this.allowHTMLContent?a.innerHTML=o.replace(c,`<strong class="cm-signature-active-param">${c}</strong>`):a.textContent=o.replace(c,`\xAB${c}\xBB`):Array.isArray(c)&&c.length===2?this.applyRangeHighlighting(a,o,c[0],c[1]):a.textContent=o,a}applyRangeHighlighting(e,t,a,o){e.textContent="";let s=t.substring(0,a),c=t.substring(a,o),f=t.substring(o);e.appendChild(document.createTextNode(s));let d=document.createElement("span");d.classList.add("cm-signature-active-param"),d.style.cssText="font-weight: bold; text-decoration: underline;",d.textContent=c,e.appendChild(d),e.appendChild(document.createTextNode(f))}createDocumentationElement(e){let t=document.createElement("div");t.classList.add("cm-signature-docs"),t.style.cssText="margin-top: 4px; color: #666;";let a=cr(e,this.markdownRenderer);return this.allowHTMLContent?t.innerHTML=a:t.textContent=a,t}createParameterDocElement(e){let t=document.createElement("div");t.classList.add("cm-parameter-docs"),t.style.cssText="margin-top: 4px; font-style: italic; border-top: 1px solid #eee; padding-top: 4px;";let a=cr(e,this.markdownRenderer);return this.allowHTMLContent?t.innerHTML=a:t.textContent=a,t}prepareRenameFallback(e,{line:t,character:a}){let o=e.state.doc.line(t+1).text,s=/\w+/g,c,f=a,d=a;for(;(c=s.exec(o))!==null;){let m=c.index,b=c.index+c[0].length;if(a>=m&&a<=b){f=m,d=b;break}}return f===a&&d===a?null:{range:{start:{line:t,character:f},end:{line:t,character:d}},placeholder:o.slice(f,d)}}async applyRenameEdit(e,t){if(!t)return Ln(e,"No edit returned from language server"),!1;let a=t.changes??{},o=t.documentChanges??[];if(Object.keys(a).length===0&&o.length===0)return Ln(e,"No changes to apply"),!1;if(o.length>0)for(let s of o){if("textDocument"in s){if(s.textDocument.uri!==this.documentUri){Ln(e,"Multi-file rename not supported yet");continue}let c=s.edits.sort((f,d)=>{let m=Ut(e.state.doc,f.range.start);return(Ut(e.state.doc,d.range.start)??0)-(m??0)}).map(f=>({from:Ut(e.state.doc,f.range.start)??0,to:Ut(e.state.doc,f.range.end)??0,insert:f.newText}));return e.dispatch(e.state.update({changes:c})),!0}return Ln(e,"File creation, deletion, or renaming operations not supported yet"),!1}else if(Object.keys(a).length>0)for(let[s,c]of Object.entries(a)){if(s!==this.documentUri){Ln(e,"Multi-file rename not supported yet");continue}let f=c.sort((d,m)=>{let b=Ut(e.state.doc,d.range.start);return(Ut(e.state.doc,m.range.start)??0)-(b??0)}).map(d=>({from:Ut(e.state.doc,d.range.start)??0,to:Ut(e.state.doc,d.range.end)??0,insert:d.newText}));e.dispatch(e.state.update({changes:f}))}return!1}};vm=function(e){var f;let t=null,a={rename:"F2",goToDefinition:"F12",signatureHelp:"Mod-Shift-Space",...e.keyboardShortcuts},o=e.client,s={diagnosticsEnabled:!0,hoverEnabled:!0,completionEnabled:!0,definitionEnabled:!0,renameEnabled:!0,codeActionsEnabled:!0,signatureHelpEnabled:!0,signatureActivateOnTyping:!1,signatureHelpOptions:{position:"below"},...e},c=[Dr.define(d=>(t=new lS({client:o,documentUri:e.documentUri??d.state.facet(uy),languageId:e.languageId??d.state.facet(iS),view:d,featureOptions:s,sendIncrementalChanges:e.sendIncrementalChanges,allowHTMLContent:e.allowHTMLContent,useSnippetOnCompletion:e.useSnippetOnCompletion,onGoToDefinition:e.onGoToDefinition,markdownRenderer:e.markdownRenderer}),t))];if(c.push(fa.of([{key:a.signatureHelp,run:d=>{if(!(t&&s.signatureHelpEnabled))return!1;let m=d.state.selection.main.head;return t.showSignatureHelpTooltip(d,m),!0}},{key:a.rename,run:d=>{if(!(t&&s.renameEnabled))return!1;let m=d.state.selection.main.head;return t.requestRename(d,wa(d.state.doc,m)),!0}},{key:a.goToDefinition,run:d=>{if(!(t&&s.definitionEnabled))return!1;let m=d.state.selection.main.head;return t.requestDefinition(d,wa(d.state.doc,m)).catch(b=>Ln(d,`Go to definition failed: ${b instanceof Error?b.message:"Unknown error"}`)),!0}}])),s.hoverEnabled&&c.push(am((d,m)=>t==null?null:t.requestHoverTooltip(d,wa(d.state.doc,m)),e.hoverConfig)),s.signatureHelpEnabled){c.push(zl);let d=m=>m.state.field(zl)?(m.dispatch({effects:Ul.of(null)}),!0):!1;c.push(wt.domEventHandlers({mousedown:(m,b)=>(d(b),!1)})),c.push(fa.of([{key:")",run:m=>(d(m),!1)},{key:"Escape",run:m=>d(m)}])),c.push(wt.updateListener.of(m=>{if(!(t&&s.signatureActivateOnTyping)||!m.state.field(zl)||!(m.selectionSet||m.docChanged))return;let b=m.state.selection.main.head;fS(m.state.doc,b)||d(m.view)})),c.push(wt.updateListener.of(async m=>{var E;if(!(t&&m.docChanged)||m.transactions.some(T=>T.annotation(ff))||!((E=t.client.capabilities)!=null&&E.signatureHelpProvider)||!s.signatureActivateOnTyping)return;let b=t.client.capabilities.signatureHelpProvider.triggerCharacters||["(",","],w=m.changes,x=-1,S;w.iterChanges((T,M,z,B,V)=>{if(x>=0)return;let N=uS(V.toString(),z,b);N&&(x=N.triggerPos,S=N.triggerCharacter)}),x>=0&&t.showSignatureHelpTooltip(m.view,x,S)}))}return s.completionEnabled&&c.push(Xu({...e.completionConfig,override:[async d=>{var x,S;if(t==null)return null;let{state:m,pos:b}=d,w=cS(d,((S=(x=t.client.capabilities)==null?void 0:x.completionProvider)==null?void 0:S.triggerCharacters)??[],e.completionMatchBefore);return w==null?null:await t.requestCompletion(d,wa(m.doc,b),w)},...((f=e.completionConfig)==null?void 0:f.override)||[]]})),c.push(wt.domEventHandlers({click:(d,m)=>{if(s.definitionEnabled&&a.goToDefinition==="ctrlcmd"&&(d.ctrlKey||d.metaKey)){let b=m.posAtCoords({x:d.clientX,y:d.clientY});b&&t&&(t.requestDefinition(m,wa(m.state.doc,b)).catch(w=>Ln(m,`Go to definition failed: ${w instanceof Error?w.message:"Unknown error"}`)),d.preventDefault())}}})),c};function cS(e,t,a){let{state:o,pos:s,explicit:c}=e,f=o.doc.lineAt(s),d=_a.CompletionTriggerKind.Invoked,m,b=f.text[s-f.from-1]||"",w=t==null?void 0:t.includes(b);return!c&&w&&(d=_a.CompletionTriggerKind.TriggerCharacter,m=b),d===_a.CompletionTriggerKind.Invoked&&!e.matchBefore(a||/(\w+|\w+\.|\/|,)$/)?null:{triggerKind:d,triggerCharacter:m}}function uS(e,t,a){if(!e)return null;for(let o of a){let s=e.indexOf(o);if(s!==-1)return{triggerPos:t+s+1,triggerCharacter:o}}return null}function dS(e){let t=0;for(let a of e)a==="("?t++:a===")"&&t--;return t}function fS(e,t,a=sS){let o=e.lineAt(t),s=Math.max(1,o.number-a),c=e.line(s).from;return dS(e.sliceString(c,t))>0}sd=function(e,t,a={}){let{preserveCursor:o=!0,effects:s,userEvent:c}=a,f=e.state.doc;if(f.toString()!==t)if(o&&e.hasFocus){let d=e.state.selection.main.head,m=f.lineAt(d),b=m.number,w=d-m.from,x=e.state.update({changes:{from:0,to:f.length,insert:t}}).state.doc,S;if(b<=x.lines){let E=x.line(b),T=E.length;S=E.from+Math.min(w,T)}else S=x.line(x.lines).to;e.dispatch({changes:{from:0,to:f.length,insert:t},annotations:ff.of(!0),selection:{anchor:S},effects:s,userEvent:c})}else e.dispatch({changes:{from:0,to:f.length,insert:t},effects:s,userEvent:c})},to=function(){return Il.define({combine:e=>e.find(t=>t!==void 0)})};const py=to(),hy=to(),pf=to(),Zl=to(),my=to();Kx=function({cellId:e,completionConfig:t,hotkeys:a,placeholderType:o,lspConfig:s,diagnosticsConfig:c}){return[Zl.of(e),py.of(t),hy.of(a),pf.of(o),my.of({...s,diagnostics:c})]},Nd=new Qu,Qm=function(e){return e==="application/vnd.marimo+error"},R0=function(e){return e==="application/vnd.marimo+traceback"},Hl=function(e){return Qm(e)||R0(e)};function pS(e){return Object.values(e.cellRuntime).some(t=>t.status==="running")}function hS(e){return Object.values(e.cellRuntime).filter(t=>t.status==="running"||t.status==="queued").length}function mS(e){return u0(e).length>0}rk=function(e){return e.cellIds.inOrderIds.map(t=>e.cellData[t])},t0=function({cellHandles:e}){var a;let t={};for(let[o,s]of Pr.entries(e))(a=s.current)!=null&&a.editorView&&(t[o]=s.current.editorView);return t},I0=function(e){let{cellIds:t,cellData:a}=e,o=[];for(let s of t.inOrderIds)a[s].config.disabled&&o.push(s);return o},e0=function(e){let{cellIds:t,cellData:a}=e,o=[];for(let s of t.inOrderIds)a[s].config.disabled||o.push(s);return o};function gS(e){return e.history.length>0}function yS(e){let t=e.history[e.history.length-1];return t&&t.type==="move"?"Undo move":"Undo cell deletion"}mk=function(e,t){let a=e.cellIds.findWithId(t).getDescendants(t);return{stale:a.some(o=>{var s,c;return((s=e.cellRuntime[o])==null?void 0:s.staleInputs)||((c=e.cellData[o])==null?void 0:c.edited)}),errored:a.some(o=>{var s;return(s=e.cellRuntime[o])==null?void 0:s.errored}),runningOrQueued:a.some(o=>{var s,c;return((s=e.cellRuntime[o])==null?void 0:s.status)==="running"||((c=e.cellRuntime[o])==null?void 0:c.status)==="queued"})}},u0=function(e){let{cellIds:t,cellData:a,cellRuntime:o}=e;return t.inOrderIds.filter(s=>O0({executionTime:o[s].runElapsedTimeMs??a[s].lastExecutionTime,status:o[s].status,errored:o[s].errored,interrupted:o[s].interrupted,stopped:o[s].stopped})||a[s].edited||o[s].interrupted||o[s].staleInputs&&!(o[s].status==="disabled-transitively"||a[s].config.disabled))},O0=function({executionTime:e,status:t,errored:a,interrupted:o,stopped:s}){return e===null&&t!=="queued"&&t!=="running"&&!(a||o||s)},$x=function({edited:e,interrupted:t,staleInputs:a,disabled:o,status:s}){return e||t||a&&!(o||s==="disabled-transitively")},xk=function({needsRun:e,errored:t,stopped:a,disabled:o,status:s}){return{"needs-run":e,"has-error":t,stopped:a,disabled:o??!1,stale:s==="disabled-transitively"}},Ek=function({errored:e,stopped:t}){return{published:!0,"has-error":e,stopped:t}},yk=function({errored:e,interrupted:t,stopped:a,output:o,showErrorTracebacks:s}){let c=Hl(o==null?void 0:o.mimetype),f=s&&c&&Array.isArray(o==null?void 0:o.data)&&o.data.some(d=>d.type==="exception"&&"traceback"in d&&d.traceback);return(e||t||a||c)&&!f},st=Il.define({combine:e=>e[0]}),ha=Il.define({combine:e=>e[0]});var vS={...lm,caseInsensitiveIdentifiers:!0,identifierQuotes:"`"};const gy=Zu.define(vS),bS=Zu.define({doubleQuotedStrings:!1,hashComments:!1,spaceAfterDashes:!1,identifierQuotes:'"',caseInsensitiveIdentifiers:!0,keywords:"abs access acos aes_decrypt aggregate all allocate allow alter analyze and any approx_count_distinct approx_percentile are array array_avg array_cat array_compact array_contains array_generate_range array_max array_max_cardinality array_min array_position array_remove array_remove_at array_size array_sum array_to_string arrow as ascii asensitive asin assign asymmetric at atan atan2 atomic authorization auto avg avoid base64 batch begin begin_frame begin_partition between bigint bin bin_pack binary binary_string bit bit_and bit_length bit_or bitwise_and bitwise_not bitwise_or bitwise_xor blob bool_and bool_or boolean both branch bround btrim by cache call called cardinality cascaded case cast catalog cbrt ceil ceiling change char char_length character character_length check chr classifier clob close cloud coalesce col_like collate collect column columns commit commits_older_than compute concat concat_ws condition connect constraint contains convert convert_from convert_replaceutf8 convert_timezone convert_to copy corr corresponding cos cosh cot count covar_pop covar_samp crc32 create cross cube cume_dist current current_catalog current_date current_date_utc current_default_transform_group current_path current_role current_row current_schema current_time current_timestamp current_transform_group_for_type current_user cursor cycle data databases datasets date date_add date_diff date_format date_part date_sub date_trunc datediff datetype day dayofmonth dayofweek dayofyear deallocate dec decimal declare dedupe_lookback_period default define degrees delete dense_rank deref describe deterministic dimensions disallow disconnect display distinct double drop dynamic e each element else empty empty_as_null encode end end-exec end_frame end_partition ends_with engine equals escape escape_char every except exec execute exists exp expire explain extend external extract factorial false fetch field field_delimiter file_format files filter first_value flatten float floor folder for foreign frame_row free from from_hex full function fusion geo_beyond geo_distance geo_nearby get global grant grants greatest group grouping groups hash hash64 having hex history hold hour identity if ilike imindir import in include indicator initcap initial inner inout insensitive insert instr int integer intersect intersection interval into is is_bigint is_int is_member is_substr is_utf8 is_varchar isdate isnumeric job join json_array json_arrayagg json_exists json_object json_objectagg json_query json_value lag language large last_day last_query_id last_value lateral lazy lcase lead leading least left length levenshtein like like_regex limit listagg ln local localsort localtime localtimestamp locate log log10 logs lower lpad lshift ltrim manifests map_keys map_values mask mask_first_n mask_hash mask_last_n mask_show_first_n mask_show_last_n masking match match_number match_recognize matches max max_file_size_mb maxdir md5 measures median member merge metadata method min min_file_size_mb min_input_files mindir minus minute missing mod modifies module monitor month months_between more multiset national natural nchar nclob ndv new next next_day no none normalize normalize_string not notification_provider notification_queue_reference now nth_value ntile null null_if nullif numeric nvl occurrences_regex octet_length of offset old older_than omit on one only open operate optimize or order orphan out outer over overlaps overlay ownership parameter parse_url partition partitions pattern per percent percent_rank percentile_cont percentile_disc period permute pi pivot pmod policy portion position position_regex pow power precedes precision prepare prev primary procedure project promotion qualify quarter query query_user quote quote_char radians random range rank raw reads real record_delimiter recursive ref reference references referencing reflection reflections refresh regex regexp_col_like regexp_extract regexp_like regexp_matches regexp_replace regexp_split regr_avgx regr_avgy regr_count regr_intercept regr_r2 regr_slope regr_sxy regr_syy release remove rename repeat repeatstr replace reset result retain_last retain_last_commits retain_last_snapshots return returns reverse revoke rewrite right role rollback rollup round route row row_number rows rpad rshift rtrim running savepoint schemas scope scroll search second seek select sensitive session_user set sha sha1 sha256 sha512 show sign similar similar_to sin sinh size skip smallint snapshot snapshots snapshots_older_than some soundex specific specifictype split_part sql sqlexception sqlstate sqlwarning sqrt st_fromgeohash st_geohash start starts_with static statistics stddev stddev_pop stddev_samp stream string_binary strpos submultiset subset substr substring substring_index substring_regex succeeds sum symmetric system system_time system_user table tables tablesample tag tan tanh target_file_size_mb tblproperties then time time_format timestamp timestamp_format timestampadd timestampdiff timestamptype timezone_hour timezone_minute tinyint to to_char to_date to_hex to_number to_time to_timestamp toascii trailing transaction_timestamp translate translate_regex translation treat trigger trim trim_array trim_space true truncate typeof ucase uescape unbase64 unhex union unique unix_timestamp unknown unnest unpivot unset update upper upsert usage use user using vacuum value value_of values var_pop var_samp varbinary varchar varying versioning view views week weekofyear when whenever where width_bucket window with within without write xor year",types:"array bigint binary boolean char character date dec decimal double float int integer interval map numeric struct time timestamp uuid varbinary varchar variant"}),yy=Zu.define({charSetCasts:!0,doubleQuotedStrings:!1,unquotedBitLiterals:!0,hashComments:!1,spaceAfterDashes:!1,specialVar:"@?",identifierQuotes:'"',caseInsensitiveIdentifiers:!0,keywords:"percentile_cont row_number rank dense_rank rank_dense percent_rank cume_dist ntile lag lead first_value last_value nth_value !__postfix !~~ !~~* % & && * ** + - ->> / // <-> << <=> <@ >> @ @> Calendar JSON TimeZone ^ ^@ abort abs absolute access access_mode acos acosh action add add_parquet_key admin after age aggregate alias all all_profiling_output allow_community_extensions allow_extensions_metadata_mismatch allow_persistent_secrets allow_unredacted_secrets allow_unsigned_extensions allowed_directories allowed_paths also alter always analyse analyze and anti any any_value apply approx_count_distinct approx_quantile approx_top_k arbitrary arg_max arg_max_null arg_min arg_min_null argmax argmin array array_agg array_aggr array_aggregate array_append array_apply array_cat array_concat array_contains array_cosine_distance array_cosine_similarity array_cross_product array_distance array_distinct array_dot_product array_extract array_filter array_grade_up array_has array_has_all array_has_any array_indexof array_inner_product array_intersect array_length array_negative_dot_product array_negative_inner_product array_pop_back array_pop_front array_position array_prepend array_push_back array_push_front array_reduce array_resize array_reverse array_reverse_sort array_select array_slice array_sort array_to_json array_to_string array_to_string_comma_default array_transform array_unique array_value array_where array_zip arrow_large_buffer_size arrow_lossless_conversion arrow_output_list_view arrow_output_version arrow_scan arrow_scan_dumb as asc ascii asin asinh asof asof_loop_join_threshold assertion assignment asymmetric at atan atan2 atanh attach attribute authorization autoinstall_extension_repository autoinstall_known_extensions autoload_known_extensions avg backward bar base64 before begin between bigint bin binary binary_as_string bit bit_and bit_count bit_length bit_or bit_position bit_xor bitstring bitstring_agg blob bool bool_and bool_or boolean both bpchar by bytea cache call called can_cast_implicitly cardinality cascade cascaded case cast cast_to_type catalog catalog_error_max_schemas cbrt ceil ceiling centuries century chain char char_length character character_length characteristics check checkpoint checkpoint_threshold chr class close cluster coalesce col_description collate collation collations column columns combine comment comments commit committed compression concat concat_ws concurrently configuration conflict connection constant_or_null constraint constraints contains content continue conversion copy copy_database corr cos cosh cost cot count count_if count_star countif covar_pop covar_samp create create_sort_key cross csv cube current current_catalog current_connection_id current_database current_date current_localtime current_localtimestamp current_query current_query_id current_role current_schema current_schemas current_setting current_transaction_id current_user currval cursor custom_extension_repository custom_profiling_settings custom_user_agent cycle damerau_levenshtein data database database_list database_size date date_add date_diff date_part date_sub date_trunc datediff datepart datesub datetime datetrunc day dayname dayofmonth dayofweek dayofyear days deallocate debug_asof_iejoin debug_checkpoint_abort debug_force_external debug_force_no_cross_product debug_skip_checkpoint_on_commit debug_verify_vector debug_window_mode dec decade decades decimal declare decode default default_block_size default_collation default_null_order default_order default_secret_storage defaults deferrable deferred definer degrees delete delimiter delimiters depends desc describe detach dictionary disable disable_checkpoint_on_shutdown disable_logging disable_object_cache disable_optimizer disable_parquet_prefetching disable_print_progress_bar disable_profile disable_profiling disable_progress_bar disable_timestamptz_casts disable_verification disable_verify_external disable_verify_fetch_row disable_verify_parallelism disable_verify_serializer disabled_compression_methods disabled_filesystems disabled_log_types disabled_optimizers discard distinct divide do document domain double drop duckdb_api duckdb_columns duckdb_constraints duckdb_databases duckdb_dependencies duckdb_extensions duckdb_external_file_cache duckdb_functions duckdb_indexes duckdb_keywords duckdb_log_contexts duckdb_logs duckdb_logs_parsed duckdb_memory duckdb_optimizers duckdb_prepared_statements duckdb_schemas duckdb_secret_types duckdb_secrets duckdb_sequences duckdb_settings duckdb_table_sample duckdb_tables duckdb_temporary_files duckdb_types duckdb_variables duckdb_views dynamic_or_filter_threshold each editdist3 element_at else enable enable_checkpoint_on_shutdown enable_external_access enable_external_file_cache enable_fsst_vectors enable_geoparquet_conversion enable_http_logging enable_http_metadata_cache enable_logging enable_macro_dependencies enable_object_cache enable_optimizer enable_print_progress_bar enable_profile enable_profiling enable_progress_bar enable_progress_bar_print enable_verification enable_view_dependencies enabled_log_types encode encoding encrypted end ends_with entropy enum enum_code enum_first enum_last enum_range enum_range_boundary epoch epoch_ms epoch_ns epoch_us equi_width_bins era error errors_as_json escape even event except exclude excluding exclusive execute exists exp explain explain_output export export_state extension extension_directory extension_versions extensions external external_threads extract factorial false family favg fdiv fetch file_search_path filter finalize first flatten float float4 float8 floor fmod following for force force_bitpacking_mode force_checkpoint force_compression foreign format formatReadableDecimalSize formatReadableSize format_bytes format_pg_type format_type forward freeze from from_base64 from_binary from_hex from_json from_json_strict fsum full function functions gamma gcd gen_random_uuid generate_series generate_subscripts generated geomean geometric_mean get_bit get_block_size get_current_time get_current_timestamp getvariable glob global grade_up grant granted greatest greatest_common_divisor group group_concat grouping grouping_id groups guid hamming handler having header hex histogram histogram_exact histogram_values hold home_directory hour hours http_logging_output http_proxy http_proxy_password http_proxy_username hugeint identity ieee_floating_point_ops if ignore ilike ilike_escape immediate immediate_transaction_mode immutable implicit import import_database in in_search_path include including increment index index_scan_max_count index_scan_percentage indexes inet_client_addr inet_client_port inet_server_addr inet_server_port inherit inherits initially inline inner inout input insensitive insert install instead instr int int1 int128 int16 int2 int32 int4 int64 int8 integer integer_division integral intersect interval into invoker is is_histogram_other_bin isfinite isinf isnan isnull isodow isolation isoyear jaccard jaro_similarity jaro_winkler_similarity join json json_array json_array_length json_contains json_deserialize_sql json_each json_execute_serialized_sql json_exists json_extract json_extract_path json_extract_path_text json_extract_string json_group_array json_group_object json_group_structure json_keys json_merge_patch json_object json_pretty json_quote json_serialize_plan json_serialize_sql json_structure json_transform json_transform_strict json_tree json_type json_valid json_value julian kahan_sum key kurtosis kurtosis_pop label lambda lambda_syntax language large last last_day late_materialization_max_rows lateral lcase lcm leading leakproof least least_common_multiple left left_grapheme len length length_grapheme level levenshtein lgamma like like_escape limit list list_aggr list_aggregate list_any_value list_append list_apply list_approx_count_distinct list_avg list_bit_and list_bit_or list_bit_xor list_bool_and list_bool_or list_cat list_concat list_contains list_cosine_distance list_cosine_similarity list_count list_distance list_distinct list_dot_product list_element list_entropy list_extract list_filter list_first list_grade_up list_has list_has_all list_has_any list_histogram list_indexof list_inner_product list_intersect list_kurtosis list_kurtosis_pop list_last list_mad list_max list_median list_min list_mode list_negative_dot_product list_negative_inner_product list_pack list_position list_prepend list_product list_reduce list_resize list_reverse list_reverse_sort list_select list_sem list_skewness list_slice list_sort list_stddev_pop list_stddev_samp list_string_agg list_sum list_transform list_unique list_value list_var_pop list_var_samp list_where list_zip listagg listen ln load local location lock lock_configuration locked log log10 log2 log_query_path logged logging_level logging_mode logging_storage logical long lower lpad ltrim macro mad make_date make_time make_timestamp make_timestamp_ns make_timestamptz map map_concat map_contains map_contains_entry map_contains_value map_entries map_extract map_extract_value map_from_entries map_keys map_to_pg_oid map_values mapping match materialized max max_by max_expression_depth max_memory max_temp_directory_size max_vacuum_tasks maxvalue md5 md5_number md5_number_lower md5_number_upper mean median memory_limit merge_join_threshold metadata_info method microsecond microseconds millennia millennium millisecond milliseconds min min_by minute minutes minvalue mismatches mod mode month monthname months move multiply name names nanosecond national natural nchar nested_loop_join_threshold new next nextafter nextval nfc_normalize no none normalized_interval not not_ilike_escape not_like_escape nothing notify notnull now nowait null null_order nullif nulls numeric nvarchar obj_description object octet_length of off offset oid oids old old_implicit_casting on only operator option options or ord order order_by_non_integer_literal ordered_aggregate_threshold ordinality others out outer over overlaps overlay overriding owned owner pandas_analyze_sample pandas_scan parallel parquet_bloom_probe parquet_file_metadata parquet_kv_metadata parquet_metadata parquet_metadata_cache parquet_scan parquet_schema parse_dirname parse_dirpath parse_duckdb_log_message parse_filename parse_path parser partial partition partitioned partitioned_write_flush_threshold partitioned_write_max_open_files passing password percent perfect_ht_threshold persistent pi pivot pivot_filter_threshold pivot_limit pivot_longer pivot_wider placing plans platform policy position positional pow power pragma pragma_collations pragma_database_size pragma_metadata_info pragma_platform pragma_show pragma_storage_info pragma_table_info pragma_user_agent pragma_version preceding precision prefer_range_joins prefetch_all_parquet_files prefix prepare prepared preserve preserve_identifier_case preserve_insertion_order primary printf prior privileges procedural procedure produce_arrow_string_view product profile_output profiling_mode profiling_output program progress_bar_time publication python_enable_replacements python_map_function python_scan_all_frames qualify quantile quantile_cont quantile_disc quarter quarters query query_table quote radians random range read read_blob read_csv read_csv_auto read_json read_json_auto read_json_objects read_json_objects_auto read_ndjson read_ndjson_auto read_ndjson_objects read_parquet read_text real reassign recheck recursive reduce ref references referencing refresh regexp_escape regexp_extract regexp_extract_all regexp_full_match regexp_matches regexp_replace regexp_split_to_array regexp_split_to_table regr_avgx regr_avgy regr_count regr_intercept regr_r2 regr_slope regr_sxx regr_sxy regr_syy reindex relative release remap_struct rename repeat repeat_row repeatable replace replica reservoir_quantile reset respect restart restrict returning returns reverse revoke right right_grapheme role rollback rollup round round_even roundbankers row row_to_json rows rpad rtrim rule sample savepoint scalar_subquery_error_on_multiple_rows scheduler_process_partial schema schemas scope scroll search search_path second seconds secret secret_directory security select sem semi seq_scan sequence sequences serializable server session session_user set set_bit setof sets setseed sha1 sha256 share shobj_description short show show_databases show_tables show_tables_expanded sign signbit signed similar simple sin sinh skewness skip smallint snapshot sniff_csv some sorted split split_part sql sqrt stable standalone start starts_with statement statistics stats stddev stddev_pop stddev_samp stdin stdout storage storage_compatibility_version storage_info stored str_split str_split_regex streaming_buffer_size strftime strict string string_agg string_split string_split_regex string_to_array strip strip_accents strlen strpos strptime struct struct_concat struct_extract struct_extract_at struct_insert struct_pack subscription substr substring substring_grapheme subtract suffix sum sum_no_overflow sumkahan summarize summary symmetric sysid system table table_info tables tablesample tablespace tan tanh temp temp_directory template temporary test_all_types test_vector_types text then threads ties time time_bucket timestamp timestamp_ms timestamp_ns timestamp_s timestamp_us timestamptz timetz timetz_byte_comparable timezone timezone_hour timezone_minute tinyint to to_base to_base64 to_binary to_centuries to_days to_decades to_hex to_hours to_json to_microseconds to_millennia to_milliseconds to_minutes to_months to_quarters to_seconds to_timestamp to_weeks to_years today trailing transaction transaction_timestamp transform translate treat trigger trim true trunc truncate truncate_duckdb_logs trusted try_cast try_strptime txid_current type typeof types ubigint ucase uhugeint uint128 uint16 uint32 uint64 uint8 uinteger unbin unbounded uncommitted unencrypted unhex unicode union union_extract union_tag union_value unique unknown unlisten unlogged unnest unpack unpivot unpivot_list until update upper url_decode url_encode use user user_agent username using usmallint utinyint uuid uuid_extract_timestamp uuid_extract_version uuidv4 uuidv7 vacuum valid validate validator value values var_pop var_samp varbinary varchar variable variadic variance varint varying vector_type verbose verify_external verify_fetch_row verify_parallelism verify_serializer version view views virtual volatile wal_autocheckpoint wavg week weekday weekofyear weeks weighted_avg when where which_secret whitespace window with within without work worker_threads wrapper write write_log xml xmlattributes xmlconcat xmlelement xmlexists xmlforest xmlnamespaces xmlparse xmlpi xmlroot xmlserialize xmltable xor year years yearweek yes zone zstd_min_string_length | || ~ ~~ ~~* ~~~",types:"JSON bigint binary bit bitstring blob bool boolean bpchar bytea char date datetime dec decimal double enum float float4 float8 guid hugeint int int1 int128 int16 int2 int32 int4 int64 int8 integer integral interval list logical long map null numeric nvarchar oid real row short signed smallint string struct text time timestamp timestamp_ms timestamp_ns timestamp_s timestamp_us timestamptz timetz tinyint ubigint uhugeint uint128 uint16 uint32 uint64 uint8 uinteger union usmallint utinyint uuid varbinary varchar varint"});var wS=new Set("postgresql.postgres.couchbase.db2.db2i.tidb.mysql.sqlite.mssql.sqlserver.duckdb.mariadb.cassandra.noql.spark.awsathena.athena.bigquery.hive.redshift.snowflake.flink.mongodb.trino.oracle.oracledb.singlestoredb.timescaledb.databricks.datafusion.microsoft sql server.dremio".split("."));function ec(e){return wS.has(e)}function vy(e){let t=e.dialect;if(!ec(t))return _e.debug("Unknown dialect",{dialect:t}),_s;switch(t){case"postgresql":case"postgres":return lm;case"mysql":return hL;case"sqlite":return fL;case"mssql":case"sqlserver":case"microsoft sql server":return gL;case"duckdb":return yy;case"mariadb":return yL;case"cassandra":return vL;case"oracledb":case"oracle":return dL;case"bigquery":return gy;case"dremio":return bS;case"timescaledb":return lm;case"awsathena":case"athena":case"db2i":case"db2":case"hive":case"redshift":case"snowflake":case"flink":case"mongodb":case"noql":case"couchbase":case"trino":case"tidb":case"singlestoredb":case"spark":case"databricks":case"datafusion":return _e.debug("Unsupported dialect",{dialect:t}),_s;default:return fs(t),_s}}var _S={...mL,caseInsensitiveIdentifiers:!0,identifierQuotes:"'"};let _s;_s=Zu.define(_S),ma="__marimo_duckdb",eo=new Set([ma]),ek="memory",F_=function(e,t){var o;if(!e)return t;let a=((o=e.schemaPath)!=null&&o.length?e.schemaPath:[e.schema]).filter(Boolean);return[e.database,...a,t].join(".")},Bl=function(e){return e===""},Am=function(e){return e.schemas_resolved!==!1},S0=function(e){return e.tables_resolved!==!1},Sm=function(e){return e.child_schemas_resolved!==!1},fd=function(e,t){let a=t==null?void 0:t.trim().toLowerCase();return a?S0(e)&&e.tables.some(o=>o.name.toLowerCase().includes(a))?!0:Sm(e)?(e.child_schemas??[]).some(o=>fd(o,a)):!1:!1},Bx=function(e,t){return!(t!=null&&t.trim())||!Am(e)?!1:e.schemas.some(a=>fd(a,t))};var xs={formatTablePath:e=>e.join("."),formatSelectClause:(e,t)=>`SELECT ${e} FROM ${t} LIMIT 100`};function xS(e){if(e=e.toLowerCase(),!ec(e))return xs;switch(e){case"bigquery":{let t=gy.spec.identifierQuotes;return{formatTablePath:a=>`${t}${a.join(".")}${t}`,formatSelectClause:xs.formatSelectClause}}case"mssql":case"sqlserver":case"microsoft sql server":return{formatTablePath:xs.formatTablePath,formatSelectClause:(t,a)=>`SELECT TOP 100 ${t} FROM ${a}`};case"timescaledb":case"postgres":case"postgresql":case"duckdb":case"dremio":return{formatTablePath:t=>t.map(a=>`"${a}"`).join("."),formatSelectClause:(t,a)=>`SELECT ${t==="*"?"*":`"${t}"`} FROM ${a} LIMIT 100`};case"db2":case"db2i":case"mysql":case"sqlite":case"mariadb":case"cassandra":case"noql":case"awsathena":case"athena":case"hive":case"redshift":case"snowflake":case"flink":case"mongodb":case"oracle":case"oracledb":case"couchbase":case"tidb":case"spark":case"trino":case"singlestoredb":case"databricks":case"datafusion":return xs;default:return fs(e),xs}}xx=function({table:e,columnName:t,sqlTableContext:a}){if(a){let{engine:o,schema:s,defaultSchema:c,defaultDatabase:f,database:d,dialect:m}=a,b=[e.name];Bl(s)||s!==c&&b.unshift(s),d!==f&&b.unshift(d);let w=xS(m),x=w.formatTablePath(b),S=w.formatSelectClause(t,x);return o==="__marimo_duckdb"?`_df = mo.sql(f"""
28
- ${S}
29
- """)`:`_df = mo.sql(f"""
30
- ${S}
31
- """, engine=${o})`}return`_df = mo.sql(f'SELECT "${t}" FROM ${e.name} LIMIT 100')`},sx=function(e,t){if(t==="date"||t==="datetime"||t==="time"){if(e==="min")return"Earliest";if(e==="max")return"Latest"}return e};function kS(){return{tables:[],expandedTables:new Set,expandedColumns:new Set,columnsPreviews:new Map}}var{reducer:jL,createActions:zL,valueAtom:by,useActions:CS}=ds(kS,{addDatasets:(e,t)=>{let{previewDatasetColumn:a}=ir();for(let d of t.tables)for(let m of d.columns){let b=`${d.name}:${m.name}`;e.expandedColumns.has(b)&&a({tableName:d.name,columnName:m.name,source:d.source,sourceType:d.source_type})}let o=e.tables;t.clear_channel&&(o=o.filter(d=>d.source!==t.clear_channel));let s=[...t.tables,...o],c=new Set,f=s.filter(d=>{let m=`${d.name}:${d.source}`;return c.has(m)?!1:(c.add(m),!0)}).toSorted((d,m)=>d.name.localeCompare(m.name));return{...e,tables:f}},filterDatasetsFromVariables:(e,t)=>{let a=new Set(t),o=e.tables.filter(s=>s.variable_name?a.has(s.variable_name):!0);return{...e,tables:o}},toggleTable:(e,t)=>{let a=new Set(e.expandedTables);return a.has(t)?a.delete(t):a.add(t),{...e,expandedTables:a}},toggleColumn:(e,t)=>{let a=`${t.table}:${t.column}`,o=new Set(e.expandedColumns);return o.has(a)?o.delete(a):o.add(a),{...e,expandedColumns:o}},closeAllColumns:e=>({...e,expandedColumns:new Set}),addColumnPreview:(e,t)=>{let a=`${t.table_name}:${t.column_name}`,o=new Map(e.columnsPreviews);return o.set(a,t),{...e,columnsPreviews:o}}});Ox=()=>rn(by),dd=Ee(e=>e(by).tables),rx=Ee(new Set),U_=Ee(!1),Dx=function(){return CS()};var SS=new Map([[ma,{name:ma,dialect:"duckdb",source:"duckdb",display_name:"DuckDB (In-Memory)",databases:[]}]]);function tc(e,t,a){if(t.length===0)return e;let[o,...s]=t;return e.map(c=>c.name===o?s.length===0?a(c):{...c,child_schemas:tc(c.child_schemas??[],s,a)}:c)}function wy(e){let{schemaPath:t,schema:a}=e;return t&&t.length>0?t:[a]}function ES(){return{latestEngineSelected:ma,connectionsMap:SS}}let TS,IS;({reducer:TS,createActions:IS,valueAtom:Xi,useActions:Kk}=ds(ES,{addDataSourceConnection:(e,t)=>{if(t.connections.length===0)return e;let{latestEngineSelected:a,connectionsMap:o}=e,s=new Map(o);for(let c of t.connections)s.set(c.name,c);return{latestEngineSelected:a,connectionsMap:s}},filterDataSourcesFromVariables:(e,t)=>{let{latestEngineSelected:a,connectionsMap:o}=e,s=new Set(t),c=new Map([...o].filter(([f])=>eo.has(f)?!0:s.has(f)));return{latestEngineSelected:c.has(a)?a:ma,connectionsMap:c}},clearDataSourceConnections:()=>({latestEngineSelected:ma,connectionsMap:new Map}),removeDataSourceConnection:(e,t)=>{let{latestEngineSelected:a,connectionsMap:o}=e,s=new Map(o);return s.delete(t),{latestEngineSelected:s.has(a)?a:ma,connectionsMap:s}},addSchemaList:(e,t)=>{let{schemas:a,sqlSchemaContext:o}=t,{connectionsMap:s,latestEngineSelected:c}=e,f=o.engine,d=s.get(f);if(!d)return e;let m=o.schemaPath??[],b=new Map(s),w={...d,databases:d.databases.map(x=>x.name===o.database?m.length===0?{...x,schemas:a,schemas_resolved:!0}:{...x,schemas:tc(x.schemas,m,S=>({...S,child_schemas:a,child_schemas_resolved:!0}))}:x)};return b.set(f,w),{latestEngineSelected:c,connectionsMap:b}},addTableList:(e,t)=>{let{tables:a,sqlTableContext:o}=t,{connectionsMap:s,latestEngineSelected:c}=e,f=o.engine,d=s.get(f);if(!d)return e;let m=wy(o),b=new Map(s),w={...d,databases:d.databases.map(x=>x.name===o.database?{...x,schemas:tc(x.schemas,m,S=>({...S,tables:a,tables_resolved:!0}))}:x)};return b.set(f,w),{latestEngineSelected:c,connectionsMap:b}},addTable:(e,t)=>{let{table:a,sqlTableContext:o}=t,{connectionsMap:s,latestEngineSelected:c}=e,f=o.engine,d=a.name,m=s.get(f);if(!m)return e;let b=wy(o),w=new Map(s),x={...m,databases:m.databases.map(S=>S.name===o.database?{...S,schemas:tc(S.schemas,b,E=>{let T=E.tables.length===0?[a]:E.tables.map(M=>M.name===d?a:M);return{...E,tables:T}})}:S)};return w.set(f,x),{latestEngineSelected:c,connectionsMap:w}}})),nd=Ee(e=>e(Xi).connectionsMap);function _y(e){let t=Te.get(Xi);t.connectionsMap.has(e)&&Te.set(Xi,{...t,latestEngineSelected:e})}tx=Ee(e=>{let t=Te.get(dd),a=e(Xi).connectionsMap,o=new Map;for(let s of t)o.set(s.name,s);for(let s of a.values())for(let c of s.databases){let f=c.name===s.default_database||s.databases.length===1,d=(m,b)=>{let w=b.length===0,x=b.length===1&&b[0]===s.default_schema,S=b.join(".");for(let E of m.tables){let T;if(T=E.name,w){T=f?E.name:`${c.name}.${E.name}`,o.has(T)?_e.warn(`Table name collision for ${T}. Skipping.`):o.set(T,E);continue}if(f&&x&&!o.has(T)){o.set(T,E);continue}if(T=`${S}.${E.name}`,f&&!o.has(T)){o.set(T,E);continue}T=`${c.name}.${S}.${E.name}`,o.has(T)?_e.warn(`Table name collision for ${T}. Skipping.`):o.set(T,E)}for(let E of m.child_schemas??[])d(E,[...b,E.name])};for(let m of c.schemas)d(m,Bl(m.name)?[]:[m.name])}return o}),kx=function(e){return e.variable_name?"dataframe":"table"};let nc,hf,xy,ky,Cy,mf,Sy;nc=class{constructor(e,t={}){we(this,"cache",new Map);this.maxSize=e,this.options=t}getOrCreate(e){an(this.options.create,"create function is required");let t=this.cache.get(e);if(t!==void 0)return t;let a=this.options.create(e);return this.cache.set(e,a),a}get(e){let t=this.cache.get(e);return t!==void 0&&(this.cache.delete(e),this.cache.set(e,t)),t}set(e,t){if(this.cache.has(e)&&this.cache.delete(e),this.cache.set(e,t),this.cache.size>this.maxSize){let a=this.cache.keys().next().value;a!==void 0&&this.cache.delete(a)}}keys(){return this.cache.keys()}values(){return this.cache.values()}entries(){return this.cache.entries()}delete(e){this.cache.delete(e)}},zm=ot("activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]),Nm=ot("book-marked",[["path",{d:"M10 2v8l3-3 3 3V2",key:"sqw3rj"}],["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}]]),Pm=ot("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]),m0=ot("box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]),ym=ot("braces",[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]]),hf=ot("calendar-clock",[["path",{d:"M16 14v2.2l1.6 1",key:"fo4ql5"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5",key:"1osxxc"}],["path",{d:"M3 10h5",key:"r794hk"}],["path",{d:"M8 2v4",key:"1cmpym"}],["circle",{cx:"16",cy:"16",r:"6",key:"qoo3c4"}]]),g0=ot("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]),Dm=ot("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]),wm=ot("clock",[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]),xy=ot("cog",[["path",{d:"M11 10.27 7 3.34",key:"16pf9h"}],["path",{d:"m11 13.73-4 6.93",key:"794ttg"}],["path",{d:"M12 22v-2",key:"1osdcq"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M14 12h8",key:"4f43i9"}],["path",{d:"m17 20.66-1-1.73",key:"eq3orb"}],["path",{d:"m17 3.34-1 1.73",key:"2wel8s"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"m20.66 17-1.73-1",key:"sg0v6f"}],["path",{d:"m20.66 7-1.73 1",key:"1ow05n"}],["path",{d:"m3.34 17 1.73-1",key:"nuk764"}],["path",{d:"m3.34 7 1.73 1",key:"1ulond"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["circle",{cx:"12",cy:"12",r:"8",key:"46899m"}]]),xm=ot("columns-2",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]]),ys=ot("database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]),Md=ot("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),bm=ot("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]),ky=ot("folder-tree",[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]]),ld=ot("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]),Cy=ot("key-round",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]),no=ot("layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]),Zm=ot("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]),N0=ot("network",[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]]),M0=ot("notebook-pen",[["path",{d:"M13.4 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7.4",key:"re6nr2"}],["path",{d:"M2 6h4",key:"aawbzj"}],["path",{d:"M2 10h4",key:"l0bgd4"}],["path",{d:"M2 14h4",key:"1gsvsf"}],["path",{d:"M2 18h4",key:"1bu2t1"}],["path",{d:"M21.378 5.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"pqwjuv"}]]),Gm=ot("paint-roller",[["rect",{width:"16",height:"6",x:"2",y:"2",rx:"2",key:"jcyz7m"}],["path",{d:"M10 16v-2a2 2 0 0 1 2-2h8a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2h-2",key:"1b9h7c"}],["rect",{width:"4",height:"6",x:"8",y:"16",rx:"1",key:"d6e7yl"}]]),l0=ot("scroll-text",[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]]),mf=ot("search-check",[["path",{d:"m8 11 2 2 4-4",key:"1sed1v"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]),Sy=ot("square-dashed-bottom-code",[["path",{d:"M10 9.5 8 12l2 2.5",key:"3mjy60"}],["path",{d:"M14 21h1",key:"v9vybs"}],["path",{d:"m14 9.5 2 2.5-2 2.5",key:"1bir2l"}],["path",{d:"M5 21a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2",key:"as5y1o"}],["path",{d:"M9 21h1",key:"15o7lz"}]]),f0=ot("square-terminal",[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]]),Zi=ot("table-2",[["path",{d:"M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18",key:"gugj83"}]]),w0=ot("text-search",[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M10 12H3",key:"1ulcyk"}],["path",{d:"M10 19H3",key:"108z41"}],["circle",{cx:"17",cy:"15",r:"3",key:"1upz2a"}],["path",{d:"m21 19-1.9-1.9",key:"dwi7p8"}]]),s0=ot("variable",[["path",{d:"M8 21s-4-3-4-9 4-9 4-9",key:"uto9ud"}],["path",{d:"M16 3s4 3 4 9-4 9-4 9",key:"4w2vsq"}],["line",{x1:"15",x2:"9",y1:"9",y2:"15",key:"f7djnv"}],["line",{x1:"9",x2:"15",y1:"9",y2:"15",key:"1shsy8"}]]),Vl=function(e){switch(e){case"duckdb":return"DuckDB";case"motherduck":return"MotherDuck";case"sqlite":return"SQLite";case"postgres":case"postgresql":return"PostgreSQL";case"mysql":return"MySQL";case"mariadb":return"MariaDB";case"mssql":case"microsoft sql server":return"Microsoft SQL Server";case"oracle":return"Oracle";case"redshift":return"Amazon Redshift";case"snowflake":return"Snowflake";case"bigquery":return"Google BigQuery";case"clickhouse":return"ClickHouse";case"timeplus":return"Timeplus";case"databricks":return"Databricks";case"db2":return"IBM Db2";case"hive":return"Apache Hive";case"impala":return"Apache Impala";case"presto":return"Presto";case"trino":return"Trino";case"cockroachdb":return"CockroachDB";case"timescaledb":return"TimescaleDB";case"singlestore":return"SingleStore";case"cassandra":return"Apache Cassandra";case"mongodb":return"MongoDB";case"iceberg":return"Apache Iceberg";case"dremio":return"Dremio";default:return e}};function Ey(e){let[t,a]=e.split(" ");return a?`${Vl(t)} ${a}`:Vl(e)}kd={boolean:wL,date:_L,time:wm,datetime:hf,temporal:hf,number:cm,string:xL,integer:cm,unknown:ym},zk=function(e){switch(e){case"boolean":return"bg-(--orange-4)";case"date":case"time":case"datetime":case"temporal":return"bg-(--grass-4) dark:bg-(--grass-5)";case"number":case"integer":return"bg-(--purple-4)";case"string":return"bg-(--blue-4)";case"unknown":return"bg-(--slate-4) dark:bg-(--slate-6)";default:return fs(e),"bg-(--slate-4) dark:bg-(--slate-6)"}};let ks,Ty,gf,Iy,co,Ly,Oy,Ay,Ry,My,uo,Sr,di,zr,yf;oi=class{constructor(e,t){this.singular=e,this._plural=t}pluralize(e){return e===1?this.singular:this.plural}get plural(){return this._plural??`${this.singular}s`}},Yx=class Qk{constructor(t){this.words=t}static of(...t){return new Qk(t.map(a=>typeof a=="string"?new oi(a):a))}join(t,a){return this.words.map(o=>o.pluralize(a)).join(t)}},ks=Bn(),Ty=5,gf={boolean:"bg-(--orange-4) text-(--orange-11)",date:"bg-(--grass-4) text-(--grass-11)",time:"bg-(--grass-4) text-(--grass-11)",datetime:"bg-(--grass-4) text-(--grass-11)",number:"bg-(--purple-4) text-(--purple-11)",integer:"bg-(--purple-4) text-(--purple-11)",string:"bg-(--blue-4) text-(--blue-11)",unknown:"bg-(--slate-4) text-(--slate-11)"},Iy={local:"bg-(--blue-4) text-(--blue-11)",duckdb:"bg-(--amber-4) text-(--amber-11)",connection:"bg-(--green-4) text-(--green-11)",catalog:"bg-(--purple-4) text-(--purple-11)"},co="p-3 min-w-[250px] flex flex-col divide-y",Ly=new oi("column","columns"),Oy=new oi("row","rows"),Ay=new oi("schema","schemas"),Ry=new oi("table","tables"),My=new oi("database","databases"),uo=e=>{let t=(0,ks.c)(6),{icon:a,title:o,badge:s}=e,c;t[0]===o?c=t[1]:(c=(0,P.jsx)("h3",{className:"font-semibold text-sm",children:o}),t[0]=o,t[1]=c);let f;return t[2]!==s||t[3]!==a||t[4]!==c?(f=(0,P.jsxs)("div",{className:"flex items-center gap-2 pb-2",children:[a,c,s]}),t[2]=s,t[3]=a,t[4]=c,t[5]=f):f=t[5],f},Sr=e=>{let t=(0,ks.c)(5),{label:a,value:o}=e,s;t[0]===a?s=t[1]:(s=(0,P.jsxs)("span",{className:"text-(--slate-11)",children:[a,":"]}),t[0]=a,t[1]=s);let c;return t[2]!==s||t[3]!==o?(c=(0,P.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[s,o]}),t[2]=s,t[3]=o,t[4]=c):c=t[4],c},di=e=>{let t=(0,ks.c)(5),{icon:a,text:o}=e,s;t[0]===o?s=t[1]:(s=(0,P.jsx)("span",{className:"text-xs text-(--slate-11)",children:o}),t[0]=o,t[1]=s);let c;return t[2]!==a||t[3]!==s?(c=(0,P.jsxs)("div",{className:"flex items-center gap-1",children:[a,s]}),t[2]=a,t[3]=s,t[4]=c):c=t[4],c},zr=e=>{let t=(0,ks.c)(15),{title:a,items:o,totalCount:s,limit:c}=e,f=a===void 0?"":a,d=c===void 0?Ty:c;if(o.length===0)return null;let m;t[0]!==o||t[1]!==d?(m=o.slice(0,d),t[0]=o,t[1]=d,t[2]=m):m=t[2];let b=m,w=s>d,x;t[3]===f?x=t[4]:(x=f&&(0,P.jsxs)("h4",{className:"text-xs font-medium text-(--slate-11) mb-2",children:[f,":"]}),t[3]=f,t[4]=x);let S;t[5]!==w||t[6]!==d||t[7]!==s?(S=w&&(0,P.jsxs)("div",{className:"text-xs text-(--slate-10) text-center py-1",children:["... and ",s-d," more"]}),t[5]=w,t[6]=d,t[7]=s,t[8]=S):S=t[8];let E;t[9]!==S||t[10]!==b?(E=(0,P.jsxs)("div",{className:"flex flex-col gap-1 overflow-y-auto",children:[b,S]}),t[9]=S,t[10]=b,t[11]=E):E=t[11];let T;return t[12]!==x||t[13]!==E?(T=(0,P.jsxs)("div",{className:"py-2",children:[x,E]}),t[12]=x,t[13]=E,t[14]=T):T=t[14],T},yf=e=>gf[e]||gf.unknown;const LS=e=>{var f,d;let t=e.type==="view"?(0,P.jsx)(Md,{className:"w-4 h-4 text-(--blue-9)"}):(0,P.jsx)(Zi,{className:"w-4 h-4 text-(--green-9)"}),a=(0,P.jsx)(Vn,{variant:"secondary",className:`text-xs ${e.type==="view"?"bg-(--blue-4) text-(--blue-11)":"bg-(--green-4) text-(--green-11)"}`,children:e.type}),o=e.columns.map(m=>{let b=kd[m.type];return(0,P.jsxs)("div",{className:"flex items-center justify-between text-xs rounded",children:[(0,P.jsxs)("div",{className:"flex items-center gap-2",children:[(0,P.jsx)(b,{className:"w-3 h-3 text-(--slate-9)"}),(0,P.jsx)("span",{className:"font-mono",children:m.name})]}),(0,P.jsx)(Vn,{variant:"outline",className:`text-xs ${yf(m.type)}`,children:m.type})]},m.name)}),s=e.primary_keys&&e.primary_keys.length>0,c=e.indexes&&e.indexes.length>0;return(0,P.jsxs)("div",{className:`${co} min-w-[300px]`,children:[(0,P.jsx)(uo,{icon:t,title:e.name,badge:a}),(0,P.jsxs)("div",{className:"flex flex-col gap-2 py-2",children:[(0,P.jsx)(Sr,{label:"Source",value:(0,P.jsx)(Vn,{variant:"outline",className:`text-xs ${Iy[e.source_type]}`,children:e.source})}),e.variable_name&&(0,P.jsx)(Sr,{label:"Variable",value:(0,P.jsx)("code",{className:"text-xs bg-(--slate-4) px-1 rounded",children:e.variable_name})}),e.engine&&(0,P.jsx)(Sr,{label:"Engine",value:(0,P.jsx)("code",{className:"text-xs bg-(--slate-4) px-1 rounded",children:e.engine})})]}),(e.num_columns!=null||e.num_rows!=null)&&(0,P.jsxs)("div",{className:"grid grid-cols-2 gap-2 py-2",children:[e.num_columns!=null&&(0,P.jsx)(di,{icon:(0,P.jsx)(xm,{className:"w-3 h-3 text-(--slate-9)"}),text:`${e.num_columns} ${Ly.pluralize(e.num_columns)}`}),e.num_rows!=null&&(0,P.jsx)(di,{icon:(0,P.jsx)(cm,{className:"w-3 h-3 text-(--slate-9)"}),text:`${e.num_rows} ${Oy.pluralize(e.num_rows)}`})]}),e.columns.length===0&&rc("column"),(s||c)&&(0,P.jsxs)("div",{className:"flex flex-col gap-2 py-2",children:[s&&(0,P.jsxs)("div",{className:"flex flex-row gap-1",children:[(0,P.jsxs)("div",{className:"flex items-center gap-1",children:[(0,P.jsx)(IL,{className:"w-3 h-3 text-(--amber-9)"}),(0,P.jsx)("span",{className:"text-xs font-medium text-(--slate-11)",children:"Primary Keys:"})]}),(f=e.primary_keys)==null?void 0:f.map(m=>(0,P.jsx)(Vn,{variant:"outline",className:"text-xs text-(--slate-11)",children:m},m))]}),c&&(0,P.jsxs)("div",{className:"flex flex-row gap-1",children:[(0,P.jsxs)("div",{className:"flex items-center gap-1 mb-1",children:[(0,P.jsx)(Nm,{className:"w-3 h-3 text-(--purple-9)"}),(0,P.jsx)("span",{className:"text-xs font-medium text-(--slate-11)",children:"Indexes:"})]}),(d=e.indexes)==null?void 0:d.map(m=>(0,P.jsx)(Vn,{variant:"outline",className:"text-xs text-(--slate-11)",children:m},m))]})]}),e.columns.length>0&&(0,P.jsx)(zr,{items:o,totalCount:e.columns.length})]})},OS=e=>{var s;let t=kd[e.type],a=(0,P.jsx)(Vn,{variant:"outline",className:`text-xs ${yf(e.type)}`,children:e.type}),o=((s=e.sample_values)==null?void 0:s.map((c,f)=>(0,P.jsx)("div",{className:"text-xs bg-(--slate-3) rounded font-mono",children:c==null?"null":String(c)},f)))||[];return(0,P.jsxs)("div",{className:co,children:[(0,P.jsx)(uo,{icon:(0,P.jsx)(t,{className:"w-4 h-4 text-(--slate-9)"}),title:e.name,badge:a}),(0,P.jsxs)("div",{className:"flex flex-col gap-2 mt-2",children:[(0,P.jsx)(Sr,{label:"Type",value:(0,P.jsx)("span",{className:"font-medium",children:e.type})}),(0,P.jsx)(Sr,{label:"External Type",value:(0,P.jsx)("code",{className:"text-xs bg-(--slate-4) px-1 rounded",children:e.external_type})})]}),e.sample_values&&e.sample_values.length>0&&(0,P.jsx)(zr,{title:"Sample Values",items:o,totalCount:e.sample_values.length})]})},AS=e=>{let t=(0,P.jsx)(Vn,{variant:"outline",className:"text-xs bg-(--blue-4) text-(--blue-11)",children:e.dialect}),a=e.schemas.map(o=>(0,P.jsxs)("div",{className:"flex items-center justify-between text-xs rounded hover:bg-(--slate-3)",children:[(0,P.jsxs)("div",{className:"flex items-center gap-2",children:[(0,P.jsx)(no,{className:"w-3 h-3 text-(--slate-9)"}),(0,P.jsx)("span",{children:o.name})]}),(0,P.jsxs)(Vn,{variant:"outline",className:"text-xs",children:[o.tables.length," ",Ry.pluralize(o.tables.length)]})]},o.name));return(0,P.jsxs)("div",{className:co,children:[(0,P.jsx)(uo,{icon:(0,P.jsx)(ys,{className:"w-4 h-4 text-(--blue-9)"}),title:e.name,badge:t}),(0,P.jsxs)("div",{className:"flex flex-col gap-2 py-2",children:[(0,P.jsx)(Sr,{label:"Dialect",value:(0,P.jsx)("span",{className:"font-medium",children:e.dialect})}),e.engine&&(0,P.jsx)(Sr,{label:"Engine",value:(0,P.jsx)("code",{className:"text-xs bg-(--slate-4) px-1 rounded",children:e.engine})})]}),(0,P.jsx)("div",{className:"py-2",children:(0,P.jsx)(di,{icon:(0,P.jsx)(no,{className:"w-3 h-3 text-(--slate-9)"}),text:`${e.schemas.length} schema${e.schemas.length===1?"":"s"}`})}),e.schemas.length===0&&rc("schema"),e.schemas.length>0&&(0,P.jsx)(zr,{title:"Schemas",items:a,totalCount:e.schemas.length})]})},RS=e=>{let t=(0,P.jsx)(Vn,{variant:"outline",className:"text-xs bg-(--green-4) text-(--green-11)",children:"Schema"}),a=e.tables.map(o=>(0,P.jsxs)("div",{className:"flex items-center justify-between text-xs rounded hover:bg-(--slate-3)",children:[(0,P.jsxs)("div",{className:"flex items-center gap-2",children:[o.type==="view"?(0,P.jsx)(Md,{className:"w-3 h-3 text-(--blue-9)"}):(0,P.jsx)(Zi,{className:"w-3 h-3 text-(--green-9)"}),(0,P.jsx)("span",{children:o.name})]}),(0,P.jsx)(Vn,{variant:"outline",className:`text-xs ${o.type==="view"?"bg-(--blue-4) text-(--blue-11)":"bg-(--green-4) text-(--green-11)"}`,children:o.type})]},o.name));return(0,P.jsxs)("div",{className:co,children:[(0,P.jsx)(uo,{icon:(0,P.jsx)(no,{className:"w-4 h-4 text-(--green-9)"}),title:e.name,badge:t}),(0,P.jsx)("div",{className:"py-2",children:(0,P.jsx)(di,{icon:(0,P.jsx)(Zi,{className:"w-3 h-3 text-(--slate-9)"}),text:`${e.tables.length} table${e.tables.length===1?"":"s"}`})}),e.tables.length===0&&rc("table"),e.tables.length>0&&(0,P.jsx)(zr,{title:"Tables",items:a,totalCount:e.tables.length})]})};var Py=(0,P.jsx)(Vn,{variant:"outline",children:"default"}),MS=8,Ny=3;let rc;Ck=(e,t)=>{let a=e.databases.length,o=e.databases.reduce((m,b)=>m+b.schemas.length,0),s=(m,b)=>{if(m.tables.length===0)return null;let w=m.name===e.default_schema&&b,x=[];return o<MS&&(x=m.tables.slice(0,Ny+1).map(S=>(0,P.jsxs)("div",{className:"flex items-center gap-2 ml-4",children:[(0,P.jsx)(Zi,{className:"w-3 h-3 text-(--green-9)"}),(0,P.jsx)("span",{className:"text-xs",children:S.name})]},S.name))),(0,P.jsxs)("div",{children:[(0,P.jsxs)("div",{className:"flex items-center gap-2 text-xs rounded hover:bg-(--slate-3) ml-2",children:[(0,P.jsx)(no,{className:"w-3 h-3 text-(--slate-9)"}),(0,P.jsx)("span",{children:m.name}),w&&Py,(0,P.jsxs)(Vn,{variant:"outline",className:"text-xs ml-auto",children:[m.tables.length," tables"]})]}),(0,P.jsx)(zr,{items:x,totalCount:m.tables.length,limit:Ny})]},m.name)},c=e.databases.map(m=>{let b=m.name===e.default_database||e.databases.length===1,w=m.schemas.map(x=>s(x,b));return(0,P.jsxs)("div",{children:[(0,P.jsxs)("div",{className:"flex items-center gap-2",children:[(0,P.jsx)(ys,{className:"w-3 h-3 text-(--blue-9)"}),(0,P.jsx)("span",{className:"text-xs",children:m.name}),b&&Py]}),w&&(0,P.jsx)(zr,{items:w,totalCount:m.schemas.length})]},m.name)}),f=e.name;eo.has(e.name)&&(f="In-Memory");let d=t==null?void 0:t.map(m=>(0,P.jsxs)("div",{className:"flex items-center gap-2",children:[(0,P.jsx)(Zi,{className:"w-3 h-3 text-(--blue-9)"}),(0,P.jsx)("span",{className:"text-xs",children:m.name})]},m.name));return(0,P.jsxs)("div",{className:`${co} px-1`,children:[(0,P.jsx)(uo,{icon:(0,P.jsx)(xy,{className:"w-4 h-4 text-(--purple-9)"}),title:f}),(0,P.jsxs)("div",{className:"flex flex-col gap-2 py-2",children:[(0,P.jsx)(Sr,{label:"Dialect",value:(0,P.jsx)("span",{className:"font-medium",children:Vl(e.dialect)})}),(0,P.jsx)(Sr,{label:"Source",value:(0,P.jsx)(Vn,{variant:"outline",className:"text-xs bg-(--green-4) text-(--green-11)",children:e.source})})]}),(0,P.jsxs)("div",{className:"flex flex-row justify-between py-2",children:[(0,P.jsx)(di,{icon:(0,P.jsx)(ys,{className:"w-3 h-3 text-(--slate-9)"}),text:`${a} ${My.pluralize(a)}`}),(0,P.jsx)(di,{icon:(0,P.jsx)(no,{className:"w-3 h-3 text-(--slate-9)"}),text:`${o} ${Ay.pluralize(o)}`})]}),a>0&&(0,P.jsx)(zr,{items:c,totalCount:a}),d&&d.length>0&&(0,P.jsx)(zr,{title:"Dataframes",items:d,totalCount:d.length})]})},rc=e=>(0,P.jsxs)("div",{className:"flex items-start gap-2 mt-3",children:[(0,P.jsx)(ld,{size:10,className:"mt-1 text-(--slate-10) shrink-0"}),(0,P.jsxs)("span",{className:"text-xs text-(--slate-11)",children:["No ",e," information available.",`
32
- `,(0,P.jsx)("span",{className:"text-(--blue-10)",children:"Introspect to see more details."})]})]});var ac=Rd(),Dy=class{constructor(){we(this,"schema",{})}addTable(e,t){let a={self:NS({table:t}),children:t.columns.map(o=>PS({column:o}))};return this.setAt([...e,t.name],a),this}addSchema(e,t){let a={self:DS({namespace:t,path:e}),children:{}};return this.setAt(e,a),this}addDatabase(e,t){let a={self:jS({namespace:t,path:e}),children:{}};return this.setAt(e,a),this}setAt(e,t){let a=this.schema;for(let o of e.slice(0,-1))a[o]||(a[o]={children:{}}),a=a[o].children;a[e[e.length-1]]=t}build(){return this.schema}reset(){return this.schema={},this}};function PS(e){return{label:e.column.name,type:"column",info:()=>{let t=document.createElement("div");return(0,ac.createRoot)(t).render(OS(e.column)),{dom:t}}}}function NS(e){return{label:e.table.name,type:"table",info:()=>{let t=document.createElement("div");return(0,ac.createRoot)(t).render(LS(e.table)),{dom:t}}}}function DS(e){return{label:e.namespace.name,detail:e.path.join("."),type:"schema",info:()=>{let t=document.createElement("div");return(0,ac.createRoot)(t).render(RS(e.namespace)),{dom:t}}}}function jS(e){return{label:e.namespace.name,detail:e.path.join("."),type:"database",info:()=>{let t=document.createElement("div");return(0,ac.createRoot)(t).render(AS(e.namespace)),{dom:t}}}}var zS=Ee(e=>{let t=e(dd),a=new Dy;for(let o of t)a.addTable([],o);return a.build()}),qS=class{constructor(){this.cache=new nc(10,{create:e=>this.getConnectionSchema(e)})}getConnection(e){return Te.get(nd).get(e)}getConnectionSchema(e){var f;let{default_database:t,databases:a,default_schema:o}=e,s=new Dy,c=a.find(d=>d.name===t||a.length===1);if(((f=c??a[0])==null?void 0:f.schemas.some(d=>Bl(d.name)))??!1){for(let d of a){let m=d.name===(c==null?void 0:c.name),b=d.schemas.flatMap(w=>w.tables);s.addDatabase([d.name],d);for(let w of b)m?s.addTable([],w):s.addTable([d.name],w)}return{shouldAddLocalTables:!1,schema:s.build(),defaultSchema:c==null?void 0:c.name}}if(c)for(let d of c.schemas){s.addSchema([d.name],d);for(let m of d.tables)s.addTable([d.name],m)}for(let d of a){s.addDatabase([d.name],d);for(let m of d.schemas){s.addSchema([d.name,m.name],m);for(let b of m.tables)s.addTable([d.name,m.name],b)}}return{shouldAddLocalTables:!0,schema:s.build(),defaultSchema:o??void 0}}getInternalDialect(e){let t=this.getConnection(e);return t?t.dialect.toLowerCase():null}getDialect(e){let t=this.getConnection(e);return t?vy(t):_s}getCompletionSource(e){let t=this.getConnection(e);if(!t)return null;let a=()=>Te.get(zS),o=this.cache.getOrCreate(t);return{dialect:vy(t),schema:o.shouldAddLocalTables?{...o.schema,...a()}:o.schema,defaultSchema:o.defaultSchema,defaultTable:FS(t)}}};function FS(e){if(e.databases.length!==1)return;let t=e.databases[0];if(t.schemas.length!==1)return;let a=t.schemas[0];if(a.tables.length===1)return a.tables[0].name}const fi=new qS,Cs=_r.define();gd=async function(e){let{sendFormat:t}=ir(),a=Pr.mapValues(e,s=>xr(s)),o=await t({codes:a,lineLength:i_().formatting.line_length});for(let[s,c]of Pr.entries(o.codes)){let f=s,d=a[f],m=e[f];m&&c!==d&&(m.state.facet(st).updateCellCode({cellId:f,code:c,formattingChange:!0}),Yi(m,c))}},uk=function(){return gd(t0(Cd()))};async function BS(e,t){let{formatDialect:a}=await ne(async()=>{let{formatDialect:x}=await import("./esm-D6WfbcL3.js").then(async S=>(await S.__tla,S));return{formatDialect:x}},__vite__mapDeps([0,1]),import.meta.url),o=await VS(fi.getInternalDialect(t)),s=e.state.field(Hn),c=S8(e.state);if(s.type!=="sql"){_e.error("Language adapter is not SQL");return}let f=e.state.doc.toString(),d;try{d=a(f,{dialect:o,tabWidth:c,useTabs:!1})}catch(x){_e.error("Error formatting SQL",{error:x});return}let m=s.transformIn(d)[0],b=e.state.facet(st),w=e.state.facet(Zl);b.updateCellCode({cellId:w,code:m,formattingChange:!0}),sd(e,d,{effects:[Cs.of(!0)]})}async function VS(e){let{bigquery:t,db2:a,db2i:o,duckdb:s,hive:c,mariadb:f,mysql:d,tidb:m,n1ql:b,plsql:w,postgresql:x,redshift:S,spark:E,sqlite:T,sql:M,trino:z,transactsql:B,singlestoredb:V,snowflake:N}=await ne(async()=>{let{bigquery:ce,db2:A,db2i:q,duckdb:$,hive:ie,mariadb:fe,mysql:me,tidb:ve,n1ql:ae,plsql:de,postgresql:be,redshift:oe,spark:le,sqlite:G,sql:Oe,trino:He,transactsql:et,singlestoredb:Fe,snowflake:Ne}=await import("./esm-D6WfbcL3.js").then(async Le=>(await Le.__tla,Le));return{bigquery:ce,db2:A,db2i:q,duckdb:$,hive:ie,mariadb:fe,mysql:me,tidb:ve,n1ql:ae,plsql:de,postgresql:be,redshift:oe,spark:le,sqlite:G,sql:Oe,trino:He,transactsql:et,singlestoredb:Fe,snowflake:Ne}},__vite__mapDeps([0,1]),import.meta.url),X=M;if(!e||!ec(e))return X;switch(e){case"mysql":return d;case"mariadb":return f;case"postgres":case"postgresql":return x;case"sqlite":return T;case"db2":return a;case"db2i":return o;case"hive":return c;case"redshift":return S;case"snowflake":return N;case"trino":return z;case"tidb":return m;case"oracle":case"oracledb":return w;case"spark":return E;case"singlestoredb":return V;case"couchbase":return b;case"bigquery":return t;case"duckdb":return s;case"mssql":case"sqlserver":case"microsoft sql server":return B;case"athena":case"awsathena":case"cassandra":case"noql":case"flink":case"mongodb":case"timescaledb":case"datafusion":case"dremio":return M;case"databricks":return E;default:return fs(e),X}}var HS=Rd();function $S(e,t){let a=document.createElement("div"),o;return{dom:a,mount(){o=(0,HS.createRoot)(a),o.render((0,P.jsx)(Yw,{store:Te,children:(0,P.jsx)(t,{view:e})}))},update(){o==null||o.render((0,P.jsx)(Yw,{store:Te,children:(0,P.jsx)(t,{view:e})}))},destroy(){o==null||o.unmount()}}}function he(e){return new S_(x_.define(e))}function xa(e){return ne(()=>import("./dist-D6Iobl3P.js").then(async t=>(await t.__tla,t)),__vite__mapDeps([2,3,4,5]),import.meta.url).then(t=>t.sql({dialect:t[e]}))}var WS=[te.of({name:"C",extensions:["c","h","ino"],load(){return ne(()=>import("./dist-DGhK0kPE.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([6,7,5]),import.meta.url).then(e=>e.cpp())}}),te.of({name:"C++",alias:["cpp"],extensions:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],load(){return ne(()=>import("./dist-DGhK0kPE.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([6,7,5]),import.meta.url).then(e=>e.cpp())}}),te.of({name:"CQL",alias:["cassandra"],extensions:["cql"],load(){return xa("Cassandra")}}),te.of({name:"CSS",extensions:["css"],load(){return ne(()=>import("./dist-Bfm9U3vp.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([8,9,5]),import.meta.url).then(e=>e.css())}}),te.of({name:"Go",extensions:["go"],load(){return ne(()=>import("./dist-CECF_J8y.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([10,11,4,5]),import.meta.url).then(e=>e.go())}}),te.of({name:"HTML",alias:["xhtml"],extensions:["html","htm","handlebars","hbs"],load(){return ne(()=>import("./dist-Csf5i4KY.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([12,9,5,13,14,4]),import.meta.url).then(e=>e.html())}}),te.of({name:"Java",extensions:["java"],load(){return ne(()=>import("./dist-xSLg7wNV.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([15,16,5]),import.meta.url).then(e=>e.java())}}),te.of({name:"JavaScript",alias:["ecmascript","js","node"],extensions:["js","mjs","cjs"],load(){return ne(()=>import("./dist-DrBqBDHF.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([17,14,4,5]),import.meta.url).then(e=>e.javascript())}}),te.of({name:"Jinja",extensions:["j2","jinja","jinja2"],load(){return ne(()=>import("./dist-BMOD2Pyh.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([18,9,5,13,14,4,19]),import.meta.url).then(e=>e.jinja())}}),te.of({name:"JSON",alias:["json5"],extensions:["json","map"],load(){return ne(()=>import("./dist-CDUl-YL4.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([20,21,5]),import.meta.url).then(e=>e.json())}}),te.of({name:"JSX",extensions:["jsx"],load(){return ne(()=>import("./dist-DrBqBDHF.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([17,14,4,5]),import.meta.url).then(e=>e.javascript({jsx:!0}))}}),te.of({name:"LESS",extensions:["less"],load(){return ne(()=>import("./dist-sPfKr-vH.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([22,9,5,23]),import.meta.url).then(e=>e.less())}}),te.of({name:"Liquid",extensions:["liquid"],load(){return ne(()=>import("./dist-CRrIf3gB.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([24,9,5,13,14,4,25]),import.meta.url).then(e=>e.liquid())}}),te.of({name:"MariaDB SQL",load(){return xa("MariaSQL")}}),te.of({name:"Markdown",extensions:["md","markdown","mkd"],load(){return ne(()=>import("./dist-CvWC93qL.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([26,9,5,13,14,4,27]),import.meta.url).then(e=>e.markdown())}}),te.of({name:"MS SQL",load(){return xa("MSSQL")}}),te.of({name:"MySQL",load(){return xa("MySQL")}}),te.of({name:"PHP",extensions:["php","php3","php4","php5","php7","phtml"],load(){return ne(()=>import("./dist-R1kU4nzJ.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([28,9,5,13,14,4,29]),import.meta.url).then(e=>e.php())}}),te.of({name:"PLSQL",extensions:["pls"],load(){return xa("PLSQL")}}),te.of({name:"PostgreSQL",load(){return xa("PostgreSQL")}}),te.of({name:"Python",extensions:["BUILD","bzl","py","pyw"],filename:/^(BUCK|BUILD)$/,load(){return ne(()=>import("./dist-DsfPGbgk.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([30,31,4,5]),import.meta.url).then(e=>e.python())}}),te.of({name:"Rust",extensions:["rs"],load(){return ne(()=>import("./dist-CCAhuqF-.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([32,33,5]),import.meta.url).then(e=>e.rust())}}),te.of({name:"Sass",extensions:["sass"],load(){return ne(()=>import("./dist-0QUuSoRx.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([34,9,5,35]),import.meta.url).then(e=>e.sass({indented:!0}))}}),te.of({name:"SCSS",extensions:["scss"],load(){return ne(()=>import("./dist-0QUuSoRx.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([34,9,5,35]),import.meta.url).then(e=>e.sass())}}),te.of({name:"SQL",extensions:["sql"],load(){return xa("StandardSQL")}}),te.of({name:"SQLite",load(){return xa("SQLite")}}),te.of({name:"TSX",extensions:["tsx"],load(){return ne(()=>import("./dist-DrBqBDHF.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([17,14,4,5]),import.meta.url).then(e=>e.javascript({jsx:!0,typescript:!0}))}}),te.of({name:"TypeScript",alias:["ts"],extensions:["ts","mts","cts"],load(){return ne(()=>import("./dist-DrBqBDHF.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([17,14,4,5]),import.meta.url).then(e=>e.javascript({typescript:!0}))}}),te.of({name:"WebAssembly",extensions:["wat","wast"],load(){return ne(()=>import("./dist-SVDIDTM2.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([36,37,5]),import.meta.url).then(e=>e.wast())}}),te.of({name:"XML",alias:["rss","wsdl","xsd"],extensions:["xml","xsl","xsd","svg"],load(){return ne(()=>import("./dist-BsphJPAV.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([38,39,5]),import.meta.url).then(e=>e.xml())}}),te.of({name:"YAML",alias:["yml"],extensions:["yaml","yml"],load(){return ne(()=>import("./dist-6c4zOh78.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([40,41,5]),import.meta.url).then(e=>e.yaml())}}),te.of({name:"APL",extensions:["dyalog","apl"],load(){return ne(()=>import("./apl-DTwRFDps.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([42,43]),import.meta.url).then(e=>he(e.apl))}}),te.of({name:"PGP",alias:["asciiarmor"],extensions:["asc","pgp","sig"],load(){return ne(()=>import("./asciiarmor-CiqkDK0s.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([44,45]),import.meta.url).then(e=>he(e.asciiArmor))}}),te.of({name:"ASN.1",extensions:["asn","asn1"],load(){return ne(()=>import("./asn1-RTvH5MEs.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([46,47]),import.meta.url).then(e=>he(e.asn1({})))}}),te.of({name:"Asterisk",filename:/^extensions\.conf$/i,load(){return ne(()=>import("./asterisk-9U_4Kgke.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>he(e.asterisk))}}),te.of({name:"Brainfuck",extensions:["b","bf"],load(){return ne(()=>import("./brainfuck-szH_VGzd.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([48,49]),import.meta.url).then(e=>he(e.brainfuck))}}),te.of({name:"Cobol",extensions:["cob","cpy"],load(){return ne(()=>import("./cobol-BJJRqW1D.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([50,51]),import.meta.url).then(e=>he(e.cobol))}}),te.of({name:"C#",alias:["csharp","cs"],extensions:["cs"],load(){return ne(()=>import("./clike-DKPr2D1_.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([52,53]),import.meta.url).then(e=>he(e.csharp))}}),te.of({name:"Clojure",extensions:["clj","cljc","cljx"],load(){return ne(()=>import("./clojure-CyEbLmch.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([54,55]),import.meta.url).then(e=>he(e.clojure))}}),te.of({name:"ClojureScript",extensions:["cljs"],load(){return ne(()=>import("./clojure-CyEbLmch.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([54,55]),import.meta.url).then(e=>he(e.clojure))}}),te.of({name:"Closure Stylesheets (GSS)",extensions:["gss"],load(){return ne(()=>import("./css-DsUcFZz8.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([56,57]),import.meta.url).then(e=>he(e.gss))}}),te.of({name:"CMake",extensions:["cmake","cmake.in"],filename:/^CMakeLists\.txt$/,load(){return ne(()=>import("./cmake-Dk8f7QuI.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([58,59]),import.meta.url).then(e=>he(e.cmake))}}),te.of({name:"CoffeeScript",alias:["coffee","coffee-script"],extensions:["coffee"],load(){return ne(()=>import("./coffeescript-BDuWJ9WO.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([60,61]),import.meta.url).then(e=>he(e.coffeeScript))}}),te.of({name:"Common Lisp",alias:["lisp"],extensions:["cl","lisp","el"],load(){return ne(()=>import("./commonlisp-CVHm2VSp.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([62,63]),import.meta.url).then(e=>he(e.commonLisp))}}),te.of({name:"Cypher",extensions:["cyp","cypher"],load(){return ne(()=>import("./cypher-CUlCm6vR.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([64,65]),import.meta.url).then(e=>he(e.cypher))}}),te.of({name:"Cython",extensions:["pyx","pxd","pxi"],load(){return ne(()=>import("./python-_Mr8fyXP.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([66,67]),import.meta.url).then(e=>he(e.cython))}}),te.of({name:"Crystal",extensions:["cr"],load(){return ne(()=>import("./crystal-C2Fgr79A.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([68,69]),import.meta.url).then(e=>he(e.crystal))}}),te.of({name:"D",extensions:["d"],load(){return ne(()=>import("./d-4ANEHA6q.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([70,71]),import.meta.url).then(e=>he(e.d))}}),te.of({name:"Dart",extensions:["dart"],load(){return ne(()=>import("./clike-DKPr2D1_.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([52,53]),import.meta.url).then(e=>he(e.dart))}}),te.of({name:"diff",extensions:["diff","patch"],load(){return ne(()=>import("./diff-C-W-5V8L.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([72,73]),import.meta.url).then(e=>he(e.diff))}}),te.of({name:"Dockerfile",filename:/^Dockerfile$/,load(){return ne(()=>import("./dockerfile-C2PznFWk.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([74,75]),import.meta.url).then(e=>he(e.dockerFile))}}),te.of({name:"DTD",extensions:["dtd"],load(){return ne(()=>import("./dtd-D9h-tL8G.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([76,77]),import.meta.url).then(e=>he(e.dtd))}}),te.of({name:"Dylan",extensions:["dylan","dyl","intr"],load(){return ne(()=>import("./dylan-D3MC56xy.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([78,79]),import.meta.url).then(e=>he(e.dylan))}}),te.of({name:"EBNF",load(){return ne(()=>import("./ebnf-Cnws41cu.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>he(e.ebnf))}}),te.of({name:"ECL",extensions:["ecl"],load(){return ne(()=>import("./ecl-B6UC4tME.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([80,81]),import.meta.url).then(e=>he(e.ecl))}}),te.of({name:"edn",extensions:["edn"],load(){return ne(()=>import("./clojure-CyEbLmch.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([54,55]),import.meta.url).then(e=>he(e.clojure))}}),te.of({name:"Eiffel",extensions:["e"],load(){return ne(()=>import("./eiffel-CjvEov4k.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([82,83]),import.meta.url).then(e=>he(e.eiffel))}}),te.of({name:"Elm",extensions:["elm"],load(){return ne(()=>import("./elm-DvSbvRWe.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([84,85]),import.meta.url).then(e=>he(e.elm))}}),te.of({name:"Erlang",extensions:["erl"],load(){return ne(()=>import("./erlang-DJYaGXyq.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([86,87]),import.meta.url).then(e=>he(e.erlang))}}),te.of({name:"Esper",load(){return ne(()=>import("./sql-tYjnWETe.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>he(e.esper))}}),te.of({name:"Factor",extensions:["factor"],load(){return ne(()=>import("./factor-CUQCrkTo.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([88,89,75]),import.meta.url).then(e=>he(e.factor))}}),te.of({name:"FCL",load(){return ne(()=>import("./fcl-CwkPc-_9.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>he(e.fcl))}}),te.of({name:"Forth",extensions:["forth","fth","4th"],load(){return ne(()=>import("./forth-D9xegiCO.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([90,91]),import.meta.url).then(e=>he(e.forth))}}),te.of({name:"Fortran",extensions:["f","for","f77","f90","f95"],load(){return ne(()=>import("./fortran-B0Oe0U8s.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([92,93]),import.meta.url).then(e=>he(e.fortran))}}),te.of({name:"F#",alias:["fsharp"],extensions:["fs"],load(){return ne(()=>import("./mllike-C1DLZhEI.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([94,95]),import.meta.url).then(e=>he(e.fSharp))}}),te.of({name:"Gas",extensions:["s"],load(){return ne(()=>import("./gas-jLjj-PIq.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([96,97]),import.meta.url).then(e=>he(e.gas))}}),te.of({name:"Gherkin",extensions:["feature"],load(){return ne(()=>import("./gherkin-3Ig8Crit.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([98,99]),import.meta.url).then(e=>he(e.gherkin))}}),te.of({name:"Groovy",extensions:["groovy","gradle"],filename:/^Jenkinsfile$/,load(){return ne(()=>import("./groovy-NKpNVJ-n.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([100,101]),import.meta.url).then(e=>he(e.groovy))}}),te.of({name:"Haskell",extensions:["hs"],load(){return ne(()=>import("./haskell-OPE4bAjk.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([102,103]),import.meta.url).then(e=>he(e.haskell))}}),te.of({name:"Haxe",extensions:["hx"],load(){return ne(()=>import("./haxe-DEAZF8L3.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([104,105]),import.meta.url).then(e=>he(e.haxe))}}),te.of({name:"HXML",extensions:["hxml"],load(){return ne(()=>import("./haxe-DEAZF8L3.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([104,105]),import.meta.url).then(e=>he(e.hxml))}}),te.of({name:"HTTP",load(){return ne(()=>import("./http-BQNSD-HR.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>he(e.http))}}),te.of({name:"IDL",extensions:["pro"],load(){return ne(()=>import("./idl-BM6265Xl.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([106,107]),import.meta.url).then(e=>he(e.idl))}}),te.of({name:"JSON-LD",alias:["jsonld"],extensions:["jsonld"],load(){return ne(()=>import("./javascript-CZ9vDpAy.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([108,109]),import.meta.url).then(e=>he(e.jsonld))}}),te.of({name:"Julia",extensions:["jl"],load(){return ne(()=>import("./julia-BrY9TQnt.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([110,111]),import.meta.url).then(e=>he(e.julia))}}),te.of({name:"Kotlin",extensions:["kt","kts"],load(){return ne(()=>import("./clike-DKPr2D1_.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([52,53]),import.meta.url).then(e=>he(e.kotlin))}}),te.of({name:"LiveScript",alias:["ls"],extensions:["ls"],load(){return ne(()=>import("./livescript-CNahkUp5.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([112,113]),import.meta.url).then(e=>he(e.liveScript))}}),te.of({name:"Lua",extensions:["lua"],load(){return ne(()=>import("./lua-Skr4TVu_.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([114,115]),import.meta.url).then(e=>he(e.lua))}}),te.of({name:"mIRC",extensions:["mrc"],load(){return ne(()=>import("./mirc-CffYPE4R.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([116,117]),import.meta.url).then(e=>he(e.mirc))}}),te.of({name:"Mathematica",extensions:["m","nb","wl","wls"],load(){return ne(()=>import("./mathematica-BXxhrpeY.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([118,119]),import.meta.url).then(e=>he(e.mathematica))}}),te.of({name:"Modelica",extensions:["mo"],load(){return ne(()=>import("./modelica-CvAyRRNV.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([120,121]),import.meta.url).then(e=>he(e.modelica))}}),te.of({name:"MUMPS",extensions:["mps"],load(){return ne(()=>import("./mumps-DFJehEx7.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([122,123]),import.meta.url).then(e=>he(e.mumps))}}),te.of({name:"Mbox",extensions:["mbox"],load(){return ne(()=>import("./mbox-BRrQCVe9.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([124,125]),import.meta.url).then(e=>he(e.mbox))}}),te.of({name:"Nginx",filename:/nginx.*\.conf$/i,load(){return ne(()=>import("./nginx-Cm282mo8.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>he(e.nginx))}}),te.of({name:"NSIS",extensions:["nsh","nsi"],load(){return ne(()=>import("./nsis-BVI9YULz.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([126,127,75]),import.meta.url).then(e=>he(e.nsis))}}),te.of({name:"NTriples",extensions:["nt","nq"],load(){return ne(()=>import("./ntriples-Bcdh7b2H.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([128,129]),import.meta.url).then(e=>he(e.ntriples))}}),te.of({name:"Objective-C",alias:["objective-c","objc"],extensions:["m"],load(){return ne(()=>import("./clike-DKPr2D1_.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([52,53]),import.meta.url).then(e=>he(e.objectiveC))}}),te.of({name:"Objective-C++",alias:["objective-c++","objc++"],extensions:["mm"],load(){return ne(()=>import("./clike-DKPr2D1_.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([52,53]),import.meta.url).then(e=>he(e.objectiveCpp))}}),te.of({name:"OCaml",extensions:["ml","mli","mll","mly"],load(){return ne(()=>import("./mllike-C1DLZhEI.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([94,95]),import.meta.url).then(e=>he(e.oCaml))}}),te.of({name:"Octave",extensions:["m"],load(){return ne(()=>import("./octave-CdAKz6YS.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([130,131]),import.meta.url).then(e=>he(e.octave))}}),te.of({name:"Oz",extensions:["oz"],load(){return ne(()=>import("./oz-DSySeR-W.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([132,133]),import.meta.url).then(e=>he(e.oz))}}),te.of({name:"Pascal",extensions:["p","pas"],load(){return ne(()=>import("./pascal-DefziIUN.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([134,135]),import.meta.url).then(e=>he(e.pascal))}}),te.of({name:"Perl",extensions:["pl","pm"],load(){return ne(()=>import("./perl-BOOloBPk.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([136,137]),import.meta.url).then(e=>he(e.perl))}}),te.of({name:"Pig",extensions:["pig"],load(){return ne(()=>import("./pig-f0nBb-5x.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([138,139]),import.meta.url).then(e=>he(e.pig))}}),te.of({name:"PowerShell",extensions:["ps1","psd1","psm1"],load(){return ne(()=>import("./powershell-DToQjbK9.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([140,141]),import.meta.url).then(e=>he(e.powerShell))}}),te.of({name:"Properties files",alias:["ini","properties"],extensions:["properties","ini","in"],load(){return ne(()=>import("./properties-BRob-nyj.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([142,143]),import.meta.url).then(e=>he(e.properties))}}),te.of({name:"ProtoBuf",extensions:["proto"],load(){return ne(()=>import("./protobuf-DZyC6051.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([144,145]),import.meta.url).then(e=>he(e.protobuf))}}),te.of({name:"Pug",alias:["jade"],extensions:["pug","jade"],load(){return ne(()=>import("./pug-pVoM8FRt.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([146,147,109]),import.meta.url).then(e=>he(e.pug))}}),te.of({name:"Puppet",extensions:["pp"],load(){return ne(()=>import("./puppet-9fuYG07F.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([148,149]),import.meta.url).then(e=>he(e.puppet))}}),te.of({name:"Q",extensions:["q"],load(){return ne(()=>import("./q-D73s4Y77.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([150,151]),import.meta.url).then(e=>he(e.q))}}),te.of({name:"R",alias:["rscript"],extensions:["r","R"],load(){return ne(()=>import("./r-BOEjz92e.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([152,153]),import.meta.url).then(e=>he(e.r))}}),te.of({name:"RPM Changes",load(){return ne(()=>import("./rpm-LpXWTM5t.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([154,155]),import.meta.url).then(e=>he(e.rpmChanges))}}),te.of({name:"RPM Spec",extensions:["spec"],load(){return ne(()=>import("./rpm-LpXWTM5t.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([154,155]),import.meta.url).then(e=>he(e.rpmSpec))}}),te.of({name:"Ruby",alias:["jruby","macruby","rake","rb","rbx"],extensions:["rb"],filename:/^(Gemfile|Rakefile)$/,load(){return ne(()=>import("./ruby-DodgSDfF.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([156,157]),import.meta.url).then(e=>he(e.ruby))}}),te.of({name:"SAS",extensions:["sas"],load(){return ne(()=>import("./sas-D9KCtUmL.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([158,159]),import.meta.url).then(e=>he(e.sas))}}),te.of({name:"Scala",extensions:["scala"],load(){return ne(()=>import("./clike-DKPr2D1_.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([52,53]),import.meta.url).then(e=>he(e.scala))}}),te.of({name:"Scheme",extensions:["scm","ss"],load(){return ne(()=>import("./scheme-p8UJxmJw.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([160,161]),import.meta.url).then(e=>he(e.scheme))}}),te.of({name:"Shell",alias:["bash","sh","zsh"],extensions:["sh","ksh","bash"],filename:/^PKGBUILD$/,load(){return ne(()=>import("./shell-BWdqyqwL.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([162,163]),import.meta.url).then(e=>he(e.shell))}}),te.of({name:"Sieve",extensions:["siv","sieve"],load(){return ne(()=>import("./sieve-CLwJmtiQ.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([164,165]),import.meta.url).then(e=>he(e.sieve))}}),te.of({name:"Smalltalk",extensions:["st"],load(){return ne(()=>import("./smalltalk-D3KV-Qah.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([166,167]),import.meta.url).then(e=>he(e.smalltalk))}}),te.of({name:"Solr",load(){return ne(()=>import("./solr-ptw1yIqO.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>he(e.solr))}}),te.of({name:"SML",extensions:["sml","sig","fun","smackspec"],load(){return ne(()=>import("./mllike-C1DLZhEI.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([94,95]),import.meta.url).then(e=>he(e.sml))}}),te.of({name:"SPARQL",alias:["sparul"],extensions:["rq","sparql"],load(){return ne(()=>import("./sparql-D9Jz2mBw.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([168,169]),import.meta.url).then(e=>he(e.sparql))}}),te.of({name:"Spreadsheet",alias:["excel","formula"],load(){return ne(()=>import("./spreadsheet-VEzeu_mb.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>he(e.spreadsheet))}}),te.of({name:"Squirrel",extensions:["nut"],load(){return ne(()=>import("./clike-DKPr2D1_.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([52,53]),import.meta.url).then(e=>he(e.squirrel))}}),te.of({name:"Stylus",extensions:["styl"],load(){return ne(()=>import("./stylus-ClN4l_XO.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([170,171]),import.meta.url).then(e=>he(e.stylus))}}),te.of({name:"Swift",extensions:["swift"],load(){return ne(()=>import("./swift-Dvd_9xBv.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([172,173]),import.meta.url).then(e=>he(e.swift))}}),te.of({name:"sTeX",load(){return ne(()=>import("./stex-pjf-hOob.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([174,175]),import.meta.url).then(e=>he(e.stex))}}),te.of({name:"LaTeX",alias:["tex"],extensions:["text","ltx","tex"],load(){return ne(()=>import("./stex-pjf-hOob.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([174,175]),import.meta.url).then(e=>he(e.stex))}}),te.of({name:"SystemVerilog",extensions:["v","sv","svh"],load(){return ne(()=>import("./verilog-CSmDH7su.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([176,177]),import.meta.url).then(e=>he(e.verilog))}}),te.of({name:"Tcl",extensions:["tcl"],load(){return ne(()=>import("./tcl-DR2p8cyi.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([178,179]),import.meta.url).then(e=>he(e.tcl))}}),te.of({name:"Textile",extensions:["textile"],load(){return ne(()=>import("./textile-D6S27_J2.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([180,181]),import.meta.url).then(e=>he(e.textile))}}),te.of({name:"TiddlyWiki",load(){return ne(()=>import("./tiddlywiki-CPkGLyXH.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>he(e.tiddlyWiki))}}),te.of({name:"Tiki wiki",load(){return ne(()=>import("./tiki-BtjLo8OF.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>he(e.tiki))}}),te.of({name:"TOML",extensions:["toml"],load(){return ne(()=>import("./toml-B-YuQ2Id.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([182,183]),import.meta.url).then(e=>he(e.toml))}}),te.of({name:"Troff",extensions:["1","2","3","4","5","6","7","8","9"],load(){return ne(()=>import("./troff-HSk8AoRF.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([184,185]),import.meta.url).then(e=>he(e.troff))}}),te.of({name:"TTCN",extensions:["ttcn","ttcn3","ttcnpp"],load(){return ne(()=>import("./ttcn-CehzlVdx.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([186,187]),import.meta.url).then(e=>he(e.ttcn))}}),te.of({name:"TTCN_CFG",extensions:["cfg"],load(){return ne(()=>import("./ttcn-cfg-CLEPwk1s.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([188,189]),import.meta.url).then(e=>he(e.ttcnCfg))}}),te.of({name:"Turtle",extensions:["ttl"],load(){return ne(()=>import("./turtle-DQLHkbOu.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([190,191]),import.meta.url).then(e=>he(e.turtle))}}),te.of({name:"Web IDL",extensions:["webidl"],load(){return ne(()=>import("./webidl-Bf6dokXM.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([192,193]),import.meta.url).then(e=>he(e.webIDL))}}),te.of({name:"VB.NET",extensions:["vb"],load(){return ne(()=>import("./vb-o1EHrS4z.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([194,195]),import.meta.url).then(e=>he(e.vb))}}),te.of({name:"VBScript",extensions:["vbs"],load(){return ne(()=>import("./vbscript-BS8yUFpf.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([196,197]),import.meta.url).then(e=>he(e.vbScript))}}),te.of({name:"Velocity",extensions:["vtl"],load(){return ne(()=>import("./velocity-u_oGPFaA.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([198,199]),import.meta.url).then(e=>he(e.velocity))}}),te.of({name:"Verilog",extensions:["v"],load(){return ne(()=>import("./verilog-CSmDH7su.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([176,177]),import.meta.url).then(e=>he(e.verilog))}}),te.of({name:"VHDL",extensions:["vhd","vhdl"],load(){return ne(()=>import("./vhdl-BCaWLcjw.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([200,201]),import.meta.url).then(e=>he(e.vhdl))}}),te.of({name:"XQuery",extensions:["xy","xquery","xq","xqm","xqy"],load(){return ne(()=>import("./xquery-Di0kkiXg.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([202,203]),import.meta.url).then(e=>he(e.xQuery))}}),te.of({name:"Yacas",extensions:["ys"],load(){return ne(()=>import("./yacas-DB8tPtyp.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([204,205]),import.meta.url).then(e=>he(e.yacas))}}),te.of({name:"Z80",extensions:["z80"],load(){return ne(()=>import("./z80-DFUvlWxk.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([206,207]),import.meta.url).then(e=>he(e.z80))}}),te.of({name:"MscGen",extensions:["mscgen","mscin","msc"],load(){return ne(()=>import("./mscgen-uMZWtMZv.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([208,209]),import.meta.url).then(e=>he(e.mscgen))}}),te.of({name:"X\xF9",extensions:["xu"],load(){return ne(()=>import("./mscgen-uMZWtMZv.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([208,209]),import.meta.url).then(e=>he(e.xu))}}),te.of({name:"MsGenny",extensions:["msgenny"],load(){return ne(()=>import("./mscgen-uMZWtMZv.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([208,209]),import.meta.url).then(e=>he(e.msgenny))}}),te.of({name:"Vue",extensions:["vue"],load(){return ne(()=>import("./dist-DQNaXfK1.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([210,9,5,13,14,4,211]),import.meta.url).then(e=>e.vue())}}),te.of({name:"Angular Template",load(){return ne(()=>import("./dist-DzAAhYcW.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([212,9,5,13,14,4]),import.meta.url).then(e=>e.angular())}})],jy=new WeakMap,US=/(\n|\r\n?|\u2028|\u2029)/g,KS=/^\s*/,QS=/\S/,GS=Array.prototype.slice,vf=48,zy=57,qy=97,JS=102,Fy=65,XS=70;$l=function(e){if(typeof e=="string")return Hy([e])[0];if(typeof e=="function")return function(){let o=GS.call(arguments);return o[0]=Vy(o[0]),e.apply(this,o)};let t=Vy(e),a=By(t,0);for(let o=1;o<t.length;o++)a+=arguments[o]+By(t,o);return a};function By(e,t){let a=e[t];if(a===void 0)throw TypeError(`invalid cooked string at index ${t}`);return a}function Vy(e){let t=jy.get(e);if(t)return t;let a=Hy(e.raw),o=a.map(ZS);return Object.defineProperty(o,"raw",{value:Object.freeze(a)}),Object.freeze(o),jy.set(e,o),o}function Hy(e){let t=e.map(s=>s.split(US)),a;for(let s=0;s<t.length;s++){let c=t[s],f=s===0,d=s+1===t.length;if(f){if(c.length===1||c[0].length>0)throw Error("invalid content on opening line");c[1]=""}if(d){if(c.length===1||QS.test(c[c.length-1]))throw Error("invalid content on closing line");c[c.length-2]="",c[c.length-1]=""}for(let m=2;m<c.length;m+=2){let b=c[m],w=m+1===c.length&&!d,x=KS.exec(b)[0];if(!w&&x.length===b.length){c[m]="";continue}a=YS(x,a)}}let o=a?a.length:0;return t.map(s=>{let c=s[0];for(let f=1;f<s.length;f+=2){let d=s[f],m=s[f+1];c+=d+m.slice(o)}return c})}function YS(e,t){if(t===void 0||e===t)return e;let a=0;for(let o=Math.min(e.length,t.length);a<o&&e[a]===t[a];a++);return e.slice(0,a)}function ZS(e){let t="",a=0,o=0;for(;(o=e.indexOf("\\",o))>-1;){if(t+=e.slice(a,o),++o===e.length)return;let s=e[o++];switch(s){case"b":t+="\b";break;case"t":t+=" ";break;case"n":t+=`
33
- `;break;case"v":t+="\v";break;case"f":t+="\f";break;case"r":t+="\r";break;case"\r":o<e.length&&e[o]===`
34
- `&&++o;case`
35
- `:case"\u2028":case"\u2029":break;case"0":if($y(e,o))return;t+="\0";break;case"x":{let c=bf(e,o,o+2);if(c===-1)return;o+=2,t+=String.fromCharCode(c);break}case"u":{let c;if(o<e.length&&e[o]==="{"){let f=e.indexOf("}",++o);if(f===-1)return;c=bf(e,o,f),o=f+1}else c=bf(e,o,o+4),o+=4;if(c===-1||c>1114111)return;t+=String.fromCodePoint(c);break}default:if($y(s,0))return;t+=s}a=o}return t+e.slice(a)}function $y(e,t){let a=e.charCodeAt(t);return a>=vf&&a<=zy}function bf(e,t,a){if(a>=e.length)return-1;let o=0;for(;t<a;t++){let s=e3(e.charCodeAt(t));if(s===-1)return-1;o=o*16+s}return o}function e3(e){return e>=vf&&e<=zy?e-vf:e>=qy&&e<=JS?e-qy+10:e>=Fy&&e<=XS?e-Fy+10:-1}const Wy=["","f","r","fr","rf"];function t3(e){try{return $l(`
36
- ${e}
37
- `).trim()}catch{return e}}function n3(e){return N_.parse(e)}var r3=new Set(["(","[","{",",",")","]","}"]);function a3(e,t){return e.name==="ArgList"?{args:i3(e),kwargs:o3(e,t)}:(console.warn(`Not an ArgList, name: ${e.name}`),{args:[],kwargs:[]})}function i3(e){var o;e.firstChild();let t=[],a=e.name;do if(a=e.name,!r3.has(a)){if(a==="VariableName"&&((o=e.node.nextSibling)==null?void 0:o.name)==="AssignOp"){e.prev();break}t.push(e.node)}while(e.nextSibling());return t}function o3(e,t){let a=[],o=e.name;do if(o=e.name,o==="VariableName"){let s=t.slice(e.from,e.to),c=e.node.nextSibling;if(!c||c.name!=="AssignOp")continue;let f=c.nextSibling;if(!f)continue;let d=t.slice(f.from,f.to).trim();a.push({key:s,value:d})}while(e.nextSibling());return a}function s3(e,t){if(e.name==="String"){let a=t.slice(e.from,e.to);return a.startsWith('r"""')||a.startsWith("r'''")?a.slice(4,-3):a.startsWith('"""')||a.startsWith("'''")?a.slice(3,-3):a.startsWith('r"')||a.startsWith("r'")?a.slice(2,-1):a.slice(1,-1)}if(e.name==="FormatString"){let a=t.slice(e.from,e.to);return a.startsWith('f"""')||a.startsWith("f'''")?a.slice(4,-3):a.startsWith('rf"""')||a.startsWith("rf'''")||a.startsWith('fr"""')||a.startsWith("fr'''")?a.slice(5,-3):a.startsWith('r"""')||a.startsWith("r'''")?a.slice(4,-3):a.startsWith('f"')||a.startsWith("f'")?a.slice(2,-1):a.startsWith('rf"')||a.startsWith("rf'")||a.startsWith('fr"')||a.startsWith("fr'")?a.slice(3,-1):(a.startsWith('r"')||a.startsWith("r'"),a.slice(2,-1))}return null}function l3(e){return e===""?0:e.startsWith('rf"""')||e.startsWith("rf'''")||e.startsWith('fr"""')||e.startsWith("fr'''")?5:e.startsWith('f"""')||e.startsWith("f'''")||e.startsWith('r"""')||e.startsWith("r'''")?4:e.startsWith('"""')||e.startsWith("'''")||e.startsWith("rf'")||e.startsWith('rf"')||e.startsWith("fr'")||e.startsWith('fr"')?3:e.startsWith("f'")||e.startsWith('f"')||e.startsWith("r'")||e.startsWith('r"')?2:e.startsWith("'")||e.startsWith('"')?1:0}function c3(e){let t=[...Wy].sort((a,o)=>o.length-a.length);for(let a of t)if(e.startsWith(a))return[a,e.slice(a.length)];return["",e]}function u3(e,t){return e.replaceAll(`\\${t}`,t)}var d3=[['"""','"""'],["'''","'''"],['"','"'],["'","'"]],f3=Wy.flatMap(e=>d3.map(([t,a])=>[e+t,a])).map(([e,t])=>[e,RegExp(`^mo\\.md\\(\\s*${Uy(e)}(.*)${Uy(t)}\\s*\\)$`,"s")]);function Uy(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}let Ky,ic;Td=class{constructor(){we(this,"type","markdown");we(this,"defaultCode",`mo.md(r"""
38
- """)`);we(this,"defaultMetadata",{quotePrefix:"r"})}static fromMarkdown(e){return`mo.md(r"""
39
- ${e}
40
- """)`}transformIn(e){e=e.trim();let t={...this.defaultMetadata};if(e==="")return{code:"",offset:0,metadata:t};for(let[a,o]of f3){let s=e.match(o);if(s){let c=s[1],[f,d]=c3(a);t.quotePrefix=f;let m=u3(c,d),b=e.indexOf(c);return{code:$l(`
41
- ${m}
42
- `).trim(),offset:b,metadata:t}}}return{code:e,offset:0,metadata:t}}transformOut(e,t){e===""&&(e=" ");let{quotePrefix:a}=t,o=e.replaceAll('""',String.raw`"\"`),s=`mo.md(${a}"""
43
- `;return{code:s+o+`
44
- """)`,offset:s.length+1}}isSupported(e){if(e=e.trim(),e==="")return!0;if(!e.startsWith("mo.md("))return!1;if(e==="mo.md()")return!0;let t=dm.parser.parse(e),a=[{match:"Script"},{match:"ExpressionStatement"},{match:"CallExpression"},{match:"MemberExpression"},{match:"VariableName"},{match:"."},{match:"PropertyName"},{match:"ArgList"},{match:"("},{match:/String|FormatString/,stop:!0},{match:")"}],o=!0;return t.iterate({enter:s=>{let c=a.shift();if(c===void 0)return o=!1,!1;let f=c.match;return typeof f=="string"?(o&&(o=f===s.name),o&&!c.stop):(f.test(s.name)||(o=!1),o&&!c.stop)}}),o}},Ky=class{constructor(){we(this,"type","python");we(this,"defaultCode","");we(this,"defaultMetadata",{})}transformIn(e){return{code:e,offset:0,metadata:{}}}transformOut(e,t){return{code:e,offset:0}}isSupported(e){return!0}},ic="__marimo_duckdb",Ad=class{constructor(){we(this,"type","sql");we(this,"defaultMetadata",{dataframeName:"_df",quotePrefix:"f",commentLines:[],showOutput:!0,engine:ic})}get defaultCode(){return'_df = mo.sql(f"""SELECT * FROM """)'}static fromQuery(e){return`_df = mo.sql(f"""${e.trim()}""")`}transformIn(e){e=e.trim();let t={...this.defaultMetadata,commentLines:this.extractCommentLines(e)};if(!this.isSupported(e))return{code:e,offset:0,metadata:t};if(e==="")return{code:"",offset:0,metadata:t};let a=Qy(e);return a?(t.dataframeName=a.dfName,t.showOutput=a.output??!0,t.engine=a.engine??ic,{code:$l(`
45
- ${a.sqlString}
46
- `).trim(),offset:a.startPosition,metadata:t}):{code:e,offset:0,metadata:t}}transformOut(e,t){let{quotePrefix:a,commentLines:o,showOutput:s,engine:c,dataframeName:f}=t,d=`${f} = mo.sql(
47
- ${a}"""
48
- `,m=e.replaceAll('"""',String.raw`\"""`),b=`
49
- """${s?"":`,
50
- output=False`}${c===ic?"":`,
51
- engine=${c}`}
52
- )`;return{code:[...o,d].join(`
53
- `)+h3(m)+b,offset:d.length+1}}isSupported(e){return e.trim()===""?!0:!e.includes("mo.sql")||e.split("mo.sql").length>2?!1:Qy(e)!==null}extractCommentLines(e){let t=e.split(`
54
- `),a=[];for(let o of t)if(o!=null&&o.startsWith("#"))a.push(o);else break;return a}};function p3(e){do{if(e.name==="AssignStatement")return e.node;if(e.name!=="Comment")return null}while(e.next());return null}function Qy(e){try{let t=n3(e).cursor();t.name==="Script"&&t.next();let a=p3(t);if(!a||e.slice(a.to).trim().length>0)return null;let o=null,s=null,c,f,d=0,m=a.cursor();if(m.firstChild(),m.name==="VariableName"&&(o=e.slice(m.from,m.to)),!o)return null;let b=!1,w=null;for(;m.nextSibling();)if(m.name==="AssignOp")b=!0;else if(b&&!w){w=m.node;break}if(!w||w.name==="ConditionalExpression"||w.name==="BinaryExpression"||w.name==="UnaryExpression")return null;let x=w.cursor(),S=null;if(x.name==="CallExpression")S=x.node;else{x.firstChild();do if(x.name==="CallExpression"){S=x.node;break}while(x.nextSibling())}if(S){let E=S.cursor(),T=!1;if(E.firstChild(),E.name==="MemberExpression"&&(T=e.slice(E.from,E.to)==="mo.sql"),T){for(;E.next();)if(E.name==="ArgList"){let{args:M,kwargs:z}=a3(E.node.cursor(),e);M.length===1&&(s=s3(M[0],e),d=M[0].from+l3(e.slice(M[0].from,M[0].to)));for(let{key:B,value:V}of z)switch(B){case"engine":c=V;break;case"output":f=V==="True";break}if(s==="")return{dfName:o,sqlString:"",engine:c,output:f,startPosition:d};break}}}return!o||!s?null:{dfName:o,sqlString:t3(s),engine:c,output:f,startPosition:d}}catch(t){return console.warn("Failed to parse SQL statement",t),null}}function h3(e){return e.split(`
55
- `).map(t=>t!=null&&t.trim()?` ${t}`:t).join(`
56
- `)}var m3=Bn(),wf=()=>({cellIds:new Set}),{valueAtom:_f,useActions:g3}=ds(wf,{markForCut:(e,t)=>({cellIds:new Set(t.cellIds)}),clear:()=>wf()});hd=Ee(e=>e(_f).cellIds),Wm=Ee(null,(e,t)=>{t(_f,wf())}),q_=function(){return g3()},_x=function(e){let t=(0,m3.c)(3),a=rn(hd),o;return t[0]!==e||t[1]!==a?(o=a.has(e),t[0]=e,t[1]=a,t[2]=o):o=t[2],o},tk=function(){return rn(_f)},qx=(e,t,a)=>Dr.define(o=>new y3(o,e,t,a)),ni=y_.define();var y3=class{constructor(e,t,a,o){we(this,"isInitDispatch",!1);we(this,"onRemoteUpdate",e=>{if(e.by!=="local"){if(e.by==="checkout"){this.view.dispatch({changes:[{from:0,to:this.view.state.doc.length,insert:this.getTextFromDoc(this.doc).toString()}],annotations:[ni.of(this)]});return}if(e.by==="import"){let t=[],a=0;for(let{diff:o,path:s}of e.events){if(s.join("/")!==this.docPath.join("/")||o.type!=="text")continue;let c=o.diff;for(let f of c)f.insert?t.push({from:a,to:a,insert:f.insert}):f.delete?(t.push({from:a,to:a+f.delete}),a+=f.delete):f.retain!=null&&(a+=f.retain);t.length>0&&this.view.dispatch({changes:t,annotations:[ni.of(this)]})}}}});this.view=e,this.doc=t,this.docPath=a,this.getTextFromDoc=o,this.sub=t.subscribe(this.onRemoteUpdate),Promise.resolve().then(()=>{this.isInitDispatch=!0;let s=this.view.state.doc.toString(),c=this.getTextFromDoc(this.doc);s!==c.toString()&&e.dispatch({changes:[{from:0,to:this.view.state.doc.length,insert:c.toString()}],annotations:[ni.of(this)]})})}update(e){if(this.isInitDispatch){this.isInitDispatch=!1;return}if(!e.docChanged||e.transactions.length>0&&(e.transactions[0].annotation(ni)===this||e.transactions[0].annotation(ni)==="undo"))return;let t=0;e.changes.iterChanges((a,o,s,c,f)=>{let d=f.sliceString(0,f.length,`
57
- `);a!==o&&this.getTextFromDoc(this.doc).delete(a+t,o-a),d.length>0&&this.getTextFromDoc(this.doc).insert(a+t,d),t+=d.length-(o-a)}),this.doc.commit()}destroy(){var e;(e=this.sub)==null||e.call(this),this.sub=void 0}};C0=function(e,t){if(typeof window>"u")return;let a=`__marimo__${t}`;window[a]&&_e.warn(`Overwriting existing debug object ${a}`),window[a]=e};var v3={markdown:!0,wasm_layouts:!1,rtc_v2:!1,cache_panel:!1,external_agents:!1,debugger:!1,line_timing:!1};ms=function(e){var t,a;return((a=(t=i_())==null?void 0:t.experimental)==null?void 0:a[e])??v3[e]};function b3(e,t){ir().saveUserConfig({config:{experimental:{[e]:t}}})}C0(b3,"setFeatureFlag");function oc(e,t){return{get:()=>t.get(e),sub:a=>t.sub(e,()=>a(t.get(e)))}}function w3(e,{offset:t,body:a=window,behavior:o="smooth"}){let s=(t==null?void 0:t.top)??0,c=(t==null?void 0:t.bottom)??0,f=e.getBoundingClientRect();if(f.top<s){a.scrollBy({top:f.top-s,behavior:o});return}if(f.bottom>window.innerHeight-c){a.scrollBy({top:f.bottom-window.innerHeight+c,behavior:o});return}}Fl=function(e){return e?e.state.field(Hn).type:"python"};function _3(e,t){return!e||Fl(e)===t?!1:e.state.doc.toString().trim()===""?!0:Wn[t].isSupported(xr(e))}td=function(e,t,a={}){return!a.force&&!_3(e,t)?!1:(ed(e,{language:t}),t)};function x3(e){return fa.of([{key:e.getHotkey("cell.format").key,preventDefault:!0,run:t=>(gd({[t.state.facet(ha)]:t}),!0)},{key:e.getHotkey("cell.viewAsMarkdown").key,preventDefault:!0,run:t=>{let a=td(t,Fl(t)==="markdown"?"python":"markdown",{force:!0});return a==="markdown"&&t.state.facet(st).afterToggleMarkdown(),a!==!1}},{key:e.getHotkey("cell.viewAsSQL").key,preventDefault:!0,run:t=>{let a=td(t,Fl(t)==="sql"?"python":"sql",{force:!0});return a==="sql"&&t.state.facet(st).afterToggleSQL(),a!==!1}}])}Lx=function(){return wt.updateListener.of(e=>{if(e.view.hasFocus&&e.heightChanged&&e.docChanged){if(e.transactions.some(t=>t.effects.some(a=>a.is(Cs))))return;Gy(e.view,{behavior:"smooth"})}})};function Gy(e,t){let a=e.dom.getElementsByClassName("cm-activeLine cm-line");if(a.length===1){let o=a[0],s=document.getElementById("App");an(s,"App not found"),w3(o,{offset:{top:30,bottom:150},body:s,behavior:t.behavior})}}function k3(){return{}}let C3,S3,Jy;({reducer:C3,createActions:S3,valueAtom:ti,useActions:Jy}=ds(k3,{setVariables:(e,t)=>{let a={...e},o={};for(let s of t)o[s.name]={...a[s.name],...s};return o},addVariables:(e,t)=>{let a={...e};for(let o of t)a[o.name]={...a[o.name],...o};return a},setMetadata:(e,t)=>{let a={...e};for(let{name:o,value:s,dataType:c}of t)a[o]&&(a[o]={...a[o],value:s,dataType:c});return a}})),W_=()=>rn(ti),Mx=function(){return Jy()},Bm=function(e){let t=e.storage||bs;return{getItem(a,o){try{let s=t.getItem(a);if(!s)return o;let c=JSON.parse(s);return e.fromSerializable(c)}catch(s){return _e.warn(`Error getting ${a} from storage`,s),o}},setItem:(a,o)=>{t.setItem(a,JSON.stringify(e.toSerializable(o)))},removeItem:a=>{t.removeItem(a)}}},Dd=yg(()=>bs),Nl=[{type:"files",Icon:ky,label:"Files",tooltip:"View files",defaultSection:"sidebar",additionalKeywords:["explorer","browser","directory"]},{type:"variables",Icon:s0,label:"Variables",tooltip:"Explore variables and data sources",defaultSection:"sidebar",additionalKeywords:["state","scope","inspector"]},{type:"packages",Icon:m0,label:"Packages",tooltip:"Manage packages",defaultSection:"sidebar",additionalKeywords:["dependencies","pip","install"]},{type:"ai",Icon:Pm,label:"AI",tooltip:"Chat & Agents",defaultSection:"sidebar",additionalKeywords:["chat","copilot","assistant"]},{type:"outline",Icon:l0,label:"Outline",tooltip:"View outline",defaultSection:"sidebar",additionalKeywords:["toc","structure","headings"]},{type:"documentation",Icon:w0,label:"Docs",tooltip:"View live docs",defaultSection:"sidebar",additionalKeywords:["reference","api"]},{type:"dependencies",Icon:N0,label:"Dependencies",tooltip:"Explore dependencies",defaultSection:"sidebar",additionalKeywords:["graph","imports"]},{type:"errors",Icon:Dm,label:"Errors",tooltip:"View errors",defaultSection:"developer-panel",additionalKeywords:["exceptions","problems","diagnostics"]},{type:"scratchpad",Icon:M0,label:"Scratchpad",tooltip:"Scratchpad",defaultSection:"developer-panel",additionalKeywords:["scratch","draft","playground"]},{type:"tracing",Icon:zm,label:"Tracing",tooltip:"View tracing",defaultSection:"developer-panel",additionalKeywords:["profiling","performance"]},{type:"secrets",Icon:Cy,label:"Secrets",tooltip:"Manage secrets",defaultSection:"developer-panel",hidden:Uu(),additionalKeywords:["env","environment","keys","credentials"]},{type:"logs",Icon:bm,label:"Logs",tooltip:"View logs",defaultSection:"developer-panel",additionalKeywords:["console","stdout"]},{type:"terminal",Icon:f0,label:"Terminal",tooltip:"Terminal",hidden:Uu(),defaultSection:"developer-panel",requiredCapability:"terminal",additionalKeywords:["shell","console","bash","command"]},{type:"snippets",Icon:Sy,label:"Snippets",tooltip:"Snippets",defaultSection:"developer-panel",additionalKeywords:["templates","examples"]},{type:"cache",Icon:um,label:"Cache",tooltip:"View cache",defaultSection:"developer-panel",hidden:!ms("cache_panel"),additionalKeywords:["memory","memoize"]}],ox=new Map(Nl.map(e=>[e.type,e])),dx=function({panel:e,capabilities:t,aiEnabled:a}){return!!(e.hidden||e.type==="ai"&&!a||e.requiredCapability&&!t[e.requiredCapability])};var E3=Bn(),xf={sidebar:Nl.filter(e=>!e.hidden&&e.defaultSection==="sidebar").map(e=>e.type),developerPanel:Nl.filter(e=>!e.hidden&&e.defaultSection==="developer-panel").map(e=>e.type)};function T3(e){let t=new Set([...e.sidebar,...e.developerPanel]);return{sidebar:[...e.sidebar,...xf.sidebar.filter(a=>!t.has(a))],developerPanel:[...e.developerPanel,...xf.developerPanel.filter(a=>!t.has(a))]}}Mm=Dl("marimo:panel-layout",xf,Bm({toSerializable:e=>e,fromSerializable:e=>T3(e)}),{getOnInit:!0});function Xy(e){let t=Te.get(Mm);return t.sidebar.includes(e)?"sidebar":t.developerPanel.includes(e)?"developer-panel":null}var Yy="marimo:sidebar",Zy=new od(t_({selectedPanel:n_().optional().transform(e=>e),isSidebarOpen:r_(),isDeveloperPanelOpen:r_().optional().default(!1),selectedDeveloperPanelTab:n_().optional().default("errors").transform(e=>e)}),I3);function I3(){return{selectedPanel:"variables",isSidebarOpen:!1,isDeveloperPanelOpen:!1,selectedDeveloperPanelTab:"errors"}}let L3,O3,e1;({reducer:L3,createActions:O3,valueAtom:bd,useActions:e1}=ds(()=>Zy.get(Yy),{openApplication:(e,t)=>{let a=Xy(t);return a==="sidebar"?{...e,selectedPanel:t,isSidebarOpen:!0}:a==="developer-panel"?{...e,selectedDeveloperPanelTab:t,isDeveloperPanelOpen:!0}:e},toggleApplication:(e,t)=>{let a=Xy(t);return a==="sidebar"?{...e,selectedPanel:t,isSidebarOpen:e.isSidebarOpen?e.selectedPanel!==t:!0}:a==="developer-panel"?{...e,selectedDeveloperPanelTab:t,isDeveloperPanelOpen:e.isDeveloperPanelOpen?e.selectedDeveloperPanelTab!==t:!0}:e},toggleSidebarPanel:e=>({...e,isSidebarOpen:!e.isSidebarOpen}),setIsSidebarOpen:(e,t)=>({...e,isSidebarOpen:t}),toggleDeveloperPanel:e=>({...e,isDeveloperPanelOpen:!e.isDeveloperPanelOpen}),setIsDeveloperPanelOpen:(e,t)=>({...e,isDeveloperPanelOpen:t})},[(e,t)=>Zy.set(Yy,t)])),bx=()=>{let e=(0,E3.c)(2),t=rn(bd);if(t.isSidebarOpen)return t;let a;return e[0]===t?a=e[1]:(a={...t,selectedPanel:void 0},e[0]=t,e[1]=a),a},mx=function(){return e1()},gm=Ee({terminal:!1,pylsp:!1,basedpyright:!1,ty:!1,pyrefly:!1});function ka(e){var t;return((t=Te.get(gm))==null?void 0:t[e])??!1}_d=Ee({documentation:null});var t1=new Set(["FunctionDefinition","LambdaExpression","ArrayComprehensionExpression","SetComprehensionExpression","DictionaryComprehensionExpression","ComprehensionExpression","ClassDefinition"]);function A3(e){let t=nm(e.state);if(!t||N3(t))return[];let a=new Set(Object.keys(e.variables).filter(E=>{let T=e.variables[E];return T.dataType!=="module"&&!T.declaredBy.includes("setup")&&!T.declaredBy.includes(e.cellId)}));if(a.size===0)return[];let o=[],s=new Map,c=new Map,f=new Map;function d(E,T){var X,ce,A,q,$,ie,fe,me,ve;let M=E.cursor(),z=M.name,B=M.from,V=t1.has(z),N=T;switch(V&&(N=[...T,B],s.set(B,new Set),c.set(B,z)),z){case"FunctionDefinition":{let ae=E.cursor();ae.firstChild();do if(ae.name==="VariableName"){let be=e.state.doc.sliceString(ae.from,ae.to),oe=T[T.length-1]??-1;s.has(oe)||s.set(oe,new Set),(X=s.get(oe))==null||X.add(be);break}while(ae.nextSibling());let de=E.cursor();de.firstChild();do if(de.name==="ParamList"){let be=de.node.cursor();be.firstChild();do if(be.name==="VariableName"){let oe=e.state.doc.sliceString(be.from,be.to);(ce=s.get(B))==null||ce.add(oe)}while(be.nextSibling())}while(de.nextSibling());break}case"LambdaExpression":{let ae=E.cursor();ae.firstChild();do if(ae.name==="ParamList"){let de=ae.node.cursor();de.firstChild();do if(de.name==="VariableName"){let be=e.state.doc.sliceString(de.from,de.to);(A=s.get(B))==null||A.add(be)}while(de.nextSibling())}while(ae.nextSibling());break}case"ArrayComprehensionExpression":case"DictionaryComprehensionExpression":case"SetComprehensionExpression":case"ComprehensionExpression":{let ae=E.cursor();ae.firstChild();let de=!1;do if(ae.name==="for")de=!0;else if(de&&ae.name==="VariableName"){let be=e.state.doc.sliceString(ae.from,ae.to);(q=s.get(B))==null||q.add(be)}else if(de&&ae.name==="TupleExpression"){let be=ae.node.cursor();be.firstChild();do if(be.name==="VariableName"){let oe=e.state.doc.sliceString(be.from,be.to);($=s.get(B))==null||$.add(oe)}while(be.nextSibling())}else de&&ae.name==="in"&&(de=!1);while(ae.nextSibling());break}case"ClassDefinition":{let ae=E.cursor();ae.firstChild();do if(ae.name==="VariableName"){let de=e.state.doc.sliceString(ae.from,ae.to),be=T[T.length-1]??-1;s.has(be)||s.set(be,new Set),(ie=s.get(be))==null||ie.add(de);break}while(ae.nextSibling());f.set(B,[]);break}case"AssignStatement":{let ae=E.cursor(),de=[];ae.firstChild();do ae.name==="AssignOp"&&de.push(ae.from);while(ae.nextSibling());let be=de[de.length-1],oe=E.cursor();oe.firstChild();let le=N[N.length-1]??-1;do oe.from<be&&kf(oe,{currentScope:le,state:e.state,allDeclarations:s,scopeTypes:c,classLevelDeclarations:f,assignmentPosition:M.to});while(oe.nextSibling());break}case"ForStatement":{let ae=E.cursor();ae.firstChild();let de=!1;do if(ae.name==="for")de=!0;else if(de&&ae.name==="VariableName"){let be=e.state.doc.sliceString(ae.from,ae.to),oe=N[N.length-1]??-1;s.has(oe)||s.set(oe,new Set),(fe=s.get(oe))==null||fe.add(be)}else de&&ae.name==="in"&&(de=!1);while(ae.nextSibling());break}case"ImportStatement":{let ae=E.cursor();ae.firstChild();let de=N[N.length-1]??-1;s.has(de)||s.set(de,new Set);let be=s.get(de),oe=!1,le=null,G=()=>{le!==null&&(be==null||be.add(le)),le=null};do{if(ae.name==="import"){oe=!0;continue}if(oe){if(ae.name==="as"){le=null;continue}ae.name==="VariableName"?(G(),le=e.state.doc.sliceString(ae.from,ae.to)):ae.name===","&&G()}}while(ae.nextSibling());G();break}case"TryStatement":{let ae=E.cursor();ae.firstChild();let de=!1;do if(ae.name==="as")de=!0;else if(de&&ae.name==="VariableName"){let be=e.state.doc.sliceString(ae.from,ae.to),oe=N[N.length-1]??-1;s.has(oe)||s.set(oe,new Set),(me=s.get(oe))==null||me.add(be),de=!1}while(ae.nextSibling());break}case"WithStatement":{let ae=E.cursor();ae.firstChild();let de=!1;do if(ae.name==="as")de=!0;else if(de&&ae.name==="VariableName"){let be=e.state.doc.sliceString(ae.from,ae.to),oe=N[N.length-1]??-1;s.has(oe)||s.set(oe,new Set),(ve=s.get(oe))==null||ve.add(be),de=!1}while(ae.nextSibling());break}}S(M,ae=>{d(ae,N)})}function m(E,T,M){let z=f.get(T);return z?z.some(([B,V])=>B===E&&V<M):!1}function b(E,T,M){var z,B;for(let V of T)if(c.get(V)==="ClassDefinition"){if(m(E,V,M))return!0}else if((z=s.get(V))!=null&&z.has(E))return!0;return((B=s.get(-1))==null?void 0:B.has(E))??!1}function w(E,T){let M=E.cursor(),z=M.name,B=M.from;if(z==="ImportStatement")return;let V=t1.has(z),N=T;if(V&&(N=[...T,B]),z==="VariableName"){let X=e.state.doc.sliceString(M.from,M.to);x(X,M)&&(b(X,N,M.from)||o.push({from:M.from,to:M.to,variableName:X}))}S(M,X=>{w(X,N)})}function x(E,T){return a.has(E)&&!P3(T)&&!R3(T)&&!M3(T)}function S(E,T){if(E.firstChild())do T(E.node);while(E.nextSibling())}return d(t,[]),w(t,[]),o}function R3(e){let t=e.node.cursor();if(t.moveTo(e.from),t.parent()&&t.name==="CallExpression"&&t.firstChild())do if(t.name==="ArgList"&&t.firstChild()){do if(t.from===e.from&&t.to===e.to)return t.nextSibling()&&t.name==="AssignOp";while(t.nextSibling());break}while(t.nextSibling());return!1}function M3(e){let t=e.node.cursor();if(t.parent()&&t.name==="AssignStatement"){let a=t.node.cursor();a.firstChild();let o=-1;do if(a.name==="AssignOp"){o=a.from;break}while(a.nextSibling());return o!==-1&&e.from<o}return!1}function P3(e){let t=e.node.cursor();return!!(t.prevSibling()&&t.name===".")}function N3(e){let t=e.cursor();do if(t.name==="\u26A0"||t.type.isError)return!0;while(t.next());return!1}function kf(e,t){var a;switch(e.name){case"VariableName":{let o=t.state.doc.sliceString(e.from,e.to);if(t.currentScope!==-1&&t.scopeTypes.get(t.currentScope)==="ClassDefinition"){let s=t.classLevelDeclarations.get(t.currentScope);s&&s.push([o,t.assignmentPosition])}else t.allDeclarations.has(t.currentScope)||t.allDeclarations.set(t.currentScope,new Set),(a=t.allDeclarations.get(t.currentScope))==null||a.add(o);break}case"TupleExpression":{let o=e.node.cursor();o.firstChild();do kf(o,t);while(o.nextSibling());break}case"ArrayExpression":{let o=e.node.cursor();o.firstChild();do kf(o,t);while(o.nextSibling());break}}}var D3=En.mark({class:"mo-cm-reactive-reference"});Y_=En.mark({class:"mo-cm-reactive-reference-hover"});var n1=_r.define(),j3=class{constructor(e,t){we(this,"highlightDebounceMs",300);this.view=e,this.cellId=t,this.scheduleHighlighting=Zh(()=>{this.runHighlighting()},this.highlightDebounceMs),this.variablesUnsubscribe=Te.sub(ti,()=>{this.scheduleHighlighting()}),this.scheduleHighlighting()}update(e){(e.docChanged||e.focusChanged)&&this.scheduleHighlighting()}destroy(){this.scheduleHighlighting.cancel(),this.variablesUnsubscribe()}runHighlighting(){let e=A3({state:this.view.state,cellId:this.cellId,variables:Te.get(ti)});e.length>0&&_e.debug(`Found ${e.length} reactive variables in cell ${this.cellId}`),queueMicrotask(()=>{this.view.dispatch({effects:n1.of(e)})})}};id=ei.define({create(){return{decorations:En.none,ranges:[]}},update(e,t){let a={decorations:e.decorations.map(t.changes),ranges:e.ranges};for(let o of t.effects)o.is(n1)&&(a={decorations:En.set(o.value.map(s=>D3.range(s.from,s.to))),ranges:o.value});return a},provide:e=>wt.decorations.from(e,t=>t.decorations)});function z3(e){return[id,Dr.define(t=>new j3(t,e))]}J_=function(e,t){return t?z3(e):[]};function r1(e,t=!1){if(!e)return null;let a=document.createElement("span");if(a.classList.add("mo-cm-tooltip"),a.classList.add("docs-documentation"),t&&a.classList.add("cm-tooltip-section"),a.style.display="flex",a.style.flexDirection="column",a.style.gap=".8rem",a.innerHTML=e,t){let o=document.createElement("div");o.classList.add("text-xs","text-muted-foreground","font-medium","pt-1","-mt-2","border-t","border-border");let s=document.createElement("kbd");s.className="ml-1 rounded-md bg-muted/40 px-2 text-[0.75rem] font-prose center border border-foreground/20 text-muted-foreground inline whitespace-nowrap",s.textContent=r8()?"\u2318":"Ctrl",o.append(document.createTextNode("Jump to defining cell ")),o.append(s),o.append(document.createTextNode(" + Click")),a.append(o)}return a}cd=new Al("autocomplete-result",async(e,t)=>{let{sendCodeCompletionRequest:a}=ir();await a({id:e,...t})});var q3={param:3,property:2};const Cf={asCompletionResult(e,t){return{from:e-t.prefix_length,options:t.options.map(a=>({label:a.name,type:a.type,boost:q3[a.type]??1,info:()=>r1(a.completion_info)})),validFor:/^\w*$/}},asHoverTooltip({position:e,message:t,limitToType:a,excludeTypes:o,exactName:s,showGoToDefinitionHint:c=!1}){let f=F3(t.options,s);if(!f)return;let d=e-t.prefix_length,m=r1(f.completion_info,c);if(m&&!(a&&f.type!==a)&&!(o!=null&&o.includes(f.type)))return{pos:d,html:f.completion_info,end:d+f.name.length,above:!0,create:()=>({dom:m,resize:!1})}}};function F3(e,t){if(e.length!==0){if(e.length===1)return e[0];if(t)return e.find(a=>a.name===t)}}Bk=function(e){var t,a,o,s;return[(t=e==null?void 0:e.pylsp)!=null&&t.enabled&&ka("pylsp")||(a=e==null?void 0:e.ty)!=null&&a.enabled&&ka("ty")||(o=e==null?void 0:e.pyrefly)!=null&&o.enabled&&ka("pyrefly")||(s=e==null?void 0:e.basedpyright)!=null&&s.enabled&&ka("basedpyright")?[]:am(async(c,f)=>{let d=await a1({view:c,pos:f,excludeTypes:["tooltip"]});return d===null||d==="cancelled"?null:d},{hideOnChange:!0}),H3]};async function a1({view:e,pos:t,excludeTypes:a}){var w;let o=Tn.findElement(e.dom);if(!o)return _e.error("Failed to find active cell."),null;let s=Tn.parse(o.id),{startToken:c,endToken:f}=Sf(e.state.doc,t),d=((w=e.state.field(id,!1))==null?void 0:w.ranges.some(x=>t>=x.from&&t<=x.to))??!1,m=await cd.request({document:e.state.doc.slice(0,f).toString(),cellId:s});if(!m)return"cancelled";let b=e.state.doc.slice(c,f).toString();return Cf.asHoverTooltip({position:f,message:m,exactName:b,excludeTypes:a,showGoToDefinitionHint:d})??null}function Sf(e,t){let a=t,o=a>0?e.sliceString(a-1,a):"",s=a<e.length?e.sliceString(a,a+1):"";o==="("&&s===")"&&--a;let c=a,f=a;for(;c>0;){let d=e.sliceString(c-1,c);if(!/\w/.test(d))break;c--}for(;f<e.length;){let d=e.sliceString(f,f+1);if(!/\w/.test(d))break;f++}return{startToken:c,endToken:f}}function B3(e){let{head:t}=e.selection.main,a=e.doc.sliceString(t-1,t);return/\w/.test(a)}var V3=Zh(async(e,t)=>{if(Te.get(bd).selectedPanel!=="documentation")return;let a=await a1({view:e,pos:t});a!=="cancelled"&&Te.set(_d,{documentation:(a==null?void 0:a.html)??null})},300),H3=wt.updateListener.of(e=>{if(e.selectionSet&&B3(e.state)){let t=e.state.selection.main.head;V3(e.view,t)}}),i1=new Set(["FunctionDefinition","LambdaExpression","ArrayComprehensionExpression","SetComprehensionExpression","DictionaryComprehensionExpression","ComprehensionExpression","ClassDefinition"]),$3=new Set(["ClassDefinition"]);function o1(e,t){requestAnimationFrame(()=>{e.focus(),e.dispatch({selection:{anchor:t,head:t},effects:wt.scrollIntoView(t,{y:"center"})})})}function W3(e,t){let a=nm(e),o=null;return a.iterate({enter:s=>{if(o!==null)return!1;if(s.name==="VariableName"&&e.doc.sliceString(s.from,s.to)===t)return o=s.from,!1;if(s.name==="Comment"||s.name==="String")return!1}}),o}function U3(e,t){let a=[],o=e.resolveInner(t,0);for(;o;)i1.has(o.name)&&(a.some(s=>s.type==="FunctionDefinition"||s.type==="LambdaExpression")&&o.name==="ClassDefinition"||a.push({id:o.from,type:o.name})),o=o.parent;return a.push({id:-1,type:"global"}),a}function Ss(e,t,a){e.push({scopeId:t,from:a})}function K3(e,t){if(e.firstChild())do t(e.node);while(e.nextSibling())}function Ef(e,t,a,o,s){switch(e.name){case"VariableName":t.doc.sliceString(e.from,e.to)===a&&Ss(s,o,e.from);break;case"TupleExpression":case"ArrayExpression":{let c=e.node.cursor();c.firstChild();do Ef(c,t,a,o,s);while(c.nextSibling());break}default:break}}function s1(e,t,a,o,s){let c=e.cursor();c.firstChild();do{if(c.name!=="ParamList")continue;let f=c.node.cursor();f.firstChild();do f.name==="VariableName"&&t.doc.sliceString(f.from,f.to)===a&&Ss(s,o,f.from);while(f.nextSibling())}while(c.nextSibling())}function Q3(e,t,a,o,s){let c=e.cursor();c.firstChild();let f=!1;do if(c.name==="for")f=!0;else{if(f&&c.name==="in")break;f&&Ef(c,t,a,o,s)}while(c.nextSibling())}function l1(e,t,a,o,s){let c=e.cursor(),f=c.name,d=c.from,m=i1.has(f)?[...o,d]:o,b=m[m.length-1]??-1;switch(f){case"FunctionDefinition":case"ClassDefinition":{let w=e.cursor();w.firstChild();do if(w.name==="VariableName"&&t.doc.sliceString(w.from,w.to)===a){Ss(s,o[o.length-1]??-1,w.from);break}while(w.nextSibling());f==="FunctionDefinition"&&s1(e,t,a,d,s);break}case"LambdaExpression":s1(e,t,a,d,s);break;case"ArrayComprehensionExpression":case"DictionaryComprehensionExpression":case"SetComprehensionExpression":case"ComprehensionExpression":case"ForStatement":Q3(e,t,a,b,s);break;case"AssignStatement":{let w=[],x=e.cursor();x.firstChild();do x.name==="AssignOp"&&w.push(x.from);while(x.nextSibling());let S=w[w.length-1];if(S===void 0)break;let E=e.cursor();E.firstChild();do E.from<S&&Ef(E,t,a,b,s);while(E.nextSibling());break}case"ImportStatement":{let w=e.cursor();w.firstChild();let x=!1,S=null,E=()=>{S!=null&&S.matches&&Ss(s,b,S.from),S=null};do{if(w.name==="import"){x=!0;continue}if(x){if(w.name==="as"){S=null;continue}w.name==="VariableName"?(E(),S={from:w.from,matches:t.doc.sliceString(w.from,w.to)===a}):w.name===","&&E()}}while(w.nextSibling());E();break}case"TryStatement":case"WithStatement":{let w=e.cursor();w.firstChild();let x=!1;do w.name==="as"?x=!0:x&&w.name==="VariableName"&&t.doc.sliceString(w.from,w.to)===a&&(Ss(s,b,w.from),x=!1);while(w.nextSibling());break}default:break}K3(c,w=>{l1(w,t,a,m,s)})}function G3(e,t,a){let o=nm(e),s=[];l1(o,e,t,[],s);let c=Math.max(0,Math.min(a,e.doc.length));for(let f of U3(o,c)){let d=s.filter(m=>m.scopeId===f.id).filter(m=>$3.has(f.type)?m.from<=c:!0).toSorted((m,b)=>m.from-b.from)[0];if(d)return d.from}return null}Ml=function(e,t,a){let{state:o}=e,s=a===void 0?W3(o,t):G3(o,t,a);return s===null?!1:(o1(e,s),!0)};function J3(e,t){return o1(e,e.state.doc.line(t).from),!0}function X3(e,t){let a=Te.get(a8);return(a==="mac"?e.mac??e.key:a==="windows"?e.win??e.key:e.linux??e.key)===t}function Y3(e){let{from:t,to:a}=e.selection.main;if(t===a){let{startToken:o,endToken:s}=Sf(e.doc,t);return{position:o,word:e.doc.sliceString(o,s)}}return{position:t,word:e.doc.sliceString(t,a)}}function Z3(e,t){if(!t)return null;let a=e[t];return!a||a.declaredBy.length===0?null:a.declaredBy[0]}function eE(e){return e.startsWith("_")}Pd=function(e){let{state:t}=e,{position:a,word:o}=Y3(t);return o?(A_(e),e.dispatch({effects:z8}),nE(e,o,a)):!1};function tE(e,t=Te.get(i8).getHotkey("cell.goToDefinition").key){var a;for(let o of e.state.facet(fa).flat())if(X3(o,t)&&((a=o.run)!=null&&a.call(o,e)))return!0;return!1}Sx=function(e){return Pd(e)?!0:tE(e)};function nE(e,t,a){if(a!==void 0&&Ml(e,t,a))return!0;let o=rE(e,t);return o?Ml(o,t):!1}Qx=function(e,t){let a=c1(e);return a?J3(a,t):!1};function rE(e,t){if(eE(t))return e;let a=Z3(Te.get(ti),t);return a?c1(a):null}function c1(e){var t;return((t=Te.get(Xe).cellHandles[e].current)==null?void 0:t.editorView)??null}function aE(e){var t=e.Pos;function a(u,h,y){if(h.line===y.line&&h.ch>=y.ch-1){var v=u.getLine(h.line).charCodeAt(h.ch);55296<=v&&v<=55551&&(y.ch+=1)}return{start:h,end:y}}var o=[{keys:"<Left>",type:"keyToKey",toKeys:"h"},{keys:"<Right>",type:"keyToKey",toKeys:"l"},{keys:"<Up>",type:"keyToKey",toKeys:"k"},{keys:"<Down>",type:"keyToKey",toKeys:"j"},{keys:"g<Up>",type:"keyToKey",toKeys:"gk"},{keys:"g<Down>",type:"keyToKey",toKeys:"gj"},{keys:"<Space>",type:"keyToKey",toKeys:"l"},{keys:"<BS>",type:"keyToKey",toKeys:"h"},{keys:"<Del>",type:"keyToKey",toKeys:"x"},{keys:"<C-Space>",type:"keyToKey",toKeys:"W"},{keys:"<C-BS>",type:"keyToKey",toKeys:"B"},{keys:"<S-Space>",type:"keyToKey",toKeys:"w"},{keys:"<S-BS>",type:"keyToKey",toKeys:"b"},{keys:"<C-n>",type:"keyToKey",toKeys:"j"},{keys:"<C-p>",type:"keyToKey",toKeys:"k"},{keys:"<C-[>",type:"keyToKey",toKeys:"<Esc>"},{keys:"<C-c>",type:"keyToKey",toKeys:"<Esc>"},{keys:"<C-[>",type:"keyToKey",toKeys:"<Esc>",context:"insert"},{keys:"<C-c>",type:"keyToKey",toKeys:"<Esc>",context:"insert"},{keys:"<C-Esc>",type:"keyToKey",toKeys:"<Esc>"},{keys:"<C-Esc>",type:"keyToKey",toKeys:"<Esc>",context:"insert"},{keys:"s",type:"keyToKey",toKeys:"cl",context:"normal"},{keys:"s",type:"keyToKey",toKeys:"c",context:"visual"},{keys:"S",type:"keyToKey",toKeys:"cc",context:"normal"},{keys:"S",type:"keyToKey",toKeys:"VdO",context:"visual"},{keys:"<Home>",type:"keyToKey",toKeys:"0"},{keys:"<End>",type:"keyToKey",toKeys:"$"},{keys:"<PageUp>",type:"keyToKey",toKeys:"<C-b>"},{keys:"<PageDown>",type:"keyToKey",toKeys:"<C-f>"},{keys:"<CR>",type:"keyToKey",toKeys:"j^",context:"normal"},{keys:"<Ins>",type:"keyToKey",toKeys:"i",context:"normal"},{keys:"<Ins>",type:"action",action:"toggleOverwrite",context:"insert"},{keys:"H",type:"motion",motion:"moveToTopLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"M",type:"motion",motion:"moveToMiddleLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"L",type:"motion",motion:"moveToBottomLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"h",type:"motion",motion:"moveByCharacters",motionArgs:{forward:!1}},{keys:"l",type:"motion",motion:"moveByCharacters",motionArgs:{forward:!0}},{keys:"j",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,linewise:!0}},{keys:"k",type:"motion",motion:"moveByLines",motionArgs:{forward:!1,linewise:!0}},{keys:"gj",type:"motion",motion:"moveByDisplayLines",motionArgs:{forward:!0}},{keys:"gk",type:"motion",motion:"moveByDisplayLines",motionArgs:{forward:!1}},{keys:"w",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!1}},{keys:"W",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!1,bigWord:!0}},{keys:"e",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!0,inclusive:!0}},{keys:"E",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!0,bigWord:!0,inclusive:!0}},{keys:"b",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1}},{keys:"B",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1,bigWord:!0}},{keys:"ge",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!0,inclusive:!0}},{keys:"gE",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!0,bigWord:!0,inclusive:!0}},{keys:"{",type:"motion",motion:"moveByParagraph",motionArgs:{forward:!1,toJumplist:!0}},{keys:"}",type:"motion",motion:"moveByParagraph",motionArgs:{forward:!0,toJumplist:!0}},{keys:"(",type:"motion",motion:"moveBySentence",motionArgs:{forward:!1}},{keys:")",type:"motion",motion:"moveBySentence",motionArgs:{forward:!0}},{keys:"<C-f>",type:"motion",motion:"moveByPage",motionArgs:{forward:!0}},{keys:"<C-b>",type:"motion",motion:"moveByPage",motionArgs:{forward:!1}},{keys:"<C-d>",type:"motion",motion:"moveByScroll",motionArgs:{forward:!0,explicitRepeat:!0}},{keys:"<C-u>",type:"motion",motion:"moveByScroll",motionArgs:{forward:!1,explicitRepeat:!0}},{keys:"gg",type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!1,explicitRepeat:!0,linewise:!0,toJumplist:!0}},{keys:"G",type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!0,explicitRepeat:!0,linewise:!0,toJumplist:!0}},{keys:"g$",type:"motion",motion:"moveToEndOfDisplayLine"},{keys:"g^",type:"motion",motion:"moveToStartOfDisplayLine"},{keys:"g0",type:"motion",motion:"moveToStartOfDisplayLine"},{keys:"0",type:"motion",motion:"moveToStartOfLine"},{keys:"^",type:"motion",motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"+",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,toFirstChar:!0}},{keys:"-",type:"motion",motion:"moveByLines",motionArgs:{forward:!1,toFirstChar:!0}},{keys:"_",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,toFirstChar:!0,repeatOffset:-1}},{keys:"$",type:"motion",motion:"moveToEol",motionArgs:{inclusive:!0}},{keys:"%",type:"motion",motion:"moveToMatchedSymbol",motionArgs:{inclusive:!0,toJumplist:!0}},{keys:"f<character>",type:"motion",motion:"moveToCharacter",motionArgs:{forward:!0,inclusive:!0}},{keys:"F<character>",type:"motion",motion:"moveToCharacter",motionArgs:{forward:!1}},{keys:"t<character>",type:"motion",motion:"moveTillCharacter",motionArgs:{forward:!0,inclusive:!0}},{keys:"T<character>",type:"motion",motion:"moveTillCharacter",motionArgs:{forward:!1}},{keys:";",type:"motion",motion:"repeatLastCharacterSearch",motionArgs:{forward:!0}},{keys:",",type:"motion",motion:"repeatLastCharacterSearch",motionArgs:{forward:!1}},{keys:"'<register>",type:"motion",motion:"goToMark",motionArgs:{toJumplist:!0,linewise:!0}},{keys:"`<register>",type:"motion",motion:"goToMark",motionArgs:{toJumplist:!0}},{keys:"]`",type:"motion",motion:"jumpToMark",motionArgs:{forward:!0}},{keys:"[`",type:"motion",motion:"jumpToMark",motionArgs:{forward:!1}},{keys:"]'",type:"motion",motion:"jumpToMark",motionArgs:{forward:!0,linewise:!0}},{keys:"['",type:"motion",motion:"jumpToMark",motionArgs:{forward:!1,linewise:!0}},{keys:"]p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!0,isEdit:!0,matchIndent:!0}},{keys:"[p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!1,isEdit:!0,matchIndent:!0}},{keys:"]<character>",type:"motion",motion:"moveToSymbol",motionArgs:{forward:!0,toJumplist:!0}},{keys:"[<character>",type:"motion",motion:"moveToSymbol",motionArgs:{forward:!1,toJumplist:!0}},{keys:"|",type:"motion",motion:"moveToColumn"},{keys:"o",type:"motion",motion:"moveToOtherHighlightedEnd",context:"visual"},{keys:"O",type:"motion",motion:"moveToOtherHighlightedEnd",motionArgs:{sameLine:!0},context:"visual"},{keys:"d",type:"operator",operator:"delete"},{keys:"y",type:"operator",operator:"yank"},{keys:"c",type:"operator",operator:"change"},{keys:"=",type:"operator",operator:"indentAuto"},{keys:">",type:"operator",operator:"indent",operatorArgs:{indentRight:!0}},{keys:"<",type:"operator",operator:"indent",operatorArgs:{indentRight:!1}},{keys:"g~",type:"operator",operator:"changeCase"},{keys:"gu",type:"operator",operator:"changeCase",operatorArgs:{toLower:!0},isEdit:!0},{keys:"gU",type:"operator",operator:"changeCase",operatorArgs:{toLower:!1},isEdit:!0},{keys:"n",type:"motion",motion:"findNext",motionArgs:{forward:!0,toJumplist:!0}},{keys:"N",type:"motion",motion:"findNext",motionArgs:{forward:!1,toJumplist:!0}},{keys:"gn",type:"motion",motion:"findAndSelectNextInclusive",motionArgs:{forward:!0}},{keys:"gN",type:"motion",motion:"findAndSelectNextInclusive",motionArgs:{forward:!1}},{keys:"gq",type:"operator",operator:"hardWrap"},{keys:"gw",type:"operator",operator:"hardWrap",operatorArgs:{keepCursor:!0}},{keys:"g?",type:"operator",operator:"rot13"},{keys:"x",type:"operatorMotion",operator:"delete",motion:"moveByCharacters",motionArgs:{forward:!0},operatorMotionArgs:{visualLine:!1}},{keys:"X",type:"operatorMotion",operator:"delete",motion:"moveByCharacters",motionArgs:{forward:!1},operatorMotionArgs:{visualLine:!0}},{keys:"D",type:"operatorMotion",operator:"delete",motion:"moveToEol",motionArgs:{inclusive:!0},context:"normal"},{keys:"D",type:"operator",operator:"delete",operatorArgs:{linewise:!0},context:"visual"},{keys:"Y",type:"operatorMotion",operator:"yank",motion:"expandToLine",motionArgs:{linewise:!0},context:"normal"},{keys:"Y",type:"operator",operator:"yank",operatorArgs:{linewise:!0},context:"visual"},{keys:"C",type:"operatorMotion",operator:"change",motion:"moveToEol",motionArgs:{inclusive:!0},context:"normal"},{keys:"C",type:"operator",operator:"change",operatorArgs:{linewise:!0},context:"visual"},{keys:"~",type:"operatorMotion",operator:"changeCase",motion:"moveByCharacters",motionArgs:{forward:!0},operatorArgs:{shouldMoveCursor:!0},context:"normal"},{keys:"~",type:"operator",operator:"changeCase",context:"visual"},{keys:"<C-u>",type:"operatorMotion",operator:"delete",motion:"moveToStartOfLine",context:"insert"},{keys:"<C-w>",type:"operatorMotion",operator:"delete",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1},context:"insert"},{keys:"<C-w>",type:"idle",context:"normal"},{keys:"<C-i>",type:"action",action:"jumpListWalk",actionArgs:{forward:!0}},{keys:"<C-o>",type:"action",action:"jumpListWalk",actionArgs:{forward:!1}},{keys:"<C-e>",type:"action",action:"scroll",actionArgs:{forward:!0,linewise:!0}},{keys:"<C-y>",type:"action",action:"scroll",actionArgs:{forward:!1,linewise:!0}},{keys:"a",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"charAfter"},context:"normal"},{keys:"A",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"eol"},context:"normal"},{keys:"A",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"endOfSelectedArea"},context:"visual"},{keys:"i",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"inplace"},context:"normal"},{keys:"gi",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"lastEdit"},context:"normal"},{keys:"I",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"firstNonBlank"},context:"normal"},{keys:"gI",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"bol"},context:"normal"},{keys:"I",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"startOfSelectedArea"},context:"visual"},{keys:"o",type:"action",action:"newLineAndEnterInsertMode",isEdit:!0,interlaceInsertRepeat:!0,actionArgs:{after:!0},context:"normal"},{keys:"O",type:"action",action:"newLineAndEnterInsertMode",isEdit:!0,interlaceInsertRepeat:!0,actionArgs:{after:!1},context:"normal"},{keys:"v",type:"action",action:"toggleVisualMode"},{keys:"V",type:"action",action:"toggleVisualMode",actionArgs:{linewise:!0}},{keys:"<C-v>",type:"action",action:"toggleVisualMode",actionArgs:{blockwise:!0}},{keys:"<C-q>",type:"action",action:"toggleVisualMode",actionArgs:{blockwise:!0}},{keys:"gv",type:"action",action:"reselectLastSelection"},{keys:"J",type:"action",action:"joinLines",isEdit:!0},{keys:"gJ",type:"action",action:"joinLines",actionArgs:{keepSpaces:!0},isEdit:!0},{keys:"p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!0,isEdit:!0}},{keys:"P",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!1,isEdit:!0}},{keys:"r<character>",type:"action",action:"replace",isEdit:!0},{keys:"@<register>",type:"action",action:"replayMacro"},{keys:"q<register>",type:"action",action:"enterMacroRecordMode"},{keys:"R",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{replace:!0},context:"normal"},{keys:"R",type:"operator",operator:"change",operatorArgs:{linewise:!0,fullLine:!0},context:"visual",exitVisualBlock:!0},{keys:"u",type:"action",action:"undo",context:"normal"},{keys:"u",type:"operator",operator:"changeCase",operatorArgs:{toLower:!0},context:"visual",isEdit:!0},{keys:"U",type:"operator",operator:"changeCase",operatorArgs:{toLower:!1},context:"visual",isEdit:!0},{keys:"<C-r>",type:"action",action:"redo"},{keys:"m<register>",type:"action",action:"setMark"},{keys:'"<register>',type:"action",action:"setRegister"},{keys:"<C-r><register>",type:"action",action:"insertRegister",context:"insert",isEdit:!0},{keys:"<C-o>",type:"action",action:"oneNormalCommand",context:"insert"},{keys:"zz",type:"action",action:"scrollToCursor",actionArgs:{position:"center"}},{keys:"z.",type:"action",action:"scrollToCursor",actionArgs:{position:"center"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"zt",type:"action",action:"scrollToCursor",actionArgs:{position:"top"}},{keys:"z<CR>",type:"action",action:"scrollToCursor",actionArgs:{position:"top"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"zb",type:"action",action:"scrollToCursor",actionArgs:{position:"bottom"}},{keys:"z-",type:"action",action:"scrollToCursor",actionArgs:{position:"bottom"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:".",type:"action",action:"repeatLastEdit"},{keys:"<C-a>",type:"action",action:"incrementNumberToken",isEdit:!0,actionArgs:{increase:!0,backtrack:!1}},{keys:"<C-x>",type:"action",action:"incrementNumberToken",isEdit:!0,actionArgs:{increase:!1,backtrack:!1}},{keys:"<C-t>",type:"action",action:"indent",actionArgs:{indentRight:!0},context:"insert"},{keys:"<C-d>",type:"action",action:"indent",actionArgs:{indentRight:!1},context:"insert"},{keys:"a<register>",type:"motion",motion:"textObjectManipulation"},{keys:"i<register>",type:"motion",motion:"textObjectManipulation",motionArgs:{textObjectInner:!0}},{keys:"/",type:"search",searchArgs:{forward:!0,querySrc:"prompt",toJumplist:!0}},{keys:"?",type:"search",searchArgs:{forward:!1,querySrc:"prompt",toJumplist:!0}},{keys:"*",type:"search",searchArgs:{forward:!0,querySrc:"wordUnderCursor",wholeWordOnly:!0,toJumplist:!0}},{keys:"#",type:"search",searchArgs:{forward:!1,querySrc:"wordUnderCursor",wholeWordOnly:!0,toJumplist:!0}},{keys:"g*",type:"search",searchArgs:{forward:!0,querySrc:"wordUnderCursor",toJumplist:!0}},{keys:"g#",type:"search",searchArgs:{forward:!1,querySrc:"wordUnderCursor",toJumplist:!0}},{keys:":",type:"ex"}],s=Object.create(null),c=o.length,f=[{name:"colorscheme",shortName:"colo"},{name:"map"},{name:"imap",shortName:"im"},{name:"nmap",shortName:"nm"},{name:"vmap",shortName:"vm"},{name:"omap",shortName:"om"},{name:"noremap",shortName:"no"},{name:"nnoremap",shortName:"nn"},{name:"vnoremap",shortName:"vn"},{name:"inoremap",shortName:"ino"},{name:"onoremap",shortName:"ono"},{name:"unmap"},{name:"mapclear",shortName:"mapc"},{name:"nmapclear",shortName:"nmapc"},{name:"vmapclear",shortName:"vmapc"},{name:"imapclear",shortName:"imapc"},{name:"omapclear",shortName:"omapc"},{name:"write",shortName:"w"},{name:"undo",shortName:"u"},{name:"redo",shortName:"red"},{name:"set",shortName:"se"},{name:"setlocal",shortName:"setl"},{name:"setglobal",shortName:"setg"},{name:"sort",shortName:"sor"},{name:"substitute",shortName:"s",possiblyAsync:!0},{name:"startinsert",shortName:"start"},{name:"nohlsearch",shortName:"noh"},{name:"yank",shortName:"y"},{name:"delmarks",shortName:"delm"},{name:"marks",excludeFromCommandHistory:!0},{name:"registers",shortName:"reg",excludeFromCommandHistory:!0},{name:"vglobal",shortName:"v"},{name:"delete",shortName:"d"},{name:"join",shortName:"j"},{name:"normal",shortName:"norm"},{name:"global",shortName:"g"}],d=ko("");function m(u){u.setOption("disableInput",!0),u.setOption("showCursorWhenSelecting",!1),e.signal(u,"vim-mode-change",{mode:"normal"}),u.on("cursorActivity",Ro),le(u),e.on(u.getInputField(),"paste",w(u))}function b(u){u.setOption("disableInput",!1),u.off("cursorActivity",Ro),e.off(u.getInputField(),"paste",w(u)),u.state.vim=null,Ma&&clearTimeout(Ma)}function w(u){var h=u.state.vim;return h.onPasteFn||(h.onPasteFn=function(){h.insertMode||(u.setCursor(Ct(u.getCursor(),0,1)),Vr.enterInsertMode(u,{},h))}),h.onPasteFn}var x=/[\d]/,S=[e.isWordChar,function(u){return u&&!e.isWordChar(u)&&!/\s/.test(u)}],E=[function(u){return/\S/.test(u)}],T=["<",">"],M=["-",'"',".",":","_","/","+"],z=/^\w$/,B=/^[A-Z]$/;try{B=RegExp("^[\\p{Lu}]$","u")}catch{}function V(u,h){return h>=u.firstLine()&&h<=u.lastLine()}function N(u){return/^[a-z]$/.test(u)}function X(u){return"()[]{}".indexOf(u)!=-1}function ce(u){return x.test(u)}function A(u){return B.test(u)}function q(u){return/^\s*$/.test(u)}function $(u){return".?!".indexOf(u)!=-1}function ie(u,h){for(var y=0;y<h.length;y++)if(h[y]==u)return!0;return!1}var fe={};function me(u,h,y,v,_){if(h===void 0&&!_)throw Error("defaultValue is required unless callback is provided");if(y||(y="string"),fe[u]={type:y,defaultValue:h,callback:_},v)for(var k=0;k<v.length;k++)fe[v[k]]=fe[u];h&&ve(u,h)}function ve(u,h,y,v){var _=fe[u];v||(v={});var k=v.scope;if(!_)return Error("Unknown option: "+u);if(_.type=="boolean"){if(h&&h!==!0)return Error("Invalid argument: "+u+"="+h);h!==!1&&(h=!0)}_.callback?(k!=="local"&&_.callback(h,void 0),k!=="global"&&y&&_.callback(h,y)):(k!=="local"&&(_.value=_.type=="boolean"?!!h:h),k!=="global"&&y&&(y.state.vim.options[u]={value:h}))}function ae(u,h,y){var v=fe[u];y||(y={});var _=y.scope;if(!v)return Error("Unknown option: "+u);if(v.callback){let k=h&&v.callback(void 0,h);return _!=="global"&&k!==void 0?k:_==="local"?void 0:v.callback()}else return(_!=="global"&&h&&h.state.vim.options[u]||_!=="local"&&v||{}).value}me("filetype",void 0,"string",["ft"],function(u,h){if(h!==void 0)if(u===void 0){let y=h.getOption("mode");return y=="null"?"":y}else{let y=u==""?"null":u;h.setOption("mode",y)}}),me("textwidth",80,"number",["tw"],function(u,h){if(h!==void 0){if(u===void 0)return h.getOption("textwidth");var y=Math.round(u);y>1&&h.setOption("textwidth",y)}});var de=function(){var u=100,h=-1,y=0,v=0,_=Array(u);function k(R,j,D){var ee=_[h%u];function Y(K){var ye=++h%u,ge=_[ye];ge&&ge.clear(),_[ye]=R.setBookmark(K)}if(ee){var U=ee.find();U&&!gt(U,j)&&Y(j)}else Y(j);Y(D),y=h,v=h-u+1,v<0&&(v=0)}function I(R,j){h+=j,h>y?h=y:h<v&&(h=v);var D=_[(u+h)%u];if(D&&!D.find()){var ee=j>0?1:-1,Y,U=R.getCursor();do if(h+=ee,D=_[(u+h)%u],D&&(Y=D.find())&&!gt(U,Y))break;while(h<y&&h>v)}return D}function O(R,j){var D=h,ee=I(R,j);return h=D,ee&&ee.find()}return{cachedCursor:void 0,add:k,find:O,move:I}},be=function(u){return u?{changes:u.changes,expectCursorActivityForChange:u.expectCursorActivityForChange}:{changes:[],expectCursorActivityForChange:!1}};class oe{constructor(){this.latestRegister=void 0,this.isPlaying=!1,this.isRecording=!1,this.replaySearchQueries=[],this.onRecordingDone=void 0,this.lastInsertModeChanges=be()}exitMacroRecordMode(){var h=G.macroModeState;h.onRecordingDone&&h.onRecordingDone(),h.onRecordingDone=void 0,h.isRecording=!1}enterMacroRecordMode(h,y){var v=G.registerController.getRegister(y);if(v){if(v.clear(),this.latestRegister=y,h.openDialog){var _=cn("span",{class:"cm-vim-message"},"recording @"+y);this.onRecordingDone=h.openDialog(_,function(){},{bottom:!0})}this.isRecording=!0}}}function le(u){return u.state.vim||(u.state.vim={inputState:new Rs,lastEditInputState:void 0,lastEditActionCommand:void 0,lastHPos:-1,lastHSPos:-1,lastMotion:null,marks:{},insertMode:!1,insertModeReturn:!1,insertModeRepeat:void 0,visualMode:!1,visualLine:!1,visualBlock:!1,lastSelection:null,lastPastedText:void 0,sel:{anchor:new t(0,0),head:new t(0,0)},options:{},expectLiteralNext:!1,status:""}),u.state.vim}var G;function Oe(){for(var u in G={searchQuery:null,searchIsReversed:!1,lastSubstituteReplacePart:void 0,jumpList:de(),macroModeState:new oe,lastCharacterSearch:{increment:0,forward:!0,selectedCharacter:""},registerController:new xc({}),searchHistoryController:new Co,exCommandHistoryController:new Co},fe){var h=fe[u];h.value=h.defaultValue}}class He{constructor(h,y){this.keyName=h,this.key=y.key,this.ctrlKey=y.ctrlKey,this.altKey=y.altKey,this.metaKey=y.metaKey,this.shiftKey=y.shiftKey}}var et,Fe={enterVimMode:m,leaveVimMode:b,buildKeyMap:function(){},getRegisterController:function(){return G.registerController},resetVimGlobalState_:Oe,getVimGlobalState_:function(){return G},maybeInitVimState_:le,suppressErrorLogging:!1,InsertModeKey:He,map:function(u,h,y){Kt.map(u,h,y)},unmap:function(u,h){return Kt.unmap(u,h)},noremap:function(u,h,y){Kt.map(u,h,y,!0)},mapclear:function(u){var h=o.length,y=c,v=o.slice(0,h-y);if(o=o.slice(h-y),u)for(var _=v.length-1;_>=0;_--){var k=v[_];if(u!==k.context)if(k.context)this._mapCommand(k);else{var I=["normal","insert","visual"];for(var O in I)if(I[O]!==u){var R=Object.assign({},k);R.context=I[O],this._mapCommand(R)}}}},langmap:bi,vimKeyFromEvent:Br,setOption:ve,getOption:ae,defineOption:me,defineEx:function(u,h,y){if(!h)h=u;else if(u.indexOf(h)!==0)throw Error('(Vim.defineEx) "'+h+'" is not a prefix of "'+u+'", command not registered');Qn[u]=y,Kt.commandMap_[h]={name:u,shortName:h,type:"api"}},handleKey:function(u,h,y){var v=this.findKey(u,h,y);if(typeof v=="function")return v()},multiSelectHandleKey:Qr,findKey:function(u,h,y){var v=le(u),_=u;function k(){var D=G.macroModeState;if(D.isRecording){if(h=="q")return D.exitMacroRecordMode(),mt(_),!0;y!="mapping"&&mr(D,h)}}function I(){if(h=="<Esc>"){if(v.visualMode)Rn(_);else if(v.insertMode)hn(_);else return;return mt(_),!0}}function O(){if(I())return!0;v.inputState.keyBuffer.push(h);var D=v.inputState.keyBuffer.join(""),ee=h.length==1,Y=pr.matchCommand(D,o,v.inputState,"insert"),U=v.inputState.changeQueue;if(Y.type=="none")return mt(_),!1;if(Y.type=="partial"){if(Y.expectLiteralNext&&(v.expectLiteralNext=!0),et&&window.clearTimeout(et),et=ee&&window.setTimeout(function(){v.insertMode&&v.inputState.keyBuffer.length&&mt(_)},ae("insertModeEscKeysTimeout")),ee){var K=_.listSelections();(!U||U.removed.length!=K.length)&&(U=v.inputState.changeQueue=new Ms),U.inserted+=h;for(var ye=0;ye<K.length;ye++){var ge=Xt(K[ye].anchor,K[ye].head),Me=Tr(K[ye].anchor,K[ye].head),ke=_.getRange(ge,_.state.overwrite?Ct(Me,0,1):Me);U.removed[ye]=(U.removed[ye]||"")+ke}}return!ee}else Y.type=="full"&&(v.inputState.keyBuffer.length=0);if(v.expectLiteralNext=!1,et&&window.clearTimeout(et),Y.command&&U){for(var K=_.listSelections(),ye=0;ye<K.length;ye++){var Ae=K[ye].head;_.replaceRange(U.removed[ye]||"",Ct(Ae,0,-U.inserted.length),Ae,"+input")}G.macroModeState.lastInsertModeChanges.changes.pop()}return Y.command||mt(_),Y.command}function R(){if(k()||I())return!0;v.inputState.keyBuffer.push(h);var D=v.inputState.keyBuffer.join("");if(/^[1-9]\d*$/.test(D))return!0;var ee=/^(\d*)(.*)$/.exec(D);if(!ee)return mt(_),!1;var Y=v.visualMode?"visual":"normal",U=ee[2]||ee[1];v.inputState.operatorShortcut&&v.inputState.operatorShortcut.slice(-1)==U&&(U=v.inputState.operatorShortcut);var K=pr.matchCommand(U,o,v.inputState,Y);return K.type=="none"?(mt(_),!1):K.type=="partial"?(K.expectLiteralNext&&(v.expectLiteralNext=!0),!0):K.type=="clear"?(mt(_),!0):(v.expectLiteralNext=!1,v.inputState.keyBuffer.length=0,ee=/^(\d*)(.*)$/.exec(D),ee&&ee[1]&&ee[1]!="0"&&v.inputState.pushRepeatDigit(ee[1]),K.command)}var j=v.insertMode?O():R();if(j===!1)return!v.insertMode&&(h.length===1||e.isMac&&/<A-.>/.test(h))?function(){return!0}:void 0;if(j===!0)return function(){return!0};if(j)return function(){return _.operation(function(){_.curOp.isVimOp=!0;try{if(typeof j!="object")return;j.type=="keyToKey"?Mt(_,j.toKeys,j):pr.processCommand(_,v,j)}catch(D){throw _.state.vim=void 0,le(_),Fe.suppressErrorLogging||console.log(D),D}return!0})}},handleEx:function(u,h){Kt.processCommand(u,h)},defineMotion:Xf,defineAction:Cc,defineOperator:Yf,mapCommand:zc,_mapCommand:Or,defineRegister:Jf,exitVisualMode:Rn,exitInsertMode:hn},Ne=[],Le=!1,De;function Tt(u){if(!De)throw Error("No prompt to send key to");if(u[0]=="<"){var h=u.toLowerCase().slice(1,-1);if(h=h.split("-").pop()||"",h=="lt")u="<";else if(h=="space")u=" ";else if(h=="cr")u=`
58
- `;else if(An[h]){var y=De.value||"",v={key:An[h],target:{value:y,selectionEnd:y.length,selectionStart:y.length}};De.onKeyDown&&De.onKeyDown(v,De.value,k),De&&De.onKeyUp&&De.onKeyUp(v,De.value,k);return}}if(u==`
59
- `){var _=De;De=null,_.onClose&&_.onClose(_.value)}else De.value=(De.value||"")+u;function k(I){De&&(typeof I=="string"?De.value=I:De=null)}}function Mt(u,h,y){var v=Le;if(y){if(Ne.indexOf(y)!=-1)return;Ne.push(y),Le=y.noremap!=0}try{for(var _=le(u),k=/<(?:[CSMA]-)*\w+>|./gi,I;I=k.exec(h);){var O=I[0],R=_.insertMode;if(De){Tt(O);continue}if(!Fe.handleKey(u,O,"mapping")&&R&&_.insertMode){if(O[0]=="<"){var j=O.toLowerCase().slice(1,-1);if(j=j.split("-").pop()||"",j=="lt")O="<";else if(j=="space")O=" ";else if(j=="cr")O=`
60
- `;else if(An.hasOwnProperty(j)){O=An[j],Ai(u,O);continue}else O=O[0],k.lastIndex=I.index+1}u.replaceSelection(O)}}}finally{if(Ne.pop(),Le=Ne.length?v:!1,!Ne.length&&De){var D=De;De=null,Aa(u,D)}}}var Ca={Return:"CR",Backspace:"BS",Delete:"Del",Escape:"Esc",Insert:"Ins",ArrowLeft:"Left",ArrowRight:"Right",ArrowUp:"Up",ArrowDown:"Down",Enter:"CR"," ":"Space"},xo={Shift:1,Alt:1,Command:1,Control:1,CapsLock:1,AltGraph:1,Dead:1,Unidentified:1},An={};"Left|Right|Up|Down|End|Home".split("|").concat(Object.keys(Ca)).forEach(function(u){An[(Ca[u]||"").toLowerCase()]=An[u.toLowerCase()]=u});function Br(u,h){var k;var y=u.key;if(!xo[y]){y.length>1&&y[0]=="n"&&(y=y.replace("Numpad","")),y=Ca[y]||y;var v="";if(u.ctrlKey&&(v+="C-"),u.altKey&&(v+="A-"),u.metaKey&&(v+="M-"),e.isMac&&v=="A-"&&y.length==1&&(v=v.slice(2)),(v||y.length>1)&&u.shiftKey&&(v+="S-"),h&&!h.expectLiteralNext&&y.length==1){if(d.keymap&&y in d.keymap)(d.remapCtrl!=0||!v)&&(y=d.keymap[y]);else if(y.charCodeAt(0)>128&&!s[y]){var _=((k=u.code)==null?void 0:k.slice(-1))||"";u.shiftKey||(_=_.toLowerCase()),_&&(y=_,!v&&u.altKey&&(v="A-"))}}return v+=y,v.length>1&&(v="<"+v+">"),v}}function bi(u,h){d.string!==u&&(d=ko(u)),d.remapCtrl=h}function ko(u){let h={};if(!u)return{keymap:h,string:""};function y(v){return v.split(/\\?(.)/).filter(Boolean)}return u.split(/((?:[^\\,]|\\.)+),/).map(v=>{if(!v)return;let _=v.split(/((?:[^\\;]|\\.)+);/);if(_.length==3){let k=y(_[1]),I=y(_[2]);if(k.length!==I.length)return;for(let O=0;O<k.length;++O)h[k[O]]=I[O]}else if(_.length==1){let k=y(v);if(k.length%2!=0)return;for(let I=0;I<k.length;I+=2)h[k[I]]=k[I+1]}}),{keymap:h,string:u}}me("langmap",void 0,"string",["lmap"],function(u,h){if(u===void 0)return d.string;bi(u)});class Rs{constructor(){this.prefixRepeat=[],this.motionRepeat=[],this.operator=null,this.operatorArgs=null,this.motion=null,this.motionArgs=null,this.keyBuffer=[],this.registerName=void 0,this.changeQueue=null}pushRepeatDigit(h){this.operator?this.motionRepeat=this.motionRepeat.concat(h):this.prefixRepeat=this.prefixRepeat.concat(h)}getRepeat(){var h=0;return(this.prefixRepeat.length>0||this.motionRepeat.length>0)&&(h=1,this.prefixRepeat.length>0&&(h*=parseInt(this.prefixRepeat.join(""),10)),this.motionRepeat.length>0&&(h*=parseInt(this.motionRepeat.join(""),10))),h}}function mt(u,h){u.state.vim.inputState=new Rs,u.state.vim.expectLiteralNext=!1,e.signal(u,"vim-command-done",h)}function Ms(){this.removed=[],this.inserted=""}class vn{constructor(h,y,v){this.clear(),this.keyBuffer=[h||""],this.insertModeChanges=[],this.searchQueries=[],this.linewise=!!y,this.blockwise=!!v}setText(h,y,v){this.keyBuffer=[h||""],this.linewise=!!y,this.blockwise=!!v}pushText(h,y){y&&(this.linewise||this.keyBuffer.push(`
61
- `),this.linewise=!0),this.keyBuffer.push(h)}pushInsertModeChanges(h){this.insertModeChanges.push(be(h))}pushSearchQuery(h){this.searchQueries.push(h)}clear(){this.keyBuffer=[],this.insertModeChanges=[],this.searchQueries=[],this.linewise=!1}toString(){return this.keyBuffer.join("")}}function Jf(u,h){var y=G.registerController.registers;if(!u||u.length!=1)throw Error("Register name must be 1 character");if(y[u])throw Error("Register already defined "+u);y[u]=h,M.push(u)}class xc{constructor(h){this.registers=h,this.unnamedRegister=h['"']=new vn,h["."]=new vn,h[":"]=new vn,h["/"]=new vn,h["+"]=new vn}pushText(h,y,v,_,k){if(h!=="_"){_&&v.charAt(v.length-1)!==`
62
- `&&(v+=`
63
- `);var I=this.isValidRegister(h)?this.getRegister(h):null;if(!I||!h){switch(y){case"yank":this.registers[0]=new vn(v,_,k);break;case"delete":case"change":v.indexOf(`
64
- `)==-1?this.registers["-"]=new vn(v,_):(this.shiftNumericRegisters_(),this.registers[1]=new vn(v,_));break}this.unnamedRegister.setText(v,_,k);return}A(h)?I.pushText(v,_):I.setText(v,_,k),h==="+"&&navigator.clipboard.writeText(v),this.unnamedRegister.setText(I.toString(),_)}}getRegister(h){return this.isValidRegister(h)?(h=h.toLowerCase(),this.registers[h]||(this.registers[h]=new vn),this.registers[h]):this.unnamedRegister}isValidRegister(h){return h&&(ie(h,M)||z.test(h))}shiftNumericRegisters_(){for(var h=9;h>=2;h--)this.registers[h]=this.getRegister(""+(h-1))}}class Co{constructor(){this.historyBuffer=[],this.iterator=0,this.initialPrefix=null}nextMatch(h,y){var v=this.historyBuffer,_=y?-1:1;this.initialPrefix===null&&(this.initialPrefix=h);for(var k=this.iterator+_;y?k>=0:k<v.length;k+=_)for(var I=v[k],O=0;O<=I.length;O++)if(this.initialPrefix==I.substring(0,O))return this.iterator=k,I;if(k>=v.length)return this.iterator=v.length,this.initialPrefix;if(k<0)return h}pushInput(h){var y=this.historyBuffer.indexOf(h);y>-1&&this.historyBuffer.splice(y,1),h.length&&this.historyBuffer.push(h)}reset(){this.initialPrefix=null,this.iterator=this.historyBuffer.length}}var pr={matchCommand:function(u,h,y,v){var _=Zf(u,h,v,y),k=_.full[0];if(!k)return _.partial.length?{type:"partial",expectLiteralNext:_.partial.length==1&&_.partial[0].keys.slice(-11)=="<character>"}:{type:"none"};if(k.keys.slice(-11)=="<character>"||k.keys.slice(-10)=="<register>"){var I=wi(u);if(!I||I.length>1)return{type:"clear"};y.selectedCharacter=I}return{type:"full",command:k}},processCommand:function(u,h,y){switch(h.inputState.repeatOverride=y.repeatOverride,y.type){case"motion":this.processMotion(u,h,y);break;case"operator":this.processOperator(u,h,y);break;case"operatorMotion":this.processOperatorMotion(u,h,y);break;case"action":this.processAction(u,h,y);break;case"search":this.processSearch(u,h,y);break;case"ex":case"keyToEx":this.processEx(u,h,y);break}},processMotion:function(u,h,y){h.inputState.motion=y.motion,h.inputState.motionArgs=So(y.motionArgs),this.evalInput(u,h)},processOperator:function(u,h,y){var v=h.inputState;if(v.operator)if(v.operator==y.operator){v.motion="expandToLine",v.motionArgs={linewise:!0,repeat:1},this.evalInput(u,h);return}else mt(u);v.operator=y.operator,v.operatorArgs=So(y.operatorArgs),y.keys.length>1&&(v.operatorShortcut=y.keys),y.exitVisualBlock&&(h.visualBlock=!1,$r(u)),h.visualMode&&this.evalInput(u,h)},processOperatorMotion:function(u,h,y){var v=h.visualMode,_=So(y.operatorMotionArgs);_&&v&&_.visualLine&&(h.visualLine=!0),this.processOperator(u,h,y),v||this.processMotion(u,h,y)},processAction:function(u,h,y){var v=h.inputState,_=v.getRepeat(),k=!!_,I=So(y.actionArgs)||{repeat:1};v.selectedCharacter&&(I.selectedCharacter=v.selectedCharacter),y.operator&&this.processOperator(u,h,y),y.motion&&this.processMotion(u,h,y),(y.motion||y.operator)&&this.evalInput(u,h),I.repeat=_||1,I.repeatIsExplicit=k,I.registerName=v.registerName,mt(u),h.lastMotion=null,y.isEdit&&this.recordLastEdit(h,v,y),Vr[y.action](u,I,h)},processSearch:function(u,h,y){if(!u.getSearchCursor)return;var v=y.searchArgs.forward,_=y.searchArgs.wholeWordOnly;wn(u).setReversed(!v);var k=v?"/":"?",I=wn(u).getQuery(),O=u.getScrollInfo(),R="";function j(ke,Ae,Ye){G.searchHistoryController.pushInput(ke),G.searchHistoryController.reset();try{Wr(u,ke,Ae,Ye)}catch{Je(u,"Invalid regex: "+ke),mt(u);return}pr.processMotion(u,h,{keys:"",type:"motion",motion:"findNext",motionArgs:{forward:!0,toJumplist:y.searchArgs.toJumplist}})}function D(ke){u.scrollTo(O.left,O.top),j(ke,!0,!0);var Ae=G.macroModeState;Ae.isRecording&&Ii(Ae,ke)}function ee(){return ae("pcre")?"(JavaScript regexp: set pcre)":"(Vim regexp: set nopcre)"}function Y(ke,Ae,Ye){var Be=Br(ke),dt,yt;Be=="<Up>"||Be=="<Down>"?(dt=Be=="<Up>",yt=ke.target?ke.target.selectionEnd:0,Ae=G.searchHistoryController.nextMatch(Ae,dt)||"",Ye(Ae),yt&&ke.target&&(ke.target.selectionEnd=ke.target.selectionStart=Math.min(yt,ke.target.value.length))):Be&&Be!="<Left>"&&Be!="<Right>"&&G.searchHistoryController.reset(),R=Ae,U()}function U(){var ke;try{ke=Wr(u,R,!0,!0)}catch{}ke?u.scrollIntoView(Ur(u,!v,ke),30):(Kr(u),u.scrollTo(O.left,O.top))}function K(ke,Ae,Ye){var Be=Br(ke);Be=="<Esc>"||Be=="<C-c>"||Be=="<C-[>"||Be=="<BS>"&&Ae==""?(G.searchHistoryController.pushInput(Ae),G.searchHistoryController.reset(),Wr(u,(I==null?void 0:I.source)||""),Kr(u),u.scrollTo(O.left,O.top),e.e_stop(ke),mt(u),Ye(),u.focus()):Be=="<Up>"||Be=="<Down>"?e.e_stop(ke):Be=="<C-u>"&&(e.e_stop(ke),Ye(""))}switch(y.searchArgs.querySrc){case"prompt":var ye=G.macroModeState;ye.isPlaying?j(ye.replaySearchQueries.shift()||"",!0,!1):Aa(u,{onClose:D,prefix:k,desc:cn("span",{$cursor:"pointer",onmousedown:function(Ae){Ae.preventDefault(),ve("pcre",!ae("pcre")),this.textContent=ee(),U()}},ee()),onKeyUp:Y,onKeyDown:K});break;case"wordUnderCursor":var ge=Kn(u,{noSymbol:!0}),Me=!0;if(ge||(ge=Kn(u,{noSymbol:!1}),Me=!1),!ge){Je(u,"No word under cursor"),mt(u);return}let ke=u.getLine(ge.start.line).substring(ge.start.ch,ge.end.ch);ke=Me&&_?"\\b"+ke+"\\b":Hr(ke),G.jumpList.cachedCursor=u.getCursor(),u.setCursor(ge.start),j(ke,!0,!1);break}},processEx:function(u,h,y){function v(O){G.exCommandHistoryController.pushInput(O),G.exCommandHistoryController.reset(),Kt.processCommand(u,O),u.state.vim&&mt(u),Kr(u)}function _(O,R,j){var D=Br(O),ee,Y;(D=="<Esc>"||D=="<C-c>"||D=="<C-[>"||D=="<BS>"&&R=="")&&(G.exCommandHistoryController.pushInput(R),G.exCommandHistoryController.reset(),e.e_stop(O),mt(u),Kr(u),j(),u.focus()),D=="<Up>"||D=="<Down>"?(e.e_stop(O),ee=D=="<Up>",Y=O.target?O.target.selectionEnd:0,R=G.exCommandHistoryController.nextMatch(R,ee)||"",j(R),Y&&O.target&&(O.target.selectionEnd=O.target.selectionStart=Math.min(Y,O.target.value.length))):D=="<C-u>"?(e.e_stop(O),j("")):D&&D!="<Left>"&&D!="<Right>"&&G.exCommandHistoryController.reset()}function k(O,R){var j=new e.StringStream(R),D={};try{if(Kt.parseInput_(u,j,D),D.commandName!="s"){Kr(u);return}var ee=Kt.matchCommand_(D.commandName);if(!ee||(Kt.parseCommandArgs_(j,D,ee),!D.argString))return;var Y=Fs(D.argString.slice(1),!0,!0);Y&&Lo(u,Y)}catch{}}if(y.type=="keyToEx")Kt.processCommand(u,y.exArgs.input);else{var I={onClose:v,onKeyDown:_,onKeyUp:k,prefix:":"};h.visualMode&&(I.value="'<,'>",I.selectValueOnOpen=!1),Aa(u,I)}},evalInput:function(u,h){var y=h.inputState,v=y.motion,_=y.motionArgs||{repeat:1},k=y.operator,I=y.operatorArgs||{},O=y.registerName,R=h.sel,j=Qe(h.visualMode?Pt(u,R.head):u.getCursor("head")),D=Qe(h.visualMode?Pt(u,R.anchor):u.getCursor("anchor")),ee=Qe(j),Y=Qe(D),U,K,ye;if(k&&this.recordLastEdit(h,y),ye=y.repeatOverride===void 0?y.getRepeat():y.repeatOverride,ye>0&&_.explicitRepeat?_.repeatIsExplicit=!0:(_.noRepeat||!_.explicitRepeat&&ye===0)&&(ye=1,_.repeatIsExplicit=!1),y.selectedCharacter&&(_.selectedCharacter=I.selectedCharacter=y.selectedCharacter),_.repeat=ye,mt(u),v){var ge=bn[v](u,j,_,h,y);if(h.lastMotion=bn[v],!ge)return;if(_.toJumplist){var Me=G.jumpList,ke=Me.cachedCursor;ke?(Yt(u,ke,ge),delete Me.cachedCursor):Yt(u,j,ge)}ge instanceof Array?(K=ge[0],U=ge[1]):U=ge,U||(U=Qe(j)),h.visualMode?(h.visualBlock&&U.ch===1/0||(U=Pt(u,U,ee)),K&&(K=Pt(u,K)),K||(K=Y),R.anchor=K,R.head=U,$r(u),fn(u,h,"<",_t(K,U)?K:U),fn(u,h,">",_t(K,U)?U:K)):k||(U=Pt(u,U,ee),u.setCursor(U.line,U.ch))}if(k){if(I.lastSel){K=Y;var Ae=I.lastSel,Ye=Math.abs(Ae.head.line-Ae.anchor.line),Be=Math.abs(Ae.head.ch-Ae.anchor.ch);U=Ae.visualLine?new t(Y.line+Ye,Y.ch):Ae.visualBlock?new t(Y.line+Ye,Y.ch+Be):Ae.head.line==Ae.anchor.line?new t(Y.line,Y.ch+Be):new t(Y.line+Ye,Y.ch),h.visualMode=!0,h.visualLine=Ae.visualLine,h.visualBlock=Ae.visualBlock,R=h.sel={anchor:K,head:U},$r(u)}else h.visualMode&&(I.lastSel={anchor:Qe(R.anchor),head:Qe(R.head),visualBlock:h.visualBlock,visualLine:h.visualLine});var dt,yt,je,Pe,xt;if(h.visualMode){dt=Xt(R.head,R.anchor),yt=Tr(R.head,R.anchor),je=h.visualLine||I.linewise,Pe=h.visualBlock?"block":je?"line":"char";var Nt=a(u,dt,yt);if(xt=To(u,{anchor:Nt.start,head:Nt.end},Pe),je){var Vt=xt.ranges;if(Pe=="block")for(var Ri=0;Ri<Vt.length;Ri++)Vt[Ri].head.ch=It(u,Vt[Ri].head.line);else Pe=="line"&&(Vt[0].head=new t(Vt[0].head.line+1,0))}}else{if(dt=Qe(K||Y),yt=Qe(U||ee),_t(yt,dt)){var qc=dt;dt=yt,yt=qc}je=_.linewise||I.linewise,je?Ic(u,dt,yt):_.forward&&Ns(u,dt,yt),Pe="char";var Fc=!_.inclusive||je,Nt=a(u,dt,yt);xt=To(u,{anchor:Nt.start,head:Nt.end},Pe,Fc)}u.setSelections(xt.ranges,xt.primary),h.lastMotion=null,I.repeat=ye,I.registerName=O,I.linewise=je;var Mo=Jt[k](u,I,xt.ranges,Y,U);h.visualMode&&Rn(u,Mo!=null),Mo&&u.setCursor(Mo)}},recordLastEdit:function(u,h,y){var v=G.macroModeState;v.isPlaying||(u.lastEditInputState=h,u.lastEditActionCommand=y,v.lastInsertModeChanges.changes=[],v.lastInsertModeChanges.expectCursorActivityForChange=!1,v.lastInsertModeChanges.visualBlock=u.visualBlock?u.sel.head.line-u.sel.anchor.line:0)}},bn={moveToTopLine:function(u,h,y){var v=Ei(u).top+y.repeat-1;return new t(v,Mn(u.getLine(v)))},moveToMiddleLine:function(u){var h=Ei(u),y=Math.floor((h.top+h.bottom)*.5);return new t(y,Mn(u.getLine(y)))},moveToBottomLine:function(u,h,y){var v=Ei(u).bottom-y.repeat+1;return new t(v,Mn(u.getLine(v)))},expandToLine:function(u,h,y){return new t(h.line+y.repeat-1,1/0)},findNext:function(u,h,y){var v=wn(u),_=v.getQuery();if(_){var k=!y.forward;k=v.isReversed()?!k:k,Lo(u,_);var I=Ur(u,k,_,y.repeat);return I||Je(u,"No match found "+_+(ae("pcre")?" (set nopcre to use Vim regexps)":"")),I}},findAndSelectNextInclusive:function(u,h,y,v,_){var k=wn(u),I=k.getQuery();if(I){var O=!y.forward;O=k.isReversed()?!O:O;var R=ip(u,O,I,y.repeat,v);if(R){if(_.operator)return R;var j=R[0],D=new t(R[1].line,R[1].ch-1);if(v.visualMode){(v.visualLine||v.visualBlock)&&(v.visualLine=!1,v.visualBlock=!1,e.signal(u,"vim-mode-change",{mode:"visual",subMode:""}));var ee=v.sel.anchor;if(ee)return k.isReversed()?y.forward?[ee,j]:[ee,D]:y.forward?[ee,D]:[ee,j]}else v.visualMode=!0,v.visualLine=!1,v.visualBlock=!1,e.signal(u,"vim-mode-change",{mode:"visual",subMode:""});return O?[D,j]:[j,D]}}},goToMark:function(u,h,y,v){var _=Oo(u,v,y.selectedCharacter||"");return _?y.linewise?{line:_.line,ch:Mn(u.getLine(_.line))}:_:null},moveToOtherHighlightedEnd:function(u,h,y,v){var _=v.sel;return v.visualBlock&&y.sameLine?[Pt(u,new t(_.anchor.line,_.head.ch)),Pt(u,new t(_.head.line,_.anchor.ch))]:[_.head,_.anchor]},jumpToMark:function(u,h,y,v){for(var _=h,k=0;k<y.repeat;k++){var I=_;for(var O in v.marks)if(N(O)){var R=v.marks[O].find();if(!(y.forward?_t(R,I):_t(I,R))&&!(y.linewise&&R.line==I.line)){var j=gt(I,_),D=y.forward?_i(I,R,_):_i(_,R,I);(j||D)&&(_=R)}}}return y.linewise&&(_=new t(_.line,Mn(u.getLine(_.line)))),_},moveByCharacters:function(u,h,y){var v=h,_=y.repeat,k=y.forward?v.ch+_:v.ch-_;return new t(v.line,k)},moveByLines:function(u,h,y,v){var _=h,k=_.ch;switch(v.lastMotion){case this.moveByLines:case this.moveByDisplayLines:case this.moveByScroll:case this.moveToColumn:case this.moveToEol:k=v.lastHPos;break;default:v.lastHPos=k}var I=y.repeat+(y.repeatOffset||0),O=y.forward?_.line+I:_.line-I,R=u.firstLine(),j=u.lastLine(),D=u.findPosV(_,y.forward?I:-I,"line",v.lastHSPos);return(y.forward?D.line>O:D.line<O)&&(O=D.line,k=D.ch),O<R&&_.line==R?this.moveToStartOfLine(u,h,y,v):O>j&&_.line==j?Io(u,h,y,v,!0):(y.toFirstChar&&(k=Mn(u.getLine(O)),v.lastHPos=k),v.lastHSPos=u.charCoords(new t(O,k),"div").left,new t(O,k))},moveByDisplayLines:function(u,h,y,v){var _=h;switch(v.lastMotion){case this.moveByDisplayLines:case this.moveByScroll:case this.moveByLines:case this.moveToColumn:case this.moveToEol:break;default:v.lastHSPos=u.charCoords(_,"div").left}var k=y.repeat,I=u.findPosV(_,y.forward?k:-k,"line",v.lastHSPos);if(I.hitSide)if(y.forward){var O={top:u.charCoords(I,"div").top+8,left:v.lastHSPos};I=u.coordsChar(O,"div")}else{var R=u.charCoords(new t(u.firstLine(),0),"div");R.left=v.lastHSPos,I=u.coordsChar(R,"div")}return v.lastHPos=I.ch,I},moveByPage:function(u,h,y){var v=h,_=y.repeat;return u.findPosV(v,y.forward?_:-_,"page")},moveByParagraph:function(u,h,y){var v=y.forward?1:-1;return Lt(u,h,y.repeat,v).start},moveBySentence:function(u,h,y){var v=y.forward?1:-1;return Oc(u,h,y.repeat,v)},moveByScroll:function(u,h,y,v){var _=u.getScrollInfo(),k=null,I=y.repeat;I||(I=_.clientHeight/(2*u.defaultTextHeight()));var O=u.charCoords(h,"local");if(y.repeat=I,k=bn.moveByDisplayLines(u,h,y,v),!k)return null;var R=u.charCoords(k,"local");return u.scrollTo(null,_.top+R.top-O.top),k},moveByWords:function(u,h,y){return ki(u,h,y.repeat,!!y.forward,!!y.wordEnd,!!y.bigWord)},moveTillCharacter:function(u,h,y){var v=y.repeat,_=Ir(u,v,y.forward,y.selectedCharacter,h),k=y.forward?-1:1;return Ta(k,y),_?(_.ch+=k,_):null},moveToCharacter:function(u,h,y){var v=y.repeat;return Ta(0,y),Ir(u,v,y.forward,y.selectedCharacter,h)||h},moveToSymbol:function(u,h,y){var v=y.repeat;return y.selectedCharacter&&np(u,v,y.forward,y.selectedCharacter)||h},moveToColumn:function(u,h,y,v){var _=y.repeat;return v.lastHPos=_-1,v.lastHSPos=u.charCoords(h,"div").left,Ia(u,_)},moveToEol:function(u,h,y,v){return Io(u,h,y,v,!1)},moveToFirstNonWhiteSpaceCharacter:function(u,h){var y=h;return new t(y.line,Mn(u.getLine(y.line)))},moveToMatchedSymbol:function(u,h){for(var y=h,v=y.line,_=y.ch,k=u.getLine(v),I;_<k.length;_++)if(I=k.charAt(_),I&&X(I)){var O=u.getTokenTypeAt(new t(v,_+1));if(O!=="string"&&O!=="comment")break}if(_<k.length){var R=I==="<"||I===">"?/[(){}[\]<>]/:/[(){}[\]]/;return u.findMatchingBracket(new t(v,_),{bracketRegex:R}).to}else return y},moveToStartOfLine:function(u,h){return new t(h.line,0)},moveToLineOrEdgeOfDocument:function(u,h,y){var v=y.forward?u.lastLine():u.firstLine();return y.repeatIsExplicit&&(v=y.repeat-u.getOption("firstLineNumber")),new t(v,Mn(u.getLine(v)))},moveToStartOfDisplayLine:function(u){return u.execCommand("goLineLeft"),u.getCursor()},moveToEndOfDisplayLine:function(u){u.execCommand("goLineRight");var h=u.getCursor();return h.sticky=="before"&&h.ch--,h},textObjectManipulation:function(u,h,y,v){var _={"(":")",")":"(","{":"}","}":"{","[":"]","]":"[","<":">",">":"<"},k={"'":!0,'"':!0,"`":!0},I=y.selectedCharacter||"";I=="b"?I="(":I=="B"&&(I="{");var O=!y.textObjectInner,R,j;if(_[I]){if(j=!0,R=Lr(u,h,I,O),!R){var D=u.getSearchCursor(RegExp("\\"+I,"g"),h);D.find()&&(R=Lr(u,D.from(),I,O))}}else if(k[I])j=!0,R=Oa(u,h,I,O);else if(I==="W"||I==="w")for(var ee=y.repeat||1;ee-- >0;){var Y=Kn(u,{inclusive:O,innerWord:!O,bigWord:I==="W",noSymbol:I==="W",multiline:!0},R&&R.end);Y&&(R||(R=Y),R.end=Y.end)}else if(I==="p")if(R=Lt(u,h,y.repeat,0,O),y.linewise=!0,v.visualMode)v.visualLine||(v.visualLine=!0);else{var U=v.inputState.operatorArgs;U&&(U.linewise=!0),R.end.line--}else if(I==="t")R=Bt(u,h,O);else if(I==="s"){var K=u.getLine(h.line);h.ch>0&&$(K[h.ch])&&--h.ch;var ye=zs(u,h,y.repeat,1,O),ge=zs(u,h,y.repeat,-1,O);q(u.getLine(ge.line)[ge.ch])&&q(u.getLine(ye.line)[ye.ch-1])&&(ge={line:ge.line,ch:ge.ch+1}),R={start:ge,end:ye}}return R?u.state.vim.visualMode?tp(u,R.start,R.end,j):[R.start,R.end]:null},repeatLastCharacterSearch:function(u,h,y){var v=G.lastCharacterSearch,_=y.repeat,k=y.forward===v.forward,I=(v.increment?1:0)*(k?-1:1);u.moveH(-I,"char"),y.inclusive=!!k;var O=Ir(u,_,k,v.selectedCharacter);return O?(O.ch+=I,O):(u.moveH(I,"char"),h)}};function Xf(u,h){bn[u]=h}function kc(u,h){for(var y=[],v=0;v<h;v++)y.push(u);return y}var Jt={change:function(u,h,y){var v,_,k=u.state.vim,I=y[0].anchor,O=y[0].head;if(k.visualMode)if(h.fullLine)O.ch=Number.MAX_VALUE,O.line--,u.setSelection(I,O),_=u.getSelection(),u.replaceSelection(""),v=I;else{_=u.getSelection();var R=kc("",y.length);u.replaceSelections(R),v=Xt(y[0].head,y[0].anchor)}else{_=u.getRange(I,O);var j=k.lastEditInputState;if((j==null?void 0:j.motion)=="moveByWords"&&!q(_)){var D=/\s+$/.exec(_);D&&j.motionArgs&&j.motionArgs.forward&&(O=Ct(O,0,-D[0].length),_=_.slice(0,-D[0].length))}h.linewise&&(I=new t(I.line,Mn(u.getLine(I.line))),O.line>I.line&&(O=new t(O.line-1,Number.MAX_VALUE))),u.replaceRange("",I,O),v=I}G.registerController.pushText(h.registerName,"change",_,h.linewise,y.length>1),Vr.enterInsertMode(u,{head:v},u.state.vim)},delete:function(u,h,y){var v,_,k=u.state.vim;if(k.visualBlock){_=u.getSelection();var I=kc("",y.length);u.replaceSelections(I),v=Xt(y[0].head,y[0].anchor)}else{var O=y[0].anchor,R=y[0].head;h.linewise&&R.line!=u.firstLine()&&O.line==u.lastLine()&&O.line==R.line-1&&(O.line==u.firstLine()?O.ch=0:O=new t(O.line-1,It(u,O.line-1))),_=u.getRange(O,R),u.replaceRange("",O,R),v=O,h.linewise&&(v=bn.moveToFirstNonWhiteSpaceCharacter(u,O))}return G.registerController.pushText(h.registerName,"delete",_,h.linewise,k.visualBlock),Pt(u,v)},indent:function(u,h,y){var v=u.state.vim,_=v.visualMode&&h.repeat||1;if(v.visualBlock){for(var k=u.getOption("tabSize"),I=u.getOption("indentWithTabs")?" ":" ".repeat(k),O,R=y.length-1;R>=0;R--)if(O=Xt(y[R].anchor,y[R].head),h.indentRight)u.replaceRange(I.repeat(_),O,O);else{for(var j=u.getLine(O.line),D=0,ee=0;ee<_;ee++){var Y=j[O.ch+D];if(Y==" ")D++;else if(Y==" "){D++;for(var U=1;U<I.length&&(Y=j[O.ch+D],Y===" ");U++)D++}else break}u.replaceRange("",O,Ct(O,0,D))}return O}else if(u.indentMore)for(var ee=0;ee<_;ee++)h.indentRight?u.indentMore():u.indentLess();else{var K=y[0].anchor.line,ye=v.visualBlock?y[y.length-1].anchor.line:y[0].head.line;h.linewise&&ye--;for(var R=K;R<=ye;R++)for(var ee=0;ee<_;ee++)u.indentLine(R,h.indentRight)}return bn.moveToFirstNonWhiteSpaceCharacter(u,y[0].anchor)},indentAuto:function(u,h,y){return u.execCommand("indentAuto"),bn.moveToFirstNonWhiteSpaceCharacter(u,y[0].anchor)},hardWrap:function(u,h,y,v){if(u.hardWrap){var _=y[0].anchor.line,k=y[0].head.line;h.linewise&&k--;var I=u.hardWrap({from:_,to:k});return I>_&&h.linewise&&I--,h.keepCursor?v:new t(I,0)}},changeCase:function(u,h,y,v,_){for(var k=u.getSelections(),I=[],O=h.toLower,R=0;R<k.length;R++){var j=k[R],D="";if(O===!0)D=j.toLowerCase();else if(O===!1)D=j.toUpperCase();else for(var ee=0;ee<j.length;ee++){var Y=j.charAt(ee);D+=A(Y)?Y.toLowerCase():Y.toUpperCase()}I.push(D)}return u.replaceSelections(I),h.shouldMoveCursor?_:!u.state.vim.visualMode&&h.linewise&&y[0].anchor.line+1==y[0].head.line?bn.moveToFirstNonWhiteSpaceCharacter(u,v):h.linewise?v:Xt(y[0].anchor,y[0].head)},yank:function(u,h,y,v){var _=u.state.vim,k=u.getSelection(),I=_.visualMode?Xt(_.sel.anchor,_.sel.head,y[0].head,y[0].anchor):v;return G.registerController.pushText(h.registerName,"yank",k,h.linewise,_.visualBlock),I},rot13:function(u,h,y,v,_){for(var k=u.getSelections(),I=[],O=0;O<k.length;O++){let R=k[O].split("").map(j=>{let D=j.charCodeAt(0);return D>=65&&D<=90?String.fromCharCode(65+(D-65+13)%26):D>=97&&D<=122?String.fromCharCode(97+(D-97+13)%26):j}).join("");I.push(R)}return u.replaceSelections(I),h.shouldMoveCursor?_:!u.state.vim.visualMode&&h.linewise&&y[0].anchor.line+1==y[0].head.line?bn.moveToFirstNonWhiteSpaceCharacter(u,v):h.linewise?v:Xt(y[0].anchor,y[0].head)}};function Yf(u,h){Jt[u]=h}var Vr={jumpListWalk:function(u,h,y){if(!y.visualMode){var v=h.repeat||1,_=h.forward,k=G.jumpList.move(u,_?v:-v),I=k?k.find():void 0;I||(I=u.getCursor()),u.setCursor(I)}},scroll:function(u,h,y){if(!y.visualMode){var v=h.repeat||1,_=u.defaultTextHeight(),k=u.getScrollInfo().top,I=_*v,O=h.forward?k+I:k-I,R=Qe(u.getCursor()),j=u.charCoords(R,"local");if(h.forward)O>j.top?(R.line+=(O-j.top)/_,R.line=Math.ceil(R.line),u.setCursor(R),j=u.charCoords(R,"local"),u.scrollTo(null,j.top)):u.scrollTo(null,O);else{var D=O+u.getScrollInfo().clientHeight;D<j.bottom?(R.line-=(j.bottom-D)/_,R.line=Math.floor(R.line),u.setCursor(R),j=u.charCoords(R,"local"),u.scrollTo(null,j.bottom-u.getScrollInfo().clientHeight)):u.scrollTo(null,O)}}},scrollToCursor:function(u,h){var y=u.getCursor().line,v=u.charCoords(new t(y,0),"local"),_=u.getScrollInfo().clientHeight,k=v.top;switch(h.position){case"center":k=v.bottom-_/2;break;case"bottom":var I=new t(y,u.getLine(y).length-1),O=u.charCoords(I,"local").bottom-k;k=k-_+O;break}u.scrollTo(null,k)},replayMacro:function(u,h,y){var v=h.selectedCharacter||"",_=h.repeat||1,k=G.macroModeState;for(v=="@"?v=k.latestRegister||"":k.latestRegister=v;_--;)Ti(u,y,k,v)},enterMacroRecordMode:function(u,h){var y=G.macroModeState,v=h.selectedCharacter;G.registerController.isValidRegister(v)&&y.enterMacroRecordMode(u,v)},toggleOverwrite:function(u){u.state.overwrite?(u.toggleOverwrite(!1),u.setOption("keyMap","vim-insert"),e.signal(u,"vim-mode-change",{mode:"insert"})):(u.toggleOverwrite(!0),u.setOption("keyMap","vim-replace"),e.signal(u,"vim-mode-change",{mode:"replace"}))},enterInsertMode:function(u,h,y){if(!u.getOption("readOnly")){y.insertMode=!0,y.insertModeRepeat=h&&h.repeat||1;var v=h?h.insertAt:null,_=y.sel,k=h.head||u.getCursor("head"),I=u.listSelections().length;if(v=="eol")k=new t(k.line,It(u,k.line));else if(v=="bol")k=new t(k.line,0);else if(v=="charAfter"){var O=a(u,k,Ct(k,0,1));k=O.end}else if(v=="firstNonBlank"){var O=a(u,k,bn.moveToFirstNonWhiteSpaceCharacter(u,k));k=O.end}else if(v=="startOfSelectedArea"){if(!y.visualMode)return;y.visualBlock?(k=new t(Math.min(_.head.line,_.anchor.line),Math.min(_.head.ch,_.anchor.ch)),I=Math.abs(_.head.line-_.anchor.line)+1):k=_.head.line<_.anchor.line?_.head:new t(_.anchor.line,0)}else if(v=="endOfSelectedArea"){if(!y.visualMode)return;y.visualBlock?(k=new t(Math.min(_.head.line,_.anchor.line),Math.max(_.head.ch,_.anchor.ch)+1),I=Math.abs(_.head.line-_.anchor.line)+1):k=_.head.line>=_.anchor.line?Ct(_.head,0,1):new t(_.anchor.line,0)}else if(v=="inplace"){if(y.visualMode)return}else v=="lastEdit"&&(k=Dc(u)||k);u.setOption("disableInput",!1),h&&h.replace?(u.toggleOverwrite(!0),u.setOption("keyMap","vim-replace"),e.signal(u,"vim-mode-change",{mode:"replace"})):(u.toggleOverwrite(!1),u.setOption("keyMap","vim-insert"),e.signal(u,"vim-mode-change",{mode:"insert"})),G.macroModeState.isPlaying||(u.on("change",gr),y.insertEnd&&y.insertEnd.clear(),y.insertEnd=u.setBookmark(k,{insertLeft:!0}),e.on(u.getInputField(),"keydown",$s)),y.visualMode&&Rn(u),Sc(u,k,I)}},toggleVisualMode:function(u,h,y){var v=h.repeat,_=u.getCursor(),k;if(y.visualMode)y.visualLine!=!!h.linewise||y.visualBlock!=!!h.blockwise?(y.visualLine=!!h.linewise,y.visualBlock=!!h.blockwise,e.signal(u,"vim-mode-change",{mode:"visual",subMode:y.visualLine?"linewise":y.visualBlock?"blockwise":""}),$r(u)):Rn(u);else{y.visualMode=!0,y.visualLine=!!h.linewise,y.visualBlock=!!h.blockwise,k=Pt(u,new t(_.line,_.ch+v-1));var I=a(u,_,k);y.sel={anchor:I.start,head:I.end},e.signal(u,"vim-mode-change",{mode:"visual",subMode:y.visualLine?"linewise":y.visualBlock?"blockwise":""}),$r(u),fn(u,y,"<",Xt(_,k)),fn(u,y,">",Tr(_,k))}},reselectLastSelection:function(u,h,y){var v=y.lastSelection;if(y.visualMode&&xi(u,y),v){var _=v.anchorMark.find(),k=v.headMark.find();if(!_||!k)return;y.sel={anchor:_,head:k},y.visualMode=!0,y.visualLine=v.visualLine,y.visualBlock=v.visualBlock,$r(u),fn(u,y,"<",Xt(_,k)),fn(u,y,">",Tr(_,k)),e.signal(u,"vim-mode-change",{mode:"visual",subMode:y.visualLine?"linewise":y.visualBlock?"blockwise":""})}},joinLines:function(u,h,y){var v,_;if(y.visualMode){if(v=u.getCursor("anchor"),_=u.getCursor("head"),_t(_,v)){var k=_;_=v,v=k}_.ch=It(u,_.line)-1}else{var I=Math.max(h.repeat,2);v=u.getCursor(),_=Pt(u,new t(v.line+I-1,1/0))}for(var O=0,R=v.line;R<_.line;R++){O=It(u,v.line);var j="",D=0;if(!h.keepSpaces){var ee=u.getLine(v.line+1);D=ee.search(/\S/),D==-1?D=ee.length:j=" "}u.replaceRange(j,new t(v.line,O),new t(v.line+1,D))}var Y=Pt(u,new t(v.line,O));y.visualMode&&Rn(u,!1),u.setCursor(Y)},newLineAndEnterInsertMode:function(u,h,y){y.insertMode=!0;var v=Qe(u.getCursor());v.line===u.firstLine()&&!h.after?(u.replaceRange(`
65
- `,new t(u.firstLine(),0)),u.setCursor(u.firstLine(),0)):(v.line=h.after?v.line:v.line-1,v.ch=It(u,v.line),u.setCursor(v),(e.commands.newlineAndIndentContinueComment||e.commands.newlineAndIndent)(u)),this.enterInsertMode(u,{repeat:h.repeat},y)},paste:function(u,h,y){var v=G.registerController.getRegister(h.registerName);if(h.registerName==="+")navigator.clipboard.readText().then(k=>{this.continuePaste(u,h,y,k,v)});else{var _=v.toString();this.continuePaste(u,h,y,_,v)}},continuePaste:function(u,h,y,v,_){var k=Qe(u.getCursor());if(v){if(h.matchIndent){var I=u.getOption("tabSize"),O=function(xt){var Nt=xt.split(" ").length-1,Vt=xt.split(" ").length-1;return Nt*I+Vt*1},R=O(u.getLine(u.getCursor().line).match(/^\s*/)[0]),j=v.replace(/\n$/,""),D=v!==j,ee=O(v.match(/^\s*/)[0]),v=j.replace(/^\s*/gm,function(xt){var Nt=R+(O(xt)-ee);if(Nt<0)return"";if(u.getOption("indentWithTabs")){var Vt=Math.floor(Nt/I);return Array(Vt+1).join(" ")}else return Array(Nt+1).join(" ")});v+=D?`
66
- `:""}h.repeat>1&&(v=Array(h.repeat+1).join(v));var Y=_.linewise,U=_.blockwise,K=U?v.split(`
67
- `):void 0;if(K){Y&&K.pop();for(var ye=0;ye<K.length;ye++)K[ye]=K[ye]==""?" ":K[ye];k.ch+=h.after?1:0,k.ch=Math.min(It(u,k.line),k.ch)}else Y?y.visualMode?v=y.visualLine?v.slice(0,-1):`
68
- `+v.slice(0,v.length-1)+`
69
- `:h.after?(v=`
70
- `+v.slice(0,v.length-1),k.ch=It(u,k.line)):k.ch=0:k.ch+=h.after?1:0;var ge;if(y.visualMode){y.lastPastedText=v;var Me,ke=Ps(u),Ae=ke[0],Ye=ke[1],Be=u.getSelection(),dt=u.listSelections(),yt=Array(dt.length).join("1").split("1");y.lastSelection&&(Me=y.lastSelection.headMark.find()),G.registerController.unnamedRegister.setText(Be),U?(u.replaceSelections(yt),Ye=new t(Ae.line+v.length-1,Ae.ch),u.setCursor(Ae),Ea(u,Ye),u.replaceSelections(v),ge=Ae):y.visualBlock?(u.replaceSelections(yt),u.setCursor(Ae),u.replaceRange(v,Ae,Ae),ge=Ae):(u.replaceRange(v,Ae,Ye),ge=u.posFromIndex(u.indexFromPos(Ae)+v.length-1)),Me&&(y.lastSelection.headMark=u.setBookmark(Me)),Y&&(ge.ch=0)}else if(U&&K){u.setCursor(k);for(var ye=0;ye<K.length;ye++){var je=k.line+ye;je>u.lastLine()&&u.replaceRange(`
71
- `,new t(je,0)),It(u,je)<k.ch&&Eo(u,je,k.ch)}u.setCursor(k),Ea(u,new t(k.line+K.length-1,k.ch)),u.replaceSelections(K),ge=k}else if(u.replaceRange(v,k),Y){var je=h.after?k.line+1:k.line;ge=new t(je,Mn(u.getLine(je)))}else ge=Qe(k),/\n/.test(v)||(ge.ch+=v.length-(h.after?1:0));y.visualMode&&Rn(u,!1),u.setCursor(ge)}},undo:function(u,h){u.operation(function(){ln(u,e.commands.undo,h.repeat)(),u.setCursor(Pt(u,u.getCursor("start")))})},redo:function(u,h){ln(u,e.commands.redo,h.repeat)()},setRegister:function(u,h,y){y.inputState.registerName=h.selectedCharacter},insertRegister:function(u,h,y){var v=h.selectedCharacter,_=G.registerController.getRegister(v),k=_&&_.toString();k&&u.replaceSelection(k)},oneNormalCommand:function(u,h,y){hn(u,!0),y.insertModeReturn=!0,e.on(u,"vim-command-done",function v(){y.visualMode||(y.insertModeReturn&&(y.insertModeReturn=!1,y.insertMode||Vr.enterInsertMode(u,{},y)),e.off(u,"vim-command-done",v))})},setMark:function(u,h,y){var v=h.selectedCharacter;v&&fn(u,y,v,u.getCursor())},replace:function(u,h,y){var v=h.selectedCharacter||"",_=u.getCursor(),k,I,O=u.listSelections();if(y.visualMode)_=u.getCursor("start"),I=u.getCursor("end");else{var R=u.getLine(_.line);k=_.ch+h.repeat,k>R.length&&(k=R.length),I=new t(_.line,k)}var j=a(u,_,I);if(_=j.start,I=j.end,v==`
72
- `)y.visualMode||u.replaceRange("",_,I),(e.commands.newlineAndIndentContinueComment||e.commands.newlineAndIndent)(u);else{var D=u.getRange(_,I);if(D=D.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,v),D=D.replace(/[^\n]/g,v),y.visualBlock){var ee=Array(u.getOption("tabSize")+1).join(" ");D=u.getSelection(),D=D.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,v);var Y=D.replace(/\t/g,ee).replace(/[^\n]/g,v).split(`
73
- `);u.replaceSelections(Y)}else u.replaceRange(D,_,I);y.visualMode?(_=_t(O[0].anchor,O[0].head)?O[0].anchor:O[0].head,u.setCursor(_),Rn(u,!1)):u.setCursor(Ct(I,0,-1))}},incrementNumberToken:function(u,h){for(var y=u.getCursor(),v=u.getLine(y.line),_=/(-?)(?:(0x)([\da-f]+)|(0b|0|)(\d+))/gi,k,I,O,R;(k=_.exec(v))!==null&&(I=k.index,O=I+k[0].length,!(y.ch<O)););if(!(!h.backtrack&&O<=y.ch)){if(k){var j=k[2]||k[4],D=k[3]||k[5],ee=h.increase?1:-1,Y={"0b":2,0:8,"":10,"0x":16}[j.toLowerCase()];R=(parseInt(k[1]+D,Y)+ee*h.repeat).toString(Y);var U=j?Array(D.length-R.length+1+k[1].length).join("0"):"";R=R.charAt(0)==="-"?"-"+j+U+R.substr(1):j+U+R;var K=new t(y.line,I),ye=new t(y.line,O);u.replaceRange(R,K,ye)}else return;u.setCursor(new t(y.line,I+R.length-1))}},repeatLastEdit:function(u,h,y){var v=y.lastEditInputState;if(v){var _=h.repeat;_&&h.repeatIsExplicit?v.repeatOverride=_:_=v.repeatOverride||_,Oi(u,y,_,!1)}},indent:function(u,h){u.indentLine(u.getCursor().line,h.indentRight)},exitInsertMode:function(u,h){hn(u)}};function Cc(u,h){Vr[u]=h}function Pt(u,h,y){var v=u.state.vim,_=v.insertMode||v.visualMode,k=Math.min(Math.max(u.firstLine(),h.line),u.lastLine()),I=u.getLine(k),O=I.length-1+ +!!_,R=Math.min(Math.max(0,h.ch),O),j=I.charCodeAt(R);if(56320<=j&&j<=57343){var D=1;y&&y.line==k&&y.ch>R&&(D=-1),R+=D,R>O&&(R-=2)}return new t(k,R)}function So(u){var h={};for(var y in u)Object.prototype.hasOwnProperty.call(u,y)&&(h[y]=u[y]);return h}function Ct(u,h,y){return typeof h=="object"&&(y=h.ch,h=h.line),new t(u.line+h,u.ch+y)}function Zf(u,h,y,v){v.operator&&(y="operatorPending");for(var _,k=[],I=[],O=Le?h.length-c:0;O<h.length;O++){var R=h[O];y=="insert"&&R.context!="insert"||R.context&&R.context!=y||v.operator&&R.type=="action"||!(_=ep(u,R.keys))||(_=="partial"&&k.push(R),_=="full"&&I.push(R))}return{partial:k,full:I}}function ep(u,h){let y=h.slice(-11)=="<character>",v=h.slice(-10)=="<register>";if(y||v){var _=h.length-(y?11:10),k=u.slice(0,_),I=h.slice(0,_);return k==I&&u.length>_?"full":I.indexOf(k)==0?"partial":!1}else return u==h?"full":h.indexOf(u)==0?"partial":!1}function wi(u){var h=/^.*(<[^>]+>)$/.exec(u),y=h?h[1]:u.slice(-1);if(y.length>1)switch(y){case"<CR>":case"<S-CR>":y=`
74
- `;break;case"<Space>":case"<S-Space>":y=" ";break;default:y="";break}return y}function ln(u,h,y){return function(){for(var v=0;v<y;v++)h(u)}}function Qe(u){return new t(u.line,u.ch)}function gt(u,h){return u.ch==h.ch&&u.line==h.line}function _t(u,h){return u.line<h.line||u.line==h.line&&u.ch<h.ch}function Xt(u,h){return arguments.length>2&&(h=Xt.apply(void 0,Array.prototype.slice.call(arguments,1))),_t(u,h)?u:h}function Tr(u,h){return arguments.length>2&&(h=Tr.apply(void 0,Array.prototype.slice.call(arguments,1))),_t(u,h)?h:u}function _i(u,h,y){var v=_t(u,h),_=_t(h,y);return v&&_}function It(u,h){return u.getLine(h).length}function Sa(u){return u.trim?u.trim():u.replace(/^\s+|\s+$/g,"")}function Hr(u){return u.replace(/([.?*+$\[\]\/\\(){}|\-])/g,"\\$1")}function Eo(u,h,y){var v=It(u,h),_=Array(y-v+1).join(" ");u.setCursor(new t(h,v)),u.replaceRange(_,u.getCursor())}function Ea(u,h){var y=[],v=u.listSelections(),_=Qe(u.clipPos(h)),k=!gt(h,_),I=Ec(v,u.getCursor("head")),O=gt(v[I].head,v[I].anchor),R=v.length-1,j=R-I>I?R:0,D=v[j].anchor,ee=Math.min(D.line,_.line),Y=Math.max(D.line,_.line),U=D.ch,K=_.ch,ye=v[j].head.ch-U,ge=K-U;ye>0&&ge<=0?(U++,k||K--):ye<0&&ge>=0?(U--,O||K++):ye<0&&ge==-1&&(U--,K++);for(var Me=ee;Me<=Y;Me++){var ke={anchor:new t(Me,U),head:new t(Me,K)};y.push(ke)}return u.setSelections(y),h.ch=K,D.ch=U,D}function Sc(u,h,y){for(var v=[],_=0;_<y;_++){var k=Ct(h,_,0);v.push({anchor:k,head:k})}u.setSelections(v,0)}function Ec(u,h,y){for(var v=0;v<u.length;v++){var _=gt(u[v].anchor,h),k=gt(u[v].head,h);if(_||k)return v}return-1}function Ps(u,h){var y=u.listSelections(),v=y[0],_=y[y.length-1];return[_t(v.anchor,v.head)?v.anchor:v.head,_t(_.anchor,_.head)?_.head:_.anchor]}function xi(u,h){var y=h.sel.anchor,v=h.sel.head;h.lastPastedText&&(h.lastPastedText=(v=u.posFromIndex(u.indexFromPos(y)+h.lastPastedText.length),void 0)),h.lastSelection={anchorMark:u.setBookmark(y),headMark:u.setBookmark(v),anchor:Qe(y),head:Qe(v),visualMode:h.visualMode,visualLine:h.visualLine,visualBlock:h.visualBlock}}function tp(u,h,y,v){var _=u.state.vim.sel,k=v?h:_.head,I=v?h:_.anchor,O;return _t(y,h)&&(O=y,y=h,h=O),_t(k,I)?(k=Xt(h,k),I=Tr(I,y)):(I=Xt(h,I),k=Tr(k,y),k=Ct(k,0,-1),k.ch==-1&&k.line!=u.firstLine()&&(k=new t(k.line-1,It(u,k.line-1)))),[I,k]}function $r(u,h,y){var v=u.state.vim;h||(h=v.sel),y||(y=v.visualLine?"line":v.visualBlock?"block":"char");var _=To(u,h,y);u.setSelections(_.ranges,_.primary)}function To(u,h,y,v){var _=Qe(h.head),k=Qe(h.anchor);if(y=="char"){var I=!v&&!_t(h.head,h.anchor)?1:0,O=_t(h.head,h.anchor)?1:0;return _=Ct(h.head,0,I),k=Ct(h.anchor,0,O),{ranges:[{anchor:k,head:_}],primary:0}}else if(y=="line"){if(_t(h.head,h.anchor))_.ch=0,k.ch=It(u,k.line);else{k.ch=0;var R=u.lastLine();_.line>R&&(_.line=R),_.ch=It(u,_.line)}return{ranges:[{anchor:k,head:_}],primary:0}}else if(y=="block"){var j=Math.min(k.line,_.line),D=k.ch,ee=Math.max(k.line,_.line),Y=_.ch;D<Y?Y+=1:D+=1;for(var U=ee-j+1,K=_.line==j?0:U-1,ye=[],ge=0;ge<U;ge++)ye.push({anchor:new t(j+ge,D),head:new t(j+ge,Y)});return{ranges:ye,primary:K}}throw"never happens"}function Tc(u){var h=u.getCursor("head");return u.getSelection().length==1&&(h=Xt(h,u.getCursor("anchor"))),h}function Rn(u,h){var y=u.state.vim;h!==!1&&u.setCursor(Pt(u,y.sel.head)),xi(u,y),y.visualMode=!1,y.visualLine=!1,y.visualBlock=!1,y.insertMode||e.signal(u,"vim-mode-change",{mode:"normal"})}function Ns(u,h,y){var v=u.getRange(h,y);if(/\n\s*$/.test(v)){var _=v.split(`
75
- `);_.pop();for(var k=_.pop();_.length>0&&k&&q(k);k=_.pop())y.line--,y.ch=0;k?(y.line--,y.ch=It(u,y.line)):y.ch=0}}function Ic(u,h,y){h.ch=0,y.ch=0,y.line++}function Mn(u){if(!u)return 0;var h=u.search(/\S/);return h==-1?u.length:h}function Kn(u,{inclusive:h,innerWord:y,bigWord:v,noSymbol:_,multiline:k},I){var O=I||Tc(u),R=u.getLine(O.line),j=R,D=O.line,ee=D,Y=O.ch,U,K=_?S[0]:E[0];if(y&&/\s/.test(R.charAt(Y)))K=function(Ye){return/\s/.test(Ye)};else{for(;!K(R.charAt(Y));)if(Y++,Y>=R.length){if(!k)return null;Y--,U=js(u,O,!0,v,!0);break}v?K=E[0]:(K=S[0],K(R.charAt(Y))||(K=S[1]))}for(var ye=Y,ge=Y;K(R.charAt(ge))&&ge>=0;)ge--;if(ge++,U)ye=U.to,ee=U.line,j=u.getLine(ee),!j&&ye==0&&ye++;else for(;K(R.charAt(ye))&&ye<R.length;)ye++;if(h){var Me=ye,ke=O.ch<=ge&&/\s/.test(R.charAt(O.ch));if(!ke)for(;/\s/.test(j.charAt(ye))&&ye<j.length;)ye++;if(Me==ye||ke){for(var Ae=ge;/\s/.test(R.charAt(ge-1))&&ge>0;)ge--;!ge&&!ke&&(ge=Ae)}}return{start:new t(D,ge),end:new t(ee,ye)}}function Bt(u,h,y){var v=h;if(!e.findMatchingTag||!e.findEnclosingTag)return{start:v,end:v};var _=e.findMatchingTag(u,h)||e.findEnclosingTag(u,h);return!_||!_.open||!_.close?{start:v,end:v}:y?{start:_.open.from,end:_.close.to}:{start:_.open.to,end:_.close.from}}function Yt(u,h,y){gt(h,y)||G.jumpList.add(u,h,y)}function Ta(u,h){G.lastCharacterSearch.increment=u,G.lastCharacterSearch.forward=h.forward,G.lastCharacterSearch.selectedCharacter=h.selectedCharacter}var Ds={"(":"bracket",")":"bracket","{":"bracket","}":"bracket","[":"section","]":"section","*":"comment","/":"comment",m:"method",M:"method","#":"preprocess"},Lc={bracket:{isComplete:function(u){if(u.nextCh===u.symb){if(u.depth++,u.depth>=1)return!0}else u.nextCh===u.reverseSymb&&u.depth--;return!1}},section:{init:function(u){u.curMoveThrough=!0,u.symb=(u.forward?"]":"[")===u.symb?"{":"}"},isComplete:function(u){return u.index===0&&u.nextCh===u.symb}},comment:{isComplete:function(u){var h=u.lastCh==="*"&&u.nextCh==="/";return u.lastCh=u.nextCh,h}},method:{init:function(u){u.symb=u.symb==="m"?"{":"}",u.reverseSymb=u.symb==="{"?"}":"{"},isComplete:function(u){return u.nextCh===u.symb}},preprocess:{init:function(u){u.index=0},isComplete:function(u){var y;if(u.nextCh==="#"){var h=(y=u.lineText.match(/^#(\w+)/))==null?void 0:y[1];if(h==="endif"){if(u.forward&&u.depth===0)return!0;u.depth++}else if(h==="if"){if(!u.forward&&u.depth===0)return!0;u.depth--}if(h==="else"&&u.depth===0)return!0}return!1}}};function np(u,h,y,v){var _=Qe(u.getCursor()),k=y?1:-1,I=y?u.lineCount():-1,O=_.ch,R=_.line,j=u.getLine(R),D={lineText:j,nextCh:j.charAt(O),lastCh:null,index:O,symb:v,reverseSymb:(y?{")":"(","}":"{"}:{"(":")","{":"}"})[v],forward:y,depth:0,curMoveThrough:!1},ee=Ds[v];if(!ee)return _;var Y=Lc[ee].init,U=Lc[ee].isComplete;for(Y&&Y(D);R!==I&&h;){if(D.index+=k,D.nextCh=D.lineText.charAt(D.index),!D.nextCh){if(R+=k,D.lineText=u.getLine(R)||"",k>0)D.index=0;else{var K=D.lineText.length;D.index=K>0?K-1:0}D.nextCh=D.lineText.charAt(D.index)}U(D)&&(_.line=R,_.ch=D.index,h--)}return D.nextCh||D.curMoveThrough?new t(R,D.index):_}function js(u,h,y,v,_){var k=h.line,I=h.ch,O=u.getLine(k),R=y?1:-1,j=v?E:S;if(_&&O==""){if(k+=R,O=u.getLine(k),!V(u,k))return null;I=y?0:O.length}for(;;){if(_&&O=="")return{from:0,to:0,line:k};for(var D=R>0?O.length:-1,ee=D,Y=D;I!=D;){for(var U=!1,K=0;K<j.length&&!U;++K)if(j[K](O.charAt(I))){for(ee=I;I!=D&&j[K](O.charAt(I));)I+=R;if(Y=I,U=ee!=Y,ee==h.ch&&k==h.line&&Y==ee+R)continue;return{from:Math.min(ee,Y+1),to:Math.max(ee,Y),line:k}}U||(I+=R)}if(k+=R,!V(u,k))return null;O=u.getLine(k),I=R>0?0:O.length}}function ki(u,h,y,v,_,k){var I=Qe(h),O=[];(v&&!_||!v&&_)&&y++;for(var R=!(v&&_),j=0;j<y;j++){var D=js(u,h,v,k,R);if(!D){var ee=It(u,u.lastLine());O.push(v?{line:u.lastLine(),from:ee,to:ee}:{line:0,from:0,to:0});break}O.push(D),h=new t(D.line,v?D.to-1:D.from)}var Y=O.length!=y,U=O[0],K=O.pop();return v&&!_?(!Y&&(U.from!=I.ch||U.line!=I.line)&&(K=O.pop()),K&&new t(K.line,K.from)):v&&_?K&&new t(K.line,K.to-1):!v&&_?(!Y&&(U.to!=I.ch||U.line!=I.line)&&(K=O.pop()),K&&new t(K.line,K.to)):K&&new t(K.line,K.from)}function Io(u,h,y,v,_){var k=new t(h.line+y.repeat-1,1/0),I=u.clipPos(k);return I.ch--,_||(v.lastHPos=1/0,v.lastHSPos=u.charCoords(I,"div").left),k}function Ir(u,h,y,v,_){if(v){for(var k=_||u.getCursor(),I=k.ch,O,R=0;R<h;R++){var j=u.getLine(k.line);if(O=La(I,j,v,y),O==-1)return;I=O}if(O!=null)return new t(u.getCursor().line,O)}}function Ia(u,h){var y=u.getCursor().line;return Pt(u,new t(y,h-1))}function fn(u,h,y,v){!ie(y,T)&&!z.test(y)||(h.marks[y]&&h.marks[y].clear(),h.marks[y]=u.setBookmark(v))}function La(u,h,y,v,_){return v?h.indexOf(y,u+1):h.lastIndexOf(y,u-1)}function Lt(u,h,y,v,_){var k=h.line,I=u.firstLine(),O=u.lastLine(),R,j,D=k;function ee(ge){return!u.getLine(ge)}function Y(ge,Me,ke){return ke?ee(ge)!=ee(ge+Me):!ee(ge)&&ee(ge+Me)}if(v){for(;I<=D&&D<=O&&y>0;)Y(D,v)&&y--,D+=v;return{start:new t(D,0),end:h}}var U=u.state.vim;if(U.visualLine&&Y(k,1,!0)){var K=U.sel.anchor;Y(K.line,-1,!0)&&(!_||K.line!=k)&&(k+=1)}var ye=ee(k);for(D=k;D<=O&&y;D++)Y(D,1,!0)&&(!_||ee(D)!=ye)&&y--;for(j=new t(D,0),D>O&&!ye?ye=!0:_=!1,D=k;D>I&&!((!_||ee(D)==ye||D==k)&&Y(D,-1,!0));D--);return R=new t(D,0),{start:R,end:j}}function zs(u,h,y,v,_){function k(j){j.line!==null&&(j.pos+j.dir<0||j.pos+j.dir>=j.line.length?j.line=null:j.pos+=j.dir)}function I(j,D,ee,Y){var U={line:j.getLine(D),ln:D,pos:ee,dir:Y};if(U.line==="")return{ln:U.ln,pos:U.pos};var K=U.pos;for(k(U);U.line!==null;){if(K=U.pos,$(U.line[U.pos]))if(_){for(k(U);U.line!==null&&q(U.line[U.pos]);)K=U.pos,k(U);return{ln:U.ln,pos:K+1}}else return{ln:U.ln,pos:U.pos+1};k(U)}return{ln:U.ln,pos:K+1}}function O(j,D,ee,Y){var U=j.getLine(D),K={line:U,ln:D,pos:ee,dir:Y};if(K.line==="")return{ln:K.ln,pos:K.pos};var ye=K.pos;for(k(K);K.line!==null;){if(!q(K.line[K.pos])&&!$(K.line[K.pos]))ye=K.pos;else if($(K.line[K.pos]))return _&&q(K.line[K.pos+1])?{ln:K.ln,pos:K.pos+1}:{ln:K.ln,pos:ye};k(K)}return K.line=U,_&&q(K.line[K.pos])?{ln:K.ln,pos:K.pos}:{ln:K.ln,pos:ye}}for(var R={ln:h.line,pos:h.ch};y>0;)R=v<0?O(u,R.ln,R.pos,v):I(u,R.ln,R.pos,v),y--;return new t(R.ln,R.pos)}function Oc(u,h,y,v){function _(R,j){if(j.line!==null)if(j.pos+j.dir<0||j.pos+j.dir>=j.line.length){if(j.ln+=j.dir,!V(R,j.ln)){j.line=null;return}j.line=R.getLine(j.ln),j.pos=j.dir>0?0:j.line.length-1}else j.pos+=j.dir}function k(R,j,D,ee){var ge=R.getLine(j),Y=ge==="",U={line:ge,ln:j,pos:D,dir:ee},K={ln:U.ln,pos:U.pos},ye=U.line==="";for(_(R,U);U.line!==null;){if(K.ln=U.ln,K.pos=U.pos,U.line===""&&!ye||Y&&U.line!==""&&!q(U.line[U.pos]))return{ln:U.ln,pos:U.pos};$(U.line[U.pos])&&!Y&&(U.pos===U.line.length-1||q(U.line[U.pos+1]))&&(Y=!0),_(R,U)}var ge=R.getLine(K.ln);K.pos=0;for(var Me=ge.length-1;Me>=0;--Me)if(!q(ge[Me])){K.pos=Me;break}return K}function I(R,j,D,ee){var ge=R.getLine(j),Y={line:ge,ln:j,pos:D,dir:ee},U=Y.ln,K=null,ye=Y.line==="";for(_(R,Y);Y.line!==null;){if(Y.line===""&&!ye)return K===null?{ln:Y.ln,pos:Y.pos}:{ln:U,pos:K};if($(Y.line[Y.pos])&&K!==null&&!(Y.ln===U&&Y.pos+1===K))return{ln:U,pos:K};Y.line!==""&&!q(Y.line[Y.pos])&&(ye=!1,U=Y.ln,K=Y.pos),_(R,Y)}var ge=R.getLine(U);K=0;for(var Me=0;Me<ge.length;++Me)if(!q(ge[Me])){K=Me;break}return{ln:U,pos:K}}for(var O={ln:h.line,pos:h.ch};y>0;)O=v<0?I(u,O.ln,O.pos,v):k(u,O.ln,O.pos,v),y--;return new t(O.ln,O.pos)}function Lr(u,h,y,v){var _=h,k={"(":/[()]/,")":/[()]/,"[":/[[\]]/,"]":/[[\]]/,"{":/[{}]/,"}":/[{}]/,"<":/[<>]/,">":/[<>]/}[y],I={"(":"(",")":"(","[":"[","]":"[","{":"{","}":"{","<":"<",">":"<"}[y],O=u.getLine(_.line).charAt(_.ch)===I?1:0,R=u.scanForBracket(new t(_.line,_.ch+O),-1,void 0,{bracketRegex:k}),j=u.scanForBracket(new t(_.line,_.ch+O),1,void 0,{bracketRegex:k});if(!R||!j)return null;var D=R.pos,ee=j.pos;if(D.line==ee.line&&D.ch>ee.ch||D.line>ee.line){var Y=D;D=ee,ee=Y}return v?ee.ch+=1:D.ch+=1,{start:D,end:ee}}function Oa(u,h,y,v){var _=Qe(h),k=u.getLine(_.line).split(""),I,O,R,j,D=k.indexOf(y);if(_.ch<D)_.ch=D;else if(D<_.ch&&k[_.ch]==y){var ee=/string/.test(u.getTokenTypeAt(Ct(h,0,1))),Y=/string/.test(u.getTokenTypeAt(h));ee&&!Y||(O=_.ch,--_.ch)}if(k[_.ch]==y&&!O)I=_.ch+1;else for(R=_.ch;R>-1&&!I;R--)k[R]==y&&(I=R+1);if(I&&!O)for(R=I,j=k.length;R<j&&!O;R++)k[R]==y&&(O=R);return!I||!O?{start:_,end:_}:(v&&(--I,++O),{start:new t(_.line,I),end:new t(_.line,O)})}me("pcre",!0,"boolean");class rp{constructor(){this.highlightTimeout}getQuery(){return G.query}setQuery(h){G.query=h}getOverlay(){return this.searchOverlay}setOverlay(h){this.searchOverlay=h}isReversed(){return G.isReversed}setReversed(h){G.isReversed=h}getScrollbarAnnotate(){return this.annotate}setScrollbarAnnotate(h){this.annotate=h}}function wn(u){var h=u.state.vim;return h.searchState_||(h.searchState_=new rp)}function Ac(u){return Ci(u,"/")}function ap(u){return Si(u,"/")}function Ci(u,h){var y=Si(u,h)||[];if(!y.length)return[];var v=[];if(y[0]===0){for(var _=0;_<y.length;_++)typeof y[_]=="number"&&v.push(u.substring(y[_]+1,y[_+1]));return v}}function Si(u,h){h||(h="/");for(var y=!1,v=[],_=0;_<u.length;_++){var k=u.charAt(_);!y&&k==h&&v.push(_),y=!y&&k=="\\"}return v}function hr(u){var h={V:"|(){+?*.[$^",M:"|(){+?*.[",m:"|(){+?",v:"<>"},y={">":"(?<=[\\w])(?=[^\\w]|$)","<":"(?<=[^\\w]|^)(?=[\\w])"},v=h.m,_=u.replace(/\\.|[\[|(){+*?.$^<>]/g,function(I){if(I[0]==="\\"){var O=I[1];return O==="}"||v.indexOf(O)!=-1?O:O in h?(v=h[O],""):O in y?y[O]:I}else return v.indexOf(I)==-1?I:y[I]||"\\"+I}),k=_.indexOf("\\zs");return k!=-1&&(_="(?<="+_.slice(0,k)+")"+_.slice(k+3)),k=_.indexOf("\\ze"),k!=-1&&(_=_.slice(0,k)+"(?="+_.slice(k+3)+")"),_}var pn={"\\n":`
76
- `,"\\r":"\r","\\t":" "};function Rc(u){for(var h=!1,y=[],v=-1;v<u.length;v++){var _=u.charAt(v)||"",k=u.charAt(v+1)||"";pn[_+k]?(y.push(pn[_+k]),v++):h?(y.push(_),h=!1):_==="\\"?(h=!0,ce(k)||k==="$"?y.push("$"):k!=="/"&&k!=="\\"&&y.push("\\")):(_==="$"&&y.push("$"),y.push(_),k==="/"&&y.push("\\"))}return y.join("")}var Mc={"\\/":"/","\\\\":"\\","\\n":`
77
- `,"\\r":"\r","\\t":" ","\\&":"&"};function qs(u){for(var h=new e.StringStream(u),y=[];!h.eol();){for(;h.peek()&&h.peek()!="\\";)y.push(h.next());var v=!1;for(var _ in Mc)if(h.match(_,!0)){v=!0,y.push(Mc[_]);break}v||y.push(h.next())}return y.join("")}function Fs(u,h,y){G.registerController.getRegister("/").setText(u);var v=ap(u),_,k;return v.length?(_=u.substring(0,v[0]),k=u.substring(v[0]).indexOf("i")!=-1):_=u,_?(ae("pcre")||(_=hr(_)),y&&(h=/^[^A-Z]*$/.test(_)),new RegExp(_,h||k?"im":"m")):null}function cn(u){typeof u=="string"&&(u=document.createElement(u));for(var h=1;h<arguments.length;h++){var y=arguments[h];if(y)if(typeof y!="object"&&(y=document.createTextNode(y)),y.nodeType)u.appendChild(y);else for(var v in y)Object.prototype.hasOwnProperty.call(y,v)&&(v[0]==="$"?u.style[v.slice(1)]=y[v]:typeof y[v]=="function"?u[v]=y[v]:u.setAttribute(v,y[v]))}return u}function Je(u,h,y){var v=cn("div",{$color:"red",$whiteSpace:"pre",class:"cm-vim-message"},h);u.openNotification?y?(v=cn("div",{},v,cn("div",{},"Press ENTER or type command to continue")),u.state.closeVimNotification&&u.state.closeVimNotification(),u.state.closeVimNotification=u.openNotification(v,{bottom:!0,duration:0})):u.openNotification(v,{bottom:!0,duration:15e3}):alert(v.innerText)}function Pn(u,h){return cn("div",{$display:"flex",$flex:1},cn("span",{$fontFamily:"monospace",$whiteSpace:"pre",$flex:1,$display:"flex"},u,cn("input",{type:"text",autocorrect:"off",autocapitalize:"off",spellcheck:"false",$flex:1})),h&&cn("span",{$color:"#888"},h))}function Aa(u,h){var _;if(Ne.length){h.value||(h.value=""),De=h;return}var y=Pn(h.prefix,h.desc);if(u.openDialog)u.openDialog(y,h.onClose,{onKeyDown:h.onKeyDown,onKeyUp:h.onKeyUp,bottom:!0,selectValueOnOpen:!1,value:h.value});else{var v="";typeof h.prefix!="string"&&h.prefix&&(v+=h.prefix.textContent),h.desc&&(v+=" "+h.desc),(_=h.onClose)==null||_.call(h,prompt(v,""))}}function Pc(u,h){return u instanceof RegExp&&h instanceof RegExp?u.flags==h.flags&&u.source==h.source:!1}function Wr(u,h,y,v){if(h){var _=wn(u),k=Fs(h,!!y,!!v);if(k)return Lo(u,k),Pc(k,_.getQuery())||_.setQuery(k),k}}function Ra(u){if(u.source.charAt(0)=="^")var h=!0;return{token:function(y){if(h&&!y.sol()){y.skipToEnd();return}var v=y.match(u,!1);if(v)return v[0].length==0?(y.next(),"searching"):!y.sol()&&(y.backUp(1),!u.exec(y.next()+v[0]))?(y.next(),null):(y.match(u),"searching");for(;!y.eol()&&(y.next(),!y.match(u,!1)););},query:u}}var Ma=0;function Lo(u,h){clearTimeout(Ma);var y=wn(u);y.highlightTimeout=Ma,Ma=setTimeout(function(){if(u.state.vim){var v=wn(u);v.highlightTimeout=void 0;var _=v.getOverlay();(!_||h!=_.query)&&(_&&u.removeOverlay(_),_=Ra(h),u.addOverlay(_),u.showMatchesOnScrollbar&&(v.getScrollbarAnnotate()&&v.getScrollbarAnnotate().clear(),v.setScrollbarAnnotate(u.showMatchesOnScrollbar(h))),v.setOverlay(_))}},50)}function Ur(u,h,y,v){return u.operation(function(){v===void 0&&(v=1);for(var _=u.getCursor(),k=u.getSearchCursor(y,_),I=0;I<v;I++){var O=k.find(h);if(I==0&&O&&gt(k.from(),_)){var R=h?k.from():k.to();O=k.find(h),O&&!O[0]&&gt(k.from(),R)&&u.getLine(R.line).length==R.ch&&(O=k.find(h))}if(!O&&(k=u.getSearchCursor(y,h?new t(u.lastLine()):new t(u.firstLine(),0)),!k.find(h)))return}return k.from()})}function ip(u,h,y,v,_){return u.operation(function(){v===void 0&&(v=1);var k=u.getCursor(),I=u.getSearchCursor(y,k),O=I.find(!h);!_.visualMode&&O&&gt(I.from(),k)&&I.find(!h);for(var R=0;R<v;R++)if(O=I.find(h),!O&&(I=u.getSearchCursor(y,h?new t(u.lastLine()):new t(u.firstLine(),0)),!I.find(h)))return;var j=I.from(),D=I.to();return j&&D&&[j,D]})}function Kr(u){var h=wn(u);h.highlightTimeout&&(h.highlightTimeout=(clearTimeout(h.highlightTimeout),void 0)),u.removeOverlay(wn(u).getOverlay()),h.setOverlay(null),h.getScrollbarAnnotate()&&(h.getScrollbarAnnotate().clear(),h.setScrollbarAnnotate(null))}function Nc(u,h,y){return typeof u!="number"&&(u=u.line),h instanceof Array?ie(u,h):typeof y=="number"?u>=h&&u<=y:u==h}function Ei(u){var h=u.getScrollInfo(),y=6,v=10,_=u.coordsChar({left:0,top:y+h.top},"local"),k=h.clientHeight-v+h.top,I=u.coordsChar({left:0,top:k},"local");return{top:_.line,bottom:I.line}}function Oo(u,h,y){if(y=="'"||y=="`")return G.jumpList.find(u,-1)||new t(0,0);if(y==".")return Dc(u);var v=h.marks[y];return v&&v.find()}function Dc(u){if(u.getLastEditEnd)return u.getLastEditEnd();for(var h=u.doc.history.done,y=h.length;y--;)if(h[y].changes)return Qe(h[y].changes[0].to)}class Ao{constructor(){this.commandMap_,this.buildCommandMap_()}processCommand(h,y,v){var _=this;h.operation(function(){h.curOp&&(h.curOp.isVimOp=!0),_._processCommand(h,y,v)})}_processCommand(h,y,v){var _=h.state.vim,k=G.registerController.getRegister(":"),I=k.toString(),O=new e.StringStream(y);k.setText(y);var R=v||{};R.input=y;try{this.parseInput_(h,O,R)}catch(ee){throw Je(h,ee+""),ee}_.visualMode&&Rn(h);var j,D;if(!R.commandName)R.line!==void 0&&(D="move");else if(j=this.matchCommand_(R.commandName),j){if(D=j.name,j.excludeFromCommandHistory&&k.setText(I),this.parseCommandArgs_(O,R,j),j.type=="exToKey"){Mt(h,j.toKeys||"",j);return}else if(j.type=="exToEx"){this.processCommand(h,j.toInput||"");return}}if(!D){Je(h,'Not an editor command ":'+y+'"');return}try{Qn[D](h,R),(!j||!j.possiblyAsync)&&R.callback&&R.callback()}catch(ee){throw Je(h,ee+""),ee}}parseInput_(h,y,v){var k,I;y.eatWhile(":"),y.eat("%")?(v.line=h.firstLine(),v.lineEnd=h.lastLine()):(v.line=this.parseLineSpec_(h,y),v.line!==void 0&&y.eat(",")&&(v.lineEnd=this.parseLineSpec_(h,y))),v.line==null?h.state.vim.visualMode?(v.selectionLine=(k=Oo(h,h.state.vim,"<"))==null?void 0:k.line,v.selectionLineEnd=(I=Oo(h,h.state.vim,">"))==null?void 0:I.line):v.selectionLine=h.getCursor().line:(v.selectionLine=v.line,v.selectionLineEnd=v.lineEnd);var _=y.match(/^(\w+|!!|@@|[!#&*<=>@~])/);return _?v.commandName=_[1]:v.commandName=(y.match(/.*/)||[""])[0],v}parseLineSpec_(h,y){var v=y.match(/^(\d+)/);if(v)return parseInt(v[1],10)-1;switch(y.next()){case".":return this.parseLineSpecOffset_(y,h.getCursor().line);case"$":return this.parseLineSpecOffset_(y,h.lastLine());case"'":var _=y.next()||"",k=Oo(h,h.state.vim,_);if(!k)throw Error("Mark not set");return this.parseLineSpecOffset_(y,k.line);case"-":case"+":return y.backUp(1),this.parseLineSpecOffset_(y,h.getCursor().line);default:y.backUp(1);return}}parseLineSpecOffset_(h,y){var v=h.match(/^([+-])?(\d+)/);if(v){var _=parseInt(v[2],10);v[1]=="-"?y-=_:y+=_}return y}parseCommandArgs_(h,y,v){var I;if(!h.eol()){y.argString=(I=h.match(/.*/))==null?void 0:I[0];var _=v.argDelimiter||/\s+/,k=Sa(y.argString||"").split(_);k.length&&k[0]&&(y.args=k)}}matchCommand_(h){for(var y=h.length;y>0;y--){var v=h.substring(0,y);if(this.commandMap_[v]){var _=this.commandMap_[v];if(_.name.indexOf(h)===0)return _}}}buildCommandMap_(){this.commandMap_={};for(var h=0;h<f.length;h++){var y=f[h],v=y.shortName||y.name;this.commandMap_[v]=y}}map(h,y,v,_){if(h!=":"&&h.charAt(0)==":"){if(v)throw Error("Mode not supported for ex mappings");var k=h.substring(1);y!=":"&&y.charAt(0)==":"?this.commandMap_[k]={name:k,type:"exToEx",toInput:y.substring(1),user:!0}:this.commandMap_[k]={name:k,type:"exToKey",toKeys:y,user:!0}}else{var I={keys:h,type:"keyToKey",toKeys:y,noremap:!!_};v&&(I.context=v),Or(I)}}unmap(h,y){if(h!=":"&&h.charAt(0)==":"){if(y)throw Error("Mode not supported for ex mappings");var v=h.substring(1);if(this.commandMap_[v]&&this.commandMap_[v].user)return delete this.commandMap_[v],!0}else for(var _=h,k=0;k<o.length;k++)if(_==o[k].keys&&o[k].context===y)return o.splice(k,1),Vs(_),!0}}var Qn={colorscheme:function(u,h){if(!h.args||h.args.length<1){Je(u,u.getOption("theme"));return}u.setOption("theme",h.args[0])},map:function(u,h,y,v){var _=h.args;if(!_||_.length<2){u&&Je(u,"Invalid mapping: "+h.input);return}Kt.map(_[0],_[1],y,v)},imap:function(u,h){this.map(u,h,"insert")},nmap:function(u,h){this.map(u,h,"normal")},vmap:function(u,h){this.map(u,h,"visual")},omap:function(u,h){this.map(u,h,"operatorPending")},noremap:function(u,h){this.map(u,h,void 0,!0)},inoremap:function(u,h){this.map(u,h,"insert",!0)},nnoremap:function(u,h){this.map(u,h,"normal",!0)},vnoremap:function(u,h){this.map(u,h,"visual",!0)},onoremap:function(u,h){this.map(u,h,"operatorPending",!0)},unmap:function(u,h,y){var v=h.args;(!v||v.length<1||!Kt.unmap(v[0],y))&&u&&Je(u,"No such mapping: "+h.input)},mapclear:function(u,h){Fe.mapclear()},imapclear:function(u,h){Fe.mapclear("insert")},nmapclear:function(u,h){Fe.mapclear("normal")},vmapclear:function(u,h){Fe.mapclear("visual")},omapclear:function(u,h){Fe.mapclear("operatorPending")},move:function(u,h){pr.processCommand(u,u.state.vim,{keys:"",type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!1,explicitRepeat:!0,linewise:!0},repeatOverride:h.line+1})},set:function(u,h){var y=h.args,v=h.setCfg||{};if(!y||y.length<1){u&&Je(u,"Invalid mapping: "+h.input);return}var _=y[0].split("="),k=_.shift()||"",I=_.length>0?_.join("="):void 0,O=!1,R=!1;if(k.charAt(k.length-1)=="?"){if(I)throw Error("Trailing characters: "+h.argString);k=k.substring(0,k.length-1),O=!0}else k.charAt(k.length-1)=="!"&&(k=k.substring(0,k.length-1),R=!0);I===void 0&&k.substring(0,2)=="no"&&(k=k.substring(2),I=!1);var j=fe[k]&&fe[k].type=="boolean";if(j&&(R?I=!ae(k,u,v):I??(I=!0)),!j&&I===void 0||O){var D=ae(k,u,v);D instanceof Error?Je(u,D.message):D===!0||D===!1?Je(u," "+(D?"":"no")+k):Je(u," "+k+"="+D)}else{var ee=ve(k,I,u,v);ee instanceof Error&&Je(u,ee.message)}},setlocal:function(u,h){h.setCfg={scope:"local"},this.set(u,h)},setglobal:function(u,h){h.setCfg={scope:"global"},this.set(u,h)},registers:function(u,h){var y=h.args,v=G.registerController.registers,_=`----------Registers----------
78
-
79
- `;if(y)for(var k=y.join(""),I=0;I<k.length;I++){var O=k.charAt(I);if(G.registerController.isValidRegister(O)){var R=v[O]||new vn;_+='"'+O+" "+R.toString()+`
80
- `}}else for(var O in v){var j=v[O].toString();j.length&&(_+='"'+O+" "+j+`
81
- `)}Je(u,_,!0)},marks:function(u,h){var y=h.args,v=u.state.vim.marks,_=`-----------Marks-----------
82
- mark line col
83
-
84
- `;if(y)for(var k=y.join(""),I=0;I<k.length;I++){var O=k.charAt(I),R=v[O]&&v[O].find();R&&(_+=O+" "+R.line+" "+R.ch+`
85
- `)}else for(var O in v){var R=v[O]&&v[O].find();R&&(_+=O+" "+R.line+" "+R.ch+`
86
- `)}Je(u,_,!0)},sort:function(u,h){var y,v,_,k,I;function O(){if(h.argString){var je=new e.StringStream(h.argString);if(je.eat("!")&&(y=!0),je.eol())return;if(!je.eatSpace())return"Invalid arguments";var Pe=je.match(/([dinuox]+)?\s*(\/.+\/)?\s*/);if(!Pe||!je.eol())return"Invalid arguments";if(Pe[1]){v=Pe[1].indexOf("i")!=-1,_=Pe[1].indexOf("u")!=-1;var xt=Pe[1].indexOf("d")!=-1||Pe[1].indexOf("n")!=-1,Nt=Pe[1].indexOf("x")!=-1,Vt=Pe[1].indexOf("o")!=-1;if(Number(xt)+Number(Nt)+Number(Vt)>1)return"Invalid arguments";k=xt&&"decimal"||Nt&&"hex"||Vt&&"octal"}Pe[2]&&(I=new RegExp(Pe[2].substr(1,Pe[2].length-2),v?"i":""))}}var R=O();if(R){Je(u,R+": "+h.argString);return}var j=h.line||u.firstLine(),D=h.lineEnd||h.line||u.lastLine();if(j==D)return;var ee=new t(j,0),Y=new t(D,It(u,D)),U=u.getRange(ee,Y).split(`
87
- `),K=k=="decimal"?/(-?)([\d]+)/:k=="hex"?/(-?)(?:0x)?([0-9a-f]+)/i:k=="octal"?/([0-7]+)/:null,ye=k=="decimal"?10:k=="hex"?16:k=="octal"?8:void 0,ge=[],Me=[];if(k||I)for(var ke=0;ke<U.length;ke++){var Ae=I?U[ke].match(I):null;Ae&&Ae[0]!=""?ge.push(Ae):K&&K.exec(U[ke])?ge.push(U[ke]):Me.push(U[ke])}else Me=U;function Ye(je,Pe){if(y){var xt=je;je=Pe,Pe=xt}v&&(je=je.toLowerCase(),Pe=Pe.toLowerCase());var Nt=K&&K.exec(je),Vt=K&&K.exec(Pe);return!Nt||!Vt?je<Pe?-1:1:parseInt((Nt[1]+Nt[2]).toLowerCase(),ye)-parseInt((Vt[1]+Vt[2]).toLowerCase(),ye)}function Be(je,Pe){if(y){var xt=je;je=Pe,Pe=xt}return v&&(je[0]=je[0].toLowerCase(),Pe[0]=Pe[0].toLowerCase()),je[0]<Pe[0]?-1:1}if(ge.sort(I?Be:Ye),I)for(var ke=0;ke<ge.length;ke++)ge[ke]=ge[ke].input;else k||Me.sort(Ye);if(U=y?ge.concat(Me):Me.concat(ge),_){var dt=U,yt;U=[];for(var ke=0;ke<dt.length;ke++)dt[ke]!=yt&&U.push(dt[ke]),yt=dt[ke]}u.replaceRange(U.join(`
88
- `),ee,Y)},vglobal:function(u,h){this.global(u,h)},normal:function(u,h){var y=!1,v=h.argString;if(v&&v[0]=="!"&&(v=v.slice(1),y=!0),v=v.trimStart(),!v){Je(u,"Argument is required.");return}var _=h.line;if(typeof _=="number")for(var k=isNaN(h.lineEnd)?_:h.lineEnd,I=_;I<=k;I++)u.setCursor(I,0),Mt(u,h.argString.trimStart(),{noremap:y}),u.state.vim.insertMode&&hn(u,!0);else Mt(u,h.argString.trimStart(),{noremap:y}),u.state.vim.insertMode&&hn(u,!0)},global:function(u,h){var y=h.argString;if(!y){Je(u,"Regular Expression missing from global");return}var v=h.commandName[0]==="v";y[0]==="!"&&h.commandName[0]==="g"&&(v=!0,y=y.slice(1));var _=h.line===void 0?u.firstLine():h.line,k=h.lineEnd||h.line||u.lastLine(),I=Ac(y),O=y,R="";if(I&&I.length&&(O=I[0],R=I.slice(1,I.length).join("/")),O)try{Wr(u,O,!0,!0)}catch{Je(u,"Invalid regex: "+O);return}for(var j=wn(u).getQuery(),D=[],ee=_;ee<=k;ee++){var Y=u.getLine(ee);j.test(Y)!==v&&D.push(R?u.getLineHandle(ee):Y)}if(!R){Je(u,D.join(`
89
- `));return}var U=0,K=function(){if(U<D.length){var ye=D[U++],ge=u.getLineNumber(ye);if(ge==null){K();return}var Me=ge+1+R;Kt.processCommand(u,Me,{callback:K})}else u.releaseLineHandles&&u.releaseLineHandles()};K()},substitute:function(u,h){if(!u.getSearchCursor)throw Error("Search feature not available. Requires searchcursor.js or any other getSearchCursor implementation.");var y=h.argString,v=y?Ci(y,y[0]):[],_="",k="",I,O,R,j=!1,D=!1;if(v&&v.length)_=v[0],ae("pcre")&&_!==""&&(_=new RegExp(_).source),k=v[1],k!==void 0&&(k=ae("pcre")?qs(k.replace(/([^\\])&/g,"$1$$&")):Rc(k),G.lastSubstituteReplacePart=k),I=v[2]?v[2].split(" "):[];else if(y&&y.length){Je(u,"Substitutions should be of the form :s/pattern/replace/");return}if(I&&(O=I[0],R=parseInt(I[1]),O&&(O.indexOf("c")!=-1&&(j=!0),O.indexOf("g")!=-1&&(D=!0),_=ae("pcre")?_+"/"+O:_.replace(/\//g,"\\/")+"/"+O)),_)try{Wr(u,_,!0,!0)}catch{Je(u,"Invalid regex: "+_);return}if(k||(k=G.lastSubstituteReplacePart),k===void 0){Je(u,"No previous substitute regular expression");return}var ee=wn(u).getQuery(),Y=h.line===void 0?u.getCursor().line:h.line,U=h.lineEnd||Y;Y==u.firstLine()&&U==u.lastLine()&&(U=1/0),R&&(Y=U,U=Y+R-1);var K=Pt(u,new t(Y,0)),ye=u.getSearchCursor(ee,K);Bs(u,j,D,Y,U,ye,ee,k,h.callback)},startinsert:function(u,h){Mt(u,h.argString=="!"?"A":"i",{})},redo:e.commands.redo,undo:e.commands.undo,write:function(u){e.commands.save?e.commands.save(u):u.save&&u.save()},nohlsearch:function(u){Kr(u)},yank:function(u){var h=Qe(u.getCursor()).line,y=u.getLine(h);G.registerController.pushText("0","yank",y,!0,!0)},delete:function(u,h){var y=h.selectionLine,v=isNaN(h.selectionLineEnd)?y:h.selectionLineEnd;Jt.delete(u,{linewise:!0},[{anchor:new t(y,0),head:new t(v+1,0)}])},join:function(u,h){var y=h.selectionLine,v=isNaN(h.selectionLineEnd)?y:h.selectionLineEnd;u.setCursor(new t(y,0)),Vr.joinLines(u,{repeat:v-y},u.state.vim)},delmarks:function(u,h){if(!h.argString||!Sa(h.argString)){Je(u,"Argument required");return}for(var y=u.state.vim,v=new e.StringStream(Sa(h.argString));!v.eol();){v.eatSpace();var _=v.pos;if(!v.match(/[a-zA-Z]/,!1)){Je(u,"Invalid argument: "+h.argString.substring(_));return}var k=v.next();if(v.match("-",!0)){if(!v.match(/[a-zA-Z]/,!1)){Je(u,"Invalid argument: "+h.argString.substring(_));return}var I=k,O=v.next();if(I&&O&&N(I)==N(O)){var R=I.charCodeAt(0),j=O.charCodeAt(0);if(R>=j){Je(u,"Invalid argument: "+h.argString.substring(_));return}for(var D=0;D<=j-R;D++){var ee=String.fromCharCode(R+D);delete y.marks[ee]}}else{Je(u,"Invalid argument: "+I+"-");return}}else k&&delete y.marks[k]}}},Kt=new Ao;Fe.defineEx("version","ve",u=>{Je(u,"Codemirror-vim version: 6.3.0")});function Bs(u,h,y,v,_,k,I,O,R){u.state.vim.exMode=!0;var j=!1,D=0,ee,Y,U;function K(){u.operation(function(){for(;!j;)ye(),Me();ke()})}function ye(){var Ye="",Be=k.match||k.pos&&k.pos.match;Ye=Be?O.replace(/\$(\d{1,3}|[$&])/g,function(yt,je){if(je=="$")return"$";if(je=="&")return Be[0];for(var Pe=je;parseInt(Pe)>=Be.length&&Pe.length>0;)Pe=Pe.slice(0,Pe.length-1);return Pe?Be[Pe]+je.slice(Pe.length,je.length):yt}):u.getRange(k.from(),k.to()).replace(I,O);var dt=k.to().line;k.replace(Ye),Y=k.to().line,_+=Y-dt,U=Y<dt}function ge(){var Ye=ee&&Qe(k.to()),Be=k.findNext();return Be&&!Be[0]&&Ye&&gt(k.from(),Ye)&&(Be=k.findNext()),Be&&D++,Be}function Me(){for(;ge()&&Nc(k.from(),v,_);)if(!(!y&&k.from().line==Y&&!U)){u.scrollIntoView(k.from(),30),u.setSelection(k.from(),k.to()),ee=k.from(),j=!1;return}j=!0}function ke(Ye){if(Ye&&Ye(),u.focus(),ee){u.setCursor(ee);var Be=u.state.vim;Be.exMode=!1,Be.lastHPos=Be.lastHSPos=ee.ch}R?R():j&&Je(u,(D?"Found "+D+" matches":"No matches found")+" for pattern: "+I+(ae("pcre")?" (set nopcre to use Vim regexps)":""))}function Ae(Ye,Be,dt){switch(e.e_stop(Ye),Br(Ye)){case"y":ye(),Me();break;case"n":Me();break;case"a":var yt=R;R=void 0,u.operation(K),R=yt;break;case"l":ye();case"q":case"<Esc>":case"<C-c>":case"<C-[>":ke(dt);break}return j&&ke(dt),!0}if(Me(),j){Je(u,"No matches for "+I+(ae("pcre")?" (set nopcre to use vim regexps)":""));return}if(!h){K(),R&&R();return}Aa(u,{prefix:cn("span","replace with ",cn("strong",O)," (y/n/a/q/l)"),onKeyDown:Ae})}function hn(u,h){var y=u.state.vim,v=G.macroModeState,_=G.registerController.getRegister("."),k=v.isPlaying,I=v.lastInsertModeChanges;k||(u.off("change",gr),y.insertEnd&&y.insertEnd.clear(),y.insertEnd=void 0,e.off(u.getInputField(),"keydown",$s)),!k&&y.insertModeRepeat&&y.insertModeRepeat>1&&(Oi(u,y,y.insertModeRepeat-1,!0),y.lastEditInputState.repeatOverride=y.insertModeRepeat),delete y.insertModeRepeat,y.insertMode=!1,h||u.setCursor(u.getCursor().line,u.getCursor().ch-1),u.setOption("keyMap","vim"),u.setOption("disableInput",!0),u.toggleOverwrite(!1),_.setText(I.changes.join("")),e.signal(u,"vim-mode-change",{mode:"normal"}),v.isRecording&&Hs(v)}function Or(u){o.unshift(u),u.keys&&jc(u.keys)}function jc(u){u.split(/(<(?:[CSMA]-)*\w+>|.)/i).forEach(function(h){h&&(s[h]||(s[h]=0),s[h]++)})}function Vs(u){u.split(/(<(?:[CSMA]-)*\w+>|.)/i).forEach(function(h){s[h]&&s[h]--})}function zc(u,h,y,v,_){var k={keys:u,type:h};for(var I in k[h]=y,k[h+"Args"]=v,_)k[I]=_[I];Or(k)}me("insertModeEscKeysTimeout",200,"number");function Ti(u,h,y,v){var _=G.registerController.getRegister(v);if(v==":"){_.keyBuffer[0]&&Kt.processCommand(u,_.keyBuffer[0]),y.isPlaying=!1;return}var k=_.keyBuffer,I=0;y.isPlaying=!0,y.replaySearchQueries=_.searchQueries.slice(0);for(var O=0;O<k.length;O++)for(var R=k[O],j,D,ee=/<(?:[CSMA]-)*\w+>|./gi;j=ee.exec(R);)if(D=j[0],Fe.handleKey(u,D,"macro"),h.insertMode){var Y=_.insertModeChanges[I++].changes;G.macroModeState.lastInsertModeChanges.changes=Y,Ws(u,Y,1),hn(u)}y.isPlaying=!1}function mr(u,h){if(!u.isPlaying){var y=u.latestRegister,v=G.registerController.getRegister(y);v&&v.pushText(h)}}function Hs(u){if(!u.isPlaying){var h=u.latestRegister,y=G.registerController.getRegister(h);y&&y.pushInsertModeChanges&&y.pushInsertModeChanges(u.lastInsertModeChanges)}}function Ii(u,h){if(!u.isPlaying){var y=u.latestRegister,v=G.registerController.getRegister(y);v&&v.pushSearchQuery&&v.pushSearchQuery(h)}}function gr(u,h){var y=G.macroModeState,v=y.lastInsertModeChanges;if(!y.isPlaying)for(var _=u.state.vim;h;){if(v.expectCursorActivityForChange=!0,v.ignoreCount>1)v.ignoreCount--;else if(h.origin=="+input"||h.origin=="paste"||h.origin===void 0){var k=u.listSelections().length;k>1&&(v.ignoreCount=k);var I=h.text.join(`
90
- `);if(v.maybeReset&&(v.maybeReset=(v.changes=[],!1)),I)if(u.state.overwrite&&!/\n/.test(I))v.changes.push([I]);else{if(I.length>1){var O=_&&_.insertEnd&&_.insertEnd.find(),R=u.getCursor();if(O&&O.line==R.line){var j=O.ch-R.ch;j>0&&j<I.length&&(v.changes.push([I,j]),I="")}}I&&v.changes.push(I)}}h=h.next}}function Ro(u){var _;var h=u.state.vim;if(h.insertMode){var y=G.macroModeState;if(y.isPlaying)return;var v=y.lastInsertModeChanges;v.expectCursorActivityForChange?v.expectCursorActivityForChange=!1:(v.maybeReset=!0,h.insertEnd&&h.insertEnd.clear(),h.insertEnd=u.setBookmark(u.getCursor(),{insertLeft:!0}))}else(_=u.curOp)!=null&&_.isVimOp||Li(u,h)}function Li(u,h){var y=u.getCursor("anchor"),v=u.getCursor("head");if(h.visualMode&&!u.somethingSelected()?Rn(u,!1):!h.visualMode&&!h.insertMode&&u.somethingSelected()&&(h.visualMode=!0,h.visualLine=!1,e.signal(u,"vim-mode-change",{mode:"visual"})),h.visualMode){var _=_t(v,y)?0:-1,k=_t(v,y)?-1:0;v=Ct(v,0,_),y=Ct(y,0,k),h.sel={anchor:y,head:v},fn(u,h,"<",Xt(v,y)),fn(u,h,">",Tr(v,y))}else h.insertMode||(h.lastHPos=u.getCursor().ch)}function $s(u){var h=G.macroModeState.lastInsertModeChanges,y=e.keyName?e.keyName(u):u.key;y&&(y.indexOf("Delete")!=-1||y.indexOf("Backspace")!=-1)&&(h.maybeReset&&(h.maybeReset=(h.changes=[],!1)),h.changes.push(new He(y,u)))}function Oi(u,h,y,v){var _=G.macroModeState;_.isPlaying=!0;var k=h.lastEditActionCommand,I=h.inputState;function O(){k?pr.processAction(u,h,k):pr.evalInput(u,h)}function R(D){if(_.lastInsertModeChanges.changes.length>0){D=h.lastEditActionCommand?D:1;var ee=_.lastInsertModeChanges;Ws(u,ee.changes,D)}}if(h.inputState=h.lastEditInputState,k&&k.interlaceInsertRepeat)for(var j=0;j<y;j++)O(),R(1);else v||O(),R(y);h.inputState=I,h.insertMode&&!v&&hn(u),_.isPlaying=!1}function Ai(u,h){e.lookupKey(h,"vim-insert",function(y){return typeof y=="string"?e.commands[y](u):y(u),!0})}function Ws(u,h,y){var v=u.getCursor("head"),_=G.macroModeState.lastInsertModeChanges.visualBlock;_&&(Sc(u,v,_+1),y=u.listSelections().length,u.setCursor(v));for(var k=0;k<y;k++){_&&u.setCursor(Ct(v,k,0));for(var I=0;I<h.length;I++){var O=h[I];if(O instanceof He)Ai(u,O.keyName);else if(typeof O=="string")u.replaceSelection(O);else{var R=u.getCursor(),j=Ct(R,0,O[0].length-(O[1]||0));u.replaceRange(O[0],R,O[1]?R:j),u.setCursor(j)}}}_&&u.setCursor(Ct(v,0,1))}function Qt(u){var h=new u.constructor;return Object.keys(u).forEach(function(y){if(y!="insertEnd"){var v=u[y];Array.isArray(v)?v=v.slice():v&&typeof v=="object"&&v.constructor!=Object&&(v=Qt(v)),h[y]=v}}),u.sel&&(h.sel={head:u.sel.head&&Qe(u.sel.head),anchor:u.sel.anchor&&Qe(u.sel.anchor)}),h}function Qr(u,h,y){var k=le(u),v=u,_=!1,k=Fe.maybeInitVimState_(v),I=k.visualBlock||k.wasInVisualBlock;if(v.state.closeVimNotification){var O=v.state.closeVimNotification;if(v.state.closeVimNotification=null,O(),h=="<CR>")return mt(v),!0}var R=v.isInMultiSelectMode();if(k.wasInVisualBlock&&!R?k.wasInVisualBlock=!1:R&&k.visualBlock&&(k.wasInVisualBlock=!0),h=="<Esc>"&&!k.insertMode&&!k.visualMode&&R&&k.status=="<Esc>")mt(v);else if(I||!R||v.inVirtualSelectionMode)_=Fe.handleKey(v,h,y);else{var j=Qt(k),D=k.inputState.changeQueueList||[];v.operation(function(){var Y;v.curOp&&(v.curOp.isVimOp=!0);var ee=0;v.forEachSelection(function(){v.state.vim.inputState.changeQueue=D[ee];var U=v.getCursor("head"),K=v.getCursor("anchor"),ye=_t(U,K)?0:-1,ge=_t(U,K)?-1:0;U=Ct(U,0,ye),K=Ct(K,0,ge),v.state.vim.sel.head=U,v.state.vim.sel.anchor=K,_=Fe.handleKey(v,h,y),v.virtualSelection&&(D[ee]=v.state.vim.inputState.changeQueue,v.state.vim=Qt(j)),ee++}),(Y=v.curOp)!=null&&Y.cursorActivity&&!_&&(v.curOp.cursorActivity=!1),v.state.vim=k,k.inputState.changeQueueList=D,k.inputState.changeQueue=null},!0)}return _&&!k.visualMode&&!k.insertMode&&k.visualMode!=v.somethingSelected()&&Li(v,k),_}return Oe(),Fe}function On(e,t){var a=t.ch,o=t.line+1;o<1&&(o=1,a=0),o>e.lines&&(o=e.lines,a=Number.MAX_VALUE);var s=e.line(o);return Math.min(s.from+Math.max(0,a),s.to)}function ur(e,t){let a=e.lineAt(t);return{line:a.number-1,ch:t-a.from}}var Er=class{constructor(e,t){this.line=e,this.ch=t}};function u1(e,t,a){if(e.addEventListener)e.addEventListener(t,a,!1);else{var o=e._handlers||(e._handlers={});o[t]=(o[t]||[]).concat(a)}}function d1(e,t,a){if(e.removeEventListener)e.removeEventListener(t,a,!1);else{var o=e._handlers,s=o&&o[t];if(s){var c=s.indexOf(a);c>-1&&(o[t]=s.slice(0,c).concat(s.slice(c+1)))}}}function f1(e,t,...a){var c;var o=(c=e._handlers)==null?void 0:c[t];if(o)for(var s=0;s<o.length;++s)o[s](...a)}function p1(e,...t){if(e)for(var a=0;a<e.length;++a)e[a](...t)}var Tf;try{Tf=RegExp("[\\w\\p{Alphabetic}\\p{Number}_]","u")}catch{Tf=/[\w]/}function Es(e,t){var a=e.cm6;if(!a.state.readOnly){var o="input.type.compose";if(e.curOp&&(e.curOp.lastChange||(o="input.type.compose.start")),t.annotations)try{t.annotations.some(function(s){s.value=="input"&&(s.value=o)})}catch(s){console.error(s)}else t.userEvent=o;return a.dispatch(t)}}function h1(e,t){var o;e.curOp&&(e.curOp.$changeStart=void 0),(t?V8:G8)(e.cm6);let a=(o=e.curOp)==null?void 0:o.$changeStart;a!=null&&e.cm6.dispatch({selection:{anchor:a}})}var iE={Left:e=>us(e.cm6,{key:"Left"},"editor"),Right:e=>us(e.cm6,{key:"Right"},"editor"),Up:e=>us(e.cm6,{key:"Up"},"editor"),Down:e=>us(e.cm6,{key:"Down"},"editor"),Backspace:e=>us(e.cm6,{key:"Backspace"},"editor"),Delete:e=>us(e.cm6,{key:"Delete"},"editor")},Ve=class Gk{openDialog(t,a,o){return sE(this,t,a,o)}openNotification(t,a){return oE(this,t,a)}constructor(t){this.state={},this.marks=Object.create(null),this.$mid=0,this.options={},this._handlers={},this.$lastChangeEndOffset=0,this.virtualSelection=null,this.cm6=t,this.onChange=this.onChange.bind(this),this.onSelectionChange=this.onSelectionChange.bind(this)}on(t,a){u1(this,t,a)}off(t,a){d1(this,t,a)}signal(t,a,o){f1(this,t,a,o)}indexFromPos(t){return On(this.cm6.state.doc,t)}posFromIndex(t){return ur(this.cm6.state.doc,t)}foldCode(t){let a=this.cm6,o=a.state.selection.ranges,s=this.cm6.state.doc,c=On(s,t),f=$t.create([$t.range(c,c)],0).ranges;a.state.selection.ranges=f,E8(a),a.state.selection.ranges=o}firstLine(){return 0}lastLine(){return this.cm6.state.doc.lines-1}lineCount(){return this.cm6.state.doc.lines}setCursor(t,a){typeof t=="object"&&(a=t.ch,t=t.line);var o=On(this.cm6.state.doc,{line:t,ch:a||0});this.cm6.dispatch({selection:{anchor:o}},{scrollIntoView:!this.curOp}),this.curOp&&!this.curOp.isVimOp&&this.onBeforeEndOperation()}getCursor(t){var a=this.cm6.state.selection.main,o=t=="head"||!t?a.head:t=="anchor"?a.anchor:t=="start"?a.from:t=="end"?a.to:null;if(o==null)throw Error("Invalid cursor type");return this.posFromIndex(o)}listSelections(){var t=this.cm6.state.doc;return this.cm6.state.selection.ranges.map(a=>({anchor:ur(t,a.anchor),head:ur(t,a.head)}))}setSelections(t,a){var o=this.cm6.state.doc,s=t.map(c=>{var f=On(o,c.head),d=On(o,c.anchor);return f==d?$t.cursor(f,1):$t.range(d,f)});this.cm6.dispatch({selection:$t.create(s,a)})}setSelection(t,a,o){this.setSelections([{anchor:t,head:a}],0),o&&o.origin=="*mouse"&&this.onBeforeEndOperation()}getLine(t){var a=this.cm6.state.doc;return t<0||t>=a.lines?"":this.cm6.state.doc.line(t+1).text}getLineHandle(t){return this.$lineHandleChanges||(this.$lineHandleChanges=[]),{row:t,index:this.indexFromPos(new Er(t,0))}}getLineNumber(t){var a=this.$lineHandleChanges;if(!a)return null;for(var o=t.index,s=0;s<a.length;s++)if(o=a[s].changes.mapPos(o,1,m_.TrackAfter),o==null)return null;var c=this.posFromIndex(o);return c.ch==0?c.line:null}releaseLineHandles(){this.$lineHandleChanges=void 0}getRange(t,a){var o=this.cm6.state.doc;return this.cm6.state.sliceDoc(On(o,t),On(o,a))}replaceRange(t,a,o,s){o||(o=a);var c=this.cm6.state.doc,f=On(c,a),d=On(c,o);Es(this,{changes:{from:f,to:d,insert:t}})}replaceSelection(t){Es(this,this.cm6.state.replaceSelection(t))}replaceSelections(t){var a=this.cm6.state.selection.ranges.map((o,s)=>({from:o.from,to:o.to,insert:t[s]||""}));Es(this,{changes:a})}getSelection(){return this.getSelections().join(`
91
- `)}getSelections(){var t=this.cm6;return t.state.selection.ranges.map(a=>t.state.sliceDoc(a.from,a.to))}somethingSelected(){return this.cm6.state.selection.ranges.some(t=>!t.empty)}getInputField(){return this.cm6.contentDOM}clipPos(t){var a=this.cm6.state.doc,o=t.ch,s=t.line+1;s<1&&(s=1,o=0),s>a.lines&&(s=a.lines,o=Number.MAX_VALUE);var c=a.line(s);return o=Math.min(Math.max(0,o),c.to-c.from),new Er(s-1,o)}getValue(){return this.cm6.state.doc.toString()}setValue(t){var a=this.cm6;return a.dispatch({changes:{from:0,to:a.state.doc.length,insert:t},selection:$t.range(0,0)})}focus(){return this.cm6.focus()}blur(){return this.cm6.contentDOM.blur()}defaultTextHeight(){return this.cm6.defaultLineHeight}findMatchingBracket(t,a){var o=this.cm6.state,s=On(o.doc,t),c=E_(o,s+1,-1);return c&&c.end||(c=E_(o,s,1),c&&c.end)?{to:ur(o.doc,c.end.from)}:{to:void 0}}scanForBracket(t,a,o,s){return uE(this,t,a,o,s)}indentLine(t,a){a?this.indentMore():this.indentLess()}indentMore(){tL(this.cm6)}indentLess(){F8(this.cm6)}execCommand(t){if(t=="indentAuto")Gk.commands.indentAuto(this);else if(t=="goLineLeft")Q8(this.cm6);else if(t=="goLineRight"){K8(this.cm6);let a=this.cm6.state,o=a.selection.main.head;o<a.doc.length&&a.sliceDoc(o,o+1)!==`
92
- `&&U8(this.cm6)}else console.log(t+" is not implemented")}setBookmark(t,a){var o=a!=null&&a.insertLeft?1:-1,s=this.indexFromPos(t);return new pE(this,s,o)}addOverlay({query:t}){let a=new J8({regexp:!0,search:t.source,caseSensitive:!/i/.test(t.flags)});if(a.valid){a.forVim=!0,this.cm6Query=a;let o=im.of(a);return this.cm6.dispatch({effects:o}),a}}removeOverlay(t){if(!this.cm6Query)return;this.cm6Query.forVim=!1;let a=im.of(this.cm6Query);this.cm6.dispatch({effects:a})}getSearchCursor(t,a){var o=this,s=null,c=null,f=!1;a.ch??(a.ch=Number.MAX_VALUE);var d=On(o.cm6.state.doc,a),m=t.source.replace(/(\\.|{(?:\d+(?:,\d*)?|,\d+)})|[{}]/g,function(E,T){return T||"\\"+E});function b(E,T=0,M=E.length){return new Z8(E,m,{ignoreCase:t.ignoreCase},T,M)}function w(E){var T=o.cm6.state.doc;if(E>T.length)return null;let M=b(T,E).next();return M.done?null:M.value}var x=1e4;function S(E,T){var M=o.cm6.state.doc;for(let z=1;;z++){let B=Math.max(E,T-z*x),V=b(M,B,T),N=null;for(;!V.next().done;)N=V.value;if(N&&(B==E||N.from>B+10))return N;if(B==E)return null}}return{findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(E){var T=o.cm6.state.doc;return s=E?S(0,s?f?s.to-1:s.from:d):w(s?f?s.to+1:s.to:d),c=s&&{from:ur(T,s.from),to:ur(T,s.to),match:s.match},f=s?s.from==s.to:!1,s&&s.match},from:function(){return c==null?void 0:c.from},to:function(){return c==null?void 0:c.to},replace:function(E){s&&(Es(o,{changes:{from:s.from,to:s.to,insert:E}}),s.to=s.from+E.length,c&&(c.to=ur(o.cm6.state.doc,s.to)))},get match(){return c&&c.match}}}findPosV(t,a,o,s){let{cm6:c}=this,f=c.state.doc,d=o=="page"?c.dom.clientHeight:0,m=On(f,t),b=$t.cursor(m,1,void 0,s),w=Math.round(Math.abs(a));for(let S=0;S<w;S++)o=="page"?b=c.moveVertically(b,a>0,d):o=="line"&&(b=c.moveVertically(b,a>0));let x=ur(f,b.head);return(a<0&&b.head==0&&s!=0&&t.line==0&&t.ch!=0||a>0&&b.head==f.length&&x.ch!=s&&t.line==x.line)&&(x.hitSide=!0),x}charCoords(t,a){var o=this.cm6.contentDOM.getBoundingClientRect(),s=On(this.cm6.state.doc,t),c=this.cm6.coordsAtPos(s),f=-o.top;return{left:((c==null?void 0:c.left)||0)-o.left,top:((c==null?void 0:c.top)||0)+f,bottom:((c==null?void 0:c.bottom)||0)+f}}coordsChar(t,a){var o=this.cm6.contentDOM.getBoundingClientRect(),s=this.cm6.posAtCoords({x:t.left+o.left,y:t.top+o.top})||0;return ur(this.cm6.state.doc,s)}getScrollInfo(){var t=this.cm6.scrollDOM;return{left:t.scrollLeft,top:t.scrollTop,height:t.scrollHeight,width:t.scrollWidth,clientHeight:t.clientHeight,clientWidth:t.clientWidth}}scrollTo(t,a){t!=null&&(this.cm6.scrollDOM.scrollLeft=t),a!=null&&(this.cm6.scrollDOM.scrollTop=a)}scrollIntoView(t,a){if(t){var o=this.indexFromPos(t);this.cm6.dispatch({effects:wt.scrollIntoView(o)})}else this.cm6.dispatch({scrollIntoView:!0,userEvent:"scroll"})}getWrapperElement(){return this.cm6.dom}getMode(){return{name:this.getOption("mode")}}setSize(t,a){this.cm6.dom.style.width=t+4+"px",this.cm6.dom.style.height=a+"px",this.refresh()}refresh(){this.cm6.measure()}destroy(){this.removeOverlay()}getLastEditEnd(){return this.posFromIndex(this.$lastChangeEndOffset)}onChange(t){for(let o in this.$lineHandleChanges&&this.$lineHandleChanges.push(t),this.marks)this.marks[o].update(t.changes);this.virtualSelection&&(this.virtualSelection.ranges=this.virtualSelection.ranges.map(o=>o.map(t.changes)));var a=this.curOp=this.curOp||{};t.changes.iterChanges((o,s,c,f,d)=>{(a.$changeStart==null||a.$changeStart>c)&&(a.$changeStart=c),this.$lastChangeEndOffset=f;var m={text:d.toJSON()};a.lastChange?a.lastChange.next=a.lastChange=m:a.lastChange=a.change=m},!0),a.changeHandlers||(a.changeHandlers=this._handlers.change&&this._handlers.change.slice())}onSelectionChange(){var t=this.curOp=this.curOp||{};t.cursorActivityHandlers||(t.cursorActivityHandlers=this._handlers.cursorActivity&&this._handlers.cursorActivity.slice()),this.curOp.cursorActivity=!0}operation(t,a){this.curOp||(this.curOp={$d:0}),this.curOp.$d++;try{var o=t()}finally{this.curOp&&(this.curOp.$d--,this.curOp.$d||this.onBeforeEndOperation())}return o}onBeforeEndOperation(){var t=this.curOp,a=!1;t&&(t.change&&p1(t.changeHandlers,this,t.change),t&&t.cursorActivity&&(p1(t.cursorActivityHandlers,this,null),t.isVimOp&&(a=!0)),this.curOp=null),a&&this.scrollIntoView()}moveH(t,a){if(a=="char"){var o=this.getCursor();this.setCursor(o.line,o.ch+t)}}setOption(t,a){switch(t){case"keyMap":this.state.keyMap=a;break;case"textwidth":this.state.textwidth=a;break}}getOption(t){switch(t){case"firstLineNumber":return 1;case"tabSize":return this.cm6.state.tabSize||4;case"readOnly":return this.cm6.state.readOnly;case"indentWithTabs":return this.cm6.state.facet(p_)==" ";case"indentUnit":return this.cm6.state.facet(p_).length||2;case"textwidth":return this.state.textwidth;case"keyMap":return this.state.keyMap||"vim"}}toggleOverwrite(t){this.state.overwrite=t}getTokenTypeAt(t){var s,c,f;var a=this.indexFromPos(t),o=((f=(c=(s=b_(this.cm6.state,a))==null?void 0:s.resolve(a))==null?void 0:c.type)==null?void 0:f.name)||"";return/comment/i.test(o)?"comment":/string/i.test(o)?"string":""}overWriteSelection(t){var a=this.cm6.state.doc,o=this.cm6.state.selection,s=o.ranges.map(c=>{if(c.empty){var f=c.to<a.length?a.sliceString(c.from,c.to+1):"";if(f&&!/\n/.test(f))return $t.range(c.from,c.to+1)}return c});this.cm6.dispatch({selection:$t.create(s,o.mainIndex)}),this.replaceSelection(t)}isInMultiSelectMode(){return this.cm6.state.selection.ranges.length>1}virtualSelectionMode(){return!!this.virtualSelection}forEachSelection(t){var a=this.cm6.state.selection;this.virtualSelection=$t.create(a.ranges,a.mainIndex);for(var o=0;o<this.virtualSelection.ranges.length;o++){var s=this.virtualSelection.ranges[o];s&&(this.cm6.dispatch({selection:$t.create([s])}),t(),this.virtualSelection.ranges[o]=this.cm6.state.selection.ranges[0])}this.cm6.dispatch({selection:this.virtualSelection}),this.virtualSelection=null}hardWrap(t){return hE(this,t)}};Ve.isMac=typeof navigator<"u"&&/Mac/.test(navigator.platform),Ve.Pos=Er,Ve.StringStream=j8,Ve.commands={cursorCharLeft:function(e){X8(e.cm6)},redo:function(e){h1(e,!1)},undo:function(e){h1(e,!0)},newlineAndIndent:function(e){B8({state:e.cm6.state,dispatch:t=>Es(e,t)})},indentAuto:function(e){$8(e.cm6)},newlineAndIndentContinueComment:void 0,save:void 0},Ve.isWordChar=function(e){return Tf.test(e)},Ve.keys=iE,Ve.addClass=function(e,t){},Ve.rmClass=function(e,t){},Ve.e_preventDefault=function(e){e.preventDefault()},Ve.e_stop=function(e){var t,a;(t=e==null?void 0:e.stopPropagation)==null||t.call(e),(a=e==null?void 0:e.preventDefault)==null||a.call(e)},Ve.lookupKey=function(e,t,a){var o=Ve.keys[e];!o&&/^Arrow/.test(e)&&(o=Ve.keys[e.slice(5)]),o&&a(o)},Ve.on=u1,Ve.off=d1,Ve.signal=f1,Ve.findMatchingTag=dE,Ve.findEnclosingTag=fE,Ve.keyName=void 0;function m1(e,t,a){var o=document.createElement("div");return o.appendChild(t),o}function g1(e,t){e.state.currentNotificationClose&&e.state.currentNotificationClose(),e.state.currentNotificationClose=t}function oE(e,t,a){g1(e,d);var o=m1(e,t,a&&a.bottom),s=!1,c,f=a&&a.duration!==void 0?a.duration:5e3;function d(){s||(s=!0,clearTimeout(c),o.remove(),v1(e,o))}return o.onclick=function(m){m.preventDefault(),d()},y1(e,o),f&&(c=setTimeout(d,f)),d}function y1(e,t){var a=e.state.dialog;e.state.dialog=t,t.style.flex="1",t&&a!==t&&(a&&a.contains(document.activeElement)&&e.focus(),a&&a.parentElement?a.parentElement.replaceChild(t,a):a&&a.remove(),Ve.signal(e,"dialog"))}function v1(e,t){e.state.dialog==t&&(e.state.dialog=null,Ve.signal(e,"dialog"))}function sE(e,t,a,o){o||(o={}),g1(e,void 0);var s=m1(e,t,o.bottom),c=!1;y1(e,s);function f(m){if(typeof m=="string")d.value=m;else{if(c)return;c=!0,v1(e,s),e.state.dialog||e.focus(),o.onClose&&o.onClose(s)}}var d=s.getElementsByTagName("input")[0];return d&&(o.value&&(d.value=o.value,o.selectValueOnOpen!==!1&&d.select()),o.onInput&&Ve.on(d,"input",function(m){o.onInput(m,d.value,f)}),o.onKeyUp&&Ve.on(d,"keyup",function(m){o.onKeyUp(m,d.value,f)}),Ve.on(d,"keydown",function(m){o&&o.onKeyDown&&o.onKeyDown(m,d.value,f)||(m.keyCode==13&&a&&a(d.value),(m.keyCode==27||o.closeOnEnter!==!1&&m.keyCode==13)&&(d.blur(),Ve.e_stop(m),f()))}),o.closeOnBlur!==!1&&Ve.on(d,"blur",function(){setTimeout(function(){document.activeElement!==d&&f()})}),d.focus()),f}var lE={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<","<":">>",">":"<<"};function cE(e){return e&&e.bracketRegex||/[(){}[\]]/}function uE(e,t,a,o,s){for(var c=s&&s.maxScanLineLength||1e4,f=s&&s.maxScanLines||1e3,d=[],m=cE(s),b=a>0?Math.min(t.line+f,e.lastLine()+1):Math.max(e.firstLine()-1,t.line-f),w=t.line;w!=b;w+=a){var x=e.getLine(w);if(x){var S=a>0?0:x.length-1,E=a>0?x.length:-1;if(!(x.length>c))for(w==t.line&&(S=t.ch-(a<0?1:0));S!=E;S+=a){var T=x.charAt(S);if(m.test(T)){var M=lE[T];if(M&&M.charAt(1)==">"==a>0)d.push(T);else if(d.length)d.pop();else return{pos:new Er(w,S),ch:T}}}}}return w-a==(a>0?e.lastLine():e.firstLine())?!1:null}function dE(e,t){return null}function fE(e,t){var c,f,d;var a=e.cm6.state,o=e.indexFromPos(t);o<a.doc.length&&a.sliceDoc(o,o+1)=="<"&&o++;for(var s=((c=b_(a,o))==null?void 0:c.resolve(o))||null;s;){if(((f=s.firstChild)==null?void 0:f.type.name)=="OpenTag"&&((d=s.lastChild)==null?void 0:d.type.name)=="CloseTag")return{open:b1(a.doc,s.firstChild),close:b1(a.doc,s.lastChild)};s=s.parent}}function b1(e,t){return{from:ur(e,t.from),to:ur(e,t.to)}}var pE=class{constructor(e,t,a){this.cm=e,this.id=e.$mid++,this.offset=t,this.assoc=a,e.marks[this.id]=this}clear(){delete this.cm.marks[this.id]}find(){return this.offset==null?null:this.cm.posFromIndex(this.offset)}update(e){this.offset!=null&&(this.offset=e.mapPos(this.offset,this.assoc,m_.TrackDel))}};function hE(e,t){var T;for(var a=t.column||e.getOption("textwidth")||80,o=t.allowMerge!=0,s=Math.min(t.from,t.to),c=Math.max(t.from,t.to);s<=c;){var f=e.getLine(s);if(f.length>a){var d=E(f,a,5);if(d){var m=(T=/^\s*/.exec(f))==null?void 0:T[0];e.replaceRange(`
93
- `+m,new Er(s,d.start),new Er(s,d.end))}c++}else if(o&&/\S/.test(f)&&s!=c){var b=e.getLine(s+1);if(b&&/\S/.test(b)){var w=f.replace(/\s+$/,""),x=b.replace(/^\s+/,""),S=w+" "+x,d=E(S,a,5);d&&d.start>w.length||S.length<a?(e.replaceRange(" ",new Er(s,w.length),new Er(s+1,b.length-x.length)),s--,c--):w.length<f.length&&e.replaceRange("",new Er(s,w.length),new Er(s,f.length))}}s++}return s;function E(M,z,B){if(!(M.length<z)){var V=M.slice(0,z),N=M.slice(z),X=/^(?:(\s+)|(\S+)(\s+))/.exec(N),ce=/(?:(\s+)|(\s+)(\S+))$/.exec(V),A=0,q=0;if(ce&&!ce[2]&&(A=z-ce[1].length,q=z),X&&!X[2]&&(A||(A=z),q=z+X[1].length),A)return{start:A,end:q};if(ce&&ce[2]&&ce.index>B)return{start:ce.index,end:ce.index+ce[2].length};if(X&&X[2])return A=z+X[2].length,{start:A,end:A+X[3].length}}}}var If=M8||(function(){let e={cursorBlinkRate:1200};return function(){return e}})(),mE=class{constructor(e,t,a,o,s,c,f,d,m,b){this.left=e,this.top=t,this.height=a,this.fontFamily=o,this.fontSize=s,this.fontWeight=c,this.color=f,this.className=d,this.letter=m,this.partial=b}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",e.style.height=this.height+"px",e.style.lineHeight=this.height+"px",e.style.fontFamily=this.fontFamily,e.style.fontSize=this.fontSize,e.style.fontWeight=this.fontWeight,e.style.color=this.partial?"transparent":this.color,e.className=this.className,e.textContent=this.letter}eq(e){return this.left==e.left&&this.top==e.top&&this.height==e.height&&this.fontFamily==e.fontFamily&&this.fontSize==e.fontSize&&this.fontWeight==e.fontWeight&&this.color==e.color&&this.className==e.className&&this.letter==e.letter}},gE=class{constructor(e,t){this.view=e,this.rangePieces=[],this.cursors=[],this.cm=t,this.measureReq={read:this.readPos.bind(this),write:this.drawSel.bind(this)},this.cursorLayer=e.scrollDOM.appendChild(document.createElement("div")),this.cursorLayer.className="cm-cursorLayer cm-vimCursorLayer",this.cursorLayer.setAttribute("aria-hidden","true"),e.requestMeasure(this.measureReq),this.setBlinkRate()}setBlinkRate(){let e=If(this.cm.cm6.state).cursorBlinkRate;this.cursorLayer.style.animationDuration=e+"ms"}update(e){(e.selectionSet||e.geometryChanged||e.viewportChanged)&&(this.view.requestMeasure(this.measureReq),this.cursorLayer.style.animationName=this.cursorLayer.style.animationName=="cm-blink"?"cm-blink2":"cm-blink"),yE(e)&&this.setBlinkRate()}scheduleRedraw(){this.view.requestMeasure(this.measureReq)}readPos(){let{state:e}=this.view,t=[];for(let a of e.selection.ranges){let o=a==e.selection.main,s=wE(this.cm,this.view,a,o);s&&t.push(s)}return{cursors:t}}drawSel({cursors:e}){if(e.length!=this.cursors.length||e.some((t,a)=>!t.eq(this.cursors[a]))){let t=this.cursorLayer.children;if(t.length!==e.length){this.cursorLayer.textContent="";for(let a of e)this.cursorLayer.appendChild(a.draw())}else e.forEach((a,o)=>a.adjust(t[o]));this.cursors=e}}destroy(){this.cursorLayer.remove()}};function yE(e){return If(e.startState)!=If(e.state)}var vE=Ju.highest(wt.theme({".cm-vimMode .cm-line":{"& ::selection":{backgroundColor:"transparent !important"},"&::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-fat-cursor":{position:"absolute",background:"#ff9696",border:"none",whiteSpace:"pre"},"&:not(.cm-focused) .cm-fat-cursor":{background:"none",outline:"solid 1px #ff9696",color:"transparent !important"}}));function bE(e){let t=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==D8.LTR?t.left:t.right-e.scrollDOM.clientWidth)-e.scrollDOM.scrollLeft*e.scaleX,top:t.top-e.scrollDOM.scrollTop*e.scaleY}}function wE(e,t,a,o){var w,x,S;var s;let c=a.head,f=!1,d=1,m=e.state.vim;if(m&&(!m.insertMode||e.state.overwrite)){if(f=!0,m.visualBlock&&!o)return null;a.anchor<a.head&&(c<t.state.doc.length&&t.state.sliceDoc(c,c+1))!=`
94
- `&&c--,e.state.overwrite?d=.2:m.status&&(d=.5)}if(f){let E=c<t.state.doc.length&&t.state.sliceDoc(c,c+1);E&&/[\uDC00-\uDFFF]/.test(E)&&c>1&&(c--,E=t.state.sliceDoc(c,c+1));let T=t.coordsAtPos(c,1);if(!T)return null;let M=bE(t),z=t.domAtPos(c),B=z?z.node:t.contentDOM;for(B instanceof Text&&z.offset>=B.data.length&&((w=B.parentElement)==null?void 0:w.nextSibling)&&(B=(x=B.parentElement)==null?void 0:x.nextSibling,z={node:B,offset:0});z&&z.node instanceof HTMLElement;)B=z.node,z={node:z.node.childNodes[z.offset],offset:0};if(!(B instanceof HTMLElement)){if(!B.parentNode)return null;B=B.parentNode}let V=getComputedStyle(B),N=T.left,X=(S=(s=t).coordsForChar)==null?void 0:S.call(s,c);if(X&&(N=X.left),!E||E==`
95
- `||E=="\r")E="\xA0";else if(E==" "){E="\xA0";var b=t.coordsAtPos(c+1,-1);b&&(N=b.left-(b.left-T.left)/parseInt(V.tabSize))}else/[\uD800-\uDBFF]/.test(E)&&c<t.state.doc.length-1&&(E+=t.state.sliceDoc(c+1,c+2));let ce=T.bottom-T.top;return new mE((N-M.left)/t.scaleX,(T.top-M.top+ce*(1-d))/t.scaleY,ce*d/t.scaleY,V.fontFamily,V.fontSize,V.fontWeight,V.color,o?"cm-fat-cursor cm-cursor-primary":"cm-fat-cursor cm-cursor-secondary",E,d!=1)}else return null}let w1,_1,x1,k1;w1=typeof navigator<"u"&&/linux/i.test(navigator.platform)&&/ Gecko\/\d+/.exec(navigator.userAgent),pa=aE(Ve),_1=250,x1=wt.baseTheme({".cm-vimMode .cm-cursorLayer:not(.cm-vimCursorLayer)":{display:"none"},".cm-vim-panel":{padding:"0px 10px",fontFamily:"monospace",minHeight:"1.3em",display:"flex"},".cm-vim-panel input":{border:"none",outline:"none",backgroundColor:"inherit"},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"}}),k1=Dr.fromClass(class{constructor(e){this.status="",this.query=null,this.decorations=En.none,this.waitForCopy=!1,this.lastKeydown="",this.useNextTextInput=!1,this.compositionText="",this.view=e;let t=this.cm=new Ve(e);pa.enterVimMode(this.cm),this.view.cm=this.cm,this.cm.state.vimPlugin=this,this.blockCursor=new gE(e,t),this.updateClass(),this.cm.on("vim-command-done",()=>{t.state.vim&&(t.state.vim.status=""),this.blockCursor.scheduleRedraw(),this.updateStatus()}),this.cm.on("vim-mode-change",a=>{t.state.vim&&(t.state.vim.mode=a.mode,a.subMode&&(t.state.vim.mode+=" block"),t.state.vim.status="",this.blockCursor.scheduleRedraw(),this.updateClass(),this.updateStatus())}),this.cm.on("dialog",()=>{this.cm.state.statusbar?this.updateStatus():e.dispatch({effects:C1.of(!!this.cm.state.dialog)})}),this.dom=document.createElement("span"),this.spacer=document.createElement("span"),this.spacer.style.flex="1",this.statusButton=document.createElement("span"),this.statusButton.onclick=a=>{pa.handleKey(this.cm,"<Esc>","user"),this.cm.focus()},this.statusButton.style.cssText="cursor: pointer"}update(e){var t;if((e.viewportChanged||e.docChanged)&&this.query&&this.highlight(this.query),e.docChanged&&this.cm.onChange(e),e.selectionSet&&this.cm.onSelectionChange(),e.viewportChanged,this.cm.curOp&&!this.cm.curOp.isVimOp&&this.cm.onBeforeEndOperation(),e.transactions){for(let a of e.transactions)for(let o of a.effects)if(o.is(im))if(!((t=o.value)!=null&&t.forVim))this.highlight(null);else{let s=o.value.create();this.highlight(s)}}this.blockCursor.update(e)}updateClass(){let e=this.cm.state;!e.vim||e.vim.insertMode&&!e.overwrite?this.view.scrollDOM.classList.remove("cm-vimMode"):this.view.scrollDOM.classList.add("cm-vimMode")}updateStatus(){let e=this.cm.state.statusbar,t=this.cm.state.vim;if(!e||!t)return;let a=this.cm.state.dialog;if(a)a.parentElement!=e&&(e.textContent="",e.appendChild(a));else{e.textContent="";var o=(t.mode||"normal").toUpperCase();t.insertModeReturn&&(o+="(C-O)"),this.statusButton.textContent=`--${o}--`,e.appendChild(this.statusButton),e.appendChild(this.spacer)}this.dom.textContent=t.status,e.appendChild(this.dom)}destroy(){pa.leaveVimMode(this.cm),this.updateClass(),this.blockCursor.destroy(),delete this.view.cm}highlight(e){if(this.query=e,!e)return this.decorations=En.none;let{view:t}=this,a=new Ll;for(let o=0,s=t.visibleRanges,c=s.length;o<c;o++){let{from:f,to:d}=s[o];for(;o<c-1&&d>s[o+1].from-2*_1;)d=s[++o].to;e.highlight(t.state,f,d,(m,b)=>{a.add(m,b,xE)})}return this.decorations=a.finish()}handleKey(e,t){let a=this.cm,o=a.state.vim;if(!o)return;let s=pa.vimKeyFromEvent(e,o);if(Ve.signal(this.cm,"inputEvent",{type:"handleKey",key:s}),!s)return;if(s=="<Esc>"&&!o.insertMode&&!o.visualMode&&this.query){let f=o.searchState_;f&&(a.removeOverlay(f.getOverlay()),f.setOverlay(null))}if(s==="<C-c>"&&!Ve.isMac&&a.somethingSelected())return this.waitForCopy=!0,!0;o.status=(o.status||"")+s;let c=pa.multiSelectHandleKey(a,s,"user");return o=pa.maybeInitVimState_(a),!c&&o.insertMode&&a.state.overwrite&&(e.key&&e.key.length==1&&!/\n/.test(e.key)?(c=!0,a.overWriteSelection(e.key)):e.key=="Backspace"&&(c=!0,Ve.commands.cursorCharLeft(a))),c&&(Ve.signal(this.cm,"vim-keypress",s),e.preventDefault(),e.stopPropagation(),this.blockCursor.scheduleRedraw()),this.updateStatus(),!!c}},{eventHandlers:{copy:function(e,t){this.waitForCopy&&(this.waitForCopy=!1,Promise.resolve().then(()=>{var a=this.cm,o=a.state.vim;o&&(o.insertMode?a.setSelection(a.getCursor(),a.getCursor()):a.operation(()=>{a.curOp&&(a.curOp.isVimOp=!0),pa.handleKey(a,"<Esc>","user")}))}))},compositionstart:function(e,t){this.useNextTextInput=!0,Ve.signal(this.cm,"inputEvent",e)},compositionupdate:function(e,t){Ve.signal(this.cm,"inputEvent",e)},compositionend:function(e,t){Ve.signal(this.cm,"inputEvent",e)},keypress:function(e,t){Ve.signal(this.cm,"inputEvent",e),this.lastKeydown=="Dead"&&this.handleKey(e,t)},keydown:function(e,t){Ve.signal(this.cm,"inputEvent",e),this.lastKeydown=e.key,this.lastKeydown=="Unidentified"||this.lastKeydown=="Process"||this.lastKeydown=="Dead"?this.useNextTextInput=!0:(this.useNextTextInput=!1,this.handleKey(e,t))}},provide:()=>[wt.inputHandler.of((e,t,a,o)=>{var w,x;var s=Wl(e);if(!s)return!1;var c=(w=s.state)==null?void 0:w.vim,f=s.state.vimPlugin;if(c&&!c.insertMode&&!((x=s.curOp)!=null&&x.isVimOp)){if(o==="\0\0")return!0;if(Ve.signal(s,"inputEvent",{type:"text",text:o,from:t,to:a}),o.length==1&&f.useNextTextInput){if(c.expectLiteralNext&&e.composing)return f.compositionText=o,!1;if(f.compositionText){var d=f.compositionText;f.compositionText="";var m=e.state.selection.main.head;if(d===e.state.sliceDoc(m-d.length,m)){var b=s.getCursor();s.replaceRange("",s.posFromIndex(m-d.length),b)}}return f.handleKey({key:o,preventDefault:()=>{},stopPropagation:()=>{}}),_E(e),!0}}return!1})],decorations:e=>e.decorations});function _E(e){var t=e.scrollDOM.parentElement;if(t){if(w1){e.contentDOM.textContent="\0\0",e.contentDOM.dispatchEvent(new CustomEvent("compositionend"));return}var a=e.scrollDOM.nextSibling,o=window.getSelection(),s=o&&{anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset};e.scrollDOM.remove(),t.insertBefore(e.scrollDOM,a);try{s&&o&&(o.setPosition(s.anchorNode,s.anchorOffset),s.focusNode&&o.extend(s.focusNode,s.focusOffset))}catch(c){console.error(c)}e.focus(),e.contentDOM.dispatchEvent(new CustomEvent("compositionend"))}}var xE=En.mark({class:"cm-searchMatch"}),C1=_r.define(),kE=ei.define({create:()=>!1,update(e,t){for(let a of t.effects)a.is(C1)&&(e=a.value);return e},provide:e=>rm.from(e,t=>t?CE:null)});function CE(e){let t=document.createElement("div");t.className="cm-vim-panel";let a=e.cm;return a.state.dialog&&t.appendChild(a.state.dialog),{top:!1,dom:t}}function SE(e){let t=document.createElement("div");t.className="cm-vim-panel";let a=e.cm;return a.state.statusbar=t,a.state.vimPlugin.updateStatus(),{dom:t}}Wk=function(e={}){return[x1,k1,vE,e.status?rm.of(SE):kE]},Wl=function(e){return e.cm||null},o0=function(e){let t=e.state.selection.main;return t.from===0&&t.to===0},n0=function(e,t=!1){let a=e.state.selection.main,o=e.state.doc.length;return t&&a.from===o-1&&a.to===o-1?!0:a.from===o&&a.to===o},d0=function(e){e&&e.dispatch({selection:{anchor:e.state.doc.length,head:e.state.doc.length}})},jk=function(e){requestAnimationFrame(()=>{var a;let t=(a=e.current)==null?void 0:a.view;t&&(t.focus(),d0(t))})},Tk=function(e){var t;return((t=Wl(e))==null?void 0:t.state.vim)!=null},vk=function(e){var a;let t=(a=Wl(e))==null?void 0:a.state.vim;return t?!t.mode&&!t.insertMode&&!t.visualMode?!0:t.mode==="normal":!1},ok=function(e){e&&e.dispatch({selection:{anchor:0,head:e.state.doc.length}})};const Ts=Ee(null);Xx=function(e){let t=Te.get(Ts);if(e===null){Te.set(Ts,null);return}(t==null?void 0:t.cellId)===e.cellId&&t.line===e.line||Te.set(Ts,{...e,startedAtMs:Date.now()})};const fo=Ee(new Map);var EE=new Set;function TE(e){return Ee(t=>{let a=t(Ts);return(a==null?void 0:a.cellId)===e?a.line:null})}function IE(e){return Ee(t=>{let a=t(Ts);return(a==null?void 0:a.cellId)===e?{line:a.line,startedAtMs:a.startedAtMs}:null})}function LE(e){return Ee(t=>t(fo).get(e)??EE)}function Lf(e){let t={};for(let[a,o]of e)o.size>0&&(t[a]=[...o].toSorted((s,c)=>s-c));ir().sendSetBreakpoints({breakpoints:t}).catch(a=>{_e.debug("Failed to sync breakpoints to kernel",{error:a})})}kk=function(e){let t=Te.get(fo);if(!t.has(e))return;let a=new Map(t);a.delete(e),Te.set(fo,a),Lf(a)},Rk=function(){let e=Te.get(fo);e.size>0&&Lf(e)},b0=function(e,t){let a=Te.get(fo),o=new Map(a),s=new Set(o.get(e)??[]);s.has(t)?s.delete(t):s.add(t),s.size>0?o.set(e,s):o.delete(e),Te.set(fo,o),Lf(o)};function S1(e,t){if(t==null||t<1||t>e.doc.lines)return En.none;let a=new Ll;try{let o=e.doc.line(t);a.add(o.from,o.from,En.line({class:"cm-debugger-current-line"}))}catch(o){_e.debug("Invalid debugger line",{error:o})}return a.finish()}var OE=class{constructor(e,t){this.decorations=S1(e.state,t.get()),this.unsubscribe=t.sub(a=>{this.decorations=S1(e.state,a),e.dispatch({userEvent:"marimo.debugger-line-update"})})}update(e){this.decorations=this.decorations.map(e.changes)}destroy(){this.unsubscribe()}};function AE(e){return[Dr.define(t=>new OE(t,e),{decorations:t=>t.decorations}),wt.theme({".cm-debugger-current-line":{backgroundColor:"color-mix(in srgb, var(--amber-4) 50%, transparent)"}})]}var E1=new class extends __{toDOM(){let e=document.createElement("div");return e.className="cm-breakpoint-marker",e}},T1=_r.define(),I1=ei.define({create:()=>new Set,update(e,t){for(let a of t.effects)if(a.is(T1))return a.value;return e}});function RE(e){let t=e.field(I1);if(t.size===0)return h_.empty;let a=new Ll;for(let o of[...t].toSorted((s,c)=>s-c))if(o>=1&&o<=e.doc.lines){let s=e.doc.line(o);a.add(s.from,s.from,E1)}return a.finish()}var ME=class{constructor(e,t){let a=o=>{e.dispatch({effects:T1.of(o)})};t.get().size>0&&queueMicrotask(()=>a(t.get())),this.unsubscribe=t.sub(a)}destroy(){this.unsubscribe()}};function PE(e,t){return[I1,Dr.define(a=>new ME(a,t)),w_({class:"cm-breakpoint-gutter",markers:a=>RE(a.state),initialSpacer:()=>E1,domEventHandlers:{mousedown:(a,o)=>{let s=a.state.doc.lineAt(o.from).number;return b0(e,s),!0}}}),wt.theme({".cm-breakpoint-gutter":{width:"14px",cursor:"pointer"},".cm-breakpoint-marker":{width:"8px",height:"8px",borderRadius:"50%",backgroundColor:"var(--red-9)",margin:"4px auto"}})]}p0=class zd{static fromMilliseconds(t){return t==null?null:new zd(t)}static fromSeconds(t){return t==null?null:new zd(t*1e3)}static now(){return new zd(Date.now())}constructor(t){this.ms=t}toMilliseconds(){return this.ms}toSeconds(){return this.ms/1e3}},Ym=function(e){if(e===null)return"";let t=e,a=t/1e3;return a>=60?`${Math.floor(a/60)}m${Math.floor(a%60)}s`:a>=1?`${a.toFixed(2).toString()}s`:`${t.toFixed(0).toString()}ms`};var NE=500,DE=250,jE=(Fr=class extends P8{constructor(t){super(),this.startedAtMs=t}eq(t){return t.startedAtMs===this.startedAtMs}toDOM(){let t=document.createElement("span");t.className="cm-line-timer",t.setAttribute("aria-hidden","true");let a=()=>{let o=Date.now()-this.startedAtMs;t.textContent=o>=NE?Ym(o):""};return a(),Fr.intervals.set(t,window.setInterval(a,DE)),t}destroy(t){let a=Fr.intervals.get(t);a!==void 0&&(window.clearInterval(a),Fr.intervals.delete(t))}ignoreEvent(){return!0}},we(Fr,"intervals",new WeakMap),Fr);function L1(e,t){if(t===null||t.line<1||t.line>e.doc.lines)return En.none;let a=new Ll;try{let o=e.doc.line(t.line);a.add(o.from,o.from,En.line({class:"cm-timing-current-line"})),a.add(o.to,o.to,En.widget({widget:new jE(t.startedAtMs),side:1}))}catch(o){_e.debug("Invalid timing line",{error:o})}return a.finish()}var zE=class{constructor(e,t){this.decorations=L1(e.state,t.get()),this.unsubscribe=t.sub(a=>{this.decorations=L1(e.state,a),e.dispatch({userEvent:"marimo.timing-line-update"})})}update(e){this.decorations=this.decorations.map(e.changes)}destroy(){this.unsubscribe()}};function qE(e){return[Dr.define(t=>new zE(t,e),{decorations:t=>t.decorations}),wt.theme({".cm-timing-current-line":{backgroundColor:"color-mix(in srgb, var(--grass-4) 50%, transparent)"},".cm-line-timer":{color:"var(--grass-11)",fontSize:"0.85em",marginLeft:"1.5ch",pointerEvents:"none"}})]}function O1(e,t){if(!(t!=null&&t.length))return En.none;let a=new Ll,o=e.facet(ha),s=t.filter(c=>c.kind==="cell"&&c.cellId===o).toSorted((c,f)=>c.lineNumber-f.lineNumber);for(let c of s)try{let f=e.doc.line(c.lineNumber),d=En.line({class:"cm-error-line"});a.add(f.from,f.from,d)}catch(f){_e.debug("Invalid line number in error decoration",{error:f})}return a.finish()}function A1(e,t){if(!(t!=null&&t.length))return;let a=e.state.facet(ha),o=t.filter(f=>f.kind==="cell"&&f.cellId===a);if(o.length===0)return;let s=N8(e.state),c=[];for(let f of o)try{let d=e.state.doc.line(f.lineNumber);s.between(d.from,d.to,(m,b)=>{c.push(A8.of({from:m,to:b}))})}catch(d){_e.debug("Invalid line numbers",{error:d})}c.length>0&&e.dispatch({effects:c})}var FE=class{constructor(e,t){let a=t.get();this.decorations=O1(e.state,a),A1(e,a),this.unsubscribe=t.sub(o=>{let s=this.decorations.size;this.decorations=O1(e.state,o),A1(e,o),s!==this.decorations.size&&e.dispatch({userEvent:"marimo.error-decoration-update"})})}update(e){this.decorations=this.decorations.map(e.changes)}destroy(){this.unsubscribe()}};function BE(e){return Dr.define(t=>new FE(t,e),{decorations:t=>t.decorations})}function VE(e){return[BE(e),wt.theme({".cm-error-line":{backgroundColor:"color-mix(in srgb, var(--red-4) 40%, transparent)"},"&.cm-focused .cm-error-line.cm-activeLine":{backgroundColor:"color-mix(in srgb, var(--red-5) 40%, transparent)"}})]}function HE({cellId:e,hotkeys:t}){let a=[];return a.push(...a_({key:t.getHotkey("cell.run").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(st).onRun(),!0)}),{key:t.getHotkey("cell.runAndNewBelow").key,preventDefault:!0,stopPropagation:!0,run:o=>{let s=o.state.facet(st);return s.onRun(),e==="__scratch__"||(o.contentDOM.blur(),s.moveToNextCell({cellId:e,before:!1})),!0}},...a_({key:t.getHotkey("cell.runAndNewAbove").key,preventDefault:!0,stopPropagation:!0,run:o=>{let s=o.state.facet(st);return s.onRun(),e==="__scratch__"||(o.contentDOM.blur(),s.moveToNextCell({cellId:e,before:!0})),!0}}),{key:t.getHotkey("cell.aiCompletion").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(st).aiCellCompletion()&&o.contentDOM.focus(),!0)}),e!=="__scratch__"&&a.push({key:t.getHotkey("cell.goToDefinition").key,run:o=>Pd(o)},{key:t.getHotkey("cell.delete").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.doc.length===0&&o.state.facet(st).deleteCell(),!0)},{key:t.getHotkey("cell.moveUp").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(st).moveCell({cellId:e,before:!0}),!0)},{key:t.getHotkey("cell.moveDown").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(st).moveCell({cellId:e,before:!1}),!0)},{key:t.getHotkey("cell.moveLeft").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(st).moveCell({cellId:e,before:!0,direction:"left"}),!0)},{key:t.getHotkey("cell.moveRight").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(st).moveCell({cellId:e,before:!1,direction:"right"}),!0)},{key:"ArrowUp",run:o=>O_(o.state)?!1:o0(o)?(o.state.facet(st).moveToNextCell({cellId:e,before:!0,noCreate:!0}),!0):!1},{key:"ArrowDown",run:o=>O_(o.state)?!1:n0(o)?(o.state.facet(st).moveToNextCell({cellId:e,before:!1,noCreate:!0}),!0):!1},{key:t.getHotkey("cell.focusDown").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(st).moveToNextCell({cellId:e,before:!1,noCreate:!0}),!0)},{key:t.getHotkey("cell.focusUp").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(st).moveToNextCell({cellId:e,before:!0,noCreate:!0}),!0)},{key:t.getHotkey("cell.sendToBottom").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(st).sendToBottom({cellId:e}),!0)},{key:t.getHotkey("cell.sendToTop").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(st).sendToTop({cellId:e}),!0)},{key:t.getHotkey("cell.createAbove").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.contentDOM.blur(),o.state.facet(st).createNewCell({cellId:e,before:!0}),!0)},{key:t.getHotkey("cell.createBelow").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.contentDOM.blur(),o.state.facet(st).createNewCell({cellId:e,before:!1}),!0)},{key:t.getHotkey("cell.hideCode").key,preventDefault:!0,stopPropagation:!0,run:o=>{var c;let s=o.state.facet(st).toggleHideCode();return A_(o),s?(o.contentDOM.blur(),(c=document.getElementById(Tn.create(e)))==null||c.focus()):o.contentDOM.focus(),!0}},{key:t.getHotkey("cell.splitCell").key,preventDefault:!0,stopPropagation:!0,run:o=>{let s=o.state.facet(st);return s.splitCell({cellId:e}),s.moveToNextCell&&requestAnimationFrame(()=>{o.contentDOM.blur(),s.moveToNextCell({cellId:e,before:!1})}),!0}}),[Ju.high(fa.of(a))]}function $E(e){return[wt.updateListener.of(t=>{if(t.docChanged){let a=t.transactions.some(f=>f.effects.some(d=>d.is(Cs))),o=xr(t.view),s=t.view.state.facet(st),c=t.view.state.facet(ha);s.updateCellCode({cellId:c,code:o,formattingChange:a}),Te.get(hd).has(c)&&Te.set(Wm)}}),x3(e)]}var WE=["input","delete","undo","redo"];function UE({docChanged:e,transactions:t,predicate:a=()=>!0,hasFocus:o=!1}){return!e||!a()||t.some(s=>s.effects.some(c=>c.is(Cs)))?!1:t.some(s=>s.annotation(ni)===void 0?WE.some(c=>s.isUserEvent(c))||o:!1)}function KE({predicate:e}){return wt.updateListener.of(t=>{UE({docChanged:t.docChanged,transactions:t.transactions,predicate:e,hasFocus:t.view.hasFocus})&&t.view.state.facet(st).onRun()})}Ok=function({cellId:e,hotkeys:t,cellActions:a}){let o=ms("debugger"),s=ms("line_timing");return[st.of(a),ha.of(e),HE({cellId:e,hotkeys:t}),$E(t),VE(oc(d6(e),Te)),o?PE(e,oc(LE(e),Te)):[],s?qE(oc(IE(e),Te)):o?AE(oc(TE(e),Te)):[]]};const sc=_r.define();var QE=20;function GE(e){let{state:t,anchor:a,head:o}=e;if(o<a)return!1;let s=t.doc.lineAt(o).number,c=t.doc.lineAt(a).number,f=Math.max(c,s-QE+1),d=Math.max(a,t.doc.line(f).from),m=d>a,b=m?1:0,w=t.doc.iterRange(d,o);for(;;){let{value:x,done:S}=w.next();if(S)break;for(let E of x)if(E==="(")b++;else if(E===")"&&(b--,m?b<=0:b<0))return!1}return!0}function JE(e){return{...e,create:t=>{let{dom:a,...o}=e.create(t),s=document.createElement("div");return s.classList.add("mo-cm-tooltip"),s.append(a),{...o,dom:s}}}}Ed=ei.define({create:()=>null,update(e,t){for(let a of t.effects)if(a.is(sc))return a.value;if(!e||t.selection&&!t.docChanged)return null;if(t.docChanged){let a=t.changes.mapPos(e.pos);return GE({state:t.state,anchor:a,head:t.state.selection.main.head})?{...e,pos:a}:null}return e},provide:e=>g_.from(e)}),Pk=function(e){return e.state.field(Ed,!1)?(e.dispatch({effects:sc.of(null)}),!0):!1};const R1=async e=>{var f,d;let t=e.state.doc.sliceString(0,e.pos),a=document.activeElement,o=null;if(a!==null){let m=Tn.findElement(a);m!==null&&(o=Tn.parse(m.id))}if(o===null)return _e.error("Failed to find active cell."),null;let s=await cd.request({document:t,cellId:o});if(!s)return(f=e.view)==null||f.dispatch({effects:sc.of(null)}),null;let c=Cf.asHoverTooltip({position:e.pos,message:s,limitToType:"tooltip"});return c&&Te.set(_d,{documentation:c.html??null}),(d=e.view)==null||d.dispatch({effects:sc.of(c?JE(c):null)}),c?null:Cf.asCompletionResult(e.pos,s)};function XE(e){return t=>e.predicate(t.state)?e.completion(t):null}var YE=async e=>{let t=e.matchBefore(/:\w*$/);if(!e.explicit&&!t)return null;let a=await ZE();return{from:(t==null?void 0:t.from)??e.pos,options:a,validFor:/^[\w:]*$/}},ZE=ar(async()=>{let e=await fetch("https://unpkg.com/emojilib@3.0.11/dist/emoji-en-US.json").then(t=>{if(!t.ok)throw Error("Failed to fetch emoji list");return t.json()}).catch(()=>({}));return Object.entries(e).map(([t,a])=>({shortcode:a[0],label:a.map(o=>`:${o}`).join(" "),emoji:t,displayLabel:`${t} ${a[0].replaceAll("_"," ")}`,apply:t,type:"emoji"}))}),e4=async e=>{let t=e.matchBefore(/::[\w-:]*$/);if(!e.explicit&&!t)return null;let a=await t4();return{from:(t==null?void 0:t.from)??e.pos,options:a,validFor:/^[\w-:]*$/}},t4=ar(async()=>{let e=await fetch("https://unpkg.com/lucide-static@0.452.0/tags.json").then(a=>{if(!a.ok)throw Error("Failed to fetch Lucide icon list");return a.json()}).catch(()=>({})),t=a=>`https://cdn.jsdelivr.net/npm/lucide-static@0.452.0/icons/${a}.svg`;return Object.entries(e).map(([a,o])=>({label:`::${a}`,displayLabel:a,type:"lucide-icon",boost:10,apply:`::lucide:${a}::`,detail:o.join(", "),info:()=>{let s=document.createElement("img");return s.src=t(a),s.style.width="24px",s.style.height="24px",s}}))}),n4=e=>{let t=e.matchBefore(/\\\w*$/);return!e.explicit&&!t?null:{from:(t==null?void 0:t.from)??e.pos,options:r4(),validFor:/^[\w\\]*$/}},r4=ar(()=>[["alpha","\u03B1","Greek small letter alpha"],["beta","\u03B2","Greek small letter beta"],["gamma","\u03B3","Greek small letter gamma"],["delta","\u03B4","Greek small letter delta"],["epsilon","\u03B5","Greek small letter epsilon"],["zeta","\u03B6","Greek small letter zeta"],["eta","\u03B7","Greek small letter eta"],["theta","\u03B8","Greek small letter theta"],["iota","\u03B9","Greek small letter iota"],["kappa","\u03BA","Greek small letter kappa"],["lambda","\u03BB","Greek small letter lambda"],["mu","\u03BC","Greek small letter mu"],["nu","\u03BD","Greek small letter nu"],["xi","\u03BE","Greek small letter xi"],["omicron","\u03BF","Greek small letter omicron"],["pi","\u03C0","Greek small letter pi"],["rho","\u03C1","Greek small letter rho"],["sigma","\u03C3","Greek small letter sigma"],["tau","\u03C4","Greek small letter tau"],["upsilon","\u03C5","Greek small letter upsilon"],["phi","\u03C6","Greek small letter phi"],["chi","\u03C7","Greek small letter chi"],["psi","\u03C8","Greek small letter psi"],["omega","\u03C9","Greek small letter omega"],["Gamma","\u0393","Greek capital letter gamma"],["Delta","\u0394","Greek capital letter delta"],["Theta","\u0398","Greek capital letter theta"],["Lambda","\u039B","Greek capital letter lambda"],["Xi","\u039E","Greek capital letter xi"],["Pi","\u03A0","Greek capital letter pi"],["Sigma","\u03A3","Greek capital letter sigma"],["Phi","\u03A6","Greek capital letter phi"],["Psi","\u03A8","Greek capital letter psi"],["Omega","\u03A9","Greek capital letter omega"],["pm","\xB1","Plus-minus sign"],["mp","\u2213","Minus-plus sign"],["times","\xD7","Multiplication sign"],["div","\xF7","Division sign"],["cdot","\u22C5","Dot operator"],["ast","\u2217","Asterisk operator"],["star","\u22C6","Star operator"],["circ","\u2218","Ring operator"],["bullet","\u2022","Bullet"],["cap","\u2229","Intersection"],["cup","\u222A","Union"],["uplus","\u228E","Multiset union"],["sqcap","\u2293","Square cap"],["sqcup","\u2294","Square cup"],["vee","\u2228","Logical or"],["wedge","\u2227","Logical and"],["setminus","\u2216","Set minus"],["oplus","\u2295","Circled plus"],["ominus","\u2296","Circled minus"],["otimes","\u2297","Circled times"],["oslash","\u2298","Circled division slash"],["odot","\u2299","Circled dot operator"],["leq","\u2264","Less than or equal to"],["geq","\u2265","Greater than or equal to"],["equiv","\u2261","Identical to"],["prec","\u227A","Precedes"],["succ","\u227B","Succeeds"],["sim","\u223C","Tilde operator"],["perp","\u22A5","Up tack"],["mid","\u2223","Divides"],["parallel","\u2225","Parallel to"],["subset","\u2282","Subset of"],["supset","\u2283","Superset of"],["subseteq","\u2286","Subset of or equal to"],["supseteq","\u2287","Superset of or equal to"],["cong","\u2245","Approximately equal to"],["approx","\u2248","Almost equal to"],["neq","\u2260","Not equal to"],["ne","\u2260","Not equal to"],["propto","\u221D","Proportional to"],["leftarrow","\u2190","Leftward arrow"],["rightarrow","\u2192","Rightward arrow"],["Leftarrow","\u21D0","Leftward double arrow"],["Rightarrow","\u21D2","Rightward double arrow"],["leftrightarrow","\u2194","Left right arrow"],["Leftrightarrow","\u21D4","Left right double arrow"],["uparrow","\u2191","Upward arrow"],["downarrow","\u2193","Downward arrow"],["Uparrow","\u21D1","Upward double arrow"],["Downarrow","\u21D3","Downward double arrow"],["infty","\u221E","Infinity"],["nabla","\u2207","Nabla"],["partial","\u2202","Partial differential"],["forall","\u2200","For all"],["exists","\u2203","There exists"],["nexists","\u2204","There does not exist"],["emptyset","\u2205","Empty set"],["in","\u2208","Element of"],["notin","\u2209","Not an element of"],["sum","\u2211","N-ary summation"],["prod","\u220F","N-ary product"],["int","\u222B","Integral"],["oint","\u222E","Contour integral"],["sqrt","\u221A","Square root"],["hbar","\u210F","Planck constant over 2pi"],["ldots","\u2026","Horizontal ellipsis"],["cdots","\u22EF","Midline horizontal ellipsis"],["vdots","\u22EE","Vertical ellipsis"],["ddots","\u22F1","Down right diagonal ellipsis"]].map(([e,t,a])=>({label:`\\${e} ${a}`,displayLabel:e,type:"latex-symbol",boost:10,apply:`\\${e}`,info:()=>{let o=document.createElement("div");return o.textContent=`${t} ${a}`,o},detail:t})));const a4=[YE,e4,n4];var i4=100;function po(e){return!e.state.selection.main.empty}function Of({view:e,selection:t,markup:a}){let o=[],s=!0;for(let c=t.from;c<=t.to;c++)if(!e.state.doc.lineAt(c).text.startsWith(a)){s=!1;break}for(let c=t.from;c<=t.to;){let f=e.state.doc.lineAt(c),d=f.text.startsWith(a);s?o.push({from:f.from,to:f.from+a.length,insert:Ji.of([""])}):(d&&o.push({from:f.from,to:f.from+a.length,insert:Ji.of([""])}),o.push({from:f.from,insert:Ji.of([a])})),c=f.to+1}return o}function Af({view:e,range:t,markupAfter:a,markupBefore:o}){if(t.empty){let b=e.state.wordAt(t.head);b&&(t=b)}let s=e.state.sliceDoc(t.from-o.length,t.from)===o,c=e.state.sliceDoc(t.to,t.to+a.length)===a,f=[];f.push(s?{from:t.from-o.length,to:t.from,insert:Ji.of([""])}:{from:t.from,insert:Ji.of(o.split(`
96
- `))},c?{from:t.to,to:t.to+a.length,insert:Ji.of([""])}:{from:t.to,insert:Ji.of(a.split(`
97
- `))});let d=s?-o.length:o.length,m=c?-a.length:a.length;return{changes:f,range:$t.range(t.from+d,t.to+m)}}function o4(e){if(!po(e))return!1;let t=Of({view:e,selection:e.state.selection.main,markup:"> "});return t.length>0&&e.dispatch(e.state.update({changes:t,scrollIntoView:!0,userEvent:"input"})),e.focus(),!0}function s4(e){if(!po(e))return!1;let t=e.state.changeByRange(a=>{if(a.empty){let o=e.state.wordAt(a.head);o&&(a=o)}return Af({view:e,range:a,markupBefore:"**",markupAfter:"**"})});return e.dispatch(e.state.update(t,{scrollIntoView:!0,annotations:cs.userEvent.of("input")})),e.focus(),!0}function M1(e){if(!po(e))return!1;let t=e.state.changeByRange(a=>{if(a.empty){let s=e.state.wordAt(a.head);s&&(a=s)}let o=e.state.doc.lineAt(a.from).number!==e.state.doc.lineAt(a.to).number;return Af({view:e,range:a,markupBefore:o?"```\n":"`",markupAfter:o?"\n```":"`"})});return e.dispatch(e.state.update(t,{scrollIntoView:!0,annotations:cs.userEvent.of("input")})),e.focus(),!0}function l4(e){let t=e.state.changeByRange(a=>{if(a.empty){let o=e.state.wordAt(a.head);o&&(a=o)}return Af({view:e,range:a,markupBefore:"_",markupAfter:"_"})});return e.dispatch(e.state.update(t,{scrollIntoView:!0,annotations:cs.userEvent.of("input")})),e.focus(),!0}function P1(e,t="http://"){if(!po(e))return!1;let a=e.state.changeByRange(s=>{let c=e.state.sliceDoc(s.from,s.to);return{changes:[{from:s.from,to:s.to,insert:`[${c}](${t})`}],range:s}});e.dispatch(e.state.update(a,{scrollIntoView:!0,annotations:cs.userEvent.of("input")}));let{to:o}=a.selection.main;try{e.dispatch({selection:$t.create([$t.range(o+3,o+3+t.length),$t.cursor(o+3+t.length)])})}catch{}return e.focus(),!0}hm=async function(e,t){var d;let a=new FileReader,o=await new Promise(m=>{a.onload=()=>m(a.result),a.readAsDataURL(t)}),s;try{if(o.startsWith("data:")){let m=prompt("We can save your image as a file. Enter a filename.",t.name),b=t.type.split("/")[1];if(m===null){let w=Math.round(o.length/1024);if(w>i4){Rl({title:"Content too large",description:`The content size is ${w} KB, which is too large to paste directly into the document.`});return}}else{m.trim()===""?m=t.name:m.endsWith(`.${b}`)||(m=`${m}.${b}`);let w=Te.get(hs),x=w?j_.dirname(w):null,S=x?`${x}/public`:"public",E=await ir().sendCreateFileOrFolder({path:S,type:"file",name:m,file:t});E.success?(s=(d=E.info)==null?void 0:d.path,s&&x&&s.startsWith(x)&&(s=j_.rest(s,x).replaceAll("\\","/")),Rl({title:"Image uploaded successfully",description:`We've uploaded your image at ${s}`})):Rl({title:"Failed to upload image. Using raw base64 string."})}}}catch{Rl({title:"Failed to upload image. Using raw base64 string."})}let c=e.state.changeByRange(m=>{let b=e.state.sliceDoc(m.from,m.to);return b.trim()===""&&(b="alt"),{changes:[{from:m.from,to:m.to,insert:`![${b}](${s??o})`}],range:m}});e.dispatch(e.state.update(c,{scrollIntoView:!0,annotations:cs.userEvent.of("input")}));let{to:f}=c.selection.main;try{e.dispatch({selection:$t.create([$t.range(f+4,f+4+o.length),$t.cursor(f+4+o.length)])})}catch{}return e.focus(),!0},a0=async function(e,t){let a=await t.text(),o=e.state.changeByRange(s=>({changes:[{from:s.from,to:s.from,insert:a}],range:s}));return e.dispatch(e.state.update(o,{scrollIntoView:!0,annotations:cs.userEvent.of("input")})),e.focus(),!0};function c4(e){if(!po(e))return!1;let{changes:t}=e.state.changeByRange(a=>({range:a,changes:Of({view:e,selection:a,markup:e.state.sliceDoc(a.from,a.to+2).startsWith("* ")?"* ":"- "})}));return t.length>0&&e.dispatch(e.state.update({changes:t,scrollIntoView:!0,userEvent:"input"})),e.focus(),!0}function u4(e){if(!po(e))return!1;let{changes:t}=e.state.changeByRange(a=>({range:a,changes:Of({view:e,selection:a,markup:"1. "})}));return t.length>0&&e.dispatch(e.state.update({changes:t,scrollIntoView:!0,userEvent:"input"})),e.focus(),!0}function d4(e){return[Ju.highest(fa.of([{key:e.getHotkey("markdown.bold").key,stopPropagation:!0,run:s4},{key:e.getHotkey("markdown.italic").key,stopPropagation:!0,run:l4},{key:e.getHotkey("markdown.link").key,stopPropagation:!0,run:t=>P1(t)},{key:e.getHotkey("markdown.orderedList").key,run:u4},{key:e.getHotkey("markdown.unorderedList").key,run:c4},{key:e.getHotkey("markdown.blockquote").key,run:o4},{key:e.getHotkey("markdown.code").key,run:M1},{key:"`",run:M1}])),wt.domEventHandlers({paste:(t,a)=>{var s;if(a.state.selection.main.empty)return!1;let o=(s=t.clipboardData)==null?void 0:s.getData("text/plain");o!=null&&o.startsWith("http")&&(t.preventDefault(),P1(a,o))}}),wt.domEventHandlers({paste:(t,a)=>{var s;let o=(s=t.clipboardData)==null?void 0:s.files[0];if(!o)return!1;if(o.type.startsWith("image/"))return t.preventDefault(),hm(a,o),!0;if(o.type.startsWith("text/"))return t.preventDefault(),a0(a,o),!0}})]}function f4(e,t,a=3,o=""){return Object.values(e).flatMap(s=>t.has(s.name)?[]:{label:`${o}${s.name}`,displayLabel:s.name,detail:s.dataType??"",boost:a,type:"variable",apply:`${o}${s.name}`,section:"Variable",info:()=>Fm(s)})}Fm=function(e){let t=document.createElement("div");t.classList.add("mo-cm-tooltip","docs-documentation","min-w-[200px]","flex","flex-col","gap-1","p-2");let a=document.createElement("div");a.classList.add("flex","items-center","gap-2");let o=document.createElement("span");if(o.classList.add("font-bold","text-base"),o.textContent=e.name,a.append(o),e.dataType){let s=document.createElement("span");s.classList.add("text-xs","px-1.5","py-0.5","rounded-full","bg-purple-100","text-purple-800","dark:bg-purple-900","dark:text-purple-200"),s.textContent=e.dataType,a.append(s)}if(t.append(a),e.value){let s=document.createElement("div");s.classList.add("flex","flex-col","gap-1");let c=document.createElement("div");c.classList.add("text-xs","text-muted-foreground"),c.textContent="Value:",s.append(c);let f=document.createElement("div");f.classList.add("text-xs","font-mono","bg-muted","p-2","rounded","overflow-auto","max-h-40"),f.textContent=e.value,s.append(f),t.append(s)}return t};var ho="Python",Rf=123,N1=125,Mf=1,p4={mark:`${ho}Mark`,resolve:ho};function h4(e,t){return{defineNodes:[{name:ho,style:Gu.emphasis},{name:`${ho}Mark`,style:Gu.processingInstruction}],parseInline:[{name:ho,parse(a,o,s){return!t()||o!==Rf&&o!==N1||o===Rf&&a.slice(s-1,s)==="{"?-1:a.addDelimiter(p4,s,s+Mf,o===Rf,o===N1)}}],wrap:k_(a=>{if(!t()||a.type.name!==ho)return null;let o=a.from+Mf,s=a.to-Mf;return o>=s||o<0||s<0?null:{parser:e,overlay:[{from:o,to:s}],extensions:[D_().support]}})}}const m4=e=>{let t=e.state.doc.sliceString(0,e.pos),a=t.lastIndexOf("{");if(t.at(a-1)==="{"||a===-1||t.indexOf("}",a)>a)return null;let o=e.matchBefore(/\w*$/);if(!o)return null;let s=f4(Te.get(ti),new Set,99);return{from:o.from,options:s,validFor:/^\w*$/}};var lc="InlineMathDollar",mo="InlineMathBracket",cc="BlockMathDollar",go="BlockMathBracket",pi={[lc]:1,[mo]:3,[cc]:2,[go]:3},pt={DOLLAR:36,BACKSLASH:92,OPEN_PAREN:40,CLOSE_PAREN:41,OPEN_BRACKET:91,CLOSE_BRACKET:93},yo=Object.keys(pi).reduce((e,t)=>(e[t]={mark:`${t}Mark`,resolve:t},e),{});function g4(e){let t=[];return Object.keys(pi).forEach(a=>{t.push({name:a,style:Gu.emphasis},{name:`${a}Mark`,style:Gu.processingInstruction})}),{defineNodes:t,parseInline:[{name:cc,parse(a,o,s){return o!==pt.DOLLAR||a.char(s+1)!==pt.DOLLAR?-1:a.addDelimiter(yo[cc],s,s+pi[cc],!0,!0)}},{name:lc,parse(a,o,s){return o!==pt.DOLLAR||a.char(s+1)===pt.DOLLAR?-1:a.addDelimiter(yo[lc],s,s+pi[lc],!0,!0)}},{name:mo,before:"Escape",parse(a,o,s){return o!==pt.BACKSLASH||a.char(s+1)!==pt.BACKSLASH||![pt.OPEN_PAREN,pt.CLOSE_PAREN].includes(a.char(s+2))?-1:a.addDelimiter(yo[mo],s,s+pi[mo],a.char(s+2)===pt.OPEN_PAREN,a.char(s+2)===pt.CLOSE_PAREN)}},{name:go,before:"Escape",parse(a,o,s){return o!==pt.BACKSLASH||a.char(s+1)!==pt.BACKSLASH||![pt.OPEN_BRACKET,pt.CLOSE_BRACKET].includes(a.char(s+2))?-1:a.addDelimiter(yo[go],s,s+pi[go],a.char(s+2)===pt.OPEN_BRACKET,a.char(s+2)===pt.CLOSE_BRACKET)}},{name:mo,before:"Escape",parse(a,o,s){return o!==pt.BACKSLASH||![pt.OPEN_PAREN,pt.CLOSE_PAREN].includes(a.char(s+1))?-1:a.addDelimiter(yo[mo],s,s+2,a.char(s+1)===pt.OPEN_PAREN,a.char(s+1)===pt.CLOSE_PAREN)}},{name:go,before:"Escape",parse(a,o,s){return o!==pt.BACKSLASH||![pt.OPEN_BRACKET,pt.CLOSE_BRACKET].includes(a.char(s+1))?-1:a.addDelimiter(yo[go],s,s+2,a.char(s+1)===pt.OPEN_BRACKET,a.char(s+1)===pt.CLOSE_BRACKET)}}],wrap:k_(a=>{let o=pi[a.type.name];if(o){let s=a.from+o,c=a.to-o;return s>=c||s<0||c<0?null:{parser:e,overlay:[{from:s,to:c}]}}return null})}}pd=_r.define(),md=_r.define(),jr=ei.define({create:()=>({}),update:(e,t)=>{for(let a of t.effects){if(a.is(pd))return a.value;if(a.is(md))return{...e,...a.value}}return e}}),Ik=!0,ad=class{constructor(){we(this,"parser",new Td);we(this,"type","markdown");we(this,"defaultCode",this.parser.defaultCode);we(this,"defaultMetadata",this.parser.defaultMetadata)}static fromMarkdown(e){return Td.fromMarkdown(e)}transformIn(e){let t=this.parser.transformIn(e);return[t.code,t.offset,t.metadata]}transformOut(e,t){let a=this.parser.transformOut(e,t);return[a.code,a.offset]}isSupported(e){return this.parser.isSupported(e)}getExtension(e,t,a,o){let s=P_().language.data,c,f=()=>{var m;if(!c)return!0;let d=c==null?void 0:c.state.field(jr);return d===void 0?!1:((m=d.quotePrefix)==null?void 0:m.includes("f"))??!1};return[Dr.define(d=>(c=d,{})),P_({base:LL,codeLanguages:WS,extensions:[g4(x_.define(RL).parser),h4(dm.parser,f)]}),d4(a),a4.map(d=>s.of({autocomplete:d})),D_().language.data.of({autocomplete:XE({completion:R1,predicate:f})}),Xu({defaultKeymap:!1,activateOnTyping:!0}),KE({predicate:()=>!f()})]}};function uc(){var e;return((e=Te.get(ql))==null?void 0:e.rootUri)??"file:///"}function dc(){var t;let e=(t=Te.get(ql))==null?void 0:t.rootUri;return e?[{uri:e,name:"marimo"}]:[]}function D1(){var e;return((e=Te.get(ql))==null?void 0:e.documentUri)??"file:///__marimo_notebook__.py"}function y4(e){return Pr.filter(e,t=>t!==!1&&t!==null)}function j1(e){let t=e.map(y4);return Object.assign({},...t)}var v4=class{constructor(e){we(this,"clients",[]);this.clients=e,this.documentUri=D1()}onNotification(e){let t=[];for(let a of this.clients)t.push(a.onNotification(e));return()=>{for(let a of t)a();return!0}}get clientCapabilities(){return j1(this.clients.map(e=>{if(e.clientCapabilities)return typeof e.clientCapabilities=="function"?e.clientCapabilities({}):e.clientCapabilities}).filter(e=>e!=null))}get ready(){return this.clients.some(e=>e.ready)}set ready(e){this.clients.forEach(t=>{t.ready=e})}get capabilities(){return j1(this.clients.map(e=>e.capabilities).filter(e=>e!==null))}set capabilities(e){this.clients.forEach(t=>{t.capabilities=e})}get initializePromise(){return this.clients[0].initializePromise}set initializePromise(e){this.clients.forEach(t=>{t.initializePromise=e})}firstWithCapability(e){return this.clients.find(t=>{var a;return(a=t.capabilities)==null?void 0:a[e]})}clientsWithCapability(e){return this.clients.filter(t=>{var a;return(a=t.capabilities)==null?void 0:a[e]})}async initialize(){await Promise.all(this.clients.map(e=>e.initialize()))}async close(){await Promise.all(this.clients.map(e=>e.close()))}async textDocumentDidChange(e){return await Promise.all(this.clients.map(t=>t.textDocumentDidChange(e))),e}async completionItemResolve(e){let t=this.firstWithCapability("completionProvider");return t?t.completionItemResolve(e):e}async textDocumentCodeAction(e){let t=this.firstWithCapability("codeActionProvider");return t?t.textDocumentCodeAction(e):null}async textDocumentRename(e){let t=this.firstWithCapability("renameProvider");return t?t.textDocumentRename(e):null}async textDocumentPrepareRename(e){let t=this.firstWithCapability("renameProvider");return t?t.textDocumentPrepareRename(e):null}async textDocumentSignatureHelp(e){let t=this.firstWithCapability("signatureHelpProvider");return t?t.textDocumentSignatureHelp(e):null}async textDocumentCompletion(e){let t=this.clientsWithCapability("completionProvider");return b4(await Promise.allSettled(t.map(a=>a.textDocumentCompletion(e))))}async textDocumentDefinition(e){let t=this.firstWithCapability("definitionProvider");return t?t.textDocumentDefinition(e):null}async textDocumentDidOpen(e){return await Promise.all(this.clients.map(t=>t.textDocumentDidOpen(e))),e}async textDocumentHover(e){var t;for(let a of this.clients){if(!((t=a.capabilities)!=null&&t.hoverProvider))continue;let o=await a.textDocumentHover(e);if(o)return o}return{contents:[]}}};function b4(e){let t=[],a=!1;for(let o of e)if(o.status==="fulfilled"){let s=o.value;if(s==null)continue;Array.isArray(s)&&t.push(...s),"items"in s&&(t.push(...s.items),a||(a=s.isIncomplete))}return{items:t,isIncomplete:a}}function w4(e){let t=N_.parse(e),a="";return q8(e,t,I8,(o,s)=>{let c=o.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");a+=s?`<span class="${s}">${c}</span>`:c},()=>{a+=`
98
- `}),a}function _4(){let e=new Yu.Renderer,t=e.code.bind(e);return e.code=a=>{let{text:o,lang:s}=a;return o.trim()?s==="python"||s==="py"?`<pre><code class="language-python">${w4(o)}</code></pre>
99
- `:t(a):""},a=>Yu(a,{async:!1,gfm:!0,breaks:!0,renderer:e})}cx=function(e){return[...x4(e),e].join(`
100
- `)};function x4(e){return v0().map(t=>{let a=xr(t);return a===e?null:a}).filter(Boolean).toSorted((t,a)=>t.startsWith("import")&&!a.startsWith("import")?-1:!t.startsWith("import")&&a.startsWith("import")?1:0)}var k4=Ee(e=>{let t=e(Xe);return Pr.fromEntries(t.cellIds.inOrderIds.map(a=>{var s;let o=t.cellHandles[a];return[a,(s=o==null?void 0:o.current)!=null&&s.editorView?xr(o.current.editorView):""]}))}),C4=Ee(e=>e(Xe).cellIds.inOrderIds),S4=Ee(e=>T4(e(C4),e(ti)));const E4=Ee(e=>({cellIds:e(S4),codes:e(k4)}));function T4(e,t){var m,b;let a=new Map;e.forEach(w=>a.set(w,[]));let o=new Set(e),s=new Set(e);for(let{declaredBy:w,usedBy:x}of Object.values(t))for(let S of w){o.delete(S);for(let E of x)s.delete(E),E!==S&&((m=a.get(S))==null||m.push(E))}let c=new Map;e.forEach(w=>c.set(w,0)),a.forEach(w=>{w.forEach(x=>{c.set(x,(c.get(x)||0)+1)})});let f=[];c.forEach((w,x)=>{w===0&&f.push(x)});let d=[];for(;f.length>0;){let w=f.shift();if(!w)break;d.push(w),(b=a.get(w))==null||b.forEach(x=>{c.set(x,(c.get(x)||0)-1),c.get(x)===0&&f.push(x)})}return[...d.filter(w=>!o.has(w)),...o]}function I4(e,t){let a=new Map,o=0;e.forEach(f=>{a.set(f,o),o+=t[f].split(`
101
- `).length});function s(f){return a.has(f)||_e.warn("[lsp] no cell line offsets for",f),a.get(f)??0}let c=e.map(f=>t[f]).join(`
102
- `);return{cellIds:e,mergedText:c,transformRange:(f,d)=>z1(f,s(d)),reverseRange:(f,d)=>z1(f,-s(d)),isInRange:(f,d)=>{let m=t[d].split(`
103
- `).length,b=a.get(d)||0,w=f.start.line-b,x=f.end.line-b,S=w>=0&&w<m,E=x>=0&&x<m;return S&&!E&&_e.warn("[lsp] Cross-cell diagnostic detected: range starts in cell but ends outside",{cellId:d,range:f,cellLines:m,offset:b}),S&&E},getEditsForNewText:f=>{let d=f.split(`
104
- `),m=c.split(`
105
- `);if(d.length!==m.length)throw _e.warn("[lsp] cannot apply rename with new lines",d,m),Error("Cannot apply rename when there are new lines");let b=[];for(let[w,x]of Pr.entries(t)){if(!a.has(w))continue;let S=a.get(w)??0,E=x.split(`
106
- `).length,T=d.slice(S,S+E);b.push({cellId:w,text:T.join(`
107
- `)})}return b},transformPosition:(f,d)=>fc(f,s(d)),reversePosition:(f,d)=>fc(f,-s(d))}}function z1(e,t){return{start:fc(e.start,t),end:fc(e.end,t)}}function fc(e,t){return{line:e.line+t,character:e.character}}var L4=new RegExp("(?<!`):math:`([^\\n`]+)`","g"),O4=/:math:\s*<code>(.+?)<\/code>/gs,A4=/\\\[(.+?)\\]/gs,R4=/\\\((.+?)\\\)/gs,M4=new RegExp("(?<!\\\\)\\$\\$(.+?)(?<!\\\\)\\$\\$","gs"),P4=new RegExp("(?<![$\\\\])\\$(?!\\$)([^\\n$]+?)(?<!\\\\)\\$(?!\\$)","g");function Is(e){return B1(e)?D4(e).map(t=>t.isFenced?t.text:j4(t.text.replaceAll(L4,(a,o)=>pc(o)).replaceAll(O4,(a,o)=>pc(o))).map(a=>a.isInlineCode?a.text:z4(a.text)).join("")).join(""):e}function q1(e){return e==null?e:Array.isArray(e)?e.map(t=>F1(t)):typeof e=="string"?Is(e):N4(e)?e.kind==="markdown"?{...e,value:Is(e.value)}:B1(e.value)?{kind:"markdown",value:Is(e.value)}:e:F1(e)}function F1(e){return typeof e=="string"?Is(e):e.language!=="markdown"&&e.language!=="md"?e:{...e,value:Is(e.value)}}function N4(e){return typeof e=="object"&&"kind"in e&&"value"in e}function B1(e){return e.includes(".. math::")||e.includes(":math:`")||/\\\[[\S\s]+?\\]/.test(e)||/\\\([\S\s]+?\\\)/.test(e)||new RegExp("(?<!\\\\)\\$\\$[\\S\\s]+?(?<!\\\\)\\$\\$").test(e)||new RegExp("(?<![$\\\\])\\$(?!\\$)[^\\n$]+?(?<!\\\\)\\$(?!\\$)").test(e)||/:math:\s*<code>[\S\s]+?<\/code>/.test(e)}function D4(e){let t=e.split(`
108
- `),a=[],o=[],s=!1,c="",f=0,d=m=>{o.length!==0&&(a.push({text:o.join(`
109
- `),isFenced:m}),o=[])};for(let m of t){let b=m.match(/^[\t ]*(`{3,}|~{3,})/);if(b){let w=b[1],x=w[0],S=w.length;if(!s){d(!1),s=!0,c=x,f=S,o.push(m);continue}if(x===c&&S>=f){o.push(m),d(!0),s=!1,c="",f=0;continue}}o.push(m)}return d(s),a}function j4(e){let t=[],a="",o=!1,s="",c=0;for(;c<e.length;){if(e[c]==="`"){let f=c;for(;f<e.length&&e[f]==="`";)f+=1;let d=e.slice(c,f);if(o&&d===s){a+=d,t.push({text:a,isInlineCode:!0}),a="",o=!1,s="",c=f;continue}if(!o){a&&(a=(t.push({text:a,isInlineCode:!1}),"")),o=!0,s=d,a+=d,c=f;continue}}a+=e[c],c+=1}return a&&t.push({text:a,isInlineCode:o}),t}function z4(e){let t=q4(e);return t=t.replaceAll(A4,(a,o)=>Pf(o)),t=t.replaceAll(R4,(a,o)=>pc(o)),t=t.replaceAll(M4,(a,o)=>Pf(o)),t=t.replaceAll(P4,(a,o)=>pc(o)),t}function vo(e){var t;return((t=e.match(/^[\t ]*/))==null?void 0:t[0].replaceAll(" "," ").length)??0}function q4(e){var s;let t=e.split(`
110
- `);if(t.length===0)return e;let a=[],o=0;for(;o<t.length;){let c=t[o],f=c.match(/^[\t ]*\.\.\s+math::(.*)$/);if(!f){a.push(c),o+=1;continue}let d=((s=f[1])==null?void 0:s.trim())??"",m=vo(c);o+=1;let b=[],w=d.includes("\\begin");if(d)b.push(d);else{for(;o<t.length;){let T=t[o];if(!T.trim()){o+=1;continue}if(!(vo(T)>m&&T.trim().startsWith(":")))break;o+=1}if(o<t.length){let T=t[o];w=!!T.trim()&&vo(T)<=m&&T.trimStart().startsWith("\\")}}if(w)for(;o<t.length&&t[o].trim();)b.push(t[o]),o+=1;else for(;o<t.length;){let T=t[o];if(!T.trim()){b.push(""),o+=1;continue}if(vo(T)<=m)break;b.push(T),o+=1}let x=b.filter(T=>!!T.trim());if(x.length===0){a.push(c);continue}let S=Math.min(...x.map(T=>vo(T))),E=b.map(T=>{if(!T)return"";let M=Math.min(S,vo(T));return T.slice(M)}).join(`
111
- `).trim();a.push(Pf(E))}return a.join(`
112
- `)}function pc(e){return`<marimo-tex class="arithmatex">||(${e.trim()}||)</marimo-tex>`}function Pf(e){return`<marimo-tex class="arithmatex">||[${e.trim()}||]</marimo-tex>`}const un={PREFIX:"file:///",of(e){return`${this.PREFIX}${e}`},is(e){return e.startsWith(this.PREFIX)},parse(e){return an(this.is(e),`Invalid cell document URI: ${e}`),e.slice(this.PREFIX.length)}};function V1(e){return"notify"in e}function F4(e){return e.startsWith("_")&&!e.startsWith("__")}var B4=class{constructor(e){we(this,"documentVersion",0);we(this,"lastSnapshot",null);this.getNotebookCode=e}snapshot(){var a;let e=this.getLens(),t=((a=this.lastSnapshot)==null?void 0:a.mergedText)!==e.mergedText;return t?(this.documentVersion++,this.lastSnapshot=e,{lens:e,didChange:t,version:this.documentVersion}):{lens:e,didChange:t,version:this.documentVersion}}getLatestSnapshot(){if(!this.lastSnapshot)throw Error("No snapshots");return{lens:this.lastSnapshot,version:this.documentVersion}}getLens(){let{cellIds:e,codes:t}=this.getNotebookCode();return I4(e,t)}},V4=()=>{let e=Cd().cellHandles;return Pr.mapValues(e,t=>{var a;return(a=t.current)==null?void 0:a.editorViewOrNull})};function Nf(e){let t=q1(e);return Array.isArray(t)?e:t}function Df(e){return{...e,documentation:Nf(e.documentation)}}function H4(e){return e==null?null:Array.isArray(e)?e.map(t=>Df(t)):{...e,items:e.items.map(t=>Df(t))}}function $4(e){return{...e,signatures:e.signatures.map(t=>{var a;return{...t,documentation:Nf(t.documentation),parameters:(a=t.parameters)==null?void 0:a.map(o=>({...o,documentation:Nf(o.documentation)}))}})}}var hc=(fr=class{constructor(t,a,o=V4){we(this,"completionItemCache",new nc(10));we(this,"latestDiagnosticsVersion",null);we(this,"forwardedDiagnosticsVersion",0);this.documentUri=D1(),this.getNotebookEditors=o,this.initialSettings=a,this.client=t,this.patchProcessNotification(),this.initializePromise.then(()=>{an(V1(this.client),"notify is not a method on the client"),this.client.notify("workspace/didChangeConfiguration",{settings:a})}),this.snapshotter=new B4(this.getNotebookCode.bind(this))}static pruneSeenCellUris(t){for(let a of fr.SEEN_CELL_DOCUMENT_URIS){let o=un.parse(a);t.has(o)||fr.SEEN_CELL_DOCUMENT_URIS.delete(a)}}onNotification(t){return this.client.onNotification(t)}get ready(){return this.client.ready}set ready(t){this.client.ready=t}get capabilities(){return this.client.capabilities}set capabilities(t){this.client.capabilities=t}get initializePromise(){return this.client.initializePromise}set initializePromise(t){this.client.initializePromise=t}get clientCapabilities(){return this.client.clientCapabilities}async initialize(){await this.client.initialize()}close(){this.client.close()}async resyncAllDocuments(){an(V1(this.client),"notify is not a method on the client"),await this.client.initialize(),this.client.notify("workspace/didChangeConfiguration",{settings:this.initialSettings});let{lens:t,version:a}=this.snapshotter.snapshot();this.latestDiagnosticsVersion=null,this.forwardedDiagnosticsVersion=0,await this.client.textDocumentDidOpen({textDocument:{languageId:"python",text:t.mergedText,uri:this.documentUri,version:a}}),_e.log("[lsp] Document re-synchronization complete")}getNotebookCode(){return Te.get(E4)}assertCellDocumentUri(t){an(un.is(t),"Execpted URI to be CellDocumentUri")}async textDocumentDidOpen(t){_e.debug("[lsp] textDocumentDidOpen",t);let a=t.textDocument.uri;this.assertCellDocumentUri(a);let{lens:o,version:s}=this.snapshotter.snapshot();fr.SEEN_CELL_DOCUMENT_URIS.add(a);let c=await this.client.textDocumentDidOpen({textDocument:{languageId:t.textDocument.languageId,text:o.mergedText,uri:this.documentUri,version:s}});return c?{...c,textDocument:{...c.textDocument,text:o.mergedText}}:t}async sync(){let{lens:t,version:a,didChange:o}=this.snapshotter.snapshot(),s={textDocument:{uri:this.documentUri,version:a},contentChanges:[{text:t.mergedText}]};return o&&await this.client.textDocumentDidChange(s),{params:s,lens:t}}async textDocumentDidChange(t){if(_e.debug("[lsp] textDocumentDidChange",t),t.contentChanges.length===1){let{params:a}=await this.sync();return a}return _e.warn("[lsp] Unhandled textDocumentDidChange",t),this.client.textDocumentDidChange(t)}async textDocumentDefinition(t){let a=t.textDocument.uri;if(!un.is(a))return _e.warn("Invalid cell document URI",a),null;let{lens:o}=await this.sync(),s=un.parse(a);return this.client.textDocumentDefinition({...t,textDocument:{uri:this.documentUri},position:o.transformPosition(t.position,s)})}async textDocumentSignatureHelp(t){let a=t.textDocument.uri;if(!un.is(a))return _e.warn("Invalid cell document URI",a),null;let{lens:o}=await this.sync(),s=un.parse(a),c=await this.client.textDocumentSignatureHelp({...t,textDocument:{uri:this.documentUri},position:o.transformPosition(t.position,s)});return c?$4(c):null}textDocumentCodeAction(t){return Promise.resolve(null)}async textDocumentRename(t){var z;let a=t.textDocument.uri;if(!un.is(a))return _e.warn("Invalid cell document URI",a),null;let o=un.parse(a),{lens:s}=await this.sync(),c=s.transformPosition(t.position,o),f=await this.client.textDocumentRename({...t,textDocument:{uri:this.documentUri},position:c});if(!f)return null;let d=(z=f.documentChanges)==null?void 0:z.flatMap(B=>"edits"in B?B.edits:[]);if(!d||d.length!==1)return _e.warn("Expected exactly one edit",d),f;let m=d[0];if(!("newText"in m))return _e.warn("Expected newText in edit",m),f;let b=s.getEditsForNewText(m.newText),w=new Map(b.map(B=>[B.cellId,B.text])),x=this.getNotebookEditors(),S=x[o],E=!1;if(S){let B=S.state.doc.line(t.position.line+1).from+t.position.character,{startToken:V,endToken:N}=Sf(S.state.doc,B),X=S.state.doc.sliceString(V,N);E=F4(X),E&&_e.debug("[lsp] Private variable rename detected, limiting to current cell",X)}let T=[],M=0;for(let[B,V]of Pr.entries(x)){if(E&&B!==o)continue;let N=w.get(B);if(N==null){_e.warn("[lsp] No new code for cell during rename",B),T.push(B);continue}if(!V){_e.warn("[lsp] No editor view for cell during rename",B),T.push(B);continue}xr(V)!==N&&(Yi(V,N),M++)}return T.length>0&&_e.error(`[lsp] Rename partially failed: could not update ${T.length} cell(s)`,T),_e.debug(`[lsp] Rename completed: updated ${M} cell(s)`),{...f,documentChanges:[{edits:[],textDocument:{uri:a,version:0}}]}}async completionItemResolve(t){let a=JSON.stringify(t),o=this.completionItemCache.get(a);if(o)return o;let s=this.client.completionItemResolve(t).then(c=>Df(c));return this.completionItemCache.set(a,s),s}async textDocumentPrepareRename(t){let a=t.textDocument.uri;if(!un.is(a))return _e.warn("Invalid cell document URI",a),null;let{lens:o}=await this.sync(),s=un.parse(a);return this.client.textDocumentPrepareRename({...t,textDocument:{uri:this.documentUri},position:o.transformPosition(t.position,s)})}async textDocumentHover(t){_e.debug("[lsp] textDocumentHover",t);let{lens:a}=await this.sync(),o=un.parse(t.textDocument.uri),s=await this.client.textDocumentHover({...t,textDocument:{uri:this.documentUri},position:a.transformPosition(t.position,o)});return s?(typeof s.contents=="object"&&"kind"in s.contents&&(s.contents={kind:"markdown",value:s.contents.value}),s.contents=q1(s.contents)??s.contents,s.contents===""?null:(s.range&&(s.range=a.reverseRange(s.range,o)),s)):(_e.debug("[lsp] no hover result"),s)}async textDocumentCompletion(t){let{lens:a}=this.snapshotter.getLatestSnapshot();if(!un.is(t.textDocument.uri))return _e.error("[lsp] Invalid cell document URI in completion request",t.textDocument.uri),null;let o=un.parse(t.textDocument.uri);if(!o||o==="undefined")return _e.error("[lsp] Invalid cellId 'undefined' in completion request",{cellId:o,uri:t.textDocument.uri,availableCellIds:a.cellIds}),null;a.cellIds.includes(o)||_e.warn("[lsp] CellId in completion request not found in current lens",{cellId:o,uri:t.textDocument.uri,availableCellIds:a.cellIds});let s=a.transformPosition(t.position,o);return H4(await this.client.textDocumentCompletion({...t,textDocument:{uri:this.documentUri},position:s}))}patchProcessNotification(){an("processNotification"in this.client,"processNotification is not a method on the client");let t=this.client.processNotification.bind(this.client),a=o=>{if(o.method==="textDocument/publishDiagnostics"){let s=o.params.version;if(s!=null){let S=this.latestDiagnosticsVersion;if(S!==null&&Number.isFinite(s)&&s<S){_e.debug("[lsp] dropping stale diagnostics notification",o);return}this.latestDiagnosticsVersion=s}_e.debug("[lsp] handling diagnostics",o);let c=this.snapshotter.getLatestSnapshot(),f=o.params.diagnostics,{lens:d}=c,m=++this.forwardedDiagnosticsVersion,b=new Map;for(let S of f)for(let E of d.cellIds)if(d.isInRange(S.range,E)){b.has(E)||b.set(E,[]);let T={...S,range:d.reverseRange(S.range,E)};b.get(E).push(T);break}let w=new Set(d.cellIds);fr.pruneSeenCellUris(w);let x=new Set(fr.SEEN_CELL_DOCUMENT_URIS);for(let[S,E]of b.entries()){_e.debug("[lsp] diagnostics for cell",S,E);let T=un.of(S);x.delete(T),t({...o,params:{...o.params,uri:T,version:m,diagnostics:E}})}if(x.size>0){_e.debug("[lsp] clearing diagnostics",x);for(let S of x)t({method:"textDocument/publishDiagnostics",params:{uri:S,version:m,diagnostics:[]}})}return}return t(o)};this.client.processNotification=a}},we(fr,"SEEN_CELL_DOCUMENT_URIS",new Set),fr),W4=Pl(),U4=ai(),K4=class extends U4.Transport{constructor(t){super();we(this,"isClosed",!1);we(this,"hasConnectedBefore",!1);we(this,"pendingSubscriptions",[]);this.options=t,this.delegate=void 0}createDelegate(){if(this.delegate)try{this.delegate.close()}catch(t){_e.warn("Error closing old WebSocket delegate",t)}this.delegate=new W4.WebSocketTransport(this.options.getWsUrl());for(let{event:t,handler:a}of this.pendingSubscriptions)this.delegate.subscribe(t,a);return this.delegate}isDelegateClosedOrClosing(){if(!this.delegate)return!0;let t=this.delegate.connection;return t?t.readyState===WebSocket.CLOSING||t.readyState===WebSocket.CLOSED:!0}async connect(){if(this.isClosed)throw Error("Transport is closed");return this.connectionPromise||(this.connectionPromise=(async()=>{try{this.options.waitForConnection&&await this.options.waitForConnection();let t=this.delegate;(!t||this.isDelegateClosedOrClosing())&&(t=this.createDelegate()),await t.connect(),_e.log("WebSocket transport connected successfully");let a=this.hasConnectedBefore;this.hasConnectedBefore=!0,a&&this.options.onReconnect&&(_e.log("Calling onReconnect callback to re-synchronize state"),await this.options.onReconnect())}catch(t){throw _e.error("WebSocket transport connection failed",t),this.delegate=void 0,t}finally{this.connectionPromise=void 0}})()),this.connectionPromise}close(){var t;this.isClosed=!0,(t=this.delegate)==null||t.close(),this.delegate=void 0,this.connectionPromise=void 0}subscribe(...t){super.subscribe(...t);let[a,o]=t;this.pendingSubscriptions.push({event:a,handler:o}),this.delegate&&this.delegate.subscribe(a,o)}unsubscribe(...t){let a=super.unsubscribe(...t),[o,s]=t;return this.pendingSubscriptions=this.pendingSubscriptions.filter(c=>!(c.event===o&&c.handler===s)),this.delegate&&this.delegate.unsubscribe(o,s),a}async sendData(t,a){var o;if(this.isDelegateClosedOrClosing()){_e.warn("WebSocket is closed or closing, attempting to reconnect");try{await this.connect()}catch(s){throw _e.error("Failed to reconnect WebSocket",s),s}}return(o=this.delegate)==null?void 0:o.sendData(t,a)}};function mc(e,t){let a=s8();return new K4({getWsUrl:()=>a.getLSPURL(e).toString(),waitForConnection:async()=>{await o8()},onReconnect:t})}_r.define(),new Qu;function Q4(e){return e.facet(R8.readOnly)}function G4(e){return[C_(e),fa.of([{key:"ArrowRight",preventDefault:!0,run:t=>H1(t,e)},{key:"Tab",preventDefault:!0,run:t=>H1(t,e)}])]}function H1(e,t){if(Q4(e.state))return!1;let a=e.state.doc.length;return a===0?(e.dispatch({changes:{from:0,to:a,insert:t},selection:{head:t.length,anchor:t.length}}),!0):!1}function J4(e){let{beforeText:t,linkText:a,afterText:o,onClick:s}=e;return[C_(c=>{let f=document.createElement("span");f.append(document.createTextNode(t));let d=document.createElement("span");return d.textContent=a,d.classList.add("cm-clickable-placeholder"),d.onclick=m=>{m.stopPropagation(),s(c)},f.append(d),f.append(document.createTextNode(o)),f}),wt.theme({".cm-placeholder":{color:"var(--slate-8)"},".cm-clickable-placeholder":{cursor:"pointer !important",pointerEvents:"auto",color:"var(--slate-9)",textDecoration:"underline",textUnderlineOffset:"0.2em"},".cm-clickable-placeholder:hover":{color:"var(--sky-11)"}})]}var X4=ar(e=>{let t,a={transport:mc("pylsp",async()=>{await(t==null?void 0:t())}),rootUri:uc(),workspaceFolders:dc()},o=e==null?void 0:e.pylsp,s=["D100","D103"],c=["W292","E402","E302","E305"],f=["B018","I001"],d={pylsp:{plugins:{marimo_plugin:{enabled:!0},jedi:{auto_import_modules:["numpy"]},jedi_completion:{include_params:!0,resolve_at_most:50},flake8:{enabled:o==null?void 0:o.enable_flake8,extendIgnore:c},pydocstyle:{enabled:o==null?void 0:o.enable_pydocstyle,ignore:s},pylint:{enabled:o==null?void 0:o.enable_pylint},pyflakes:{enabled:o==null?void 0:o.enable_pyflakes},pylsp_mypy:{enabled:o==null?void 0:o.enable_mypy,live_mode:!0},ruff:{enabled:o==null?void 0:o.enable_ruff,extendIgnore:[...c,...s,...f]},signature:{formatter:o!=null&&o.enable_ruff?"ruff":"black",line_length:88}}}},m=new hc(new ps({...a}),d);return t=()=>m.resyncAllDocuments(),m}),Y4=ar(e=>{let t,a=new hc(new ps({transport:mc("ty",async()=>{await(t==null?void 0:t())}),rootUri:uc(),workspaceFolders:dc(),getWorkspaceConfiguration:o=>[{disableLanguageServices:!0}]}),{});return t=()=>a.resyncAllDocuments(),a}),Z4=ar(e=>{var o;let t,a=new hc(new ps({transport:mc("pyrefly",async()=>{await(t==null?void 0:t())}),rootUri:uc(),workspaceFolders:dc(),initializationOptions:{pyrefly:{displayTypeErrors:((o=e.diagnostics)==null?void 0:o.enabled)??!1?"force-on":"force-off"}}}),{});return t=()=>a.resyncAllDocuments(),a}),eT=ar(e=>{let t,a=new hc(new ps({transport:mc("basedpyright",async()=>{await(t==null?void 0:t())}),rootUri:uc(),workspaceFolders:dc()}),{});return t=()=>a.resyncAllDocuments(),a}),tT=class{constructor(){we(this,"parser",new Ky);we(this,"type","python");we(this,"defaultCode",this.parser.defaultCode);we(this,"defaultMetadata",this.parser.defaultMetadata)}transformIn(e){let t=this.parser.transformIn(e);return[t.code,t.offset,t.metadata]}transformOut(e,t){let a=this.parser.transformOut(e,t);return[a.code,a.offset]}isSupported(e){return this.parser.isSupported(e)}getExtension(e,t,a,o,s){return[(()=>{var w,x,S,E,T;let c={defaultKeymap:!1,activateOnTyping:t.activate_on_typing,closeOnBlur:!1},f={hideOnChange:!0},d=[];(w=s==null?void 0:s.pylsp)!=null&&w.enabled&&ka("pylsp")&&d.push(X4(s)),(x=s==null?void 0:s.ty)!=null&&x.enabled&&ka("ty")&&d.push(Y4(s)),(S=s==null?void 0:s.pyrefly)!=null&&S.enabled&&ka("pyrefly")&&d.push(Z4(s)),(E=s==null?void 0:s.basedpyright)!=null&&E.enabled&&ka("basedpyright")&&d.push(eT(s));let m=t.signature_hint_on_typing,b=m?/(\w+|\w+\.|\/)$/:/(\w+|\w+\.|\(|\/|,)$/;if(d.length>0){let M=d.length===1?d[0]:new v4(d);return[vm({client:M,languageId:"python",allowHTMLContent:!0,markdownRenderer:_4(),useSnippetOnCompletion:!0,hoverConfig:f,completionConfig:c,diagnosticsEnabled:((T=s.diagnostics)==null?void 0:T.enabled)??!1,sendIncrementalChanges:!1,signatureHelpEnabled:!0,signatureActivateOnTyping:m,signatureHelpOptions:{position:"above"},keyboardShortcuts:{signatureHelp:a.getHotkey("cell.signatureHelp").key,goToDefinition:a.getHotkey("cell.goToDefinition").key,rename:a.getHotkey("cell.renameSymbol").key},completionMatchBefore:b,onGoToDefinition:z=>{_e.debug("onGoToDefinition",z),M.documentUri!==z.uri&&ir().openFile({path:z.uri.replace("file://","")})}}),uy.of(un.of(e))]}return[Xu({...c,override:[R1]}),Ed]})(),Em(),nT(o)]}};function nT(e){return e==="marimo-import"?Ju.highest(G4("import marimo as mo")):e==="ai"?J4({beforeText:"Start coding or ",linkText:"generate",afterText:" with AI.",onClick:t=>{t.state.facet(st).aiCellCompletion()}}):[]}var jf=dm.configure({props:[T8.add({ParenthesizedExpression:v_,ArgList:v_})]});Em=function(){return new S_(jf,[jf.data.of({autocomplete:OL}),jf.data.of({autocomplete:AL})])};const rT=e=>{let t;return async()=>(t||(t=e()),await t)};var gc=class{constructor(e={}){we(this,"opts");we(this,"parser",null);we(this,"offsetRecord",{});we(this,"getParser",rT(async()=>{if(this.parser)return this.parser;let e=await ne(()=>import("./node-sql-parser-BWgUjcfV.js").then(async a=>(await a.__tla,a)).then(GI(1)),__vite__mapDeps([213,1]),import.meta.url),{Parser:t}=e.default||e;return this.parser=new t,this.parser}));this.opts=e}async parse(e,t){var s,c;this.offsetRecord={};let a=(c=(s=this.opts).getParserOptions)==null?void 0:c.call(s,t.state),o=await this.sanitizeSql(e,a);try{let f=await this.getParser();return(a==null?void 0:a.database)==="DuckDB"?this.parseWithDuckDBSupport(o,a):{success:!0,errors:[],ast:f.astify(o,a)}}catch(f){return{success:!1,errors:[this.extractErrorInfo(f,o)]}}}async sanitizeSql(e,t){if(t!=null&&t.ignoreBrackets){let{sql:a,offsetRecord:o}=oT(e);return this.offsetRecord=o,a}return e}async parseWithDuckDBSupport(e,t){let a=await this.getParser(),o=aT(e).trimStart().toLowerCase();if(o.startsWith("from")||o.includes("macro"))return{success:!0,errors:[]};let s=e;o.includes("create or replace table")&&(this.offsetRecord[e.indexOf("create or replace table")]=-11,s=e.replace(/create or replace table/i,"create table"));try{let c={...t,database:"PostgreSQL"};return{success:!0,errors:[],ast:a.astify(s,c)}}catch(c){return{success:!1,errors:[this.extractErrorInfo(c,e)]}}}extractErrorInfo(e,t){var f,d,m;let a=1,o=1,s=(e==null?void 0:e.message)||"SQL parsing error",c=e;if(c!=null&&c.location)a=((f=c.location.start)==null?void 0:f.line)||1,o=((d=c.location.start)==null?void 0:d.column)||1;else if(c!=null&&c.hash)a=c.hash.line||1,o=((m=c.hash.loc)==null?void 0:m.first_column)||1;else{let b=s.match(/line (\d+)/i),w=s.match(/column (\d+)/i);b!=null&&b[1]&&(a=parseInt(b[1],10)),w!=null&&w[1]&&(o=parseInt(w[1],10))}for(let[b,w]of Object.entries(this.offsetRecord))o>parseInt(b,10)&&(o-=w);return o>t.length&&(o=t.length),{message:this.cleanErrorMessage(s),line:Math.max(1,a),column:o,severity:"error"}}cleanErrorMessage(e){return e.replace(/^Error: /,"").replace(/Expected .* but .* found\./i,t=>t.replace(/but .* found/,"found unexpected token")).trim()}async validateSql(e,t){return(await this.parse(e,t)).errors}async extractTableReferences(e,t){var o,s;let a=t?(s=(o=this.opts).getParserOptions)==null?void 0:s.call(o,t.state):void 0;try{return(await this.getParser()).tableList(e,a).map(c=>{let f=c.split("::");return f[f.length-1]||c})}catch{return[]}}async extractColumnReferences(e,t){var o,s;let a=t!=null&&t.state?(s=(o=this.opts).getParserOptions)==null?void 0:s.call(o,t.state):void 0;try{return(await this.getParser()).columnList(e,a).map(c=>{let f=c.split("::");return f[f.length-1]||c})}catch{return[]}}};function aT(e,t=["/*","--"]){let a=[];if(t.includes("/*")&&a.push("/\\*[\\s\\S]*?\\*/"),t.includes("--")&&a.push("--[^\\n]*"),a.length===0)return e;let o=RegExp(`^\\s*(${a.join("|")})\\s*`,""),s=e,c="";for(;s!==c;)c=s,s=s.replace(o,"");return s}var iT=2;function oT(e){let t={};return{sql:e.replace(/("(?:[^"\\]|\\.)*")|('(?:[^'\\]|\\.)*')|(\{[^}]*\})/g,(a,o,s,c,f)=>o||s?a:c?(t[f]=iT,`'${c}'`):a),offsetRecord:t}}var sT=750;function lT(e,t){let a=t.line(e.line).from+Math.max(0,e.column-1);return{from:a,to:a+1,severity:e.severity,message:e.message,source:"sql-parser"}}function cT(e={}){let t=e.parser||new gc;return eL(async a=>{let o=a.state.doc,s=o.toString();return s.trim()?(await t.validateSql(s,{state:a.state})).map(c=>lT(c,o)):[]},{delay:e.delay||sT})}function hi(e){return typeof e=="object"&&!Array.isArray(e)&&!("self"in e)}function qr(e){return typeof e=="object"&&!Array.isArray(e)&&"self"in e&&"children"in e}function dr(e){return Array.isArray(e)}function dn(e,t,a,o){let s=e.length;if(t==="string"||t==="completion"&&o&&dr(o))return"column";if(t==="namespace"&&a){if(dr(a))return"table";if(hi(a))return Object.values(a).some(c=>dr(c)||qr(c)&&dr(c.children))?s<=1?"database":"schema":s===0?"database":"namespace"}if(t==="completion"&&a)return dr(a)?"table":(hi(a)&&Object.values(a).some(c=>dr(c)||qr(c)&&dr(c.children)),s<=1?"database":"schema");switch(s){case 0:return"database";case 1:return"schema";default:return"namespace"}}function $1(e,t,a={}){let{maxDepth:o=10}=a;if(t===""&&qr(e)){let c=dn([],"completion",e.children);return{completion:e.self,path:[],type:"completion",semanticType:c,namespace:e.children}}let s=t.split(".").filter(c=>c.length>0);return s.length===0||s.length>o?null:zf(e,s,[],a)}function zf(e,t,a,o,s){if(t.length===0){if(qr(e)){let m=dn(a,"completion",e.children,s);return{completion:e.self,path:a,type:"completion",semanticType:m,namespace:e.children}}return{path:a,type:"namespace",semanticType:dn(a,"namespace",e,s),namespace:e}}let[c,...f]=t,{caseSensitive:d=!1}=o;if(!c)return null;if(hi(e)){let m=d?Object.keys(e).find(b=>b===c):Object.keys(e).find(b=>b.toLowerCase()===c.toLowerCase());if(m){let b=e[m];if(b)return zf(b,f,[...a,m],o,e)}}else{if(qr(e))return zf(e.children,t,a,o,e);if(dr(e)){for(let m of e)if(typeof m=="string"){if((d?m===c:m.toLowerCase()===c.toLowerCase())&&f.length===0){let b=dn([...a,m],"string",void 0,e);return{value:m,path:[...a,m],type:"string",semanticType:b}}}else if((d?m.label===c:m.label.toLowerCase()===c.toLowerCase())&&f.length===0){let b=dn([...a,m.label],"completion",void 0,e);return{completion:m,path:[...a,m.label],type:"completion",semanticType:b}}}}return null}function uT(e,t,a={}){let o=[];if(t.includes(".")){let s=t.lastIndexOf("."),c=t.substring(0,s),f=t.substring(s+1),d=$1(e,c,a);if(d!=null&&d.namespace)return qf(d.namespace,f,d.path,a)}else return qf(e,t,[],a);return o}function qf(e,t,a,o){let s=[],{caseSensitive:c=!1,allowPartialMatch:f=!0}=o;if(hi(e)){for(let[d,m]of Object.entries(e))if(f?c?d.startsWith(t):d.toLowerCase().startsWith(t.toLowerCase()):c?d===t:d.toLowerCase()===t.toLowerCase())if(qr(m)){let b=dn([...a,d],"completion",m.children,e);s.push({completion:m.self,path:[...a,d],type:"completion",semanticType:b,namespace:m.children})}else{let b=dn([...a,d],"namespace",m,e);s.push({path:[...a,d],type:"namespace",semanticType:b,namespace:m})}}else if(qr(e)){if(f?c?e.self.label.startsWith(t):e.self.label.toLowerCase().startsWith(t.toLowerCase()):c?e.self.label===t:e.self.label.toLowerCase()===t.toLowerCase()){let d=dn([...a,e.self.label],"completion",e.children);s.push({completion:e.self,path:[...a,e.self.label],type:"completion",semanticType:d,namespace:e.children})}s.push(...qf(e.children,t,a,o))}else if(dr(e)){for(let d of e)if(typeof d=="string"){if(f?c?d.startsWith(t):d.toLowerCase().startsWith(t.toLowerCase()):c?d===t:d.toLowerCase()===t.toLowerCase()){let m=dn([...a,d],"string",void 0,e);s.push({value:d,path:[...a,d],type:"string",semanticType:m})}}else if(f?c?d.label.startsWith(t):d.label.toLowerCase().startsWith(t.toLowerCase()):c?d.label===t:d.label.toLowerCase()===t.toLowerCase()){let m=dn([...a,d.label],"completion",void 0,e);s.push({completion:d,path:[...a,d.label],type:"completion",semanticType:m})}}return s}function dT(e,t,a={}){let o=[],{maxDepth:s=10}=a;yc(e,[],o,s);let{caseSensitive:c=!1}=a;return o.filter(f=>f.path.some(d=>c?d===t:d.toLowerCase()===t.toLowerCase())).sort((f,d)=>{var w,x;let m=c?f.path[f.path.length-1]===t:((w=f.path[f.path.length-1])==null?void 0:w.toLowerCase())===t.toLowerCase(),b=c?d.path[d.path.length-1]===t:((x=d.path[d.path.length-1])==null?void 0:x.toLowerCase())===t.toLowerCase();return m&&!b?-1:!m&&b?1:f.path.length-d.path.length})}function yc(e,t,a,o){if(!(t.length>=o)){if(hi(e))for(let[s,c]of Object.entries(e)){let f=[...t,s];if(qr(c)){let d=dn(f,"completion",c.children,e);a.push({completion:c.self,path:f,type:"completion",semanticType:d,namespace:c.children}),yc(c.children,f,a,o)}else{let d=dn(f,"namespace",c,e);a.push({path:f,type:"namespace",semanticType:d,namespace:c}),yc(c,f,a,o)}}else if(qr(e)){let s=dn(t,"completion",e.children);a.push({completion:e.self,path:t,type:"completion",semanticType:s,namespace:e.children}),yc(e.children,t,a,o)}else if(dr(e))for(let s of e)if(typeof s=="string"){let c=dn([...t,s],"string",void 0,e);a.push({value:s,path:[...t,s],type:"string",semanticType:c})}else{let c=dn([...t,s.label],"completion",void 0,e);a.push({completion:s,path:[...t,s.label],type:"completion",semanticType:c})}}}function W1(e,t,a={}){let{enableFuzzySearch:o=!1}=a,s=$1(e,t,a);if(s)return s;let c=uT(e,t,a);if(c.length>0)return c[0]||null;if(o){let f=dT(e,t,a);if(f.length>0)return f[0]||null}return null}function U1(e,t){if(t.size===0)return{};if(hi(e)){let a={};for(let[o,s]of Object.entries(e))if(Array.from(t).some(c=>c.toLowerCase()===o.toLowerCase()))a[o]=s;else if(hi(s)){let c=U1(s,t);Object.keys(c).length>0&&(a[o]=c)}return a}return e}function fT(e={}){let{schema:t={},keywords:a={},hoverTime:o=300,enableKeywords:s=!0,enableTables:c=!0,enableColumns:f=!0,enableFuzzySearch:d=!0,parser:m=new gc,tooltipRender:b,tooltipRenderers:w={}}=e,x=null;return am(async(S,E,T)=>{let{from:M,to:z,text:B}=S.state.doc.lineAt(E),V=E,N=E;x===null&&(x=typeof a=="function"?a(S):Promise.resolve(a));let X=await x;for(;V>M&&/[\w.]/.test(B[V-M-1]??"");)V--;for(;N<z&&/[\w.]/.test(B[N-M]??"");)N++;if(V===E&&T<0||N===E&&T>0)return null;let ce=B.slice(V-M,N-M).toLowerCase();if(!ce||ce.length===0)return null;let A=typeof t=="function"?t(S):t,q=null;`${ce}`;let $=X[ce];if(!q&&s&&$&&(q={word:ce,view:S,pos:E,tooltipType:"keyword",keywordData:{keyword:ce,info:$}}),!q&&(c||f)&&A){let fe=S.state.doc.toString(),me=await m.extractTableReferences(fe),ve=new Set(me.map(be=>be.toLowerCase())),ae=U1(A,ve),de=W1(ae,ce,{enableFuzzySearch:d});!de&&ve.size===0&&(de=W1(A,ce,{enableFuzzySearch:d})),de&&(Array.from(ve),q={word:ce,view:S,pos:E,tooltipType:"namespace",namespaceData:{item:de,word:ce,resolvedSchema:ve.size>0?ae:A}})}if(!q)return null;let ie=q;return{pos:V,end:N,above:!0,create(fe){if(b){let ae=b(ce,fe,E);if(ae)return{dom:ae}}let me=null;if(ie.tooltipType==="keyword"&&ie.keywordData)me=w.keyword?w.keyword(ie.keywordData):Q1(ie.keywordData);else if(ie.tooltipType==="namespace"&&ie.namespaceData){let ae=ie.namespaceData,{semanticType:de}=ae.item;me=de==="table"&&w.table?w.table(ae):de==="column"&&w.column?w.column(ae):(de==="database"||de==="schema"||de==="namespace")&&w.namespace?w.namespace(ae):K1(ae.item)}if(!me)return{dom:document.createElement("div")};let ve=document.createElement("div");return ve.className="cm-sql-hover-tooltip",ve.innerHTML=me,{dom:ve}}}},{hoverTime:o})}function K1(e){var s,c,f,d,m,b,w;let t=e.path.join("."),a=((s=e.completion)==null?void 0:s.label)||e.value||e.path[e.path.length-1]||"unknown",o=`<div class="sql-hover-${e.semanticType}">`;switch(o+=`<div class="sql-hover-header"><strong>${a}</strong> <span class="sql-hover-type">${e.semanticType}</span></div>`,e.semanticType){case"database":if(o+=`<div class="sql-hover-description">Database${(c=e.completion)!=null&&c.detail?`: ${e.completion.detail}`:""}</div>`,e.namespace){let x=vc(e.namespace);x>0&&(o+=`<div class="sql-hover-children">Contains ${x} schema${x===1?"":"s"}</div>`)}break;case"schema":if(o+=`<div class="sql-hover-description">Schema${(f=e.completion)!=null&&f.detail?`: ${e.completion.detail}`:""}</div>`,t&&(o+=`<div class="sql-hover-path"><strong>Path:</strong> <code>${t}</code></div>`),e.namespace){let x=vc(e.namespace);x>0&&(o+=`<div class="sql-hover-children">Contains ${x} table${x===1?"":"s"}</div>`)}break;case"table":if(o+=`<div class="sql-hover-description">Table${(d=e.completion)!=null&&d.detail?`: ${e.completion.detail}`:""}</div>`,t){let x=e.path;x.length>1&&(o+=`<div class="sql-hover-path"><strong>Schema:</strong> <code>${x.slice(0,-1).join(".")}</code></div>`)}if(e.namespace&&dr(e.namespace)){let x=e.namespace;if(x.length>0){o+=`<div class="sql-hover-columns"><strong>Columns (${x.length}):</strong><br>`;let S=x.slice(0,8).map(E=>typeof E=="string"?E:E.label);o+=S.map(E=>`<code>${E}</code>`).join(", "),x.length>8&&(o+=`, <em>and ${x.length-8} more...</em>`),o+="</div>"}}break;case"column":if(o+=`<div class="sql-hover-description">Column${(m=e.completion)!=null&&m.detail?`: ${e.completion.detail}`:""}</div>`,t){let x=e.path;x.length>1&&(o+=`<div class="sql-hover-path"><strong>Table:</strong> <code>${x.slice(0,-1).join(".")}</code></div>`)}break;default:if(o+=`<div class="sql-hover-description">Namespace${(b=e.completion)!=null&&b.detail?`: ${e.completion.detail}`:""}</div>`,t&&(o+=`<div class="sql-hover-path"><strong>Path:</strong> <code>${t}</code></div>`),e.namespace){let x=vc(e.namespace);x>0&&(o+=`<div class="sql-hover-children">Contains ${x} item${x===1?"":"s"}</div>`)}break}return(w=e.completion)!=null&&w.info&&typeof e.completion.info=="string"&&(o+=`<div class="sql-hover-info">${e.completion.info}</div>`),o+="</div>",o}function vc(e){return Array.isArray(e)?e.length:typeof e=="object"&&e?"self"in e&&"children"in e?1+vc(e.children):Object.keys(e).length:0}function Q1(e){let{keyword:t,info:a}=e,o='<div class="sql-hover-keyword">';if(o+=`<div class="sql-hover-header"><strong>${t.toUpperCase()}</strong> <span class="sql-hover-type">keyword</span></div>`,o+=`<div class="sql-hover-description">${a.description}</div>`,a.syntax&&(o+=`<div class="sql-hover-syntax"><strong>Syntax:</strong> <code>${a.syntax}</code></div>`),a.example&&(o+=`<div class="sql-hover-example"><strong>Example:</strong><br><code>${a.example}</code></div>`),a.metadata&&typeof a.metadata=="object"&&Object.keys(a.metadata).length>0){o+='<div class="sql-hover-metadata">';for(let[s,c]of Object.entries(a.metadata))o+=`<span class="sql-hover-tag" title="${s}">${c}</span> `;o+="</div>"}return o+="</div>",o}function pT(e){let{tableName:t,columns:a,metadata:o}=e,s='<div class="sql-hover-table">';if(s+=`<div class="sql-hover-header"><strong>${t}</strong> <span class="sql-hover-type">table</span></div>`,s+=`<div class="sql-hover-description">Table with ${a.length} column${a.length===1?"":"s"}</div>`,a.length>0){s+='<div class="sql-hover-columns"><strong>Columns:</strong><br>';let c=a.slice(0,10);s+=c.map(f=>`<code>${f}</code>`).join(", "),a.length>10&&(s+=`, <em>and ${a.length-10} more...</em>`),s+="</div>"}if(o&&typeof o=="object"&&Object.keys(o).length>0){s+='<div class="sql-hover-metadata">';for(let[c,f]of Object.entries(o))s+=`<span class="sql-hover-tag" title="${c}">${f}</span> `;s+="</div>"}return s+="</div>",s}function hT(e){let{tableName:t,columnName:a,schema:o,metadata:s}=e,c='<div class="sql-hover-column">';c+=`<div class="sql-hover-header"><strong>${a}</strong> <span class="sql-hover-type">column</span></div>`,c+=`<div class="sql-hover-description">Column in table <code>${t}</code></div>`;let f=o[t];if(f&&f.length>1){let d=f.filter(m=>m!==a);if(d.length>0){c+=`<div class="sql-hover-related"><strong>Other columns in ${t}:</strong><br>`;let m=d.slice(0,8);c+=m.map(b=>`<code>${b}</code>`).join(", "),d.length>8&&(c+=`, <em>and ${d.length-8} more...</em>`),c+="</div>"}}if(s&&typeof s=="object"&&Object.keys(s).length>0){c+='<div class="sql-hover-metadata">';for(let[d,m]of Object.entries(s))c+=`<span class="sql-hover-tag" title="${d}">${m}</span> `;c+="</div>"}return c+="</div>",c}const mT={keyword:Q1,table:pT,column:hT,namespace:K1},G1=(e="light")=>{let t=e==="dark"?{tooltipBg:"#1f2937",tooltipBorder:"#374151",tooltipText:"#f9fafb",tooltipTypeBg:"#374151",tooltipTypeText:"#9ca3af",tooltipChildren:"#9ca3af",codeBg:"#374151",codeText:"#f3f4f6",strong:"#ffffff",em:"#9ca3af",header:"#ffffff",info:"#d1d5db",related:"#d1d5db",path:"#d1d5db",example:"#d1d5db",columns:"#d1d5db",syntax:"#d1d5db"}:{tooltipBg:"#ffffff",tooltipBorder:"#e5e7eb",tooltipText:"#374151",tooltipTypeBg:"#f3f4f6",tooltipTypeText:"#6b7280",tooltipChildren:"#6b7280",codeBg:"#f9fafb",codeText:"#1f2937",strong:"#111827",em:"#6b7280",header:"#111827",info:"#374151",related:"#374151",path:"#374151",example:"#374151",columns:"#374151",syntax:"#374151"};return wt.theme({".cm-sql-hover-tooltip":{padding:"8px 12px",backgroundColor:t.tooltipBg,border:`1px solid ${t.tooltipBorder}`,borderRadius:"6px",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",fontSize:"13px",lineHeight:"1.4",maxWidth:"320px",fontFamily:"system-ui, -apple-system, sans-serif",color:t.tooltipText},".cm-sql-hover-tooltip .sql-hover-header":{marginBottom:"6px",display:"flex",alignItems:"center",gap:"6px",color:t.header},".cm-sql-hover-tooltip .sql-hover-type":{fontSize:"11px",padding:"2px 6px",backgroundColor:t.tooltipTypeBg,color:t.tooltipTypeText,borderRadius:"4px",fontWeight:"500"},".cm-sql-hover-tooltip .sql-hover-description":{color:t.info,marginBottom:"8px"},".cm-sql-hover-tooltip .sql-hover-syntax":{marginBottom:"8px",color:t.syntax},".cm-sql-hover-tooltip .sql-hover-example":{marginBottom:"4px",color:t.example},".cm-sql-hover-tooltip .sql-hover-columns":{marginBottom:"4px",color:t.columns},".cm-sql-hover-tooltip .sql-hover-related":{marginBottom:"4px",color:t.related},".cm-sql-hover-tooltip .sql-hover-path":{marginBottom:"4px",color:t.path},".cm-sql-hover-tooltip .sql-hover-info":{marginBottom:"4px",color:t.info},".cm-sql-hover-tooltip .sql-hover-children":{marginBottom:"4px",color:t.tooltipChildren,fontSize:"12px"},".cm-sql-hover-tooltip code":{backgroundColor:t.codeBg,padding:"1px 4px",borderRadius:"3px",fontSize:"12px",fontFamily:"ui-monospace, 'SF Mono', 'Monaco', 'Cascadia Code', 'Roboto Mono', monospace",color:t.codeText},".cm-sql-hover-tooltip strong":{fontWeight:"600",color:t.strong},".cm-sql-hover-tooltip em":{fontStyle:"italic",color:t.em}})};var gT=class{constructor(e){we(this,"parser");we(this,"cache",new Map);we(this,"MAX_CACHE_SIZE",10);this.parser=e}async analyzeDocument(e){let t=e.doc.toString(),a=this.generateCacheKey(t),o=this.cache.get(a);if(o)return o;let s=await this.extractStatements(t,e);if(this.cache.set(a,s),this.cache.size>this.MAX_CACHE_SIZE){let c=this.cache.keys().next().value;c!==void 0&&this.cache.delete(c)}return s}async getStatementAtPosition(e,t){return(await this.analyzeDocument(e)).find(a=>t>=a.from&&t<=a.to)||null}async getStatementsInRange(e,t,a){return(await this.analyzeDocument(e)).filter(o=>o.from<=a&&o.to>=t)}async extractStatements(e,t){let a=[],o=this.splitByStatementSeparators(e),s=0;for(let c of o){let f=c.trim();if(f.length===0){s+=c.length;continue}let d=s+c.indexOf(f),m=d+f.length,b=t.doc.lineAt(d),w=t.doc.lineAt(m),x=this.stripComments(f);if(x.trim().length===0||x.trim()===";"){s+=c.length;continue}let S=await this.parser.parse(x,{state:t}),E=this.determineStatementType(x),T=x.endsWith(";")?x.slice(0,-1).trim():x.trim();a.push({from:d,to:m,lineFrom:b.number,lineTo:w.number,content:T,type:E,isValid:S.success}),s+=c.length}return a}splitByStatementSeparators(e){let t=[],a="",o=!1,s="",c=!1,f=!1,d=0;for(;d<e.length;){let m=e[d],b=e[d+1];if(!o&&!f&&m==="-"&&b==="-"){c=!0,a+=m+b,d+=2;continue}if(!o&&!c&&m==="/"&&b==="*"){f=!0,a+=m+b,d+=2;continue}if(f&&m==="*"&&b==="/"){f=!1,a+=m+b,d+=2;continue}if(c&&(m===`
113
- `||m==="\r")){c=!1,a+=m,d++;continue}if(c||f){a+=m,d++;continue}if(!o&&(m==="'"||m==='"'||m==="`"))o=!0,s=m,a+=m;else if(o&&m===s){if(b===s){a+=m+b,d+=2;continue}o=!1,s="",a+=m}else!o&&m===";"?(a+=m,t.push(a),a=""):a+=m;d++}return a.trim()&&t.push(a),t}determineStatementType(e){let t=e.trim().toLowerCase();return t.startsWith("select")?"select":t.startsWith("insert")?"insert":t.startsWith("update")?"update":t.startsWith("delete")?"delete":t.startsWith("create")?"create":t.startsWith("drop")?"drop":t.startsWith("alter")?"alter":t.startsWith("use")?"use":"other"}stripComments(e){let t="",a=!1,o="",s=!1,c=!1,f=0;for(;f<e.length;){let d=e[f],m=e[f+1];if(!a&&!c&&d==="-"&&m==="-"){s=!0,f+=2;continue}if(!a&&!s&&d==="/"&&m==="*"){c=!0,f+=2;continue}if(c&&d==="*"&&m==="/"){c=!1,f+=2;continue}if(s&&(d===`
114
- `||d==="\r")){s=!1,t+=d,f++;continue}if(s||c){f++;continue}if(!a&&(d==="'"||d==='"'||d==="`"))a=!0,o=d,t+=d;else if(a&&d===o){if(m===o){t+=d+m,f+=2;continue}a=!1,o="",t+=d}else t+=d;f++}return t}generateCacheKey(e){let t=0;for(let a=0;a<e.length;a++){let o=e.charCodeAt(a);t=(t<<5)-t+o,t&=t}return t.toString()}clearCache(){this.cache.clear()}},J1=_r.define(),X1=ei.define({create(){return{currentStatement:null,allStatements:[],cursorPosition:0,isFocused:!0}},update(e,t){for(let a of t.effects)if(a.is(J1))return a.value;return e}}),yT=class extends __{constructor(t,a,o=!0,s=!0){super();we(this,"config");we(this,"isCurrent");we(this,"isValid");we(this,"isFocused");this.config=t,this.isCurrent=a,this.isValid=o,this.isFocused=s}toDOM(){let t=document.createElement("div");t.className="cm-sql-gutter-marker";let a=this.config.backgroundColor||"#3b82f6";!this.isValid&&this.config.showInvalid!==!1&&(a=this.config.errorBackgroundColor||"#ef4444");let o;return o=this.isFocused?this.isCurrent?"1":(this.config.inactiveOpacity||"0.3").toString():this.config.unfocusedOpacity===void 0?this.config.hideWhenNotFocused?"0":this.isCurrent?"1":(this.config.inactiveOpacity||"0.3").toString():this.config.unfocusedOpacity.toString(),t.style.cssText=`
115
- background: ${a};
116
- height: 100%;
117
- width: 100%;
118
- opacity: ${o};
119
- transition: opacity 150ms ease-in-out;
120
- border-radius: 1px;
121
- `,t}eq(t){return this.isCurrent===t.isCurrent&&this.isValid===t.isValid&&this.isFocused===t.isFocused&&this.config===t.config}};function vT(e,t){var d;let a=h_.empty;if((d=t.whenHide)!=null&&d.call(t,e))return a;let o=e.state.field(X1,!1);if(!o)return a;let{currentStatement:s,allStatements:c,isFocused:f}=o;try{let m=e.state.doc.lineAt(e.viewport.from).number,b=e.state.doc.lineAt(e.viewport.to).number;for(let w of c){if(w.lineTo<m||w.lineFrom>b)continue;let x=(s==null?void 0:s.from)===w.from&&(s==null?void 0:s.to)===w.to;if(!w.isValid&&t.showInvalid===!1)continue;let S=new yT(t,x,w.isValid,f),E=Math.max(w.lineFrom,m),T=Math.min(w.lineTo,b);for(let M=E;M<=T;M++)try{if(M<1||M>e.state.doc.lines)continue;let z=e.state.doc.line(M);a=a.update({add:[S.range(z.from)]})}catch(z){console.warn("SqlGutter: Invalid line number",M,z)}}}catch(m){console.warn("SqlGutter: Error creating markers",m)}return a}function bT(e){return wt.updateListener.of(async t=>{if(!t.docChanged&&!t.selectionSet&&!t.focusChanged)return;let{state:a}=t.view,{main:o}=a.selection,s=o.head,c=await e.analyzeDocument(a),f={currentStatement:await e.getStatementAtPosition(a,s),allStatements:c,cursorPosition:s,isFocused:t.view.hasFocus};t.view.dispatch({effects:J1.of(f)})})}function wT(e){let t=e.width||3;return wt.baseTheme({".cm-sql-gutter":{width:`${t}px`,minWidth:`${t}px`},".cm-sql-gutter .cm-gutterElement":{width:`${t}px`,padding:"0",margin:"0"},".cm-sql-gutter-marker":{width:"100%",height:"100%",display:"block"},".cm-lineNumbers .cm-gutterElement":{paddingLeft:"8px",paddingRight:"8px"}})}function _T(e){return w_({class:`cm-sql-gutter ${e.className||""}`,markers:t=>vT(t,e)})}function xT(e={}){return[X1,bT(new gT(e.parser||new gc)),wT(e),_T(e)]}function kT(e={}){let t=[],{enableLinting:a=!0,enableGutterMarkers:o=!0,enableHover:s=!0,linterConfig:c,gutterConfig:f,hoverConfig:d}=e;return a&&t.push(cT(c)),o&&t.push(xT(f)),s&&(t.push(fT(d)),d!=null&&d.theme?t.push(d.theme):t.push(G1())),t}var CT=class Jk{static jsonStringifySortKeys(){return t=>typeof t!="object"||!t?String(t):JSON.stringify(t,Object.keys(t).toSorted(),2)}constructor(t,a={}){this.delegate=t,this.toKey=a.toKey??Jk.jsonStringifySortKeys(),this.cache=new nc(a.maxSize??128)}request(t){let a=this.toKey(t),o=this.cache.get(a);if(o!==void 0)return o;let s=this.delegate.request(t);return this.cache.set(a,s),s.catch(c=>{throw this.cache.delete(a),c})}resolve(t,a){this.delegate.resolve(t,a)}reject(t,a){this.delegate.reject(t,a)}};ax=new Al("sql-table-preview",async(e,t)=>{await ir().previewSQLTable({requestId:e,...t})}),Px=new Al("sql-schema-list-preview",async(e,t)=>{await ir().previewSQLSchemaList({requestId:e,...t})}),Ax=new Al("sql-table-list-preview",async(e,t)=>{await ir().previewSQLTableList({requestId:e,...t})}),Hm=new CT(new Al("validate-sql",async(e,t)=>{await ir().validateSQL({requestId:e,...t})}),{maxSize:3});var ST=Bn();let mi;mi=Ee(new Map),K_=e=>{let t=(0,ST.c)(3),a=rn(mi),o;return t[0]!==e||t[1]!==a?(o=a.get(e),t[0]=e,t[1]=a,t[2]=o):o=t[2],o};function Ff(e){let t=Te.get(mi),a=new Map(t);a.delete(e),Te.set(mi,a)}function ET(){Te.set(mi,new Map)}function TT({cellId:e,errorMessage:t,dialect:a}){let o=Te.get(mi),s=new Map(o),c=a==="DuckDB"?IT(t):Y1(t);s.set(e,c),Te.set(mi,s)}function IT(e){let{errorType:t,errorMessage:a}=Y1(e),o=a,s,c=a.indexOf("LINE ");return c!==-1&&(s=a.slice(Math.max(0,c)).trim(),o=a.slice(0,Math.max(0,c)).trim()),{errorType:t,errorMessage:o,codeblock:s}}function Y1(e){return{errorType:e.split(":")[0].trim(),errorMessage:e.split(":").slice(1).join(":").trim()}}function Z1(e){return e.field(jr)}function LT(){return e=>{let t=Z1(e.state).engine,a=fi.getCompletionSource(t);return a&&pL(a)(e)||null}}function OT(){return e=>{let t=Z1(e.state).engine,a=fi.getDialect(t);return e.matchBefore(/\.\w*/)?null:bL(a,!0,(o,s)=>({label:o,type:s,info:async()=>{let c=(await AT())[o.toLocaleLowerCase()];if(!c)return null;let f=document.createElement("div");return f.innerHTML=mT.keyword({keyword:o,info:c}),f}}))(e)}}var AT=ar(async()=>{let e=await ne(()=>import("./common-keywords-PqH2GDfH.js").then(async a=>(await a.__tla,a)),[],import.meta.url),t=await ne(()=>import("./duckdb-keywords-mPlR0SxW.js").then(async a=>(await a.__tla,a)),[],import.meta.url);return{...e.default.keywords,...t.default.keywords}}),RT=Bn(),ev=Dl("marimo:notebook-sql-mode","default",Dd);function MT(){let e=(0,RT.c)(3),[t,a]=Zw(ev),o;return e[0]!==a||e[1]!==t?(o={sqlMode:t,setSQLMode:a},e[0]=a,e[1]=t,e[2]=o):o=e[2],o}function tv(){return Te.get(ev)}var PT=yy,NT="DuckDB",nv=new Qu;function Bf(){return Te.get(Xi).latestEngineSelected}let rv;jd=(Gf=class{constructor(){we(this,"parser",new Ad);we(this,"type","sql");this.sqlModeEnabled=!0}get defaultMetadata(){return{...this.parser.defaultMetadata,engine:Bf()||"__marimo_duckdb"}}get defaultCode(){let e=Bf();return e&&e!=="__marimo_duckdb"?`_df = mo.sql(f"""SELECT * FROM """, engine=${e})`:this.parser.defaultCode}transformIn(e){this.parser.defaultMetadata.engine=Bf()||"__marimo_duckdb";let t=this.parser.transformIn(e),a=t.metadata;return a.engine&&a.engine!=="__marimo_duckdb"&&_y(a.engine),[t.code,t.offset,a]}transformOut(e,t){let a=this.parser.transformOut(e,t);return[a.code,a.offset]}isSupported(e){return this.parser.isSupported(e)}getExtension(e,t,a,o,s){var f;let c=[nv.of(M_({dialect:PT})),fa.of([{key:"Tab",run:d=>oL(d)||H8(d),preventDefault:!0}]),Xu({defaultKeymap:!1,activateOnTyping:!0,override:[LT(),m4,OT()]})];if(((f=s==null?void 0:s.diagnostics)==null?void 0:f.sql_linter)??!1){let d=Te.get(ML),m=new rv({getParserOptions:b=>({database:iv(b)??NT})});c.push(kT({enableLinting:!0,linterConfig:{delay:250,parser:m},enableGutterMarkers:!0,gutterConfig:{backgroundColor:"#3b82f6",errorBackgroundColor:"#ef4444",hideWhenNotFocused:!0,parser:m},hoverConfig:{schema:zT,hoverTime:300,enableKeywords:!0,enableTables:!0,enableColumns:!0,parser:m,theme:G1(d)}}),wt.updateListener.of(b=>{b.focusChanged&&m.setFocusState(b.view.hasFocus)}))}return this.sqlModeEnabled&&c.push(FT()),c}},we(Gf,"fromQuery",e=>Ad.fromQuery(e)),Gf),rv=class extends gc{constructor(){super(...arguments);we(this,"validationTimeout",null);we(this,"VALIDATION_DELAY_MS",300);we(this,"isFocused",!1)}setFocusState(t){this.isFocused=t}async validateWithDelay(t,a,o){return this.validationTimeout&&window.clearTimeout(this.validationTimeout),new Promise(s=>{this.validationTimeout=window.setTimeout(async()=>{var c;if(!this.isFocused){s([]);return}try{let f=await sv(t,a,o,tv());if(f.error){_e.error("Failed to validate SQL",{error:f.error}),s([]);return}s(((c=f.parse_result)==null?void 0:c.errors)??[])}catch(f){_e.error("Failed to validate SQL",{error:f}),s([])}},this.VALIDATION_DELAY_MS)})}async validateSql(t,a){let o=bo(a.state);if(!this.isFocused)return[];if(!eo.has(o.engine))return super.validateSql(t,a);let s=iv(a.state);return this.validateWithDelay(t,o.engine,s)}async parse(t,a){return bo(a.state).engine==="__marimo_duckdb"?{success:!0,errors:[]}:super.parse(t,a)}};function av(e,t){e.dispatch({effects:nv.reconfigure(M_({dialect:t}))})}function DT(e,t){av(e,fi.getDialect(t))}function jT(e){let t=bo(e.state).engine;av(e,fi.getDialect(t))}function bo(e){return e.field(jr)}function zT(e){let t=bo(e.state).engine,a=fi.getCompletionSource(t);return a!=null&&a.schema?a.schema:{}}function iv(e){let t=bo(e).engine;return ov(t)}function ov(e){var a;let t=(a=fi.getInternalDialect(e))==null?void 0:a.toLowerCase();if(!t||!ec(t))return null;switch(t){case"postgresql":case"postgres":return"PostgreSQL";case"db2":case"db2i":return"DB2";case"mysql":return"MySQL";case"sqlite":return"Sqlite";case"mssql":case"sqlserver":case"microsoft sql server":return"TransactSQL";case"duckdb":return"DuckDB";case"mariadb":return"MariaDB";case"cassandra":return"Noql";case"athena":case"awsathena":return"Athena";case"bigquery":return"BigQuery";case"hive":return"Hive";case"redshift":return"Redshift";case"snowflake":return"Snowflake";case"flink":return"FlinkSQL";case"mongodb":case"noql":return"Noql";case"oracle":case"oracledb":case"timescaledb":case"couchbase":case"trino":case"tidb":case"singlestoredb":case"spark":case"databricks":case"datafusion":case"dremio":return _e.debug("Unsupported dialect",{dialect:t}),null;default:return fs(t),null}}var qT=300;function FT(){return Dr.define(e=>{let t,a=null,o=e.state.facet(ha);return{update(s){if(!s.docChanged)return;let c=tv();if(c==="default")return;let f=bo(s.state).engine;if(!eo.has(f))return;let d=s.state.doc.toString();t&&window.clearTimeout(t),t=window.setTimeout(async()=>{if(a!==d){if(a=d,d===""){Ff(o);return}try{let m=ov(f),b=(await sv(d,f,m,c)).validate_result;b!=null&&b.error_message?TT({cellId:o,errorMessage:b.error_message,dialect:m}):Ff(o)}catch(m){_e.error("Failed to validate SQL",{error:m})}}},qT)},destroy(){t&&window.clearTimeout(t),Ff(o)}}})}async function sv(e,t,a,o){let s=await Hm.request({onlyParse:o==="default",engine:t,dialect:a,query:e});if(s.error)throw Error(s.error);return s}var BT=ar(()=>new tT),VT=ar(()=>new ad),HT=ar(()=>new jd);Wn={get python(){return BT()},get markdown(){return VT()},get sql(){return HT()}};function $T(){return Object.values(Wn)}let lv;lv=Bn(),jl=xe.forwardRef((e,t)=>{let a=(0,lv.c)(13),o,s;a[0]===e?(o=a[1],s=a[2]):({className:o,...s}=e,a[0]=e,a[1]=o,a[2]=s);let c;a[3]===o?c=a[4]:(c=Nr("flex items-center justify-center peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground data-[state=indeterminate]:bg-primary data-[state=indeterminate]:text-primary-foreground",o),a[3]=o,a[4]=c);let f;a[5]===Symbol.for("react.memo_cache_sentinel")?(f=Nr("flex items-center justify-center text-current max-h-[14px] overflow-hidden"),a[5]=f):f=a[5];let d;a[6]===s.checked?d=a[7]:(d=(0,P.jsx)($0,{className:f,children:s.checked==="indeterminate"?(0,P.jsx)(Zm,{className:"h-4 w-4"}):(0,P.jsx)(CL,{className:"h-4 w-4"})}),a[6]=s.checked,a[7]=d);let m;return a[8]!==s||a[9]!==t||a[10]!==c||a[11]!==d?(m=(0,P.jsx)(Bd,{ref:t,className:c,...s,children:d}),a[8]=s,a[9]=t,a[10]=c,a[11]=d,a[12]=m):m=a[12],m}),jl.displayName=Bd.displayName,px="_";var WT=new Set("__*.marimo.app.False.None.True.__peg_parser__.and.as.assert.async.await.break.class.continue.def.del.elif.else.except.finally.for.from.global.if.import.in.is.lambda.nonlocal.not.or.pass.raise.return.try.while.with.yield.None.setup".split("."));Lm=function(e,t=!0){return e=e.trim(),e?(/^\d/.test(e)&&(e=`_${e}`),e=e.replaceAll(/\W/g,"_"),t?e.toLowerCase():e):"_"},wx=function(e,t){let a=new Set(t),o=e,s=f=>!a.has(f)&&!WT.has(f);if(s(e))return e;let c=1;for(;!s(o);)o=`${e}_${c}`,c++;return o},gx=function(e,t){return km(e)?`cell-${t}`:e},km=function(e){return e?e==="_"||e==="__":!0};var UT=Bn();function KT(e){let t=(0,UT.c)(15),{minWidth:a,padding:o}=e,s=a===void 0?70:a,c=o===void 0?15:o,[f,d]=(0,xe.useState)(50),m=(0,xe.useRef)(null),b=(0,xe.useRef)(null),w;t[0]===c?w=t[1]:(w=A=>{if(b.current&&m.current){let q=b.current;q.style.fontSize=window.getComputedStyle(m.current).fontSize,q.style.fontFamily=window.getComputedStyle(m.current).fontFamily,q.textContent=A;let $=q.offsetWidth;d($+c)}},t[0]=c,t[1]=w);let x=w,S;t[2]===x?S=t[3]:(S=()=>{var A;x(((A=m.current)==null?void 0:A.value)??"")},t[2]=x,t[3]=S),kL(S);let E;t[4]===x?E=t[5]:(E=A=>{x(A.target.value)},t[4]=x,t[5]=E);let T=`${f}px`,M=`${s}px`,z;t[6]!==T||t[7]!==M?(z={width:T,minWidth:M},t[6]=T,t[7]=M,t[8]=z):z=t[8];let B;t[9]!==E||t[10]!==z?(B={ref:m,type:"text",onChange:E,style:z},t[9]=E,t[10]=z,t[11]=B):B=t[11];let V=B,N;t[12]===Symbol.for("react.memo_cache_sentinel")?(N={ref:b,style:{visibility:"hidden",position:"absolute",whiteSpace:"pre"}},t[12]=N):N=t[12];let X=N,ce;return t[13]===V?ce=t[14]:(ce={inputProps:V,spanProps:X},t[13]=V,t[14]=ce),ce}var QT=Bn();function GT({currentQuotePrefix:e,checked:t,prefix:a}){let o=e;return t?e===""?o=a:e!=="rf"&&a!==e&&(o="rf"):e===a?o="":e==="rf"&&(o=a==="r"?"f":"r"),o}let cv;cv=()=>{let e=(0,QT.c)(2),t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,P.jsxs)("section",{className:"flex flex-col gap-0.5",children:[(0,P.jsxs)("header",{className:"flex items-center gap-1",children:[(0,P.jsx)("code",{className:"text-xs px-1 py-0.5 bg-(--slate-2) rounded",children:"r"}),(0,P.jsx)("span",{className:"font-semibold",children:"Raw String"})]}),(0,P.jsx)("p",{className:"text-sm text-muted-foreground",children:"Write LaTeX without escaping special characters"}),(0,P.jsx)("pre",{className:"text-xs bg-(--slate-2) p-2 rounded",children:"\\alpha \\beta"})]}),e[0]=t):t=e[0];let a;return e[1]===Symbol.for("react.memo_cache_sentinel")?(a=(0,P.jsxs)("div",{className:"flex flex-col gap-3.5",children:[t,(0,P.jsxs)("section",{className:"flex flex-col gap-0.5",children:[(0,P.jsxs)("header",{className:"flex items-center gap-1",children:[(0,P.jsx)("code",{className:"text-xs px-1 py-0.5 bg-(--slate-2) rounded",children:"f"}),(0,P.jsx)("span",{className:"font-semibold",children:"Format String"})]}),(0,P.jsx)("p",{className:"text-sm text-muted-foreground",children:"Interpolate Python values"}),(0,P.jsxs)("pre",{className:"text-xs bg-(--slate-2) p-2 rounded",children:["Hello ","{name}","! \u{1F601}"]})]})]}),e[1]=a):a=e[1],a},jm="data-cell-id",V_=function(e){return{[jm]:e}},y0="data-for-cell-id",wd=function(e){return{[y0]:e}};var JT="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eClickHouse%3c/title%3e%3cpath%20d='M21.333%2010H24v4h-2.667ZM16%201.335h2.667v21.33H16Zm-5.333%200h2.666v21.33h-2.666ZM0%2022.665V1.335h2.667v21.33zm5.333-21.33H8v21.33H5.333Z'/%3e%3c/svg%3e",XT="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eDatabricks%3c/title%3e%3cpath%20d='M.95%2014.184L12%2020.403l9.919-5.55v2.21L12%2022.662l-10.484-5.96-.565.308v.77L12%2024l11.05-6.218v-4.317l-.515-.309L12%2019.118l-9.867-5.653v-2.21L12%2016.805l11.05-6.218V6.32l-.515-.308L12%2011.974%202.647%206.681%2012%201.388l7.76%204.368.668-.411v-.566L12%200%20.95%206.27v.72L12%2013.207l9.919-5.55v2.26L12%2015.52%201.516%209.56l-.565.308Z'/%3e%3c/svg%3e",YT="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAGcElEQVR4nNxZa2wcVxU+99557M6+vLazj6xjO6+maWVTl0YpLU1DU9KARNqooQhFVYJUqUWgiocqIVRESPlRoEhIqYoqgSiCItqQPkAEKUWQtlGSJtAY00R5mTjZTfze94x3HvdedMdZnKgS6s7O2kk/a7R3xvY933fOd874yhhucCyYAIWA9IOH2r+35/HUnjU96sBC8fAERQLpj0+mXjdeXM6rzy/no88uK6zolHu97EX8p/f/IWHAv38i9bsH+kIPo/ozhAJBgpR9J419je437xb62Zc7n/tcf+gRsebADYQAxLW2N/ApL/vNq4AdA7Ht2/piT4q15fAp1wEYAGEALYA18TzT1TXQ09O75qPuKbWS8NW4Lan27/pM4gWrBIgFnaIDvKZIpPPKt+nlgpMTi0q5PKqoqvZR950XAREZaz/fmHmFOFijwGHkDDu5PKGs1SlQ5gAAQ+S9U9Y/xM+Wy+WxRvaeFwE770z+OBNQbmYWwPlp63BPh3q7XQaCxAi50gP7Tldf87J3ywVszEQ2bumOf5WZAAajeWoDJjYOMM5BCECEw9miefxwduaol/1b2sQdCon/8BOZX3ETYWYiODFhvrNUC6ylFgJqzl27DxV+xD3GaGkFnl6deS4G8mJqAmRrtaGkoqxiJnazPpt9gPNVa3DvqfKrXmO0rAJ3RSLrHojHd4jMMwvBSMn+d1pSVrv37oXdz50Hx79JOXgtQGsqIAEiT8V7djtVzEiQ4w+K+t9uCmn3uNmX5rL/l8ullw5c1g80E6slFXgkuuixJVKw3y5jxEzExnV7pB3k7rr3hZDBiZl3njk+9u1mY/legSgm0cfiXbtcTziYHJmovNEXC99PZzAV41KMzaLtXGBVmaQltWfCdPLNxPNdwFdii58KYykhXM2AO5MGvTSAgw9aLnUx8zlomCxTKdeHdP14s/F8tdAiIie2RpPfAPcPNYAjRumNOwLRLZwL2rPgHAGnCF6aHPuJ5869Cr5WYFs0/S0ZkTDns9SK1BltI/JicYcEcXAX8L5R+vOblanf+hHTNwFtWGr7QiT9BAPklnWoVt5/qxrZILQI7wvyjHPrjKkfeL0y9QID76Pzavhmoa3RzNdkLMcYEKCA4aJtncjIgVs4oFnbCCGASDtRVrw3Uz7sV1xfBKiAlc2RJV+vkz9vWYMZWesTa1ER5vYEgot27YPvjJ/dXGBOwY+44JeAdaHkQxpRU9QVQGDIrPz1FjV+f/3eFcaRFcdKosicsh8x6/ClBzaEu7YLoqJNDUonVKR0UCTuRT9w9wshpAzb+qmcY2b9iFlH0xVow0r81sCiz9azfdCY3rNWSzw8a5/ZZ2ItPv9UmfiFP7Tn0HQFPhlMbuKIyOKkhThjNc4rBCtRJl5jrvO5W4mSY+beMib/4A/tOTQtYCCY2kTdszmHE7X8/tWBTtf7s7S528IYELxcuviMycWZzF80baHVgdT6/00fu3oso7Tdwa5Ypt7Aw5Zx7M1K7pf+UL4WTVWgQwqnQ5LWLexTpfblEFaT7Jrsc3GMLDw7+a9tFDj1j/YcmqpAWkn06yhERaYP6ZdeHtC6tl6deYPx4q7xY5+/YFfP+kf5WniqQELp6J6hNaNdia8s4TCojkmrjOYVHGin7qsLQdYqvb976uijk455yX/ac/AkYNLKZx9Nb/kNQkAsLJNBW9+/Uk3eJzI/ZlUG36qcfv6MXf3nmtjtO/ZO/v27/tOeA/L6iyu0pfdu7/riATF93s0fffq+toGdM5zmJ+ziuRgJpWSEgy/mXlk/Zk2f8ZfytfDcxOeM828XHH04TAIJjOTgDAlIiPNEmgQTw9Xh146UBn/aavLgVUAmkLk5IkdXFh09l62NHloaWblZjFGMONjMrsTUjqV5qzjuP90Pw9MUmrKms/2x276U0pbcO2Hlh9qUzj6GMJiclk/q5/b+Ovfqg+P29LD/dD+MhnsgSMLhnlDvPQVrOrcmfufjF2cuvI0BqVlj5GDBKmQZsJbMe9+BAZP1yU3fF+tloVV3LzSfhtEbXrWhO7Ri3ULz8PwmzoRXfTqr/+ddf+k0Dk8CEGBMOWccmC8H82bgSUAmfNO6S/q5Bc8+eBUQDXWtz1VP36gCMC4xnfPrZFw2/I9uLZi6u2aXs7ZdGWkNpcbQcAU0LX2XYYxeF/YBLwIYs0twndjnY4H/BgAA//95CrBYRwImwgAAAABJRU5ErkJggg==",ZT="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eDuckDB%3c/title%3e%3cpath%20d='M12%200C5.363%200%200%205.363%200%2012s5.363%2012%2012%2012%2012-5.363%2012-12S18.637%200%2012%200zM9.502%207.03a4.974%204.974%200%200%201%204.97%204.97%204.974%204.974%200%200%201-4.97%204.97A4.974%204.974%200%200%201%204.532%2012a4.974%204.974%200%200%201%204.97-4.97zm6.563%203.183h2.351c.98%200%201.787.782%201.787%201.762s-.807%201.789-1.787%201.789h-2.351v-3.551z'/%3e%3c/svg%3e",e5="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eGoogle%20BigQuery%3c/title%3e%3cpath%20d='M5.676%2010.595h2.052v5.244a5.892%205.892%200%200%201-2.052-2.088v-3.156zm18.179%2010.836a.504.504%200%200%201%200%20.708l-1.716%201.716a.504.504%200%200%201-.708%200l-4.248-4.248a.206.206%200%200%201-.007-.007c-.02-.02-.028-.045-.043-.066a10.736%2010.736%200%200%201-6.334%202.065C4.835%2021.599%200%2016.764%200%2010.799S4.835%200%2010.8%200s10.799%204.835%2010.799%2010.8c0%202.369-.772%204.553-2.066%206.333.025.017.052.028.074.05l4.248%204.248zm-5.028-10.632a8.015%208.015%200%201%200-8.028%208.028h.024a8.016%208.016%200%200%200%208.004-8.028zm-4.86%204.98a6.002%206.002%200%200%200%202.04-2.184v-1.764h-2.04v3.948zm-4.5.948c.442.057.887.08%201.332.072.4.025.8.025%201.2%200V7.692H9.468v9.035z'/%3e%3c/svg%3e",t5=""+new URL("iceberg-COKYXo-A.png",import.meta.url).href,n5="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eMotherDuck%3c/title%3e%3cg%20transform='scale(0.85)%20translate(0,%202)'%3e%3cpath%20fill='%23ff9538'%20d='M1.71%2015.86s7.45%205.32%207.89%205.59c.44.27%201.08.33%201.64.11.56-.22.98-.71%201.11-1.21s1.85-9.49%201.85-9.49c.02-.12.07-.48-.13-.83-.27-.47-.86-.71-1.38-.57-.42.12-.64.44-.7.55-.09.17-.26.45-.57.7-.24.19-.47.3-.58.34-.96.38-2.02.06-2.61-.72-.38-.48-1.04-.67-1.64-.43-.6.24-.94.84-.89%201.45.11.98-.44%201.94-1.4%202.32-.51.21-1.06.21-1.54.05-.12-.03-.51-.12-.89.09-.48.26-.74.84-.61%201.37.09.39.38.62.48.69z'%20/%3e%3cpath%20fill='%23ff9538'%20d='M14.12%204.21s2.65%208.76%202.83%209.24c.19.48.66.92%201.23%201.09.58.16%201.21.03%201.62-.28.41-.31%207.25-6.39%207.25-6.39.09-.08.35-.34.4-.74.07-.53-.25-1.09-.75-1.29-.4-.16-.78-.04-.89%200-.18.08-.48.2-.88.2-.3.01-.55-.05-.67-.08-.99-.28-1.64-1.18-1.63-2.16-.01-.61-.42-1.17-1.04-1.35-.62-.18-1.26.09-1.59.6-.51.84-1.53%201.27-2.52.99-.53-.15-.96-.48-1.25-.91-.07-.09-.33-.4-.76-.48-.54-.09-1.1.22-1.32.71-.16.37-.08.72-.04.84z'%20/%3e%3c/g%3e%3c/svg%3e",r5="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eMySQL%3c/title%3e%3cpath%20d='M16.405%205.501c-.115%200-.193.014-.274.033v.013h.014c.054.104.146.18.214.273.054.107.1.214.154.32l.014-.015c.094-.066.14-.172.14-.333-.04-.047-.046-.094-.08-.14-.04-.067-.126-.1-.18-.153zM5.77%2018.695h-.927a50.854%2050.854%200%2000-.27-4.41h-.008l-1.41%204.41H2.45l-1.4-4.41h-.01a72.892%2072.892%200%2000-.195%204.41H0c.055-1.966.192-3.81.41-5.53h1.15l1.335%204.064h.008l1.347-4.064h1.095c.242%202.015.384%203.86.428%205.53zm4.017-4.08c-.378%202.045-.876%203.533-1.492%204.46-.482.716-1.01%201.073-1.583%201.073-.153%200-.34-.046-.566-.138v-.494c.11.017.24.026.386.026.268%200%20.483-.075.647-.222.197-.18.295-.382.295-.605%200-.155-.077-.47-.23-.944L6.23%2014.615h.91l.727%202.36c.164.536.233.91.205%201.123.4-1.064.678-2.227.835-3.483zm12.325%204.08h-2.63v-5.53h.885v4.85h1.745zm-3.32.135l-1.016-.5c.09-.076.177-.158.255-.25.433-.506.648-1.258.648-2.253%200-1.83-.718-2.746-2.155-2.746-.704%200-1.254.232-1.65.697-.43.508-.646%201.256-.646%202.245%200%20.972.19%201.686.574%202.14.35.41.877.615%201.583.615.264%200%20.506-.033.725-.098l1.325.772.36-.622zM15.5%2017.588c-.225-.36-.337-.94-.337-1.736%200-1.393.424-2.09%201.27-2.09.443%200%20.77.167.977.5.224.362.336.936.336%201.723%200%201.404-.424%202.108-1.27%202.108-.445%200-.77-.167-.978-.5zm-1.658-.425c0%20.47-.172.856-.516%201.156-.344.3-.803.45-1.384.45-.543%200-1.064-.172-1.573-.515l.237-.476c.438.22.833.328%201.19.328.332%200%20.593-.073.783-.22a.754.754%200%2000.3-.615c0-.33-.23-.61-.648-.845-.388-.213-1.163-.657-1.163-.657-.422-.307-.632-.636-.632-1.177%200-.45.157-.81.47-1.085.315-.278.72-.415%201.22-.415.512%200%20.98.136%201.4.41l-.213.476a2.726%202.726%200%2000-1.064-.23c-.283%200-.502.068-.654.206a.685.685%200%2000-.248.524c0%20.328.234.61.666.85.393.215%201.187.67%201.187.67.433.305.648.63.648%201.168zm9.382-5.852c-.535-.014-.95.04-1.297.188-.1.04-.26.04-.274.167.055.053.063.14.11.214.08.134.218.313.346.407.14.11.28.216.427.31.26.16.555.255.81.416.145.094.293.213.44.313.073.05.12.14.214.172v-.02c-.046-.06-.06-.147-.105-.214-.067-.067-.134-.127-.2-.193a3.223%203.223%200%2000-.695-.675c-.214-.146-.682-.35-.77-.595l-.013-.014c.146-.013.32-.066.46-.106.227-.06.435-.047.67-.106.106-.027.213-.06.32-.094v-.06c-.12-.12-.21-.283-.334-.395a8.867%208.867%200%2000-1.104-.823c-.21-.134-.476-.22-.697-.334-.08-.04-.214-.06-.26-.127-.12-.146-.19-.34-.275-.514a17.69%2017.69%200%2001-.547-1.163c-.12-.262-.193-.523-.34-.763-.69-1.137-1.437-1.826-2.586-2.5-.247-.14-.543-.2-.856-.274-.167-.008-.334-.02-.5-.027-.11-.047-.216-.174-.31-.235-.38-.24-1.364-.76-1.644-.072-.18.434.267.862.422%201.082.115.153.26.328.34.5.047.116.06.235.107.356.106.294.207.622.347.897.073.14.153.287.247.413.054.073.146.107.167.227-.094.136-.1.334-.154.5-.24.757-.146%201.693.194%202.25.107.166.362.534.703.393.3-.12.234-.5.32-.835.02-.08.007-.133.048-.187v.015c.094.188.188.367.274.555.206.328.566.668.867.895.16.12.287.328.487.402v-.02h-.015c-.043-.058-.1-.086-.154-.133a3.445%203.445%200%2001-.35-.4%208.76%208.76%200%2001-.747-1.218c-.11-.21-.202-.436-.29-.643-.04-.08-.04-.2-.107-.24-.1.146-.247.273-.32.453-.127.288-.14.642-.188%201.01-.027.007-.014%200-.027.014-.214-.052-.287-.274-.367-.46-.2-.475-.233-1.238-.06-1.785.047-.14.247-.582.167-.716-.042-.127-.174-.2-.247-.303a2.478%202.478%200%2001-.24-.427c-.16-.374-.24-.788-.414-1.162-.08-.173-.22-.354-.334-.513-.127-.18-.267-.307-.368-.52-.033-.073-.08-.194-.027-.274.014-.054.042-.075.094-.09.088-.072.335.022.422.062.247.1.455.194.662.334.094.066.195.193.315.226h.14c.214.047.455.014.655.073.355.114.675.28.962.46a5.953%205.953%200%20012.085%202.286c.08.154.115.295.188.455.14.33.313.663.455.982.14.315.275.636.476.897.1.14.502.213.682.286.133.06.34.115.46.188.23.14.454.3.67.454.11.076.443.243.463.378z'/%3e%3c/svg%3e",uv=""+new URL("postgresql-q8VEBKGg.svg",import.meta.url).href,a5="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eAmazon%20Redshift%3c/title%3e%3cpath%20d='M16.639%209.932a.822.822%200%200%201-.822-.82.823.823%200%200%201%201.645%200c0%20.452-.37.82-.823.82m-2.086%204.994a.823.823%200%200%201-.822-.822.822.822%200%200%201%201.645%200%20.822.822%200%200%201-.823.822m-5.004-.833a.822.822%200%201%201%20.002-1.644.822.822%200%200%201-.002%201.644m-2.083%204.578a.823.823%200%200%201-.823-.82.823.823%200%200%201%201.645%200c0%20.452-.37.82-.822.82m9.173-11.236a1.68%201.68%200%200%200-1.68%201.676c0%20.566.285%201.066.718%201.37l-.782%201.982a1.674%201.674%200%200%200-1.923%201.104l-1.753-.398a1.675%201.675%200%200%200-3.348.103c0%20.432.169.823.438%201.12l-.764%201.79c-.028-.001-.053-.008-.08-.008a1.68%201.68%200%200%200-1.68%201.676%201.68%201.68%200%200%200%203.36%200c0-.593-.312-1.112-.778-1.41l.674-1.579c.161.052.33.088.508.088.661%200%201.228-.386%201.502-.94l1.856.42a1.68%201.68%200%200%200%203.327-.325c0-.5-.224-.943-.574-1.25l.822-2.083c.053.005.104.016.157.016a1.68%201.68%200%200%200%201.68-1.676%201.68%201.68%200%200%200-1.68-1.676M12%2023.145c-4.17%200-7.286-1.252-7.286-2.37V4.79C6.14%205.938%209.131%206.547%2012%206.547c2.869%200%205.86-.609%207.286-1.756v15.983c0%201.12-3.116%202.37-7.286%202.37M12%20.856c4.293%200%207.286%201.274%207.286%202.419%200%201.143-2.993%202.418-7.286%202.418-4.293%200-7.286-1.275-7.286-2.418C4.714%202.129%207.707.855%2012%20.855m8.143%202.419C20.143%201.147%2015.947%200%2012%200%208.052%200%203.857%201.147%203.857%203.274l.002.01h-.002v17.49C3.857%2022.87%208.052%2024%2012%2024c3.947%200%208.143-1.13%208.143-3.226V3.284h-.002l.002-.01'/%3e%3c/svg%3e",i5="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eSnowflake%3c/title%3e%3cpath%20d='M24%203.459c0%20.646-.418%201.18-1.141%201.18-.723%200-1.142-.534-1.142-1.18%200-.647.419-1.18%201.142-1.18.723%200%201.141.533%201.141%201.18zm-.228%200c0-.533-.38-.951-.913-.951s-.913.38-.913.95c0%20.533.38.952.913.952.57%200%20.913-.419.913-.951zm-1.37-.533h.495c.266%200%20.456.152.456.38%200%20.153-.076.229-.19.305l.19.266v.038h-.266l-.19-.266h-.229v.266h-.266zm.495.228h-.229v.267h.229c.114%200%20.152-.038.152-.114.038-.077-.038-.153-.152-.153zM7.602%2012.4c.038-.151.076-.304.076-.456%200-.114-.038-.228-.038-.342-.114-.343-.304-.647-.646-.838l-4.87-2.777c-.685-.38-1.56-.152-1.94.533-.381.685-.153%201.56.532%201.94l2.701%201.56-2.701%201.56c-.685.38-.913%201.256-.533%201.94.38.685%201.256.914%201.94.533l4.832-2.777c.343-.267.571-.533.647-.876zm1.332%202.626c-.266-.038-.57.038-.837.19l-4.832%202.777c-.685.38-.913%201.256-.532%201.94.38.686%201.255.914%201.94.533l2.701-1.56v3.12c0%20.8.647%201.408%201.446%201.408.799%200%201.407-.647%201.407-1.408v-5.592c0-.761-.57-1.37-1.293-1.408zm4.946-6.088c.266.038.57-.038.837-.19l4.832-2.777c.685-.38.913-1.256.532-1.94-.38-.686-1.255-.914-1.94-.533l-2.701%201.56V1.975c0-.799-.647-1.408-1.446-1.408-.799%200-1.446.609-1.446%201.408V7.53c0%20.76.609%201.37%201.332%201.407zM3.265%205.97l4.832%202.777c.266.152.533.19.837.19.723-.038%201.331-.684%201.331-1.407V1.975c0-.799-.646-1.408-1.407-1.408-.799%200-1.446.647-1.446%201.408v3.12l-2.701-1.56c-.685-.38-1.56-.152-1.94.533-.419.646-.19%201.521.494%201.902zm9.093%206.011a.412.412%200%2000-.114-.266l-.57-.571a.346.346%200%2000-.267-.114.412.412%200%2000-.266.114l-.571.57a.411.411%200%2000-.114.267c0%20.076.038.19.114.267l.57.57a.345.345%200%2000.267.114c.076%200%20.19-.038.266-.114l.571-.57a.412.412%200%2000.114-.267zm1.598.533L11.94%2014.53c-.039.038-.153.114-.229.114h-.608a.411.411%200%2001-.267-.114L8.82%2012.514a.408.408%200%2001-.076-.229v-.608c0-.076.038-.19.114-.267l2.016-2.016a.41.41%200%2001.267-.114h.608a.41.41%200%2001.267.114l2.016%202.016a.347.347%200%2001.114.267v.608c-.076.077-.114.19-.19.229zm5.593%205.44l-4.832-2.777c-.266-.152-.57-.19-.837-.152-.723.038-1.332.684-1.332%201.408v5.554c0%20.8.647%201.408%201.408%201.408.799%200%201.446-.647%201.446-1.408v-3.12l2.7%201.56c.686.38%201.561.152%201.941-.533.419-.646.19-1.521-.494-1.94zm2.549-7.533l-2.701%201.56%202.7%201.56c.686.38.914%201.256.533%201.94-.38.685-1.255.913-1.94.533l-4.832-2.778a1.644%201.644%200%2001-.647-.798c-.037-.153-.076-.305-.076-.457%200-.114.039-.228.039-.342.114-.343.342-.647.646-.837l4.832-2.778c.685-.38%201.56-.152%201.94.533.457.609.19%201.484-.494%201.864'/%3e%3c/svg%3e",o5="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eApache%20Spark%3c/title%3e%3cpath%20d='M10.812%200c-.425.013-.845.215-1.196.605a3.593%203.593%200%2000-.493.722c-.355.667-.425%201.415-.556%202.143a551.9%20551.9%200%2000-.726%204.087c-.027.16-.096.227-.244.273C5.83%208.386%204.06%208.94%202.3%209.514c-.387.125-.773.289-1.114.506-1.042.665-1.196%201.753-.415%202.71.346.422.79.715%201.284.936%201.1.49%202.202.976%203.3%201.47.019.01.036.013.053.019h-.004l1.306.535c0%20.023.002.045%200%20.073-.2%202.03-.39%204.063-.58%206.095-.04.419-.012.831.134%201.23.317.87%201.065%201.148%201.881.701.372-.204.666-.497.937-.818%201.372-1.623%202.746-3.244%204.113-4.872.111-.133.205-.15.363-.098.349.117.697.231%201.045.347h.001c.02.012.045.02.073.03l.142.042c1.248.416%202.68.775%203.929%201.19.4.132.622.164%201.045.098.311-.048.592-.062.828-.236.602-.33.995-.957.988-1.682-.005-.427-.154-.813-.35-1.186-.82-1.556-1.637-3.113-2.461-4.666-.078-.148-.076-.243.037-.375%201.381-1.615%202.756-3.236%204.133-4.855.272-.32.513-.658.653-1.058.308-.878-.09-1.57-1-1.741a2.783%202.783%200%2000-1.235.069c-1.974.521-3.947%201.041-5.918%201.57-.175.047-.26.015-.355-.144a353.08%20353.08%200%2000-2.421-4.018%204.61%204.61%200%2000-.652-.849c-.371-.37-.802-.549-1.227-.536zm.172%203.703a.592.592%200%2001.189.211c.87%201.446%201.742%202.89%202.609%204.338.07.118.135.16.277.121%201.525-.41%203.052-.813%204.579-1.217.367-.098.735-.193%201.103-.289a.399.399%200%2001-.1.2c-1.259%201.48-2.516%202.962-3.779%204.438-.11.13-.12.22-.04.37.937%201.803%201.768%203.309%202.498%204.76l-3.696-1.019c-.538-.18-1.077-.358-1.615-.539-.163-.055-.25-.03-.36.1-1.248%201.488-2.504%202.97-3.759%204.454a.398.398%200%2001-.18.132c.035-.378.068-.757.104-1.136.149-1.572.297-3.144.451-4.716-.03-.318.117-.405-.322-.545-1.493-.593-3.346-1.321-4.816-1.905a.595.595%200%2001.24-.134c1.797-.57%203.595-1.14%205.394-1.705.127-.04.199-.092.211-.233.013-.148.05-.294.076-.441.241-1.363.483-2.726.726-4.088.068-.386.14-.771.21-1.157z'/%3e%3c/svg%3e",s5="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eSQLite%3c/title%3e%3cpath%20d='M21.678.521c-1.032-.92-2.28-.55-3.513.544a8.71%208.71%200%200%200-.547.535c-2.109%202.237-4.066%206.38-4.674%209.544.237.48.422%201.093.544%201.561a13.044%2013.044%200%200%201%20.164.703s-.019-.071-.096-.296l-.05-.146a1.689%201.689%200%200%200-.033-.08c-.138-.32-.518-.995-.686-1.289-.143.423-.27.818-.376%201.176.484.884.778%202.4.778%202.4s-.025-.099-.147-.442c-.107-.303-.644-1.244-.772-1.464-.217.804-.304%201.346-.226%201.478.152.256.296.698.422%201.186.286%201.1.485%202.44.485%202.44l.017.224a22.41%2022.41%200%200%200%20.056%202.748c.095%201.146.273%202.13.5%202.657l.155-.084c-.334-1.038-.47-2.399-.41-3.967.09-2.398.642-5.29%201.661-8.304%201.723-4.55%204.113-8.201%206.3-9.945-1.993%201.8-4.692%207.63-5.5%209.788-.904%202.416-1.545%204.684-1.931%206.857.666-2.037%202.821-2.912%202.821-2.912s1.057-1.304%202.292-3.166c-.74.169-1.955.458-2.362.629-.6.251-.762.337-.762.337s1.945-1.184%203.613-1.72C21.695%207.9%2024.195%202.767%2021.678.521m-18.573.543A1.842%201.842%200%200%200%201.27%202.9v16.608a1.84%201.84%200%200%200%201.835%201.834h9.418a22.953%2022.953%200%200%201-.052-2.707c-.006-.062-.011-.141-.016-.2a27.01%2027.01%200%200%200-.473-2.378c-.121-.47-.275-.898-.369-1.057-.116-.197-.098-.31-.097-.432%200-.12.015-.245.037-.386a9.98%209.98%200%200%201%20.234-1.045l.217-.028c-.017-.035-.014-.065-.031-.097l-.041-.381a32.8%2032.8%200%200%201%20.382-1.194l.2-.019c-.008-.016-.01-.038-.018-.053l-.043-.316c.63-3.28%202.587-7.443%204.8-9.791.066-.069.133-.128.198-.194Z'/%3e%3c/svg%3e",l5="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eSupabase%3c/title%3e%3cpath%20d='M11.9%201.036c-.015-.986-1.26-1.41-1.874-.637L.764%2012.05C-.33%2013.427.65%2015.455%202.409%2015.455h9.579l.113%207.51c.014.985%201.259%201.408%201.873.636l9.262-11.653c1.093-1.375.113-3.403-1.645-3.403h-9.642z'/%3e%3c/svg%3e",c5="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3c!--%20Generated%20by%20Pixelmator%20Pro%203.6.17%20--%3e%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Option2SymbolB'%3e%3cg%20id='Layer1-2'%3e%3cg%20id='Group'%20opacity='0.4'%3e%3cpath%20id='Path'%20fill='%23d53c97'%20stroke='none'%20d='M%2017.016802%2012.188573%20C%2017.016802%209.607646%2015.86018%207.293022%2014.039526%205.731081%20C%2013.942595%205.70038%2013.844628%205.671406%2013.745972%205.645189%20C%2013.131133%205.809095%2012.54265%206.059378%2011.998103%206.388559%20C%2013.964327%207.575191%2015.281006%209.730104%2015.281006%2012.188573%20C%2015.279476%2014.563734%2014.033739%2016.764488%2011.998103%2017.988243%20C%2012.542634%2018.317537%2013.131119%2018.567936%2013.745972%2018.731958%20C%2013.844628%2018.705742%2013.942595%2018.67642%2014.039526%2018.645721%20C%2015.86018%2017.084126%2017.016802%2014.769501%2017.016802%2012.188573%20Z'/%3e%3cpath%20id='path1'%20fill='%23d53c97'%20stroke='none'%20d='M%2013.897406%205.609659%20L%2013.894991%205.60759%20C%2013.844973%205.619663%2013.7953%205.631737%2013.745972%205.645189%20C%2013.79599%205.631737%2013.847043%205.622078%2013.897406%205.609659%20Z'/%3e%3cpath%20id='path2'%20fill='%23d53c97'%20stroke='none'%20d='M%201.735796%2012.188573%20C%201.735796%209.164728%203.728925%206.59622%206.470945%205.729357%20C%207.554634%204.797861%208.856011%204.155121%2010.254373%203.860756%20C%209.680216%203.740549%209.095179%203.679977%208.508574%203.68%20C%203.816888%203.68%20-0%207.496887%20-0%2012.188573%20C%20-0%2016.880259%203.816888%2020.697147%208.508574%2020.697147%20C%209.0952%2020.697229%209.680255%2020.636539%2010.254373%2020.516048%20C%208.855971%2020.221794%207.554568%2019.579041%206.470945%2018.647446%20C%203.728925%2017.780582%201.735796%2015.213453%201.735796%2012.188573%20Z'/%3e%3cpath%20id='path3'%20fill='%23d53c97'%20stroke='none'%20d='M%2013.745972%2018.731958%20C%2013.7953%2018.745068%2013.844973%2018.757484%2013.894991%2018.769558%20C%2013.894991%2018.769558%2013.896715%2018.769558%2013.897406%2018.767488%20C%2013.847043%2018.754379%2013.79599%2018.745411%2013.745972%2018.731958%20Z'/%3e%3c/g%3e%3cpath%20id='path4'%20fill='%23ff3b65'%20stroke='none'%20d='M%2020.508402%2012.188573%20C%2020.508402%209.606611%2019.351088%207.290262%2017.5294%205.729357%20C%2016.301817%205.342468%2014.989366%205.313629%2013.745972%205.646223%20C%2016.636665%206.418224%2018.772606%209.058484%2018.772606%2012.189609%20C%2018.772606%2015.320732%2016.636665%2017.960991%2013.745972%2018.731958%20C%2014.98947%2019.064316%2016.301983%2019.034998%2017.5294%2018.647446%20C%2019.419907%2017.034296%2020.508638%2014.673781%2020.508402%2012.188573%20Z'/%3e%3cpath%20id='path5'%20fill='%23ff3b65'%20stroke='none'%20d='M%209.962543%2018.647446%20C%207.220525%2017.780582%205.227395%2015.213453%205.227395%2012.188573%20C%205.227395%209.163693%207.220525%206.59622%209.962543%205.729357%20C%2011.046233%204.797861%2012.34761%204.155121%2013.745972%203.860756%20C%2013.171818%203.74053%2012.586779%203.679956%2012.000173%203.68%20C%207.308832%203.68%203.491599%207.496887%203.491599%2012.188573%20C%203.491599%2016.880259%207.308487%2020.697147%2012.000173%2020.697147%20C%2012.586799%2020.697247%2013.171857%2020.636557%2013.745972%2020.516048%20C%2012.34757%2020.221794%2011.046167%2019.579041%209.962543%2018.647446%20Z'/%3e%3cpath%20id='path6'%20fill='%23383838'%20stroke='none'%20d='M%2015.491772%203.68%20C%2010.800431%203.68%206.983198%207.496887%206.983198%2012.188573%20C%206.983198%2016.880259%2010.800086%2020.697147%2015.491772%2020.697147%20C%2020.183456%2020.697147%2024%2016.880259%2024%2012.188573%20C%2024%207.496887%2020.183456%203.68%2015.491772%203.68%20Z%20M%2022.264549%2012.188573%20C%2022.264549%2015.923018%2019.226215%2018.961351%2015.491772%2018.961351%20C%2011.757326%2018.961351%208.718994%2015.923018%208.718994%2012.188573%20C%208.718994%208.454128%2011.757326%205.415796%2015.491772%205.415796%20C%2019.226215%205.415796%2022.264549%208.454128%2022.264549%2012.188573%20Z'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e",u5=""+new URL("trino-DFsJbQoT.svg",import.meta.url).href,d5=Bn(),f5={sqlite:s5,duckdb:ZT,motherduck:n5,postgres:uv,postgresql:uv,mysql:r5,snowflake:i5,databricks:XT,clickhouse:JT,timeplus:c5,bigquery:e5,trino:u5,iceberg:t5,datafusion:YT,pyspark:o5,redshift:a5,supabase:l5};_m=e=>{let t=(0,d5.c)(11),{name:a,className:o}=e,s=f5[a.toLowerCase()];if(!s){let d;t[0]===o?d=t[1]:(d=Nr("mt-0.5",o),t[0]=o,t[1]=d);let m;return t[2]===d?m=t[3]:(m=(0,P.jsx)(ys,{className:d}),t[2]=d,t[3]=m),m}let c;t[4]!==o||t[5]!==s?(c=Nr("invert-[.5] dark:invert-[.7]",o,s.endsWith(".png")&&"brightness-100 dark:brightness-100 invert-0 dark:invert-0"),t[4]=o,t[5]=s,t[6]=c):c=t[6];let f;return t[7]!==a||t[8]!==c||t[9]!==s?(f=(0,P.jsx)("img",{src:s,alt:a,className:c}),t[7]=a,t[8]=c,t[9]=s,t[10]=f):f=t[10],f};var Vf=Bn();const p5=e=>{let t=(0,Vf.c)(34),{selectedEngine:a,onChange:o,cellId:s}=e,c=rn(nd),f=[],d=[];for(let[de,be]of c.entries())eo.has(de)?f.push(be):d.push(be);let m=lL(),b=a&&!c.has(a),w;t[0]!==c||t[1]!==o||t[2]!==m?(w=de=>{if(de===dv){window.open(fv,"_blank");return}let be=c.get(de);be&&(m(),o(be.name),_y(be.name))},t[0]=c,t[1]=o,t[2]=m,t[3]=w):w=t[3];let x=w,S=v5,E=k8,T;t[4]===s?T=t[5]:(T=wd(s),t[4]=s,t[5]=T);let M;t[6]===Symbol.for("react.memo_cache_sentinel")?(M=(0,P.jsx)(v8,{placeholder:"Select an engine"}),t[6]=M):M=t[6];let z;t[7]===T?z=t[8]:(z=(0,P.jsx)(m5,{...T,children:M}),t[7]=T,t[8]=z);let B=w8,V;t[9]===s?V=t[10]:(V=wd(s),t[9]=s,t[10]=V);let N=_8,X;t[11]===Symbol.for("react.memo_cache_sentinel")?(X=(0,P.jsx)(y8,{children:"Database connections"}),t[11]=X):X=t[11];let ce;t[12]!==b||t[13]!==a?(ce=b&&(0,P.jsx)(em,{value:a,children:(0,P.jsxs)("div",{className:"flex items-center gap-1 opacity-50",children:[(0,P.jsx)(g0,{className:"h-3 w-3"}),(0,P.jsx)("span",{className:"truncate",children:Ey(a)})]})},a),t[12]=b,t[13]=a,t[14]=ce):ce=t[14];let A=S(d),q=d.length>0&&(0,P.jsx)(d_,{}),$=S(f),ie;t[15]===Symbol.for("react.memo_cache_sentinel")?(ie=(0,P.jsx)(d_,{}),t[15]=ie):ie=t[15];let fe;t[16]===Symbol.for("react.memo_cache_sentinel")?(fe=(0,P.jsx)(em,{className:"text-muted-foreground",value:dv,children:(0,P.jsxs)("a",{className:"flex items-center gap-1",href:fv,target:"_blank",rel:"noreferrer",children:[(0,P.jsx)(TL,{className:"h-3 w-3"}),(0,P.jsx)("span",{children:"How to add a database connection"})]})}),t[16]=fe):fe=t[16];let me;t[17]!==N||t[18]!==q||t[19]!==$||t[20]!==X||t[21]!==ce||t[22]!==A?(me=(0,P.jsxs)(N,{children:[X,ce,A,q,$,ie,fe]}),t[17]=N,t[18]=q,t[19]=$,t[20]=X,t[21]=ce,t[22]=A,t[23]=me):me=t[23];let ve;t[24]!==B||t[25]!==me||t[26]!==V?(ve=(0,P.jsx)(B,{...V,children:me}),t[24]=B,t[25]=me,t[26]=V,t[27]=ve):ve=t[27];let ae;return t[28]!==E||t[29]!==x||t[30]!==a||t[31]!==ve||t[32]!==z?(ae=(0,P.jsx)("div",{className:"flex flex-row gap-1 items-center",children:(0,P.jsxs)(E,{value:a,onValueChange:x,children:[z,ve]})}),t[28]=E,t[29]=x,t[30]=a,t[31]=ve,t[32]=z,t[33]=ae):ae=t[33],ae};var dv="__help__",fv="http://docs.marimo.io/guides/working_with_data/sql/#connecting-to-a-custom-database";const h5=()=>{let e=(0,Vf.c)(16),{sqlMode:t,setSQLMode:a}=MT(),o;e[0]!==a||e[1]!==t?(o=()=>{let E=t==="validate"?"default":"validate";E==="default"&&ET(),a(E)},e[0]=a,e[1]=t,e[2]=o):o=e[2];let s=o,c=b5,f=w5,d;e[3]===t?d=e[4]:(d=f(t),e[3]=t,e[4]=d);let m;e[5]===t?m=e[6]:(m=c(t),e[5]=t,e[6]=m);let b=t==="validate"?"Validate":"Default",w;e[7]===b?w=e[8]:(w=(0,P.jsx)("span",{className:"ml-1",children:b}),e[7]=b,e[8]=w);let x;e[9]!==s||e[10]!==m||e[11]!==w?(x=(0,P.jsxs)(f_,{variant:"ghost",size:"sm",onClick:s,className:"h-5 px-1.5 text-xs border-border shadow-none hover:bg-accent",children:[m,w]}),e[9]=s,e[10]=m,e[11]=w,e[12]=x):x=e[12];let S;return e[13]!==d||e[14]!==x?(S=(0,P.jsx)("div",{className:"flex flex-row gap-1 items-center",children:(0,P.jsx)(tm,{delayDuration:300,content:d,children:x})}),e[13]=d,e[14]=x,e[15]=S):S=e[15],S};var m5=e=>{let t=(0,Vf.c)(6),a,o;t[0]===e?(a=t[1],o=t[2]):({children:a,...o}=e,t[0]=e,t[1]=a,t[2]=o);let s;return t[3]!==a||t[4]!==o?(s=(0,P.jsx)(x8,{className:"text-xs border-border shadow-none! ring-0! h-5 px-1.5 hover:bg-accent transition-colors",...o,children:a}),t[3]=a,t[4]=o,t[5]=s):s=t[5],s};function g5(e){return e.source!=="iceberg"}function y5(e){return(0,P.jsx)(em,{value:e.name,children:(0,P.jsxs)("div",{className:"flex items-center gap-1",children:[(0,P.jsx)(_m,{className:"h-3 w-3",name:e.dialect}),(0,P.jsx)("span",{className:"truncate ml-0.5",children:Ey(e.display_name)})]})},e.name)}function v5(e){return e=e.filter(g5),e.map(y5)}function b5(e){return e==="validate"?(0,P.jsx)(mf,{className:"h-3 w-3"}):(0,P.jsx)(um,{className:"h-3 w-3"})}function w5(e){return e==="validate"?(0,P.jsxs)("div",{className:"text-xs",children:[(0,P.jsxs)("div",{className:"font-semibold mb-1 flex flex-row items-center gap-1",children:[(0,P.jsx)(mf,{className:"h-3 w-3"}),"Validate Mode"]}),(0,P.jsx)("p",{children:"Queries are validated as you write them"})]}):(0,P.jsxs)("div",{className:"text-xs",children:[(0,P.jsxs)("div",{className:"font-semibold mb-1 flex flex-row items-center gap-1",children:[(0,P.jsx)(um,{className:"h-3 w-3"}),"Default Mode"]}),(0,P.jsx)("p",{children:"Standard editing"})]})}var pv=Bn(),hv=()=>{let e=(0,pv.c)(1),t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,P.jsx)("div",{className:"h-4 border-r border-border"}),e[0]=t):t=e[0],t};const _5=e=>{let t=(0,pv.c)(102),{view:a}=e,o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={minWidth:50},t[0]=o):o=t[0];let{spanProps:s,inputProps:c}=KT(o),f;t[1]===a.state?f=t[2]:(f=a.state.field(Hn),t[1]=a.state,t[2]=f);let d=f,m;t[3]===a.state?m=t[4]:(m=a.state.facet(ha),t[3]=a.state,t[4]=m);let b=m,w;t[5]===Symbol.for("react.memo_cache_sentinel")?(w=(0,P.jsx)("div",{}),t[5]=w):w=t[5];let x=w,S=!1,E;t[6]===a?E=t[7]:(E=B=>{a.dispatch({effects:md.of(B),changes:{from:0,to:a.state.doc.length,insert:a.state.doc.toString()}})},t[6]=a,t[7]=E);let T=E;if(d instanceof jd){let B;t[8]===a.state?B=t[9]:(B=a.state.field(jr),t[8]=a.state,t[9]=B);let V=B;S=!0;let N;t[10]===T?N=t[11]:(N=Tt=>{let Mt=Lm(Tt.currentTarget.value,!1);Tt.currentTarget.value=Mt,T({dataframeName:Mt})},t[10]=T,t[11]=N);let X=N,ce;t[12]!==T||t[13]!==a?(ce=Tt=>{T({engine:Tt}),DT(a,Tt)},t[12]=T,t[13]=a,t[14]=ce):ce=t[14];let A=ce,q;t[15]===Symbol.for("react.memo_cache_sentinel")?(q=(0,P.jsx)("span",{className:"select-none",children:"Output variable: "}),t[15]=q):q=t[15];let $;t[16]===c?$=t[17]:($=Tt=>{var Mt;(Mt=c.onChange)==null||Mt.call(c,Tt)},t[16]=c,t[17]=$);let ie;t[18]===X?ie=t[19]:(ie=Tt=>{Tt.key==="Enter"&&Tt.shiftKey&&X(Tt)},t[18]=X,t[19]=ie);let fe;t[20]!==c||t[21]!==V.dataframeName||t[22]!==X||t[23]!==$||t[24]!==ie?(fe=(0,P.jsx)("input",{...c,defaultValue:V.dataframeName,onChange:$,onBlur:X,onKeyDown:ie,className:"min-w-14 w-auto border border-border rounded px-1 focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring"}),t[20]=c,t[21]=V.dataframeName,t[22]=X,t[23]=$,t[24]=ie,t[25]=fe):fe=t[25];let me;t[26]===s?me=t[27]:(me=(0,P.jsx)("span",{...s}),t[26]=s,t[27]=me);let ve;t[28]!==fe||t[29]!==me?(ve=(0,P.jsxs)("label",{className:"flex gap-2 items-center",children:[q,fe,me]}),t[28]=fe,t[29]=me,t[30]=ve):ve=t[30];let ae;t[31]!==b||t[32]!==V.engine||t[33]!==A?(ae=(0,P.jsx)(p5,{selectedEngine:V.engine,onChange:A,cellId:b}),t[31]=b,t[32]=V.engine,t[33]=A,t[34]=ae):ae=t[34];let de;t[35]===V.engine?de=t[36]:(de=V.engine==="__marimo_duckdb"&&(0,P.jsx)(h5,{}),t[35]=V.engine,t[36]=de);let be;t[37]!==V.engine||t[38]!==a?(be=async()=>{await BS(a,V.engine)},t[37]=V.engine,t[38]=a,t[39]=be):be=t[39];let oe;t[40]===Symbol.for("react.memo_cache_sentinel")?(oe=(0,P.jsx)(Gm,{className:"h-3 w-3"}),t[40]=oe):oe=t[40];let le;t[41]===be?le=t[42]:(le=(0,P.jsx)(tm,{content:"Format SQL",children:(0,P.jsx)(f_,{variant:"text",size:"icon",onClick:be,children:oe})}),t[41]=be,t[42]=le);let G;t[43]===Symbol.for("react.memo_cache_sentinel")?(G=(0,P.jsx)(hv,{}),t[43]=G):G=t[43];let Oe;t[44]===T?Oe=t[45]:(Oe=Tt=>{T({showOutput:!Tt.target.checked})},t[44]=T,t[45]=Oe);let He=!V.showOutput,et;t[46]!==Oe||t[47]!==He?(et=(0,P.jsx)("input",{type:"checkbox",onChange:Oe,checked:He}),t[46]=Oe,t[47]=He,t[48]=et):et=t[48];let Fe;t[49]===Symbol.for("react.memo_cache_sentinel")?(Fe=(0,P.jsx)("span",{className:"select-none",children:"Hide output"}),t[49]=Fe):Fe=t[49];let Ne;t[50]===et?Ne=t[51]:(Ne=(0,P.jsxs)("label",{className:"flex items-center gap-2",children:[et,Fe]}),t[50]=et,t[51]=Ne);let Le;t[52]!==de||t[53]!==le||t[54]!==Ne?(Le=(0,P.jsxs)("div",{className:"flex items-center gap-2 ml-auto",children:[de,le,G,Ne]}),t[52]=de,t[53]=le,t[54]=Ne,t[55]=Le):Le=t[55];let De;t[56]!==ve||t[57]!==ae||t[58]!==Le?(De=(0,P.jsxs)("div",{className:"flex flex-1 gap-2 items-center",children:[ve,ae,Le]}),t[56]=ve,t[57]=ae,t[58]=Le,t[59]=De):De=t[59],x=De}if(d instanceof ad){S=!0;let B,V,N,X,ce,A,q,$,ie,fe;if(t[60]!==T||t[61]!==a.state){let{quotePrefix:Oe}=a.state.field(jr);V=Oe,V===void 0&&(V="r",T({quotePrefix:V})),fe=(He,et)=>{typeof et=="boolean"&&T({quotePrefix:GT({currentQuotePrefix:V,checked:et,prefix:He})})},X="flex flex-row w-full justify-end gap-1.5 items-center",ie="flex items-center gap-1.5",t[72]===Symbol.for("react.memo_cache_sentinel")?(N=(0,P.jsx)("span",{children:"r"}),t[72]=N):N=t[72],B=jl,A="Toggle raw string",q="w-3 h-3",$=V.includes("r"),ce=He=>{fe("r",He)},t[60]=T,t[61]=a.state,t[62]=B,t[63]=V,t[64]=N,t[65]=X,t[66]=ce,t[67]=A,t[68]=q,t[69]=$,t[70]=ie,t[71]=fe}else B=t[62],V=t[63],N=t[64],X=t[65],ce=t[66],A=t[67],q=t[68],$=t[69],ie=t[70],fe=t[71];let me;t[73]!==B||t[74]!==ce||t[75]!==A||t[76]!==q||t[77]!==$?(me=(0,P.jsx)(B,{"aria-label":A,className:q,checked:$,onCheckedChange:ce}),t[73]=B,t[74]=ce,t[75]=A,t[76]=q,t[77]=$,t[78]=me):me=t[78];let ve;t[79]!==N||t[80]!==me||t[81]!==ie?(ve=(0,P.jsxs)("div",{className:ie,children:[N,me]}),t[79]=N,t[80]=me,t[81]=ie,t[82]=ve):ve=t[82];let ae;t[83]===Symbol.for("react.memo_cache_sentinel")?(ae=(0,P.jsx)("span",{children:"f"}),t[83]=ae):ae=t[83];let de;t[84]===V?de=t[85]:(de=V.includes("f"),t[84]=V,t[85]=de);let be;t[86]===fe?be=t[87]:(be=Oe=>{fe("f",Oe)},t[86]=fe,t[87]=be);let oe;t[88]!==de||t[89]!==be?(oe=(0,P.jsxs)("div",{className:"flex items-center gap-1.5",children:[ae,(0,P.jsx)(jl,{"aria-label":"Toggle f-string",className:"w-3 h-3",checked:de,onCheckedChange:be})]}),t[88]=de,t[89]=be,t[90]=oe):oe=t[90];let le;t[91]===Symbol.for("react.memo_cache_sentinel")?(le=(0,P.jsx)(tm,{content:(0,P.jsx)(cv,{}),children:(0,P.jsx)(ld,{className:"w-3 h-3"})}),t[91]=le):le=t[91];let G;t[92]!==X||t[93]!==ve||t[94]!==oe?(G=(0,P.jsxs)("div",{className:X,children:[ve,oe,le]}),t[92]=X,t[93]=ve,t[94]=oe,t[95]=G):G=t[95],x=G}let M;t[96]===S?M=t[97]:(M=S&&(0,P.jsx)(hv,{}),t[96]=S,t[97]=M);let z;return t[98]!==x||t[99]!==d.type||t[100]!==M?(z=(0,P.jsx)(C8,{children:(0,P.jsxs)("div",{className:"flex justify-between items-center gap-4 pl-2 pt-2",children:[x,M,d.type]})}),t[98]=x,t[99]=d.type,t[100]=M,t[101]=z):z=t[101],z};var Hf=new Qu;ud=_r.define(),Hn=ei.define({create(){return Wn.python},update(e,t){for(let a of t.effects)if(a.is(ud))return a.value;return e},provide:e=>rm.from(e,t=>t.type==="python"?null:a=>$S(a,_5))});function x5(){let e=$T(),t=(a,o)=>{let s=e[o%e.length];return s.isSupported(a)?s:t(a,o+1)};return[fa.of([{key:"F4",preventDefault:!0,run:a=>{let o=a.state.field(Hn),s=e.findIndex(f=>f.type===o.type),c=t(a.state.doc.toString(),s+1);return o===c?!1:(mv({view:a,nextLanguage:c,opts:{keepCodeAsIs:!1}}),!0)}}])]}function mv({view:e,nextLanguage:t,opts:a}){let o=e.state.field(Hn),s=e.state.doc.toString(),c=e.state.facet(py),f=e.state.facet(hy),d=e.state.facet(pf),m=e.state.facet(Zl),b=e.state.facet(my),w=e.state.field(jr),x=e.state.selection.main.head,S;if(a.keepCodeAsIs)S=s,o.type!==t.type&&(w={...t.defaultMetadata});else{let[E,T]=o.transformOut(s,w),[M,z,B]=t.transformIn(E);x+=T,x-=z,x=sm(x,0,M.length),S=M,w=B}e.dispatch({effects:[ud.of(t),pd.of(w),Hf.reconfigure(t.getExtension(m,c,f,d,b)),Nd.reconfigure([]),Cs.of(!0)],changes:a.keepCodeAsIs?void 0:{from:0,to:e.state.doc.length,insert:S},selection:a.keepCodeAsIs?void 0:$t.cursor(x)}),e.dispatch({effects:[Nd.reconfigure([W8()])]}),t.type==="sql"&&jT(e)}$k=function(e){let{placeholderType:t,completionConfig:a,hotkeys:o,cellId:s,lspConfig:c}=e;return[x5(),Hf.of(Wn.python.getExtension(s,a,o,t,c)),Hn,jr]},Ex=function(e){return gv(xr({state:e}).trim())};function gv(e){return e?Wn.markdown.isSupported(e)?Wn.markdown:Wn.sql.isSupported(e)?Wn.sql:Wn.python:Wn.python}ed=function(e,t){e.state.field(Hn).type!==t.language&&mv({view:e,nextLanguage:Wn[t.language],opts:{keepCodeAsIs:t.keepCodeAsIs??!1}})},Vk=function(e,{completionConfig:t,hotkeysProvider:a,lspConfig:o}){let s=e.state.field(Hn),c=e.state.facet(pf),f=e.state.facet(Zl);return f===void 0&&_e.error("Cell ID is undefined in reconfigureLanguageEffect"),c===void 0&&_e.error("Placeholder type is undefined in reconfigureLanguageEffect"),t===void 0&&_e.error("Completion config is undefined in reconfigureLanguageEffect"),Hf.reconfigure(s.getExtension(f,t,a,c,o))},xr=function(e,t,a){let o=e.state.field(Hn),s=e.state.field(jr),c=e.state.doc.toString();return t===void 0?o.transformOut(c,s)[0]:o.transformOut(c.slice(t,a),s)[0]},Yi=function(e,t){let a=e.state.field(Hn),o=gv(t);o.type!==a.type&&ed(e,{language:o.type,keepCodeAsIs:!0});let[s]=e.state.field(Hn).transformIn(t);return sd(e,s),s};function k5(e){let t=e.state.selection.main.head,a=e.state.doc.toString(),o=a.length>0&&a[t-1]===`
122
- `,s=a.length>0&&a[t]===`
123
- `,c=o?t-1:t,f=s?t+1:t;return{beforeCursorCode:xr(e,0,c),afterCursorCode:xr(e,f)}}if(typeof document<"u"){let e="data-temp-href-target";fm.addHook("beforeSanitizeAttributes",t=>{t.tagName==="A"&&(t.hasAttribute("target")||t.setAttribute("target","_self"),t.hasAttribute("target")&&t.setAttribute(e,t.getAttribute("target")||""))}),fm.addHook("afterSanitizeAttributes",t=>{t.tagName==="A"&&t.hasAttribute(e)&&(t.setAttribute("target",t.getAttribute(e)||""),t.removeAttribute(e),t.getAttribute("target")==="_blank"&&t.setAttribute("rel","noopener noreferrer"))})}P0=function(e){let t={USE_PROFILES:{html:!0,svg:!0,mathMl:!0},ADD_TAGS:["use"],ADD_ATTR:["href","xlink:href"],FORCE_BODY:!0,CUSTOM_ELEMENT_HANDLING:{tagNameCheck:/^(marimo-[A-Za-z][\w-]*|iconify-icon)$/,attributeNameCheck:/^[A-Za-z][\w-]*$/},SAFE_FOR_XML:!e.includes("marimo-mermaid")};return fm.sanitize(e,t)};var C5=["marimo-carousel","marimo-tabs","marimo-accordion","marimo-sidebar"],S5="h1, h2, h3, h4, h5, h6";function E5(e){if(typeof DOMParser>"u")return null;let t=[],a=new DOMParser().parseFromString(e,"text/html").querySelectorAll(S5);for(let o of Array.from(a)){let s=o.textContent;if(C5.some(m=>o.closest(m))||!s)continue;let c=Number.parseInt(o.tagName[1],10),f=o.innerHTML,d={name:s,level:c,by:c0(o)};f!==s&&(d.html=P0(f)),t.push(d)}return{items:t}}c0=function(e){let t=e.id;if(t)return{id:t};let a=e.textContent;return{path:`//${e.tagName}[contains(., "${a}")]`}};function T5(e){return{items:e.filter(Boolean).flatMap(t=>t.items)}}Jm=function(e){if(e==null||e.mimetype!=="text/html"&&e.mimetype!=="text/markdown"||e.data==null)return null;try{return an(typeof e.data=="string","expected string"),E5(e.data)}catch{return _e.error("Failed to parse outline"),null}},lk=function(e){return e==null?!1:e.items.some(t=>t.level<=3)};function yv(e,t){let a=f=>f.items.length===0?7:Math.min(...f.items.map(d=>d.level)),o=t[e];if(o==null||o.items.length===0)return _e.warn("Failed to find a starting outline"),null;let s=a(o),c=e+1;for(;c<t.length;){let f=t[c];if(f&&a(f)<=s)return[e,c-1];c++}return[e,t.length-1]}bk=Dl("marimo:rtc:username","",Dd),_0=ar(()=>ms("rtc_v2"));var vv=(vi=class{constructor(){we(this,"lines",[""]);we(this,"cursor",{row:0,col:0})}ensureLine(t){for(;this.lines.length<=t;)this.lines.push("")}moveCursor(t,a){let o=this.cursor.row;this.cursor.row=Math.max(0,this.cursor.row+t),this.cursor.col=Math.max(0,this.cursor.col+a),this.ensureLine(this.cursor.row),t<0&&this.cursor.row<o&&this.lines.splice(this.cursor.row+1)}setCursor(t,a){this.cursor.row=Math.max(0,t),this.cursor.col=Math.max(0,a),this.ensureLine(this.cursor.row)}writeChar(t){this.ensureLine(this.cursor.row);let a=this.lines[this.cursor.row].padEnd(this.cursor.col," ");this.lines[this.cursor.row]=a.slice(0,this.cursor.col)+t+a.slice(this.cursor.col+1),this.cursor.col++}writeString(t){if(t.length===0)return;this.ensureLine(this.cursor.row);let a=this.lines[this.cursor.row].padEnd(this.cursor.col," ");this.lines[this.cursor.row]=a.slice(0,this.cursor.col)+t+a.slice(this.cursor.col+t.length),this.cursor.col+=t.length}control(t){switch(t){case`
124
- `:this.cursor.row++,this.cursor.col=0,this.ensureLine(this.cursor.row);break;case"\r":this.cursor.col=0;break;case" ":this.writeChar(" ");break;case"\b":this.cursor.col=Math.max(0,this.cursor.col-1);break;case"\v":this.cursor.row++,this.ensureLine(this.cursor.row);break}}handleEscape(t){let a=vi.ESCAPE_REGEX.exec(t);if(!a){this.writeString(t);return}let o=a[1].split(";").map(s=>s===""?1:Number.parseInt(s,10));switch(a[2]){case"A":this.moveCursor(-o[0],0);break;case"B":this.moveCursor(o[0],0);break;case"C":this.moveCursor(0,o[0]);break;case"D":this.moveCursor(0,-o[0]);break;case"H":this.setCursor(o[0]-1||0,o[1]-1||0);break;case"J":o[0]===2&&(this.lines=[""],this.setCursor(0,0));break;case"K":switch(this.ensureLine(this.cursor.row),o[0]){case 0:this.lines[this.cursor.row]=this.lines[this.cursor.row].slice(0,this.cursor.col);break;case 1:{let s=this.lines[this.cursor.row].length;this.lines[this.cursor.row]=" ".repeat(this.cursor.col)+this.lines[this.cursor.row].slice(this.cursor.col,s);break}case 2:this.lines[this.cursor.row]="";break}break;default:this.writeString(t);break}}render(){return this.lines.join(`
125
- `)}},we(vi,"ESCAPE_REGEX",/\u001B\[([0-9;]*)([A-DJKH])/u),vi),I5=class{constructor(){we(this,"ESC_REGEX",/\u001B(?:\[[0-9;]*[A-Za-z]|\([0-9A-Za-z])/gu)}parse(e){let t=[],a=0;for(let o of e.matchAll(this.ESC_REGEX)){let s=o.index??0;s>a&&t.push({type:"text",value:e.slice(a,s)}),t.push({type:"escape",value:o[0]}),a=s+o[0].length}return a<e.length&&t.push({type:"text",value:e.slice(a)}),t}},bv=class{constructor(){we(this,"parser",new I5);we(this,"buffer",new vv)}reduce(e){return this.reset(),this.append(e),this.render()}append(e){let t=this.parser.parse(e);if(t.length===1&&t[0].type==="text"){let a=t[0].value;if(!this.hasControlChars(a)){this.buffer.writeString(a);return}}for(let a of t)a.type==="text"?this.processText(a.value):this.buffer.handleEscape(a.value)}reset(){this.buffer=new vv}render(){return this.buffer.render()}hasControlChars(e){for(let t of e)if(t<" ")return!0;return!1}processText(e){let t=0,a=e.length;for(let o=0;o<a;o++){let s=e[o];if(s===`
126
- `||s==="\r"||s===" "||s==="\b"||s==="\v"){if(o>t){let c=e.slice(t,o),f=this.filterControlChars(c);f.length>0&&this.buffer.writeString(f)}this.buffer.control(s),t=o+1}else if(s<" "){if(o>t){let c=e.slice(t,o);c.length>0&&this.buffer.writeString(c)}t=o+1}}if(t<a){let o=e.slice(t),s=this.filterControlChars(o);s.length>0&&this.buffer.writeString(s)}}filterControlChars(e){let t=!1;for(let o of e)if(o<" "){t=!0;break}if(!t)return e;let a="";for(let o of e)o>=" "&&(a+=o);return a}},bc=class D0{constructor(t,a,o,s){we(this,"ansiReducer",new bv);this.mimetype=t,this.channel=a,this.timestamp=o,this.ansiReducer=s,this._data=this.ansiReducer.render()}get data(){return this._data}static create(t){let a=new bv;return a.append(t.data),new D0(t.mimetype,t.channel,t.timestamp,a)}appendData(t){return this.ansiReducer.append(t),new D0(this.mimetype,this.channel,this.timestamp,this.ansiReducer)}toJSON(){return{mimetype:this.mimetype,channel:this.channel,timestamp:this.timestamp,data:this.data}}};function L5(e,t=5e3){let a=[...e];if(a.length<2)return _v(a.map(A5),t);let o=a[a.length-1],s=a[a.length-2];return O5(o,s)&&(wv(o),wv(s),a[a.length-2]=R5(s,o),a.pop()),_v(a,t)}function O5(e,t){let a=e.mimetype==="text/plain"&&t.mimetype==="text/plain";if(!a)return!1;let o=e.channel===t.channel,s=e.channel!=="stdin";return a&&o&&s}function A5(e){return e instanceof bc?e:typeof e.data=="string"?bc.create(e):e}function R5(e,t){return e instanceof bc?e.appendData(t.data):bc.create(e).appendData(t.data)}function wv(e){an(typeof e.data=="string","expected string output")}function _v(e,t){let a=0,o;for(o=e.length-1;o>=0&&a<t;o--){let d=e[o];d.mimetype==="text/plain"?(an(typeof d.data=="string","expected string"),a+=d.data.split(`
127
- `).length):a++}if(a<t)return e;let s=o+1,c={channel:"stderr",mimetype:"text/html",data:`<pre>Streaming output truncated to last ${t} lines.
128
- </pre>`,timestamp:-1},f=e[s];if(f==null)return[c,...e.slice(s+1)];if(f.mimetype==="text/plain"){an(typeof f.data=="string","expected string");let d=f.data.split(`
129
- `),m=t-(a-d.length);return[c,{...f,data:d.slice(-m).join(`
130
- `)},...e.slice(s+1)]}return[c,...e.slice(s+1)]}function M5(e,t){let a={...e};switch(t.status){case"queued":a.interrupted=!1,a.errored=!1,a.runElapsedTimeMs=null,a.debuggerActive=!1;break;case"running":a.interrupted=!1,e.stopped&&(a.output=null),a.status==="queued"&&(a.consoleOutputs=[]),a.stopped=!1,a.runStartTimestamp=t.timestamp,a.lastRunStartTimestamp=t.timestamp;break;case"idle":e.runStartTimestamp&&(a.runElapsedTimeMs=p0.fromSeconds((t.timestamp??0)-e.runStartTimestamp).toMilliseconds(),a.runStartTimestamp=null,a.staleInputs=!1),!e.lastRunStartTimestamp&&t.timestamp&&(a.lastRunStartTimestamp=t.timestamp),a.debuggerActive=!1;break;case null:break;case"disabled-transitively":break;case void 0:break;default:fs(t.status)}a.output=t.output??a.output,a.staleInputs=t.stale_inputs??a.staleInputs,a.status=t.status??a.status,t.serialization!==void 0&&(a.serialization=t.serialization);let o=!1;t.output!=null&&t.output.mimetype==="application/vnd.marimo+error"&&((a.status==="queued"||a.status==="running")&&(a.status="idle"),an(Array.isArray(t.output.data),"Expected error output data to be an array"),t.output.data.some(d=>d.type==="interruption")?(a.interrupted=!0,o=!0):t.output.data.some(d=>d.type.includes("ancestor"))?a.stopped=!0:a.errored=!0);let s=e.consoleOutputs;(o||t.status==="idle")&&(a.debuggerActive=!1,s=s.map(d=>d.channel==="stdin"?{...d,response:d.response??""}:d));let c=t.console;c!=null&&(s=L5(Array.isArray(c)?c:[...s,c])),a.consoleOutputs=s,a.outline=Jm(a.output);let f=[t.console].flat().filter(Boolean).filter(d=>d.channel==="pdb");return f.length>0&&f.some(d=>d.data==="start")&&(a.debuggerActive=!0),a}function P5(e){let t={...e};return e.status!=="disabled-transitively"&&(t.status="queued"),t.interrupted=!1,t.errored=!1,t.runElapsedTimeMs=null,t.debuggerActive=!1,t}r0=function(e){return e==="running"||e==="queued"},ak=function(e,t){let{status:a,output:o,runStartTimestamp:s,interrupted:c,staleInputs:f}=e;if(c)return!1;if(t)return!0;let d=r0(a),m=a==="running"&&o!==null&&s!==null&&(o.timestamp??0)>s;return d&&!m?!0:f},Wx=function(){let e=Te.get(Ld);return xd(e,"internal-error: initial mode not found"),an(e!=="present","internal-error: initial mode cannot be 'present'"),e},Zx=function(e){return e==="read"||e==="home"||e==="gallery"?e:e==="edit"?"present":"edit"},A0=Ee({mode:o_()?"read":"not-set",cellAnchor:null}),Ld=Ee(void 0),L0=Ee(!1),gk=function(){let{mode:e}=rn(A0);return e!=="read"};function gi(e,t){if(!e){_e.warn("getCell: cellId is undefined");return}let a=t.cellData[e];if(!a){_e.warn(`getCell: cell ${e} not found in state`);return}return a}function xv(e,t){let a=t.cellIds.inOrderIds,o=a.indexOf(e);if(o>0)return{after:a[o-1]};if(o===0&&a.length>1)return{before:a[1]}}function kv(e){let t=new Map,a=e.cellIds.getColumns();for(let[o,s]of a.entries())for(let c of s.inOrderIds)t.set(c,o);return t}function wo(e,t){let a=new Set(e.cellIds.inOrderIds),o=[];for(let s of t.cellIds.inOrderIds)if(!a.has(s)){let c=gi(s,t);c&&o.push({type:"create-cell",cellId:c.id,code:c.code,name:c.name,config:c.config,...xv(c.id,t)})}return o}function N5(e,t){let a=new Set(t.cellIds.inOrderIds),o=[];for(let s of e.cellIds.inOrderIds)a.has(s)||o.push({type:"delete-cell",cellId:s});return o}function wc(e,t){let a=kv(e),o=kv(t),s=[];for(let[c,f]of o)if(a.get(c)!==f){let d=gi(c,t);s.push({type:"set-config",cellId:c,column:f,disabled:(d==null?void 0:d.config.disabled)??!1,hideCode:(d==null?void 0:d.config.hide_code)??!1})}return s.push({type:"reorder-cells",cellIds:t.cellIds.inOrderIds}),s}function D5(e,t,a){switch(a.type){case"createNewCell":return wo(e,t);case"deleteCell":return[{type:"delete-cell",cellId:a.payload.cellId}];case"moveCell":case"sendToTop":case"sendToBottom":{let{cellId:o}=a.payload;return[{type:"move-cell",cellId:o,...xv(o,t)}]}case"dropCellOverCell":case"dropCellOverColumn":case"moveCellToIndex":case"moveCellsRelativeTo":return wc(e,t);case"updateCellCode":{let o=gi(a.payload.cellId,t);return o?[{type:"set-code",cellId:o.id,code:o.code}]:[]}case"updateCellName":{let o=gi(a.payload.cellId,t);return o?[{type:"set-name",cellId:o.id,name:o.name}]:[]}case"updateCellConfig":{let{cellId:o}=a.payload,s=gi(o,t);return s?[{type:"set-config",cellId:o,column:s.config.column??null,disabled:s.config.disabled??!1,hideCode:s.config.hide_code??!1}]:[]}case"dropOverNewColumn":case"moveColumn":case"addColumnBreakpoint":case"deleteColumn":case"mergeAllColumns":case"compactColumns":return wc(e,t);case"addColumn":return[...wo(e,t),...wc(e,t)];case"undoDeleteCell":{let o=wo(e,t),s=wc(e,t);return o.length===0?s:s.length>1?[...o,...s]:o}case"splitCell":{let{cellId:o}=a.payload,s=gi(o,t);return s?[{type:"set-code",cellId:o,code:s.code},...wo(e,t)]:[]}case"undoSplitCell":{let{cellId:o}=a.payload,s=gi(o,t);return s?[{type:"set-code",cellId:o,code:s.code},...N5(e,t)]:[]}case"moveToNextCell":return wo(e,t);case"addSetupCellIfDoesntExist":return wo(e,t);case"focusCell":case"focusTopCell":case"focusBottomCell":case"scrollToTarget":case"showCellIfHidden":case"markTouched":case"markUntouched":return[];case"prepareForRun":case"handleCellMessage":case"setCellIds":case"rebuildCellColumns":case"setCellCodes":case"setCells":case"setStdinResponse":case"clearSerializedEditorState":case"clearCellOutput":case"clearCellConsoleOutput":case"clearAllCellOutputs":case"clearLogs":return[];case"foldAll":case"unfoldAll":case"collapseCell":case"expandCell":case"collapseAllCells":case"expandAllCells":return[];default:cL(a)}}function j5(e){let t=new Set,a=new Set;for(let o of e)o.type==="create-cell"?t.add(o.cellId):o.type==="delete-cell"&&a.add(o.cellId);return t.intersection(a)}function z5(e,t){var o,s,c;let a=[];for(let f of e)switch(f.type){case"create-cell":{let d="__end__",m=!1;f.after?(d=f.after,m=!1):f.before&&(d=f.before,m=!0),a.push({type:"createNewCell",payload:{cellId:d,before:m,code:f.code,newCellId:f.cellId,autoFocus:!1,hideCode:((o=f.config)==null?void 0:o.hide_code)??!1}}),f.name&&a.push({type:"updateCellName",payload:{cellId:f.cellId,name:f.name}}),(((s=f.config)==null?void 0:s.disabled)!=null||((c=f.config)==null?void 0:c.column)!=null)&&a.push({type:"updateCellConfig",payload:{cellId:f.cellId,config:{...f.config.disabled!=null&&{disabled:f.config.disabled},...f.config.column!=null&&{column:f.config.column}}}});break}case"delete-cell":a.push({type:"deleteCell",payload:{cellId:f.cellId}});break;case"move-cell":{let d=[...t()],m=f.cellId,b=d.indexOf(m);if(b<0)break;if(d.splice(b,1),f.after){let w=d.indexOf(f.after);w>=0?d.splice(w+1,0,m):d.push(m)}else if(f.before){let w=d.indexOf(f.before);w>=0?d.splice(w,0,m):d.unshift(m)}else d.push(m);a.push({type:"setCellIds",payload:{cellIds:d}});break}case"reorder-cells":a.push({type:"setCellIds",payload:{cellIds:f.cellIds}});break;case"set-code":a.push({type:"setCellCodes",payload:{ids:[f.cellId],codes:[f.code],codeIsStale:!0}});break;case"set-name":a.push({type:"updateCellName",payload:{cellId:f.cellId,name:f.name}});break;case"set-config":a.push({type:"updateCellConfig",payload:{cellId:f.cellId,config:{column:f.column,disabled:f.disabled,hide_code:f.hideCode}}});break}return a}var Cv=new Set(["set-code","set-name","set-config"]),q5=new Set(["set-code","set-name","set-config","move-cell"]);function F5(e){let t=new Set;for(let s of e)s.type==="delete-cell"&&t.add(s.cellId);let a=e.filter(s=>!(q5.has(s.type)&&"cellId"in s&&t.has(s.cellId))),o=new Map;return a.forEach((s,c)=>{Cv.has(s.type)&&"cellId"in s&&o.set(`${s.type}:${s.cellId}`,c)}),a.filter((s,c)=>Cv.has(s.type)&&"cellId"in s?o.get(`${s.type}:${s.cellId}`)===c:!0)}var $f=[],B5=Zh(()=>{let e=F5($f);$f=[],e.length!==0&&ir().sendDocumentTransaction({changes:e})},400);function V5(e){return"cellId"in e&&e.cellId==="__scratch__"}function H5(e){Te.get(L0)||V5(e)||($f.push(e),B5())}function $5(e,t,a){for(let o of D5(e,t,a))H5(o)}dk=function(e,t,a){var d;let o=j5(e),s=[...e.filter(m=>m.type!=="set-config"),...e.filter(m=>m.type==="set-config")],c=!1,f=null;for(let m of s)if(!(o.size>0&&"cellId"in m&&o.has(m.cellId))){m.type==="set-config"&&(c=!0),m.type==="create-cell"&&((d=m.config)==null?void 0:d.column)!=null&&(c=!0),m.type==="reorder-cells"&&(f=m.cellIds);for(let b of z5([m],a))t[b.type](b.payload)}c&&t.rebuildCellColumns({cellIds:f??a()})};function W5(e,t){return EL(e*1e3,t==null?void 0:t.in)}var Wf=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},ht;(function(e){e[e.EOS=0]="EOS",e[e.Text=1]="Text",e[e.Incomplete=2]="Incomplete",e[e.ESC=3]="ESC",e[e.Unknown=4]="Unknown",e[e.SGR=5]="SGR",e[e.OSCURL=6]="OSCURL"})(ht||(ht={})),E0=class{constructor(){this.VERSION="6.0.6",this.setup_palettes(),this._use_classes=!1,this.bold=!1,this.faint=!1,this.italic=!1,this.underline=!1,this.fg=this.bg=null,this._buffer="",this._url_allowlist={http:1,https:1},this._escape_html=!0,this.boldStyle="font-weight:bold",this.faintStyle="opacity:0.7",this.italicStyle="font-style:italic",this.underlineStyle="text-decoration:underline"}set use_classes(e){this._use_classes=e}get use_classes(){return this._use_classes}set url_allowlist(e){this._url_allowlist=e}get url_allowlist(){return this._url_allowlist}set escape_html(e){this._escape_html=e}get escape_html(){return this._escape_html}set boldStyle(e){this._boldStyle=e}get boldStyle(){return this._boldStyle}set faintStyle(e){this._faintStyle=e}get faintStyle(){return this._faintStyle}set italicStyle(e){this._italicStyle=e}get italicStyle(){return this._italicStyle}set underlineStyle(e){this._underlineStyle=e}get underlineStyle(){return this._underlineStyle}setup_palettes(){this.ansi_colors=[[{rgb:[0,0,0],class_name:"ansi-black"},{rgb:[187,0,0],class_name:"ansi-red"},{rgb:[0,187,0],class_name:"ansi-green"},{rgb:[187,187,0],class_name:"ansi-yellow"},{rgb:[0,0,187],class_name:"ansi-blue"},{rgb:[187,0,187],class_name:"ansi-magenta"},{rgb:[0,187,187],class_name:"ansi-cyan"},{rgb:[255,255,255],class_name:"ansi-white"}],[{rgb:[85,85,85],class_name:"ansi-bright-black"},{rgb:[255,85,85],class_name:"ansi-bright-red"},{rgb:[0,255,0],class_name:"ansi-bright-green"},{rgb:[255,255,85],class_name:"ansi-bright-yellow"},{rgb:[85,85,255],class_name:"ansi-bright-blue"},{rgb:[255,85,255],class_name:"ansi-bright-magenta"},{rgb:[85,255,255],class_name:"ansi-bright-cyan"},{rgb:[255,255,255],class_name:"ansi-bright-white"}]],this.palette_256=[],this.ansi_colors.forEach(a=>{a.forEach(o=>{this.palette_256.push(o)})});let e=[0,95,135,175,215,255];for(let a=0;a<6;++a)for(let o=0;o<6;++o)for(let s=0;s<6;++s){let c={rgb:[e[a],e[o],e[s]],class_name:"truecolor"};this.palette_256.push(c)}let t=8;for(let a=0;a<24;++a,t+=10){let o={rgb:[t,t,t],class_name:"truecolor"};this.palette_256.push(o)}}escape_txt_for_html(e){return this._escape_html?e.replace(/[&<>"']/gm,t=>{if(t==="&")return"&amp;";if(t==="<")return"&lt;";if(t===">")return"&gt;";if(t==='"')return"&quot;";if(t==="'")return"&#x27;"}):e}append_buffer(e){this._buffer+=e}get_next_packet(){var e={kind:ht.EOS,text:"",url:""},t=this._buffer.length;if(t==0)return e;var a=this._buffer.indexOf("\x1B");if(a==-1)return e.kind=ht.Text,e.text=this._buffer,this._buffer="",e;if(a>0)return e.kind=ht.Text,e.text=this._buffer.slice(0,a),this._buffer=this._buffer.slice(a),e;if(a==0){if(t<3)return e.kind=ht.Incomplete,e;var o=this._buffer.charAt(1);if(o!="["&&o!="]"&&o!="(")return e.kind=ht.ESC,e.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),e;if(o=="["){this._csi_regex||(this._csi_regex=Sv(K5||(K5=Wf([`
131
- ^ # beginning of line
132
- #
133
- # First attempt
134
- (?: # legal sequence
135
- \x1B[ # CSI
136
- ([<-?]?) # private-mode char
137
- ([d;]*) # any digits or semicolons
138
- ([ -/]? # an intermediate modifier
139
- [@-~]) # the command
140
- )
141
- | # alternate (second attempt)
142
- (?: # illegal sequence
143
- \x1B[ # CSI
144
- [ -~]* # anything legal
145
- ([\0-:]) # anything illegal
146
- )
147
- `],[`
148
- ^ # beginning of line
149
- #
150
- # First attempt
151
- (?: # legal sequence
152
- \\x1b\\[ # CSI
153
- ([\\x3c-\\x3f]?) # private-mode char
154
- ([\\d;]*) # any digits or semicolons
155
- ([\\x20-\\x2f]? # an intermediate modifier
156
- [\\x40-\\x7e]) # the command
157
- )
158
- | # alternate (second attempt)
159
- (?: # illegal sequence
160
- \\x1b\\[ # CSI
161
- [\\x20-\\x7e]* # anything legal
162
- ([\\x00-\\x1f:]) # anything illegal
163
- )
164
- `]))));let c=this._buffer.match(this._csi_regex);if(c===null)return e.kind=ht.Incomplete,e;if(c[4])return e.kind=ht.ESC,e.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),e;c[1]!=""||c[3]!="m"?e.kind=ht.Unknown:e.kind=ht.SGR,e.text=c[2];var s=c[0].length;return this._buffer=this._buffer.slice(s),e}else if(o=="]"){if(t<4)return e.kind=ht.Incomplete,e;if(this._buffer.charAt(2)!="8"||this._buffer.charAt(3)!=";")return e.kind=ht.ESC,e.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),e;this._osc_st||(this._osc_st=U5(Q5||(Q5=Wf([`
165
- (?: # legal sequence
166
- (\x1B) # ESC | # alternate
167
- (\x07) # BEL (what xterm did)
168
- )
169
- | # alternate (second attempt)
170
- ( # illegal sequence
171
- [\0-] # anything illegal
172
- | # alternate
173
- [\b-] # anything illegal
174
- | # alternate
175
- [-] # anything illegal
176
- )
177
- `],[`
178
- (?: # legal sequence
179
- (\\x1b\\\\) # ESC \\
180
- | # alternate
181
- (\\x07) # BEL (what xterm did)
182
- )
183
- | # alternate (second attempt)
184
- ( # illegal sequence
185
- [\\x00-\\x06] # anything illegal
186
- | # alternate
187
- [\\x08-\\x1a] # anything illegal
188
- | # alternate
189
- [\\x1c-\\x1f] # anything illegal
190
- )
191
- `])))),this._osc_st.lastIndex=0;{let d=this._osc_st.exec(this._buffer);if(d===null)return e.kind=ht.Incomplete,e;if(d[3])return e.kind=ht.ESC,e.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),e}{let d=this._osc_st.exec(this._buffer);if(d===null)return e.kind=ht.Incomplete,e;if(d[3])return e.kind=ht.ESC,e.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),e}this._osc_regex||(this._osc_regex=Sv(G5||(G5=Wf([`
192
- ^ # beginning of line
193
- #
194
- \x1B]8; # OSC Hyperlink
195
- [ -:<-~]* # params (excluding ;)
196
- ; # end of params
197
- ([!-~]{0,512}) # URL capture
198
- (?: # ST
199
- (?:\x1B) # ESC | # alternate
200
- (?:\x07) # BEL (what xterm did)
201
- )
202
- ([ -~]+) # TEXT capture
203
- \x1B]8;; # OSC Hyperlink End
204
- (?: # ST
205
- (?:\x1B) # ESC | # alternate
206
- (?:\x07) # BEL (what xterm did)
207
- )
208
- `],[`
209
- ^ # beginning of line
210
- #
211
- \\x1b\\]8; # OSC Hyperlink
212
- [\\x20-\\x3a\\x3c-\\x7e]* # params (excluding ;)
213
- ; # end of params
214
- ([\\x21-\\x7e]{0,512}) # URL capture
215
- (?: # ST
216
- (?:\\x1b\\\\) # ESC \\
217
- | # alternate
218
- (?:\\x07) # BEL (what xterm did)
219
- )
220
- ([\\x20-\\x7e]+) # TEXT capture
221
- \\x1b\\]8;; # OSC Hyperlink End
222
- (?: # ST
223
- (?:\\x1b\\\\) # ESC \\
224
- | # alternate
225
- (?:\\x07) # BEL (what xterm did)
226
- )
227
- `]))));let c=this._buffer.match(this._osc_regex);if(c===null)return e.kind=ht.ESC,e.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),e;e.kind=ht.OSCURL,e.url=c[1],e.text=c[2];var s=c[0].length;return this._buffer=this._buffer.slice(s),e}else if(o=="(")return e.kind=ht.Unknown,this._buffer=this._buffer.slice(3),e}}ansi_to_html(e){this.append_buffer(e);for(var t=[];;){var a=this.get_next_packet();if(a.kind==ht.EOS||a.kind==ht.Incomplete)break;a.kind==ht.ESC||a.kind==ht.Unknown||(a.kind==ht.Text?t.push(this.transform_to_html(this.with_state(a))):a.kind==ht.SGR?this.process_ansi(a):a.kind==ht.OSCURL&&t.push(this.process_hyperlink(a)))}return t.join("")}with_state(e){return{bold:this.bold,faint:this.faint,italic:this.italic,underline:this.underline,fg:this.fg,bg:this.bg,text:e.text}}process_ansi(e){let t=e.text.split(";");for(;t.length>0;){let a=t.shift(),o=parseInt(a,10);if(isNaN(o)||o===0)this.fg=null,this.bg=null,this.bold=!1,this.faint=!1,this.italic=!1,this.underline=!1;else if(o===1)this.bold=!0;else if(o===2)this.faint=!0;else if(o===3)this.italic=!0;else if(o===4)this.underline=!0;else if(o===21)this.bold=!1;else if(o===22)this.faint=!1,this.bold=!1;else if(o===23)this.italic=!1;else if(o===24)this.underline=!1;else if(o===39)this.fg=null;else if(o===49)this.bg=null;else if(o>=30&&o<38)this.fg=this.ansi_colors[0][o-30];else if(o>=40&&o<48)this.bg=this.ansi_colors[0][o-40];else if(o>=90&&o<98)this.fg=this.ansi_colors[1][o-90];else if(o>=100&&o<108)this.bg=this.ansi_colors[1][o-100];else if((o===38||o===48)&&t.length>0){let s=o===38,c=t.shift();if(c==="5"&&t.length>0){let f=parseInt(t.shift(),10);f>=0&&f<=255&&(s?this.fg=this.palette_256[f]:this.bg=this.palette_256[f])}if(c==="2"&&t.length>2){let f=parseInt(t.shift(),10),d=parseInt(t.shift(),10),m=parseInt(t.shift(),10);if(f>=0&&f<=255&&d>=0&&d<=255&&m>=0&&m<=255){let b={rgb:[f,d,m],class_name:"truecolor"};s?this.fg=b:this.bg=b}}}}}transform_to_html(e){let t=e.text;if(t.length===0||(t=this.escape_txt_for_html(t),!e.bold&&!e.italic&&!e.faint&&!e.underline&&e.fg===null&&e.bg===null))return t;let a=[],o=[],s=e.fg,c=e.bg;e.bold&&a.push(this._boldStyle),e.faint&&a.push(this._faintStyle),e.italic&&a.push(this._italicStyle),e.underline&&a.push(this._underlineStyle),this._use_classes?(s&&(s.class_name==="truecolor"?a.push(`color:rgb(${s.rgb.join(",")})`):o.push(`${s.class_name}-fg`)),c&&(c.class_name==="truecolor"?a.push(`background-color:rgb(${c.rgb.join(",")})`):o.push(`${c.class_name}-bg`))):(s&&a.push(`color:rgb(${s.rgb.join(",")})`),c&&a.push(`background-color:rgb(${c.rgb})`));let f="",d="";return o.length&&(f=` class="${o.join(" ")}"`),a.length&&(d=` style="${a.join(";")}"`),`<span${d}${f}>${t}</span>`}process_hyperlink(e){let t=e.url.split(":");return t.length<1||!this._url_allowlist[t[0]]?"":`<a href="${this.escape_txt_for_html(e.url)}">${this.escape_txt_for_html(e.text)}</a>`}};function Sv(e,...t){let a=e.raw[0].replace(/^\s+|\s+\n|\s*#[\s\S]*?\n|\n/gm,"");return new RegExp(a)}function U5(e,...t){let a=e.raw[0].replace(/^\s+|\s+\n|\s*#[\s\S]*?\n|\n/gm,"");return new RegExp(a,"g")}var K5,Q5,G5,J5=new E0;Id=function(e){try{let t=document.createElement("div");return t.innerHTML=e,(t.textContent||t.innerText||"").split(`
228
- `).map(a=>a.trimEnd()).join(`
229
- `)}catch(t){return _e.error("Error parsing HTML content:",t),e}},Nk=function(e){if(!e)return"";try{return Id(J5.ansi_to_html(e))}catch(t){return _e.error("Error converting ANSI to plain text:",t),e}},i0=Ee(null);let yi;yi=Bn(),Fx=wC,pm=xe.forwardRef((e,t)=>{let a=(0,yi.c)(9),o,s;a[0]===e?(o=a[1],s=a[2]):({className:o,...s}=e,a[0]=e,a[1]=o,a[2]=s);let c;a[3]===o?c=a[4]:(c=Nr("fixed top-0 z-100 flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:w-fit md:max-w-[420px]","print:hidden",o),a[3]=o,a[4]=c);let f;return a[5]!==s||a[6]!==t||a[7]!==c?(f=(0,P.jsx)(lg,{ref:t,className:c,...s}),a[5]=s,a[6]=t,a[7]=c,a[8]=f):f=a[8],f}),pm.displayName=lg.displayName;var Ev={default:"bg-background border",danger:"group destructive text-error border-destructive bg-(--red-1) shadow-md-solid shadow-error"},X5=l8("data-[swipe=move]:transition-none group relative pointer-events-auto flex w-full items-start justify-between gap-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=move]:translate-x-(--radix-toast-swipe-move-x) data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-(--radix-toast-swipe-end-x) data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=open]:slide-in-from-top-full sm:data-[state=open]:slide-in-from-bottom-full data-[state=closed]:slide-out-to-right-full",{variants:{variant:Ev},defaultVariants:{variant:"default"}});function Y5(e){return typeof e=="string"&&e in Ev}Om=xe.forwardRef((e,t)=>{let a=(0,yi.c)(11),o,s,c;a[0]===e?(o=a[1],s=a[2],c=a[3]):({className:o,variant:c,...s}=e,a[0]=e,a[1]=o,a[2]=s,a[3]=c);let f=Y5(c)?c:"default",d;a[4]!==o||a[5]!==f?(d=Nr(X5({variant:f}),"print:hidden",o),a[4]=o,a[5]=f,a[6]=d):d=a[6];let m;return a[7]!==s||a[8]!==t||a[9]!==d?(m=(0,P.jsx)(cg,{ref:t,className:d,...s}),a[7]=s,a[8]=t,a[9]=d,a[10]=m):m=a[10],m}),Om.displayName=cg.displayName;var Tv=xe.forwardRef((e,t)=>{let a=(0,yi.c)(9),o,s;a[0]===e?(o=a[1],s=a[2]):({className:o,...s}=e,a[0]=e,a[1]=o,a[2]=s);let c;a[3]===o?c=a[4]:(c=Nr("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-destructive/30 hover:group-[.destructive]:border-destructive/30 hover:group-[.destructive]:bg-destructive hover:group-[.destructive]:text-destructive-foreground focus:group-[.destructive]:ring-destructive",o),a[3]=o,a[4]=c);let f;return a[5]!==s||a[6]!==t||a[7]!==c?(f=(0,P.jsx)(fg,{ref:t,className:c,...s}),a[5]=s,a[6]=t,a[7]=c,a[8]=f):f=a[8],f});Tv.displayName=fg.displayName,Um=xe.forwardRef((e,t)=>{let a=(0,yi.c)(10),o,s;a[0]===e?(o=a[1],s=a[2]):({className:o,...s}=e,a[0]=e,a[1]=o,a[2]=s);let c;a[3]===o?c=a[4]:(c=Nr("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-hidden focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 hover:group-[.destructive]:text-red-500 focus:group-[.destructive]:ring-red-400 focus:group-[.destructive]:ring-offset-red-600",o),a[3]=o,a[4]=c);let f;a[5]===Symbol.for("react.memo_cache_sentinel")?(f=(0,P.jsx)(SL,{className:"h-4 w-4"}),a[5]=f):f=a[5];let d;return a[6]!==s||a[7]!==t||a[8]!==c?(d=(0,P.jsx)(pg,{ref:t,className:c,"toast-close":"",...s,children:f}),a[6]=s,a[7]=t,a[8]=c,a[9]=d):d=a[9],d}),Um.displayName=pg.displayName,qm=xe.forwardRef((e,t)=>{let a=(0,yi.c)(9),o,s;a[0]===e?(o=a[1],s=a[2]):({className:o,...s}=e,a[0]=e,a[1]=o,a[2]=s);let c;a[3]===o?c=a[4]:(c=Nr("text-sm font-semibold",o),a[3]=o,a[4]=c);let f;return a[5]!==s||a[6]!==t||a[7]!==c?(f=(0,P.jsx)(ug,{ref:t,className:c,...s}),a[5]=s,a[6]=t,a[7]=c,a[8]=f):f=a[8],f}),qm.displayName=ug.displayName,$m=xe.forwardRef((e,t)=>{let a=(0,yi.c)(13),o,s,c;a[0]===e?(o=a[1],s=a[2],c=a[3]):({className:o,onPointerDown:s,...c}=e,a[0]=e,a[1]=o,a[2]=s,a[3]=c);let f;a[4]===o?f=a[5]:(f=Nr("max-h-48 overflow-auto text-sm opacity-90 whitespace-pre-wrap wrap-break-word select-text cursor-text",o),a[4]=o,a[5]=f);let d;a[6]===s?d=a[7]:(d=b=>{b.stopPropagation(),s==null||s(b)},a[6]=s,a[7]=d);let m;return a[8]!==c||a[9]!==t||a[10]!==f||a[11]!==d?(m=(0,P.jsx)(dg,{ref:t,className:f,onPointerDown:d,...c}),a[8]=c,a[9]=t,a[10]=f,a[11]=d,a[12]=m):m=a[12],m}),$m.displayName=dg.displayName;var Iv=!1;function Z5(e){var o;let t=[],a=[e.console].filter(Boolean).flat();for(let s of a){let c=s.mimetype==="text/plain",f=s.mimetype==="text/html"||s.mimetype==="application/vnd.marimo+traceback";if(c||f){let d=s.channel==="stderr"||s.channel==="marimo-error";switch(s.channel){case"stdout":case"stderr":case"marimo-error":{let m=uL.asString(s.data),b=f?Id(m):m;t.push({timestamp:s.timestamp||Date.now(),level:d?"stderr":"stdout",message:b,cellId:e.cell_id});break}default:break}}}if(t.forEach(Lv.log),a.length===0&&Hl((o=e.output)==null?void 0:o.mimetype)&&Array.isArray(e.output.data)){e.output.data.forEach(f=>{Lv.log({level:"stderr",cellId:e.cell_id,timestamp:e.timestamp??0,message:JSON.stringify(f)})});let s=e.output.data.filter(f=>"type"in f&&f.type==="exception"||f.type==="internal"),c=Te.get(Ld)==="read";if(s.length>0&&!Iv&&c){Iv=!0;let f=s.find(d=>d.traceback);Rl(f?{title:"An internal error occurred",description:f.msg||"Click 'View' to see traceback",variant:"danger",action:xe.createElement(Tv,{altText:"View traceback",onClick:()=>{Te.set(i0,{traceback:f.traceback,errorMessage:f.msg||"An internal error occurred"})}},"View")}:{title:"An internal error occurred",description:"See console for details.",variant:"danger"})}}return t}var Lv={log:e=>{let t=e.level==="stdout"?"gray":e.level==="stderr"?"red":"orange",a=e.level.toUpperCase();console.log(`%c[${a}]`,`color:${t}; padding:2px 0; border-radius:2px; font-weight:bold`,`[${x0(e.timestamp)}]`,`(${e.cellId}) ${e.message}`)}};x0=function(e){try{return W5(e).toLocaleTimeString(void 0,{hour12:!0,hour:"numeric",minute:"numeric",second:"numeric"})}catch{return""}},Nx=function(e,t){let a=yd(t);a?a.focus():_e.warn(`[CellFocusManager] focusCellEditor: element not found: ${t}`)},Ix=function(e){let t=document.getElementById(Tn.create(e));t?Uf(t):_e.warn(`[CellFocusManager] focusCell: element not found: ${e}`)},lx=function(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})},Cm=function(){return document.activeElement instanceof HTMLElement&&document.activeElement.classList.contains("marimo-cell")};function Uf(e){try{e.focus()}catch{_e.warn("[CellFocusManager] element may not be focusable",e)}}Tm=function(e,t){let{retries:a,delay:o,initialDelay:s=0}=t,c=0,f=()=>{if(c<a){try{if(e())return}catch(d){_e.error(`Error executing function on attempt ${c+1}, retrying`,{error:d})}c++,setTimeout(f,o)}};s>0?setTimeout(f,s):f()};function e6(){let e=globalThis.scheduler;if(typeof(e==null?void 0:e.postTask)=="function")return t=>{e.postTask(t,{priority:"user-visible"}).catch(a=>{setTimeout(()=>{throw a})})};if(typeof MessageChannel=="function"){let t=[],a=new MessageChannel;return a.port1.onmessage=()=>{var o;(o=t.shift())==null||o()},o=>{t.push(o),a.port2.postMessage(null)}}return t=>{setTimeout(t,0)}}const t6=e6();function n6(e=t6){let t=new Map,a=new Set,o=!1;function s(){o||t.size===0||(o=!0,e(f))}function c(){for(let d of a){if(t.has(d))return d;a.delete(d)}return t.keys().next().value}function f(){o=!1;try{let d=c();if(d!==void 0){let m=t.get(d);t.delete(d),a.delete(d),m==null||m()}}finally{s()}}return{request(d,m){t.set(d,m),s()},promote(d){let m=t.get(d);m&&(t.delete(d),a.delete(d),m())},prioritize(d){t.has(d)&&a.add(d)},deprioritize(d){a.delete(d)},cancel(d){t.delete(d),a.delete(d)}}}Vm=n6();function Ls({cellId:e,cell:t,isCodeHidden:a,codeFocus:o,variableName:s}){var f;if(!t)return;let c=document.getElementById(Tn.create(e));if(!c){_e.warn("scrollCellIntoView: element not found");return}if(Cm()){Uf(c);return}if(a)Uf(c);else{Vm.promote(e);let d=(f=t.current)==null?void 0:f.editorView;if(!d){_e.warn("scrollCellIntoView: editor not found",e);return}if(d.hasFocus||!document.hasFocus())return;if(Tm(()=>(d.focus(),d.hasFocus),{retries:5,delay:20}),o==="top")d.dispatch({selection:{anchor:0,head:0}});else if(o==="bottom"){let m=d.state.doc.line(d.state.doc.lines);d.dispatch({selection:{anchor:m.from,head:m.from}})}else s&&Ml(d,s)}c.scrollIntoView({behavior:"smooth",block:"nearest"})}Uk=function(e){let t=document.getElementById(Tn.create(e));if(!t){_e.warn("scrollCellIntoView: element not found");return}t.classList.add("focus-outline"),setTimeout(()=>{t.classList.remove("focus-outline")},2e3),t.scrollIntoView({behavior:"smooth",block:"center"})};function r6(){let e=document.getElementById("App");e==null||e.scrollTo({top:e.scrollHeight,behavior:"smooth"})}function a6(){var e;(e=document.getElementById("App"))==null||e.scrollTo({top:0,behavior:"smooth"})}H_=function(e){let t=yd(e);if(t!=null&&t.hasFocus){Gy(t,{behavior:"instant"});return}let a=document.getElementById(Tn.create(e));a?a.scrollIntoView({behavior:"instant",block:"nearest"}):_e.warn(`[CellFocusManager] scrollCellIntoView: element not found: ${e}`)},or=function({id:e,name:t="_",code:a="",lastCodeRun:o=null,lastExecutionTime:s=null,edited:c=!1,config:f,serializedEditorState:d=null}){return{id:e,config:f||{hide_code:!1,disabled:!1,column:null},name:t,code:a,edited:c,lastCodeRun:o,lastExecutionTime:s,serializedEditorState:d}};function Ov(e){return{hide_code:!1,disabled:!1,column:null,...e}}$n=function(e){return{outline:null,output:null,consoleOutputs:[],status:"idle",staleInputs:!1,interrupted:!1,errored:!1,stopped:!1,runElapsedTimeMs:null,runStartTimestamp:null,lastRunStartTimestamp:null,debuggerActive:!1,...e}};var _c=Bn();function Av(e){let t={column:0,hide_code:!1,disabled:!1};return{...e,cellData:{[vs]:or({id:vs,config:t}),...e.cellData},cellRuntime:{[vs]:$n(),...e.cellRuntime},cellHandles:{[vs]:(0,xe.createRef)(),...e.cellHandles}}}function i6(){return Av({cellIds:gs.from([]),cellData:{},cellRuntime:{},cellHandles:{},history:[],scrollKey:null,cellLogs:[],untouchedNewCells:new Set})}let o6,Rv,s6,Mv;({reducer:o6,addMiddleware:Rv,createActions:s6,useActions:Mv,valueAtom:Xe}=ds(i6,{createNewCell:(e,t)=>{var z;let{cellId:a,before:o,code:s,name:c,config:f,lastCodeRun:d=null,lastExecutionTime:m=null,autoFocus:b=!0,skipIfCodeExists:w=!1,hideCode:x=void 0}=t,S,E;if(w){for(let B of e.cellIds.inOrderIds)if(((z=e.cellData[B])==null?void 0:z.code)===s)return e}if(a==="__end__"){let B=e.cellIds.atOrThrow(0);S=B.id,E=B.length}else if(typeof a=="string"){let B=e.cellIds.findWithId(a);S=B.id,E=B.topLevelIds.indexOf(a)}else if(a.type==="__end__"){let B=e.cellIds.get(a.columnId)||e.cellIds.atOrThrow(0);S=B.id,E=B.length}else throw Error("Invalid cellId");let T=t.newCellId||ii.create(),M=o?E:E+1;return{...e,cellIds:e.cellIds.insertId(T,S,M),cellData:{...e.cellData,[T]:or({id:T,code:s,name:c,lastCodeRun:d,config:Ov({...f,...x!=null&&{hide_code:x}}),lastExecutionTime:m,edited:!!s&&s!==d})},cellRuntime:{...e.cellRuntime,[T]:$n()},cellHandles:{...e.cellHandles,[T]:(0,xe.createRef)()},scrollKey:b?T:null,untouchedNewCells:x&&b?new Set([...e.untouchedNewCells,T]):e.untouchedNewCells}},moveCell:(e,t)=>{let{cellId:a,before:o,direction:s}=t;if(o!==void 0&&s!==void 0&&_e.warn("Both before and direction specified for moveCell. Ignoring one."),s){let d=e.cellIds.findWithId(a),m=e.cellIds.indexOf(d),b=s==="left"?m-1:m+1,w=e.cellIds.at(b);return w?{...e,cellIds:e.cellIds.moveAcrossColumns(d.id,a,w.id,void 0),scrollKey:a}:e}let c=e.cellIds.findWithId(a),f=c.indexOfOrThrow(a);return o&&f===0?{...e,cellIds:e.cellIds.moveWithinColumn(c.id,f,0),scrollKey:a}:!o&&f===c.length-1?{...e,cellIds:e.cellIds.moveWithinColumn(c.id,f,c.length-1),scrollKey:a}:o?{...e,cellIds:e.cellIds.moveWithinColumn(c.id,f,f-1),scrollKey:a}:{...e,cellIds:e.cellIds.moveWithinColumn(c.id,f,f+1),scrollKey:a}},moveCellToIndex:(e,t)=>{let{cellId:a,columnId:o,index:s}=t,c=e.cellIds.findWithId(a),f=c.indexOfOrThrow(a),d=e.cellIds.get(o);if(!d)return e;let m=Math.max(0,Math.min(s,d.length)),b=c.id===o&&f<m?m-1:m;if(c.id===o&&f===b)return e;let w=e.cellIds.deleteById(a),x=w.get(o);return x?{...e,cellIds:w.insertId(a,o,Math.max(0,Math.min(b,x.length))),scrollKey:null}:e},dropCellOverCell:(e,t)=>{let{cellId:a,overCellId:o}=t,s=e.cellIds.findWithId(a),c=e.cellIds.findWithId(o),f=s.indexOfOrThrow(a),d=c.indexOfOrThrow(o);return s.id===c.id?f===d?e:{...e,cellIds:e.cellIds.moveWithinColumn(s.id,f,d),scrollKey:null}:{...e,cellIds:e.cellIds.moveAcrossColumns(s.id,a,c.id,o),scrollKey:null}},moveCellsRelativeTo:(e,t)=>{let{cellIds:a,targetCellId:o,position:s,previousPlacements:c}=t;if(a.length===0)return e;let f=e.cellIds.moveCellsRelativeTo(a,o,s),d=c&&c.length===a.length?[...e.history,{type:"move",cellIds:a,placements:c}]:e.history;return{...e,cellIds:f,history:d,scrollKey:null}},dropCellOverColumn:(e,t)=>{let{cellId:a,columnId:o}=t,s=e.cellIds.findWithId(a);return{...e,cellIds:e.cellIds.moveAcrossColumns(s.id,a,o,void 0)}},dropOverNewColumn:(e,t)=>{let{cellId:a}=t;return{...e,cellIds:e.cellIds.moveToNewColumn(a)}},moveColumn:(e,t)=>t.column===t.overColumn?e:{...e,cellIds:e.cellIds.moveColumn(t.column,t.overColumn)},focusCell:(e,t)=>{let a=e.cellIds.findWithId(t.cellId);if(a.length===0)return e;let{cellId:o,where:s}=t,c=a.indexOfOrThrow(o),f;f=s==="before"?sm(c-1,0,a.length-1):s==="after"?sm(c+1,0,a.length-1):c;let d=a.atOrThrow(f);return Ls({cellId:d,cell:e.cellHandles[d],isCodeHidden:Os(e,d),codeFocus:s==="after"?"top":"bottom",variableName:void 0}),e},focusTopCell:e=>{let t=e.cellIds.getColumns().at(0);if(t===void 0||t.length===0)return e;let a=t.first();return Ls({cellId:a,cell:e.cellHandles[a],isCodeHidden:Os(e,a),codeFocus:void 0,variableName:void 0}),a6(),e},focusBottomCell:e=>{let t=e.cellIds.getColumns().at(-1);if(t===void 0||t.length===0)return e;let a=t.last();return Ls({cellId:a,cell:e.cellHandles[a],isCodeHidden:Os(e,a),codeFocus:void 0,variableName:void 0}),r6(),e},sendToTop:(e,t)=>{let a=e.cellIds.findWithId(t.cellId);if(a.length===0)return e;let{cellId:o,scroll:s=!0}=t,c=a.indexOfOrThrow(o);return c===0?e:{...e,cellIds:e.cellIds.moveWithinColumn(a.id,c,0),scrollKey:s?o:null}},sendToBottom:(e,t)=>{let a=e.cellIds.findWithId(t.cellId);if(a.length===0)return e;let{cellId:o,scroll:s=!0}=t,c=a.indexOfOrThrow(o),f=a.length-1;return c===f?e:{...e,cellIds:e.cellIds.moveWithinColumn(a.id,c,f),scrollKey:s?o:null}},addColumn:(e,t)=>{let a=ii.create();return{...e,cellIds:e.cellIds.addColumn(t.columnId,[a]),cellData:{...e.cellData,[a]:or({id:a})},cellRuntime:{...e.cellRuntime,[a]:$n()},cellHandles:{...e.cellHandles,[a]:(0,xe.createRef)()},scrollKey:a}},addColumnBreakpoint:(e,t)=>{let{cellId:a}=t;return e.cellIds.getColumns()[0].inOrderIds[0]===a?e:{...e,cellIds:e.cellIds.insertBreakpoint(a)}},deleteColumn:(e,t)=>{let{columnId:a}=t;return{...e,cellIds:e.cellIds.delete(a)}},mergeAllColumns:e=>({...e,cellIds:e.cellIds.mergeAllColumns()}),compactColumns:e=>({...e,cellIds:e.cellIds.compact()}),deleteCell:(e,t)=>{var b,w;let a=t.cellId;if(e.cellIds.hasOnlyOneId())return e;let o;try{o=e.cellIds.findWithId(a)}catch(x){return _e.warn("Skipping delete for missing cellId",{cellId:a,error:x}),e}let s=o.indexOfOrThrow(a),c=s===0?1:s-1,f=null;o.length>1&&(f=o.atOrThrow(c));let d=(w=(b=e.cellHandles[a].current)==null?void 0:b.editorView)==null?void 0:w.state.toJSON({history:nL});d&&(d.doc=e.cellData[a].code),u6(a);let m=e.cellData[a];return{...e,cellIds:e.cellIds.deleteById(a),history:[...e.history,{type:"delete",name:m.name,serializedEditorState:d,column:o.id,index:s,isSetupCell:a===Un,config:m.config}],scrollKey:f}},undoDeleteCell:e=>{if(e.history.length===0)return e;let t=e.history[e.history.length-1];if(t.type==="move"){let{cellIds:w,placements:x}=t;if(w.length===0||x.length!==w.length||w.some(E=>!e.cellData[E]))return{...e,history:e.history.slice(0,-1)};let S=w.map((E,T)=>({id:E,columnId:x[T].columnId,index:x[T].index}));return{...e,cellIds:e.cellIds.placeCells(S),history:e.history.slice(0,-1),scrollKey:w[0]??null}}let{name:a,serializedEditorState:o={doc:""},column:s,index:c,isSetupCell:f,config:d}=t,m=f?Un:ii.create(),b=or({id:m,name:a,code:o.doc,edited:o.doc.trim().length>0,serializedEditorState:o,config:d});return{...e,cellIds:e.cellIds.insertId(m,s,c),cellData:{...e.cellData,[m]:b},cellRuntime:{...e.cellRuntime,[m]:$n()},cellHandles:{...e.cellHandles,[m]:(0,xe.createRef)()},history:e.history.slice(0,-1),scrollKey:m}},clearSerializedEditorState:(e,t)=>{let{cellId:a}=t;return _o({state:e,cellId:a,cellReducer:o=>({...o,serializedEditorState:null})})},updateCellCode:(e,t)=>{let{cellId:a,code:o,formattingChange:s}=t;return e.cellData[a]?_o({state:e,cellId:a,cellReducer:c=>s?{...c,code:o,lastCodeRun:c.edited?c.lastCodeRun:o}:{...c,code:o,edited:o.trim()!==c.lastCodeRun}}):e},updateCellName:(e,t)=>{let{cellId:a,name:o}=t;return _o({state:e,cellId:a,cellReducer:s=>({...s,name:o})})},updateCellConfig:(e,t)=>{let{cellId:a,config:o}=t;return _o({state:e,cellId:a,cellReducer:s=>({...s,config:Ov({...s.config,...o})})})},prepareForRun:(e,t)=>_o({state:As({state:e,cellId:t.cellId,cellReducer:a=>P5(a)}),cellId:t.cellId,cellReducer:a=>({...a,edited:!1,lastCodeRun:a.code.trim()})}),handleCellMessage:(e,t)=>{let a=t.cell_id,o=As({state:e,cellId:a,cellReducer:s=>M5(s,t)});return t.status==="queued"&&(o=_o({state:o,cellId:a,cellReducer:s=>({...s,lastCodeRun:s.code.trim(),edited:!1})})),{...o,cellLogs:[...o.cellLogs,...Z5(t)]}},setCellIds:(e,t)=>{if(YI(e.cellIds.inOrderIds,t.cellIds))return e;let a={...e.cellData},o={...e.cellRuntime},s={...e.cellHandles};for(let c of t.cellIds)c in e.cellData||(a[c]=or({id:c})),c in e.cellRuntime||(o[c]=$n()),c in e.cellHandles||(s[c]=(0,xe.createRef)());return{...e,cellIds:gs.fromWithPreviousShape(t.cellIds,e.cellIds),cellData:a,cellRuntime:o,cellHandles:s}},rebuildCellColumns:(e,t)=>{let a=gs.fromIdsAndColumns(t.cellIds.map(o=>{var s;return[o,((s=e.cellData[o])==null?void 0:s.config.column)??null]}));return{...e,cellIds:a}},setCellCodes:(e,t)=>{var s,c;an(t.codes.length===t.ids.length,"Expected codes and ids to have the same length");let a={...e},o=({cell:f,code:d,cellId:m,name:b,config:w})=>{if(!f)return or({id:m,code:d,name:b,config:w,lastCodeRun:t.codeIsStale?null:d,edited:t.codeIsStale&&d.trim().length>0});let x=t.codeIsStale?f.lastCodeRun:d,S=x?x.trim()!==d.trim():!!d;if(f.code.trim()===d.trim())return{...f,code:d,edited:S,lastCodeRun:x,...b!==void 0&&{name:b},...w!==void 0&&{config:w}};if(!_0()){let E=a.cellHandles[m].current;E!=null&&E.editorViewOrNull&&Yi(E.editorViewOrNull,d)}return{...f,code:d,edited:S,lastCodeRun:x,...b!==void 0&&{name:b},...w!==void 0&&{config:w}}};for(let f=0;f<t.ids.length;f++){let d=t.ids[f],m=t.codes[f];if(d===void 0||m===void 0)continue;let b=(s=t.names)==null?void 0:s[f],w=(c=t.configs)==null?void 0:c[f];a={...a,cellData:{...a.cellData,[d]:o({cell:a.cellData[d],code:m,cellId:d,name:b,config:w})}}}return a},setStdinResponse:(e,t)=>{let{cellId:a,response:o,outputIndex:s}=t;return As({state:e,cellId:a,cellReducer:c=>{let f=[...c.consoleOutputs],d=f[s];return d==null||d.channel!=="stdin"?(_e.warn("Expected stdin output"),c):(f[s]={channel:"stdin",mimetype:d.mimetype,data:d.data,timestamp:d.timestamp,response:o},{...c,interrupted:!1,consoleOutputs:f})}})},setCells:(e,t)=>{let a=Object.fromEntries(t.map(f=>[f.id,f])),o=Uu(),s=f=>{if(!o)return $n();let d=e.cellRuntime[f];return d&&(d.output!=null||d.consoleOutputs.length>0)?d:$n()},c=Object.fromEntries(t.map(f=>[f.id,s(f.id)]));return Av({...e,cellIds:gs.fromIdsAndColumns(t.map(f=>[f.id,f.config.column])),cellData:a,cellRuntime:c,cellHandles:Object.fromEntries(t.map(f=>[f.id,(0,xe.createRef)()]))})},moveToNextCell:(e,t)=>{let{cellId:a,before:o,noCreate:s=!1}=t;if(a==="__scratch__")return e;let c=e.cellIds.findWithId(a),f=c.indexOfOrThrow(a),d=o?f-1:f+1,m=d===c.length,b=d===-1;if(m&&!s){let w=ii.create();return{...e,cellIds:e.cellIds.insertId(w,c.id,d),cellData:{...e.cellData,[w]:or({id:w})},cellRuntime:{...e.cellRuntime,[w]:$n()},cellHandles:{...e.cellHandles,[w]:(0,xe.createRef)()},scrollKey:w}}if(b&&!s){let w=ii.create();return{...e,cellIds:e.cellIds.insertId(w,c.id,0),cellData:{...e.cellData,[w]:or({id:w})},cellRuntime:{...e.cellRuntime,[w]:$n()},cellHandles:{...e.cellHandles,[w]:(0,xe.createRef)()},scrollKey:w}}if((m||b)&&s)return e;if(d>=0&&d<c.length){let w=c.atOrThrow(d);Ls({cellId:w,cell:e.cellHandles[w],isCodeHidden:Os(e,w),codeFocus:o?"bottom":"top",variableName:void 0})}return e},markTouched:(e,t)=>{let{cellId:a}=t;if(e.untouchedNewCells.has(a)){let o=new Set(e.untouchedNewCells);return o.delete(a),{...e,untouchedNewCells:o}}return e},markUntouched:(e,t)=>{let{cellId:a}=t;if(!e.untouchedNewCells.has(a)){let o=new Set(e.untouchedNewCells);return o.add(a),{...e,untouchedNewCells:o}}return e},scrollToTarget:e=>{let t=e.scrollKey;if(t===null)return e;let a=e.cellIds.findWithId(t),o=a.indexOfOrThrow(t),s=o===a.length-1?a.last():a.atOrThrow(o);return Ls({cellId:s,cell:e.cellHandles[s],isCodeHidden:Os(e,s),codeFocus:void 0,variableName:void 0}),{...e,scrollKey:null}},foldAll:e=>(DC(Object.values(e.cellHandles).map(t=>{var a;return(a=t.current)==null?void 0:a.editorView})),e),unfoldAll:e=>(jC(Object.values(e.cellHandles).map(t=>{var a;return(a=t.current)==null?void 0:a.editorView})),e),clearLogs:e=>({...e,cellLogs:[]}),collapseCell:(e,t)=>{let{cellId:a}=t,o=e.cellIds.findWithId(a),s=o.topLevelIds.map(d=>e.cellRuntime[d].outline),c=yv(o.indexOfOrThrow(a),s);if(!c)return e;let f=o.atOrThrow(c[1]);return{...e,cellIds:e.cellIds.transformWithCellId(a,d=>d.collapse(a,f)),scrollKey:a}},expandCell:(e,t)=>{let{cellId:a}=t;return{...e,cellIds:e.cellIds.transformWithCellId(a,o=>o.expand(a)),scrollKey:a}},collapseAllCells:e=>({...e,cellIds:e.cellIds.transformAll(t=>{let a=t.topLevelIds.map(m=>e.cellRuntime[m].outline),o=[...t.nodes],s=[],c=[],f=o.length-1;for(;f>=0;){let m=yv(f,a);if(m){let b=f,w=m[1],x=s.find(T=>T.start<=w&&T.end===w);x&&(w=x.start),s.push({start:b,end:w});let S=t.atOrThrow(b),E=t.atOrThrow(w);c.push({id:S,until:E})}else c.push(null);f--}let d=c.toReversed();return t.collapseAll(d)})}),expandAllCells:e=>({...e,cellIds:e.cellIds.transformAll(t=>t.expandAll())}),showCellIfHidden:(e,t)=>{let{cellId:a}=t,o=e.cellIds.findWithId(a),s=o,c=o.findAndExpandDeep(a);return c.equals(s)?e:{...e,cellIds:e.cellIds.transformWithCellId(a,()=>c)}},splitCell:(e,t)=>{var w;let{cellId:a}=t,o=e.cellIds.findWithId(a),s=o.indexOfOrThrow(a),c=e.cellData[a],f=e.cellHandles[a].current;if((f==null?void 0:f.editorView)==null)return e;let{beforeCursorCode:d,afterCursorCode:m}=k5(f.editorView);Yi(f.editorView,d);let b=ii.create();return{...e,cellIds:e.cellIds.insertId(b,o.id,s+1),cellData:{...e.cellData,[a]:{...c,code:d,edited:!!d&&d.trim()!==((w=c.lastCodeRun)==null?void 0:w.trim())},[b]:or({id:b,code:m,edited:!!m})},cellRuntime:{...e.cellRuntime,[a]:{...e.cellRuntime[a],output:null,consoleOutputs:[]},[b]:$n()},cellHandles:{...e.cellHandles,[b]:(0,xe.createRef)()},scrollKey:b}},undoSplitCell:(e,t)=>{var f;let{cellId:a,snapshot:o}=t,s=e.cellData[a],c=e.cellHandles[a].current;return(c==null?void 0:c.editorView)==null?e:(Yi(c.editorView,o),{...e,cellIds:e.cellIds.transformWithCellId(a,d=>{let m=d.indexOfOrThrow(a)+1;return d.deleteAtIndex(m)}),cellData:{...e.cellData,[a]:{...s,code:o,edited:!!o&&(o==null?void 0:o.trim())!==((f=s.lastCodeRun)==null?void 0:f.trim())}},cellRuntime:{...e.cellRuntime,[a]:{...e.cellRuntime[a],output:null,consoleOutputs:[]}},cellHandles:{...e.cellHandles}})},clearCellOutput:(e,t)=>{let{cellId:a}=t;return As({state:e,cellId:a,cellReducer:o=>({...o,output:null,consoleOutputs:[]})})},clearCellConsoleOutput:(e,t)=>{let{cellId:a}=t;return As({state:e,cellId:a,cellReducer:o=>({...o,consoleOutputs:o.consoleOutputs.filter(s=>s.channel==="stdin"&&s.response==null)})})},clearAllCellOutputs:e=>{let t={...e.cellRuntime};for(let a of e.cellIds.inOrderIds)t[a]={...t[a],output:null,consoleOutputs:[]};return{...e,cellRuntime:t}},addSetupCellIfDoesntExist:(e,t)=>{let{code:a}=t;return e.cellIds.setupCellExists()?{...e,scrollKey:Un}:{...e,cellIds:e.cellIds.insertId(Un,e.cellIds.atOrThrow(0).id,0),cellData:{...e.cellData,[Un]:or({id:Un,name:Un,code:a,edited:!!a})},cellRuntime:{...e.cellRuntime,[Un]:$n()},cellHandles:{...e.cellHandles,[Un]:(0,xe.createRef)()},scrollKey:Un}}})),Rv($5);function Os(e,t){return!!e.cellData[t].config.hide_code&&!e.untouchedNewCells.has(t)}function As({state:e,cellId:t,cellReducer:a}){return t in e.cellRuntime?{...e,cellRuntime:{...e.cellRuntime,[t]:a(e.cellRuntime[t])}}:(_e.warn(`Cell ${t} not found in state`),e)}function _o({state:e,cellId:t,cellReducer:a}){return t in e.cellData?{...e,cellData:{...e.cellData,[t]:a(e.cellData[t])}}:(_e.warn(`Cell ${t} not found in state`),e)}Dk=function(e){let t=e.cellData,a={column:null};return e.cellIds.getColumns().length>1?e.cellIds.getColumns().flatMap((o,s)=>o.inOrderIds.map((c,f)=>{let d={...a};return f===0&&(d.column=s),{...t[c].config,...d}})):e.cellIds.getColumns().flatMap(o=>o.inOrderIds.map(s=>({...t[s].config,...a})))},vd=Ee(e=>e(Xe).cellIds),Vx=Ee(e=>e(vd).hasOnlyOneId()),ik=Ee(e=>I0(e(Xe)).length>0),Ee(e=>e0(e(Xe)).length>0);let Kf,Pv;Mk=Ee(e=>gS(e(Xe))),Tx=Ee(e=>yS(e(Xe))),qk=Ee(e=>mS(e(Xe))),Kf=Ee(e=>{let{cellIds:t,cellRuntime:a,cellData:o}=e(Xe);return t.inOrderIds.map(s=>{var d;let c=a[s],{name:f}=o[s];if(Hl((d=c.output)==null?void 0:d.mimetype)){an(Array.isArray(c.output.data),"Expected array data");let m=c.output.data.filter(b=>!b.type.includes("ancestor"));if(m.length>0)return{output:{...c.output,data:m},cellId:s,cellName:f}}return null}).filter(Boolean)}),Hk=Ee(e=>{let{cellIds:t,cellRuntime:a}=e(Xe);return T5(t.inOrderIds.map(o=>a[o].outline))}),Lk=Ee(e=>e(Kf).length),Pv=XI(Ee(e=>{let{cellIds:t,cellData:a}=e(Xe);return Pr.fromEntries(t.inOrderIds.map(o=>{var s;return[o,(s=a[o])==null?void 0:s.name]}))}));var l6=Ee(e=>e(Xe).scrollKey);Z_=()=>rn(Xe),fk=()=>rn(vd),hx=()=>rn(Pv),pk=()=>rn(Kf),fx=()=>rn(Xe).cellLogs,ix=()=>rn(l6),Cd=()=>Te.get(Xe),Sk=()=>Te.get(Xe).cellIds,nk=()=>{let{cellIds:e,cellData:t}=Te.get(Xe);return e.inOrderIds.map(a=>{var o;return(o=t[a])==null?void 0:o.name}).filter(Boolean)};var c6=LC(CC(Xe,e=>e.cellIds.inOrderIds.map(t=>e.cellData[t])));yx=()=>Zw(c6),Hx=Ee(e=>e(Xe).cellRuntime),Ux=Ee(e=>pS(e(Xe))),Fk=Ee(e=>{let{cellRuntime:t}=e(Xe);return Object.entries(t).every(([a,o])=>o.status!=="running"||a==="__scratch__")}),Cx=Ee(e=>hS(e(Xe))),Q_=Ee(e=>e(Xe).cellIds.colLength),sk=Ee(e=>e(Xe).cellIds.idLength>0),wk=Ee(e=>e(Xe).cellIds.getColumnIds()),Sd=Gd(e=>Ee(t=>t(Xe).cellData[e]));var Qf=Gd(e=>Ee(t=>t(Xe).cellRuntime[e]));const Nv=Gd(e=>Ee(t=>t(Xe).cellHandles[e]));function u6(e){Sd.remove(e),Qf.remove(e),Nv.remove(e)}G_=e=>{let t=(0,_c.c)(2),a;return t[0]===e?a=t[1]:(a=Sd(e),t[0]=e,t[1]=a),rn(a)},vx=e=>{let t=(0,_c.c)(2),a;return t[0]===e?a=t[1]:(a=Qf(e),t[0]=e,t[1]=a),rn(a)},B_=e=>{let t=(0,_c.c)(2),a;return t[0]===e?a=t[1]:(a=Nv(e),t[0]=e,t[1]=a),rn(a)},v0=()=>{let{cellIds:e,cellHandles:t}=Te.get(Xe);return e.inOrderIds.map(a=>{var o,s;return(s=(o=t[a])==null?void 0:o.current)==null?void 0:s.editorViewOrNull}).filter(Boolean)},yd=e=>{var a;let{cellHandles:t}=Te.get(Xe);return(a=t[e].current)==null?void 0:a.editorView},Gx=function(e){let{cellIds:t,cellData:a,cellRuntime:o}=e;return t.getColumns().flatMap(s=>s.topLevelIds.map(c=>({...a[c],...o[c]})))},Ak=function(e){return Ee(t=>t(Xe).untouchedNewCells.has(e))};function d6(e){let t=Qf(e);return Ee(a=>{let o=a(t);if(!o||o.status==="queued"||o.status==="running")return;let s=[],c=o.consoleOutputs;if(c&&c.length>0){let d=c.find(m=>m.mimetype==="application/vnd.marimo+traceback");if(d){let m=d.data;s.push(...mm(m))}}let f=o.output;if((f==null?void 0:f.mimetype)==="application/vnd.marimo+error"){let d=f.data;if(Array.isArray(d))for(let m of d)m.type==="syntax"&&m.lineno!=null&&s.push({kind:"cell",cellId:e,lineNumber:m.lineno}),m.type==="import-star"&&m.lineno!=null&&s.push({kind:"cell",cellId:e,lineNumber:m.lineno})}return s.length>0?s:void 0})}X_=function(e){let t=(0,_c.c)(2),a;return t[0]===e?a=t[1]:(a=e===void 0?{}:e,t[0]=e,t[1]=a),Mv(a)}})();export{pm as $,z_ as $i,q_ as $n,F_ as $r,hm as $t,B_ as A,mm as Ai,gm as An,ym as Ar,V_ as At,H_ as B,$_ as Bi,W_ as Bn,U_ as Br,K_ as Bt,Q_ as C,vm as Ci,Ml as Cn,bm as Cr,Hn as Ct,G_ as D,Pl as Di,J_ as Dn,wm as Dr,_m as Dt,X_ as E,ps as Ei,Y_ as En,xm as Er,ed as Et,Z_ as F,ex as Fi,Nl as Fn,tx as Fr,km as Ft,Cm as G,nx as Gi,td as Gn,Sm as Gr,Em as Gt,Tm as H,hs as Hi,ti as Hn,rx as Hr,ax as Ht,ix as I,Im as Ii,ox as In,nd as Ir,Lm as It,Om as J,rd as Ji,ni as Jn,sx as Jr,ad as Jt,lx as K,Dl as Ki,ms as Kn,Am as Kr,cx as Kt,or as L,ux as Li,dx as Ln,Xi as Lr,jl as Lt,fx as M,Rm as Mi,Mm as Mn,Pm as Mr,px as Mt,hx as N,ri as Ni,mx as Nn,Nm as Nr,gx as Nt,yx as O,ai as Oi,id as On,Dm as Or,jm as Ot,vx as P,gs as Pi,bx as Pn,zm as Pr,wx as Pt,qm as Q,ii as Qi,_x as Qn,xx as Qr,Fm as Qt,$n as R,od as Ri,Bm as Rn,kx as Rr,Wn as Rt,Cx as S,sd as Si,Sx as Sn,ld as Sr,Ex as St,Tx as T,zl as Ti,cd as Tn,ys as Tr,ud as Tt,Ix as U,ql as Ui,Lx as Un,Ox as Ur,Ax as Ut,Vm as V,Rx as Vi,Mx as Vn,dd as Vr,Px as Vt,Nx as W,gn as Wi,Fl as Wn,Dx as Wr,Hm as Wt,$m as X,jx as Xi,Wm as Xn,fd as Xr,pd as Xt,Um as Y,zx as Yi,qx as Yn,Bl as Yr,jr as Yt,Fx as Z,Km as Zi,hd as Zn,Bx as Zr,md as Zt,Vx as _,PL as __tla,Qm as _i,pa as _n,Gm as _r,Jm as _t,Hx as a,Xm as aa,$x as ai,Ym as an,gd as ar,Wx as at,Ux as b,Kx as bi,Qx as bn,Zm as br,Yi as bt,Gx as c,Jx as ca,e0 as ci,Xx as cn,Yx as cr,Zx as ct,yd as d,t0 as di,n0 as dn,Vl as dr,r0 as dt,Tn as ea,ek as ei,a0 as en,tk as er,i0 as et,nk as f,rk as fi,o0 as fn,s0 as fr,ak as ft,ik as g,Hl as gi,ok as gn,l0 as gr,c0 as gt,sk as h,u0 as hi,d0 as hn,f0 as hr,lk as ht,vd as i,ck as ia,ha as ii,p0 as in,uk as ir,dk as it,fk as j,h0 as ji,bd as jn,m0 as jr,wd as jt,pk as k,hk as ki,_d as kn,g0 as kr,y0 as kt,v0 as l,xd as la,mk as li,b0 as ln,kd as lr,gk as lt,Cd as m,yk as mi,vk as mn,Zi as mr,bk as mt,Sd as n,Un as na,eo as ni,Ed as nn,Td as nr,Id as nt,wk as o,_k as oa,xk as oi,kk as on,Ck as or,Ld as ot,Sk as p,Ek as pi,Tk as pn,w0 as pr,_0 as pt,x0 as q,k0 as qi,C0 as qn,S0 as qr,Ik as qt,Lk as r,Od as ra,st as ri,Ok as rn,$l as rr,E0 as rt,Ak as s,T0 as sa,I0 as si,Rk as sn,oi as sr,L0 as st,Mk as t,vs as ta,ma as ti,Pk as tn,Ad as tr,Nk as tt,Dk as u,Rd as ua,O0 as ui,jk as un,zk as ur,A0 as ut,qk as v,R0 as vi,Wl as vn,M0 as vr,P0 as vt,Fk as w,Ul as wi,Bk as wn,Md as wr,Vk as wt,Hk as x,to as xi,Pd as xn,no as xr,$k as xt,Xe as y,Nd as yi,Wk as yn,N0 as yr,xr as yt,Uk as z,bs as zi,Dd as zn,Kk as zr,jd as zt};