@marimo-team/frontend 0.24.1-dev24 → 0.24.1-dev26
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.
- package/dist/assets/{CellStatus-DsvXjUsv.js → CellStatus-DdKYN88d.js} +1 -1
- package/dist/assets/{JsonOutput-D62UH4Ip.js → JsonOutput-htT793Wj.js} +1 -1
- package/dist/assets/LazyAnyLanguageCodeMirror-Bx0i_n8B.js +2 -0
- package/dist/assets/{MarimoErrorOutput-B_IfCm1k.js → MarimoErrorOutput-Db7coyFA.js} +1 -1
- package/dist/assets/{RenderHTML-DY5kbf6q.js → RenderHTML-Cu5JtYZJ.js} +1 -1
- package/dist/assets/{RunButton-BfHw11b3.js → RunButton-BOnl_Dk8.js} +1 -1
- package/dist/assets/{abnfDiagram-N423BO3Z-BBbWbiyb.js → abnfDiagram-N423BO3Z-BhqlQxDe.js} +1 -1
- package/dist/assets/{add-cell-with-ai-B25FLoLF.js → add-cell-with-ai-Chy4ITIT.js} +4 -4
- package/dist/assets/add-connection-dialog-lQ4vVMYK.js +178 -0
- package/dist/assets/{agent-panel-CQobsqAS.js → agent-panel--Nt4UmNj.js} +1 -1
- package/dist/assets/{ai-model-dropdown-CmDWOIkZ.js → ai-model-dropdown-BUCPZ0ND.js} +1 -1
- package/dist/assets/{any-language-editor-B92E_2Sy.js → any-language-editor-CV_jRt2A.js} +1 -1
- package/dist/assets/apl-sEsRK68R.js +1 -0
- package/dist/assets/{app-config-button-BkwiW00-.js → app-config-button-BOxbrv3L.js} +1 -1
- package/dist/assets/architecture-TIHT7OUA-CkB6_TwN.js +1 -0
- package/dist/assets/{architectureDiagram-T3A2C74G-DoGbg0qs.js → architectureDiagram-T3A2C74G-D_0znduP.js} +1 -1
- package/dist/assets/asciiarmor-CwCv7Lne.js +1 -0
- package/dist/assets/asn1-CuzWg-fh.js +1 -0
- package/dist/assets/{blob-BqDSSN5X.js → blob-BVQSODqn.js} +1 -1
- package/dist/assets/{blockDiagram-VBNYF7ZC-Fapk5G8q.js → blockDiagram-VBNYF7ZC-DhnQkFJt.js} +1 -1
- package/dist/assets/brainfuck-CnnfS_cI.js +1 -0
- package/dist/assets/{c4Diagram-5PPSVZJV-DHpoGw8m.js → c4Diagram-5PPSVZJV-DAZWLixJ.js} +1 -1
- package/dist/assets/{cell-editor-CefMlZnX.js → cell-editor-DgOfL9Xv.js} +11 -11
- package/dist/assets/{cell-link-CP4zF1rO.js → cell-link-Bx8FWjns.js} +1 -1
- package/dist/assets/{cells-DD-zwhxi.js → cells-Biwqg0z6.js} +50 -50
- package/dist/assets/channel-97-i68Z5.js +1 -0
- package/dist/assets/{chat-display-59QZ49m7.js → chat-display-B2qUbgnh.js} +1 -1
- package/dist/assets/{chat-panel-CDZbG1OG.js → chat-panel-gxL2S-HQ.js} +1 -1
- package/dist/assets/{chat-ui-DoBTbTFY.js → chat-ui-BhnwgDpa.js} +1 -1
- package/dist/assets/{chunk-2GRJ4B5K-B92Uwj7z.js → chunk-2GRJ4B5K-BJlW2T7a.js} +1 -1
- package/dist/assets/{chunk-2Q5K7J3B-CjxRf8HM.js → chunk-2Q5K7J3B-BKHkc-hn.js} +1 -1
- package/dist/assets/{chunk-3NCLNEKW-D7adDEkj.js → chunk-3NCLNEKW-DYppyU2y.js} +1 -1
- package/dist/assets/{chunk-4I5QYGJK-Cce-HuZg.js → chunk-4I5QYGJK-o2gGFKEO.js} +1 -1
- package/dist/assets/{chunk-5FCAYU7R-BJ04i5uO.js → chunk-5FCAYU7R-B4Jz9Jv5.js} +1 -1
- package/dist/assets/{chunk-5FQGJX7Z-B4N_BMo6.js → chunk-5FQGJX7Z-BIDn9QG0.js} +2 -2
- package/dist/assets/{chunk-5HE753X5-DRFzJ7WN.js → chunk-5HE753X5-DySWu3WO.js} +1 -1
- package/dist/assets/{chunk-5JV3BV7I-BEi9dboc.js → chunk-5JV3BV7I-EFAb-cXP.js} +1 -1
- package/dist/assets/{chunk-5RXB4S5H-B63Jmiyu.js → chunk-5RXB4S5H-Bsyeqyau.js} +1 -1
- package/dist/assets/{chunk-5TONJI2A-C5JJwzzL.js → chunk-5TONJI2A-BtGpymP5.js} +1 -1
- package/dist/assets/{chunk-5VM5RSS4-CQG8Gkf2.js → chunk-5VM5RSS4-De48wE7I.js} +1 -1
- package/dist/assets/{chunk-6Q2QTUOP-CjNw1snm.js → chunk-6Q2QTUOP-UhOQcBq_.js} +1 -1
- package/dist/assets/{chunk-7BUUIJ7U-DFO0zbY5.js → chunk-7BUUIJ7U-VPkRElaC.js} +1 -1
- package/dist/assets/{chunk-7Z6QIM7H-BahVaiTb.js → chunk-7Z6QIM7H-CSiw9nlS.js} +1 -1
- package/dist/assets/{chunk-BIQX33UG-B1y9dy0P.js → chunk-BIQX33UG-Clm0kIyq.js} +1 -1
- package/dist/assets/{chunk-CQNSW5MT-BOOyLCfW.js → chunk-CQNSW5MT-CxPDGEiS.js} +1 -1
- package/dist/assets/{chunk-CYSBUYHQ-DAWZpY6r.js → chunk-CYSBUYHQ-Cx6JgR38.js} +1 -1
- package/dist/assets/{chunk-EMLP6XTP-Bj2I2iEi.js → chunk-EMLP6XTP-DrNgCa2u.js} +1 -1
- package/dist/assets/{chunk-GF5L2VYU-BA39vN3k.js → chunk-GF5L2VYU-B88HnHN4.js} +1 -1
- package/dist/assets/{chunk-I66GZJ75-CgJN5WrL.js → chunk-I66GZJ75-BWcitPjS.js} +3 -3
- package/dist/assets/{chunk-J7OUQ5F2-DK5phbYO.js → chunk-J7OUQ5F2-DuBXnQXx.js} +2 -2
- package/dist/assets/{chunk-JG7HCLWE-BEfUAeKb.js → chunk-JG7HCLWE-D4-rg2bS.js} +1 -1
- package/dist/assets/{chunk-JQJVKLGR-vTeSeIY7.js → chunk-JQJVKLGR-L5fl0mYk.js} +1 -1
- package/dist/assets/{chunk-JWPE2WC7-C-mBVSJi.js → chunk-JWPE2WC7-CIIO5B1k.js} +1 -1
- package/dist/assets/{chunk-KBJHAD2P-BKxl1MSu.js → chunk-KBJHAD2P-MvrqGNli.js} +1 -1
- package/dist/assets/{chunk-MOZMSUNE-C-RMDvp_.js → chunk-MOZMSUNE-t37mHxNa.js} +1 -1
- package/dist/assets/{chunk-NSK5VX7P-bxC5WUDr.js → chunk-NSK5VX7P-B_lLBcNS.js} +1 -1
- package/dist/assets/{chunk-OSBZ3O6U-DEYDoDYT.js → chunk-OSBZ3O6U-3f38erx3.js} +1 -1
- package/dist/assets/{chunk-QBLGF6JB-CBncH5PS.js → chunk-QBLGF6JB-CHob4JDY.js} +1 -1
- package/dist/assets/{chunk-QR6OTTB3-gGVLoYpg.js → chunk-QR6OTTB3-Xk5It1Th.js} +1 -1
- package/dist/assets/{chunk-R7FJI6CG-DWxNgy5y.js → chunk-R7FJI6CG-ClJ6eR5G.js} +1 -1
- package/dist/assets/{chunk-RYQCIY6F-DkXJx61e.js → chunk-RYQCIY6F-CZjjwaqg.js} +1 -1
- package/dist/assets/{chunk-U6XO7XAA-DWWxQ-OA.js → chunk-U6XO7XAA-Ct1fe-tp.js} +1 -1
- package/dist/assets/{chunk-UBXNYLIW-elhI8GOz.js → chunk-UBXNYLIW-XbwBj9py.js} +1 -1
- package/dist/assets/{chunk-W5SLKNZC-D_QNHYYQ.js → chunk-W5SLKNZC-DBMPI1Hf.js} +1 -1
- package/dist/assets/{chunk-WRU74C26-BU1GwH6E.js → chunk-WRU74C26-HbDQnuwB.js} +1 -1
- package/dist/assets/{chunk-XXDRQBXY-D_KNH1wc.js → chunk-XXDRQBXY-DyGGngH3.js} +1 -1
- package/dist/assets/{chunk-YOTPTUD7-Nm5N45o4.js → chunk-YOTPTUD7-CC6lxUuz.js} +1 -1
- package/dist/assets/{chunk-ZIRB5QZD-DKs4kfC7.js → chunk-ZIRB5QZD-Giz-iAOC.js} +1 -1
- package/dist/assets/classDiagram-JCYQIIEL-Bi4N77rq.js +1 -0
- package/dist/assets/classDiagram-v2-OCEON4UE-DDmVp-9r.js +1 -0
- package/dist/assets/{clike-BAN6KopO.js → clike-tfWZyYoN.js} +1 -1
- package/dist/assets/clojure-Bninbb7T.js +1 -0
- package/dist/assets/cmake-BpuaQxBS.js +1 -0
- package/dist/assets/cobol-GPJ0dHQG.js +1 -0
- package/dist/assets/{code-block-37QAKDTI-DYj4t0uu.js → code-block-37QAKDTI-CxkZZ2yu.js} +1 -1
- package/dist/assets/coffeescript-D7gQHdB-.js +1 -0
- package/dist/assets/{column-preview-BNg0hwmL.js → column-preview-BaRqZ9P8.js} +1 -1
- package/dist/assets/{command-palette-gEcd355-.js → command-palette-CGyST5ig.js} +1 -1
- package/dist/assets/{common-CcYiDLMe.js → common-sBRwGAKy.js} +1 -1
- package/dist/assets/commonlisp-Cr4KGe18.js +1 -0
- package/dist/assets/{components-CozWCL5N.js → components-CGGSwziZ.js} +1 -1
- package/dist/assets/components-DsJAWbBR.js +1 -0
- package/dist/assets/{cose-bilkent-JH36ORCC-BItWxPmu.js → cose-bilkent-JH36ORCC-Bgowgmmd.js} +1 -1
- package/dist/assets/crystal-CsTMAwME.js +1 -0
- package/dist/assets/{css-DWLxGm3Z.js → css-COZ77Eal.js} +1 -1
- package/dist/assets/cynefin-VYW2F7L2-mNpr4SbP.js +1 -0
- package/dist/assets/{cynefinDiagram-MW4NZA55-xRolnN9H.js → cynefinDiagram-MW4NZA55-BjhYqu92.js} +1 -1
- package/dist/assets/cypher-CY21sZiF.js +1 -0
- package/dist/assets/d-CURHSrpr.js +1 -0
- package/dist/assets/{dagre-VZM6K2ZE--7CAsOPi.js → dagre-VZM6K2ZE-BEuyIkT6.js} +1 -1
- package/dist/assets/{data-grid-overlay-editor-CP2bSduR.js → data-grid-overlay-editor-BQUij2ly.js} +1 -1
- package/dist/assets/data-source-discovery-DCNYJylO.js +1 -0
- package/dist/assets/{datasource-DAM_bXu_.js → datasource-DxCwZdAq.js} +2 -2
- package/dist/assets/{dependency-graph-panel-01bZMvwS.js → dependency-graph-panel-CLOQ_RvL.js} +1 -1
- package/dist/assets/{diagram-7IWD3JNH-B55VSdpL.js → diagram-7IWD3JNH-Bs3lgu-c.js} +1 -1
- package/dist/assets/{diagram-B4RE2ZJO-BDn7ASqI.js → diagram-B4RE2ZJO-Dth7brNz.js} +1 -1
- package/dist/assets/{diagram-LBJQPF4R-B51MZG2V.js → diagram-LBJQPF4R-BTVLtL0d.js} +1 -1
- package/dist/assets/{diagram-Q27KOJAE-Cwk0Mlin.js → diagram-Q27KOJAE-CP204u9a.js} +1 -1
- package/dist/assets/{diagram-UB23O5K3-BdYFaMnx.js → diagram-UB23O5K3-ClHQzHar.js} +1 -1
- package/dist/assets/diff-oDNdZgsT.js +1 -0
- package/dist/assets/dist-2VJQDijP.js +1 -0
- package/dist/assets/{dist-etjVl5BO.js → dist-BB2m_pT9.js} +1 -1
- package/dist/assets/{dist-CAHB5I2V.js → dist-BIoV7ItK.js} +1 -1
- package/dist/assets/{dist-D5yi7Y8o.js → dist-BKZjRJh7.js} +1 -1
- package/dist/assets/dist-BSndAsl2.js +1 -0
- package/dist/assets/{dist-CF4ci481.js → dist-BrBdlR-1.js} +1 -1
- package/dist/assets/dist-CULUasdr.js +1 -0
- package/dist/assets/{dist-CG7o1Txo.js → dist-CgdeWOxv.js} +1 -1
- package/dist/assets/{dist-x-uwJAB2.js → dist-D7Pn6TvC.js} +1 -1
- package/dist/assets/{dist-Ci0ANOWc.js → dist-DoCsyl8V.js} +1 -1
- package/dist/assets/{dist-BhAom09b.js → dist-Q_HuxBl8.js} +1 -1
- package/dist/assets/{dist-UMYZc9Uw.js → dist-URSEPeIQ.js} +1 -1
- package/dist/assets/dist-e3TiiDdA.js +1 -0
- package/dist/assets/{dist-0tTkix79.js → dist-gKSpDGw2.js} +1 -1
- package/dist/assets/{dist-5AUFDACg.js → dist-ziD6OB9m.js} +1 -1
- package/dist/assets/{dockerfile-vQlfzaHL.js → dockerfile-L84t-MVG.js} +1 -1
- package/dist/assets/{documentation-panel-BhruLk_O.js → documentation-panel-D9w8PAT9.js} +1 -1
- package/dist/assets/{download-DT1x-ePG.js → download-CfUkZlw7.js} +1 -1
- package/dist/assets/dtd-Cy2_BeYL.js +1 -0
- package/dist/assets/dylan-Crd9Fb_0.js +1 -0
- package/dist/assets/{ebnfDiagram-BXEA7PRR-BeNZBLGl.js → ebnfDiagram-BXEA7PRR-D5itfLTD.js} +1 -1
- package/dist/assets/ecl-CfCmFoo0.js +1 -0
- package/dist/assets/{edit-page-C8uQVdbi.js → edit-page-CyOOxVHO.js} +4 -4
- package/dist/assets/eiffel-gIaoJqnl.js +1 -0
- package/dist/assets/elm-BFWuf0zw.js +1 -0
- package/dist/assets/{erDiagram-JOGREHBK-Md316MnW.js → erDiagram-JOGREHBK-8nttFkHX.js} +1 -1
- package/dist/assets/erlang-o_h5GHv6.js +1 -0
- package/dist/assets/{error-entries-Dg9m5P8l.js → error-entries-DpvSrZSw.js} +1 -1
- package/dist/assets/{error-panel-By_xNe1V.js → error-panel-uRl1_l47.js} +1 -1
- package/dist/assets/{esm-CpCa6w8Q.js → esm-B7G79VOo.js} +1 -1
- package/dist/assets/eventmodeling-45OFAUF4-CmCnqr0B.js +1 -0
- package/dist/assets/factor-DhP48x0i.js +1 -0
- package/dist/assets/{factor-D96xahcJ.js → factor-aNENtHLj.js} +1 -1
- package/dist/assets/file-explorer-panel-DNDgcn0k.js +37 -0
- package/dist/assets/{file-icons-Dop5RazI.js → file-icons-DpREEjwW.js} +1 -1
- package/dist/assets/{file-name-input-C5_fsJ6t.js → file-name-input-C7AQKuoU.js} +1 -1
- package/dist/assets/{floating-outline-Bt2aLttK.js → floating-outline-4I6DvqaR.js} +1 -1
- package/dist/assets/flowDiagram-UKHOOZJN-BBKoHcjJ.js +1 -0
- package/dist/assets/{focus-DCZbWsqm.js → focus-CeTtpVjV.js} +1 -1
- package/dist/assets/{form-Cj3PfSUI.js → form-B10bgcbQ.js} +1 -1
- package/dist/assets/{form-DHy5wB3F.js → form-Cj9BLARR.js} +1 -1
- package/dist/assets/forth-B9culvwH.js +1 -0
- package/dist/assets/fortran-P9CMHntW.js +1 -0
- package/dist/assets/{ganttDiagram-PKOTCBZU-ZWAQtEyO.js → ganttDiagram-PKOTCBZU-lYZ3LZM4.js} +1 -1
- package/dist/assets/gas-aBeBIUA2.js +1 -0
- package/dist/assets/gherkin-BKojMN6Q.js +1 -0
- package/dist/assets/gitGraph-TEB2WS4Q-lhsXnAif.js +1 -0
- package/dist/assets/{gitGraphDiagram-DS77QQ5N-BLejYVyQ.js → gitGraphDiagram-DS77QQ5N-BMWEqU01.js} +1 -1
- package/dist/assets/{glide-data-editor-BPPCsS2s.js → glide-data-editor-Bo6hLXbn.js} +4 -4
- package/dist/assets/groovy-CePAd7wh.js +1 -0
- package/dist/assets/haskell-QHmsrbZx.js +1 -0
- package/dist/assets/haxe-CQV_8vKL.js +1 -0
- package/dist/assets/{home-page-EsENjhWM.js → home-page-BNJihtii.js} +1 -1
- package/dist/assets/{html-to-image-CajdmeRM.js → html-to-image-ChfBVn8-.js} +1 -1
- package/dist/assets/idl-Dd8N44Cm.js +1 -0
- package/dist/assets/{index-BZ-HxYIU.js → index-CtIZviYn.js} +6 -6
- package/dist/assets/info-DKCQHKI2-C7T8UDyU.js +1 -0
- package/dist/assets/infoDiagram-6WML65LV-DF1s-6Vl.js +2 -0
- package/dist/assets/{ishikawaDiagram-WSZJBQD7-DsUyhPdP.js → ishikawaDiagram-WSZJBQD7-DaG24pVU.js} +1 -1
- package/dist/assets/javascript-DSNeo7JU.js +1 -0
- package/dist/assets/{journeyDiagram-NVQOT4AX-Dtytysty.js → journeyDiagram-NVQOT4AX-Bjv5KPQN.js} +1 -1
- package/dist/assets/julia-noK_uk9P.js +1 -0
- package/dist/assets/{kanban-definition-27J2QSJJ-CtSUWi1q.js → kanban-definition-27J2QSJJ-3QfkEp5c.js} +1 -1
- package/dist/assets/katex-D7rQd2tt.js +1 -0
- package/dist/assets/{layout-B73d8K81.js → layout-YPBtS2D6.js} +3 -3
- package/dist/assets/livescript-YKkeujLh.js +1 -0
- package/dist/assets/{logs-panel-CYMHvjs-.js → logs-panel-ClE58_4G.js} +1 -1
- package/dist/assets/{loro_wasm_bg-Cei5H7n0.js → loro_wasm_bg-Bhj1szFH.js} +1 -1
- package/dist/assets/lua-fLqC1mOj.js +1 -0
- package/dist/assets/{markdown-renderer-DM-Whfio.js → markdown-renderer-BOS4jZLt.js} +3 -3
- package/dist/assets/mathematica-BEqGrvB0.js +1 -0
- package/dist/assets/mbox-9uehSvC8.js +1 -0
- package/dist/assets/{mermaid-4DMBBIKO-oaGD2RAq.js → mermaid-4DMBBIKO-VnWrwEGQ.js} +1 -1
- package/dist/assets/{mermaid-D7qPJTl5.js → mermaid-DrH-G40O.js} +3 -3
- package/dist/assets/{mermaid-parser.core-C1pvq6V4.js → mermaid-parser.core-7L0n-40M.js} +2 -2
- package/dist/assets/{mhchem-ByBXJmVs.js → mhchem-jUQ3W9QS.js} +1 -1
- package/dist/assets/{mindmap-definition-FAOFIHXS-BdiofJNg.js → mindmap-definition-FAOFIHXS-BI-5PR09.js} +1 -1
- package/dist/assets/mirc-BTX_WxCv.js +1 -0
- package/dist/assets/mllike-LThTvO6F.js +1 -0
- package/dist/assets/modelica-ClexNQK-.js +1 -0
- package/dist/assets/mscgen-Cr-Z_Sdd.js +1 -0
- package/dist/assets/mumps-G_BfPdvs.js +1 -0
- package/dist/assets/{name-cell-input-DF8MnZDV.js → name-cell-input-UMsLssMV.js} +1 -1
- package/dist/assets/nsis-CBRC0JIr.js +1 -0
- package/dist/assets/{nsis-gzbsJ5t0.js → nsis-CNBWu0HQ.js} +1 -1
- package/dist/assets/ntriples-DrvRq09t.js +1 -0
- package/dist/assets/{number-overlay-editor-CrwfeUrx.js → number-overlay-editor-C-zZ00cy.js} +1 -1
- package/dist/assets/octave-BiPC57kS.js +1 -0
- package/dist/assets/{outline-panel-Q7h5hFfo.js → outline-panel-DweKocZK.js} +1 -1
- package/dist/assets/oz-DacpSh-q.js +1 -0
- package/dist/assets/{packages-panel-BW4xGU0r.js → packages-panel-Cbw5J5QD.js} +1 -1
- package/dist/assets/packet-7NZHBO7P-CJZ85ye7.js +1 -0
- package/dist/assets/{panel-accordion-state-iff6EfKa.js → panel-accordion-state-CgvX-ElJ.js} +1 -1
- package/dist/assets/panels-DRv39UwA.js +4 -0
- package/dist/assets/pascal-BQpBPSms.js +1 -0
- package/dist/assets/{pegDiagram-VL7TDLO6-CUhl_uoo.js → pegDiagram-VL7TDLO6-Dr2AgOs7.js} +1 -1
- package/dist/assets/perl-BhMGfluR.js +1 -0
- package/dist/assets/pie-RZYD4A2V-DowYgF53.js +1 -0
- package/dist/assets/{pieDiagram-7S7Q4E2Y-BUJuppkz.js → pieDiagram-7S7Q4E2Y-CrBge38F.js} +1 -1
- package/dist/assets/pig-lTm9qLoi.js +1 -0
- package/dist/assets/powershell-3wPcC3I5.js +1 -0
- package/dist/assets/{process-output-B9grqmZC.js → process-output-BMxr8Z3g.js} +1 -1
- package/dist/assets/properties-CfDlOPua.js +1 -0
- package/dist/assets/protobuf-DqtB_3Ds.js +1 -0
- package/dist/assets/pug-BendPilS.js +1 -0
- package/dist/assets/{pug-CfBtO6QD.js → pug-IDpseMj2.js} +1 -1
- package/dist/assets/puppet-CS4oS8k4.js +1 -0
- package/dist/assets/python-DwXz2aVG.js +1 -0
- package/dist/assets/q-CAmiN8ZZ.js +1 -0
- package/dist/assets/{quadrantDiagram-CIZ2JOQS-D1kqQfB1.js → quadrantDiagram-CIZ2JOQS-BE2ggXL5.js} +1 -1
- package/dist/assets/r-BVrS7OVn.js +1 -0
- package/dist/assets/radar-I7S5WNFK-CTSSWmoj.js +1 -0
- package/dist/assets/{radio-group-B8t5cIdU.js → radio-group-YNmbPL7y.js} +1 -1
- package/dist/assets/railroad-3IZDKUUU-B7NYUsSF.js +1 -0
- package/dist/assets/railroad-abnf-AHOZXSZD-YHDI2QY9.js +1 -0
- package/dist/assets/railroad-ebnf-EBAXGLYW-C63c8OB7.js +1 -0
- package/dist/assets/railroad-peg-LSFZ7HO6-Cjglh51C.js +1 -0
- package/dist/assets/{railroadDiagram-AXF67PYL-A0Qm-6po.js → railroadDiagram-AXF67PYL-DCQRdlxt.js} +1 -1
- package/dist/assets/{readonly-code-display-CY-jDwQL.js → readonly-code-display-N9tCXdCz.js} +1 -1
- package/dist/assets/{readonly-python-code-DFjpK9Hc.js → readonly-python-code-BHrAhtGV.js} +1 -1
- package/dist/assets/{requirementDiagram-LRYGKXZP-Cq2ghiHc.js → requirementDiagram-LRYGKXZP-DwT1P9SV.js} +1 -1
- package/dist/assets/{reveal-component-DWjuDjk-.js → reveal-component-Cl6cd65E.js} +1 -1
- package/dist/assets/rpm-CdnUar42.js +1 -0
- package/dist/assets/ruby-BCel59B2.js +1 -0
- package/dist/assets/{run-page-DNJz4YBq.js → run-page-Phwq7OJt.js} +1 -1
- package/dist/assets/{sankeyDiagram-W5VNT64P-RT9P6FJq.js → sankeyDiagram-W5VNT64P-DI3BRqfo.js} +1 -1
- package/dist/assets/sas-BmzKenFt.js +1 -0
- package/dist/assets/scheme-DkHD_m5P.js +1 -0
- package/dist/assets/{scratchpad-panel-BOQN7LjT.js → scratchpad-panel-CvihhlAP.js} +1 -1
- package/dist/assets/{sequenceDiagram-SI44F4Z6-Dk9UNsG3.js → sequenceDiagram-SI44F4Z6-BBkZRxiN.js} +1 -1
- package/dist/assets/session-panel-aBrv2szQ.js +1 -0
- package/dist/assets/shell-BoNNN3zm.js +1 -0
- package/dist/assets/sieve-BXXK8f92.js +1 -0
- package/dist/assets/{sizeCapture-X5ZJPWSS-ce6Hf1Mn.js → sizeCapture-X5ZJPWSS-BwnqWK01.js} +1 -1
- package/dist/assets/{skeleton-mj_3hAv8.js → skeleton-BsZq3Vmq.js} +1 -1
- package/dist/assets/smalltalk-BOqQhpHI.js +1 -0
- package/dist/assets/{snippets-panel-C-VlGXwd.js → snippets-panel-cYP0GMUf.js} +1 -1
- package/dist/assets/sparql-edyZVkfL.js +1 -0
- package/dist/assets/{src-Be2gSjc_.js → src-BydIU0H9.js} +1 -1
- package/dist/assets/{state-C1e6in0R.js → state-DJon00Ew.js} +1 -1
- package/dist/assets/{state-BSVx1akM.js → state-Dc5AjWPq.js} +1 -1
- package/dist/assets/{stateDiagram-OKZ733FA-b4p2-xPQ.js → stateDiagram-OKZ733FA-CKgejYo0.js} +1 -1
- package/dist/assets/stateDiagram-v2-UEYNNEHI-DGOHmIHi.js +1 -0
- package/dist/assets/stylus-D7JxHbZj.js +1 -0
- package/dist/assets/swift-BVf4glc7.js +1 -0
- package/dist/assets/{swimlanes-SLNWSIFB-BU8BFEOR.js → swimlanes-SLNWSIFB-CaRk1UjW.js} +2 -2
- package/dist/assets/swimlanesDiagram-ULZ7WXOC-B3waQOQb.js +8 -0
- package/dist/assets/tcl-Dj0fCfAi.js +1 -0
- package/dist/assets/textile-C2t_E40o.js +1 -0
- package/dist/assets/{timeline-definition-Z64GVDOM-D1kTYo17.js → timeline-definition-Z64GVDOM-eczfm7Uw.js} +1 -1
- package/dist/assets/toml-DaFUQW6l.js +1 -0
- package/dist/assets/{tracing-D-L-9q2d.js → tracing-dGSNt8Nm.js} +1 -1
- package/dist/assets/{tracing-panel-DQzhu-hj.js → tracing-panel-CQCgx3e4.js} +2 -2
- package/dist/assets/{tree-actions-BBmIijvt.js → tree-actions-pW_UgP3m.js} +1 -1
- package/dist/assets/treeView-QDETBFTQ-CSvxEE7M.js +1 -0
- package/dist/assets/treemap-6X3UGDF4-CmweKwGi.js +1 -0
- package/dist/assets/troff-CYzkeKir.js +1 -0
- package/dist/assets/ttcn-CXYORWfg.js +1 -0
- package/dist/assets/ttcn-cfg-CaYX34bx.js +1 -0
- package/dist/assets/turtle-5bfs3D9s.js +1 -0
- package/dist/assets/{useCellActionButton-COoOWq__.js → useCellActionButton-De17Z9R3.js} +1 -1
- package/dist/assets/{useDeleteCell-C802AuEJ.js → useDeleteCell-BgFMPTmg.js} +1 -1
- package/dist/assets/{useDependencyPanelTab-DR6NOy5O.js → useDependencyPanelTab-w8VLtsK3.js} +1 -1
- package/dist/assets/{useNotebookActions-BXVkcfqk.js → useNotebookActions-CFJducB0.js} +1 -1
- package/dist/assets/{useRunCells-DuxMdaXo.js → useRunCells-CAfRBo7h.js} +1 -1
- package/dist/assets/{useSplitCell-B1EAP5Nv.js → useSplitCell-N8Ohs-Pp.js} +1 -1
- package/dist/assets/vb-CXQ5pSkV.js +1 -0
- package/dist/assets/vbscript-BZP_4BaN.js +1 -0
- package/dist/assets/velocity-BbHSi60j.js +1 -0
- package/dist/assets/{vennDiagram-T6HMQDX7-BhQR7L7x.js → vennDiagram-T6HMQDX7-BKrC4vk_.js} +1 -1
- package/dist/assets/verilog-Bw8NaRo-.js +1 -0
- package/dist/assets/vhdl-CkM1aKBX.js +1 -0
- package/dist/assets/wardley-OPB4EBWU-DKu5fTFq.js +1 -0
- package/dist/assets/{wardleyDiagram-T6FBY63Y-C6iZTOEK.js → wardleyDiagram-T6FBY63Y-BsBjXAQS.js} +1 -1
- package/dist/assets/webidl-C8MAcuKq.js +1 -0
- package/dist/assets/xquery-a81J2h4S.js +1 -0
- package/dist/assets/{xychartDiagram-ELKLHX3M-Hl9zZZJW.js → xychartDiagram-ELKLHX3M-i4ykddaR.js} +1 -1
- package/dist/assets/yacas-CjV2u_g7.js +1 -0
- package/dist/assets/z80-C0uVpBhe.js +1 -0
- package/dist/index.html +25 -25
- package/package.json +1 -1
- package/src/components/datasources/datasources.tsx +2 -40
- package/src/components/editor/chrome/panels/components.tsx +35 -0
- package/src/components/editor/chrome/panels/file-explorer-panel.tsx +10 -0
- package/src/components/editor/chrome/panels/session-panel.tsx +12 -4
- package/src/components/editor/connections/__tests__/quick-add-data-sources.test.tsx +2 -0
- package/src/components/editor/connections/add-connection-dialog.tsx +5 -1
- package/src/components/editor/connections/quick-add-data-sources.tsx +11 -7
- package/src/core/datasets/__tests__/data-source-discovery.test.ts +277 -0
- package/src/core/datasets/data-source-connections.ts +36 -0
- package/src/core/datasets/data-source-discovery.ts +92 -0
- package/src/core/websocket/useMarimoKernelConnection.tsx +11 -3
- package/src/hooks/useDataSourceDiscovery.ts +50 -9
- package/dist/assets/LazyAnyLanguageCodeMirror-DUvRReKp.js +0 -2
- package/dist/assets/add-connection-dialog-B05rbnef.js +0 -178
- package/dist/assets/apl-B-7blH-b.js +0 -1
- package/dist/assets/architecture-TIHT7OUA-YhortkiJ.js +0 -1
- package/dist/assets/asciiarmor-D3K8amZ9.js +0 -1
- package/dist/assets/asn1-UGGn98tp.js +0 -1
- package/dist/assets/brainfuck-B4y4U3tg.js +0 -1
- package/dist/assets/channel-B8YARzTa.js +0 -1
- package/dist/assets/classDiagram-JCYQIIEL-CjNLIEON.js +0 -1
- package/dist/assets/classDiagram-v2-OCEON4UE-DB1cPPS3.js +0 -1
- package/dist/assets/clojure-BAZ-ejkG.js +0 -1
- package/dist/assets/cmake-jWn0xN9y.js +0 -1
- package/dist/assets/cobol-XqY9jaWP.js +0 -1
- package/dist/assets/coffeescript-DI1jfZHX.js +0 -1
- package/dist/assets/commonlisp-UKb01OlU.js +0 -1
- package/dist/assets/components-B4D3PZ3j.js +0 -1
- package/dist/assets/crystal-DOvjTBWA.js +0 -1
- package/dist/assets/cynefin-VYW2F7L2-Dob7zmDv.js +0 -1
- package/dist/assets/cypher-CLDhu2ae.js +0 -1
- package/dist/assets/d-C0ecUZk9.js +0 -1
- package/dist/assets/diff-657cCCVc.js +0 -1
- package/dist/assets/dist-BbNJKBqf.js +0 -1
- package/dist/assets/dist-CJU3fYUR.js +0 -1
- package/dist/assets/dist-ClAayqDs.js +0 -1
- package/dist/assets/dist-Dk7PW1P8.js +0 -1
- package/dist/assets/dtd-DSiK7Qgi.js +0 -1
- package/dist/assets/dylan-07d5-7Q9.js +0 -1
- package/dist/assets/ecl-CSTUHiwq.js +0 -1
- package/dist/assets/eiffel-DR99GcsM.js +0 -1
- package/dist/assets/elm-Cmh0iW6J.js +0 -1
- package/dist/assets/erlang-CS9Yc6UC.js +0 -1
- package/dist/assets/eventmodeling-45OFAUF4-Dfz56MmV.js +0 -1
- package/dist/assets/factor-DjB27Lcf.js +0 -1
- package/dist/assets/file-explorer-panel-BzTVzCS7.js +0 -37
- package/dist/assets/flowDiagram-UKHOOZJN-DuIOw7R3.js +0 -1
- package/dist/assets/forth-UwTUu7NY.js +0 -1
- package/dist/assets/fortran-cptiB4gJ.js +0 -1
- package/dist/assets/gas-ajMbd9Us.js +0 -1
- package/dist/assets/gherkin-ClYkalzE.js +0 -1
- package/dist/assets/gitGraph-TEB2WS4Q-DHatMnz3.js +0 -1
- package/dist/assets/groovy-BY-gt7AW.js +0 -1
- package/dist/assets/haskell-D1BeJ7SR.js +0 -1
- package/dist/assets/haxe-QOq5WFXx.js +0 -1
- package/dist/assets/idl-3-UcEGx7.js +0 -1
- package/dist/assets/info-DKCQHKI2-DL5sXjlh.js +0 -1
- package/dist/assets/infoDiagram-6WML65LV-w0LSkwW5.js +0 -2
- package/dist/assets/javascript-CorD44JN.js +0 -1
- package/dist/assets/julia-BYqTtTAl.js +0 -1
- package/dist/assets/katex-DWt0esek.js +0 -1
- package/dist/assets/livescript-qYgfNnNE.js +0 -1
- package/dist/assets/lua-BCqCjdfz.js +0 -1
- package/dist/assets/mathematica-XKwMfn0d.js +0 -1
- package/dist/assets/mbox-BnkeOnif.js +0 -1
- package/dist/assets/mirc-ipoElhai.js +0 -1
- package/dist/assets/mllike-DmouQ5Dp.js +0 -1
- package/dist/assets/modelica-BtmmVsUf.js +0 -1
- package/dist/assets/mscgen-BHZmHZgz.js +0 -1
- package/dist/assets/mumps-oKfoFTl_.js +0 -1
- package/dist/assets/nsis-DDOPnuAW.js +0 -1
- package/dist/assets/ntriples-Dsyl_sOF.js +0 -1
- package/dist/assets/octave-CI5RGMPa.js +0 -1
- package/dist/assets/oz-D01pKAWx.js +0 -1
- package/dist/assets/packet-7NZHBO7P-Btbo_lPa.js +0 -1
- package/dist/assets/panels-BqKyRqOy.js +0 -4
- package/dist/assets/pascal-DGXfnIFD.js +0 -1
- package/dist/assets/perl-gZ7qIkF-.js +0 -1
- package/dist/assets/pie-RZYD4A2V-DHlhKt-c.js +0 -1
- package/dist/assets/pig-Cb90ayl-.js +0 -1
- package/dist/assets/powershell-_YxddSL3.js +0 -1
- package/dist/assets/properties-sU50dmvt.js +0 -1
- package/dist/assets/protobuf-DFdF-yfo.js +0 -1
- package/dist/assets/pug-DwUB-C24.js +0 -1
- package/dist/assets/puppet-DtKzwiZ6.js +0 -1
- package/dist/assets/python-BMLOKYmk.js +0 -1
- package/dist/assets/q-BF1zXMdP.js +0 -1
- package/dist/assets/r-BQiKhVSI.js +0 -1
- package/dist/assets/radar-I7S5WNFK-DZTiwd45.js +0 -1
- package/dist/assets/railroad-3IZDKUUU-DxAKHi3X.js +0 -1
- package/dist/assets/railroad-abnf-AHOZXSZD-DgPW-bTs.js +0 -1
- package/dist/assets/railroad-ebnf-EBAXGLYW-6hsaKhfa.js +0 -1
- package/dist/assets/railroad-peg-LSFZ7HO6-Sj3gnwID.js +0 -1
- package/dist/assets/rpm-v7UTuaHo.js +0 -1
- package/dist/assets/ruby-Cw43FpG3.js +0 -1
- package/dist/assets/sas-BIKscqlp.js +0 -1
- package/dist/assets/scheme-CGic3hSV.js +0 -1
- package/dist/assets/session-panel-C9zMMa1x.js +0 -1
- package/dist/assets/shell-DAh545tm.js +0 -1
- package/dist/assets/sieve-bGkng63-.js +0 -1
- package/dist/assets/smalltalk-fIw53lm8.js +0 -1
- package/dist/assets/sparql-CHbJrAY_.js +0 -1
- package/dist/assets/stateDiagram-v2-UEYNNEHI-DVggkZEP.js +0 -1
- package/dist/assets/stylus-3Q5WfXqT.js +0 -1
- package/dist/assets/swift-MKxc2knl.js +0 -1
- package/dist/assets/swimlanesDiagram-ULZ7WXOC-Dl8Izbnv.js +0 -8
- package/dist/assets/tcl-D3fKhQc_.js +0 -1
- package/dist/assets/textile-Bi_LEJQ3.js +0 -1
- package/dist/assets/toml-Dt-PBqwt.js +0 -1
- package/dist/assets/treeView-QDETBFTQ-DI-AuAry.js +0 -1
- package/dist/assets/treemap-6X3UGDF4-BikstUU5.js +0 -1
- package/dist/assets/troff-BSU-rxoD.js +0 -1
- package/dist/assets/ttcn-BmLjonVM.js +0 -1
- package/dist/assets/ttcn-cfg-TPTcP0Eh.js +0 -1
- package/dist/assets/turtle-HafmShQq.js +0 -1
- package/dist/assets/vb-CUif5uGR.js +0 -1
- package/dist/assets/vbscript-DWVPFl59.js +0 -1
- package/dist/assets/velocity-BJl8UzB4.js +0 -1
- package/dist/assets/verilog-B4LUPYXy.js +0 -1
- package/dist/assets/vhdl-C91h3ipk.js +0 -1
- package/dist/assets/wardley-OPB4EBWU-CeBjkYYY.js +0 -1
- package/dist/assets/webidl-DOay1zbU.js +0 -1
- package/dist/assets/xquery-Cez7jD_4.js +0 -1
- package/dist/assets/yacas-CSQEXB_S.js +0 -1
- package/dist/assets/z80-CJbYj7Wr.js +0 -1
- package/src/hooks/__tests__/useDataSourceDiscovery.test.ts +0 -80
- /package/dist/assets/{ConnectedDataExplorerComponent-WU7zjB7Z.js → ConnectedDataExplorerComponent-CbTaTBJ8.js} +0 -0
- /package/dist/assets/{ImageComparisonComponent-BcnwhFjf.js → ImageComparisonComponent-f3_KuPvA.js} +0 -0
- /package/dist/assets/{Inputs-DrAa-p6i.js → Inputs-S6F4fq1S.js} +0 -0
- /package/dist/assets/{Plot-93LEWfvh.js → Plot-BKmsCw4V.js} +0 -0
- /package/dist/assets/{apl-CPlG1HX3.js → apl-HjCOpvY9.js} +0 -0
- /package/dist/assets/{asciiarmor-DV_pcocJ.js → asciiarmor-CZUdQ8YG.js} +0 -0
- /package/dist/assets/{asn1-DPxWcGvG.js → asn1-D9fbSxQp.js} +0 -0
- /package/dist/assets/{asterisk-1BK_fEUT.js → asterisk-GbGHf9GU.js} +0 -0
- /package/dist/assets/{brainfuck-CGDdBVNO.js → brainfuck-DoACnXtY.js} +0 -0
- /package/dist/assets/{chunk-KEIR6QF5-Dy1GNnFZ.js → chunk-KEIR6QF5-DALP8ow3.js} +0 -0
- /package/dist/assets/{chunk-Y2CYZVJY-Ci6ix4_L.js → chunk-Y2CYZVJY-BLNiTciS.js} +0 -0
- /package/dist/assets/{clear-button-D_bGby_-.js → clear-button-ChZ5WLVn.js} +0 -0
- /package/dist/assets/{click-outside-container-Ble4snjv.js → click-outside-container-B_JD95Fi.js} +0 -0
- /package/dist/assets/{clike-D91DrsBh.js → clike-BvT_OTqG.js} +0 -0
- /package/dist/assets/{clojure-B0eb_-2q.js → clojure-DObunWgq.js} +0 -0
- /package/dist/assets/{cmake-COzUvjiS.js → cmake-Bn1dmbG8.js} +0 -0
- /package/dist/assets/{cobol-DW4FSnmb.js → cobol-CJ0xj-s7.js} +0 -0
- /package/dist/assets/{coffeescript-CommR2mv.js → coffeescript-DSHpWjh8.js} +0 -0
- /package/dist/assets/{common-keywords-CL5lDC0w.js → common-keywords-DpBQRN1C.js} +0 -0
- /package/dist/assets/{commonlisp-FR_N9RJL.js → commonlisp-C8BmLRoV.js} +0 -0
- /package/dist/assets/{crystal-CAN7bz25.js → crystal-Ca8nJT--.js} +0 -0
- /package/dist/assets/{css-DmLg8a0m.js → css-CY56PGqI.js} +0 -0
- /package/dist/assets/{cypher-BzSJn05x.js → cypher-DkMgpwTD.js} +0 -0
- /package/dist/assets/{cytoscape.esm-DMX0DoYf.js → cytoscape.esm-ohuTJsWI.js} +0 -0
- /package/dist/assets/{d-UpmnByGo.js → d-De6gURe0.js} +0 -0
- /package/dist/assets/{diff-DRpitNo9.js → diff-D9jknSNL.js} +0 -0
- /package/dist/assets/{dist-CjgCY_Ws.js → dist-B8OryoSI.js} +0 -0
- /package/dist/assets/{dist-DcguuZEe.js → dist-B_Q1ayL4.js} +0 -0
- /package/dist/assets/{dist-BY5C0xw-.js → dist-BdgY02GB.js} +0 -0
- /package/dist/assets/{dist-5zzK1Bpl.js → dist-BpyRMlx3.js} +0 -0
- /package/dist/assets/{dist-Bp45OWJJ.js → dist-BvDn6jZn.js} +0 -0
- /package/dist/assets/{dist-CSEj3YUH.js → dist-C1_zNuc7.js} +0 -0
- /package/dist/assets/{dist-CYcHr3tv.js → dist-C3M1h1bY.js} +0 -0
- /package/dist/assets/{dist-iZqQ8eEZ.js → dist-CiELQ2ik.js} +0 -0
- /package/dist/assets/{dist-Op2xySIC.js → dist-CnESRnx2.js} +0 -0
- /package/dist/assets/{dist-SgSQKL07.js → dist-Cnb7x5X_.js} +0 -0
- /package/dist/assets/{dist-CqO2FBHV.js → dist-CtsSPT78.js} +0 -0
- /package/dist/assets/{dist-BQMAD-re.js → dist-DDuxOj5E.js} +0 -0
- /package/dist/assets/{dist-C3YC038-.js → dist-DXl-iyI_.js} +0 -0
- /package/dist/assets/{dist-VHnyClcl.js → dist-DcwGajoh.js} +0 -0
- /package/dist/assets/{dist-ChJa98Av.js → dist-M9OI1ywz.js} +0 -0
- /package/dist/assets/{dist-BTX2QySO.js → dist-oc6kOhWh.js} +0 -0
- /package/dist/assets/{dist-AhQW5KN1.js → dist-rcsCwDst.js} +0 -0
- /package/dist/assets/{dtd-CQV9N2ok.js → dtd-B5FJ4BXV.js} +0 -0
- /package/dist/assets/{duckdb-keywords-CKBoTxEb.js → duckdb-keywords-DrrKcwLz.js} +0 -0
- /package/dist/assets/{dylan-Bp98yT5y.js → dylan-zZheNs86.js} +0 -0
- /package/dist/assets/{ebnf-CviyCkP7.js → ebnf-DuKzoTsP.js} +0 -0
- /package/dist/assets/{ecl-BgtQ3zu5.js → ecl-BcK76Ow3.js} +0 -0
- /package/dist/assets/{eiffel-Cu14O7Gi.js → eiffel-KaaY88la.js} +0 -0
- /package/dist/assets/{elm-Dp1dn40k.js → elm-B7-LHWcm.js} +0 -0
- /package/dist/assets/{erlang-DdogJjdp.js → erlang-DaphDTvj.js} +0 -0
- /package/dist/assets/{esm-DbAcs2Px.js → esm-BKF5e2-i.js} +0 -0
- /package/dist/assets/{fcl-DjfeL5F6.js → fcl-DopXl_Cb.js} +0 -0
- /package/dist/assets/{forth-Dd0r86IP.js → forth-BKlt87ew.js} +0 -0
- /package/dist/assets/{fortran-4qvtlW4z.js → fortran-DDZOpuZf.js} +0 -0
- /package/dist/assets/{gallery-page-CtBVFIhS.js → gallery-page-4_c4sSjL.js} +0 -0
- /package/dist/assets/{gas-DqwqZHXy.js → gas-CDn7Y-Gk.js} +0 -0
- /package/dist/assets/{gherkin-DMxJEDh5.js → gherkin-eZ5FXLoA.js} +0 -0
- /package/dist/assets/{github-6F3RzPv3.js → github-CE-ZvKrv.js} +0 -0
- /package/dist/assets/{groovy-DA_MxBua.js → groovy-BwhPb7Fz.js} +0 -0
- /package/dist/assets/{haskell-B_hi8VEK.js → haskell-Dnk7SiND.js} +0 -0
- /package/dist/assets/{haxe-D-I6YeRN.js → haxe-lllox-eQ.js} +0 -0
- /package/dist/assets/{http-VleqgIZJ.js → http-BxcKXOao.js} +0 -0
- /package/dist/assets/{idl-CteRrHSs.js → idl-DgcPYEkx.js} +0 -0
- /package/dist/assets/{javascript-Cq9DsvSW.js → javascript-COkX3Xca.js} +0 -0
- /package/dist/assets/{julia-bHGj6eLp.js → julia-D-oyKrif.js} +0 -0
- /package/dist/assets/{katex-B9FkzyvX.js → katex-DX0AbnS9.js} +0 -0
- /package/dist/assets/{kiosk-mode-B8UhlOLw.js → kiosk-mode-CNguD0K4.js} +0 -0
- /package/dist/assets/{links-STGde2qx.js → links-CWv16njv.js} +0 -0
- /package/dist/assets/{livescript-C72YlTeO.js → livescript-D_iKnN6P.js} +0 -0
- /package/dist/assets/{loro_wasm_bg-DIEeF9jI.js → loro_wasm_bg-wiZiHqmd.js} +0 -0
- /package/dist/assets/{lua-DAtJrHXr.js → lua-DvA1dcWk.js} +0 -0
- /package/dist/assets/{marimo-icons-CW8-Txe-.js → marimo-icons-BT3Q9hP-.js} +0 -0
- /package/dist/assets/{mathematica-DGp7b8Lx.js → mathematica-BsU_wLgp.js} +0 -0
- /package/dist/assets/{mbox-C35KjfEV.js → mbox-C0XhbFpn.js} +0 -0
- /package/dist/assets/{mirc-BRCHEPv1.js → mirc-CHTyPhxQ.js} +0 -0
- /package/dist/assets/{mllike-D7ajla-U.js → mllike-CUPiTPoj.js} +0 -0
- /package/dist/assets/{modelica-0RGVL4ie.js → modelica-CY01YUSk.js} +0 -0
- /package/dist/assets/{mscgen-C7Ohs4Tl.js → mscgen-DrdJ4BfA.js} +0 -0
- /package/dist/assets/{mumps-Cgag5Xef.js → mumps-oDd7O1nq.js} +0 -0
- /package/dist/assets/{nginx-D7OKXoUe.js → nginx-BFZZWp0k.js} +0 -0
- /package/dist/assets/{node-sql-parser-DE2GpgS7.js → node-sql-parser-BAQ3SN57.js} +0 -0
- /package/dist/assets/{ntriples-oQv5c69K.js → ntriples-Kz6Omt8T.js} +0 -0
- /package/dist/assets/{octave-BMTXs4lo.js → octave-D4G4nAd-.js} +0 -0
- /package/dist/assets/{oz-CuHYwo8r.js → oz-BMPClN8a.js} +0 -0
- /package/dist/assets/{pascal-eFKoVV2p.js → pascal-PjzHq8gx.js} +0 -0
- /package/dist/assets/{perl-B1OqOW8w.js → perl-BJehkHc4.js} +0 -0
- /package/dist/assets/{pig-gIrBDx27.js → pig-BErUKXIE.js} +0 -0
- /package/dist/assets/{powershell-3fQF2XND.js → powershell-C9VPAjfT.js} +0 -0
- /package/dist/assets/{properties-D4HHpZmU.js → properties-C9_sS9KX.js} +0 -0
- /package/dist/assets/{protobuf-DFSTKR0L.js → protobuf-CTL_9hGv.js} +0 -0
- /package/dist/assets/{puppet-BAISgXk9.js → puppet-DiwkFvYr.js} +0 -0
- /package/dist/assets/{python-mPctBCbA.js → python-B6qWXHOF.js} +0 -0
- /package/dist/assets/{q-CYeV5Dbb.js → q-DK2HS4ce.js} +0 -0
- /package/dist/assets/{r-Ds4UrjIV.js → r-DaU8ID7q.js} +0 -0
- /package/dist/assets/{rough.esm-CR3HSVpq.js → rough.esm-DsKVbNkz.js} +0 -0
- /package/dist/assets/{rpm-DV5-r6dM.js → rpm-B1zWd_-L.js} +0 -0
- /package/dist/assets/{ruby-B9qrycrI.js → ruby-e8Zeo08a.js} +0 -0
- /package/dist/assets/{runs-B8nVipXz.js → runs-0Fl_whti.js} +0 -0
- /package/dist/assets/{sas-Cd7L1ZOe.js → sas-CtNe7N_s.js} +0 -0
- /package/dist/assets/{scheme-L6Kva-Kc.js → scheme-D7VUNgy0.js} +0 -0
- /package/dist/assets/{secrets-panel-CVQIJOsr.js → secrets-panel-C51QhQhQ.js} +0 -0
- /package/dist/assets/{shell-Ck42V1Kn.js → shell-95QiTNIY.js} +0 -0
- /package/dist/assets/{sieve-DfSJcUfS.js → sieve-4wk3Woa7.js} +0 -0
- /package/dist/assets/{simple-mode-CfoR0Lvg.js → simple-mode-C1B3ue4E.js} +0 -0
- /package/dist/assets/{smalltalk-CT418Iph.js → smalltalk-BFPyGpl7.js} +0 -0
- /package/dist/assets/{solr-CDPrSrj5.js → solr-BCnpA4mK.js} +0 -0
- /package/dist/assets/{sparql-BlJ_cLEt.js → sparql-BMyoR-t0.js} +0 -0
- /package/dist/assets/{spreadsheet-BsJYzkOI.js → spreadsheet-C39QEIvH.js} +0 -0
- /package/dist/assets/{sql-F2Gt8FSJ.js → sql-CE9Btgz4.js} +0 -0
- /package/dist/assets/{stylus-92qIiGm1.js → stylus-BbMWgEUg.js} +0 -0
- /package/dist/assets/{swift-gZzicbJu.js → swift-BCakwsWN.js} +0 -0
- /package/dist/assets/{swiper-component-LOm8fzBm.js → swiper-component-DpFUDvyR.js} +0 -0
- /package/dist/assets/{tcl-CtgoBYkk.js → tcl-Dupz7YXC.js} +0 -0
- /package/dist/assets/{terminal-Bo6pnmSU.js → terminal-RAduwztq.js} +0 -0
- /package/dist/assets/{textile-Du3RzJ2D.js → textile-CMQNVB0J.js} +0 -0
- /package/dist/assets/{tiddlywiki-BiVbsin5.js → tiddlywiki-CIp8hgce.js} +0 -0
- /package/dist/assets/{tiki-BjQr6gnj.js → tiki-C22wqq7_.js} +0 -0
- /package/dist/assets/{toml-HcF44TVB.js → toml-CDlujHqn.js} +0 -0
- /package/dist/assets/{troff-xbwT4huN.js → troff-Dxr_rPl0.js} +0 -0
- /package/dist/assets/{ttcn-cfg-jWDg1i50.js → ttcn-cfg-_MoagO29.js} +0 -0
- /package/dist/assets/{ttcn-phKysj_0.js → ttcn-iRE0hZ1i.js} +0 -0
- /package/dist/assets/{turtle-CPC48wcy.js → turtle-C00vzWJK.js} +0 -0
- /package/dist/assets/{types-C7hjolXC.js → types-l38AsXoI.js} +0 -0
- /package/dist/assets/{useInterval-CTStcSBb.js → useInterval-WeprorQN.js} +0 -0
- /package/dist/assets/{vb-BTubZ2rB.js → vb-CkVClY4-.js} +0 -0
- /package/dist/assets/{vbscript-B52mDFWM.js → vbscript-BAyqwxih.js} +0 -0
- /package/dist/assets/{vega-component-dzk5T-cc.js → vega-component-DpKA6PEU.js} +0 -0
- /package/dist/assets/{velocity-BO3M1iFD.js → velocity-DizPkX9R.js} +0 -0
- /package/dist/assets/{verilog-CBz90JJu.js → verilog-BHLL_Z-1.js} +0 -0
- /package/dist/assets/{vhdl-CeQ1lGlV.js → vhdl-kw8S8KSM.js} +0 -0
- /package/dist/assets/{web-vitals-BaWpTOd5.js → web-vitals-DEQqQ7mh.js} +0 -0
- /package/dist/assets/{webidl-CRtF5pmu.js → webidl-BArrMnhe.js} +0 -0
- /package/dist/assets/{ws-CNqquaud.js → ws-B3l5rS71.js} +0 -0
- /package/dist/assets/{xquery-CFnbrHav.js → xquery-BVt_izxN.js} +0 -0
- /package/dist/assets/{yacas-KIC_JO6M.js → yacas-BFgb66eo.js} +0 -0
- /package/dist/assets/{z80-kGpw5_me.js → z80-CLywz-dK.js} +0 -0
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./esm-
|
|
2
|
-
var WM=Object.defineProperty;var UM=(oa,di,Ya)=>di in oa?WM(oa,di,{enumerable:!0,configurable:!0,writable:!0,value:Ya}):oa[di]=Ya;var pe=(oa,di,Ya)=>UM(oa,typeof di!="symbol"?di+"":di,Ya);import{a as KM,i as Cg,n as QM,o as Ud,r as GM,t as Pe}from"./chunk-C4rtOYze.js";import{c as AC,i as Me,l as LC,p as je,r as XM,s as JM,u as $n}from"./useEvent-GCVIknuR.js";import{t as Kd}from"./react-C60yClUi.js";import{t as PC}from"./react-dom-Ba2zmJWD.js";import{L as OC,N as YM,P as MC,T as NC,k as ZM,w as e5,z as t5}from"./zod-BIDX-mZr.js";import{t as kr}from"./compiler-runtime-DnimoHo0.js";import{t as Sg}from"./debounce-DhnxH9Rh.js";import{d as jC,f as n5,g as Se,o as Qd}from"./useEventListener-DpNnLPuE.js";import{t as ki}from"./objects-CrbstYTV.js";import{t as Vn}from"./invariant-BUdrueMv.js";import{b as r5,g as i5,h as qC,t as a5}from"./utils-C8Yt16Y7.js";import{D as o5,N as Gd,O as s5,P as l5,S as c5,r as u5}from"./config-DFK5eCC3.js";import{n as d5,t as Ci}from"./cn-DCUzRj2J.js";import{t as f5}from"./jsx-runtime-3wZU7vFS.js";import{C as zC,T as p5,b as m5,d as h5,g as Xd,h as g5,p as y5,v as FC,w as ta,x as Wr,y as $C}from"./fullscreen-CrevbcR_.js";import{l as VC,o as v5}from"./dist-CFnrytEJ.js";import{d as b5}from"./menu-items-B8lIBnFI.js";import{a as w5,c as x5,i as Eg,m as _5,n as k5,o as HC,r as C5,s as S5,t as E5}from"./select-CPo-KTTe.js";import{i as T5,t as Tg}from"./tooltip-C9LWGQ7Y.js";import{t as BC}from"./button-W__YVea9.js";import{$t as qo,A as D5,C as R5,D as I5,Gt as Gs,H as Dg,Ht as Jd,I as WC,Jt as UC,K as A5,Kt as KC,Nt as Rg,Pt as QC,Qt as li,Rt as GC,S as L5,T as XC,Tt as Si,U as P5,Ut as xn,W as O5,Wt as M5,X as Yd,Yt as _c,Zt as sr,_t as N5,at as Xt,b as JC,bt as YC,ct as ZC,dt as j5,en as Xs,f as eS,it as tS,jt as Js,k as q5,kt as nS,l as ue,ot as z5,p as F5,pt as $5,q as V5,qt as Zd,st as At,u as rS,ut as Cr,wt as Ig,z as iS}from"./dist-CeF1Em5L.js";import{A as H5,C as B5,D as W5,E as U5,S as K5,T as Q5,_ as G5,d as X5,h as J5,j as Y5,k as Z5,m as e6,n as t6,o as Ag,s as aS,t as n6,u as oS,v as r6,z as i6}from"./dist-DanVWUek.js";import{a as kc,i as Lg,n as a6,p as Pg,r as sS}from"./arrays-UzzAzxsG.js";import{n as Ur}from"./once-DNBWPkeJ.js";import{t as o6}from"./capabilities-CHeZxy51.js";import{t as s6}from"./cjs-DCKmcMBz.js";import{t as Ys}from"./createReducer-C1MhlItJ.js";import{d as l6,l as lS,n as c6,o as cS,p as u6,r as ef}from"./dist-Di6rD-vJ.js";import{n as tf,t as d6}from"./useNonce-C2dwX-sI.js";import{i as Zs,r as f6,t as p6}from"./strings-DmKKoXrM.js";import{t as Sr}from"./requests-B9zEd_sW.js";import{a as m6,c as h6,d as g6,f as uS,i as y6,l as v6,n as b6,o as Og,r as w6,s as nf,t as x6,u as _6}from"./dist-BbqPy6oS.js";import{t as kt}from"./createLucideIcon-B8oVfJNp.js";import{a as Mg,i as k6,o as C6,r as S6,t as E6}from"./useLifecycle-DDwuYzlC.js";import{t as T6}from"./check-CyyJPf_5.js";import{t as D6}from"./x-4y-nyVDU.js";import{t as R6,u as I6}from"./toDate-QOk09NqD.js";import{t as Ng}from"./database-zap-n8PGHE18.js";import{n as A6,t as el}from"./DeferredRequestRegistry-6TRSC3VZ.js";import{t as Er}from"./badge-D28DMr4y.js";import{t as de}from"./preload-helper-BPPi7vOr.js";import{a as dS,s as L6}from"./dist-BPoMypmC.js";import{a as fS,i as jg,n as P6,r as pS,t as O6}from"./dist-Bm9PT5P9.js";import{n as M6}from"./stex-BGrE-q7N.js";import{t as Cc}from"./use-toast-DjpWVza6.js";import{n as mS}from"./paths-D5zczhUD.js";import{n as N6}from"./useTheme-CwCyrmDf.js";import{t as qg}from"./purify.es-Bwm8T4QC.js";let zg,hS,tl,gS,Fg,yS,Sc,$g,Vg,vS,bS,nl,wS,Hg,xS,_S,kS,Ec,rf,Bg,CS,SS,ES,zo,af,TS,DS,of,Wg,RS,IS,Fo,sf,$o,lf,Ug,Kg,Qg,Gg,AS,Xg,LS,Tc,Jg,Yg,PS,cf,Zg,uf,OS,e0,MS,NS,t0,df,jS,Ka,ff,n0,na,Kr,r0,Dc,i0,qS,zS,a0,Xn,o0,s0,FS,pf,Ee,l0,Rc,$S,VS,HS,c0,BS,WS,US,rl,u0,Tr,KS,il,mf,QS,d0,Dr,Ic,GS,hf,XS,JS,gf,f0,ra,YS,yf,ZS,p0,eE,m0,h0,tE,g0,nE,y0,v0,b0,vf,rE,w0,x0,iE,_0,aE,k0,oE,C0,sE,lE,bf,wf,S0,E0,Qa,cE,Ei,T0,xf,Ac,Vo,_f,uE,dE,Lt,fE,Lc,pE,mE,Pc,D0,R0,hE,gE,yE,I0,vE,A0,bE,wE,xE,_E,kE,CE,kf,L0,Cf,Ga,SE,Sf,EE,TE,DE,RE,P0,O0,M0,IE,AE,LE,PE,Ef,N0,OE,Tf,Ho,j0,ME,Bo,NE,Rr,ia,q0,Wo,ci,Oc,jE,qE,z0,Df,F0,zE,$0,FE,V0,H0,$E,B0,Rf,W0,VE,U0,HE,Mc,K0,If,Q0,Af,Uo,BE,WE,ui,G0,Lf,Nc,UE,Pf,KE,QE,GE,X0,J0,XE,JE,Y0,YE,lr,ZE,jc,Ko,Z0,ey,al,eT,ty,tT,nT,Jn,rT,iT,ny,Of,aT,Mf,ry,oT,sT,lT,cT,ol,Nf,uT,Xa,iy,dT,ay,jf,fT,qc,pT,mT,oy,aa,hT,sy,gT,yT,ly,vT,zc,cy,bT,wT,uy,xT,Fc,qf,ft,_T,kT,dy,Ja,Ir,CT,$c,fy,sl,ST,j6=(async()=>{var co,Di,Tm,uo;let oa,di,Ya;oa=Pe((e=>{function t(te,he){var G=te.length;te.push(he);e:for(;0<G;){var Ne=G-1>>>1,qe=te[Ne];if(0<o(qe,he))te[Ne]=he,te[G]=qe,G=Ne;else break e}}function n(te){return te.length===0?null:te[0]}function i(te){if(te.length===0)return null;var he=te[0],G=te.pop();if(G!==he){te[0]=G;e:for(var Ne=0,qe=te.length,Qe=qe>>>1;Ne<Qe;){var He=2*(Ne+1)-1,Fe=te[He],Oe=He+1,Be=te[Oe];if(0>o(Fe,G))Oe<qe&&0>o(Be,Fe)?(te[Ne]=Be,te[Oe]=G,Ne=Oe):(te[Ne]=Fe,te[He]=G,Ne=He);else if(Oe<qe&&0>o(Be,G))te[Ne]=Be,te[Oe]=G,Ne=Oe;else break e}}return he}function o(te,he){var G=te.sortIndex-he.sortIndex;return G===0?te.id-he.id:G}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var u=Date,d=u.now();e.unstable_now=function(){return u.now()-d}}var p=[],g=[],w=1,x=null,S=3,E=!1,T=!1,O=!1,j=!1,z=typeof setTimeout=="function"?setTimeout:null,V=typeof clearTimeout=="function"?clearTimeout:null,P=typeof setImmediate<"u"?setImmediate:null;function U(te){for(var he=n(g);he!==null;){if(he.callback===null)i(g);else if(he.startTime<=te)i(g),he.sortIndex=he.expirationTime,t(p,he);else break;he=n(g)}}function me(te){if(O=!1,U(te),!T)if(n(p)!==null)T=!0,$||($=!0,Z());else{var he=n(g);he!==null&&ce(me,he.startTime-te)}}var $=!1,W=-1,ae=5,xe=-1;function _e(){return j?!0:!(e.unstable_now()-xe<ae)}function Te(){if(j=!1,$){var te=e.unstable_now();xe=te;var he=!0;try{e:{T=!1,O&&(O=!1,V(W),W=-1),E=!0;var G=S;try{t:{for(U(te),x=n(p);x!==null&&!(x.expirationTime>te&&_e());){var Ne=x.callback;if(typeof Ne=="function"){x.callback=null,S=x.priorityLevel;var qe=Ne(x.expirationTime<=te);if(te=e.unstable_now(),typeof qe=="function"){x.callback=qe,U(te),he=!0;break t}x===n(p)&&i(p),U(te)}else i(p);x=n(p)}if(x!==null)he=!0;else{var Qe=n(g);Qe!==null&&ce(me,Qe.startTime-te),he=!1}}break e}finally{x=null,S=G,E=!1}he=void 0}}finally{he?Z():$=!1}}}var Z;if(typeof P=="function")Z=function(){P(Te)};else if(typeof MessageChannel<"u"){var Q=new MessageChannel,Y=Q.port2;Q.port1.onmessage=Te,Z=function(){Y.postMessage(null)}}else Z=function(){z(Te,0)};function ce(te,he){W=z(function(){te(e.unstable_now())},he)}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(te){te.callback=null},e.unstable_forceFrameRate=function(te){0>te||125<te?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):ae=0<te?Math.floor(1e3/te):5},e.unstable_getCurrentPriorityLevel=function(){return S},e.unstable_next=function(te){switch(S){case 1:case 2:case 3:var he=3;break;default:he=S}var G=S;S=he;try{return te()}finally{S=G}},e.unstable_requestPaint=function(){j=!0},e.unstable_runWithPriority=function(te,he){switch(te){case 1:case 2:case 3:case 4:case 5:break;default:te=3}var G=S;S=te;try{return he()}finally{S=G}},e.unstable_scheduleCallback=function(te,he,G){var Ne=e.unstable_now();switch(typeof G=="object"&&G?(G=G.delay,G=typeof G=="number"&&0<G?Ne+G:Ne):G=Ne,te){case 1:var qe=-1;break;case 2:qe=250;break;case 5:qe=1073741823;break;case 4:qe=1e4;break;default:qe=5e3}return qe=G+qe,te={id:w++,callback:he,priorityLevel:te,startTime:G,expirationTime:qe,sortIndex:-1},G>Ne?(te.sortIndex=G,t(g,te),n(p)===null&&te===n(g)&&(O?(V(W),W=-1):O=!0,ce(me,G-Ne))):(te.sortIndex=qe,t(p,te),T||E||(T=!0,$||($=!0,Z()))),te},e.unstable_shouldYield=_e,e.unstable_wrapCallback=function(te){var he=S;return function(){var G=S;S=he;try{return te.apply(this,arguments)}finally{S=G}}}})),di=Pe(((e,t)=>{t.exports=oa()})),Ya=Pe((e=>{var t=di(),n=Kd(),i=PC();function o(r){var a="https://react.dev/errors/"+r;if(1<arguments.length){a+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)a+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+r+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function u(r){var a=r,s=r;if(r.alternate)for(;a.return;)a=a.return;else{r=a;do a=r,a.flags&4098&&(s=a.return),r=a.return;while(r)}return a.tag===3?s:null}function d(r){if(r.tag===13){var a=r.memoizedState;if(a===null&&(r=r.alternate,r!==null&&(a=r.memoizedState)),a!==null)return a.dehydrated}return null}function p(r){if(r.tag===31){var a=r.memoizedState;if(a===null&&(r=r.alternate,r!==null&&(a=r.memoizedState)),a!==null)return a.dehydrated}return null}function g(r){if(u(r)!==r)throw Error(o(188))}function w(r){var a=r.alternate;if(!a){if(a=u(r),a===null)throw Error(o(188));return a===r?r:null}for(var s=r,c=a;;){var m=s.return;if(m===null)break;var y=m.alternate;if(y===null){if(c=m.return,c!==null){s=c;continue}break}if(m.child===y.child){for(y=m.child;y;){if(y===s)return g(m),r;if(y===c)return g(m),a;y=y.sibling}throw Error(o(188))}if(s.return!==c.return)s=m,c=y;else{for(var C=!1,R=m.child;R;){if(R===s){C=!0,s=m,c=y;break}if(R===c){C=!0,c=m,s=y;break}R=R.sibling}if(!C){for(R=y.child;R;){if(R===s){C=!0,s=y,c=m;break}if(R===c){C=!0,c=y,s=m;break}R=R.sibling}if(!C)throw Error(o(189))}}if(s.alternate!==c)throw Error(o(190))}if(s.tag!==3)throw Error(o(188));return s.stateNode.current===s?r:a}function x(r){var a=r.tag;if(a===5||a===26||a===27||a===6)return r;for(r=r.child;r!==null;){if(a=x(r),a!==null)return a;r=r.sibling}return null}var S=Object.assign,E=Symbol.for("react.element"),T=Symbol.for("react.transitional.element"),O=Symbol.for("react.portal"),j=Symbol.for("react.fragment"),z=Symbol.for("react.strict_mode"),V=Symbol.for("react.profiler"),P=Symbol.for("react.consumer"),U=Symbol.for("react.context"),me=Symbol.for("react.forward_ref"),$=Symbol.for("react.suspense"),W=Symbol.for("react.suspense_list"),ae=Symbol.for("react.memo"),xe=Symbol.for("react.lazy"),_e=Symbol.for("react.activity"),Te=Symbol.for("react.memo_cache_sentinel"),Z=Symbol.iterator;function Q(r){return typeof r!="object"||!r?null:(r=Z&&r[Z]||r["@@iterator"],typeof r=="function"?r:null)}var Y=Symbol.for("react.client.reference");function ce(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===Y?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case j:return"Fragment";case V:return"Profiler";case z:return"StrictMode";case $:return"Suspense";case W:return"SuspenseList";case _e:return"Activity"}if(typeof r=="object")switch(r.$$typeof){case O:return"Portal";case U:return r.displayName||"Context";case P:return(r._context.displayName||"Context")+".Consumer";case me:var a=r.render;return r=r.displayName,r||(r=(r=a.displayName||a.name||"",r===""?"ForwardRef":"ForwardRef("+r+")")),r;case ae:return a=r.displayName||null,a===null?ce(r.type)||"Memo":a;case xe:a=r._payload,r=r._init;try{return ce(r(a))}catch{}}return null}var te=Array.isArray,he=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Ne={pending:!1,data:null,method:null,action:null},qe=[],Qe=-1;function He(r){return{current:r}}function Fe(r){0>Qe||(r.current=qe[Qe],qe[Qe]=null,Qe--)}function Oe(r,a){Qe++,qe[Qe]=r.current,r.current=a}var Be=He(null),gt=He(null),bt=He(null),Mn=He(null);function gn(r,a){switch(Oe(bt,a),Oe(gt,r),Oe(Be,null),a.nodeType){case 9:case 11:r=(r=a.documentElement)&&(r=r.namespaceURI)?rC(r):0;break;default:if(r=a.tagName,a=a.namespaceURI)a=rC(a),r=iC(a,r);else switch(r){case"svg":r=1;break;case"math":r=2;break;default:r=0}}Fe(Be),Oe(Be,r)}function Xe(){Fe(Be),Fe(gt),Fe(bt)}function cn(r){r.memoizedState!==null&&Oe(Mn,r);var a=Be.current,s=iC(a,r.type);a!==s&&(Oe(gt,r),Oe(Be,s))}function Ct(r){gt.current===r&&(Fe(Be),Fe(gt)),Mn.current===r&&(Fe(Mn),vc._currentValue=Ne)}var kn,Lr;function yt(r){if(kn===void 0)try{throw Error()}catch(s){var a=s.stack.trim().match(/\n( *(at )?)/);kn=a&&a[1]||"",Lr=-1<s.stack.indexOf(`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./esm-BKF5e2-i.js","./chunk-C4rtOYze.js","./dist-oo7CUTL2.js","./dist-BbqPy6oS.js","./dist-Di6rD-vJ.js","./dist-CeF1Em5L.js","./dist-CULUasdr.js","./dist-CiELQ2ik.js","./dist-DAd7fvc1.js","./dist-BVNaV53g.js","./dist-ziD6OB9m.js","./dist-CtsSPT78.js","./dist-BC6HNlDy.js","./dist-5bwTcyKs.js","./dist-BrqkjqDe.js","./dist-e3TiiDdA.js","./dist-BpyRMlx3.js","./dist-Bwzs3Vpo.js","./dist-BIoV7ItK.js","./dist-DDuxOj5E.js","./dist-BKZjRJh7.js","./dist-Cnb7x5X_.js","./dist-BrBdlR-1.js","./dist-B8OryoSI.js","./dist-BB2m_pT9.js","./dist-C1_zNuc7.js","./dist-qxqSCe2K.js","./dist-BPoMypmC.js","./dist-gKSpDGw2.js","./dist-B_Q1ayL4.js","./dist-D1BB6_s_.js","./dist-Bm9PT5P9.js","./dist-2VJQDijP.js","./dist-CnESRnx2.js","./dist-URSEPeIQ.js","./dist-M9OI1ywz.js","./dist-BSndAsl2.js","./dist-rcsCwDst.js","./dist-CgdeWOxv.js","./dist-DcwGajoh.js","./dist-D7Pn6TvC.js","./dist-DXl-iyI_.js","./apl-sEsRK68R.js","./apl-HjCOpvY9.js","./asciiarmor-CwCv7Lne.js","./asciiarmor-CZUdQ8YG.js","./asn1-CuzWg-fh.js","./asn1-D9fbSxQp.js","./brainfuck-CnnfS_cI.js","./brainfuck-DoACnXtY.js","./cobol-GPJ0dHQG.js","./cobol-CJ0xj-s7.js","./clike-tfWZyYoN.js","./clike-BvT_OTqG.js","./clojure-Bninbb7T.js","./clojure-DObunWgq.js","./css-COZ77Eal.js","./css-CY56PGqI.js","./cmake-BpuaQxBS.js","./cmake-Bn1dmbG8.js","./coffeescript-D7gQHdB-.js","./coffeescript-DSHpWjh8.js","./commonlisp-Cr4KGe18.js","./commonlisp-C8BmLRoV.js","./cypher-CY21sZiF.js","./cypher-DkMgpwTD.js","./python-DwXz2aVG.js","./python-B6qWXHOF.js","./crystal-CsTMAwME.js","./crystal-Ca8nJT--.js","./d-CURHSrpr.js","./d-De6gURe0.js","./diff-oDNdZgsT.js","./diff-D9jknSNL.js","./dockerfile-L84t-MVG.js","./simple-mode-C1B3ue4E.js","./dtd-Cy2_BeYL.js","./dtd-B5FJ4BXV.js","./dylan-Crd9Fb_0.js","./dylan-zZheNs86.js","./ecl-CfCmFoo0.js","./ecl-BcK76Ow3.js","./eiffel-gIaoJqnl.js","./eiffel-KaaY88la.js","./elm-BFWuf0zw.js","./elm-B7-LHWcm.js","./erlang-o_h5GHv6.js","./erlang-DaphDTvj.js","./factor-DhP48x0i.js","./factor-aNENtHLj.js","./forth-B9culvwH.js","./forth-BKlt87ew.js","./fortran-P9CMHntW.js","./fortran-DDZOpuZf.js","./mllike-LThTvO6F.js","./mllike-CUPiTPoj.js","./gas-aBeBIUA2.js","./gas-CDn7Y-Gk.js","./gherkin-BKojMN6Q.js","./gherkin-eZ5FXLoA.js","./groovy-CePAd7wh.js","./groovy-BwhPb7Fz.js","./haskell-QHmsrbZx.js","./haskell-Dnk7SiND.js","./haxe-CQV_8vKL.js","./haxe-lllox-eQ.js","./idl-Dd8N44Cm.js","./idl-DgcPYEkx.js","./javascript-DSNeo7JU.js","./javascript-COkX3Xca.js","./julia-noK_uk9P.js","./julia-D-oyKrif.js","./livescript-YKkeujLh.js","./livescript-D_iKnN6P.js","./lua-fLqC1mOj.js","./lua-DvA1dcWk.js","./mirc-BTX_WxCv.js","./mirc-CHTyPhxQ.js","./mathematica-BEqGrvB0.js","./mathematica-BsU_wLgp.js","./modelica-ClexNQK-.js","./modelica-CY01YUSk.js","./mumps-G_BfPdvs.js","./mumps-oDd7O1nq.js","./mbox-9uehSvC8.js","./mbox-C0XhbFpn.js","./nsis-CBRC0JIr.js","./nsis-CNBWu0HQ.js","./ntriples-DrvRq09t.js","./ntriples-Kz6Omt8T.js","./octave-BiPC57kS.js","./octave-D4G4nAd-.js","./oz-DacpSh-q.js","./oz-BMPClN8a.js","./pascal-BQpBPSms.js","./pascal-PjzHq8gx.js","./perl-BhMGfluR.js","./perl-BJehkHc4.js","./pig-lTm9qLoi.js","./pig-BErUKXIE.js","./powershell-3wPcC3I5.js","./powershell-C9VPAjfT.js","./properties-CfDlOPua.js","./properties-C9_sS9KX.js","./protobuf-DqtB_3Ds.js","./protobuf-CTL_9hGv.js","./pug-BendPilS.js","./pug-IDpseMj2.js","./puppet-CS4oS8k4.js","./puppet-DiwkFvYr.js","./q-CAmiN8ZZ.js","./q-DK2HS4ce.js","./r-BVrS7OVn.js","./r-DaU8ID7q.js","./rpm-CdnUar42.js","./rpm-B1zWd_-L.js","./ruby-BCel59B2.js","./ruby-e8Zeo08a.js","./sas-BmzKenFt.js","./sas-CtNe7N_s.js","./scheme-DkHD_m5P.js","./scheme-D7VUNgy0.js","./shell-BoNNN3zm.js","./shell-95QiTNIY.js","./sieve-BXXK8f92.js","./sieve-4wk3Woa7.js","./smalltalk-BOqQhpHI.js","./smalltalk-BFPyGpl7.js","./sparql-edyZVkfL.js","./sparql-BMyoR-t0.js","./stylus-D7JxHbZj.js","./stylus-BbMWgEUg.js","./swift-BVf4glc7.js","./swift-BCakwsWN.js","./stex-Ccczot4V.js","./stex-BGrE-q7N.js","./verilog-Bw8NaRo-.js","./verilog-BHLL_Z-1.js","./tcl-Dj0fCfAi.js","./tcl-Dupz7YXC.js","./textile-C2t_E40o.js","./textile-CMQNVB0J.js","./toml-DaFUQW6l.js","./toml-CDlujHqn.js","./troff-CYzkeKir.js","./troff-Dxr_rPl0.js","./ttcn-CXYORWfg.js","./ttcn-iRE0hZ1i.js","./ttcn-cfg-CaYX34bx.js","./ttcn-cfg-_MoagO29.js","./turtle-5bfs3D9s.js","./turtle-C00vzWJK.js","./webidl-C8MAcuKq.js","./webidl-BArrMnhe.js","./vb-CXQ5pSkV.js","./vb-CkVClY4-.js","./vbscript-BZP_4BaN.js","./vbscript-BAyqwxih.js","./velocity-BbHSi60j.js","./velocity-DizPkX9R.js","./vhdl-CkM1aKBX.js","./vhdl-kw8S8KSM.js","./xquery-a81J2h4S.js","./xquery-BVt_izxN.js","./yacas-CjV2u_g7.js","./yacas-BFgb66eo.js","./z80-C0uVpBhe.js","./z80-CLywz-dK.js","./mscgen-Cr-Z_Sdd.js","./mscgen-DrdJ4BfA.js","./dist-Q_HuxBl8.js","./dist-oc6kOhWh.js","./dist-BvDn6jZn.js","./node-sql-parser-BAQ3SN57.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
var WM=Object.defineProperty;var UM=(sa,di,Za)=>di in sa?WM(sa,di,{enumerable:!0,configurable:!0,writable:!0,value:Za}):sa[di]=Za;var pe=(sa,di,Za)=>UM(sa,typeof di!="symbol"?di+"":di,Za);import{a as KM,i as Cg,n as QM,o as Kd,r as GM,t as Pe}from"./chunk-C4rtOYze.js";import{c as AC,i as Me,l as LC,p as Ne,r as XM,s as JM,u as $n}from"./useEvent-GCVIknuR.js";import{t as Qd}from"./react-C60yClUi.js";import{t as PC}from"./react-dom-Ba2zmJWD.js";import{L as OC,N as YM,P as MC,T as NC,k as ZM,w as e5,z as t5}from"./zod-BIDX-mZr.js";import{t as kr}from"./compiler-runtime-DnimoHo0.js";import{t as Sg}from"./debounce-DhnxH9Rh.js";import{d as jC,f as n5,g as Se,o as Gd}from"./useEventListener-DpNnLPuE.js";import{t as ki}from"./objects-CrbstYTV.js";import{t as Vn}from"./invariant-BUdrueMv.js";import{b as r5,g as i5,h as qC,t as a5}from"./utils-C8Yt16Y7.js";import{D as o5,N as Xd,O as s5,P as l5,S as c5,r as u5}from"./config-DFK5eCC3.js";import{n as d5,t as Ci}from"./cn-DCUzRj2J.js";import{t as f5}from"./jsx-runtime-3wZU7vFS.js";import{C as zC,T as p5,b as m5,d as h5,g as Jd,h as g5,p as y5,v as FC,w as ta,x as Wr,y as $C}from"./fullscreen-CrevbcR_.js";import{l as VC,o as v5}from"./dist-CFnrytEJ.js";import{d as b5}from"./menu-items-B8lIBnFI.js";import{a as w5,c as x5,i as Eg,m as _5,n as k5,o as HC,r as C5,s as S5,t as E5}from"./select-CPo-KTTe.js";import{i as T5,t as Tg}from"./tooltip-C9LWGQ7Y.js";import{t as BC}from"./button-W__YVea9.js";import{$t as zo,A as D5,C as R5,D as I5,Gt as Gs,H as Dg,Ht as Yd,I as WC,Jt as UC,K as A5,Kt as KC,Nt as Rg,Pt as QC,Qt as li,Rt as GC,S as L5,T as XC,Tt as Si,U as P5,Ut as xn,W as O5,Wt as M5,X as Zd,Yt as _c,Zt as sr,_t as N5,at as Xt,b as JC,bt as YC,ct as ZC,dt as j5,en as Xs,f as eS,it as tS,jt as Js,k as q5,kt as nS,l as ue,ot as z5,p as F5,pt as $5,q as V5,qt as ef,st as At,u as rS,ut as Cr,wt as Ig,z as iS}from"./dist-CeF1Em5L.js";import{A as H5,C as B5,D as W5,E as U5,S as K5,T as Q5,_ as G5,d as X5,h as J5,j as Y5,k as Z5,m as e6,n as t6,o as Ag,s as aS,t as n6,u as oS,v as r6,z as i6}from"./dist-DanVWUek.js";import{a as kc,i as Lg,l as a6,n as o6,p as Pg,r as sS}from"./arrays-UzzAzxsG.js";import{n as Ur}from"./once-DNBWPkeJ.js";import{t as s6}from"./capabilities-CHeZxy51.js";import{t as l6}from"./cjs-DCKmcMBz.js";import{t as Ys}from"./createReducer-C1MhlItJ.js";import{d as c6,l as lS,n as u6,o as cS,p as d6,r as tf}from"./dist-Di6rD-vJ.js";import{n as nf,t as f6}from"./useNonce-C2dwX-sI.js";import{i as Zs,r as p6,t as m6}from"./strings-DmKKoXrM.js";import{t as Sr}from"./requests-B9zEd_sW.js";import{a as h6,c as g6,d as y6,f as uS,i as v6,l as b6,n as w6,o as Og,r as x6,s as rf,t as _6,u as k6}from"./dist-BbqPy6oS.js";import{t as kt}from"./createLucideIcon-B8oVfJNp.js";import{a as Mg,i as C6,o as S6,r as E6,t as T6}from"./useLifecycle-DDwuYzlC.js";import{t as D6}from"./check-CyyJPf_5.js";import{t as R6}from"./x-4y-nyVDU.js";import{t as I6,u as A6}from"./toDate-QOk09NqD.js";import{t as Ng}from"./database-zap-n8PGHE18.js";import{n as L6,t as el}from"./DeferredRequestRegistry-6TRSC3VZ.js";import{t as Er}from"./badge-D28DMr4y.js";import{t as de}from"./preload-helper-BPPi7vOr.js";import{a as dS,s as P6}from"./dist-BPoMypmC.js";import{a as fS,i as jg,n as O6,r as pS,t as M6}from"./dist-Bm9PT5P9.js";import{n as N6}from"./stex-BGrE-q7N.js";import{t as Cc}from"./use-toast-DjpWVza6.js";import{n as mS}from"./paths-D5zczhUD.js";import{n as j6}from"./useTheme-CwCyrmDf.js";import{t as qg}from"./purify.es-Bwm8T4QC.js";let zg,hS,tl,gS,Fg,yS,Sc,$g,Vg,vS,bS,nl,wS,Hg,xS,_S,kS,Ec,af,Bg,CS,SS,ES,Fo,of,TS,DS,sf,Wg,RS,IS,$o,lf,Vo,cf,Ug,Kg,Qg,Gg,AS,Xg,LS,Tc,Jg,Yg,PS,uf,Zg,df,OS,e0,MS,NS,t0,ff,jS,Qa,pf,n0,na,Kr,r0,Dc,i0,qS,zS,a0,Xn,o0,s0,FS,mf,Ee,l0,Rc,$S,VS,HS,c0,BS,WS,US,rl,u0,Tr,KS,il,hf,Ho,d0,Dr,Ic,QS,gf,GS,XS,yf,f0,ra,JS,vf,YS,p0,ZS,m0,h0,eE,g0,tE,y0,v0,b0,bf,nE,w0,x0,rE,_0,iE,k0,aE,C0,oE,sE,lE,wf,S0,E0,Ga,cE,Ei,T0,xf,Ac,Lc,_f,uE,dE,Lt,fE,Pc,pE,mE,Oc,hE,D0,gE,yE,vE,R0,bE,I0,wE,xE,_E,kE,A0,CE,kf,L0,Cf,Xa,Sf,Ef,SE,EE,TE,DE,P0,O0,M0,RE,IE,AE,LE,Tf,N0,PE,Df,ia,j0,OE,Bo,ME,Rr,aa,q0,Wo,ci,Mc,NE,jE,z0,Rf,F0,qE,$0,zE,V0,H0,FE,B0,If,W0,$E,U0,VE,HE,K0,Af,Q0,Lf,Uo,BE,WE,ui,G0,Pf,Nc,Of,Mf,UE,KE,QE,X0,J0,GE,XE,Y0,JE,lr,YE,jc,Ko,Z0,ey,al,ZE,ty,eT,tT,Jn,nT,rT,ny,Nf,iT,jf,ry,aT,oT,sT,lT,ol,cT,uT,Ja,iy,dT,ay,qc,fT,zc,pT,mT,oy,oa,hT,sy,gT,yT,ly,vT,Fc,cy,bT,wT,uy,xT,$c,qf,ft,_T,kT,dy,Ya,Ir,CT,Vc,fy,sl,ST,q6=(async()=>{var uo,Di,Tm,fo;let sa,di,Za;sa=Pe((e=>{function t(te,he){var G=te.length;te.push(he);e:for(;0<G;){var je=G-1>>>1,qe=te[je];if(0<o(qe,he))te[je]=he,te[G]=qe,G=je;else break e}}function n(te){return te.length===0?null:te[0]}function i(te){if(te.length===0)return null;var he=te[0],G=te.pop();if(G!==he){te[0]=G;e:for(var je=0,qe=te.length,Qe=qe>>>1;je<Qe;){var He=2*(je+1)-1,Fe=te[He],Oe=He+1,Be=te[Oe];if(0>o(Fe,G))Oe<qe&&0>o(Be,Fe)?(te[je]=Be,te[Oe]=G,je=Oe):(te[je]=Fe,te[He]=G,je=He);else if(Oe<qe&&0>o(Be,G))te[je]=Be,te[Oe]=G,je=Oe;else break e}}return he}function o(te,he){var G=te.sortIndex-he.sortIndex;return G===0?te.id-he.id:G}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var u=Date,d=u.now();e.unstable_now=function(){return u.now()-d}}var p=[],g=[],w=1,x=null,S=3,E=!1,T=!1,O=!1,j=!1,z=typeof setTimeout=="function"?setTimeout:null,V=typeof clearTimeout=="function"?clearTimeout:null,P=typeof setImmediate<"u"?setImmediate:null;function U(te){for(var he=n(g);he!==null;){if(he.callback===null)i(g);else if(he.startTime<=te)i(g),he.sortIndex=he.expirationTime,t(p,he);else break;he=n(g)}}function me(te){if(O=!1,U(te),!T)if(n(p)!==null)T=!0,$||($=!0,Z());else{var he=n(g);he!==null&&ce(me,he.startTime-te)}}var $=!1,W=-1,ae=5,xe=-1;function _e(){return j?!0:!(e.unstable_now()-xe<ae)}function Te(){if(j=!1,$){var te=e.unstable_now();xe=te;var he=!0;try{e:{T=!1,O&&(O=!1,V(W),W=-1),E=!0;var G=S;try{t:{for(U(te),x=n(p);x!==null&&!(x.expirationTime>te&&_e());){var je=x.callback;if(typeof je=="function"){x.callback=null,S=x.priorityLevel;var qe=je(x.expirationTime<=te);if(te=e.unstable_now(),typeof qe=="function"){x.callback=qe,U(te),he=!0;break t}x===n(p)&&i(p),U(te)}else i(p);x=n(p)}if(x!==null)he=!0;else{var Qe=n(g);Qe!==null&&ce(me,Qe.startTime-te),he=!1}}break e}finally{x=null,S=G,E=!1}he=void 0}}finally{he?Z():$=!1}}}var Z;if(typeof P=="function")Z=function(){P(Te)};else if(typeof MessageChannel<"u"){var Q=new MessageChannel,Y=Q.port2;Q.port1.onmessage=Te,Z=function(){Y.postMessage(null)}}else Z=function(){z(Te,0)};function ce(te,he){W=z(function(){te(e.unstable_now())},he)}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(te){te.callback=null},e.unstable_forceFrameRate=function(te){0>te||125<te?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):ae=0<te?Math.floor(1e3/te):5},e.unstable_getCurrentPriorityLevel=function(){return S},e.unstable_next=function(te){switch(S){case 1:case 2:case 3:var he=3;break;default:he=S}var G=S;S=he;try{return te()}finally{S=G}},e.unstable_requestPaint=function(){j=!0},e.unstable_runWithPriority=function(te,he){switch(te){case 1:case 2:case 3:case 4:case 5:break;default:te=3}var G=S;S=te;try{return he()}finally{S=G}},e.unstable_scheduleCallback=function(te,he,G){var je=e.unstable_now();switch(typeof G=="object"&&G?(G=G.delay,G=typeof G=="number"&&0<G?je+G:je):G=je,te){case 1:var qe=-1;break;case 2:qe=250;break;case 5:qe=1073741823;break;case 4:qe=1e4;break;default:qe=5e3}return qe=G+qe,te={id:w++,callback:he,priorityLevel:te,startTime:G,expirationTime:qe,sortIndex:-1},G>je?(te.sortIndex=G,t(g,te),n(p)===null&&te===n(g)&&(O?(V(W),W=-1):O=!0,ce(me,G-je))):(te.sortIndex=qe,t(p,te),T||E||(T=!0,$||($=!0,Z()))),te},e.unstable_shouldYield=_e,e.unstable_wrapCallback=function(te){var he=S;return function(){var G=S;S=he;try{return te.apply(this,arguments)}finally{S=G}}}})),di=Pe(((e,t)=>{t.exports=sa()})),Za=Pe((e=>{var t=di(),n=Qd(),i=PC();function o(r){var a="https://react.dev/errors/"+r;if(1<arguments.length){a+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)a+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+r+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function u(r){var a=r,s=r;if(r.alternate)for(;a.return;)a=a.return;else{r=a;do a=r,a.flags&4098&&(s=a.return),r=a.return;while(r)}return a.tag===3?s:null}function d(r){if(r.tag===13){var a=r.memoizedState;if(a===null&&(r=r.alternate,r!==null&&(a=r.memoizedState)),a!==null)return a.dehydrated}return null}function p(r){if(r.tag===31){var a=r.memoizedState;if(a===null&&(r=r.alternate,r!==null&&(a=r.memoizedState)),a!==null)return a.dehydrated}return null}function g(r){if(u(r)!==r)throw Error(o(188))}function w(r){var a=r.alternate;if(!a){if(a=u(r),a===null)throw Error(o(188));return a===r?r:null}for(var s=r,c=a;;){var m=s.return;if(m===null)break;var y=m.alternate;if(y===null){if(c=m.return,c!==null){s=c;continue}break}if(m.child===y.child){for(y=m.child;y;){if(y===s)return g(m),r;if(y===c)return g(m),a;y=y.sibling}throw Error(o(188))}if(s.return!==c.return)s=m,c=y;else{for(var C=!1,R=m.child;R;){if(R===s){C=!0,s=m,c=y;break}if(R===c){C=!0,c=m,s=y;break}R=R.sibling}if(!C){for(R=y.child;R;){if(R===s){C=!0,s=y,c=m;break}if(R===c){C=!0,c=y,s=m;break}R=R.sibling}if(!C)throw Error(o(189))}}if(s.alternate!==c)throw Error(o(190))}if(s.tag!==3)throw Error(o(188));return s.stateNode.current===s?r:a}function x(r){var a=r.tag;if(a===5||a===26||a===27||a===6)return r;for(r=r.child;r!==null;){if(a=x(r),a!==null)return a;r=r.sibling}return null}var S=Object.assign,E=Symbol.for("react.element"),T=Symbol.for("react.transitional.element"),O=Symbol.for("react.portal"),j=Symbol.for("react.fragment"),z=Symbol.for("react.strict_mode"),V=Symbol.for("react.profiler"),P=Symbol.for("react.consumer"),U=Symbol.for("react.context"),me=Symbol.for("react.forward_ref"),$=Symbol.for("react.suspense"),W=Symbol.for("react.suspense_list"),ae=Symbol.for("react.memo"),xe=Symbol.for("react.lazy"),_e=Symbol.for("react.activity"),Te=Symbol.for("react.memo_cache_sentinel"),Z=Symbol.iterator;function Q(r){return typeof r!="object"||!r?null:(r=Z&&r[Z]||r["@@iterator"],typeof r=="function"?r:null)}var Y=Symbol.for("react.client.reference");function ce(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===Y?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case j:return"Fragment";case V:return"Profiler";case z:return"StrictMode";case $:return"Suspense";case W:return"SuspenseList";case _e:return"Activity"}if(typeof r=="object")switch(r.$$typeof){case O:return"Portal";case U:return r.displayName||"Context";case P:return(r._context.displayName||"Context")+".Consumer";case me:var a=r.render;return r=r.displayName,r||(r=(r=a.displayName||a.name||"",r===""?"ForwardRef":"ForwardRef("+r+")")),r;case ae:return a=r.displayName||null,a===null?ce(r.type)||"Memo":a;case xe:a=r._payload,r=r._init;try{return ce(r(a))}catch{}}return null}var te=Array.isArray,he=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,je={pending:!1,data:null,method:null,action:null},qe=[],Qe=-1;function He(r){return{current:r}}function Fe(r){0>Qe||(r.current=qe[Qe],qe[Qe]=null,Qe--)}function Oe(r,a){Qe++,qe[Qe]=r.current,r.current=a}var Be=He(null),gt=He(null),bt=He(null),Mn=He(null);function gn(r,a){switch(Oe(bt,a),Oe(gt,r),Oe(Be,null),a.nodeType){case 9:case 11:r=(r=a.documentElement)&&(r=r.namespaceURI)?rC(r):0;break;default:if(r=a.tagName,a=a.namespaceURI)a=rC(a),r=iC(a,r);else switch(r){case"svg":r=1;break;case"math":r=2;break;default:r=0}}Fe(Be),Oe(Be,r)}function Xe(){Fe(Be),Fe(gt),Fe(bt)}function cn(r){r.memoizedState!==null&&Oe(Mn,r);var a=Be.current,s=iC(a,r.type);a!==s&&(Oe(gt,r),Oe(Be,s))}function Ct(r){gt.current===r&&(Fe(Be),Fe(gt)),Mn.current===r&&(Fe(Mn),vc._currentValue=je)}var kn,Lr;function yt(r){if(kn===void 0)try{throw Error()}catch(s){var a=s.stack.trim().match(/\n( *(at )?)/);kn=a&&a[1]||"",Lr=-1<s.stack.indexOf(`
|
|
3
3
|
at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
4
4
|
`+kn+r+Lr}var Yr=!1;function un(r,a){if(!r||Yr)return"";Yr=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var c={DetermineComponentFrameRoot:function(){try{if(a){var ve=function(){throw Error()};if(Object.defineProperty(ve.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ve,[])}catch(fe){var se=fe}Reflect.construct(r,[],ve)}else{try{ve.call()}catch(fe){se=fe}r.call(ve.prototype)}}else{try{throw Error()}catch(fe){se=fe}(ve=r())&&typeof ve.catch=="function"&&ve.catch(function(){})}}catch(fe){if(fe&&se&&typeof fe.stack=="string")return[fe.stack,se.stack]}return[null,null]}};c.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var m=Object.getOwnPropertyDescriptor(c.DetermineComponentFrameRoot,"name");m&&m.configurable&&Object.defineProperty(c.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var y=c.DetermineComponentFrameRoot(),C=y[0],R=y[1];if(C&&R){var H=C.split(`
|
|
5
5
|
`),ie=R.split(`
|
|
6
6
|
`);for(m=c=0;c<H.length&&!H[c].includes("DetermineComponentFrameRoot");)c++;for(;m<ie.length&&!ie[m].includes("DetermineComponentFrameRoot");)m++;if(c===H.length||m===ie.length)for(c=H.length-1,m=ie.length-1;1<=c&&0<=m&&H[c]!==ie[m];)m--;for(;1<=c&&0<=m;c--,m--)if(H[c]!==ie[m]){if(c!==1||m!==1)do if(c--,m--,0>m||H[c]!==ie[m]){var ge=`
|
|
7
7
|
`+H[c].replace(" at new "," at ");return r.displayName&&ge.includes("<anonymous>")&&(ge=ge.replace("<anonymous>",r.displayName)),ge}while(1<=c&&0<=m);break}}}finally{Yr=!1,Error.prepareStackTrace=s}return(s=r?r.displayName||r.name:"")?yt(s):""}function Ri(r,a){switch(r.tag){case 26:case 27:case 5:return yt(r.type);case 16:return yt("Lazy");case 13:return r.child!==a&&a!==null?yt("Suspense Fallback"):yt("Suspense");case 19:return yt("SuspenseList");case 0:case 15:return un(r.type,!1);case 11:return un(r.type.render,!1);case 1:return un(r.type,!0);case 31:return yt("Activity");default:return""}}function Nn(r){try{var a="",s=null;do a+=Ri(r,s),s=r,r=r.return;while(r);return a}catch(c){return`
|
|
8
8
|
Error generating stack: `+c.message+`
|
|
9
|
-
`+c.stack}}var Pr=Object.prototype.hasOwnProperty,jn=t.unstable_scheduleCallback,yn=t.unstable_cancelCallback,wa=t.unstable_shouldYield,Ii=t.unstable_requestPaint,Yt=t.unstable_now,Ai=t.unstable_getCurrentPriorityLevel,vn=t.unstable_ImmediatePriority,hi=t.unstable_UserBlockingPriority,Vt=t.unstable_NormalPriority,Zr=t.unstable_LowPriority,St=t.unstable_IdlePriority,Li=t.log,xa=t.unstable_setDisableYieldValue,Or=null,rn=null;function et(r){if(typeof Li=="function"&&xa(r),rn&&typeof rn.setStrictMode=="function")try{rn.setStrictMode(Or,r)}catch{}}var wt=Math.clz32?Math.clz32:Bn,Et=Math.log,Tt=Math.LN2;function Bn(r){return r>>>=0,r===0?32:31-(Et(r)/Tt|0)|0}var Mr=256,Dt=262144,fr=4194304;function qn(r){var a=r&42;if(a!==0)return a;switch(r&-r){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 r&261888;case 262144:case 524288:case 1048576:case 2097152:return r&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return r&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return r}}function ei(r,a,s){var c=r.pendingLanes;if(c===0)return 0;var m=0,y=r.suspendedLanes,C=r.pingedLanes;r=r.warmLanes;var R=c&134217727;return R===0?(R=c&~y,R===0?C===0?s||(s=c&~r,s!==0&&(m=qn(s))):m=qn(C):m=qn(R)):(c=R&~y,c===0?(C&=R,C===0?s||(s=R&~r,s!==0&&(m=qn(s))):m=qn(C)):m=qn(c)),m===0?0:a!==0&&a!==m&&(a&y)===0&&(y=m&-m,s=a&-a,y>=s||y===32&&s&4194048)?a:m}function Cn(r,a){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&a)===0}function pr(r,a){switch(r){case 1:case 2:case 4:case 8:case 64:return a+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 a+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 Pi(){var r=fr;return fr<<=1,!(fr&62914560)&&(fr=4194304),r}function gi(r){for(var a=[],s=0;31>s;s++)a.push(r);return a}function zn(r,a){r.pendingLanes|=a,a!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function Oi(r,a,s,c,m,y){var C=r.pendingLanes;r.pendingLanes=s,r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0,r.expiredLanes&=s,r.entangledLanes&=s,r.errorRecoveryDisabledLanes&=s,r.shellSuspendCounter=0;var R=r.entanglements,H=r.expirationTimes,ie=r.hiddenUpdates;for(s=C&~s;0<s;){var ge=31-wt(s),ve=1<<ge;R[ge]=0,H[ge]=-1;var se=ie[ge];if(se!==null)for(ie[ge]=null,ge=0;ge<se.length;ge++){var fe=se[ge];fe!==null&&(fe.lane&=-536870913)}s&=~ve}c!==0&&Wn(r,c,0),y!==0&&m===0&&r.tag!==0&&(r.suspendedLanes|=y&~(C&~a))}function Wn(r,a,s){r.pendingLanes|=a,r.suspendedLanes&=~a;var c=31-wt(a);r.entangledLanes|=a,r.entanglements[c]=r.entanglements[c]|1073741824|s&261930}function mr(r,a){var s=r.entangledLanes|=a;for(r=r.entanglements;s;){var c=31-wt(s),m=1<<c;m&a|r[c]&a&&(r[c]|=a),s&=~m}}function A(r,a){var s=a&-a;return s=s&42?1:rt(s),(s&(r.suspendedLanes|a))===0?s:0}function rt(r){switch(r){case 2:r=1;break;case 8:r=4;break;case 32:r=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:r=128;break;case 268435456:r=134217728;break;default:r=0}return r}function q(r){return r&=-r,2<r?8<r?r&134217727?32:268435456:8:2}function re(){var r=G.p;return r===0?(r=window.event,r===void 0?32:SC(r.type)):r}function we(r,a){var s=G.p;try{return G.p=r,a()}finally{G.p=s}}var De=Math.random().toString(36).slice(2),Ue="__reactFiber$"+De,Ke="__reactProps$"+De,ut="__reactContainer$"+De,Nt="__reactEvents$"+De,it="__reactListeners$"+De,jt="__reactHandles$"+De,st="__reactResources$"+De,mt="__reactMarker$"+De;function Sn(r){delete r[Ue],delete r[Ke],delete r[Nt],delete r[it],delete r[jt]}function hr(r){var a=r[Ue];if(a)return a;for(var s=r.parentNode;s;){if(a=s[ut]||s[Ue]){if(s=a.alternate,a.child!==null||s!==null&&s.child!==null)for(r=dC(r);r!==null;){if(s=r[Ue])return s;r=dC(r)}return a}r=s,s=r.parentNode}return null}function yi(r){if(r=r[Ue]||r[ut]){var a=r.tag;if(a===5||a===6||a===13||a===31||a===26||a===27||a===3)return r}return null}function Un(r){var a=r.tag;if(a===5||a===26||a===27||a===6)return r.stateNode;throw Error(o(33))}function _a(r){var a=r[st];return a||(a=r[st]={hoistableStyles:new Map,hoistableScripts:new Map}),a}function an(r){r[mt]=!0}var Ll=new Set,Pu={};function vi(r,a){ka(r,a),ka(r+"Capture",a)}function ka(r,a){for(Pu[r]=a,r=0;r<a.length;r++)Ll.add(a[r])}var Dm=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]*$"),tr={},Ou={};function Rm(r){return Pr.call(Ou,r)?!0:Pr.call(tr,r)?!1:Dm.test(r)?Ou[r]=!0:(tr[r]=!0,!1)}function fo(r,a,s){if(Rm(a))if(s===null)r.removeAttribute(a);else{switch(typeof s){case"undefined":case"function":case"symbol":r.removeAttribute(a);return;case"boolean":var c=a.toLowerCase().slice(0,5);if(c!=="data-"&&c!=="aria-"){r.removeAttribute(a);return}}r.setAttribute(a,""+s)}}function po(r,a,s){if(s===null)r.removeAttribute(a);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(a);return}r.setAttribute(a,""+s)}}function ti(r,a,s,c){if(c===null)r.removeAttribute(s);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(s);return}r.setAttributeNS(a,s,""+c)}}function Kn(r){switch(typeof r){case"bigint":case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function Mu(r){var a=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function Nu(r,a,s){var c=Object.getOwnPropertyDescriptor(r.constructor.prototype,a);if(!r.hasOwnProperty(a)&&c!==void 0&&typeof c.get=="function"&&typeof c.set=="function"){var m=c.get,y=c.set;return Object.defineProperty(r,a,{configurable:!0,get:function(){return m.call(this)},set:function(C){s=""+C,y.call(this,C)}}),Object.defineProperty(r,a,{enumerable:c.enumerable}),{getValue:function(){return s},setValue:function(C){s=""+C},stopTracking:function(){r._valueTracker=null,delete r[a]}}}}function Pl(r){if(!r._valueTracker){var a=Mu(r)?"checked":"value";r._valueTracker=Nu(r,a,""+r[a])}}function Ol(r){if(!r)return!1;var a=r._valueTracker;if(!a)return!0;var s=a.getValue(),c="";return r&&(c=Mu(r)?r.checked?"true":"false":r.value),r=c,r===s?!1:(a.setValue(r),!0)}function Fn(r){if(r||(r=typeof document<"u"?document:void 0),r===void 0)return null;try{return r.activeElement||r.body}catch{return r.body}}var pt=/[\n"\\]/g;function gr(r){return r.replace(pt,function(a){return"\\"+a.charCodeAt(0).toString(16)+" "})}function Ca(r,a,s,c,m,y,C,R){r.name="",C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"?r.type=C:r.removeAttribute("type"),a==null?C!=="submit"&&C!=="reset"||r.removeAttribute("value"):C==="number"?(a===0&&r.value===""||r.value!=a)&&(r.value=""+Kn(a)):r.value!==""+Kn(a)&&(r.value=""+Kn(a)),a==null?s==null?c!=null&&r.removeAttribute("value"):Mi(r,C,Kn(s)):Mi(r,C,Kn(a)),m==null&&y!=null&&(r.defaultChecked=!!y),m!=null&&(r.checked=m&&typeof m!="function"&&typeof m!="symbol"),R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"?r.name=""+Kn(R):r.removeAttribute("name")}function ju(r,a,s,c,m,y,C,R){if(y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(r.type=y),a!=null||s!=null){if(!(y!=="submit"&&y!=="reset"||a!=null)){Pl(r);return}s=s==null?"":""+Kn(s),a=a==null?s:""+Kn(a),R||a===r.value||(r.value=a),r.defaultValue=a}c??(c=m),c=typeof c!="function"&&typeof c!="symbol"&&!!c,r.checked=R?r.checked:!!c,r.defaultChecked=!!c,C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"&&(r.name=C),Pl(r)}function Mi(r,a,s){a==="number"&&Fn(r.ownerDocument)===r||r.defaultValue===""+s||(r.defaultValue=""+s)}function Sa(r,a,s,c){if(r=r.options,a){a={};for(var m=0;m<s.length;m++)a["$"+s[m]]=!0;for(s=0;s<r.length;s++)m=a.hasOwnProperty("$"+r[s].value),r[s].selected!==m&&(r[s].selected=m),m&&c&&(r[s].defaultSelected=!0)}else{for(s=""+Kn(s),a=null,m=0;m<r.length;m++){if(r[m].value===s){r[m].selected=!0,c&&(r[m].defaultSelected=!0);return}a!==null||r[m].disabled||(a=r[m])}a!==null&&(a.selected=!0)}}function Ea(r,a,s){if(a!=null&&(a=""+Kn(a),a!==r.value&&(r.value=a),s==null)){r.defaultValue!==a&&(r.defaultValue=a);return}r.defaultValue=s==null?"":""+Kn(s)}function hs(r,a,s,c){if(a==null){if(c!=null){if(s!=null)throw Error(o(92));if(te(c)){if(1<c.length)throw Error(o(93));c=c[0]}s=c}s??(s=""),a=s}s=Kn(a),r.defaultValue=s,c=r.textContent,c===s&&c!==""&&c!==null&&(r.value=c),Pl(r)}function Ni(r,a){if(a){var s=r.firstChild;if(s&&s===r.lastChild&&s.nodeType===3){s.nodeValue=a;return}}r.textContent=a}var Im=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 ji(r,a,s){var c=a.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?c?r.setProperty(a,""):a==="float"?r.cssFloat="":r[a]="":c?r.setProperty(a,s):typeof s!="number"||s===0||Im.has(a)?a==="float"?r.cssFloat=s:r[a]=(""+s).trim():r[a]=s+"px"}function qu(r,a,s){if(a!=null&&typeof a!="object")throw Error(o(62));if(r=r.style,s!=null){for(var c in s)!s.hasOwnProperty(c)||a!=null&&a.hasOwnProperty(c)||(c.indexOf("--")===0?r.setProperty(c,""):c==="float"?r.cssFloat="":r[c]="");for(var m in a)c=a[m],a.hasOwnProperty(m)&&s[m]!==c&&ji(r,m,c)}else for(var y in a)a.hasOwnProperty(y)&&ji(r,y,a[y])}function mo(r){if(r.indexOf("-")===-1)return!1;switch(r){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 gs=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"]]),zu=/^[\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 ys(r){return zu.test(""+r)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":r}function Nr(){}var En=null;function Ml(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var Qn=null,bi=null;function Fu(r){var a=yi(r);if(a&&(r=a.stateNode)){var s=r[Ke]||null;e:switch(r=a.stateNode,a.type){case"input":if(Ca(r,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),a=s.name,s.type==="radio"&&a!=null){for(s=r;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+gr(""+a)+'"][type="radio"]'),a=0;a<s.length;a++){var c=s[a];if(c!==r&&c.form===r.form){var m=c[Ke]||null;if(!m)throw Error(o(90));Ca(c,m.value,m.defaultValue,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name)}}for(a=0;a<s.length;a++)c=s[a],c.form===r.form&&Ol(c)}break e;case"textarea":Ea(r,s.value,s.defaultValue);break e;case"select":a=s.value,a!=null&&Sa(r,!!s.multiple,a,!1)}}}var Nl=!1;function $u(r,a,s){if(Nl)return r(a,s);Nl=!0;try{return r(a)}finally{if(Nl=!1,(Qn!==null||bi!==null)&&(Sd(),Qn&&(a=Qn,r=bi,bi=Qn=null,Fu(a),r)))for(a=0;a<r.length;a++)Fu(r[a])}}function ho(r,a){var s=r.stateNode;if(s===null)return null;var c=s[Ke]||null;if(c===null)return null;s=c[a];e:switch(a){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(c=!c.disabled)||(r=r.type,c=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!c;break e;default:r=!1}if(r)return null;if(s&&typeof s!="function")throw Error(o(231,a,typeof s));return s}var ni=!(typeof window>"u"||window.document===void 0||window.document.createElement===void 0),jl=!1;if(ni)try{var go={};Object.defineProperty(go,"passive",{get:function(){jl=!0}}),window.addEventListener("test",go,go),window.removeEventListener("test",go,go)}catch{jl=!1}var ri=null,vs=null,yo=null;function ql(){if(yo)return yo;var r,a=vs,s=a.length,c,m="value"in ri?ri.value:ri.textContent,y=m.length;for(r=0;r<s&&a[r]===m[r];r++);var C=s-r;for(c=1;c<=C&&a[s-c]===m[y-c];c++);return yo=m.slice(r,1<c?1-c:void 0)}function vo(r){var a=r.keyCode;return"charCode"in r?(r=r.charCode,r===0&&a===13&&(r=13)):r=a,r===10&&(r=13),32<=r||r===13?r:0}function bo(){return!0}function zl(){return!1}function Tn(r){function a(s,c,m,y,C){for(var R in this._reactName=s,this._targetInst=m,this.type=c,this.nativeEvent=y,this.target=C,this.currentTarget=null,r)r.hasOwnProperty(R)&&(s=r[R],this[R]=s?s(y):y[R]);return this.isDefaultPrevented=(y.defaultPrevented==null?y.returnValue===!1:y.defaultPrevented)?bo:zl,this.isPropagationStopped=zl,this}return S(a.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=bo)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=bo)},persist:function(){},isPersistent:bo}),a}var qi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},f=Tn(qi),h=S({},qi,{view:0,detail:0}),v=Tn(h),b,_,k,D=S({},h,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:We,button:0,buttons:0,relatedTarget:function(r){return r.relatedTarget===void 0?r.fromElement===r.srcElement?r.toElement:r.fromElement:r.relatedTarget},movementX:function(r){return"movementX"in r?r.movementX:(r!==k&&(k&&r.type==="mousemove"?(b=r.screenX-k.screenX,_=r.screenY-k.screenY):_=b=0,k=r),b)},movementY:function(r){return"movementY"in r?r.movementY:_}}),I=Tn(D),L=Tn(S({},D,{dataTransfer:0})),F=Tn(S({},h,{relatedTarget:0})),N=Tn(S({},qi,{animationName:0,elapsedTime:0,pseudoElement:0})),le=Tn(S({},qi,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}})),oe=Tn(S({},qi,{data:0})),X={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},J={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"},Ce={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ke(r){var a=this.nativeEvent;return a.getModifierState?a.getModifierState(r):(r=Ce[r])?!!a[r]:!1}function We(){return ke}var Ie=Tn(S({},h,{key:function(r){if(r.key){var a=X[r.key]||r.key;if(a!=="Unidentified")return a}return r.type==="keypress"?(r=vo(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?J[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:We,charCode:function(r){return r.type==="keypress"?vo(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?vo(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}})),$e=Tn(S({},D,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),ht=Tn(S({},h,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:We})),tt=Tn(S({},qi,{propertyName:0,elapsedTime:0,pseudoElement:0})),qt=Tn(S({},D,{deltaX:function(r){return"deltaX"in r?r.deltaX:"wheelDeltaX"in r?-r.wheelDeltaX:0},deltaY:function(r){return"deltaY"in r?r.deltaY:"wheelDeltaY"in r?-r.wheelDeltaY:"wheelDelta"in r?-r.wheelDelta:0},deltaZ:0,deltaMode:0})),Ht=Tn(S({},qi,{newState:0,oldState:0})),Je=[9,13,27,32],Ge=ni&&"CompositionEvent"in window,Qt=null;ni&&"documentMode"in document&&(Qt=document.documentMode);var dn=ni&&"TextEvent"in window&&!Qt,bn=ni&&(!Ge||Qt&&8<Qt&&11>=Qt),wo=" ",Vu=!1;function Hu(r,a){switch(r){case"keyup":return Je.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function bs(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var ws=!1;function dO(r,a){switch(r){case"compositionend":return bs(a);case"keypress":return a.which===32?(Vu=!0,wo):null;case"textInput":return r=a.data,r===wo&&Vu?null:r;default:return null}}function fO(r,a){if(ws)return r==="compositionend"||!Ge&&Hu(r,a)?(r=ql(),yo=vs=ri=null,ws=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(a.ctrlKey||a.altKey||a.metaKey)||a.ctrlKey&&a.altKey){if(a.char&&1<a.char.length)return a.char;if(a.which)return String.fromCharCode(a.which)}return null;case"compositionend":return bn&&a.locale!=="ko"?null:a.data;default:return null}}var pO={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 gx(r){var a=r&&r.nodeName&&r.nodeName.toLowerCase();return a==="input"?!!pO[r.type]:a==="textarea"}function yx(r,a,s,c){Qn?bi?bi.push(c):bi=[c]:Qn=c,a=Ld(a,"onChange"),0<a.length&&(s=new f("onChange","change",null,s,c),r.push({event:s,listeners:a}))}var Fl=null,$l=null;function mO(r){Xk(r,0)}function Bu(r){if(Ol(Un(r)))return r}function vx(r,a){if(r==="change")return a}var bx=!1;if(ni){var Am;if(ni){var Lm="oninput"in document;if(!Lm){var wx=document.createElement("div");wx.setAttribute("oninput","return;"),Lm=typeof wx.oninput=="function"}Am=Lm}else Am=!1;bx=Am&&(!document.documentMode||9<document.documentMode)}function xx(){Fl&&(Fl.detachEvent("onpropertychange",_x),$l=Fl=null)}function _x(r){if(r.propertyName==="value"&&Bu($l)){var a=[];yx(a,$l,r,Ml(r)),$u(mO,a)}}function hO(r,a,s){r==="focusin"?(xx(),Fl=a,$l=s,Fl.attachEvent("onpropertychange",_x)):r==="focusout"&&xx()}function gO(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return Bu($l)}function yO(r,a){if(r==="click")return Bu(a)}function vO(r,a){if(r==="input"||r==="change")return Bu(a)}function bO(r,a){return r===a&&(r!==0||1/r==1/a)||r!==r&&a!==a}var yr=typeof Object.is=="function"?Object.is:bO;function Vl(r,a){if(yr(r,a))return!0;if(typeof r!="object"||!r||typeof a!="object"||!a)return!1;var s=Object.keys(r),c=Object.keys(a);if(s.length!==c.length)return!1;for(c=0;c<s.length;c++){var m=s[c];if(!Pr.call(a,m)||!yr(r[m],a[m]))return!1}return!0}function kx(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function Cx(r,a){var s=kx(r);r=0;for(var c;s;){if(s.nodeType===3){if(c=r+s.textContent.length,r<=a&&c>=a)return{node:s,offset:a-r};r=c}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=kx(s)}}function Sx(r,a){return r&&a?r===a?!0:r&&r.nodeType===3?!1:a&&a.nodeType===3?Sx(r,a.parentNode):"contains"in r?r.contains(a):r.compareDocumentPosition?!!(r.compareDocumentPosition(a)&16):!1:!1}function Ex(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var a=Fn(r.document);a instanceof r.HTMLIFrameElement;){try{var s=typeof a.contentWindow.location.href=="string"}catch{s=!1}if(s)r=a.contentWindow;else break;a=Fn(r.document)}return a}function Pm(r){var a=r&&r.nodeName&&r.nodeName.toLowerCase();return a&&(a==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||a==="textarea"||r.contentEditable==="true")}var wO=ni&&"documentMode"in document&&11>=document.documentMode,xs=null,Om=null,Hl=null,Mm=!1;function Tx(r,a,s){var c=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Mm||xs==null||xs!==Fn(c)||(c=xs,"selectionStart"in c&&Pm(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset}),Hl&&Vl(Hl,c)||(Hl=c,c=Ld(Om,"onSelect"),0<c.length&&(a=new f("onSelect","select",null,a,s),r.push({event:a,listeners:c}),a.target=xs)))}function xo(r,a){var s={};return s[r.toLowerCase()]=a.toLowerCase(),s["Webkit"+r]="webkit"+a,s["Moz"+r]="moz"+a,s}var _s={animationend:xo("Animation","AnimationEnd"),animationiteration:xo("Animation","AnimationIteration"),animationstart:xo("Animation","AnimationStart"),transitionrun:xo("Transition","TransitionRun"),transitionstart:xo("Transition","TransitionStart"),transitioncancel:xo("Transition","TransitionCancel"),transitionend:xo("Transition","TransitionEnd")},Nm={},Dx={};ni&&(Dx=document.createElement("div").style,"AnimationEvent"in window||(delete _s.animationend.animation,delete _s.animationiteration.animation,delete _s.animationstart.animation),"TransitionEvent"in window||delete _s.transitionend.transition);function _o(r){if(Nm[r])return Nm[r];if(!_s[r])return r;var a=_s[r],s;for(s in a)if(a.hasOwnProperty(s)&&s in Dx)return Nm[r]=a[s];return r}var Rx=_o("animationend"),Ix=_o("animationiteration"),Ax=_o("animationstart"),xO=_o("transitionrun"),_O=_o("transitionstart"),kO=_o("transitioncancel"),Lx=_o("transitionend"),Px=new Map,jm="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(" ");jm.push("scrollEnd");function ii(r,a){Px.set(r,a),vi(a,[r])}var Wu=typeof reportError=="function"?reportError:function(r){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var a=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof r=="object"&&r&&typeof r.message=="string"?String(r.message):String(r),error:r});if(!window.dispatchEvent(a))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",r);return}console.error(r)},jr=[],ks=0,qm=0;function Uu(){for(var r=ks,a=qm=ks=0;a<r;){var s=jr[a];jr[a++]=null;var c=jr[a];jr[a++]=null;var m=jr[a];jr[a++]=null;var y=jr[a];if(jr[a++]=null,c!==null&&m!==null){var C=c.pending;C===null?m.next=m:(m.next=C.next,C.next=m),c.pending=m}y!==0&&Ox(s,m,y)}}function Ku(r,a,s,c){jr[ks++]=r,jr[ks++]=a,jr[ks++]=s,jr[ks++]=c,qm|=c,r.lanes|=c,r=r.alternate,r!==null&&(r.lanes|=c)}function zm(r,a,s,c){return Ku(r,a,s,c),Qu(r)}function ko(r,a){return Ku(r,null,null,a),Qu(r)}function Ox(r,a,s){r.lanes|=s;var c=r.alternate;c!==null&&(c.lanes|=s);for(var m=!1,y=r.return;y!==null;)y.childLanes|=s,c=y.alternate,c!==null&&(c.childLanes|=s),y.tag===22&&(r=y.stateNode,r===null||r._visibility&1||(m=!0)),r=y,y=y.return;return r.tag===3?(y=r.stateNode,m&&a!==null&&(m=31-wt(s),r=y.hiddenUpdates,c=r[m],c===null?r[m]=[a]:c.push(a),a.lane=s|536870912),y):null}function Qu(r){if(50<dc)throw dc=0,Qh=null,Error(o(185));for(var a=r.return;a!==null;)r=a,a=r.return;return r.tag===3?r.stateNode:null}var Cs={};function CO(r,a,s,c){this.tag=r,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=a,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=c,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function vr(r,a,s,c){return new CO(r,a,s,c)}function Fm(r){return r=r.prototype,!(!r||!r.isReactComponent)}function zi(r,a){var s=r.alternate;return s===null?(s=vr(r.tag,a,r.key,r.mode),s.elementType=r.elementType,s.type=r.type,s.stateNode=r.stateNode,s.alternate=r,r.alternate=s):(s.pendingProps=a,s.type=r.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=r.flags&65011712,s.childLanes=r.childLanes,s.lanes=r.lanes,s.child=r.child,s.memoizedProps=r.memoizedProps,s.memoizedState=r.memoizedState,s.updateQueue=r.updateQueue,a=r.dependencies,s.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},s.sibling=r.sibling,s.index=r.index,s.ref=r.ref,s.refCleanup=r.refCleanup,s}function Mx(r,a){r.flags&=65011714;var s=r.alternate;return s===null?(r.childLanes=0,r.lanes=a,r.child=null,r.subtreeFlags=0,r.memoizedProps=null,r.memoizedState=null,r.updateQueue=null,r.dependencies=null,r.stateNode=null):(r.childLanes=s.childLanes,r.lanes=s.lanes,r.child=s.child,r.subtreeFlags=0,r.deletions=null,r.memoizedProps=s.memoizedProps,r.memoizedState=s.memoizedState,r.updateQueue=s.updateQueue,r.type=s.type,a=s.dependencies,r.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),r}function Gu(r,a,s,c,m,y){var C=0;if(c=r,typeof r=="function")Fm(r)&&(C=1);else if(typeof r=="string")C=IM(r,s,Be.current)?26:r==="html"||r==="head"||r==="body"?27:5;else e:switch(r){case _e:return r=vr(31,s,a,m),r.elementType=_e,r.lanes=y,r;case j:return Co(s.children,m,y,a);case z:C=8,m|=24;break;case V:return r=vr(12,s,a,m|2),r.elementType=V,r.lanes=y,r;case $:return r=vr(13,s,a,m),r.elementType=$,r.lanes=y,r;case W:return r=vr(19,s,a,m),r.elementType=W,r.lanes=y,r;default:if(typeof r=="object"&&r)switch(r.$$typeof){case U:C=10;break e;case P:C=9;break e;case me:C=11;break e;case ae:C=14;break e;case xe:C=16,c=null;break e}C=29,s=Error(o(130,r===null?"null":typeof r,"")),c=null}return a=vr(C,s,a,m),a.elementType=r,a.type=c,a.lanes=y,a}function Co(r,a,s,c){return r=vr(7,r,c,a),r.lanes=s,r}function $m(r,a,s){return r=vr(6,r,null,a),r.lanes=s,r}function Nx(r){var a=vr(18,null,null,0);return a.stateNode=r,a}function Vm(r,a,s){return a=vr(4,r.children===null?[]:r.children,r.key,a),a.lanes=s,a.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},a}var jx=new WeakMap;function qr(r,a){if(typeof r=="object"&&r){var s=jx.get(r);return s===void 0?(a={value:r,source:a,stack:Nn(a)},jx.set(r,a),a):s}return{value:r,source:a,stack:Nn(a)}}var Ss=[],Es=0,Xu=null,Bl=0,zr=[],Fr=0,Ta=null,wi=1,xi="";function Fi(r,a){Ss[Es++]=Bl,Ss[Es++]=Xu,Xu=r,Bl=a}function qx(r,a,s){zr[Fr++]=wi,zr[Fr++]=xi,zr[Fr++]=Ta,Ta=r;var c=wi;r=xi;var m=32-wt(c)-1;c&=~(1<<m),s+=1;var y=32-wt(a)+m;if(30<y){var C=m-m%5;y=(c&(1<<C)-1).toString(32),c>>=C,m-=C,wi=1<<32-wt(a)+m|s<<m|c,xi=y+r}else wi=1<<y|s<<m|c,xi=r}function Hm(r){r.return!==null&&(Fi(r,1),qx(r,1,0))}function Bm(r){for(;r===Xu;)Xu=Ss[--Es],Ss[Es]=null,Bl=Ss[--Es],Ss[Es]=null;for(;r===Ta;)Ta=zr[--Fr],zr[Fr]=null,xi=zr[--Fr],zr[Fr]=null,wi=zr[--Fr],zr[Fr]=null}function zx(r,a){zr[Fr++]=wi,zr[Fr++]=xi,zr[Fr++]=Ta,wi=a.id,xi=a.overflow,Ta=r}var Rn=null,Bt=null,dt=!1,Da=null,$r=!1,Wm=Error(o(519));function Ra(r){throw Wl(qr(Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML","")),r)),Wm}function Fx(r){var a=r.stateNode,s=r.type,c=r.memoizedProps;switch(a[Ue]=r,a[Ke]=c,s){case"dialog":ot("cancel",a),ot("close",a);break;case"iframe":case"object":case"embed":ot("load",a);break;case"video":case"audio":for(s=0;s<pc.length;s++)ot(pc[s],a);break;case"source":ot("error",a);break;case"img":case"image":case"link":ot("error",a),ot("load",a);break;case"details":ot("toggle",a);break;case"input":ot("invalid",a),ju(a,c.value,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name,!0);break;case"select":ot("invalid",a);break;case"textarea":ot("invalid",a),hs(a,c.value,c.defaultValue,c.children)}s=c.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||a.textContent===""+s||c.suppressHydrationWarning===!0||tC(a.textContent,s)?(c.popover!=null&&(ot("beforetoggle",a),ot("toggle",a)),c.onScroll!=null&&ot("scroll",a),c.onScrollEnd!=null&&ot("scrollend",a),c.onClick!=null&&(a.onclick=Nr),a=!0):a=!1,a||Ra(r,!0)}function $x(r){for(Rn=r.return;Rn;)switch(Rn.tag){case 5:case 31:case 13:$r=!1;return;case 27:case 3:$r=!0;return;default:Rn=Rn.return}}function Ts(r){if(r!==Rn)return!1;if(!dt)return $x(r),dt=!0,!1;var a=r.tag,s;if((s=a!==3&&a!==27)&&((s=a===5)&&(s=r.type,s=!(s!=="form"&&s!=="button")||lg(r.type,r.memoizedProps)),s=!s),s&&Bt&&Ra(r),$x(r),a===13){if(r=r.memoizedState,r=r===null?null:r.dehydrated,!r)throw Error(o(317));Bt=uC(r)}else if(a===31){if(r=r.memoizedState,r=r===null?null:r.dehydrated,!r)throw Error(o(317));Bt=uC(r)}else a===27?(a=Bt,$a(r.type)?(r=pg,pg=null,Bt=r):Bt=a):Bt=Rn?Hr(r.stateNode.nextSibling):null;return!0}function So(){Bt=Rn=null,dt=!1}function Um(){var r=Da;return r!==null&&(ar===null?ar=r:ar.push.apply(ar,r),Da=null),r}function Wl(r){Da===null?Da=[r]:Da.push(r)}var Km=He(null),Eo=null,$i=null;function Ia(r,a,s){Oe(Km,a._currentValue),a._currentValue=s}function Vi(r){r._currentValue=Km.current,Fe(Km)}function Qm(r,a,s){for(;r!==null;){var c=r.alternate;if((r.childLanes&a)===a?c!==null&&(c.childLanes&a)!==a&&(c.childLanes|=a):(r.childLanes|=a,c!==null&&(c.childLanes|=a)),r===s)break;r=r.return}}function Gm(r,a,s,c){var m=r.child;for(m!==null&&(m.return=r);m!==null;){var y=m.dependencies;if(y!==null){var C=m.child;y=y.firstContext;e:for(;y!==null;){var R=y;y=m;for(var H=0;H<a.length;H++)if(R.context===a[H]){y.lanes|=s,R=y.alternate,R!==null&&(R.lanes|=s),Qm(y.return,s,r),c||(C=null);break e}y=R.next}}else if(m.tag===18){if(C=m.return,C===null)throw Error(o(341));C.lanes|=s,y=C.alternate,y!==null&&(y.lanes|=s),Qm(C,s,r),C=null}else C=m.child;if(C!==null)C.return=m;else for(C=m;C!==null;){if(C===r){C=null;break}if(m=C.sibling,m!==null){m.return=C.return,C=m;break}C=C.return}m=C}}function Ds(r,a,s,c){r=null;for(var m=a,y=!1;m!==null;){if(!y){if(m.flags&524288)y=!0;else if(m.flags&262144)break}if(m.tag===10){var C=m.alternate;if(C===null)throw Error(o(387));if(C=C.memoizedProps,C!==null){var R=m.type;yr(m.pendingProps.value,C.value)||(r===null?r=[R]:r.push(R))}}else if(m===Mn.current){if(C=m.alternate,C===null)throw Error(o(387));C.memoizedState.memoizedState!==m.memoizedState.memoizedState&&(r===null?r=[vc]:r.push(vc))}m=m.return}r!==null&&Gm(a,r,s,c),a.flags|=262144}function Ju(r){for(r=r.firstContext;r!==null;){if(!yr(r.context._currentValue,r.memoizedValue))return!0;r=r.next}return!1}function To(r){Eo=r,$i=null,r=r.dependencies,r!==null&&(r.firstContext=null)}function In(r){return Vx(Eo,r)}function Yu(r,a){return Eo===null&&To(r),Vx(r,a)}function Vx(r,a){var s=a._currentValue;if(a={context:a,memoizedValue:s,next:null},$i===null){if(r===null)throw Error(o(308));$i=a,r.dependencies={lanes:0,firstContext:a},r.flags|=524288}else $i=$i.next=a;return s}var SO=typeof AbortController<"u"?AbortController:function(){var r=[],a=this.signal={aborted:!1,addEventListener:function(s,c){r.push(c)}};this.abort=function(){a.aborted=!0,r.forEach(function(s){return s()})}},EO=t.unstable_scheduleCallback,TO=t.unstable_NormalPriority,fn={$$typeof:U,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Xm(){return{controller:new SO,data:new Map,refCount:0}}function Ul(r){r.refCount--,r.refCount===0&&EO(TO,function(){r.controller.abort()})}var Kl=null,Jm=0,Rs=0,Is=null;function DO(r,a){if(Kl===null){var s=Kl=[];Jm=0,Rs=eg(),Is={status:"pending",value:void 0,then:function(c){s.push(c)}}}return Jm++,a.then(Hx,Hx),a}function Hx(){if(--Jm===0&&Kl!==null){Is!==null&&(Is.status="fulfilled");var r=Kl;Kl=null,Rs=0,Is=null;for(var a=0;a<r.length;a++)(0,r[a])()}}function RO(r,a){var s=[],c={status:"pending",value:null,reason:null,then:function(m){s.push(m)}};return r.then(function(){c.status="fulfilled",c.value=a;for(var m=0;m<s.length;m++)(0,s[m])(a)},function(m){for(c.status="rejected",c.reason=m,m=0;m<s.length;m++)(0,s[m])(void 0)}),c}var Bx=he.S;he.S=function(r,a){Ck=Yt(),typeof a=="object"&&a&&typeof a.then=="function"&&DO(r,a),Bx!==null&&Bx(r,a)};var Do=He(null);function Ym(){var r=Do.current;return r===null?zt.pooledCache:r}function Zu(r,a){a===null?Oe(Do,Do.current):Oe(Do,a.pool)}function Wx(){var r=Ym();return r===null?null:{parent:fn._currentValue,pool:r}}var As=Error(o(460)),Zm=Error(o(474)),ed=Error(o(542)),td={then:function(){}};function Ux(r){return r=r.status,r==="fulfilled"||r==="rejected"}function Kx(r,a,s){switch(s=r[s],s===void 0?r.push(a):s!==a&&(a.then(Nr,Nr),a=s),a.status){case"fulfilled":return a.value;case"rejected":throw r=a.reason,Gx(r),r;default:if(typeof a.status=="string")a.then(Nr,Nr);else{if(r=zt,r!==null&&100<r.shellSuspendCounter)throw Error(o(482));r=a,r.status="pending",r.then(function(c){if(a.status==="pending"){var m=a;m.status="fulfilled",m.value=c}},function(c){if(a.status==="pending"){var m=a;m.status="rejected",m.reason=c}})}switch(a.status){case"fulfilled":return a.value;case"rejected":throw r=a.reason,Gx(r),r}throw Io=a,As}}function Ro(r){try{var a=r._init;return a(r._payload)}catch(s){throw typeof s=="object"&&s&&typeof s.then=="function"?(Io=s,As):s}}var Io=null;function Qx(){if(Io===null)throw Error(o(459));var r=Io;return Io=null,r}function Gx(r){if(r===As||r===ed)throw Error(o(483))}var Ls=null,Ql=0;function nd(r){var a=Ql;return Ql+=1,Ls===null&&(Ls=[]),Kx(Ls,r,a)}function Gl(r,a){a=a.props.ref,r.ref=a===void 0?null:a}function rd(r,a){throw a.$$typeof===E?Error(o(525)):(r=Object.prototype.toString.call(a),Error(o(31,r==="[object Object]"?"object with keys {"+Object.keys(a).join(", ")+"}":r)))}function Xx(r){function a(K,B){if(r){var ee=K.deletions;ee===null?(K.deletions=[B],K.flags|=16):ee.push(B)}}function s(K,B){if(!r)return null;for(;B!==null;)a(K,B),B=B.sibling;return null}function c(K){for(var B=new Map;K!==null;)K.key===null?B.set(K.index,K):B.set(K.key,K),K=K.sibling;return B}function m(K,B){return K=zi(K,B),K.index=0,K.sibling=null,K}function y(K,B,ee){return K.index=ee,r?(ee=K.alternate,ee===null?(K.flags|=67108866,B):(ee=ee.index,ee<B?(K.flags|=67108866,B):ee)):(K.flags|=1048576,B)}function C(K){return r&&K.alternate===null&&(K.flags|=67108866),K}function R(K,B,ee,ye){return B===null||B.tag!==6?(B=$m(ee,K.mode,ye),B.return=K,B):(B=m(B,ee),B.return=K,B)}function H(K,B,ee,ye){var ze=ee.type;return ze===j?ge(K,B,ee.props.children,ye,ee.key):B!==null&&(B.elementType===ze||typeof ze=="object"&&ze&&ze.$$typeof===xe&&Ro(ze)===B.type)?(B=m(B,ee.props),Gl(B,ee),B.return=K,B):(B=Gu(ee.type,ee.key,ee.props,null,K.mode,ye),Gl(B,ee),B.return=K,B)}function ie(K,B,ee,ye){return B===null||B.tag!==4||B.stateNode.containerInfo!==ee.containerInfo||B.stateNode.implementation!==ee.implementation?(B=Vm(ee,K.mode,ye),B.return=K,B):(B=m(B,ee.children||[]),B.return=K,B)}function ge(K,B,ee,ye,ze){return B===null||B.tag!==7?(B=Co(ee,K.mode,ye,ze),B.return=K,B):(B=m(B,ee),B.return=K,B)}function ve(K,B,ee){if(typeof B=="string"&&B!==""||typeof B=="number"||typeof B=="bigint")return B=$m(""+B,K.mode,ee),B.return=K,B;if(typeof B=="object"&&B){switch(B.$$typeof){case T:return ee=Gu(B.type,B.key,B.props,null,K.mode,ee),Gl(ee,B),ee.return=K,ee;case O:return B=Vm(B,K.mode,ee),B.return=K,B;case xe:return B=Ro(B),ve(K,B,ee)}if(te(B)||Q(B))return B=Co(B,K.mode,ee,null),B.return=K,B;if(typeof B.then=="function")return ve(K,nd(B),ee);if(B.$$typeof===U)return ve(K,Yu(K,B),ee);rd(K,B)}return null}function se(K,B,ee,ye){var ze=B===null?null:B.key;if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return ze===null?R(K,B,""+ee,ye):null;if(typeof ee=="object"&&ee){switch(ee.$$typeof){case T:return ee.key===ze?H(K,B,ee,ye):null;case O:return ee.key===ze?ie(K,B,ee,ye):null;case xe:return ee=Ro(ee),se(K,B,ee,ye)}if(te(ee)||Q(ee))return ze===null?ge(K,B,ee,ye,null):null;if(typeof ee.then=="function")return se(K,B,nd(ee),ye);if(ee.$$typeof===U)return se(K,B,Yu(K,ee),ye);rd(K,ee)}return null}function fe(K,B,ee,ye,ze){if(typeof ye=="string"&&ye!==""||typeof ye=="number"||typeof ye=="bigint")return K=K.get(ee)||null,R(B,K,""+ye,ze);if(typeof ye=="object"&&ye){switch(ye.$$typeof){case T:return K=K.get(ye.key===null?ee:ye.key)||null,H(B,K,ye,ze);case O:return K=K.get(ye.key===null?ee:ye.key)||null,ie(B,K,ye,ze);case xe:return ye=Ro(ye),fe(K,B,ee,ye,ze)}if(te(ye)||Q(ye))return K=K.get(ee)||null,ge(B,K,ye,ze,null);if(typeof ye.then=="function")return fe(K,B,ee,nd(ye),ze);if(ye.$$typeof===U)return fe(K,B,ee,Yu(B,ye),ze);rd(B,ye)}return null}function Ae(K,B,ee,ye){for(var ze=null,_t=null,Le=B,Ze=B=0,ct=null;Le!==null&&Ze<ee.length;Ze++){Le.index>Ze?(ct=Le,Le=null):ct=Le.sibling;var vt=se(K,Le,ee[Ze],ye);if(vt===null){Le===null&&(Le=ct);break}r&&Le&&vt.alternate===null&&a(K,Le),B=y(vt,B,Ze),_t===null?ze=vt:_t.sibling=vt,_t=vt,Le=ct}if(Ze===ee.length)return s(K,Le),dt&&Fi(K,Ze),ze;if(Le===null){for(;Ze<ee.length;Ze++)Le=ve(K,ee[Ze],ye),Le!==null&&(B=y(Le,B,Ze),_t===null?ze=Le:_t.sibling=Le,_t=Le);return dt&&Fi(K,Ze),ze}for(Le=c(Le);Ze<ee.length;Ze++)ct=fe(Le,K,Ze,ee[Ze],ye),ct!==null&&(r&&ct.alternate!==null&&Le.delete(ct.key===null?Ze:ct.key),B=y(ct,B,Ze),_t===null?ze=ct:_t.sibling=ct,_t=ct);return r&&Le.forEach(function(Ua){return a(K,Ua)}),dt&&Fi(K,Ze),ze}function Ve(K,B,ee,ye){if(ee==null)throw Error(o(151));for(var ze=null,_t=null,Le=B,Ze=B=0,ct=null,vt=ee.next();Le!==null&&!vt.done;Ze++,vt=ee.next()){Le.index>Ze?(ct=Le,Le=null):ct=Le.sibling;var Ua=se(K,Le,vt.value,ye);if(Ua===null){Le===null&&(Le=ct);break}r&&Le&&Ua.alternate===null&&a(K,Le),B=y(Ua,B,Ze),_t===null?ze=Ua:_t.sibling=Ua,_t=Ua,Le=ct}if(vt.done)return s(K,Le),dt&&Fi(K,Ze),ze;if(Le===null){for(;!vt.done;Ze++,vt=ee.next())vt=ve(K,vt.value,ye),vt!==null&&(B=y(vt,B,Ze),_t===null?ze=vt:_t.sibling=vt,_t=vt);return dt&&Fi(K,Ze),ze}for(Le=c(Le);!vt.done;Ze++,vt=ee.next())vt=fe(Le,K,Ze,vt.value,ye),vt!==null&&(r&&vt.alternate!==null&&Le.delete(vt.key===null?Ze:vt.key),B=y(vt,B,Ze),_t===null?ze=vt:_t.sibling=vt,_t=vt);return r&&Le.forEach(function(BM){return a(K,BM)}),dt&&Fi(K,Ze),ze}function Mt(K,B,ee,ye){if(typeof ee=="object"&&ee&&ee.type===j&&ee.key===null&&(ee=ee.props.children),typeof ee=="object"&&ee){switch(ee.$$typeof){case T:e:{for(var ze=ee.key;B!==null;){if(B.key===ze){if(ze=ee.type,ze===j){if(B.tag===7){s(K,B.sibling),ye=m(B,ee.props.children),ye.return=K,K=ye;break e}}else if(B.elementType===ze||typeof ze=="object"&&ze&&ze.$$typeof===xe&&Ro(ze)===B.type){s(K,B.sibling),ye=m(B,ee.props),Gl(ye,ee),ye.return=K,K=ye;break e}s(K,B);break}else a(K,B);B=B.sibling}ee.type===j?(ye=Co(ee.props.children,K.mode,ye,ee.key),ye.return=K,K=ye):(ye=Gu(ee.type,ee.key,ee.props,null,K.mode,ye),Gl(ye,ee),ye.return=K,K=ye)}return C(K);case O:e:{for(ze=ee.key;B!==null;){if(B.key===ze)if(B.tag===4&&B.stateNode.containerInfo===ee.containerInfo&&B.stateNode.implementation===ee.implementation){s(K,B.sibling),ye=m(B,ee.children||[]),ye.return=K,K=ye;break e}else{s(K,B);break}else a(K,B);B=B.sibling}ye=Vm(ee,K.mode,ye),ye.return=K,K=ye}return C(K);case xe:return ee=Ro(ee),Mt(K,B,ee,ye)}if(te(ee))return Ae(K,B,ee,ye);if(Q(ee)){if(ze=Q(ee),typeof ze!="function")throw Error(o(150));return ee=ze.call(ee),Ve(K,B,ee,ye)}if(typeof ee.then=="function")return Mt(K,B,nd(ee),ye);if(ee.$$typeof===U)return Mt(K,B,Yu(K,ee),ye);rd(K,ee)}return typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint"?(ee=""+ee,B!==null&&B.tag===6?(s(K,B.sibling),ye=m(B,ee),ye.return=K,K=ye):(s(K,B),ye=$m(ee,K.mode,ye),ye.return=K,K=ye),C(K)):s(K,B)}return function(K,B,ee,ye){try{Ql=0;var ze=Mt(K,B,ee,ye);return Ls=null,ze}catch(Le){if(Le===As||Le===ed)throw Le;var _t=vr(29,Le,null,K.mode);return _t.lanes=ye,_t.return=K,_t}}}var Ao=Xx(!0),Jx=Xx(!1),Aa=!1;function eh(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function th(r,a){r=r.updateQueue,a.updateQueue===r&&(a.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,callbacks:null})}function Lo(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function Po(r,a,s){var c=r.updateQueue;if(c===null)return null;if(c=c.shared,xt&2){var m=c.pending;return m===null?a.next=a:(a.next=m.next,m.next=a),c.pending=a,a=Qu(r),Ox(r,null,s),a}return Ku(r,c,a,s),Qu(r)}function Xl(r,a,s){if(a=a.updateQueue,a!==null&&(a=a.shared,s&4194048)){var c=a.lanes;c&=r.pendingLanes,s|=c,a.lanes=s,mr(r,s)}}function nh(r,a){var s=r.updateQueue,c=r.alternate;if(c!==null&&(c=c.updateQueue,s===c)){var m=null,y=null;if(s=s.firstBaseUpdate,s!==null){do{var C={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};y===null?m=y=C:y=y.next=C,s=s.next}while(s!==null);y===null?m=y=a:y=y.next=a}else m=y=a;s={baseState:c.baseState,firstBaseUpdate:m,lastBaseUpdate:y,shared:c.shared,callbacks:c.callbacks},r.updateQueue=s;return}r=s.lastBaseUpdate,r===null?s.firstBaseUpdate=a:r.next=a,s.lastBaseUpdate=a}var rh=!1;function Jl(){if(rh){var r=Is;if(r!==null)throw r}}function Yl(r,a,s,c){rh=!1;var m=r.updateQueue;Aa=!1;var y=m.firstBaseUpdate,C=m.lastBaseUpdate,R=m.shared.pending;if(R!==null){m.shared.pending=null;var H=R,ie=H.next;H.next=null,C===null?y=ie:C.next=ie,C=H;var ge=r.alternate;ge!==null&&(ge=ge.updateQueue,R=ge.lastBaseUpdate,R!==C&&(R===null?ge.firstBaseUpdate=ie:R.next=ie,ge.lastBaseUpdate=H))}if(y!==null){var ve=m.baseState;C=0,ge=ie=H=null,R=y;do{var se=R.lane&-536870913,fe=se!==R.lane;if(fe?(lt&se)===se:(c&se)===se){se!==0&&se===Rs&&(rh=!0),ge!==null&&(ge=ge.next={lane:0,tag:R.tag,payload:R.payload,callback:null,next:null});e:{var Ae=r,Ve=R;se=a;var Mt=s;switch(Ve.tag){case 1:if(Ae=Ve.payload,typeof Ae=="function"){ve=Ae.call(Mt,ve,se);break e}ve=Ae;break e;case 3:Ae.flags=Ae.flags&-65537|128;case 0:if(Ae=Ve.payload,se=typeof Ae=="function"?Ae.call(Mt,ve,se):Ae,se==null)break e;ve=S({},ve,se);break e;case 2:Aa=!0}}se=R.callback,se!==null&&(r.flags|=64,fe&&(r.flags|=8192),fe=m.callbacks,fe===null?m.callbacks=[se]:fe.push(se))}else fe={lane:se,tag:R.tag,payload:R.payload,callback:R.callback,next:null},ge===null?(ie=ge=fe,H=ve):ge=ge.next=fe,C|=se;if(R=R.next,R===null){if(R=m.shared.pending,R===null)break;fe=R,R=fe.next,fe.next=null,m.lastBaseUpdate=fe,m.shared.pending=null}}while(!0);ge===null&&(H=ve),m.baseState=H,m.firstBaseUpdate=ie,m.lastBaseUpdate=ge,y===null&&(m.shared.lanes=0),Na|=C,r.lanes=C,r.memoizedState=ve}}function Yx(r,a){if(typeof r!="function")throw Error(o(191,r));r.call(a)}function Zx(r,a){var s=r.callbacks;if(s!==null)for(r.callbacks=null,r=0;r<s.length;r++)Yx(s[r],a)}var Ps=He(null),id=He(0);function e_(r,a){r=Ji,Oe(id,r),Oe(Ps,a),Ji=r|a.baseLanes}function ih(){Oe(id,Ji),Oe(Ps,Ps.current)}function ah(){Ji=id.current,Fe(Ps),Fe(id)}var br=He(null),ai=null;function La(r){var a=r.alternate;Oe(on,on.current&1),Oe(br,r),ai===null&&(a===null||Ps.current!==null||a.memoizedState!==null)&&(ai=r)}function oh(r){Oe(on,on.current),Oe(br,r),ai===null&&(ai=r)}function t_(r){r.tag===22?(Oe(on,on.current),Oe(br,r),ai===null&&(ai=r)):Pa(r)}function Pa(){Oe(on,on.current),Oe(br,br.current)}function wr(r){Fe(br),ai===r&&(ai=null),Fe(on)}var on=He(0);function ad(r){for(var a=r;a!==null;){if(a.tag===13){var s=a.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||dg(s)||fg(s)))return a}else if(a.tag===19&&(a.memoizedProps.revealOrder==="forwards"||a.memoizedProps.revealOrder==="backwards"||a.memoizedProps.revealOrder==="unstable_legacy-backwards"||a.memoizedProps.revealOrder==="together")){if(a.flags&128)return a}else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===r)break;for(;a.sibling===null;){if(a.return===null||a.return===r)return null;a=a.return}a.sibling.return=a.return,a=a.sibling}return null}var Hi=0,Ye=null,Pt=null,pn=null,od=!1,Os=!1,Oo=!1,sd=0,Zl=0,Ms=null,IO=0;function Zt(){throw Error(o(321))}function sh(r,a){if(a===null)return!1;for(var s=0;s<a.length&&s<r.length;s++)if(!yr(r[s],a[s]))return!1;return!0}function lh(r,a,s,c,m,y){return Hi=y,Ye=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,he.H=r===null||r.memoizedState===null?q_:kh,Oo=!1,y=s(c,m),Oo=!1,Os&&(y=r_(a,s,c,m)),n_(r),y}function n_(r){he.H=nc;var a=Pt!==null&&Pt.next!==null;if(Hi=0,pn=Pt=Ye=null,od=!1,Zl=0,Ms=null,a)throw Error(o(300));r===null||mn||(r=r.dependencies,r!==null&&Ju(r)&&(mn=!0))}function r_(r,a,s,c){Ye=r;var m=0;do{if(Os&&(Ms=null),Zl=0,Os=!1,25<=m)throw Error(o(301));if(m+=1,pn=Pt=null,r.updateQueue!=null){var y=r.updateQueue;y.lastEffect=null,y.events=null,y.stores=null,y.memoCache!=null&&(y.memoCache.index=0)}he.H=z_,y=a(s,c)}while(Os);return y}function AO(){var r=he.H,a=r.useState()[0];return a=typeof a.then=="function"?ec(a):a,r=r.useState()[0],(Pt===null?null:Pt.memoizedState)!==r&&(Ye.flags|=1024),a}function ch(){var r=sd!==0;return sd=0,r}function uh(r,a,s){a.updateQueue=r.updateQueue,a.flags&=-2053,r.lanes&=~s}function dh(r){if(od){for(r=r.memoizedState;r!==null;){var a=r.queue;a!==null&&(a.pending=null),r=r.next}od=!1}Hi=0,pn=Pt=Ye=null,Os=!1,Zl=sd=0,Ms=null}function Gn(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return pn===null?Ye.memoizedState=pn=r:pn=pn.next=r,pn}function sn(){if(Pt===null){var r=Ye.alternate;r=r===null?null:r.memoizedState}else r=Pt.next;var a=pn===null?Ye.memoizedState:pn.next;if(a!==null)pn=a,Pt=r;else{if(r===null)throw Ye.alternate===null?Error(o(467)):Error(o(310));Pt=r,r={memoizedState:Pt.memoizedState,baseState:Pt.baseState,baseQueue:Pt.baseQueue,queue:Pt.queue,next:null},pn===null?Ye.memoizedState=pn=r:pn=pn.next=r}return pn}function ld(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ec(r){var a=Zl;return Zl+=1,Ms===null&&(Ms=[]),r=Kx(Ms,r,a),a=Ye,(pn===null?a.memoizedState:pn.next)===null&&(a=a.alternate,he.H=a===null||a.memoizedState===null?q_:kh),r}function cd(r){if(typeof r=="object"&&r){if(typeof r.then=="function")return ec(r);if(r.$$typeof===U)return In(r)}throw Error(o(438,String(r)))}function fh(r){var a=null,s=Ye.updateQueue;if(s!==null&&(a=s.memoCache),a==null){var c=Ye.alternate;c!==null&&(c=c.updateQueue,c!==null&&(c=c.memoCache,c!=null&&(a={data:c.data.map(function(m){return m.slice()}),index:0})))}if(a??(a={data:[],index:0}),s===null&&(s=ld(),Ye.updateQueue=s),s.memoCache=a,s=a.data[a.index],s===void 0)for(s=a.data[a.index]=Array(r),c=0;c<r;c++)s[c]=Te;return a.index++,s}function Bi(r,a){return typeof a=="function"?a(r):a}function ud(r){return ph(sn(),Pt,r)}function ph(r,a,s){var c=r.queue;if(c===null)throw Error(o(311));c.lastRenderedReducer=s;var m=r.baseQueue,y=c.pending;if(y!==null){if(m!==null){var C=m.next;m.next=y.next,y.next=C}a.baseQueue=m=y,c.pending=null}if(y=r.baseState,m===null)r.memoizedState=y;else{a=m.next;var R=C=null,H=null,ie=a,ge=!1;do{var ve=ie.lane&-536870913;if(ve===ie.lane?(Hi&ve)===ve:(lt&ve)===ve){var se=ie.revertLane;if(se===0)H!==null&&(H=H.next={lane:0,revertLane:0,gesture:null,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null}),ve===Rs&&(ge=!0);else if((Hi&se)===se){ie=ie.next,se===Rs&&(ge=!0);continue}else ve={lane:0,revertLane:ie.revertLane,gesture:null,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null},H===null?(R=H=ve,C=y):H=H.next=ve,Ye.lanes|=se,Na|=se;ve=ie.action,Oo&&s(y,ve),y=ie.hasEagerState?ie.eagerState:s(y,ve)}else se={lane:ve,revertLane:ie.revertLane,gesture:ie.gesture,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null},H===null?(R=H=se,C=y):H=H.next=se,Ye.lanes|=ve,Na|=ve;ie=ie.next}while(ie!==null&&ie!==a);if(H===null?C=y:H.next=R,!yr(y,r.memoizedState)&&(mn=!0,ge&&(s=Is,s!==null)))throw s;r.memoizedState=y,r.baseState=C,r.baseQueue=H,c.lastRenderedState=y}return m===null&&(c.lanes=0),[r.memoizedState,c.dispatch]}function mh(r){var a=sn(),s=a.queue;if(s===null)throw Error(o(311));s.lastRenderedReducer=r;var c=s.dispatch,m=s.pending,y=a.memoizedState;if(m!==null){s.pending=null;var C=m=m.next;do y=r(y,C.action),C=C.next;while(C!==m);yr(y,a.memoizedState)||(mn=!0),a.memoizedState=y,a.baseQueue===null&&(a.baseState=y),s.lastRenderedState=y}return[y,c]}function i_(r,a,s){var c=Ye,m=sn(),y=dt;if(y){if(s===void 0)throw Error(o(407));s=s()}else s=a();var C=!yr((Pt||m).memoizedState,s);if(C&&(m.memoizedState=s,mn=!0),m=m.queue,yh(s_.bind(null,c,m,r),[r]),m.getSnapshot!==a||C||pn!==null&&pn.memoizedState.tag&1){if(c.flags|=2048,Ns(9,{destroy:void 0},o_.bind(null,c,m,s,a),null),zt===null)throw Error(o(349));y||Hi&127||a_(c,a,s)}return s}function a_(r,a,s){r.flags|=16384,r={getSnapshot:a,value:s},a=Ye.updateQueue,a===null?(a=ld(),Ye.updateQueue=a,a.stores=[r]):(s=a.stores,s===null?a.stores=[r]:s.push(r))}function o_(r,a,s,c){a.value=s,a.getSnapshot=c,l_(a)&&c_(r)}function s_(r,a,s){return s(function(){l_(a)&&c_(r)})}function l_(r){var a=r.getSnapshot;r=r.value;try{var s=a();return!yr(r,s)}catch{return!0}}function c_(r){var a=ko(r,2);a!==null&&or(a,r,2)}function hh(r){var a=Gn();if(typeof r=="function"){var s=r;if(r=s(),Oo){et(!0);try{s()}finally{et(!1)}}}return a.memoizedState=a.baseState=r,a.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bi,lastRenderedState:r},a}function u_(r,a,s,c){return r.baseState=s,ph(r,Pt,typeof c=="function"?c:Bi)}function LO(r,a,s,c,m){if(pd(r))throw Error(o(485));if(r=a.action,r!==null){var y={payload:m,action:r,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(C){y.listeners.push(C)}};he.T===null?y.isTransition=!1:s(!0),c(y),s=a.pending,s===null?(y.next=a.pending=y,d_(a,y)):(y.next=s.next,a.pending=s.next=y)}}function d_(r,a){var s=a.action,c=a.payload,m=r.state;if(a.isTransition){var y=he.T,C={};he.T=C;try{var R=s(m,c),H=he.S;H!==null&&H(C,R),f_(r,a,R)}catch(ie){gh(r,a,ie)}finally{y!==null&&C.types!==null&&(y.types=C.types),he.T=y}}else try{y=s(m,c),f_(r,a,y)}catch(ie){gh(r,a,ie)}}function f_(r,a,s){typeof s=="object"&&s&&typeof s.then=="function"?s.then(function(c){p_(r,a,c)},function(c){return gh(r,a,c)}):p_(r,a,s)}function p_(r,a,s){a.status="fulfilled",a.value=s,m_(a),r.state=s,a=r.pending,a!==null&&(s=a.next,s===a?r.pending=null:(s=s.next,a.next=s,d_(r,s)))}function gh(r,a,s){var c=r.pending;if(r.pending=null,c!==null){c=c.next;do a.status="rejected",a.reason=s,m_(a),a=a.next;while(a!==c)}r.action=null}function m_(r){r=r.listeners;for(var a=0;a<r.length;a++)(0,r[a])()}function h_(r,a){return a}function g_(r,a){if(dt){var s=zt.formState;if(s!==null){e:{var c=Ye;if(dt){if(Bt){t:{for(var m=Bt,y=$r;m.nodeType!==8;){if(!y){m=null;break t}if(m=Hr(m.nextSibling),m===null){m=null;break t}}y=m.data,m=y==="F!"||y==="F"?m:null}if(m){Bt=Hr(m.nextSibling),c=m.data==="F!";break e}}Ra(c)}c=!1}c&&(a=s[0])}}return s=Gn(),s.memoizedState=s.baseState=a,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:h_,lastRenderedState:a},s.queue=c,s=M_.bind(null,Ye,c),c.dispatch=s,c=hh(!1),y=_h.bind(null,Ye,!1,c.queue),c=Gn(),m={state:a,dispatch:null,action:r,pending:null},c.queue=m,s=LO.bind(null,Ye,m,y,s),m.dispatch=s,c.memoizedState=r,[a,s,!1]}function y_(r){return v_(sn(),Pt,r)}function v_(r,a,s){if(a=ph(r,a,h_)[0],r=ud(Bi)[0],typeof a=="object"&&a&&typeof a.then=="function")try{var c=ec(a)}catch(C){throw C===As?ed:C}else c=a;a=sn();var m=a.queue,y=m.dispatch;return s!==a.memoizedState&&(Ye.flags|=2048,Ns(9,{destroy:void 0},PO.bind(null,m,s),null)),[c,y,r]}function PO(r,a){r.action=a}function b_(r){var a=sn(),s=Pt;if(s!==null)return v_(a,s,r);sn(),a=a.memoizedState,s=sn();var c=s.queue.dispatch;return s.memoizedState=r,[a,c,!1]}function Ns(r,a,s,c){return r={tag:r,create:s,deps:c,inst:a,next:null},a=Ye.updateQueue,a===null&&(a=ld(),Ye.updateQueue=a),s=a.lastEffect,s===null?a.lastEffect=r.next=r:(c=s.next,s.next=r,r.next=c,a.lastEffect=r),r}function w_(){return sn().memoizedState}function dd(r,a,s,c){var m=Gn();Ye.flags|=r,m.memoizedState=Ns(1|a,{destroy:void 0},s,c===void 0?null:c)}function fd(r,a,s,c){var m=sn();c=c===void 0?null:c;var y=m.memoizedState.inst;Pt!==null&&c!==null&&sh(c,Pt.memoizedState.deps)?m.memoizedState=Ns(a,y,s,c):(Ye.flags|=r,m.memoizedState=Ns(1|a,y,s,c))}function x_(r,a){dd(8390656,8,r,a)}function yh(r,a){fd(2048,8,r,a)}function OO(r){Ye.flags|=4;var a=Ye.updateQueue;if(a===null)a=ld(),Ye.updateQueue=a,a.events=[r];else{var s=a.events;s===null?a.events=[r]:s.push(r)}}function __(r){var a=sn().memoizedState;return OO({ref:a,nextImpl:r}),function(){if(xt&2)throw Error(o(440));return a.impl.apply(void 0,arguments)}}function k_(r,a){return fd(4,2,r,a)}function C_(r,a){return fd(4,4,r,a)}function S_(r,a){if(typeof a=="function"){r=r();var s=a(r);return function(){typeof s=="function"?s():a(null)}}if(a!=null)return r=r(),a.current=r,function(){a.current=null}}function E_(r,a,s){s=s==null?null:s.concat([r]),fd(4,4,S_.bind(null,a,r),s)}function vh(){}function T_(r,a){var s=sn();a=a===void 0?null:a;var c=s.memoizedState;return a!==null&&sh(a,c[1])?c[0]:(s.memoizedState=[r,a],r)}function D_(r,a){var s=sn();a=a===void 0?null:a;var c=s.memoizedState;if(a!==null&&sh(a,c[1]))return c[0];if(c=r(),Oo){et(!0);try{r()}finally{et(!1)}}return s.memoizedState=[c,a],c}function bh(r,a,s){return s===void 0||Hi&1073741824&&!(lt&261930)?r.memoizedState=a:(r.memoizedState=s,r=Ek(),Ye.lanes|=r,Na|=r,s)}function R_(r,a,s,c){return yr(s,a)?s:Ps.current===null?!(Hi&42)||Hi&1073741824&&!(lt&261930)?(mn=!0,r.memoizedState=s):(r=Ek(),Ye.lanes|=r,Na|=r,a):(r=bh(r,s,c),yr(r,a)||(mn=!0),r)}function I_(r,a,s,c,m){var y=G.p;G.p=y!==0&&8>y?y:8;var C=he.T,R={};he.T=R,_h(r,!1,a,s);try{var H=m(),ie=he.S;ie!==null&&ie(R,H),typeof H=="object"&&H&&typeof H.then=="function"?tc(r,a,RO(H,c),Vr(r)):tc(r,a,c,Vr(r))}catch(ge){tc(r,a,{then:function(){},status:"rejected",reason:ge},Vr())}finally{G.p=y,C!==null&&R.types!==null&&(C.types=R.types),he.T=C}}function MO(){}function wh(r,a,s,c){if(r.tag!==5)throw Error(o(476));var m=A_(r).queue;I_(r,m,a,Ne,s===null?MO:function(){return L_(r),s(c)})}function A_(r){var a=r.memoizedState;if(a!==null)return a;a={memoizedState:Ne,baseState:Ne,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bi,lastRenderedState:Ne},next:null};var s={};return a.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bi,lastRenderedState:s},next:null},r.memoizedState=a,r=r.alternate,r!==null&&(r.memoizedState=a),a}function L_(r){var a=A_(r);a.next===null&&(a=r.alternate.memoizedState),tc(r,a.next.queue,{},Vr())}function xh(){return In(vc)}function P_(){return sn().memoizedState}function O_(){return sn().memoizedState}function NO(r){for(var a=r.return;a!==null;){switch(a.tag){case 24:case 3:var s=Vr();r=Lo(s);var c=Po(a,r,s);c!==null&&(or(c,a,s),Xl(c,a,s)),a={cache:Xm()},r.payload=a;return}a=a.return}}function jO(r,a,s){var c=Vr();s={lane:c,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},pd(r)?N_(a,s):(s=zm(r,a,s,c),s!==null&&(or(s,r,c),j_(s,a,c)))}function M_(r,a,s){tc(r,a,s,Vr())}function tc(r,a,s,c){var m={lane:c,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(pd(r))N_(a,m);else{var y=r.alternate;if(r.lanes===0&&(y===null||y.lanes===0)&&(y=a.lastRenderedReducer,y!==null))try{var C=a.lastRenderedState,R=y(C,s);if(m.hasEagerState=!0,m.eagerState=R,yr(R,C))return Ku(r,a,m,0),zt===null&&Uu(),!1}catch{}if(s=zm(r,a,m,c),s!==null)return or(s,r,c),j_(s,a,c),!0}return!1}function _h(r,a,s,c){if(c={lane:2,revertLane:eg(),gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},pd(r)){if(a)throw Error(o(479))}else a=zm(r,s,c,2),a!==null&&or(a,r,2)}function pd(r){var a=r.alternate;return r===Ye||a!==null&&a===Ye}function N_(r,a){Os=od=!0;var s=r.pending;s===null?a.next=a:(a.next=s.next,s.next=a),r.pending=a}function j_(r,a,s){if(s&4194048){var c=a.lanes;c&=r.pendingLanes,s|=c,a.lanes=s,mr(r,s)}}var nc={readContext:In,use:cd,useCallback:Zt,useContext:Zt,useEffect:Zt,useImperativeHandle:Zt,useLayoutEffect:Zt,useInsertionEffect:Zt,useMemo:Zt,useReducer:Zt,useRef:Zt,useState:Zt,useDebugValue:Zt,useDeferredValue:Zt,useTransition:Zt,useSyncExternalStore:Zt,useId:Zt,useHostTransitionStatus:Zt,useFormState:Zt,useActionState:Zt,useOptimistic:Zt,useMemoCache:Zt,useCacheRefresh:Zt};nc.useEffectEvent=Zt;var q_={readContext:In,use:cd,useCallback:function(r,a){return Gn().memoizedState=[r,a===void 0?null:a],r},useContext:In,useEffect:x_,useImperativeHandle:function(r,a,s){s=s==null?null:s.concat([r]),dd(4194308,4,S_.bind(null,a,r),s)},useLayoutEffect:function(r,a){return dd(4194308,4,r,a)},useInsertionEffect:function(r,a){dd(4,2,r,a)},useMemo:function(r,a){var s=Gn();a=a===void 0?null:a;var c=r();if(Oo){et(!0);try{r()}finally{et(!1)}}return s.memoizedState=[c,a],c},useReducer:function(r,a,s){var c=Gn();if(s!==void 0){var m=s(a);if(Oo){et(!0);try{s(a)}finally{et(!1)}}}else m=a;return c.memoizedState=c.baseState=m,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:m},c.queue=r,r=r.dispatch=jO.bind(null,Ye,r),[c.memoizedState,r]},useRef:function(r){var a=Gn();return r={current:r},a.memoizedState=r},useState:function(r){r=hh(r);var a=r.queue,s=M_.bind(null,Ye,a);return a.dispatch=s,[r.memoizedState,s]},useDebugValue:vh,useDeferredValue:function(r,a){return bh(Gn(),r,a)},useTransition:function(){var r=hh(!1);return r=I_.bind(null,Ye,r.queue,!0,!1),Gn().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,a,s){var c=Ye,m=Gn();if(dt){if(s===void 0)throw Error(o(407));s=s()}else{if(s=a(),zt===null)throw Error(o(349));lt&127||a_(c,a,s)}m.memoizedState=s;var y={value:s,getSnapshot:a};return m.queue=y,x_(s_.bind(null,c,y,r),[r]),c.flags|=2048,Ns(9,{destroy:void 0},o_.bind(null,c,y,s,a),null),s},useId:function(){var r=Gn(),a=zt.identifierPrefix;if(dt){var s=xi,c=wi;s=(c&~(1<<32-wt(c)-1)).toString(32)+s,a="_"+a+"R_"+s,s=sd++,0<s&&(a+="H"+s.toString(32)),a+="_"}else s=IO++,a="_"+a+"r_"+s.toString(32)+"_";return r.memoizedState=a},useHostTransitionStatus:xh,useFormState:g_,useActionState:g_,useOptimistic:function(r){var a=Gn();a.memoizedState=a.baseState=r;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return a.queue=s,a=_h.bind(null,Ye,!0,s),s.dispatch=a,[r,a]},useMemoCache:fh,useCacheRefresh:function(){return Gn().memoizedState=NO.bind(null,Ye)},useEffectEvent:function(r){var a=Gn(),s={impl:r};return a.memoizedState=s,function(){if(xt&2)throw Error(o(440));return s.impl.apply(void 0,arguments)}}},kh={readContext:In,use:cd,useCallback:T_,useContext:In,useEffect:yh,useImperativeHandle:E_,useInsertionEffect:k_,useLayoutEffect:C_,useMemo:D_,useReducer:ud,useRef:w_,useState:function(){return ud(Bi)},useDebugValue:vh,useDeferredValue:function(r,a){return R_(sn(),Pt.memoizedState,r,a)},useTransition:function(){var r=ud(Bi)[0],a=sn().memoizedState;return[typeof r=="boolean"?r:ec(r),a]},useSyncExternalStore:i_,useId:P_,useHostTransitionStatus:xh,useFormState:y_,useActionState:y_,useOptimistic:function(r,a){return u_(sn(),Pt,r,a)},useMemoCache:fh,useCacheRefresh:O_};kh.useEffectEvent=__;var z_={readContext:In,use:cd,useCallback:T_,useContext:In,useEffect:yh,useImperativeHandle:E_,useInsertionEffect:k_,useLayoutEffect:C_,useMemo:D_,useReducer:mh,useRef:w_,useState:function(){return mh(Bi)},useDebugValue:vh,useDeferredValue:function(r,a){var s=sn();return Pt===null?bh(s,r,a):R_(s,Pt.memoizedState,r,a)},useTransition:function(){var r=mh(Bi)[0],a=sn().memoizedState;return[typeof r=="boolean"?r:ec(r),a]},useSyncExternalStore:i_,useId:P_,useHostTransitionStatus:xh,useFormState:b_,useActionState:b_,useOptimistic:function(r,a){var s=sn();return Pt===null?(s.baseState=r,[r,s.queue.dispatch]):u_(s,Pt,r,a)},useMemoCache:fh,useCacheRefresh:O_};z_.useEffectEvent=__;function Ch(r,a,s,c){a=r.memoizedState,s=s(c,a),s=s==null?a:S({},a,s),r.memoizedState=s,r.lanes===0&&(r.updateQueue.baseState=s)}var Sh={enqueueSetState:function(r,a,s){r=r._reactInternals;var c=Vr(),m=Lo(c);m.payload=a,s!=null&&(m.callback=s),a=Po(r,m,c),a!==null&&(or(a,r,c),Xl(a,r,c))},enqueueReplaceState:function(r,a,s){r=r._reactInternals;var c=Vr(),m=Lo(c);m.tag=1,m.payload=a,s!=null&&(m.callback=s),a=Po(r,m,c),a!==null&&(or(a,r,c),Xl(a,r,c))},enqueueForceUpdate:function(r,a){r=r._reactInternals;var s=Vr(),c=Lo(s);c.tag=2,a!=null&&(c.callback=a),a=Po(r,c,s),a!==null&&(or(a,r,s),Xl(a,r,s))}};function F_(r,a,s,c,m,y,C){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(c,y,C):a.prototype&&a.prototype.isPureReactComponent?!Vl(s,c)||!Vl(m,y):!0}function $_(r,a,s,c){r=a.state,typeof a.componentWillReceiveProps=="function"&&a.componentWillReceiveProps(s,c),typeof a.UNSAFE_componentWillReceiveProps=="function"&&a.UNSAFE_componentWillReceiveProps(s,c),a.state!==r&&Sh.enqueueReplaceState(a,a.state,null)}function Mo(r,a){var s=a;if("ref"in a)for(var c in s={},a)c!=="ref"&&(s[c]=a[c]);if(r=r.defaultProps)for(var m in s===a&&(s=S({},s)),r)s[m]===void 0&&(s[m]=r[m]);return s}function qO(r){Wu(r)}function zO(r){console.error(r)}function FO(r){Wu(r)}function md(r,a){try{var s=r.onUncaughtError;s(a.value,{componentStack:a.stack})}catch(c){setTimeout(function(){throw c})}}function V_(r,a,s){try{var c=r.onCaughtError;c(s.value,{componentStack:s.stack,errorBoundary:a.tag===1?a.stateNode:null})}catch(m){setTimeout(function(){throw m})}}function Eh(r,a,s){return s=Lo(s),s.tag=3,s.payload={element:null},s.callback=function(){md(r,a)},s}function H_(r){return r=Lo(r),r.tag=3,r}function B_(r,a,s,c){var m=s.type.getDerivedStateFromError;if(typeof m=="function"){var y=c.value;r.payload=function(){return m(y)},r.callback=function(){V_(a,s,c)}}var C=s.stateNode;C!==null&&typeof C.componentDidCatch=="function"&&(r.callback=function(){V_(a,s,c),typeof m!="function"&&(ja===null?ja=new Set([this]):ja.add(this));var R=c.stack;this.componentDidCatch(c.value,{componentStack:R===null?"":R})})}function $O(r,a,s,c,m){if(s.flags|=32768,typeof c=="object"&&c&&typeof c.then=="function"){if(a=s.alternate,a!==null&&Ds(a,s,m,!0),s=br.current,s!==null){switch(s.tag){case 31:case 13:return ai===null?Ed():s.alternate===null&&en===0&&(en=3),s.flags&=-257,s.flags|=65536,s.lanes=m,c===td?s.flags|=16384:(a=s.updateQueue,a===null?s.updateQueue=new Set([c]):a.add(c),Jh(r,c,m)),!1;case 22:return s.flags|=65536,c===td?s.flags|=16384:(a=s.updateQueue,a===null?(a={transitions:null,markerInstances:null,retryQueue:new Set([c])},s.updateQueue=a):(s=a.retryQueue,s===null?a.retryQueue=new Set([c]):s.add(c)),Jh(r,c,m)),!1}throw Error(o(435,s.tag))}return Jh(r,c,m),Ed(),!1}if(dt)return a=br.current,a===null?(c!==Wm&&(a=Error(o(423),{cause:c}),Wl(qr(a,s))),r=r.current.alternate,r.flags|=65536,m&=-m,r.lanes|=m,c=qr(c,s),m=Eh(r.stateNode,c,m),nh(r,m),en!==4&&(en=2)):(!(a.flags&65536)&&(a.flags|=256),a.flags|=65536,a.lanes=m,c!==Wm&&(r=Error(o(422),{cause:c}),Wl(qr(r,s)))),!1;var y=Error(o(520),{cause:c});if(y=qr(y,s),uc===null?uc=[y]:uc.push(y),en!==4&&(en=2),a===null)return!0;c=qr(c,s),s=a;do{switch(s.tag){case 3:return s.flags|=65536,r=m&-m,s.lanes|=r,r=Eh(s.stateNode,c,r),nh(s,r),!1;case 1:if(a=s.type,y=s.stateNode,!(s.flags&128)&&(typeof a.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(ja===null||!ja.has(y))))return s.flags|=65536,m&=-m,s.lanes|=m,m=H_(m),B_(m,r,s,c),nh(s,m),!1}s=s.return}while(s!==null);return!1}var Th=Error(o(461)),mn=!1;function An(r,a,s,c){a.child=r===null?Jx(a,null,s,c):Ao(a,r.child,s,c)}function W_(r,a,s,c,m){s=s.render;var y=a.ref;if("ref"in c){var C={};for(var R in c)R!=="ref"&&(C[R]=c[R])}else C=c;return To(a),c=lh(r,a,s,C,y,m),R=ch(),r!==null&&!mn?(uh(r,a,m),Wi(r,a,m)):(dt&&R&&Hm(a),a.flags|=1,An(r,a,c,m),a.child)}function U_(r,a,s,c,m){if(r===null){var y=s.type;return typeof y=="function"&&!Fm(y)&&y.defaultProps===void 0&&s.compare===null?(a.tag=15,a.type=y,K_(r,a,y,c,m)):(r=Gu(s.type,null,c,a,a.mode,m),r.ref=a.ref,r.return=a,a.child=r)}if(y=r.child,!Mh(r,m)){var C=y.memoizedProps;if(s=s.compare,s=s===null?Vl:s,s(C,c)&&r.ref===a.ref)return Wi(r,a,m)}return a.flags|=1,r=zi(y,c),r.ref=a.ref,r.return=a,a.child=r}function K_(r,a,s,c,m){if(r!==null){var y=r.memoizedProps;if(Vl(y,c)&&r.ref===a.ref)if(mn=!1,a.pendingProps=c=y,Mh(r,m))r.flags&131072&&(mn=!0);else return a.lanes=r.lanes,Wi(r,a,m)}return Dh(r,a,s,c,m)}function Q_(r,a,s,c){var m=c.children,y=r===null?null:r.memoizedState;if(r===null&&a.stateNode===null&&(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.mode==="hidden"){if(a.flags&128){if(y=y===null?s:y.baseLanes|s,r!==null){for(c=a.child=r.child,m=0;c!==null;)m=m|c.lanes|c.childLanes,c=c.sibling;c=m&~y}else c=0,a.child=null;return G_(r,a,y,s,c)}if(s&536870912)a.memoizedState={baseLanes:0,cachePool:null},r!==null&&Zu(a,y===null?null:y.cachePool),y===null?ih():e_(a,y),t_(a);else return c=a.lanes=536870912,G_(r,a,y===null?s:y.baseLanes|s,s,c)}else y===null?(r!==null&&Zu(a,null),ih(),Pa(a)):(Zu(a,y.cachePool),e_(a,y),Pa(a),a.memoizedState=null);return An(r,a,m,s),a.child}function rc(r,a){return r!==null&&r.tag===22||a.stateNode!==null||(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.sibling}function G_(r,a,s,c,m){var y=Ym();return y=y===null?null:{parent:fn._currentValue,pool:y},a.memoizedState={baseLanes:s,cachePool:y},r!==null&&Zu(a,null),ih(),t_(a),r!==null&&Ds(r,a,c,!0),a.childLanes=m,null}function hd(r,a){return a=yd({mode:a.mode,children:a.children},r.mode),a.ref=r.ref,r.child=a,a.return=r,a}function X_(r,a,s){return Ao(a,r.child,null,s),r=hd(a,a.pendingProps),r.flags|=2,wr(a),a.memoizedState=null,r}function VO(r,a,s){var c=a.pendingProps,m=(a.flags&128)!=0;if(a.flags&=-129,r===null){if(dt){if(c.mode==="hidden")return r=hd(a,c),a.lanes=536870912,rc(null,r);if(oh(a),(r=Bt)?(r=cC(r,$r),r=r!==null&&r.data==="&"?r:null,r!==null&&(a.memoizedState={dehydrated:r,treeContext:Ta===null?null:{id:wi,overflow:xi},retryLane:536870912,hydrationErrors:null},s=Nx(r),s.return=a,a.child=s,Rn=a,Bt=null)):r=null,r===null)throw Ra(a);return a.lanes=536870912,null}return hd(a,c)}var y=r.memoizedState;if(y!==null){var C=y.dehydrated;if(oh(a),m)if(a.flags&256)a.flags&=-257,a=X_(r,a,s);else if(a.memoizedState!==null)a.child=r.child,a.flags|=128,a=null;else throw Error(o(558));else if(mn||Ds(r,a,s,!1),m=(s&r.childLanes)!==0,mn||m){if(c=zt,c!==null&&(C=A(c,s),C!==0&&C!==y.retryLane))throw y.retryLane=C,ko(r,C),or(c,r,C),Th;Ed(),a=X_(r,a,s)}else r=y.treeContext,Bt=Hr(C.nextSibling),Rn=a,dt=!0,Da=null,$r=!1,r!==null&&zx(a,r),a=hd(a,c),a.flags|=4096;return a}return r=zi(r.child,{mode:c.mode,children:c.children}),r.ref=a.ref,a.child=r,r.return=a,r}function gd(r,a){var s=a.ref;if(s===null)r!==null&&r.ref!==null&&(a.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(o(284));(r===null||r.ref!==s)&&(a.flags|=4194816)}}function Dh(r,a,s,c,m){return To(a),s=lh(r,a,s,c,void 0,m),c=ch(),r!==null&&!mn?(uh(r,a,m),Wi(r,a,m)):(dt&&c&&Hm(a),a.flags|=1,An(r,a,s,m),a.child)}function J_(r,a,s,c,m,y){return To(a),a.updateQueue=null,s=r_(a,c,s,m),n_(r),c=ch(),r!==null&&!mn?(uh(r,a,y),Wi(r,a,y)):(dt&&c&&Hm(a),a.flags|=1,An(r,a,s,y),a.child)}function Y_(r,a,s,c,m){if(To(a),a.stateNode===null){var y=Cs,C=s.contextType;typeof C=="object"&&C&&(y=In(C)),y=new s(c,y),a.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,y.updater=Sh,a.stateNode=y,y._reactInternals=a,y=a.stateNode,y.props=c,y.state=a.memoizedState,y.refs={},eh(a),C=s.contextType,y.context=typeof C=="object"&&C?In(C):Cs,y.state=a.memoizedState,C=s.getDerivedStateFromProps,typeof C=="function"&&(Ch(a,s,C,c),y.state=a.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof y.getSnapshotBeforeUpdate=="function"||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(C=y.state,typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount(),C!==y.state&&Sh.enqueueReplaceState(y,y.state,null),Yl(a,c,y,m),Jl(),y.state=a.memoizedState),typeof y.componentDidMount=="function"&&(a.flags|=4194308),c=!0}else if(r===null){y=a.stateNode;var R=a.memoizedProps,H=Mo(s,R);y.props=H;var ie=y.context,ge=s.contextType;C=Cs,typeof ge=="object"&&ge&&(C=In(ge));var ve=s.getDerivedStateFromProps;ge=typeof ve=="function"||typeof y.getSnapshotBeforeUpdate=="function",R=a.pendingProps!==R,ge||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(R||ie!==C)&&$_(a,y,c,C),Aa=!1;var se=a.memoizedState;y.state=se,Yl(a,c,y,m),Jl(),ie=a.memoizedState,R||se!==ie||Aa?(typeof ve=="function"&&(Ch(a,s,ve,c),ie=a.memoizedState),(H=Aa||F_(a,s,H,c,se,ie,C))?(ge||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount()),typeof y.componentDidMount=="function"&&(a.flags|=4194308)):(typeof y.componentDidMount=="function"&&(a.flags|=4194308),a.memoizedProps=c,a.memoizedState=ie),y.props=c,y.state=ie,y.context=C,c=H):(typeof y.componentDidMount=="function"&&(a.flags|=4194308),c=!1)}else{y=a.stateNode,th(r,a),C=a.memoizedProps,ge=Mo(s,C),y.props=ge,ve=a.pendingProps,se=y.context,ie=s.contextType,H=Cs,typeof ie=="object"&&ie&&(H=In(ie)),R=s.getDerivedStateFromProps,(ie=typeof R=="function"||typeof y.getSnapshotBeforeUpdate=="function")||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(C!==ve||se!==H)&&$_(a,y,c,H),Aa=!1,se=a.memoizedState,y.state=se,Yl(a,c,y,m),Jl();var fe=a.memoizedState;C!==ve||se!==fe||Aa||r!==null&&r.dependencies!==null&&Ju(r.dependencies)?(typeof R=="function"&&(Ch(a,s,R,c),fe=a.memoizedState),(ge=Aa||F_(a,s,ge,c,se,fe,H)||r!==null&&r.dependencies!==null&&Ju(r.dependencies))?(ie||typeof y.UNSAFE_componentWillUpdate!="function"&&typeof y.componentWillUpdate!="function"||(typeof y.componentWillUpdate=="function"&&y.componentWillUpdate(c,fe,H),typeof y.UNSAFE_componentWillUpdate=="function"&&y.UNSAFE_componentWillUpdate(c,fe,H)),typeof y.componentDidUpdate=="function"&&(a.flags|=4),typeof y.getSnapshotBeforeUpdate=="function"&&(a.flags|=1024)):(typeof y.componentDidUpdate!="function"||C===r.memoizedProps&&se===r.memoizedState||(a.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||C===r.memoizedProps&&se===r.memoizedState||(a.flags|=1024),a.memoizedProps=c,a.memoizedState=fe),y.props=c,y.state=fe,y.context=H,c=ge):(typeof y.componentDidUpdate!="function"||C===r.memoizedProps&&se===r.memoizedState||(a.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||C===r.memoizedProps&&se===r.memoizedState||(a.flags|=1024),c=!1)}return y=c,gd(r,a),c=(a.flags&128)!=0,y||c?(y=a.stateNode,s=c&&typeof s.getDerivedStateFromError!="function"?null:y.render(),a.flags|=1,r!==null&&c?(a.child=Ao(a,r.child,null,m),a.child=Ao(a,null,s,m)):An(r,a,s,m),a.memoizedState=y.state,r=a.child):r=Wi(r,a,m),r}function Z_(r,a,s,c){return So(),a.flags|=256,An(r,a,s,c),a.child}var Rh={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ih(r){return{baseLanes:r,cachePool:Wx()}}function Ah(r,a,s){return r=r===null?0:r.childLanes&~s,a&&(r|=_r),r}function ek(r,a,s){var c=a.pendingProps,m=!1,y=(a.flags&128)!=0,C;if((C=y)||(C=r!==null&&r.memoizedState===null?!1:(on.current&2)!=0),C&&(m=!0,a.flags&=-129),C=(a.flags&32)!=0,a.flags&=-33,r===null){if(dt){if(m?La(a):Pa(a),(r=Bt)?(r=cC(r,$r),r=r!==null&&r.data!=="&"?r:null,r!==null&&(a.memoizedState={dehydrated:r,treeContext:Ta===null?null:{id:wi,overflow:xi},retryLane:536870912,hydrationErrors:null},s=Nx(r),s.return=a,a.child=s,Rn=a,Bt=null)):r=null,r===null)throw Ra(a);return fg(r)?a.lanes=32:a.lanes=536870912,null}var R=c.children;return c=c.fallback,m?(Pa(a),m=a.mode,R=yd({mode:"hidden",children:R},m),c=Co(c,m,s,null),R.return=a,c.return=a,R.sibling=c,a.child=R,c=a.child,c.memoizedState=Ih(s),c.childLanes=Ah(r,C,s),a.memoizedState=Rh,rc(null,c)):(La(a),Lh(a,R))}var H=r.memoizedState;if(H!==null&&(R=H.dehydrated,R!==null)){if(y)a.flags&256?(La(a),a.flags&=-257,a=Ph(r,a,s)):a.memoizedState===null?(Pa(a),R=c.fallback,m=a.mode,c=yd({mode:"visible",children:c.children},m),R=Co(R,m,s,null),R.flags|=2,c.return=a,R.return=a,c.sibling=R,a.child=c,Ao(a,r.child,null,s),c=a.child,c.memoizedState=Ih(s),c.childLanes=Ah(r,C,s),a.memoizedState=Rh,a=rc(null,c)):(Pa(a),a.child=r.child,a.flags|=128,a=null);else if(La(a),fg(R)){if(C=R.nextSibling&&R.nextSibling.dataset,C)var ie=C.dgst;C=ie,c=Error(o(419)),c.stack="",c.digest=C,Wl({value:c,source:null,stack:null}),a=Ph(r,a,s)}else if(mn||Ds(r,a,s,!1),C=(s&r.childLanes)!==0,mn||C){if(C=zt,C!==null&&(c=A(C,s),c!==0&&c!==H.retryLane))throw H.retryLane=c,ko(r,c),or(C,r,c),Th;dg(R)||Ed(),a=Ph(r,a,s)}else dg(R)?(a.flags|=192,a.child=r.child,a=null):(r=H.treeContext,Bt=Hr(R.nextSibling),Rn=a,dt=!0,Da=null,$r=!1,r!==null&&zx(a,r),a=Lh(a,c.children),a.flags|=4096);return a}return m?(Pa(a),R=c.fallback,m=a.mode,H=r.child,ie=H.sibling,c=zi(H,{mode:"hidden",children:c.children}),c.subtreeFlags=H.subtreeFlags&65011712,ie===null?(R=Co(R,m,s,null),R.flags|=2):R=zi(ie,R),R.return=a,c.return=a,c.sibling=R,a.child=c,rc(null,c),c=a.child,R=r.child.memoizedState,R===null?R=Ih(s):(m=R.cachePool,m===null?m=Wx():(H=fn._currentValue,m=m.parent===H?m:{parent:H,pool:H}),R={baseLanes:R.baseLanes|s,cachePool:m}),c.memoizedState=R,c.childLanes=Ah(r,C,s),a.memoizedState=Rh,rc(r.child,c)):(La(a),s=r.child,r=s.sibling,s=zi(s,{mode:"visible",children:c.children}),s.return=a,s.sibling=null,r!==null&&(C=a.deletions,C===null?(a.deletions=[r],a.flags|=16):C.push(r)),a.child=s,a.memoizedState=null,s)}function Lh(r,a){return a=yd({mode:"visible",children:a},r.mode),a.return=r,r.child=a}function yd(r,a){return r=vr(22,r,null,a),r.lanes=0,r}function Ph(r,a,s){return Ao(a,r.child,null,s),r=Lh(a,a.pendingProps.children),r.flags|=2,a.memoizedState=null,r}function tk(r,a,s){r.lanes|=a;var c=r.alternate;c!==null&&(c.lanes|=a),Qm(r.return,a,s)}function Oh(r,a,s,c,m,y){var C=r.memoizedState;C===null?r.memoizedState={isBackwards:a,rendering:null,renderingStartTime:0,last:c,tail:s,tailMode:m,treeForkCount:y}:(C.isBackwards=a,C.rendering=null,C.renderingStartTime=0,C.last=c,C.tail=s,C.tailMode=m,C.treeForkCount=y)}function nk(r,a,s){var c=a.pendingProps,m=c.revealOrder,y=c.tail;c=c.children;var C=on.current,R=(C&2)!=0;if(R?(C=C&1|2,a.flags|=128):C&=1,Oe(on,C),An(r,a,c,s),c=dt?Bl:0,!R&&r!==null&&r.flags&128)e:for(r=a.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&tk(r,s,a);else if(r.tag===19)tk(r,s,a);else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===a)break e;for(;r.sibling===null;){if(r.return===null||r.return===a)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}switch(m){case"forwards":for(s=a.child,m=null;s!==null;)r=s.alternate,r!==null&&ad(r)===null&&(m=s),s=s.sibling;s=m,s===null?(m=a.child,a.child=null):(m=s.sibling,s.sibling=null),Oh(a,!1,m,s,y,c);break;case"backwards":case"unstable_legacy-backwards":for(s=null,m=a.child,a.child=null;m!==null;){if(r=m.alternate,r!==null&&ad(r)===null){a.child=m;break}r=m.sibling,m.sibling=s,s=m,m=r}Oh(a,!0,s,null,y,c);break;case"together":Oh(a,!1,null,null,void 0,c);break;default:a.memoizedState=null}return a.child}function Wi(r,a,s){if(r!==null&&(a.dependencies=r.dependencies),Na|=a.lanes,(s&a.childLanes)===0)if(r!==null){if(Ds(r,a,s,!1),(s&a.childLanes)===0)return null}else return null;if(r!==null&&a.child!==r.child)throw Error(o(153));if(a.child!==null){for(r=a.child,s=zi(r,r.pendingProps),a.child=s,s.return=a;r.sibling!==null;)r=r.sibling,s=s.sibling=zi(r,r.pendingProps),s.return=a;s.sibling=null}return a.child}function Mh(r,a){return(r.lanes&a)===0?(r=r.dependencies,!!(r!==null&&Ju(r))):!0}function HO(r,a,s){switch(a.tag){case 3:gn(a,a.stateNode.containerInfo),Ia(a,fn,r.memoizedState.cache),So();break;case 27:case 5:cn(a);break;case 4:gn(a,a.stateNode.containerInfo);break;case 10:Ia(a,a.type,a.memoizedProps.value);break;case 31:if(a.memoizedState!==null)return a.flags|=128,oh(a),null;break;case 13:var c=a.memoizedState;if(c!==null)return c.dehydrated===null?(s&a.child.childLanes)===0?(La(a),r=Wi(r,a,s),r===null?null:r.sibling):ek(r,a,s):(La(a),a.flags|=128,null);La(a);break;case 19:var m=(r.flags&128)!=0;if(c=(s&a.childLanes)!==0,c||(c=(Ds(r,a,s,!1),(s&a.childLanes)!==0)),m){if(c)return nk(r,a,s);a.flags|=128}if(m=a.memoizedState,m!==null&&(m.rendering=null,m.tail=null,m.lastEffect=null),Oe(on,on.current),c)break;return null;case 22:return a.lanes=0,Q_(r,a,s,a.pendingProps);case 24:Ia(a,fn,r.memoizedState.cache)}return Wi(r,a,s)}function rk(r,a,s){if(r!==null)if(r.memoizedProps!==a.pendingProps)mn=!0;else{if(!Mh(r,s)&&!(a.flags&128))return mn=!1,HO(r,a,s);mn=!!(r.flags&131072)}else mn=!1,dt&&a.flags&1048576&&qx(a,Bl,a.index);switch(a.lanes=0,a.tag){case 16:e:{var c=a.pendingProps;if(r=Ro(a.elementType),a.type=r,typeof r=="function")Fm(r)?(c=Mo(r,c),a.tag=1,a=Y_(null,a,r,c,s)):(a.tag=0,a=Dh(null,a,r,c,s));else{if(r!=null){var m=r.$$typeof;if(m===me){a.tag=11,a=W_(null,a,r,c,s);break e}else if(m===ae){a.tag=14,a=U_(null,a,r,c,s);break e}}throw a=ce(r)||r,Error(o(306,a,""))}}return a;case 0:return Dh(r,a,a.type,a.pendingProps,s);case 1:return c=a.type,m=Mo(c,a.pendingProps),Y_(r,a,c,m,s);case 3:e:{if(gn(a,a.stateNode.containerInfo),r===null)throw Error(o(387));c=a.pendingProps;var y=a.memoizedState;m=y.element,th(r,a),Yl(a,c,null,s);var C=a.memoizedState;if(c=C.cache,Ia(a,fn,c),c!==y.cache&&Gm(a,[fn],s,!0),Jl(),c=C.element,y.isDehydrated)if(y={element:c,isDehydrated:!1,cache:C.cache},a.updateQueue.baseState=y,a.memoizedState=y,a.flags&256){a=Z_(r,a,c,s);break e}else if(c!==m){m=qr(Error(o(424)),a),Wl(m),a=Z_(r,a,c,s);break e}else for((r=a.stateNode.containerInfo,r.nodeType)===9?r=r.body:r=r.nodeName==="HTML"?r.ownerDocument.body:r,Bt=Hr(r.firstChild),Rn=a,dt=!0,Da=null,$r=!0,s=Jx(a,null,c,s),a.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling;else{if(So(),c===m){a=Wi(r,a,s);break e}An(r,a,c,s)}a=a.child}return a;case 26:return gd(r,a),r===null?(s=hC(a.type,null,a.pendingProps,null))?a.memoizedState=s:dt||(s=a.type,r=a.pendingProps,c=Pd(bt.current).createElement(s),c[Ue]=a,c[Ke]=r,Ln(c,s,r),an(c),a.stateNode=c):a.memoizedState=hC(a.type,r.memoizedProps,a.pendingProps,r.memoizedState),null;case 27:return cn(a),r===null&&dt&&(c=a.stateNode=fC(a.type,a.pendingProps,bt.current),Rn=a,$r=!0,m=Bt,$a(a.type)?(pg=m,Bt=Hr(c.firstChild)):Bt=m),An(r,a,a.pendingProps.children,s),gd(r,a),r===null&&(a.flags|=4194304),a.child;case 5:return r===null&&dt&&((m=c=Bt)&&(c=yM(c,a.type,a.pendingProps,$r),c===null?m=!1:(a.stateNode=c,Rn=a,Bt=Hr(c.firstChild),$r=!1,m=!0)),m||Ra(a)),cn(a),m=a.type,y=a.pendingProps,C=r===null?null:r.memoizedProps,c=y.children,lg(m,y)?c=null:C!==null&&lg(m,C)&&(a.flags|=32),a.memoizedState!==null&&(m=lh(r,a,AO,null,null,s),vc._currentValue=m),gd(r,a),An(r,a,c,s),a.child;case 6:return r===null&&dt&&((r=s=Bt)&&(s=vM(s,a.pendingProps,$r),s===null?r=!1:(a.stateNode=s,Rn=a,Bt=null,r=!0)),r||Ra(a)),null;case 13:return ek(r,a,s);case 4:return gn(a,a.stateNode.containerInfo),c=a.pendingProps,r===null?a.child=Ao(a,null,c,s):An(r,a,c,s),a.child;case 11:return W_(r,a,a.type,a.pendingProps,s);case 7:return An(r,a,a.pendingProps,s),a.child;case 8:return An(r,a,a.pendingProps.children,s),a.child;case 12:return An(r,a,a.pendingProps.children,s),a.child;case 10:return c=a.pendingProps,Ia(a,a.type,c.value),An(r,a,c.children,s),a.child;case 9:return m=a.type._context,c=a.pendingProps.children,To(a),m=In(m),c=c(m),a.flags|=1,An(r,a,c,s),a.child;case 14:return U_(r,a,a.type,a.pendingProps,s);case 15:return K_(r,a,a.type,a.pendingProps,s);case 19:return nk(r,a,s);case 31:return VO(r,a,s);case 22:return Q_(r,a,s,a.pendingProps);case 24:return To(a),c=In(fn),r===null?(m=Ym(),m===null&&(m=zt,y=Xm(),m.pooledCache=y,y.refCount++,y!==null&&(m.pooledCacheLanes|=s),m=y),a.memoizedState={parent:c,cache:m},eh(a),Ia(a,fn,m)):((r.lanes&s)!==0&&(th(r,a),Yl(a,null,null,s),Jl()),m=r.memoizedState,y=a.memoizedState,m.parent===c?(c=y.cache,Ia(a,fn,c),c!==m.cache&&Gm(a,[fn],s,!0)):(m={parent:c,cache:c},a.memoizedState=m,a.lanes===0&&(a.memoizedState=a.updateQueue.baseState=m),Ia(a,fn,c))),An(r,a,a.pendingProps.children,s),a.child;case 29:throw a.pendingProps}throw Error(o(156,a.tag))}function Ui(r){r.flags|=4}function Nh(r,a,s,c,m){if((a=(r.mode&32)!=0)&&(a=!1),a){if(r.flags|=16777216,(m&335544128)===m)if(r.stateNode.complete)r.flags|=8192;else if(Ik())r.flags|=8192;else throw Io=td,Zm}else r.flags&=-16777217}function ik(r,a){if(a.type!=="stylesheet"||a.state.loading&4)r.flags&=-16777217;else if(r.flags|=16777216,!wC(a))if(Ik())r.flags|=8192;else throw Io=td,Zm}function vd(r,a){a!==null&&(r.flags|=4),r.flags&16384&&(a=r.tag===22?536870912:Pi(),r.lanes|=a,Fs|=a)}function ic(r,a){if(!dt)switch(r.tailMode){case"hidden":a=r.tail;for(var s=null;a!==null;)a.alternate!==null&&(s=a),a=a.sibling;s===null?r.tail=null:s.sibling=null;break;case"collapsed":s=r.tail;for(var c=null;s!==null;)s.alternate!==null&&(c=s),s=s.sibling;c===null?a||r.tail===null?r.tail=null:r.tail.sibling=null:c.sibling=null}}function Wt(r){var a=r.alternate!==null&&r.alternate.child===r.child,s=0,c=0;if(a)for(var m=r.child;m!==null;)s|=m.lanes|m.childLanes,c|=m.subtreeFlags&65011712,c|=m.flags&65011712,m.return=r,m=m.sibling;else for(m=r.child;m!==null;)s|=m.lanes|m.childLanes,c|=m.subtreeFlags,c|=m.flags,m.return=r,m=m.sibling;return r.subtreeFlags|=c,r.childLanes=s,a}function BO(r,a,s){var c=a.pendingProps;switch(Bm(a),a.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Wt(a),null;case 1:return Wt(a),null;case 3:return s=a.stateNode,c=null,r!==null&&(c=r.memoizedState.cache),a.memoizedState.cache!==c&&(a.flags|=2048),Vi(fn),Xe(),s.pendingContext&&(s.pendingContext=(s.context=s.pendingContext,null)),(r===null||r.child===null)&&(Ts(a)?Ui(a):r===null||r.memoizedState.isDehydrated&&!(a.flags&256)||(a.flags|=1024,Um())),Wt(a),null;case 26:var m=a.type,y=a.memoizedState;return r===null?(Ui(a),y===null?(Wt(a),Nh(a,m,null,c,s)):(Wt(a),ik(a,y))):y?y===r.memoizedState?(Wt(a),a.flags&=-16777217):(Ui(a),Wt(a),ik(a,y)):(r=r.memoizedProps,r!==c&&Ui(a),Wt(a),Nh(a,m,r,c,s)),null;case 27:if(Ct(a),s=bt.current,m=a.type,r!==null&&a.stateNode!=null)r.memoizedProps!==c&&Ui(a);else{if(!c){if(a.stateNode===null)throw Error(o(166));return Wt(a),null}r=Be.current,Ts(a)?Fx(a,r):(r=fC(m,c,s),a.stateNode=r,Ui(a))}return Wt(a),null;case 5:if(Ct(a),m=a.type,r!==null&&a.stateNode!=null)r.memoizedProps!==c&&Ui(a);else{if(!c){if(a.stateNode===null)throw Error(o(166));return Wt(a),null}if(y=Be.current,Ts(a))Fx(a,y);else{var C=Pd(bt.current);switch(y){case 1:y=C.createElementNS("http://www.w3.org/2000/svg",m);break;case 2:y=C.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;default:switch(m){case"svg":y=C.createElementNS("http://www.w3.org/2000/svg",m);break;case"math":y=C.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;case"script":y=C.createElement("div"),y.innerHTML="<script><\/script>",y=y.removeChild(y.firstChild);break;case"select":y=typeof c.is=="string"?C.createElement("select",{is:c.is}):C.createElement("select"),c.multiple?y.multiple=!0:c.size&&(y.size=c.size);break;default:y=typeof c.is=="string"?C.createElement(m,{is:c.is}):C.createElement(m)}}y[Ue]=a,y[Ke]=c;e:for(C=a.child;C!==null;){if(C.tag===5||C.tag===6)y.appendChild(C.stateNode);else if(C.tag!==4&&C.tag!==27&&C.child!==null){C.child.return=C,C=C.child;continue}if(C===a)break e;for(;C.sibling===null;){if(C.return===null||C.return===a)break e;C=C.return}C.sibling.return=C.return,C=C.sibling}a.stateNode=y;e:switch(Ln(y,m,c),m){case"button":case"input":case"select":case"textarea":c=!!c.autoFocus;break e;case"img":c=!0;break e;default:c=!1}c&&Ui(a)}}return Wt(a),Nh(a,a.type,r===null?null:r.memoizedProps,a.pendingProps,s),null;case 6:if(r&&a.stateNode!=null)r.memoizedProps!==c&&Ui(a);else{if(typeof c!="string"&&a.stateNode===null)throw Error(o(166));if(r=bt.current,Ts(a)){if(r=a.stateNode,s=a.memoizedProps,c=null,m=Rn,m!==null)switch(m.tag){case 27:case 5:c=m.memoizedProps}r[Ue]=a,r=!!(r.nodeValue===s||c!==null&&c.suppressHydrationWarning===!0||tC(r.nodeValue,s)),r||Ra(a,!0)}else r=Pd(r).createTextNode(c),r[Ue]=a,a.stateNode=r}return Wt(a),null;case 31:if(s=a.memoizedState,r===null||r.memoizedState!==null){if(c=Ts(a),s!==null){if(r===null){if(!c)throw Error(o(318));if(r=a.memoizedState,r=r===null?null:r.dehydrated,!r)throw Error(o(557));r[Ue]=a}else So(),!(a.flags&128)&&(a.memoizedState=null),a.flags|=4;Wt(a),r=!1}else s=Um(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=s),r=!0;if(!r)return a.flags&256?(wr(a),a):(wr(a),null);if(a.flags&128)throw Error(o(558))}return Wt(a),null;case 13:if(c=a.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(m=Ts(a),c!==null&&c.dehydrated!==null){if(r===null){if(!m)throw Error(o(318));if(m=a.memoizedState,m=m===null?null:m.dehydrated,!m)throw Error(o(317));m[Ue]=a}else So(),!(a.flags&128)&&(a.memoizedState=null),a.flags|=4;Wt(a),m=!1}else m=Um(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=m),m=!0;if(!m)return a.flags&256?(wr(a),a):(wr(a),null)}return wr(a),a.flags&128?(a.lanes=s,a):(s=c!==null,r=r!==null&&r.memoizedState!==null,s&&(c=a.child,m=null,c.alternate!==null&&c.alternate.memoizedState!==null&&c.alternate.memoizedState.cachePool!==null&&(m=c.alternate.memoizedState.cachePool.pool),y=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(y=c.memoizedState.cachePool.pool),y!==m&&(c.flags|=2048)),s!==r&&s&&(a.child.flags|=8192),vd(a,a.updateQueue),Wt(a),null);case 4:return Xe(),r===null&&Jk(a.stateNode.containerInfo),Wt(a),null;case 10:return Vi(a.type),Wt(a),null;case 19:if(Fe(on),c=a.memoizedState,c===null)return Wt(a),null;if(m=(a.flags&128)!=0,y=c.rendering,y===null)if(m)ic(c,!1);else{if(en!==0||r!==null&&r.flags&128)for(r=a.child;r!==null;){if(y=ad(r),y!==null){for(a.flags|=128,ic(c,!1),r=y.updateQueue,a.updateQueue=r,vd(a,r),a.subtreeFlags=0,r=s,s=a.child;s!==null;)Mx(s,r),s=s.sibling;return Oe(on,on.current&1|2),dt&&Fi(a,c.treeForkCount),a.child}r=r.sibling}c.tail!==null&&Yt()>kd&&(a.flags|=128,m=!0,ic(c,!1),a.lanes=4194304)}else{if(!m)if(r=ad(y),r!==null){if(a.flags|=128,m=!0,r=r.updateQueue,a.updateQueue=r,vd(a,r),ic(c,!0),c.tail===null&&c.tailMode==="hidden"&&!y.alternate&&!dt)return Wt(a),null}else 2*Yt()-c.renderingStartTime>kd&&s!==536870912&&(a.flags|=128,m=!0,ic(c,!1),a.lanes=4194304);c.isBackwards?(y.sibling=a.child,a.child=y):(r=c.last,r===null?a.child=y:r.sibling=y,c.last=y)}return c.tail===null?(Wt(a),null):(r=c.tail,c.rendering=r,c.tail=r.sibling,c.renderingStartTime=Yt(),r.sibling=null,s=on.current,Oe(on,m?s&1|2:s&1),dt&&Fi(a,c.treeForkCount),r);case 22:case 23:return wr(a),ah(),c=a.memoizedState!==null,r===null?c&&(a.flags|=8192):r.memoizedState!==null!==c&&(a.flags|=8192),c?s&536870912&&!(a.flags&128)&&(Wt(a),a.subtreeFlags&6&&(a.flags|=8192)):Wt(a),s=a.updateQueue,s!==null&&vd(a,s.retryQueue),s=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(s=r.memoizedState.cachePool.pool),c=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(c=a.memoizedState.cachePool.pool),c!==s&&(a.flags|=2048),r!==null&&Fe(Do),null;case 24:return s=null,r!==null&&(s=r.memoizedState.cache),a.memoizedState.cache!==s&&(a.flags|=2048),Vi(fn),Wt(a),null;case 25:return null;case 30:return null}throw Error(o(156,a.tag))}function WO(r,a){switch(Bm(a),a.tag){case 1:return r=a.flags,r&65536?(a.flags=r&-65537|128,a):null;case 3:return Vi(fn),Xe(),r=a.flags,r&65536&&!(r&128)?(a.flags=r&-65537|128,a):null;case 26:case 27:case 5:return Ct(a),null;case 31:if(a.memoizedState!==null){if(wr(a),a.alternate===null)throw Error(o(340));So()}return r=a.flags,r&65536?(a.flags=r&-65537|128,a):null;case 13:if(wr(a),r=a.memoizedState,r!==null&&r.dehydrated!==null){if(a.alternate===null)throw Error(o(340));So()}return r=a.flags,r&65536?(a.flags=r&-65537|128,a):null;case 19:return Fe(on),null;case 4:return Xe(),null;case 10:return Vi(a.type),null;case 22:case 23:return wr(a),ah(),r!==null&&Fe(Do),r=a.flags,r&65536?(a.flags=r&-65537|128,a):null;case 24:return Vi(fn),null;case 25:return null;default:return null}}function ak(r,a){switch(Bm(a),a.tag){case 3:Vi(fn),Xe();break;case 26:case 27:case 5:Ct(a);break;case 4:Xe();break;case 31:a.memoizedState!==null&&wr(a);break;case 13:wr(a);break;case 19:Fe(on);break;case 10:Vi(a.type);break;case 22:case 23:wr(a),ah(),r!==null&&Fe(Do);break;case 24:Vi(fn)}}function ac(r,a){try{var s=a.updateQueue,c=s===null?null:s.lastEffect;if(c!==null){var m=c.next;s=m;do{if((s.tag&r)===r){c=void 0;var y=s.create,C=s.inst;c=y(),C.destroy=c}s=s.next}while(s!==m)}}catch(R){It(a,a.return,R)}}function Oa(r,a,s){try{var c=a.updateQueue,m=c===null?null:c.lastEffect;if(m!==null){var y=m.next;c=y;do{if((c.tag&r)===r){var C=c.inst,R=C.destroy;if(R!==void 0){C.destroy=void 0,m=a;var H=s,ie=R;try{ie()}catch(ge){It(m,H,ge)}}}c=c.next}while(c!==y)}}catch(ge){It(a,a.return,ge)}}function ok(r){var a=r.updateQueue;if(a!==null){var s=r.stateNode;try{Zx(a,s)}catch(c){It(r,r.return,c)}}}function sk(r,a,s){s.props=Mo(r.type,r.memoizedProps),s.state=r.memoizedState;try{s.componentWillUnmount()}catch(c){It(r,a,c)}}function oc(r,a){try{var s=r.ref;if(s!==null){switch(r.tag){case 26:case 27:case 5:var c=r.stateNode;break;case 30:c=r.stateNode;break;default:c=r.stateNode}typeof s=="function"?r.refCleanup=s(c):s.current=c}}catch(m){It(r,a,m)}}function _i(r,a){var s=r.ref,c=r.refCleanup;if(s!==null)if(typeof c=="function")try{c()}catch(m){It(r,a,m)}finally{r.refCleanup=null,r=r.alternate,r!=null&&(r.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(m){It(r,a,m)}else s.current=null}function lk(r){var a=r.type,s=r.memoizedProps,c=r.stateNode;try{e:switch(a){case"button":case"input":case"select":case"textarea":s.autoFocus&&c.focus();break e;case"img":s.src?c.src=s.src:s.srcSet&&(c.srcset=s.srcSet)}}catch(m){It(r,r.return,m)}}function jh(r,a,s){try{var c=r.stateNode;dM(c,r.type,s,a),c[Ke]=a}catch(m){It(r,r.return,m)}}function ck(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&$a(r.type)||r.tag===4}function qh(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||ck(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.tag===27&&$a(r.type)||r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function zh(r,a,s){var c=r.tag;if(c===5||c===6)r=r.stateNode,a?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(r,a):(a=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,a.appendChild(r),s=s._reactRootContainer,s!=null||a.onclick!==null||(a.onclick=Nr));else if(c!==4&&(c===27&&$a(r.type)&&(s=r.stateNode,a=null),r=r.child,r!==null))for(zh(r,a,s),r=r.sibling;r!==null;)zh(r,a,s),r=r.sibling}function bd(r,a,s){var c=r.tag;if(c===5||c===6)r=r.stateNode,a?s.insertBefore(r,a):s.appendChild(r);else if(c!==4&&(c===27&&$a(r.type)&&(s=r.stateNode),r=r.child,r!==null))for(bd(r,a,s),r=r.sibling;r!==null;)bd(r,a,s),r=r.sibling}function uk(r){var a=r.stateNode,s=r.memoizedProps;try{for(var c=r.type,m=a.attributes;m.length;)a.removeAttributeNode(m[0]);Ln(a,c,s),a[Ue]=r,a[Ke]=s}catch(y){It(r,r.return,y)}}var Ki=!1,hn=!1,Fh=!1,dk=typeof WeakSet=="function"?WeakSet:Set,Dn=null;function UO(r,a){if(r=r.containerInfo,og=Fd,r=Ex(r),Pm(r)){if("selectionStart"in r)var s={start:r.selectionStart,end:r.selectionEnd};else e:{s=(s=r.ownerDocument)&&s.defaultView||window;var c=s.getSelection&&s.getSelection();if(c&&c.rangeCount!==0){s=c.anchorNode;var m=c.anchorOffset,y=c.focusNode;c=c.focusOffset;try{s.nodeType,y.nodeType}catch{s=null;break e}var C=0,R=-1,H=-1,ie=0,ge=0,ve=r,se=null;t:for(;;){for(var fe;ve!==s||m!==0&&ve.nodeType!==3||(R=C+m),ve!==y||c!==0&&ve.nodeType!==3||(H=C+c),ve.nodeType===3&&(C+=ve.nodeValue.length),(fe=ve.firstChild)!==null;)se=ve,ve=fe;for(;;){if(ve===r)break t;if(se===s&&++ie===m&&(R=C),se===y&&++ge===c&&(H=C),(fe=ve.nextSibling)!==null)break;ve=se,se=ve.parentNode}ve=fe}s=R===-1||H===-1?null:{start:R,end:H}}else s=null}s||(s={start:0,end:0})}else s=null;for(sg={focusedElem:r,selectionRange:s},Fd=!1,Dn=a;Dn!==null;)if(a=Dn,r=a.child,a.subtreeFlags&1028&&r!==null)r.return=a,Dn=r;else for(;Dn!==null;){switch(a=Dn,y=a.alternate,r=a.flags,a.tag){case 0:if(r&4&&(r=a.updateQueue,r=r===null?null:r.events,r!==null))for(s=0;s<r.length;s++)m=r[s],m.ref.impl=m.nextImpl;break;case 11:case 15:break;case 1:if(r&1024&&y!==null){r=void 0,s=a,m=y.memoizedProps,y=y.memoizedState,c=s.stateNode;try{var Ae=Mo(s.type,m);r=c.getSnapshotBeforeUpdate(Ae,y),c.__reactInternalSnapshotBeforeUpdate=r}catch(Ve){It(s,s.return,Ve)}}break;case 3:if(r&1024){if(r=a.stateNode.containerInfo,s=r.nodeType,s===9)ug(r);else if(s===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":ug(r);break;default:r.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(r&1024)throw Error(o(163))}if(r=a.sibling,r!==null){r.return=a.return,Dn=r;break}Dn=a.return}}function fk(r,a,s){var c=s.flags;switch(s.tag){case 0:case 11:case 15:Gi(r,s),c&4&&ac(5,s);break;case 1:if(Gi(r,s),c&4)if(r=s.stateNode,a===null)try{r.componentDidMount()}catch(C){It(s,s.return,C)}else{var m=Mo(s.type,a.memoizedProps);a=a.memoizedState;try{r.componentDidUpdate(m,a,r.__reactInternalSnapshotBeforeUpdate)}catch(C){It(s,s.return,C)}}c&64&&ok(s),c&512&&oc(s,s.return);break;case 3:if(Gi(r,s),c&64&&(r=s.updateQueue,r!==null)){if(a=null,s.child!==null)switch(s.child.tag){case 27:case 5:a=s.child.stateNode;break;case 1:a=s.child.stateNode}try{Zx(r,a)}catch(C){It(s,s.return,C)}}break;case 27:a===null&&c&4&&uk(s);case 26:case 5:Gi(r,s),a===null&&c&4&&lk(s),c&512&&oc(s,s.return);break;case 12:Gi(r,s);break;case 31:Gi(r,s),c&4&&hk(r,s);break;case 13:Gi(r,s),c&4&&gk(r,s),c&64&&(r=s.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(s=tM.bind(null,s),bM(r,s))));break;case 22:if(c=s.memoizedState!==null||Ki,!c){a=a!==null&&a.memoizedState!==null||hn,m=Ki;var y=hn;Ki=c,(hn=a)&&!y?Xi(r,s,(s.subtreeFlags&8772)!=0):Gi(r,s),Ki=m,hn=y}break;case 30:break;default:Gi(r,s)}}function pk(r){var a=r.alternate;a!==null&&(r.alternate=null,pk(a)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(a=r.stateNode,a!==null&&Sn(a)),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}var Gt=null,nr=!1;function Qi(r,a,s){for(s=s.child;s!==null;)mk(r,a,s),s=s.sibling}function mk(r,a,s){if(rn&&typeof rn.onCommitFiberUnmount=="function")try{rn.onCommitFiberUnmount(Or,s)}catch{}switch(s.tag){case 26:hn||_i(s,a),Qi(r,a,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:hn||_i(s,a);var c=Gt,m=nr;$a(s.type)&&(Gt=s.stateNode,nr=!1),Qi(r,a,s),hc(s.stateNode),Gt=c,nr=m;break;case 5:hn||_i(s,a);case 6:if(c=Gt,m=nr,Gt=null,Qi(r,a,s),Gt=c,nr=m,Gt!==null)if(nr)try{(Gt.nodeType===9?Gt.body:Gt.nodeName==="HTML"?Gt.ownerDocument.body:Gt).removeChild(s.stateNode)}catch(y){It(s,a,y)}else try{Gt.removeChild(s.stateNode)}catch(y){It(s,a,y)}break;case 18:Gt!==null&&(nr?(r=Gt,sC(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,s.stateNode),Qs(r)):sC(Gt,s.stateNode));break;case 4:c=Gt,m=nr,Gt=s.stateNode.containerInfo,nr=!0,Qi(r,a,s),Gt=c,nr=m;break;case 0:case 11:case 14:case 15:Oa(2,s,a),hn||Oa(4,s,a),Qi(r,a,s);break;case 1:hn||(_i(s,a),c=s.stateNode,typeof c.componentWillUnmount=="function"&&sk(s,a,c)),Qi(r,a,s);break;case 21:Qi(r,a,s);break;case 22:hn=(c=hn)||s.memoizedState!==null,Qi(r,a,s),hn=c;break;default:Qi(r,a,s)}}function hk(r,a){if(a.memoizedState===null&&(r=a.alternate,r!==null&&(r=r.memoizedState,r!==null))){r=r.dehydrated;try{Qs(r)}catch(s){It(a,a.return,s)}}}function gk(r,a){if(a.memoizedState===null&&(r=a.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null))))try{Qs(r)}catch(s){It(a,a.return,s)}}function KO(r){switch(r.tag){case 31:case 13:case 19:var a=r.stateNode;return a===null&&(a=r.stateNode=new dk),a;case 22:return r=r.stateNode,a=r._retryCache,a===null&&(a=r._retryCache=new dk),a;default:throw Error(o(435,r.tag))}}function wd(r,a){var s=KO(r);a.forEach(function(c){if(!s.has(c)){s.add(c);var m=nM.bind(null,r,c);c.then(m,m)}})}function rr(r,a){var s=a.deletions;if(s!==null)for(var c=0;c<s.length;c++){var m=s[c],y=r,C=a,R=C;e:for(;R!==null;){switch(R.tag){case 27:if($a(R.type)){Gt=R.stateNode,nr=!1;break e}break;case 5:Gt=R.stateNode,nr=!1;break e;case 3:case 4:Gt=R.stateNode.containerInfo,nr=!0;break e}R=R.return}if(Gt===null)throw Error(o(160));mk(y,C,m),Gt=null,nr=!1,y=m.alternate,y!==null&&(y.return=null),m.return=null}if(a.subtreeFlags&13886)for(a=a.child;a!==null;)yk(a,r),a=a.sibling}var oi=null;function yk(r,a){var s=r.alternate,c=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:rr(a,r),ir(r),c&4&&(Oa(3,r,r.return),ac(3,r),Oa(5,r,r.return));break;case 1:rr(a,r),ir(r),c&512&&(hn||s===null||_i(s,s.return)),c&64&&Ki&&(r=r.updateQueue,r!==null&&(c=r.callbacks,c!==null&&(s=r.shared.hiddenCallbacks,r.shared.hiddenCallbacks=s===null?c:s.concat(c))));break;case 26:var m=oi;if(rr(a,r),ir(r),c&512&&(hn||s===null||_i(s,s.return)),c&4){var y=s===null?null:s.memoizedState;if(c=r.memoizedState,s===null)if(c===null)if(r.stateNode===null){e:{c=r.type,s=r.memoizedProps,m=m.ownerDocument||m;t:switch(c){case"title":y=m.getElementsByTagName("title")[0],(!y||y[mt]||y[Ue]||y.namespaceURI==="http://www.w3.org/2000/svg"||y.hasAttribute("itemprop"))&&(y=m.createElement(c),m.head.insertBefore(y,m.querySelector("head > title"))),Ln(y,c,s),y[Ue]=r,an(y),c=y;break e;case"link":var C=vC("link","href",m).get(c+(s.href||""));if(C){for(var R=0;R<C.length;R++)if(y=C[R],y.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&y.getAttribute("rel")===(s.rel==null?null:s.rel)&&y.getAttribute("title")===(s.title==null?null:s.title)&&y.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){C.splice(R,1);break t}}y=m.createElement(c),Ln(y,c,s),m.head.appendChild(y);break;case"meta":if(C=vC("meta","content",m).get(c+(s.content||""))){for(R=0;R<C.length;R++)if(y=C[R],y.getAttribute("content")===(s.content==null?null:""+s.content)&&y.getAttribute("name")===(s.name==null?null:s.name)&&y.getAttribute("property")===(s.property==null?null:s.property)&&y.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&y.getAttribute("charset")===(s.charSet==null?null:s.charSet)){C.splice(R,1);break t}}y=m.createElement(c),Ln(y,c,s),m.head.appendChild(y);break;default:throw Error(o(468,c))}y[Ue]=r,an(y),c=y}r.stateNode=c}else bC(m,r.type,r.stateNode);else r.stateNode=yC(m,c,r.memoizedProps);else y===c?c===null&&r.stateNode!==null&&jh(r,r.memoizedProps,s.memoizedProps):(y===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):y.count--,c===null?bC(m,r.type,r.stateNode):yC(m,c,r.memoizedProps))}break;case 27:rr(a,r),ir(r),c&512&&(hn||s===null||_i(s,s.return)),s!==null&&c&4&&jh(r,r.memoizedProps,s.memoizedProps);break;case 5:if(rr(a,r),ir(r),c&512&&(hn||s===null||_i(s,s.return)),r.flags&32){m=r.stateNode;try{Ni(m,"")}catch(Ae){It(r,r.return,Ae)}}c&4&&r.stateNode!=null&&(m=r.memoizedProps,jh(r,m,s===null?m:s.memoizedProps)),c&1024&&(Fh=!0);break;case 6:if(rr(a,r),ir(r),c&4){if(r.stateNode===null)throw Error(o(162));c=r.memoizedProps,s=r.stateNode;try{s.nodeValue=c}catch(Ae){It(r,r.return,Ae)}}break;case 3:if(Nd=null,m=oi,oi=Od(a.containerInfo),rr(a,r),oi=m,ir(r),c&4&&s!==null&&s.memoizedState.isDehydrated)try{Qs(a.containerInfo)}catch(Ae){It(r,r.return,Ae)}Fh&&(Fh=!1,vk(r));break;case 4:c=oi,oi=Od(r.stateNode.containerInfo),rr(a,r),ir(r),oi=c;break;case 12:rr(a,r),ir(r);break;case 31:rr(a,r),ir(r),c&4&&(c=r.updateQueue,c!==null&&(r.updateQueue=null,wd(r,c)));break;case 13:rr(a,r),ir(r),r.child.flags&8192&&r.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(_d=Yt()),c&4&&(c=r.updateQueue,c!==null&&(r.updateQueue=null,wd(r,c)));break;case 22:m=r.memoizedState!==null;var H=s!==null&&s.memoizedState!==null,ie=Ki,ge=hn;if(Ki=ie||m,hn=ge||H,rr(a,r),hn=ge,Ki=ie,ir(r),c&8192)e:for(a=r.stateNode,a._visibility=m?a._visibility&-2:a._visibility|1,m&&(s===null||H||Ki||hn||No(r)),s=null,a=r;;){if(a.tag===5||a.tag===26){if(s===null){H=s=a;try{if(y=H.stateNode,m)C=y.style,typeof C.setProperty=="function"?C.setProperty("display","none","important"):C.display="none";else{R=H.stateNode;var ve=H.memoizedProps.style,se=ve!=null&&ve.hasOwnProperty("display")?ve.display:null;R.style.display=se==null||typeof se=="boolean"?"":(""+se).trim()}}catch(Ae){It(H,H.return,Ae)}}}else if(a.tag===6){if(s===null){H=a;try{H.stateNode.nodeValue=m?"":H.memoizedProps}catch(Ae){It(H,H.return,Ae)}}}else if(a.tag===18){if(s===null){H=a;try{var fe=H.stateNode;m?lC(fe,!0):lC(H.stateNode,!1)}catch(Ae){It(H,H.return,Ae)}}}else if((a.tag!==22&&a.tag!==23||a.memoizedState===null||a===r)&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===r)break e;for(;a.sibling===null;){if(a.return===null||a.return===r)break e;s===a&&(s=null),a=a.return}s===a&&(s=null),a.sibling.return=a.return,a=a.sibling}c&4&&(c=r.updateQueue,c!==null&&(s=c.retryQueue,s!==null&&(c.retryQueue=null,wd(r,s))));break;case 19:rr(a,r),ir(r),c&4&&(c=r.updateQueue,c!==null&&(r.updateQueue=null,wd(r,c)));break;case 30:break;case 21:break;default:rr(a,r),ir(r)}}function ir(r){var a=r.flags;if(a&2){try{for(var s,c=r.return;c!==null;){if(ck(c)){s=c;break}c=c.return}if(s==null)throw Error(o(160));switch(s.tag){case 27:var m=s.stateNode;bd(r,qh(r),m);break;case 5:var y=s.stateNode;s.flags&32&&(Ni(y,""),s.flags&=-33),bd(r,qh(r),y);break;case 3:case 4:var C=s.stateNode.containerInfo;zh(r,qh(r),C);break;default:throw Error(o(161))}}catch(R){It(r,r.return,R)}r.flags&=-3}a&4096&&(r.flags&=-4097)}function vk(r){if(r.subtreeFlags&1024)for(r=r.child;r!==null;){var a=r;vk(a),a.tag===5&&a.flags&1024&&a.stateNode.reset(),r=r.sibling}}function Gi(r,a){if(a.subtreeFlags&8772)for(a=a.child;a!==null;)fk(r,a.alternate,a),a=a.sibling}function No(r){for(r=r.child;r!==null;){var a=r;switch(a.tag){case 0:case 11:case 14:case 15:Oa(4,a,a.return),No(a);break;case 1:_i(a,a.return);var s=a.stateNode;typeof s.componentWillUnmount=="function"&&sk(a,a.return,s),No(a);break;case 27:hc(a.stateNode);case 26:case 5:_i(a,a.return),No(a);break;case 22:a.memoizedState===null&&No(a);break;case 30:No(a);break;default:No(a)}r=r.sibling}}function Xi(r,a,s){for(s&&(s=(a.subtreeFlags&8772)!=0),a=a.child;a!==null;){var c=a.alternate,m=r,y=a,C=y.flags;switch(y.tag){case 0:case 11:case 15:Xi(m,y,s),ac(4,y);break;case 1:if(Xi(m,y,s),c=y,m=c.stateNode,typeof m.componentDidMount=="function")try{m.componentDidMount()}catch(ie){It(c,c.return,ie)}if(c=y,m=c.updateQueue,m!==null){var R=c.stateNode;try{var H=m.shared.hiddenCallbacks;if(H!==null)for(m.shared.hiddenCallbacks=null,m=0;m<H.length;m++)Yx(H[m],R)}catch(ie){It(c,c.return,ie)}}s&&C&64&&ok(y),oc(y,y.return);break;case 27:uk(y);case 26:case 5:Xi(m,y,s),s&&c===null&&C&4&&lk(y),oc(y,y.return);break;case 12:Xi(m,y,s);break;case 31:Xi(m,y,s),s&&C&4&&hk(m,y);break;case 13:Xi(m,y,s),s&&C&4&&gk(m,y);break;case 22:y.memoizedState===null&&Xi(m,y,s),oc(y,y.return);break;case 30:break;default:Xi(m,y,s)}a=a.sibling}}function $h(r,a){var s=null;r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(s=r.memoizedState.cachePool.pool),r=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(r=a.memoizedState.cachePool.pool),r!==s&&(r!=null&&r.refCount++,s!=null&&Ul(s))}function Vh(r,a){r=null,a.alternate!==null&&(r=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==r&&(a.refCount++,r!=null&&Ul(r))}function si(r,a,s,c){if(a.subtreeFlags&10256)for(a=a.child;a!==null;)bk(r,a,s,c),a=a.sibling}function bk(r,a,s,c){var m=a.flags;switch(a.tag){case 0:case 11:case 15:si(r,a,s,c),m&2048&&ac(9,a);break;case 1:si(r,a,s,c);break;case 3:si(r,a,s,c),m&2048&&(r=null,a.alternate!==null&&(r=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==r&&(a.refCount++,r!=null&&Ul(r)));break;case 12:if(m&2048){si(r,a,s,c),r=a.stateNode;try{var y=a.memoizedProps,C=y.id,R=y.onPostCommit;typeof R=="function"&&R(C,a.alternate===null?"mount":"update",r.passiveEffectDuration,-0)}catch(H){It(a,a.return,H)}}else si(r,a,s,c);break;case 31:si(r,a,s,c);break;case 13:si(r,a,s,c);break;case 23:break;case 22:y=a.stateNode,C=a.alternate,a.memoizedState===null?y._visibility&2?si(r,a,s,c):(y._visibility|=2,js(r,a,s,c,(a.subtreeFlags&10256)!=0||!1)):y._visibility&2?si(r,a,s,c):sc(r,a),m&2048&&$h(C,a);break;case 24:si(r,a,s,c),m&2048&&Vh(a.alternate,a);break;default:si(r,a,s,c)}}function js(r,a,s,c,m){for(m&&(m=(a.subtreeFlags&10256)!=0||!1),a=a.child;a!==null;){var y=r,C=a,R=s,H=c,ie=C.flags;switch(C.tag){case 0:case 11:case 15:js(y,C,R,H,m),ac(8,C);break;case 23:break;case 22:var ge=C.stateNode;C.memoizedState===null?(ge._visibility|=2,js(y,C,R,H,m)):ge._visibility&2?js(y,C,R,H,m):sc(y,C),m&&ie&2048&&$h(C.alternate,C);break;case 24:js(y,C,R,H,m),m&&ie&2048&&Vh(C.alternate,C);break;default:js(y,C,R,H,m)}a=a.sibling}}function sc(r,a){if(a.subtreeFlags&10256)for(a=a.child;a!==null;){var s=r,c=a,m=c.flags;switch(c.tag){case 22:sc(s,c),m&2048&&$h(c.alternate,c);break;case 24:sc(s,c),m&2048&&Vh(c.alternate,c);break;default:sc(s,c)}a=a.sibling}}var lc=8192;function qs(r,a,s){if(r.subtreeFlags&lc)for(r=r.child;r!==null;)wk(r,a,s),r=r.sibling}function wk(r,a,s){switch(r.tag){case 26:qs(r,a,s),r.flags&lc&&r.memoizedState!==null&&AM(s,oi,r.memoizedState,r.memoizedProps);break;case 5:qs(r,a,s);break;case 3:case 4:var c=oi;oi=Od(r.stateNode.containerInfo),qs(r,a,s),oi=c;break;case 22:r.memoizedState===null&&(c=r.alternate,c!==null&&c.memoizedState!==null?(c=lc,lc=16777216,qs(r,a,s),lc=c):qs(r,a,s));break;default:qs(r,a,s)}}function xk(r){var a=r.alternate;if(a!==null&&(r=a.child,r!==null)){a.child=null;do a=r.sibling,r.sibling=null,r=a;while(r!==null)}}function cc(r){var a=r.deletions;if(r.flags&16){if(a!==null)for(var s=0;s<a.length;s++){var c=a[s];Dn=c,kk(c,r)}xk(r)}if(r.subtreeFlags&10256)for(r=r.child;r!==null;)_k(r),r=r.sibling}function _k(r){switch(r.tag){case 0:case 11:case 15:cc(r),r.flags&2048&&Oa(9,r,r.return);break;case 3:cc(r);break;case 12:cc(r);break;case 22:var a=r.stateNode;r.memoizedState!==null&&a._visibility&2&&(r.return===null||r.return.tag!==13)?(a._visibility&=-3,xd(r)):cc(r);break;default:cc(r)}}function xd(r){var a=r.deletions;if(r.flags&16){if(a!==null)for(var s=0;s<a.length;s++){var c=a[s];Dn=c,kk(c,r)}xk(r)}for(r=r.child;r!==null;){switch(a=r,a.tag){case 0:case 11:case 15:Oa(8,a,a.return),xd(a);break;case 22:s=a.stateNode,s._visibility&2&&(s._visibility&=-3,xd(a));break;default:xd(a)}r=r.sibling}}function kk(r,a){for(;Dn!==null;){var s=Dn;switch(s.tag){case 0:case 11:case 15:Oa(8,s,a);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var c=s.memoizedState.cachePool.pool;c!=null&&c.refCount++}break;case 24:Ul(s.memoizedState.cache)}if(c=s.child,c!==null)c.return=s,Dn=c;else e:for(s=r;Dn!==null;){c=Dn;var m=c.sibling,y=c.return;if(pk(c),c===s){Dn=null;break e}if(m!==null){m.return=y,Dn=m;break e}Dn=y}}}var QO={getCacheForType:function(r){var a=In(fn),s=a.data.get(r);return s===void 0&&(s=r(),a.data.set(r,s)),s},cacheSignal:function(){return In(fn).controller.signal}},GO=typeof WeakMap=="function"?WeakMap:Map,xt=0,zt=null,at=null,lt=0,Rt=0,xr=null,Ma=!1,zs=!1,Hh=!1,Ji=0,en=0,Na=0,jo=0,Bh=0,_r=0,Fs=0,uc=null,ar=null,Wh=!1,_d=0,Ck=0,kd=1/0,Cd=null,ja=null,wn=0,qa=null,$s=null,Yi=0,Uh=0,Kh=null,Sk=null,dc=0,Qh=null;function Vr(){return xt&2&<!==0?lt&-lt:he.T===null?re():eg()}function Ek(){if(_r===0)if(!(lt&536870912)||dt){var r=Dt;Dt<<=1,!(Dt&3932160)&&(Dt=262144),_r=r}else _r=536870912;return r=br.current,r!==null&&(r.flags|=32),_r}function or(r,a,s){(r===zt&&(Rt===2||Rt===9)||r.cancelPendingCommit!==null)&&(Vs(r,0),za(r,lt,_r,!1)),zn(r,s),(!(xt&2)||r!==zt)&&(r===zt&&(!(xt&2)&&(jo|=s),en===4&&za(r,lt,_r,!1)),Zi(r))}function Tk(r,a,s){if(xt&6)throw Error(o(327));var c=!s&&(a&127)==0&&(a&r.expiredLanes)===0||Cn(r,a),m=c?YO(r,a):Xh(r,a,!0),y=c;do{if(m===0){zs&&!c&&za(r,a,0,!1);break}else{if(s=r.current.alternate,y&&!XO(s)){m=Xh(r,a,!1),y=!1;continue}if(m===2){if(y=a,r.errorRecoveryDisabledLanes&y)var C=0;else C=r.pendingLanes&-536870913,C=C===0?C&536870912?536870912:0:C;if(C!==0){a=C;e:{var R=r;m=uc;var H=R.current.memoizedState.isDehydrated;if(H&&(Vs(R,C).flags|=256),C=Xh(R,C,!1),C!==2){if(Hh&&!H){R.errorRecoveryDisabledLanes|=y,jo|=y,m=4;break e}y=ar,ar=m,y!==null&&(ar===null?ar=y:ar.push.apply(ar,y))}m=C}if(y=!1,m!==2)continue}}if(m===1){Vs(r,0),za(r,a,0,!0);break}e:{switch(c=r,y=m,y){case 0:case 1:throw Error(o(345));case 4:if((a&4194048)!==a)break;case 6:za(c,a,_r,!Ma);break e;case 2:ar=null;break;case 3:case 5:break;default:throw Error(o(329))}if((a&62914560)===a&&(m=_d+300-Yt(),10<m)){if(za(c,a,_r,!Ma),ei(c,0,!0)!==0)break e;Yi=a,c.timeoutHandle=aC(Dk.bind(null,c,s,ar,Cd,Wh,a,_r,jo,Fs,Ma,y,"Throttled",-0,0),m);break e}Dk(c,s,ar,Cd,Wh,a,_r,jo,Fs,Ma,y,null,-0,0)}}break}while(!0);Zi(r)}function Dk(r,a,s,c,m,y,C,R,H,ie,ge,ve,se,fe){if(r.timeoutHandle=-1,ve=a.subtreeFlags,ve&8192||(ve&16785408)==16785408){ve={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Nr},wk(a,y,ve);var Ae=(y&62914560)===y?_d-Yt():(y&4194048)===y?Ck-Yt():0;if(Ae=LM(ve,Ae),Ae!==null){Yi=y,r.cancelPendingCommit=Ae(Nk.bind(null,r,a,y,s,c,m,C,R,H,ge,ve,null,se,fe)),za(r,y,C,!ie);return}}Nk(r,a,y,s,c,m,C,R,H)}function XO(r){for(var a=r;;){var s=a.tag;if((s===0||s===11||s===15)&&a.flags&16384&&(s=a.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var c=0;c<s.length;c++){var m=s[c],y=m.getSnapshot;m=m.value;try{if(!yr(y(),m))return!1}catch{return!1}}if(s=a.child,a.subtreeFlags&16384&&s!==null)s.return=a,a=s;else{if(a===r)break;for(;a.sibling===null;){if(a.return===null||a.return===r)return!0;a=a.return}a.sibling.return=a.return,a=a.sibling}}return!0}function za(r,a,s,c){a&=~Bh,a&=~jo,r.suspendedLanes|=a,r.pingedLanes&=~a,c&&(r.warmLanes|=a),c=r.expirationTimes;for(var m=a;0<m;){var y=31-wt(m),C=1<<y;c[y]=-1,m&=~C}s!==0&&Wn(r,s,a)}function Sd(){return xt&6?!0:(fc(0,!1),!1)}function Gh(){if(at!==null){if(Rt===0)var r=at.return;else r=at,$i=Eo=null,dh(r),Ls=null,Ql=0,r=at;for(;r!==null;)ak(r.alternate,r),r=r.return;at=null}}function Vs(r,a){var s=r.timeoutHandle;s!==-1&&(r.timeoutHandle=-1,mM(s)),s=r.cancelPendingCommit,s!==null&&(r.cancelPendingCommit=null,s()),Yi=0,Gh(),zt=r,at=s=zi(r.current,null),lt=a,Rt=0,xr=null,Ma=!1,zs=Cn(r,a),Hh=!1,Fs=_r=Bh=jo=Na=en=0,ar=uc=null,Wh=!1,a&8&&(a|=a&32);var c=r.entangledLanes;if(c!==0)for(r=r.entanglements,c&=a;0<c;){var m=31-wt(c),y=1<<m;a|=r[m],c&=~y}return Ji=a,Uu(),s}function Rk(r,a){Ye=null,he.H=nc,a===As||a===ed?(a=Qx(),Rt=3):a===Zm?(a=Qx(),Rt=4):Rt=a===Th?8:typeof a=="object"&&a&&typeof a.then=="function"?6:1,xr=a,at===null&&(en=1,md(r,qr(a,r.current)))}function Ik(){var r=br.current;return r===null?!0:(lt&4194048)===lt?ai===null:(lt&62914560)===lt||lt&536870912?r===ai:!1}function Ak(){var r=he.H;return he.H=nc,r===null?nc:r}function Lk(){var r=he.A;return he.A=QO,r}function Ed(){en=4,Ma||(lt&4194048)!==lt&&br.current!==null||(zs=!0),!(Na&134217727)&&!(jo&134217727)||zt===null||za(zt,lt,_r,!1)}function Xh(r,a,s){var c=xt;xt|=2;var m=Ak(),y=Lk();(zt!==r||lt!==a)&&(Cd=null,Vs(r,a)),a=!1;var C=en;e:do try{if(Rt!==0&&at!==null){var R=at,H=xr;switch(Rt){case 8:Gh(),C=6;break e;case 3:case 2:case 9:case 6:br.current===null&&(a=!0);var ie=Rt;if(Rt=0,xr=null,Hs(r,R,H,ie),s&&zs){C=0;break e}break;default:ie=Rt,Rt=0,xr=null,Hs(r,R,H,ie)}}JO(),C=en;break}catch(ge){Rk(r,ge)}while(!0);return a&&r.shellSuspendCounter++,$i=Eo=null,xt=c,he.H=m,he.A=y,at===null&&(zt=null,lt=0,Uu()),C}function JO(){for(;at!==null;)Pk(at)}function YO(r,a){var s=xt;xt|=2;var c=Ak(),m=Lk();zt!==r||lt!==a?(Cd=null,kd=Yt()+500,Vs(r,a)):zs=Cn(r,a);e:do try{if(Rt!==0&&at!==null){a=at;var y=xr;t:switch(Rt){case 1:Rt=0,xr=null,Hs(r,a,y,1);break;case 2:case 9:if(Ux(y)){Rt=0,xr=null,Ok(a);break}a=function(){Rt!==2&&Rt!==9||zt!==r||(Rt=7),Zi(r)},y.then(a,a);break e;case 3:Rt=7;break e;case 4:Rt=5;break e;case 7:Ux(y)?(Rt=0,xr=null,Ok(a)):(Rt=0,xr=null,Hs(r,a,y,7));break;case 5:var C=null;switch(at.tag){case 26:C=at.memoizedState;case 5:case 27:var R=at;if(C?wC(C):R.stateNode.complete){Rt=0,xr=null;var H=R.sibling;if(H!==null)at=H;else{var ie=R.return;ie===null?at=null:(at=ie,Td(ie))}break t}}Rt=0,xr=null,Hs(r,a,y,5);break;case 6:Rt=0,xr=null,Hs(r,a,y,6);break;case 8:Gh(),en=6;break e;default:throw Error(o(462))}}ZO();break}catch(ge){Rk(r,ge)}while(!0);return $i=Eo=null,he.H=c,he.A=m,xt=s,at===null?(zt=null,lt=0,Uu(),en):0}function ZO(){for(;at!==null&&!wa();)Pk(at)}function Pk(r){var a=rk(r.alternate,r,Ji);r.memoizedProps=r.pendingProps,a===null?Td(r):at=a}function Ok(r){var a=r,s=a.alternate;switch(a.tag){case 15:case 0:a=J_(s,a,a.pendingProps,a.type,void 0,lt);break;case 11:a=J_(s,a,a.pendingProps,a.type.render,a.ref,lt);break;case 5:dh(a);default:ak(s,a),a=at=Mx(a,Ji),a=rk(s,a,Ji)}r.memoizedProps=r.pendingProps,a===null?Td(r):at=a}function Hs(r,a,s,c){$i=Eo=null,dh(a),Ls=null,Ql=0;var m=a.return;try{if($O(r,m,a,s,lt)){en=1,md(r,qr(s,r.current)),at=null;return}}catch(y){if(m!==null)throw at=m,y;en=1,md(r,qr(s,r.current)),at=null;return}a.flags&32768?(dt||c===1?r=!0:zs||lt&536870912?r=!1:(Ma=r=!0,(c===2||c===9||c===3||c===6)&&(c=br.current,c!==null&&c.tag===13&&(c.flags|=16384))),Mk(a,r)):Td(a)}function Td(r){var a=r;do{if(a.flags&32768){Mk(a,Ma);return}r=a.return;var s=BO(a.alternate,a,Ji);if(s!==null){at=s;return}if(a=a.sibling,a!==null){at=a;return}at=a=r}while(a!==null);en===0&&(en=5)}function Mk(r,a){do{var s=WO(r.alternate,r);if(s!==null){s.flags&=32767,at=s;return}if(s=r.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!a&&(r=r.sibling,r!==null)){at=r;return}at=r=s}while(r!==null);en=6,at=null}function Nk(r,a,s,c,m,y,C,R,H){r.cancelPendingCommit=null;do Dd();while(wn!==0);if(xt&6)throw Error(o(327));if(a!==null){if(a===r.current)throw Error(o(177));if(y=a.lanes|a.childLanes,y|=qm,Oi(r,s,y,C,R,H),r===zt&&(at=zt=null,lt=0),$s=a,qa=r,Yi=s,Uh=y,Kh=m,Sk=c,a.subtreeFlags&10256||a.flags&10256?(r.callbackNode=null,r.callbackPriority=0,rM(Vt,function(){return $k(),null})):(r.callbackNode=null,r.callbackPriority=0),c=(a.flags&13878)!=0,a.subtreeFlags&13878||c){c=he.T,he.T=null,m=G.p,G.p=2,C=xt,xt|=4;try{UO(r,a,s)}finally{xt=C,G.p=m,he.T=c}}wn=1,jk(),qk(),zk()}}function jk(){if(wn===1){wn=0;var r=qa,a=$s,s=(a.flags&13878)!=0;if(a.subtreeFlags&13878||s){s=he.T,he.T=null;var c=G.p;G.p=2;var m=xt;xt|=4;try{yk(a,r);var y=sg,C=Ex(r.containerInfo),R=y.focusedElem,H=y.selectionRange;if(C!==R&&R&&R.ownerDocument&&Sx(R.ownerDocument.documentElement,R)){if(H!==null&&Pm(R)){var ie=H.start,ge=H.end;if(ge===void 0&&(ge=ie),"selectionStart"in R)R.selectionStart=ie,R.selectionEnd=Math.min(ge,R.value.length);else{var ve=R.ownerDocument||document,se=ve&&ve.defaultView||window;if(se.getSelection){var fe=se.getSelection(),Ae=R.textContent.length,Ve=Math.min(H.start,Ae),Mt=H.end===void 0?Ve:Math.min(H.end,Ae);!fe.extend&&Ve>Mt&&(C=Mt,Mt=Ve,Ve=C);var K=Cx(R,Ve),B=Cx(R,Mt);if(K&&B&&(fe.rangeCount!==1||fe.anchorNode!==K.node||fe.anchorOffset!==K.offset||fe.focusNode!==B.node||fe.focusOffset!==B.offset)){var ee=ve.createRange();ee.setStart(K.node,K.offset),fe.removeAllRanges(),Ve>Mt?(fe.addRange(ee),fe.extend(B.node,B.offset)):(ee.setEnd(B.node,B.offset),fe.addRange(ee))}}}}for(ve=[],fe=R;fe=fe.parentNode;)fe.nodeType===1&&ve.push({element:fe,left:fe.scrollLeft,top:fe.scrollTop});for(typeof R.focus=="function"&&R.focus(),R=0;R<ve.length;R++){var ye=ve[R];ye.element.scrollLeft=ye.left,ye.element.scrollTop=ye.top}}Fd=!!og,sg=og=null}finally{xt=m,G.p=c,he.T=s}}r.current=a,wn=2}}function qk(){if(wn===2){wn=0;var r=qa,a=$s,s=(a.flags&8772)!=0;if(a.subtreeFlags&8772||s){s=he.T,he.T=null;var c=G.p;G.p=2;var m=xt;xt|=4;try{fk(r,a.alternate,a)}finally{xt=m,G.p=c,he.T=s}}wn=3}}function zk(){if(wn===4||wn===3){wn=0,Ii();var r=qa,a=$s,s=Yi,c=Sk;a.subtreeFlags&10256||a.flags&10256?wn=5:(wn=0,$s=qa=null,Fk(r,r.pendingLanes));var m=r.pendingLanes;if(m===0&&(ja=null),q(s),a=a.stateNode,rn&&typeof rn.onCommitFiberRoot=="function")try{rn.onCommitFiberRoot(Or,a,void 0,(a.current.flags&128)==128)}catch{}if(c!==null){a=he.T,m=G.p,G.p=2,he.T=null;try{for(var y=r.onRecoverableError,C=0;C<c.length;C++){var R=c[C];y(R.value,{componentStack:R.stack})}}finally{he.T=a,G.p=m}}Yi&3&&Dd(),Zi(r),m=r.pendingLanes,s&261930&&m&42?r===Qh?dc++:(dc=0,Qh=r):dc=0,fc(0,!1)}}function Fk(r,a){(r.pooledCacheLanes&=a)===0&&(a=r.pooledCache,a!=null&&(r.pooledCache=null,Ul(a)))}function Dd(){return jk(),qk(),zk(),$k()}function $k(){if(wn!==5)return!1;var r=qa,a=Uh;Uh=0;var s=q(Yi),c=he.T,m=G.p;try{G.p=32>s?32:s,he.T=null,s=Kh,Kh=null;var y=qa,C=Yi;if(wn=0,$s=qa=null,Yi=0,xt&6)throw Error(o(331));var R=xt;if(xt|=4,_k(y.current),bk(y,y.current,C,s),xt=R,fc(0,!1),rn&&typeof rn.onPostCommitFiberRoot=="function")try{rn.onPostCommitFiberRoot(Or,y)}catch{}return!0}finally{G.p=m,he.T=c,Fk(r,a)}}function Vk(r,a,s){a=qr(s,a),a=Eh(r.stateNode,a,2),r=Po(r,a,2),r!==null&&(zn(r,2),Zi(r))}function It(r,a,s){if(r.tag===3)Vk(r,r,s);else for(;a!==null;){if(a.tag===3){Vk(a,r,s);break}else if(a.tag===1){var c=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(ja===null||!ja.has(c))){r=qr(s,r),s=H_(2),c=Po(a,s,2),c!==null&&(B_(s,c,a,r),zn(c,2),Zi(c));break}}a=a.return}}function Jh(r,a,s){var c=r.pingCache;if(c===null){c=r.pingCache=new GO;var m=new Set;c.set(a,m)}else m=c.get(a),m===void 0&&(m=new Set,c.set(a,m));m.has(s)||(Hh=!0,m.add(s),r=eM.bind(null,r,a,s),a.then(r,r))}function eM(r,a,s){var c=r.pingCache;c!==null&&c.delete(a),r.pingedLanes|=r.suspendedLanes&s,r.warmLanes&=~s,zt===r&&(lt&s)===s&&(en===4||en===3&&(lt&62914560)===lt&&300>Yt()-_d?!(xt&2)&&Vs(r,0):Bh|=s,Fs===lt&&(Fs=0)),Zi(r)}function Hk(r,a){a===0&&(a=Pi()),r=ko(r,a),r!==null&&(zn(r,a),Zi(r))}function tM(r){var a=r.memoizedState,s=0;a!==null&&(s=a.retryLane),Hk(r,s)}function nM(r,a){var s=0;switch(r.tag){case 31:case 13:var c=r.stateNode,m=r.memoizedState;m!==null&&(s=m.retryLane);break;case 19:c=r.stateNode;break;case 22:c=r.stateNode._retryCache;break;default:throw Error(o(314))}c!==null&&c.delete(a),Hk(r,s)}function rM(r,a){return jn(r,a)}var Rd=null,Bs=null,Yh=!1,Id=!1,Zh=!1,Fa=0;function Zi(r){r!==Bs&&r.next===null&&(Bs===null?Rd=Bs=r:Bs=Bs.next=r),Id=!0,Yh||(Yh=!0,aM())}function fc(r,a){if(!Zh&&Id){Zh=!0;do for(var s=!1,c=Rd;c!==null;){if(!a)if(r!==0){var m=c.pendingLanes;if(m===0)var y=0;else{var C=c.suspendedLanes,R=c.pingedLanes;y=(1<<31-wt(42|r)+1)-1,y&=m&~(C&~R),y=y&201326741?y&201326741|1:y?y|2:0}y!==0&&(s=!0,Kk(c,y))}else y=lt,y=ei(c,c===zt?y:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),!(y&3)||Cn(c,y)||(s=!0,Kk(c,y));c=c.next}while(s);Zh=!1}}function iM(){Bk()}function Bk(){Id=Yh=!1;var r=0;Fa!==0&&pM()&&(r=Fa);for(var a=Yt(),s=null,c=Rd;c!==null;){var m=c.next,y=Wk(c,a);y===0?(c.next=null,s===null?Rd=m:s.next=m,m===null&&(Bs=s)):(s=c,(r!==0||y&3)&&(Id=!0)),c=m}wn!==0&&wn!==5||fc(r,!1),Fa!==0&&(Fa=0)}function Wk(r,a){for(var s=r.suspendedLanes,c=r.pingedLanes,m=r.expirationTimes,y=r.pendingLanes&-62914561;0<y;){var C=31-wt(y),R=1<<C,H=m[C];H===-1?((R&s)===0||(R&c)!==0)&&(m[C]=pr(R,a)):H<=a&&(r.expiredLanes|=R),y&=~R}if(a=zt,s=lt,s=ei(r,r===a?s:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),c=r.callbackNode,s===0||r===a&&(Rt===2||Rt===9)||r.cancelPendingCommit!==null)return c!==null&&c!==null&&yn(c),r.callbackNode=null,r.callbackPriority=0;if(!(s&3)||Cn(r,s)){if(a=s&-s,a===r.callbackPriority)return a;switch(c!==null&&yn(c),q(s)){case 2:case 8:s=hi;break;case 32:s=Vt;break;case 268435456:s=St;break;default:s=Vt}return c=Uk.bind(null,r),s=jn(s,c),r.callbackPriority=a,r.callbackNode=s,a}return c!==null&&c!==null&&yn(c),r.callbackPriority=2,r.callbackNode=null,2}function Uk(r,a){if(wn!==0&&wn!==5)return r.callbackNode=null,r.callbackPriority=0,null;var s=r.callbackNode;if(Dd()&&r.callbackNode!==s)return null;var c=lt;return c=ei(r,r===zt?c:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),c===0?null:(Tk(r,c,a),Wk(r,Yt()),r.callbackNode!=null&&r.callbackNode===s?Uk.bind(null,r):null)}function Kk(r,a){if(Dd())return null;Tk(r,a,!0)}function aM(){hM(function(){xt&6?jn(vn,iM):Bk()})}function eg(){if(Fa===0){var r=Rs;r===0&&(r=Mr,Mr<<=1,!(Mr&261888)&&(Mr=256)),Fa=r}return Fa}function Qk(r){return r==null||typeof r=="symbol"||typeof r=="boolean"?null:typeof r=="function"?r:ys(""+r)}function Gk(r,a){var s=a.ownerDocument.createElement("input");return s.name=a.name,s.value=a.value,r.id&&s.setAttribute("form",r.id),a.parentNode.insertBefore(s,a),r=new FormData(r),s.parentNode.removeChild(s),r}function oM(r,a,s,c,m){if(a==="submit"&&s&&s.stateNode===m){var y=Qk((m[Ke]||null).action),C=c.submitter;C&&(a=(a=C[Ke]||null)?Qk(a.formAction):C.getAttribute("formAction"),a!==null&&(y=a,C=null));var R=new f("action","action",null,c,m);r.push({event:R,listeners:[{instance:null,listener:function(){if(c.defaultPrevented){if(Fa!==0){var H=C?Gk(m,C):new FormData(m);wh(s,{pending:!0,data:H,method:m.method,action:y},null,H)}}else typeof y=="function"&&(R.preventDefault(),H=C?Gk(m,C):new FormData(m),wh(s,{pending:!0,data:H,method:m.method,action:y},y,H))},currentTarget:m}]})}}for(var tg=0;tg<jm.length;tg++){var ng=jm[tg];ii(ng.toLowerCase(),"on"+(ng[0].toUpperCase()+ng.slice(1)))}ii(Rx,"onAnimationEnd"),ii(Ix,"onAnimationIteration"),ii(Ax,"onAnimationStart"),ii("dblclick","onDoubleClick"),ii("focusin","onFocus"),ii("focusout","onBlur"),ii(xO,"onTransitionRun"),ii(_O,"onTransitionStart"),ii(kO,"onTransitionCancel"),ii(Lx,"onTransitionEnd"),ka("onMouseEnter",["mouseout","mouseover"]),ka("onMouseLeave",["mouseout","mouseover"]),ka("onPointerEnter",["pointerout","pointerover"]),ka("onPointerLeave",["pointerout","pointerover"]),vi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),vi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),vi("onBeforeInput",["compositionend","keypress","textInput","paste"]),vi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),vi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),vi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var pc="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(" "),sM=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(pc));function Xk(r,a){a=(a&4)!=0;for(var s=0;s<r.length;s++){var c=r[s],m=c.event;c=c.listeners;e:{var y=void 0;if(a)for(var C=c.length-1;0<=C;C--){var R=c[C],H=R.instance,ie=R.currentTarget;if(R=R.listener,H!==y&&m.isPropagationStopped())break e;y=R,m.currentTarget=ie;try{y(m)}catch(ge){Wu(ge)}m.currentTarget=null,y=H}else for(C=0;C<c.length;C++){if(R=c[C],H=R.instance,ie=R.currentTarget,R=R.listener,H!==y&&m.isPropagationStopped())break e;y=R,m.currentTarget=ie;try{y(m)}catch(ge){Wu(ge)}m.currentTarget=null,y=H}}}}function ot(r,a){var s=a[Nt];s===void 0&&(s=a[Nt]=new Set);var c=r+"__bubble";s.has(c)||(Yk(a,r,2,!1),s.add(c))}function rg(r,a,s){var c=0;a&&(c|=4),Yk(s,r,c,a)}var Ad="_reactListening"+Math.random().toString(36).slice(2);function Jk(r){if(!r[Ad]){r[Ad]=!0,Ll.forEach(function(s){s!=="selectionchange"&&(sM.has(s)||rg(s,!1,r),rg(s,!0,r))});var a=r.nodeType===9?r:r.ownerDocument;a===null||a[Ad]||(a[Ad]=!0,rg("selectionchange",!1,a))}}function Yk(r,a,s,c){switch(SC(a)){case 2:var m=jM;break;case 8:m=qM;break;default:m=vg}s=m.bind(null,a,s,r),m=void 0,!jl||a!=="touchstart"&&a!=="touchmove"&&a!=="wheel"||(m=!0),c?m===void 0?r.addEventListener(a,s,!0):r.addEventListener(a,s,{capture:!0,passive:m}):m===void 0?r.addEventListener(a,s,!1):r.addEventListener(a,s,{passive:m})}function ig(r,a,s,c,m){var y=c;if(!(a&1)&&!(a&2)&&c!==null)e:for(;;){if(c===null)return;var C=c.tag;if(C===3||C===4){var R=c.stateNode.containerInfo;if(R===m)break;if(C===4)for(C=c.return;C!==null;){var H=C.tag;if((H===3||H===4)&&C.stateNode.containerInfo===m)return;C=C.return}for(;R!==null;){if(C=hr(R),C===null)return;if(H=C.tag,H===5||H===6||H===26||H===27){c=y=C;continue e}R=R.parentNode}}c=c.return}$u(function(){var ie=y,ge=Ml(s),ve=[];e:{var se=Px.get(r);if(se!==void 0){var fe=f,Ae=r;switch(r){case"keypress":if(vo(s)===0)break e;case"keydown":case"keyup":fe=Ie;break;case"focusin":Ae="focus",fe=F;break;case"focusout":Ae="blur",fe=F;break;case"beforeblur":case"afterblur":fe=F;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":fe=I;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":fe=L;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":fe=ht;break;case Rx:case Ix:case Ax:fe=N;break;case Lx:fe=tt;break;case"scroll":case"scrollend":fe=v;break;case"wheel":fe=qt;break;case"copy":case"cut":case"paste":fe=le;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":fe=$e;break;case"toggle":case"beforetoggle":fe=Ht}var Ve=(a&4)!=0,Mt=!Ve&&(r==="scroll"||r==="scrollend"),K=Ve?se===null?null:se+"Capture":se;Ve=[];for(var B=ie,ee;B!==null;){var ye=B;if(ee=ye.stateNode,ye=ye.tag,ye!==5&&ye!==26&&ye!==27||ee===null||K===null||(ye=ho(B,K),ye!=null&&Ve.push(mc(B,ye,ee))),Mt)break;B=B.return}0<Ve.length&&(se=new fe(se,Ae,null,s,ge),ve.push({event:se,listeners:Ve}))}}if(!(a&7)){e:{if(se=r==="mouseover"||r==="pointerover",fe=r==="mouseout"||r==="pointerout",se&&s!==En&&(Ae=s.relatedTarget||s.fromElement)&&(hr(Ae)||Ae[ut]))break e;if((fe||se)&&(se=ge.window===ge?ge:(se=ge.ownerDocument)?se.defaultView||se.parentWindow:window,fe?(Ae=s.relatedTarget||s.toElement,fe=ie,Ae=Ae?hr(Ae):null,Ae!==null&&(Mt=u(Ae),Ve=Ae.tag,Ae!==Mt||Ve!==5&&Ve!==27&&Ve!==6)&&(Ae=null)):(fe=null,Ae=ie),fe!==Ae)){if(Ve=I,ye="onMouseLeave",K="onMouseEnter",B="mouse",(r==="pointerout"||r==="pointerover")&&(Ve=$e,ye="onPointerLeave",K="onPointerEnter",B="pointer"),Mt=fe==null?se:Un(fe),ee=Ae==null?se:Un(Ae),se=new Ve(ye,B+"leave",fe,s,ge),se.target=Mt,se.relatedTarget=ee,ye=null,hr(ge)===ie&&(Ve=new Ve(K,B+"enter",Ae,s,ge),Ve.target=ee,Ve.relatedTarget=Mt,ye=Ve),Mt=ye,fe&&Ae)t:{for(Ve=lM,K=fe,B=Ae,ee=0,ye=K;ye;ye=Ve(ye))ee++;ye=0;for(var ze=B;ze;ze=Ve(ze))ye++;for(;0<ee-ye;)K=Ve(K),ee--;for(;0<ye-ee;)B=Ve(B),ye--;for(;ee--;){if(K===B||B!==null&&K===B.alternate){Ve=K;break t}K=Ve(K),B=Ve(B)}Ve=null}else Ve=null;fe!==null&&Zk(ve,se,fe,Ve,!1),Ae!==null&&Mt!==null&&Zk(ve,Mt,Ae,Ve,!0)}}e:{if(se=ie?Un(ie):window,fe=se.nodeName&&se.nodeName.toLowerCase(),fe==="select"||fe==="input"&&se.type==="file")var _t=vx;else if(gx(se))if(bx)_t=vO;else{_t=gO;var Le=hO}else fe=se.nodeName,!fe||fe.toLowerCase()!=="input"||se.type!=="checkbox"&&se.type!=="radio"?ie&&mo(ie.elementType)&&(_t=vx):_t=yO;if(_t&&(_t=_t(r,ie))){yx(ve,_t,s,ge);break e}Le&&Le(r,se,ie),r==="focusout"&&ie&&se.type==="number"&&ie.memoizedProps.value!=null&&Mi(se,"number",se.value)}switch(Le=ie?Un(ie):window,r){case"focusin":(gx(Le)||Le.contentEditable==="true")&&(xs=Le,Om=ie,Hl=null);break;case"focusout":Hl=Om=xs=null;break;case"mousedown":Mm=!0;break;case"contextmenu":case"mouseup":case"dragend":Mm=!1,Tx(ve,s,ge);break;case"selectionchange":if(wO)break;case"keydown":case"keyup":Tx(ve,s,ge)}var Ze;if(Ge)e:{switch(r){case"compositionstart":var ct="onCompositionStart";break e;case"compositionend":ct="onCompositionEnd";break e;case"compositionupdate":ct="onCompositionUpdate";break e}ct=void 0}else ws?Hu(r,s)&&(ct="onCompositionEnd"):r==="keydown"&&s.keyCode===229&&(ct="onCompositionStart");ct&&(bn&&s.locale!=="ko"&&(ws||ct!=="onCompositionStart"?ct==="onCompositionEnd"&&ws&&(Ze=ql()):(ri=ge,vs="value"in ri?ri.value:ri.textContent,ws=!0)),Le=Ld(ie,ct),0<Le.length&&(ct=new oe(ct,r,null,s,ge),ve.push({event:ct,listeners:Le}),Ze?ct.data=Ze:(Ze=bs(s),Ze!==null&&(ct.data=Ze)))),(Ze=dn?dO(r,s):fO(r,s))&&(ct=Ld(ie,"onBeforeInput"),0<ct.length&&(Le=new oe("onBeforeInput","beforeinput",null,s,ge),ve.push({event:Le,listeners:ct}),Le.data=Ze)),oM(ve,r,ie,s,ge)}Xk(ve,a)})}function mc(r,a,s){return{instance:r,listener:a,currentTarget:s}}function Ld(r,a){for(var s=a+"Capture",c=[];r!==null;){var m=r,y=m.stateNode;if(m=m.tag,m!==5&&m!==26&&m!==27||y===null||(m=ho(r,s),m!=null&&c.unshift(mc(r,m,y)),m=ho(r,a),m!=null&&c.push(mc(r,m,y))),r.tag===3)return c;r=r.return}return[]}function lM(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5&&r.tag!==27);return r||null}function Zk(r,a,s,c,m){for(var y=a._reactName,C=[];s!==null&&s!==c;){var R=s,H=R.alternate,ie=R.stateNode;if(R=R.tag,H!==null&&H===c)break;R!==5&&R!==26&&R!==27||ie===null||(H=ie,m?(ie=ho(s,y),ie!=null&&C.unshift(mc(s,ie,H))):m||(ie=ho(s,y),ie!=null&&C.push(mc(s,ie,H)))),s=s.return}C.length!==0&&r.push({event:a,listeners:C})}var cM=/\r\n?/g,uM=/\u0000|\uFFFD/g;function eC(r){return(typeof r=="string"?r:""+r).replace(cM,`
|
|
10
|
-
`).replace(uM,"")}function tC(r,a){return a=eC(a),eC(r)===a}function Ot(r,a,s,c,m,y){switch(s){case"children":typeof c=="string"?a==="body"||a==="textarea"&&c===""||Ni(r,c):(typeof c=="number"||typeof c=="bigint")&&a!=="body"&&Ni(r,""+c);break;case"className":po(r,"class",c);break;case"tabIndex":po(r,"tabindex",c);break;case"dir":case"role":case"viewBox":case"width":case"height":po(r,s,c);break;case"style":qu(r,c,y);break;case"data":if(a!=="object"){po(r,"data",c);break}case"src":case"href":if(c===""&&(a!=="a"||s!=="href")){r.removeAttribute(s);break}if(c==null||typeof c=="function"||typeof c=="symbol"||typeof c=="boolean"){r.removeAttribute(s);break}c=ys(""+c),r.setAttribute(s,c);break;case"action":case"formAction":if(typeof c=="function"){r.setAttribute(s,"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 y=="function"&&(s==="formAction"?(a!=="input"&&Ot(r,a,"name",m.name,m,null),Ot(r,a,"formEncType",m.formEncType,m,null),Ot(r,a,"formMethod",m.formMethod,m,null),Ot(r,a,"formTarget",m.formTarget,m,null)):(Ot(r,a,"encType",m.encType,m,null),Ot(r,a,"method",m.method,m,null),Ot(r,a,"target",m.target,m,null)));if(c==null||typeof c=="symbol"||typeof c=="boolean"){r.removeAttribute(s);break}c=ys(""+c),r.setAttribute(s,c);break;case"onClick":c!=null&&(r.onclick=Nr);break;case"onScroll":c!=null&&ot("scroll",r);break;case"onScrollEnd":c!=null&&ot("scrollend",r);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(o(61));if(s=c.__html,s!=null){if(m.children!=null)throw Error(o(60));r.innerHTML=s}}break;case"multiple":r.multiple=c&&typeof c!="function"&&typeof c!="symbol";break;case"muted":r.muted=c&&typeof c!="function"&&typeof c!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(c==null||typeof c=="function"||typeof c=="boolean"||typeof c=="symbol"){r.removeAttribute("xlink:href");break}s=ys(""+c),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":c!=null&&typeof c!="function"&&typeof c!="symbol"?r.setAttribute(s,""+c):r.removeAttribute(s);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":c&&typeof c!="function"&&typeof c!="symbol"?r.setAttribute(s,""):r.removeAttribute(s);break;case"capture":case"download":c===!0?r.setAttribute(s,""):c!==!1&&c!=null&&typeof c!="function"&&typeof c!="symbol"?r.setAttribute(s,c):r.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":c!=null&&typeof c!="function"&&typeof c!="symbol"&&!isNaN(c)&&1<=c?r.setAttribute(s,c):r.removeAttribute(s);break;case"rowSpan":case"start":c==null||typeof c=="function"||typeof c=="symbol"||isNaN(c)?r.removeAttribute(s):r.setAttribute(s,c);break;case"popover":ot("beforetoggle",r),ot("toggle",r),fo(r,"popover",c);break;case"xlinkActuate":ti(r,"http://www.w3.org/1999/xlink","xlink:actuate",c);break;case"xlinkArcrole":ti(r,"http://www.w3.org/1999/xlink","xlink:arcrole",c);break;case"xlinkRole":ti(r,"http://www.w3.org/1999/xlink","xlink:role",c);break;case"xlinkShow":ti(r,"http://www.w3.org/1999/xlink","xlink:show",c);break;case"xlinkTitle":ti(r,"http://www.w3.org/1999/xlink","xlink:title",c);break;case"xlinkType":ti(r,"http://www.w3.org/1999/xlink","xlink:type",c);break;case"xmlBase":ti(r,"http://www.w3.org/XML/1998/namespace","xml:base",c);break;case"xmlLang":ti(r,"http://www.w3.org/XML/1998/namespace","xml:lang",c);break;case"xmlSpace":ti(r,"http://www.w3.org/XML/1998/namespace","xml:space",c);break;case"is":fo(r,"is",c);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=gs.get(s)||s,fo(r,s,c))}}function ag(r,a,s,c,m,y){switch(s){case"style":qu(r,c,y);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(o(61));if(s=c.__html,s!=null){if(m.children!=null)throw Error(o(60));r.innerHTML=s}}break;case"children":typeof c=="string"?Ni(r,c):(typeof c=="number"||typeof c=="bigint")&&Ni(r,""+c);break;case"onScroll":c!=null&&ot("scroll",r);break;case"onScrollEnd":c!=null&&ot("scrollend",r);break;case"onClick":c!=null&&(r.onclick=Nr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Pu.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(m=s.endsWith("Capture"),a=s.slice(2,m?s.length-7:void 0),y=r[Ke]||null,y=y==null?null:y[s],typeof y=="function"&&r.removeEventListener(a,y,m),typeof c=="function")){typeof y!="function"&&y!==null&&(s in r?r[s]=null:r.hasAttribute(s)&&r.removeAttribute(s)),r.addEventListener(a,c,m);break e}s in r?r[s]=c:c===!0?r.setAttribute(s,""):fo(r,s,c)}}}function Ln(r,a,s){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ot("error",r),ot("load",r);var c=!1,m=!1,y;for(y in s)if(s.hasOwnProperty(y)){var C=s[y];if(C!=null)switch(y){case"src":c=!0;break;case"srcSet":m=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,a));default:Ot(r,a,y,C,s,null)}}m&&Ot(r,a,"srcSet",s.srcSet,s,null),c&&Ot(r,a,"src",s.src,s,null);return;case"input":ot("invalid",r);var R=y=C=m=null,H=null,ie=null;for(c in s)if(s.hasOwnProperty(c)){var ge=s[c];if(ge!=null)switch(c){case"name":m=ge;break;case"type":C=ge;break;case"checked":H=ge;break;case"defaultChecked":ie=ge;break;case"value":y=ge;break;case"defaultValue":R=ge;break;case"children":case"dangerouslySetInnerHTML":if(ge!=null)throw Error(o(137,a));break;default:Ot(r,a,c,ge,s,null)}}ju(r,y,R,H,ie,C,m,!1);return;case"select":for(m in ot("invalid",r),c=C=y=null,s)if(s.hasOwnProperty(m)&&(R=s[m],R!=null))switch(m){case"value":y=R;break;case"defaultValue":C=R;break;case"multiple":c=R;default:Ot(r,a,m,R,s,null)}a=y,s=C,r.multiple=!!c,a==null?s!=null&&Sa(r,!!c,s,!0):Sa(r,!!c,a,!1);return;case"textarea":for(C in ot("invalid",r),y=m=c=null,s)if(s.hasOwnProperty(C)&&(R=s[C],R!=null))switch(C){case"value":c=R;break;case"defaultValue":m=R;break;case"children":y=R;break;case"dangerouslySetInnerHTML":if(R!=null)throw Error(o(91));break;default:Ot(r,a,C,R,s,null)}hs(r,c,m,y);return;case"option":for(H in s)s.hasOwnProperty(H)&&(c=s[H],c!=null)&&(H==="selected"?r.selected=c&&typeof c!="function"&&typeof c!="symbol":Ot(r,a,H,c,s,null));return;case"dialog":ot("beforetoggle",r),ot("toggle",r),ot("cancel",r),ot("close",r);break;case"iframe":case"object":ot("load",r);break;case"video":case"audio":for(c=0;c<pc.length;c++)ot(pc[c],r);break;case"image":ot("error",r),ot("load",r);break;case"details":ot("toggle",r);break;case"embed":case"source":case"link":ot("error",r),ot("load",r);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ie in s)if(s.hasOwnProperty(ie)&&(c=s[ie],c!=null))switch(ie){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,a));default:Ot(r,a,ie,c,s,null)}return;default:if(mo(a)){for(ge in s)s.hasOwnProperty(ge)&&(c=s[ge],c!==void 0&&ag(r,a,ge,c,s,void 0));return}}for(R in s)s.hasOwnProperty(R)&&(c=s[R],c!=null&&Ot(r,a,R,c,s,null))}function dM(r,a,s,c){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var m=null,y=null,C=null,R=null,H=null,ie=null,ge=null;for(fe in s){var ve=s[fe];if(s.hasOwnProperty(fe)&&ve!=null)switch(fe){case"checked":break;case"value":break;case"defaultValue":H=ve;default:c.hasOwnProperty(fe)||Ot(r,a,fe,null,c,ve)}}for(var se in c){var fe=c[se];if(ve=s[se],c.hasOwnProperty(se)&&(fe!=null||ve!=null))switch(se){case"type":y=fe;break;case"name":m=fe;break;case"checked":ie=fe;break;case"defaultChecked":ge=fe;break;case"value":C=fe;break;case"defaultValue":R=fe;break;case"children":case"dangerouslySetInnerHTML":if(fe!=null)throw Error(o(137,a));break;default:fe!==ve&&Ot(r,a,se,fe,c,ve)}}Ca(r,C,R,H,ie,ge,y,m);return;case"select":for(y in fe=C=R=se=null,s)if(H=s[y],s.hasOwnProperty(y)&&H!=null)switch(y){case"value":break;case"multiple":fe=H;default:c.hasOwnProperty(y)||Ot(r,a,y,null,c,H)}for(m in c)if(y=c[m],H=s[m],c.hasOwnProperty(m)&&(y!=null||H!=null))switch(m){case"value":se=y;break;case"defaultValue":R=y;break;case"multiple":C=y;default:y!==H&&Ot(r,a,m,y,c,H)}a=R,s=C,c=fe,se==null?!!c!=!!s&&(a==null?Sa(r,!!s,s?[]:"",!1):Sa(r,!!s,a,!0)):Sa(r,!!s,se,!1);return;case"textarea":for(R in fe=se=null,s)if(m=s[R],s.hasOwnProperty(R)&&m!=null&&!c.hasOwnProperty(R))switch(R){case"value":break;case"children":break;default:Ot(r,a,R,null,c,m)}for(C in c)if(m=c[C],y=s[C],c.hasOwnProperty(C)&&(m!=null||y!=null))switch(C){case"value":se=m;break;case"defaultValue":fe=m;break;case"children":break;case"dangerouslySetInnerHTML":if(m!=null)throw Error(o(91));break;default:m!==y&&Ot(r,a,C,m,c,y)}Ea(r,se,fe);return;case"option":for(var Ae in s)se=s[Ae],s.hasOwnProperty(Ae)&&se!=null&&!c.hasOwnProperty(Ae)&&(Ae==="selected"?r.selected=!1:Ot(r,a,Ae,null,c,se));for(H in c)se=c[H],fe=s[H],c.hasOwnProperty(H)&&se!==fe&&(se!=null||fe!=null)&&(H==="selected"?r.selected=se&&typeof se!="function"&&typeof se!="symbol":Ot(r,a,H,se,c,fe));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 Ve in s)se=s[Ve],s.hasOwnProperty(Ve)&&se!=null&&!c.hasOwnProperty(Ve)&&Ot(r,a,Ve,null,c,se);for(ie in c)if(se=c[ie],fe=s[ie],c.hasOwnProperty(ie)&&se!==fe&&(se!=null||fe!=null))switch(ie){case"children":case"dangerouslySetInnerHTML":if(se!=null)throw Error(o(137,a));break;default:Ot(r,a,ie,se,c,fe)}return;default:if(mo(a)){for(var Mt in s)se=s[Mt],s.hasOwnProperty(Mt)&&se!==void 0&&!c.hasOwnProperty(Mt)&&ag(r,a,Mt,void 0,c,se);for(ge in c)se=c[ge],fe=s[ge],!c.hasOwnProperty(ge)||se===fe||se===void 0&&fe===void 0||ag(r,a,ge,se,c,fe);return}}for(var K in s)se=s[K],s.hasOwnProperty(K)&&se!=null&&!c.hasOwnProperty(K)&&Ot(r,a,K,null,c,se);for(ve in c)se=c[ve],fe=s[ve],!c.hasOwnProperty(ve)||se===fe||se==null&&fe==null||Ot(r,a,ve,se,c,fe)}function nC(r){switch(r){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function fM(){if(typeof performance.getEntriesByType=="function"){for(var r=0,a=0,s=performance.getEntriesByType("resource"),c=0;c<s.length;c++){var m=s[c],y=m.transferSize,C=m.initiatorType,R=m.duration;if(y&&R&&nC(C)){for(C=0,R=m.responseEnd,c+=1;c<s.length;c++){var H=s[c],ie=H.startTime;if(ie>R)break;var ge=H.transferSize,ve=H.initiatorType;ge&&nC(ve)&&(H=H.responseEnd,C+=ge*(H<R?1:(R-ie)/(H-ie)))}if(--c,a+=8*(y+C)/(m.duration/1e3),r++,10<r)break}}if(0<r)return a/r/1e6}return navigator.connection&&(r=navigator.connection.downlink,typeof r=="number")?r:5}var og=null,sg=null;function Pd(r){return r.nodeType===9?r:r.ownerDocument}function rC(r){switch(r){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function iC(r,a){if(r===0)switch(a){case"svg":return 1;case"math":return 2;default:return 0}return r===1&&a==="foreignObject"?0:r}function lg(r,a){return r==="textarea"||r==="noscript"||typeof a.children=="string"||typeof a.children=="number"||typeof a.children=="bigint"||typeof a.dangerouslySetInnerHTML=="object"&&a.dangerouslySetInnerHTML!==null&&a.dangerouslySetInnerHTML.__html!=null}var cg=null;function pM(){var r=window.event;return r&&r.type==="popstate"?r===cg?!1:(cg=r,!0):(cg=null,!1)}var aC=typeof setTimeout=="function"?setTimeout:void 0,mM=typeof clearTimeout=="function"?clearTimeout:void 0,oC=typeof Promise=="function"?Promise:void 0,hM=typeof queueMicrotask=="function"?queueMicrotask:oC===void 0?aC:function(r){return oC.resolve(null).then(r).catch(gM)};function gM(r){setTimeout(function(){throw r})}function $a(r){return r==="head"}function sC(r,a){var s=a,c=0;do{var m=s.nextSibling;if(r.removeChild(s),m&&m.nodeType===8)if(s=m.data,s==="/$"||s==="/&"){if(c===0){r.removeChild(m),Qs(a);return}c--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")c++;else if(s==="html")hc(r.ownerDocument.documentElement);else if(s==="head"){s=r.ownerDocument.head,hc(s);for(var y=s.firstChild;y;){var C=y.nextSibling,R=y.nodeName;y[mt]||R==="SCRIPT"||R==="STYLE"||R==="LINK"&&y.rel.toLowerCase()==="stylesheet"||s.removeChild(y),y=C}}else s==="body"&&hc(r.ownerDocument.body);s=m}while(s);Qs(a)}function lC(r,a){var s=r;r=0;do{var c=s.nextSibling;if(s.nodeType===1?a?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(a?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),c&&c.nodeType===8)if(s=c.data,s==="/$"){if(r===0)break;r--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||r++;s=c}while(s)}function ug(r){var a=r.firstChild;for(a&&a.nodeType===10&&(a=a.nextSibling);a;){var s=a;switch(a=a.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":ug(s),Sn(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}r.removeChild(s)}}function yM(r,a,s,c){for(;r.nodeType===1;){var m=s;if(r.nodeName.toLowerCase()!==a.toLowerCase()){if(!c&&(r.nodeName!=="INPUT"||r.type!=="hidden"))break}else if(c){if(!r[mt])switch(a){case"meta":if(!r.hasAttribute("itemprop"))break;return r;case"link":if(y=r.getAttribute("rel"),y==="stylesheet"&&r.hasAttribute("data-precedence")||y!==m.rel||r.getAttribute("href")!==(m.href==null||m.href===""?null:m.href)||r.getAttribute("crossorigin")!==(m.crossOrigin==null?null:m.crossOrigin)||r.getAttribute("title")!==(m.title==null?null:m.title))break;return r;case"style":if(r.hasAttribute("data-precedence"))break;return r;case"script":if(y=r.getAttribute("src"),(y!==(m.src==null?null:m.src)||r.getAttribute("type")!==(m.type==null?null:m.type)||r.getAttribute("crossorigin")!==(m.crossOrigin==null?null:m.crossOrigin))&&y&&r.hasAttribute("async")&&!r.hasAttribute("itemprop"))break;return r;default:return r}}else if(a==="input"&&r.type==="hidden"){var y=m.name==null?null:""+m.name;if(m.type==="hidden"&&r.getAttribute("name")===y)return r}else return r;if(r=Hr(r.nextSibling),r===null)break}return null}function vM(r,a,s){if(a==="")return null;for(;r.nodeType!==3;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!s||(r=Hr(r.nextSibling),r===null))return null;return r}function cC(r,a){for(;r.nodeType!==8;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!a||(r=Hr(r.nextSibling),r===null))return null;return r}function dg(r){return r.data==="$?"||r.data==="$~"}function fg(r){return r.data==="$!"||r.data==="$?"&&r.ownerDocument.readyState!=="loading"}function bM(r,a){var s=r.ownerDocument;if(r.data==="$~")r._reactRetry=a;else if(r.data!=="$?"||s.readyState!=="loading")a();else{var c=function(){a(),s.removeEventListener("DOMContentLoaded",c)};s.addEventListener("DOMContentLoaded",c),r._reactRetry=c}}function Hr(r){for(;r!=null;r=r.nextSibling){var a=r.nodeType;if(a===1||a===3)break;if(a===8){if(a=r.data,a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"||a==="F!"||a==="F")break;if(a==="/$"||a==="/&")return null}}return r}var pg=null;function uC(r){r=r.nextSibling;for(var a=0;r;){if(r.nodeType===8){var s=r.data;if(s==="/$"||s==="/&"){if(a===0)return Hr(r.nextSibling);a--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||a++}r=r.nextSibling}return null}function dC(r){r=r.previousSibling;for(var a=0;r;){if(r.nodeType===8){var s=r.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(a===0)return r;a--}else s!=="/$"&&s!=="/&"||a++}r=r.previousSibling}return null}function fC(r,a,s){switch(a=Pd(s),r){case"html":if(r=a.documentElement,!r)throw Error(o(452));return r;case"head":if(r=a.head,!r)throw Error(o(453));return r;case"body":if(r=a.body,!r)throw Error(o(454));return r;default:throw Error(o(451))}}function hc(r){for(var a=r.attributes;a.length;)r.removeAttributeNode(a[0]);Sn(r)}var Br=new Map,pC=new Set;function Od(r){return typeof r.getRootNode=="function"?r.getRootNode():r.nodeType===9?r:r.ownerDocument}var ea=G.d;G.d={f:wM,r:xM,D:_M,C:kM,L:CM,m:SM,X:TM,S:EM,M:DM};function wM(){var r=ea.f(),a=Sd();return r||a}function xM(r){var a=yi(r);a!==null&&a.tag===5&&a.type==="form"?L_(a):ea.r(r)}var Ws=typeof document>"u"?null:document;function mC(r,a,s){var c=Ws;if(c&&typeof a=="string"&&a){var m=gr(a);m='link[rel="'+r+'"][href="'+m+'"]',typeof s=="string"&&(m+='[crossorigin="'+s+'"]'),pC.has(m)||(pC.add(m),r={rel:r,crossOrigin:s,href:a},c.querySelector(m)===null&&(a=c.createElement("link"),Ln(a,"link",r),an(a),c.head.appendChild(a)))}}function _M(r){ea.D(r),mC("dns-prefetch",r,null)}function kM(r,a){ea.C(r,a),mC("preconnect",r,a)}function CM(r,a,s){ea.L(r,a,s);var c=Ws;if(c&&r&&a){var m='link[rel="preload"][as="'+gr(a)+'"]';a==="image"&&s&&s.imageSrcSet?(m+='[imagesrcset="'+gr(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(m+='[imagesizes="'+gr(s.imageSizes)+'"]')):m+='[href="'+gr(r)+'"]';var y=m;switch(a){case"style":y=Us(r);break;case"script":y=Ks(r)}Br.has(y)||(r=S({rel:"preload",href:a==="image"&&s&&s.imageSrcSet?void 0:r,as:a},s),Br.set(y,r),c.querySelector(m)!==null||a==="style"&&c.querySelector(gc(y))||a==="script"&&c.querySelector(yc(y))||(a=c.createElement("link"),Ln(a,"link",r),an(a),c.head.appendChild(a)))}}function SM(r,a){ea.m(r,a);var s=Ws;if(s&&r){var c=a&&typeof a.as=="string"?a.as:"script",m='link[rel="modulepreload"][as="'+gr(c)+'"][href="'+gr(r)+'"]',y=m;switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":y=Ks(r)}if(!Br.has(y)&&(r=S({rel:"modulepreload",href:r},a),Br.set(y,r),s.querySelector(m)===null)){switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(yc(y)))return}c=s.createElement("link"),Ln(c,"link",r),an(c),s.head.appendChild(c)}}}function EM(r,a,s){ea.S(r,a,s);var c=Ws;if(c&&r){var m=_a(c).hoistableStyles,y=Us(r);a||(a="default");var C=m.get(y);if(!C){var R={loading:0,preload:null};if(C=c.querySelector(gc(y)))R.loading=5;else{r=S({rel:"stylesheet",href:r,"data-precedence":a},s),(s=Br.get(y))&&mg(r,s);var H=C=c.createElement("link");an(H),Ln(H,"link",r),H._p=new Promise(function(ie,ge){H.onload=ie,H.onerror=ge}),H.addEventListener("load",function(){R.loading|=1}),H.addEventListener("error",function(){R.loading|=2}),R.loading|=4,Md(C,a,c)}C={type:"stylesheet",instance:C,count:1,state:R},m.set(y,C)}}}function TM(r,a){ea.X(r,a);var s=Ws;if(s&&r){var c=_a(s).hoistableScripts,m=Ks(r),y=c.get(m);y||(y=s.querySelector(yc(m)),y||(r=S({src:r,async:!0},a),(a=Br.get(m))&&hg(r,a),y=s.createElement("script"),an(y),Ln(y,"link",r),s.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},c.set(m,y))}}function DM(r,a){ea.M(r,a);var s=Ws;if(s&&r){var c=_a(s).hoistableScripts,m=Ks(r),y=c.get(m);y||(y=s.querySelector(yc(m)),y||(r=S({src:r,async:!0,type:"module"},a),(a=Br.get(m))&&hg(r,a),y=s.createElement("script"),an(y),Ln(y,"link",r),s.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},c.set(m,y))}}function hC(r,a,s,c){var m=(m=bt.current)?Od(m):null;if(!m)throw Error(o(446));switch(r){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(a=Us(s.href),s=_a(m).hoistableStyles,c=s.get(a),c||(c={type:"style",instance:null,count:0,state:null},s.set(a,c)),c):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){r=Us(s.href);var y=_a(m).hoistableStyles,C=y.get(r);if(C||(m=m.ownerDocument||m,C={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},y.set(r,C),(y=m.querySelector(gc(r)))&&!y._p&&(C.instance=y,C.state.loading=5),Br.has(r)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},Br.set(r,s),y||RM(m,r,s,C.state))),a&&c===null)throw Error(o(528,""));return C}if(a&&c!==null)throw Error(o(529,""));return null;case"script":return a=s.async,s=s.src,typeof s=="string"&&a&&typeof a!="function"&&typeof a!="symbol"?(a=Ks(s),s=_a(m).hoistableScripts,c=s.get(a),c||(c={type:"script",instance:null,count:0,state:null},s.set(a,c)),c):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,r))}}function Us(r){return'href="'+gr(r)+'"'}function gc(r){return'link[rel="stylesheet"]['+r+"]"}function gC(r){return S({},r,{"data-precedence":r.precedence,precedence:null})}function RM(r,a,s,c){r.querySelector('link[rel="preload"][as="style"]['+a+"]")?c.loading=1:(a=r.createElement("link"),c.preload=a,a.addEventListener("load",function(){return c.loading|=1}),a.addEventListener("error",function(){return c.loading|=2}),Ln(a,"link",s),an(a),r.head.appendChild(a))}function Ks(r){return'[src="'+gr(r)+'"]'}function yc(r){return"script[async]"+r}function yC(r,a,s){if(a.count++,a.instance===null)switch(a.type){case"style":var c=r.querySelector('style[data-href~="'+gr(s.href)+'"]');if(c)return a.instance=c,an(c),c;var m=S({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return c=(r.ownerDocument||r).createElement("style"),an(c),Ln(c,"style",m),Md(c,s.precedence,r),a.instance=c;case"stylesheet":m=Us(s.href);var y=r.querySelector(gc(m));if(y)return a.state.loading|=4,a.instance=y,an(y),y;c=gC(s),(m=Br.get(m))&&mg(c,m),y=(r.ownerDocument||r).createElement("link"),an(y);var C=y;return C._p=new Promise(function(R,H){C.onload=R,C.onerror=H}),Ln(y,"link",c),a.state.loading|=4,Md(y,s.precedence,r),a.instance=y;case"script":return y=Ks(s.src),(m=r.querySelector(yc(y)))?(a.instance=m,an(m),m):(c=s,(m=Br.get(y))&&(c=S({},s),hg(c,m)),r=r.ownerDocument||r,m=r.createElement("script"),an(m),Ln(m,"link",c),r.head.appendChild(m),a.instance=m);case"void":return null;default:throw Error(o(443,a.type))}else a.type==="stylesheet"&&!(a.state.loading&4)&&(c=a.instance,a.state.loading|=4,Md(c,s.precedence,r));return a.instance}function Md(r,a,s){for(var c=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),m=c.length?c[c.length-1]:null,y=m,C=0;C<c.length;C++){var R=c[C];if(R.dataset.precedence===a)y=R;else if(y!==m)break}y?y.parentNode.insertBefore(r,y.nextSibling):(a=s.nodeType===9?s.head:s,a.insertBefore(r,a.firstChild))}function mg(r,a){r.crossOrigin??(r.crossOrigin=a.crossOrigin),r.referrerPolicy??(r.referrerPolicy=a.referrerPolicy),r.title??(r.title=a.title)}function hg(r,a){r.crossOrigin??(r.crossOrigin=a.crossOrigin),r.referrerPolicy??(r.referrerPolicy=a.referrerPolicy),r.integrity??(r.integrity=a.integrity)}var Nd=null;function vC(r,a,s){if(Nd===null){var c=new Map,m=Nd=new Map;m.set(s,c)}else m=Nd,c=m.get(s),c||(c=new Map,m.set(s,c));if(c.has(r))return c;for(c.set(r,null),s=s.getElementsByTagName(r),m=0;m<s.length;m++){var y=s[m];if(!(y[mt]||y[Ue]||r==="link"&&y.getAttribute("rel")==="stylesheet")&&y.namespaceURI!=="http://www.w3.org/2000/svg"){var C=y.getAttribute(a)||"";C=r+C;var R=c.get(C);R?R.push(y):c.set(C,[y])}}return c}function bC(r,a,s){r=r.ownerDocument||r,r.head.insertBefore(s,a==="title"?r.querySelector("head > title"):null)}function IM(r,a,s){if(s===1||a.itemProp!=null)return!1;switch(r){case"meta":case"title":return!0;case"style":if(typeof a.precedence!="string"||typeof a.href!="string"||a.href==="")break;return!0;case"link":if(typeof a.rel!="string"||typeof a.href!="string"||a.href===""||a.onLoad||a.onError)break;return a.rel==="stylesheet"?(r=a.disabled,typeof a.precedence=="string"&&r==null):!0;case"script":if(a.async&&typeof a.async!="function"&&typeof a.async!="symbol"&&!a.onLoad&&!a.onError&&a.src&&typeof a.src=="string")return!0}return!1}function wC(r){return!(r.type==="stylesheet"&&!(r.state.loading&3))}function AM(r,a,s,c){if(s.type==="stylesheet"&&(typeof c.media!="string"||matchMedia(c.media).matches!==!1)&&!(s.state.loading&4)){if(s.instance===null){var m=Us(c.href),y=a.querySelector(gc(m));if(y){a=y._p,typeof a=="object"&&a&&typeof a.then=="function"&&(r.count++,r=jd.bind(r),a.then(r,r)),s.state.loading|=4,s.instance=y,an(y);return}y=a.ownerDocument||a,c=gC(c),(m=Br.get(m))&&mg(c,m),y=y.createElement("link"),an(y);var C=y;C._p=new Promise(function(R,H){C.onload=R,C.onerror=H}),Ln(y,"link",c),s.instance=y}r.stylesheets===null&&(r.stylesheets=new Map),r.stylesheets.set(s,a),(a=s.state.preload)&&!(s.state.loading&3)&&(r.count++,s=jd.bind(r),a.addEventListener("load",s),a.addEventListener("error",s))}}var gg=0;function LM(r,a){return r.stylesheets&&r.count===0&&zd(r,r.stylesheets),0<r.count||0<r.imgCount?function(s){var c=setTimeout(function(){if(r.stylesheets&&zd(r,r.stylesheets),r.unsuspend){var y=r.unsuspend;r.unsuspend=null,y()}},6e4+a);0<r.imgBytes&&gg===0&&(gg=62500*fM());var m=setTimeout(function(){if(r.waitingForImages=!1,r.count===0&&(r.stylesheets&&zd(r,r.stylesheets),r.unsuspend)){var y=r.unsuspend;r.unsuspend=null,y()}},(r.imgBytes>gg?50:800)+a);return r.unsuspend=s,function(){r.unsuspend=null,clearTimeout(c),clearTimeout(m)}}:null}function jd(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)zd(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var qd=null;function zd(r,a){r.stylesheets=null,r.unsuspend!==null&&(r.count++,qd=new Map,a.forEach(PM,r),qd=null,jd.call(r))}function PM(r,a){if(!(a.state.loading&4)){var s=qd.get(r);if(s)var c=s.get(null);else{s=new Map,qd.set(r,s);for(var m=r.querySelectorAll("link[data-precedence],style[data-precedence]"),y=0;y<m.length;y++){var C=m[y];(C.nodeName==="LINK"||C.getAttribute("media")!=="not all")&&(s.set(C.dataset.precedence,C),c=C)}c&&s.set(null,c)}m=a.instance,C=m.getAttribute("data-precedence"),y=s.get(C)||c,y===c&&s.set(null,m),s.set(C,m),this.count++,c=jd.bind(this),m.addEventListener("load",c),m.addEventListener("error",c),y?y.parentNode.insertBefore(m,y.nextSibling):(r=r.nodeType===9?r.head:r,r.insertBefore(m,r.firstChild)),a.state.loading|=4}}var vc={$$typeof:U,Provider:null,Consumer:null,_currentValue:Ne,_currentValue2:Ne,_threadCount:0};function OM(r,a,s,c,m,y,C,R,H){this.tag=1,this.containerInfo=r,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=gi(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=gi(0),this.hiddenUpdates=gi(null),this.identifierPrefix=c,this.onUncaughtError=m,this.onCaughtError=y,this.onRecoverableError=C,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=H,this.incompleteTransitions=new Map}function MM(r,a,s,c,m,y,C,R,H,ie,ge,ve){return r=new OM(r,a,s,C,H,ie,ge,ve,R),a=1,y===!0&&(a|=24),y=vr(3,null,null,a),r.current=y,y.stateNode=r,a=Xm(),a.refCount++,r.pooledCache=a,a.refCount++,y.memoizedState={element:c,isDehydrated:s,cache:a},eh(y),r}function NM(r){return r?(r=Cs,r):Cs}function xC(r,a,s,c,m,y){m=NM(m),c.context===null?c.context=m:c.pendingContext=m,c=Lo(a),c.payload={element:s},y=y===void 0?null:y,y!==null&&(c.callback=y),s=Po(r,c,a),s!==null&&(or(s,r,a),Xl(s,r,a))}function _C(r,a){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var s=r.retryLane;r.retryLane=s!==0&&s<a?s:a}}function yg(r,a){_C(r,a),(r=r.alternate)&&_C(r,a)}function kC(r){if(r.tag===13||r.tag===31){var a=ko(r,67108864);a!==null&&or(a,r,67108864),yg(r,67108864)}}function CC(r){if(r.tag===13||r.tag===31){var a=Vr();a=rt(a);var s=ko(r,a);s!==null&&or(s,r,a),yg(r,a)}}var Fd=!0;function jM(r,a,s,c){var m=he.T;he.T=null;var y=G.p;try{G.p=2,vg(r,a,s,c)}finally{G.p=y,he.T=m}}function qM(r,a,s,c){var m=he.T;he.T=null;var y=G.p;try{G.p=8,vg(r,a,s,c)}finally{G.p=y,he.T=m}}function vg(r,a,s,c){if(Fd){var m=bg(c);if(m===null)ig(r,a,c,$d,s),EC(r,c);else if(FM(m,r,a,s,c))c.stopPropagation();else if(EC(r,c),a&4&&-1<zM.indexOf(r)){for(;m!==null;){var y=yi(m);if(y!==null)switch(y.tag){case 3:if(y=y.stateNode,y.current.memoizedState.isDehydrated){var C=qn(y.pendingLanes);if(C!==0){var R=y;for(R.pendingLanes|=2,R.entangledLanes|=2;C;){var H=1<<31-wt(C);R.entanglements[1]|=H,C&=~H}Zi(y),!(xt&6)&&(kd=Yt()+500,fc(0,!1))}}break;case 31:case 13:R=ko(y,2),R!==null&&or(R,y,2),Sd(),yg(y,2)}if(y=bg(c),y===null&&ig(r,a,c,$d,s),y===m)break;m=y}m!==null&&c.stopPropagation()}else ig(r,a,c,null,s)}}function bg(r){return r=Ml(r),wg(r)}var $d=null;function wg(r){if($d=null,r=hr(r),r!==null){var a=u(r);if(a===null)r=null;else{var s=a.tag;if(s===13){if(r=d(a),r!==null)return r;r=null}else if(s===31){if(r=p(a),r!==null)return r;r=null}else if(s===3){if(a.stateNode.current.memoizedState.isDehydrated)return a.tag===3?a.stateNode.containerInfo:null;r=null}else a!==r&&(r=null)}}return $d=r,null}function SC(r){switch(r){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(Ai()){case vn:return 2;case hi:return 8;case Vt:case Zr:return 32;case St:return 268435456;default:return 32}default:return 32}}var xg=!1,Va=null,Ha=null,Ba=null,bc=new Map,wc=new Map,Wa=[],zM="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 EC(r,a){switch(r){case"focusin":case"focusout":Va=null;break;case"dragenter":case"dragleave":Ha=null;break;case"mouseover":case"mouseout":Ba=null;break;case"pointerover":case"pointerout":bc.delete(a.pointerId);break;case"gotpointercapture":case"lostpointercapture":wc.delete(a.pointerId)}}function xc(r,a,s,c,m,y){return r===null||r.nativeEvent!==y?(r={blockedOn:a,domEventName:s,eventSystemFlags:c,nativeEvent:y,targetContainers:[m]},a!==null&&(a=yi(a),a!==null&&kC(a)),r):(r.eventSystemFlags|=c,a=r.targetContainers,m!==null&&a.indexOf(m)===-1&&a.push(m),r)}function FM(r,a,s,c,m){switch(a){case"focusin":return Va=xc(Va,r,a,s,c,m),!0;case"dragenter":return Ha=xc(Ha,r,a,s,c,m),!0;case"mouseover":return Ba=xc(Ba,r,a,s,c,m),!0;case"pointerover":var y=m.pointerId;return bc.set(y,xc(bc.get(y)||null,r,a,s,c,m)),!0;case"gotpointercapture":return y=m.pointerId,wc.set(y,xc(wc.get(y)||null,r,a,s,c,m)),!0}return!1}function TC(r){var a=hr(r.target);if(a!==null){var s=u(a);if(s!==null){if(a=s.tag,a===13){if(a=d(s),a!==null){r.blockedOn=a,we(r.priority,function(){CC(s)});return}}else if(a===31){if(a=p(s),a!==null){r.blockedOn=a,we(r.priority,function(){CC(s)});return}}else if(a===3&&s.stateNode.current.memoizedState.isDehydrated){r.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}r.blockedOn=null}function Vd(r){if(r.blockedOn!==null)return!1;for(var a=r.targetContainers;0<a.length;){var s=bg(r.nativeEvent);if(s===null){s=r.nativeEvent;var c=new s.constructor(s.type,s);En=c,s.target.dispatchEvent(c),En=null}else return a=yi(s),a!==null&&kC(a),r.blockedOn=s,!1;a.shift()}return!0}function DC(r,a,s){Vd(r)&&s.delete(a)}function $M(){xg=!1,Va!==null&&Vd(Va)&&(Va=null),Ha!==null&&Vd(Ha)&&(Ha=null),Ba!==null&&Vd(Ba)&&(Ba=null),bc.forEach(DC),wc.forEach(DC)}function Hd(r,a){r.blockedOn===a&&(r.blockedOn=null,xg||(xg=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,$M)))}var Bd=null;function RC(r){Bd!==r&&(Bd=r,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Bd===r&&(Bd=null);for(var a=0;a<r.length;a+=3){var s=r[a],c=r[a+1],m=r[a+2];if(typeof c!="function"){if(wg(c||s)===null)continue;break}var y=yi(s);y!==null&&(r.splice(a,3),a-=3,wh(y,{pending:!0,data:m,method:s.method,action:c},c,m))}}))}function Qs(r){function a(H){return Hd(H,r)}Va!==null&&Hd(Va,r),Ha!==null&&Hd(Ha,r),Ba!==null&&Hd(Ba,r),bc.forEach(a),wc.forEach(a);for(var s=0;s<Wa.length;s++){var c=Wa[s];c.blockedOn===r&&(c.blockedOn=null)}for(;0<Wa.length&&(s=Wa[0],s.blockedOn===null);)TC(s),s.blockedOn===null&&Wa.shift();if(s=(r.ownerDocument||r).$$reactFormReplay,s!=null)for(c=0;c<s.length;c+=3){var m=s[c],y=s[c+1],C=m[Ke]||null;if(typeof y=="function")C||RC(s);else if(C){var R=null;if(y&&y.hasAttribute("formAction")){if(m=y,C=y[Ke]||null)R=C.formAction;else if(wg(m)!==null)continue}else R=C.action;typeof R=="function"?s[c+1]=R:(s.splice(c,3),c-=3),RC(s)}}}function VM(){function r(y){y.canIntercept&&y.info==="react-transition"&&y.intercept({handler:function(){return new Promise(function(C){return m=C})},focusReset:"manual",scroll:"manual"})}function a(){m!==null&&(m(),m=null),c||setTimeout(s,20)}function s(){if(!c&&!navigation.transition){var y=navigation.currentEntry;y&&y.url!=null&&navigation.navigate(y.url,{state:y.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var c=!1,m=null;return navigation.addEventListener("navigate",r),navigation.addEventListener("navigatesuccess",a),navigation.addEventListener("navigateerror",a),setTimeout(s,100),function(){c=!0,navigation.removeEventListener("navigate",r),navigation.removeEventListener("navigatesuccess",a),navigation.removeEventListener("navigateerror",a),m!==null&&(m(),m=null)}}}function _g(r){this._internalRoot=r}kg.prototype.render=_g.prototype.render=function(r){var a=this._internalRoot;if(a===null)throw Error(o(409));var s=a.current;xC(s,Vr(),r,a,null,null)},kg.prototype.unmount=_g.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var a=r.containerInfo;xC(r.current,2,null,r,null,null),Sd(),a[ut]=null}};function kg(r){this._internalRoot=r}kg.prototype.unstable_scheduleHydration=function(r){if(r){var a=re();r={blockedOn:null,target:r,priority:a};for(var s=0;s<Wa.length&&a!==0&&a<Wa[s].priority;s++);Wa.splice(s,0,r),s===0&&TC(r)}};var IC=n.version;if(IC!=="19.2.4")throw Error(o(527,IC,"19.2.4"));G.findDOMNode=function(r){var a=r._reactInternals;if(a===void 0)throw typeof r.render=="function"?Error(o(188)):(r=Object.keys(r).join(","),Error(o(268,r)));return r=w(a),r=r===null?null:x(r),r=r===null?null:r.stateNode,r};var HM={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:he,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Wd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Wd.isDisabled&&Wd.supportsFiber)try{Or=Wd.inject(HM),rn=Wd}catch{}}e.createRoot=function(r,a){if(!l(r))throw Error(o(299));var s=!1,c="",m=qO,y=zO,C=FO;return a!=null&&(a.unstable_strictMode===!0&&(s=!0),a.identifierPrefix!==void 0&&(c=a.identifierPrefix),a.onUncaughtError!==void 0&&(m=a.onUncaughtError),a.onCaughtError!==void 0&&(y=a.onCaughtError),a.onRecoverableError!==void 0&&(C=a.onRecoverableError)),a=MM(r,1,!1,null,null,s,c,null,m,y,C,VM),r[ut]=a.current,Jk(r),new _g(a)}})),gf=Pe(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(i){console.error(i)}}n(),t.exports=Ya()})),BigInt.prototype.toJSON=function(){return JSON.rawJSON(this.toString())},I0=function(e){try{return JSON.parse(e,(t,n)=>$f(n))}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,n)=>typeof n=="string"?n==="\u25D0NaN\u25D0"?NaN:n==="\u25D0Infinity\u25D0"?1/0:n==="\u25D0-Infinity\u25D0"?-1/0:$f(n):$f(n))}catch{return{}}},wT=function(e){if(e.length===0)return"";let t=Object.keys(e[0]);return[`| ${t.join(" | ")} |`,`|${t.map(()=>"---").join("|")}|`,...e.map(n=>`| ${t.map(i=>PT(n[i])).join(" | ")} |`)].join(`
|
|
9
|
+
`+c.stack}}var Pr=Object.prototype.hasOwnProperty,jn=t.unstable_scheduleCallback,yn=t.unstable_cancelCallback,xa=t.unstable_shouldYield,Ii=t.unstable_requestPaint,Yt=t.unstable_now,Ai=t.unstable_getCurrentPriorityLevel,vn=t.unstable_ImmediatePriority,hi=t.unstable_UserBlockingPriority,Vt=t.unstable_NormalPriority,Zr=t.unstable_LowPriority,St=t.unstable_IdlePriority,Li=t.log,_a=t.unstable_setDisableYieldValue,Or=null,rn=null;function et(r){if(typeof Li=="function"&&_a(r),rn&&typeof rn.setStrictMode=="function")try{rn.setStrictMode(Or,r)}catch{}}var wt=Math.clz32?Math.clz32:Bn,Et=Math.log,Tt=Math.LN2;function Bn(r){return r>>>=0,r===0?32:31-(Et(r)/Tt|0)|0}var Mr=256,Dt=262144,fr=4194304;function qn(r){var a=r&42;if(a!==0)return a;switch(r&-r){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 r&261888;case 262144:case 524288:case 1048576:case 2097152:return r&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return r&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return r}}function ei(r,a,s){var c=r.pendingLanes;if(c===0)return 0;var m=0,y=r.suspendedLanes,C=r.pingedLanes;r=r.warmLanes;var R=c&134217727;return R===0?(R=c&~y,R===0?C===0?s||(s=c&~r,s!==0&&(m=qn(s))):m=qn(C):m=qn(R)):(c=R&~y,c===0?(C&=R,C===0?s||(s=R&~r,s!==0&&(m=qn(s))):m=qn(C)):m=qn(c)),m===0?0:a!==0&&a!==m&&(a&y)===0&&(y=m&-m,s=a&-a,y>=s||y===32&&s&4194048)?a:m}function Cn(r,a){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&a)===0}function pr(r,a){switch(r){case 1:case 2:case 4:case 8:case 64:return a+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 a+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 Pi(){var r=fr;return fr<<=1,!(fr&62914560)&&(fr=4194304),r}function gi(r){for(var a=[],s=0;31>s;s++)a.push(r);return a}function zn(r,a){r.pendingLanes|=a,a!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function Oi(r,a,s,c,m,y){var C=r.pendingLanes;r.pendingLanes=s,r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0,r.expiredLanes&=s,r.entangledLanes&=s,r.errorRecoveryDisabledLanes&=s,r.shellSuspendCounter=0;var R=r.entanglements,H=r.expirationTimes,ie=r.hiddenUpdates;for(s=C&~s;0<s;){var ge=31-wt(s),ve=1<<ge;R[ge]=0,H[ge]=-1;var se=ie[ge];if(se!==null)for(ie[ge]=null,ge=0;ge<se.length;ge++){var fe=se[ge];fe!==null&&(fe.lane&=-536870913)}s&=~ve}c!==0&&Wn(r,c,0),y!==0&&m===0&&r.tag!==0&&(r.suspendedLanes|=y&~(C&~a))}function Wn(r,a,s){r.pendingLanes|=a,r.suspendedLanes&=~a;var c=31-wt(a);r.entangledLanes|=a,r.entanglements[c]=r.entanglements[c]|1073741824|s&261930}function mr(r,a){var s=r.entangledLanes|=a;for(r=r.entanglements;s;){var c=31-wt(s),m=1<<c;m&a|r[c]&a&&(r[c]|=a),s&=~m}}function A(r,a){var s=a&-a;return s=s&42?1:rt(s),(s&(r.suspendedLanes|a))===0?s:0}function rt(r){switch(r){case 2:r=1;break;case 8:r=4;break;case 32:r=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:r=128;break;case 268435456:r=134217728;break;default:r=0}return r}function q(r){return r&=-r,2<r?8<r?r&134217727?32:268435456:8:2}function re(){var r=G.p;return r===0?(r=window.event,r===void 0?32:SC(r.type)):r}function we(r,a){var s=G.p;try{return G.p=r,a()}finally{G.p=s}}var De=Math.random().toString(36).slice(2),Ue="__reactFiber$"+De,Ke="__reactProps$"+De,ut="__reactContainer$"+De,Nt="__reactEvents$"+De,it="__reactListeners$"+De,jt="__reactHandles$"+De,st="__reactResources$"+De,mt="__reactMarker$"+De;function Sn(r){delete r[Ue],delete r[Ke],delete r[Nt],delete r[it],delete r[jt]}function hr(r){var a=r[Ue];if(a)return a;for(var s=r.parentNode;s;){if(a=s[ut]||s[Ue]){if(s=a.alternate,a.child!==null||s!==null&&s.child!==null)for(r=dC(r);r!==null;){if(s=r[Ue])return s;r=dC(r)}return a}r=s,s=r.parentNode}return null}function yi(r){if(r=r[Ue]||r[ut]){var a=r.tag;if(a===5||a===6||a===13||a===31||a===26||a===27||a===3)return r}return null}function Un(r){var a=r.tag;if(a===5||a===26||a===27||a===6)return r.stateNode;throw Error(o(33))}function ka(r){var a=r[st];return a||(a=r[st]={hoistableStyles:new Map,hoistableScripts:new Map}),a}function an(r){r[mt]=!0}var Ll=new Set,Ou={};function vi(r,a){Ca(r,a),Ca(r+"Capture",a)}function Ca(r,a){for(Ou[r]=a,r=0;r<a.length;r++)Ll.add(a[r])}var Dm=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]*$"),tr={},Mu={};function Rm(r){return Pr.call(Mu,r)?!0:Pr.call(tr,r)?!1:Dm.test(r)?Mu[r]=!0:(tr[r]=!0,!1)}function po(r,a,s){if(Rm(a))if(s===null)r.removeAttribute(a);else{switch(typeof s){case"undefined":case"function":case"symbol":r.removeAttribute(a);return;case"boolean":var c=a.toLowerCase().slice(0,5);if(c!=="data-"&&c!=="aria-"){r.removeAttribute(a);return}}r.setAttribute(a,""+s)}}function mo(r,a,s){if(s===null)r.removeAttribute(a);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(a);return}r.setAttribute(a,""+s)}}function ti(r,a,s,c){if(c===null)r.removeAttribute(s);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(s);return}r.setAttributeNS(a,s,""+c)}}function Kn(r){switch(typeof r){case"bigint":case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function Nu(r){var a=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function ju(r,a,s){var c=Object.getOwnPropertyDescriptor(r.constructor.prototype,a);if(!r.hasOwnProperty(a)&&c!==void 0&&typeof c.get=="function"&&typeof c.set=="function"){var m=c.get,y=c.set;return Object.defineProperty(r,a,{configurable:!0,get:function(){return m.call(this)},set:function(C){s=""+C,y.call(this,C)}}),Object.defineProperty(r,a,{enumerable:c.enumerable}),{getValue:function(){return s},setValue:function(C){s=""+C},stopTracking:function(){r._valueTracker=null,delete r[a]}}}}function Pl(r){if(!r._valueTracker){var a=Nu(r)?"checked":"value";r._valueTracker=ju(r,a,""+r[a])}}function Ol(r){if(!r)return!1;var a=r._valueTracker;if(!a)return!0;var s=a.getValue(),c="";return r&&(c=Nu(r)?r.checked?"true":"false":r.value),r=c,r===s?!1:(a.setValue(r),!0)}function Fn(r){if(r||(r=typeof document<"u"?document:void 0),r===void 0)return null;try{return r.activeElement||r.body}catch{return r.body}}var pt=/[\n"\\]/g;function gr(r){return r.replace(pt,function(a){return"\\"+a.charCodeAt(0).toString(16)+" "})}function Sa(r,a,s,c,m,y,C,R){r.name="",C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"?r.type=C:r.removeAttribute("type"),a==null?C!=="submit"&&C!=="reset"||r.removeAttribute("value"):C==="number"?(a===0&&r.value===""||r.value!=a)&&(r.value=""+Kn(a)):r.value!==""+Kn(a)&&(r.value=""+Kn(a)),a==null?s==null?c!=null&&r.removeAttribute("value"):Mi(r,C,Kn(s)):Mi(r,C,Kn(a)),m==null&&y!=null&&(r.defaultChecked=!!y),m!=null&&(r.checked=m&&typeof m!="function"&&typeof m!="symbol"),R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"?r.name=""+Kn(R):r.removeAttribute("name")}function qu(r,a,s,c,m,y,C,R){if(y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(r.type=y),a!=null||s!=null){if(!(y!=="submit"&&y!=="reset"||a!=null)){Pl(r);return}s=s==null?"":""+Kn(s),a=a==null?s:""+Kn(a),R||a===r.value||(r.value=a),r.defaultValue=a}c??(c=m),c=typeof c!="function"&&typeof c!="symbol"&&!!c,r.checked=R?r.checked:!!c,r.defaultChecked=!!c,C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"&&(r.name=C),Pl(r)}function Mi(r,a,s){a==="number"&&Fn(r.ownerDocument)===r||r.defaultValue===""+s||(r.defaultValue=""+s)}function Ea(r,a,s,c){if(r=r.options,a){a={};for(var m=0;m<s.length;m++)a["$"+s[m]]=!0;for(s=0;s<r.length;s++)m=a.hasOwnProperty("$"+r[s].value),r[s].selected!==m&&(r[s].selected=m),m&&c&&(r[s].defaultSelected=!0)}else{for(s=""+Kn(s),a=null,m=0;m<r.length;m++){if(r[m].value===s){r[m].selected=!0,c&&(r[m].defaultSelected=!0);return}a!==null||r[m].disabled||(a=r[m])}a!==null&&(a.selected=!0)}}function Ta(r,a,s){if(a!=null&&(a=""+Kn(a),a!==r.value&&(r.value=a),s==null)){r.defaultValue!==a&&(r.defaultValue=a);return}r.defaultValue=s==null?"":""+Kn(s)}function hs(r,a,s,c){if(a==null){if(c!=null){if(s!=null)throw Error(o(92));if(te(c)){if(1<c.length)throw Error(o(93));c=c[0]}s=c}s??(s=""),a=s}s=Kn(a),r.defaultValue=s,c=r.textContent,c===s&&c!==""&&c!==null&&(r.value=c),Pl(r)}function Ni(r,a){if(a){var s=r.firstChild;if(s&&s===r.lastChild&&s.nodeType===3){s.nodeValue=a;return}}r.textContent=a}var Im=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 ji(r,a,s){var c=a.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?c?r.setProperty(a,""):a==="float"?r.cssFloat="":r[a]="":c?r.setProperty(a,s):typeof s!="number"||s===0||Im.has(a)?a==="float"?r.cssFloat=s:r[a]=(""+s).trim():r[a]=s+"px"}function zu(r,a,s){if(a!=null&&typeof a!="object")throw Error(o(62));if(r=r.style,s!=null){for(var c in s)!s.hasOwnProperty(c)||a!=null&&a.hasOwnProperty(c)||(c.indexOf("--")===0?r.setProperty(c,""):c==="float"?r.cssFloat="":r[c]="");for(var m in a)c=a[m],a.hasOwnProperty(m)&&s[m]!==c&&ji(r,m,c)}else for(var y in a)a.hasOwnProperty(y)&&ji(r,y,a[y])}function ho(r){if(r.indexOf("-")===-1)return!1;switch(r){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 gs=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"]]),Fu=/^[\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 ys(r){return Fu.test(""+r)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":r}function Nr(){}var En=null;function Ml(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var Qn=null,bi=null;function $u(r){var a=yi(r);if(a&&(r=a.stateNode)){var s=r[Ke]||null;e:switch(r=a.stateNode,a.type){case"input":if(Sa(r,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),a=s.name,s.type==="radio"&&a!=null){for(s=r;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+gr(""+a)+'"][type="radio"]'),a=0;a<s.length;a++){var c=s[a];if(c!==r&&c.form===r.form){var m=c[Ke]||null;if(!m)throw Error(o(90));Sa(c,m.value,m.defaultValue,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name)}}for(a=0;a<s.length;a++)c=s[a],c.form===r.form&&Ol(c)}break e;case"textarea":Ta(r,s.value,s.defaultValue);break e;case"select":a=s.value,a!=null&&Ea(r,!!s.multiple,a,!1)}}}var Nl=!1;function Vu(r,a,s){if(Nl)return r(a,s);Nl=!0;try{return r(a)}finally{if(Nl=!1,(Qn!==null||bi!==null)&&(Ed(),Qn&&(a=Qn,r=bi,bi=Qn=null,$u(a),r)))for(a=0;a<r.length;a++)$u(r[a])}}function go(r,a){var s=r.stateNode;if(s===null)return null;var c=s[Ke]||null;if(c===null)return null;s=c[a];e:switch(a){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(c=!c.disabled)||(r=r.type,c=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!c;break e;default:r=!1}if(r)return null;if(s&&typeof s!="function")throw Error(o(231,a,typeof s));return s}var ni=!(typeof window>"u"||window.document===void 0||window.document.createElement===void 0),jl=!1;if(ni)try{var yo={};Object.defineProperty(yo,"passive",{get:function(){jl=!0}}),window.addEventListener("test",yo,yo),window.removeEventListener("test",yo,yo)}catch{jl=!1}var ri=null,vs=null,vo=null;function ql(){if(vo)return vo;var r,a=vs,s=a.length,c,m="value"in ri?ri.value:ri.textContent,y=m.length;for(r=0;r<s&&a[r]===m[r];r++);var C=s-r;for(c=1;c<=C&&a[s-c]===m[y-c];c++);return vo=m.slice(r,1<c?1-c:void 0)}function bo(r){var a=r.keyCode;return"charCode"in r?(r=r.charCode,r===0&&a===13&&(r=13)):r=a,r===10&&(r=13),32<=r||r===13?r:0}function wo(){return!0}function zl(){return!1}function Tn(r){function a(s,c,m,y,C){for(var R in this._reactName=s,this._targetInst=m,this.type=c,this.nativeEvent=y,this.target=C,this.currentTarget=null,r)r.hasOwnProperty(R)&&(s=r[R],this[R]=s?s(y):y[R]);return this.isDefaultPrevented=(y.defaultPrevented==null?y.returnValue===!1:y.defaultPrevented)?wo:zl,this.isPropagationStopped=zl,this}return S(a.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=wo)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=wo)},persist:function(){},isPersistent:wo}),a}var qi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},f=Tn(qi),h=S({},qi,{view:0,detail:0}),v=Tn(h),b,_,k,D=S({},h,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:We,button:0,buttons:0,relatedTarget:function(r){return r.relatedTarget===void 0?r.fromElement===r.srcElement?r.toElement:r.fromElement:r.relatedTarget},movementX:function(r){return"movementX"in r?r.movementX:(r!==k&&(k&&r.type==="mousemove"?(b=r.screenX-k.screenX,_=r.screenY-k.screenY):_=b=0,k=r),b)},movementY:function(r){return"movementY"in r?r.movementY:_}}),I=Tn(D),L=Tn(S({},D,{dataTransfer:0})),F=Tn(S({},h,{relatedTarget:0})),N=Tn(S({},qi,{animationName:0,elapsedTime:0,pseudoElement:0})),le=Tn(S({},qi,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}})),oe=Tn(S({},qi,{data:0})),X={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},J={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"},Ce={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ke(r){var a=this.nativeEvent;return a.getModifierState?a.getModifierState(r):(r=Ce[r])?!!a[r]:!1}function We(){return ke}var Ie=Tn(S({},h,{key:function(r){if(r.key){var a=X[r.key]||r.key;if(a!=="Unidentified")return a}return r.type==="keypress"?(r=bo(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?J[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:We,charCode:function(r){return r.type==="keypress"?bo(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?bo(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}})),$e=Tn(S({},D,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),ht=Tn(S({},h,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:We})),tt=Tn(S({},qi,{propertyName:0,elapsedTime:0,pseudoElement:0})),qt=Tn(S({},D,{deltaX:function(r){return"deltaX"in r?r.deltaX:"wheelDeltaX"in r?-r.wheelDeltaX:0},deltaY:function(r){return"deltaY"in r?r.deltaY:"wheelDeltaY"in r?-r.wheelDeltaY:"wheelDelta"in r?-r.wheelDelta:0},deltaZ:0,deltaMode:0})),Ht=Tn(S({},qi,{newState:0,oldState:0})),Je=[9,13,27,32],Ge=ni&&"CompositionEvent"in window,Qt=null;ni&&"documentMode"in document&&(Qt=document.documentMode);var dn=ni&&"TextEvent"in window&&!Qt,bn=ni&&(!Ge||Qt&&8<Qt&&11>=Qt),xo=" ",Hu=!1;function Bu(r,a){switch(r){case"keyup":return Je.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function bs(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var ws=!1;function dO(r,a){switch(r){case"compositionend":return bs(a);case"keypress":return a.which===32?(Hu=!0,xo):null;case"textInput":return r=a.data,r===xo&&Hu?null:r;default:return null}}function fO(r,a){if(ws)return r==="compositionend"||!Ge&&Bu(r,a)?(r=ql(),vo=vs=ri=null,ws=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(a.ctrlKey||a.altKey||a.metaKey)||a.ctrlKey&&a.altKey){if(a.char&&1<a.char.length)return a.char;if(a.which)return String.fromCharCode(a.which)}return null;case"compositionend":return bn&&a.locale!=="ko"?null:a.data;default:return null}}var pO={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 gx(r){var a=r&&r.nodeName&&r.nodeName.toLowerCase();return a==="input"?!!pO[r.type]:a==="textarea"}function yx(r,a,s,c){Qn?bi?bi.push(c):bi=[c]:Qn=c,a=Pd(a,"onChange"),0<a.length&&(s=new f("onChange","change",null,s,c),r.push({event:s,listeners:a}))}var Fl=null,$l=null;function mO(r){Xk(r,0)}function Wu(r){if(Ol(Un(r)))return r}function vx(r,a){if(r==="change")return a}var bx=!1;if(ni){var Am;if(ni){var Lm="oninput"in document;if(!Lm){var wx=document.createElement("div");wx.setAttribute("oninput","return;"),Lm=typeof wx.oninput=="function"}Am=Lm}else Am=!1;bx=Am&&(!document.documentMode||9<document.documentMode)}function xx(){Fl&&(Fl.detachEvent("onpropertychange",_x),$l=Fl=null)}function _x(r){if(r.propertyName==="value"&&Wu($l)){var a=[];yx(a,$l,r,Ml(r)),Vu(mO,a)}}function hO(r,a,s){r==="focusin"?(xx(),Fl=a,$l=s,Fl.attachEvent("onpropertychange",_x)):r==="focusout"&&xx()}function gO(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return Wu($l)}function yO(r,a){if(r==="click")return Wu(a)}function vO(r,a){if(r==="input"||r==="change")return Wu(a)}function bO(r,a){return r===a&&(r!==0||1/r==1/a)||r!==r&&a!==a}var yr=typeof Object.is=="function"?Object.is:bO;function Vl(r,a){if(yr(r,a))return!0;if(typeof r!="object"||!r||typeof a!="object"||!a)return!1;var s=Object.keys(r),c=Object.keys(a);if(s.length!==c.length)return!1;for(c=0;c<s.length;c++){var m=s[c];if(!Pr.call(a,m)||!yr(r[m],a[m]))return!1}return!0}function kx(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function Cx(r,a){var s=kx(r);r=0;for(var c;s;){if(s.nodeType===3){if(c=r+s.textContent.length,r<=a&&c>=a)return{node:s,offset:a-r};r=c}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=kx(s)}}function Sx(r,a){return r&&a?r===a?!0:r&&r.nodeType===3?!1:a&&a.nodeType===3?Sx(r,a.parentNode):"contains"in r?r.contains(a):r.compareDocumentPosition?!!(r.compareDocumentPosition(a)&16):!1:!1}function Ex(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var a=Fn(r.document);a instanceof r.HTMLIFrameElement;){try{var s=typeof a.contentWindow.location.href=="string"}catch{s=!1}if(s)r=a.contentWindow;else break;a=Fn(r.document)}return a}function Pm(r){var a=r&&r.nodeName&&r.nodeName.toLowerCase();return a&&(a==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||a==="textarea"||r.contentEditable==="true")}var wO=ni&&"documentMode"in document&&11>=document.documentMode,xs=null,Om=null,Hl=null,Mm=!1;function Tx(r,a,s){var c=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Mm||xs==null||xs!==Fn(c)||(c=xs,"selectionStart"in c&&Pm(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset}),Hl&&Vl(Hl,c)||(Hl=c,c=Pd(Om,"onSelect"),0<c.length&&(a=new f("onSelect","select",null,a,s),r.push({event:a,listeners:c}),a.target=xs)))}function _o(r,a){var s={};return s[r.toLowerCase()]=a.toLowerCase(),s["Webkit"+r]="webkit"+a,s["Moz"+r]="moz"+a,s}var _s={animationend:_o("Animation","AnimationEnd"),animationiteration:_o("Animation","AnimationIteration"),animationstart:_o("Animation","AnimationStart"),transitionrun:_o("Transition","TransitionRun"),transitionstart:_o("Transition","TransitionStart"),transitioncancel:_o("Transition","TransitionCancel"),transitionend:_o("Transition","TransitionEnd")},Nm={},Dx={};ni&&(Dx=document.createElement("div").style,"AnimationEvent"in window||(delete _s.animationend.animation,delete _s.animationiteration.animation,delete _s.animationstart.animation),"TransitionEvent"in window||delete _s.transitionend.transition);function ko(r){if(Nm[r])return Nm[r];if(!_s[r])return r;var a=_s[r],s;for(s in a)if(a.hasOwnProperty(s)&&s in Dx)return Nm[r]=a[s];return r}var Rx=ko("animationend"),Ix=ko("animationiteration"),Ax=ko("animationstart"),xO=ko("transitionrun"),_O=ko("transitionstart"),kO=ko("transitioncancel"),Lx=ko("transitionend"),Px=new Map,jm="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(" ");jm.push("scrollEnd");function ii(r,a){Px.set(r,a),vi(a,[r])}var Uu=typeof reportError=="function"?reportError:function(r){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var a=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof r=="object"&&r&&typeof r.message=="string"?String(r.message):String(r),error:r});if(!window.dispatchEvent(a))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",r);return}console.error(r)},jr=[],ks=0,qm=0;function Ku(){for(var r=ks,a=qm=ks=0;a<r;){var s=jr[a];jr[a++]=null;var c=jr[a];jr[a++]=null;var m=jr[a];jr[a++]=null;var y=jr[a];if(jr[a++]=null,c!==null&&m!==null){var C=c.pending;C===null?m.next=m:(m.next=C.next,C.next=m),c.pending=m}y!==0&&Ox(s,m,y)}}function Qu(r,a,s,c){jr[ks++]=r,jr[ks++]=a,jr[ks++]=s,jr[ks++]=c,qm|=c,r.lanes|=c,r=r.alternate,r!==null&&(r.lanes|=c)}function zm(r,a,s,c){return Qu(r,a,s,c),Gu(r)}function Co(r,a){return Qu(r,null,null,a),Gu(r)}function Ox(r,a,s){r.lanes|=s;var c=r.alternate;c!==null&&(c.lanes|=s);for(var m=!1,y=r.return;y!==null;)y.childLanes|=s,c=y.alternate,c!==null&&(c.childLanes|=s),y.tag===22&&(r=y.stateNode,r===null||r._visibility&1||(m=!0)),r=y,y=y.return;return r.tag===3?(y=r.stateNode,m&&a!==null&&(m=31-wt(s),r=y.hiddenUpdates,c=r[m],c===null?r[m]=[a]:c.push(a),a.lane=s|536870912),y):null}function Gu(r){if(50<dc)throw dc=0,Qh=null,Error(o(185));for(var a=r.return;a!==null;)r=a,a=r.return;return r.tag===3?r.stateNode:null}var Cs={};function CO(r,a,s,c){this.tag=r,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=a,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=c,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function vr(r,a,s,c){return new CO(r,a,s,c)}function Fm(r){return r=r.prototype,!(!r||!r.isReactComponent)}function zi(r,a){var s=r.alternate;return s===null?(s=vr(r.tag,a,r.key,r.mode),s.elementType=r.elementType,s.type=r.type,s.stateNode=r.stateNode,s.alternate=r,r.alternate=s):(s.pendingProps=a,s.type=r.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=r.flags&65011712,s.childLanes=r.childLanes,s.lanes=r.lanes,s.child=r.child,s.memoizedProps=r.memoizedProps,s.memoizedState=r.memoizedState,s.updateQueue=r.updateQueue,a=r.dependencies,s.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},s.sibling=r.sibling,s.index=r.index,s.ref=r.ref,s.refCleanup=r.refCleanup,s}function Mx(r,a){r.flags&=65011714;var s=r.alternate;return s===null?(r.childLanes=0,r.lanes=a,r.child=null,r.subtreeFlags=0,r.memoizedProps=null,r.memoizedState=null,r.updateQueue=null,r.dependencies=null,r.stateNode=null):(r.childLanes=s.childLanes,r.lanes=s.lanes,r.child=s.child,r.subtreeFlags=0,r.deletions=null,r.memoizedProps=s.memoizedProps,r.memoizedState=s.memoizedState,r.updateQueue=s.updateQueue,r.type=s.type,a=s.dependencies,r.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),r}function Xu(r,a,s,c,m,y){var C=0;if(c=r,typeof r=="function")Fm(r)&&(C=1);else if(typeof r=="string")C=IM(r,s,Be.current)?26:r==="html"||r==="head"||r==="body"?27:5;else e:switch(r){case _e:return r=vr(31,s,a,m),r.elementType=_e,r.lanes=y,r;case j:return So(s.children,m,y,a);case z:C=8,m|=24;break;case V:return r=vr(12,s,a,m|2),r.elementType=V,r.lanes=y,r;case $:return r=vr(13,s,a,m),r.elementType=$,r.lanes=y,r;case W:return r=vr(19,s,a,m),r.elementType=W,r.lanes=y,r;default:if(typeof r=="object"&&r)switch(r.$$typeof){case U:C=10;break e;case P:C=9;break e;case me:C=11;break e;case ae:C=14;break e;case xe:C=16,c=null;break e}C=29,s=Error(o(130,r===null?"null":typeof r,"")),c=null}return a=vr(C,s,a,m),a.elementType=r,a.type=c,a.lanes=y,a}function So(r,a,s,c){return r=vr(7,r,c,a),r.lanes=s,r}function $m(r,a,s){return r=vr(6,r,null,a),r.lanes=s,r}function Nx(r){var a=vr(18,null,null,0);return a.stateNode=r,a}function Vm(r,a,s){return a=vr(4,r.children===null?[]:r.children,r.key,a),a.lanes=s,a.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},a}var jx=new WeakMap;function qr(r,a){if(typeof r=="object"&&r){var s=jx.get(r);return s===void 0?(a={value:r,source:a,stack:Nn(a)},jx.set(r,a),a):s}return{value:r,source:a,stack:Nn(a)}}var Ss=[],Es=0,Ju=null,Bl=0,zr=[],Fr=0,Da=null,wi=1,xi="";function Fi(r,a){Ss[Es++]=Bl,Ss[Es++]=Ju,Ju=r,Bl=a}function qx(r,a,s){zr[Fr++]=wi,zr[Fr++]=xi,zr[Fr++]=Da,Da=r;var c=wi;r=xi;var m=32-wt(c)-1;c&=~(1<<m),s+=1;var y=32-wt(a)+m;if(30<y){var C=m-m%5;y=(c&(1<<C)-1).toString(32),c>>=C,m-=C,wi=1<<32-wt(a)+m|s<<m|c,xi=y+r}else wi=1<<y|s<<m|c,xi=r}function Hm(r){r.return!==null&&(Fi(r,1),qx(r,1,0))}function Bm(r){for(;r===Ju;)Ju=Ss[--Es],Ss[Es]=null,Bl=Ss[--Es],Ss[Es]=null;for(;r===Da;)Da=zr[--Fr],zr[Fr]=null,xi=zr[--Fr],zr[Fr]=null,wi=zr[--Fr],zr[Fr]=null}function zx(r,a){zr[Fr++]=wi,zr[Fr++]=xi,zr[Fr++]=Da,wi=a.id,xi=a.overflow,Da=r}var Rn=null,Bt=null,dt=!1,Ra=null,$r=!1,Wm=Error(o(519));function Ia(r){throw Wl(qr(Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML","")),r)),Wm}function Fx(r){var a=r.stateNode,s=r.type,c=r.memoizedProps;switch(a[Ue]=r,a[Ke]=c,s){case"dialog":ot("cancel",a),ot("close",a);break;case"iframe":case"object":case"embed":ot("load",a);break;case"video":case"audio":for(s=0;s<pc.length;s++)ot(pc[s],a);break;case"source":ot("error",a);break;case"img":case"image":case"link":ot("error",a),ot("load",a);break;case"details":ot("toggle",a);break;case"input":ot("invalid",a),qu(a,c.value,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name,!0);break;case"select":ot("invalid",a);break;case"textarea":ot("invalid",a),hs(a,c.value,c.defaultValue,c.children)}s=c.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||a.textContent===""+s||c.suppressHydrationWarning===!0||tC(a.textContent,s)?(c.popover!=null&&(ot("beforetoggle",a),ot("toggle",a)),c.onScroll!=null&&ot("scroll",a),c.onScrollEnd!=null&&ot("scrollend",a),c.onClick!=null&&(a.onclick=Nr),a=!0):a=!1,a||Ia(r,!0)}function $x(r){for(Rn=r.return;Rn;)switch(Rn.tag){case 5:case 31:case 13:$r=!1;return;case 27:case 3:$r=!0;return;default:Rn=Rn.return}}function Ts(r){if(r!==Rn)return!1;if(!dt)return $x(r),dt=!0,!1;var a=r.tag,s;if((s=a!==3&&a!==27)&&((s=a===5)&&(s=r.type,s=!(s!=="form"&&s!=="button")||lg(r.type,r.memoizedProps)),s=!s),s&&Bt&&Ia(r),$x(r),a===13){if(r=r.memoizedState,r=r===null?null:r.dehydrated,!r)throw Error(o(317));Bt=uC(r)}else if(a===31){if(r=r.memoizedState,r=r===null?null:r.dehydrated,!r)throw Error(o(317));Bt=uC(r)}else a===27?(a=Bt,Va(r.type)?(r=pg,pg=null,Bt=r):Bt=a):Bt=Rn?Hr(r.stateNode.nextSibling):null;return!0}function Eo(){Bt=Rn=null,dt=!1}function Um(){var r=Ra;return r!==null&&(ar===null?ar=r:ar.push.apply(ar,r),Ra=null),r}function Wl(r){Ra===null?Ra=[r]:Ra.push(r)}var Km=He(null),To=null,$i=null;function Aa(r,a,s){Oe(Km,a._currentValue),a._currentValue=s}function Vi(r){r._currentValue=Km.current,Fe(Km)}function Qm(r,a,s){for(;r!==null;){var c=r.alternate;if((r.childLanes&a)===a?c!==null&&(c.childLanes&a)!==a&&(c.childLanes|=a):(r.childLanes|=a,c!==null&&(c.childLanes|=a)),r===s)break;r=r.return}}function Gm(r,a,s,c){var m=r.child;for(m!==null&&(m.return=r);m!==null;){var y=m.dependencies;if(y!==null){var C=m.child;y=y.firstContext;e:for(;y!==null;){var R=y;y=m;for(var H=0;H<a.length;H++)if(R.context===a[H]){y.lanes|=s,R=y.alternate,R!==null&&(R.lanes|=s),Qm(y.return,s,r),c||(C=null);break e}y=R.next}}else if(m.tag===18){if(C=m.return,C===null)throw Error(o(341));C.lanes|=s,y=C.alternate,y!==null&&(y.lanes|=s),Qm(C,s,r),C=null}else C=m.child;if(C!==null)C.return=m;else for(C=m;C!==null;){if(C===r){C=null;break}if(m=C.sibling,m!==null){m.return=C.return,C=m;break}C=C.return}m=C}}function Ds(r,a,s,c){r=null;for(var m=a,y=!1;m!==null;){if(!y){if(m.flags&524288)y=!0;else if(m.flags&262144)break}if(m.tag===10){var C=m.alternate;if(C===null)throw Error(o(387));if(C=C.memoizedProps,C!==null){var R=m.type;yr(m.pendingProps.value,C.value)||(r===null?r=[R]:r.push(R))}}else if(m===Mn.current){if(C=m.alternate,C===null)throw Error(o(387));C.memoizedState.memoizedState!==m.memoizedState.memoizedState&&(r===null?r=[vc]:r.push(vc))}m=m.return}r!==null&&Gm(a,r,s,c),a.flags|=262144}function Yu(r){for(r=r.firstContext;r!==null;){if(!yr(r.context._currentValue,r.memoizedValue))return!0;r=r.next}return!1}function Do(r){To=r,$i=null,r=r.dependencies,r!==null&&(r.firstContext=null)}function In(r){return Vx(To,r)}function Zu(r,a){return To===null&&Do(r),Vx(r,a)}function Vx(r,a){var s=a._currentValue;if(a={context:a,memoizedValue:s,next:null},$i===null){if(r===null)throw Error(o(308));$i=a,r.dependencies={lanes:0,firstContext:a},r.flags|=524288}else $i=$i.next=a;return s}var SO=typeof AbortController<"u"?AbortController:function(){var r=[],a=this.signal={aborted:!1,addEventListener:function(s,c){r.push(c)}};this.abort=function(){a.aborted=!0,r.forEach(function(s){return s()})}},EO=t.unstable_scheduleCallback,TO=t.unstable_NormalPriority,fn={$$typeof:U,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Xm(){return{controller:new SO,data:new Map,refCount:0}}function Ul(r){r.refCount--,r.refCount===0&&EO(TO,function(){r.controller.abort()})}var Kl=null,Jm=0,Rs=0,Is=null;function DO(r,a){if(Kl===null){var s=Kl=[];Jm=0,Rs=eg(),Is={status:"pending",value:void 0,then:function(c){s.push(c)}}}return Jm++,a.then(Hx,Hx),a}function Hx(){if(--Jm===0&&Kl!==null){Is!==null&&(Is.status="fulfilled");var r=Kl;Kl=null,Rs=0,Is=null;for(var a=0;a<r.length;a++)(0,r[a])()}}function RO(r,a){var s=[],c={status:"pending",value:null,reason:null,then:function(m){s.push(m)}};return r.then(function(){c.status="fulfilled",c.value=a;for(var m=0;m<s.length;m++)(0,s[m])(a)},function(m){for(c.status="rejected",c.reason=m,m=0;m<s.length;m++)(0,s[m])(void 0)}),c}var Bx=he.S;he.S=function(r,a){Ck=Yt(),typeof a=="object"&&a&&typeof a.then=="function"&&DO(r,a),Bx!==null&&Bx(r,a)};var Ro=He(null);function Ym(){var r=Ro.current;return r===null?zt.pooledCache:r}function ed(r,a){a===null?Oe(Ro,Ro.current):Oe(Ro,a.pool)}function Wx(){var r=Ym();return r===null?null:{parent:fn._currentValue,pool:r}}var As=Error(o(460)),Zm=Error(o(474)),td=Error(o(542)),nd={then:function(){}};function Ux(r){return r=r.status,r==="fulfilled"||r==="rejected"}function Kx(r,a,s){switch(s=r[s],s===void 0?r.push(a):s!==a&&(a.then(Nr,Nr),a=s),a.status){case"fulfilled":return a.value;case"rejected":throw r=a.reason,Gx(r),r;default:if(typeof a.status=="string")a.then(Nr,Nr);else{if(r=zt,r!==null&&100<r.shellSuspendCounter)throw Error(o(482));r=a,r.status="pending",r.then(function(c){if(a.status==="pending"){var m=a;m.status="fulfilled",m.value=c}},function(c){if(a.status==="pending"){var m=a;m.status="rejected",m.reason=c}})}switch(a.status){case"fulfilled":return a.value;case"rejected":throw r=a.reason,Gx(r),r}throw Ao=a,As}}function Io(r){try{var a=r._init;return a(r._payload)}catch(s){throw typeof s=="object"&&s&&typeof s.then=="function"?(Ao=s,As):s}}var Ao=null;function Qx(){if(Ao===null)throw Error(o(459));var r=Ao;return Ao=null,r}function Gx(r){if(r===As||r===td)throw Error(o(483))}var Ls=null,Ql=0;function rd(r){var a=Ql;return Ql+=1,Ls===null&&(Ls=[]),Kx(Ls,r,a)}function Gl(r,a){a=a.props.ref,r.ref=a===void 0?null:a}function id(r,a){throw a.$$typeof===E?Error(o(525)):(r=Object.prototype.toString.call(a),Error(o(31,r==="[object Object]"?"object with keys {"+Object.keys(a).join(", ")+"}":r)))}function Xx(r){function a(K,B){if(r){var ee=K.deletions;ee===null?(K.deletions=[B],K.flags|=16):ee.push(B)}}function s(K,B){if(!r)return null;for(;B!==null;)a(K,B),B=B.sibling;return null}function c(K){for(var B=new Map;K!==null;)K.key===null?B.set(K.index,K):B.set(K.key,K),K=K.sibling;return B}function m(K,B){return K=zi(K,B),K.index=0,K.sibling=null,K}function y(K,B,ee){return K.index=ee,r?(ee=K.alternate,ee===null?(K.flags|=67108866,B):(ee=ee.index,ee<B?(K.flags|=67108866,B):ee)):(K.flags|=1048576,B)}function C(K){return r&&K.alternate===null&&(K.flags|=67108866),K}function R(K,B,ee,ye){return B===null||B.tag!==6?(B=$m(ee,K.mode,ye),B.return=K,B):(B=m(B,ee),B.return=K,B)}function H(K,B,ee,ye){var ze=ee.type;return ze===j?ge(K,B,ee.props.children,ye,ee.key):B!==null&&(B.elementType===ze||typeof ze=="object"&&ze&&ze.$$typeof===xe&&Io(ze)===B.type)?(B=m(B,ee.props),Gl(B,ee),B.return=K,B):(B=Xu(ee.type,ee.key,ee.props,null,K.mode,ye),Gl(B,ee),B.return=K,B)}function ie(K,B,ee,ye){return B===null||B.tag!==4||B.stateNode.containerInfo!==ee.containerInfo||B.stateNode.implementation!==ee.implementation?(B=Vm(ee,K.mode,ye),B.return=K,B):(B=m(B,ee.children||[]),B.return=K,B)}function ge(K,B,ee,ye,ze){return B===null||B.tag!==7?(B=So(ee,K.mode,ye,ze),B.return=K,B):(B=m(B,ee),B.return=K,B)}function ve(K,B,ee){if(typeof B=="string"&&B!==""||typeof B=="number"||typeof B=="bigint")return B=$m(""+B,K.mode,ee),B.return=K,B;if(typeof B=="object"&&B){switch(B.$$typeof){case T:return ee=Xu(B.type,B.key,B.props,null,K.mode,ee),Gl(ee,B),ee.return=K,ee;case O:return B=Vm(B,K.mode,ee),B.return=K,B;case xe:return B=Io(B),ve(K,B,ee)}if(te(B)||Q(B))return B=So(B,K.mode,ee,null),B.return=K,B;if(typeof B.then=="function")return ve(K,rd(B),ee);if(B.$$typeof===U)return ve(K,Zu(K,B),ee);id(K,B)}return null}function se(K,B,ee,ye){var ze=B===null?null:B.key;if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return ze===null?R(K,B,""+ee,ye):null;if(typeof ee=="object"&&ee){switch(ee.$$typeof){case T:return ee.key===ze?H(K,B,ee,ye):null;case O:return ee.key===ze?ie(K,B,ee,ye):null;case xe:return ee=Io(ee),se(K,B,ee,ye)}if(te(ee)||Q(ee))return ze===null?ge(K,B,ee,ye,null):null;if(typeof ee.then=="function")return se(K,B,rd(ee),ye);if(ee.$$typeof===U)return se(K,B,Zu(K,ee),ye);id(K,ee)}return null}function fe(K,B,ee,ye,ze){if(typeof ye=="string"&&ye!==""||typeof ye=="number"||typeof ye=="bigint")return K=K.get(ee)||null,R(B,K,""+ye,ze);if(typeof ye=="object"&&ye){switch(ye.$$typeof){case T:return K=K.get(ye.key===null?ee:ye.key)||null,H(B,K,ye,ze);case O:return K=K.get(ye.key===null?ee:ye.key)||null,ie(B,K,ye,ze);case xe:return ye=Io(ye),fe(K,B,ee,ye,ze)}if(te(ye)||Q(ye))return K=K.get(ee)||null,ge(B,K,ye,ze,null);if(typeof ye.then=="function")return fe(K,B,ee,rd(ye),ze);if(ye.$$typeof===U)return fe(K,B,ee,Zu(B,ye),ze);id(B,ye)}return null}function Ae(K,B,ee,ye){for(var ze=null,_t=null,Le=B,Ze=B=0,ct=null;Le!==null&&Ze<ee.length;Ze++){Le.index>Ze?(ct=Le,Le=null):ct=Le.sibling;var vt=se(K,Le,ee[Ze],ye);if(vt===null){Le===null&&(Le=ct);break}r&&Le&&vt.alternate===null&&a(K,Le),B=y(vt,B,Ze),_t===null?ze=vt:_t.sibling=vt,_t=vt,Le=ct}if(Ze===ee.length)return s(K,Le),dt&&Fi(K,Ze),ze;if(Le===null){for(;Ze<ee.length;Ze++)Le=ve(K,ee[Ze],ye),Le!==null&&(B=y(Le,B,Ze),_t===null?ze=Le:_t.sibling=Le,_t=Le);return dt&&Fi(K,Ze),ze}for(Le=c(Le);Ze<ee.length;Ze++)ct=fe(Le,K,Ze,ee[Ze],ye),ct!==null&&(r&&ct.alternate!==null&&Le.delete(ct.key===null?Ze:ct.key),B=y(ct,B,Ze),_t===null?ze=ct:_t.sibling=ct,_t=ct);return r&&Le.forEach(function(Ka){return a(K,Ka)}),dt&&Fi(K,Ze),ze}function Ve(K,B,ee,ye){if(ee==null)throw Error(o(151));for(var ze=null,_t=null,Le=B,Ze=B=0,ct=null,vt=ee.next();Le!==null&&!vt.done;Ze++,vt=ee.next()){Le.index>Ze?(ct=Le,Le=null):ct=Le.sibling;var Ka=se(K,Le,vt.value,ye);if(Ka===null){Le===null&&(Le=ct);break}r&&Le&&Ka.alternate===null&&a(K,Le),B=y(Ka,B,Ze),_t===null?ze=Ka:_t.sibling=Ka,_t=Ka,Le=ct}if(vt.done)return s(K,Le),dt&&Fi(K,Ze),ze;if(Le===null){for(;!vt.done;Ze++,vt=ee.next())vt=ve(K,vt.value,ye),vt!==null&&(B=y(vt,B,Ze),_t===null?ze=vt:_t.sibling=vt,_t=vt);return dt&&Fi(K,Ze),ze}for(Le=c(Le);!vt.done;Ze++,vt=ee.next())vt=fe(Le,K,Ze,vt.value,ye),vt!==null&&(r&&vt.alternate!==null&&Le.delete(vt.key===null?Ze:vt.key),B=y(vt,B,Ze),_t===null?ze=vt:_t.sibling=vt,_t=vt);return r&&Le.forEach(function(BM){return a(K,BM)}),dt&&Fi(K,Ze),ze}function Mt(K,B,ee,ye){if(typeof ee=="object"&&ee&&ee.type===j&&ee.key===null&&(ee=ee.props.children),typeof ee=="object"&&ee){switch(ee.$$typeof){case T:e:{for(var ze=ee.key;B!==null;){if(B.key===ze){if(ze=ee.type,ze===j){if(B.tag===7){s(K,B.sibling),ye=m(B,ee.props.children),ye.return=K,K=ye;break e}}else if(B.elementType===ze||typeof ze=="object"&&ze&&ze.$$typeof===xe&&Io(ze)===B.type){s(K,B.sibling),ye=m(B,ee.props),Gl(ye,ee),ye.return=K,K=ye;break e}s(K,B);break}else a(K,B);B=B.sibling}ee.type===j?(ye=So(ee.props.children,K.mode,ye,ee.key),ye.return=K,K=ye):(ye=Xu(ee.type,ee.key,ee.props,null,K.mode,ye),Gl(ye,ee),ye.return=K,K=ye)}return C(K);case O:e:{for(ze=ee.key;B!==null;){if(B.key===ze)if(B.tag===4&&B.stateNode.containerInfo===ee.containerInfo&&B.stateNode.implementation===ee.implementation){s(K,B.sibling),ye=m(B,ee.children||[]),ye.return=K,K=ye;break e}else{s(K,B);break}else a(K,B);B=B.sibling}ye=Vm(ee,K.mode,ye),ye.return=K,K=ye}return C(K);case xe:return ee=Io(ee),Mt(K,B,ee,ye)}if(te(ee))return Ae(K,B,ee,ye);if(Q(ee)){if(ze=Q(ee),typeof ze!="function")throw Error(o(150));return ee=ze.call(ee),Ve(K,B,ee,ye)}if(typeof ee.then=="function")return Mt(K,B,rd(ee),ye);if(ee.$$typeof===U)return Mt(K,B,Zu(K,ee),ye);id(K,ee)}return typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint"?(ee=""+ee,B!==null&&B.tag===6?(s(K,B.sibling),ye=m(B,ee),ye.return=K,K=ye):(s(K,B),ye=$m(ee,K.mode,ye),ye.return=K,K=ye),C(K)):s(K,B)}return function(K,B,ee,ye){try{Ql=0;var ze=Mt(K,B,ee,ye);return Ls=null,ze}catch(Le){if(Le===As||Le===td)throw Le;var _t=vr(29,Le,null,K.mode);return _t.lanes=ye,_t.return=K,_t}}}var Lo=Xx(!0),Jx=Xx(!1),La=!1;function eh(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function th(r,a){r=r.updateQueue,a.updateQueue===r&&(a.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,callbacks:null})}function Po(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function Oo(r,a,s){var c=r.updateQueue;if(c===null)return null;if(c=c.shared,xt&2){var m=c.pending;return m===null?a.next=a:(a.next=m.next,m.next=a),c.pending=a,a=Gu(r),Ox(r,null,s),a}return Qu(r,c,a,s),Gu(r)}function Xl(r,a,s){if(a=a.updateQueue,a!==null&&(a=a.shared,s&4194048)){var c=a.lanes;c&=r.pendingLanes,s|=c,a.lanes=s,mr(r,s)}}function nh(r,a){var s=r.updateQueue,c=r.alternate;if(c!==null&&(c=c.updateQueue,s===c)){var m=null,y=null;if(s=s.firstBaseUpdate,s!==null){do{var C={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};y===null?m=y=C:y=y.next=C,s=s.next}while(s!==null);y===null?m=y=a:y=y.next=a}else m=y=a;s={baseState:c.baseState,firstBaseUpdate:m,lastBaseUpdate:y,shared:c.shared,callbacks:c.callbacks},r.updateQueue=s;return}r=s.lastBaseUpdate,r===null?s.firstBaseUpdate=a:r.next=a,s.lastBaseUpdate=a}var rh=!1;function Jl(){if(rh){var r=Is;if(r!==null)throw r}}function Yl(r,a,s,c){rh=!1;var m=r.updateQueue;La=!1;var y=m.firstBaseUpdate,C=m.lastBaseUpdate,R=m.shared.pending;if(R!==null){m.shared.pending=null;var H=R,ie=H.next;H.next=null,C===null?y=ie:C.next=ie,C=H;var ge=r.alternate;ge!==null&&(ge=ge.updateQueue,R=ge.lastBaseUpdate,R!==C&&(R===null?ge.firstBaseUpdate=ie:R.next=ie,ge.lastBaseUpdate=H))}if(y!==null){var ve=m.baseState;C=0,ge=ie=H=null,R=y;do{var se=R.lane&-536870913,fe=se!==R.lane;if(fe?(lt&se)===se:(c&se)===se){se!==0&&se===Rs&&(rh=!0),ge!==null&&(ge=ge.next={lane:0,tag:R.tag,payload:R.payload,callback:null,next:null});e:{var Ae=r,Ve=R;se=a;var Mt=s;switch(Ve.tag){case 1:if(Ae=Ve.payload,typeof Ae=="function"){ve=Ae.call(Mt,ve,se);break e}ve=Ae;break e;case 3:Ae.flags=Ae.flags&-65537|128;case 0:if(Ae=Ve.payload,se=typeof Ae=="function"?Ae.call(Mt,ve,se):Ae,se==null)break e;ve=S({},ve,se);break e;case 2:La=!0}}se=R.callback,se!==null&&(r.flags|=64,fe&&(r.flags|=8192),fe=m.callbacks,fe===null?m.callbacks=[se]:fe.push(se))}else fe={lane:se,tag:R.tag,payload:R.payload,callback:R.callback,next:null},ge===null?(ie=ge=fe,H=ve):ge=ge.next=fe,C|=se;if(R=R.next,R===null){if(R=m.shared.pending,R===null)break;fe=R,R=fe.next,fe.next=null,m.lastBaseUpdate=fe,m.shared.pending=null}}while(!0);ge===null&&(H=ve),m.baseState=H,m.firstBaseUpdate=ie,m.lastBaseUpdate=ge,y===null&&(m.shared.lanes=0),ja|=C,r.lanes=C,r.memoizedState=ve}}function Yx(r,a){if(typeof r!="function")throw Error(o(191,r));r.call(a)}function Zx(r,a){var s=r.callbacks;if(s!==null)for(r.callbacks=null,r=0;r<s.length;r++)Yx(s[r],a)}var Ps=He(null),ad=He(0);function e_(r,a){r=Ji,Oe(ad,r),Oe(Ps,a),Ji=r|a.baseLanes}function ih(){Oe(ad,Ji),Oe(Ps,Ps.current)}function ah(){Ji=ad.current,Fe(Ps),Fe(ad)}var br=He(null),ai=null;function Pa(r){var a=r.alternate;Oe(on,on.current&1),Oe(br,r),ai===null&&(a===null||Ps.current!==null||a.memoizedState!==null)&&(ai=r)}function oh(r){Oe(on,on.current),Oe(br,r),ai===null&&(ai=r)}function t_(r){r.tag===22?(Oe(on,on.current),Oe(br,r),ai===null&&(ai=r)):Oa(r)}function Oa(){Oe(on,on.current),Oe(br,br.current)}function wr(r){Fe(br),ai===r&&(ai=null),Fe(on)}var on=He(0);function od(r){for(var a=r;a!==null;){if(a.tag===13){var s=a.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||dg(s)||fg(s)))return a}else if(a.tag===19&&(a.memoizedProps.revealOrder==="forwards"||a.memoizedProps.revealOrder==="backwards"||a.memoizedProps.revealOrder==="unstable_legacy-backwards"||a.memoizedProps.revealOrder==="together")){if(a.flags&128)return a}else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===r)break;for(;a.sibling===null;){if(a.return===null||a.return===r)return null;a=a.return}a.sibling.return=a.return,a=a.sibling}return null}var Hi=0,Ye=null,Pt=null,pn=null,sd=!1,Os=!1,Mo=!1,ld=0,Zl=0,Ms=null,IO=0;function Zt(){throw Error(o(321))}function sh(r,a){if(a===null)return!1;for(var s=0;s<a.length&&s<r.length;s++)if(!yr(r[s],a[s]))return!1;return!0}function lh(r,a,s,c,m,y){return Hi=y,Ye=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,he.H=r===null||r.memoizedState===null?q_:kh,Mo=!1,y=s(c,m),Mo=!1,Os&&(y=r_(a,s,c,m)),n_(r),y}function n_(r){he.H=nc;var a=Pt!==null&&Pt.next!==null;if(Hi=0,pn=Pt=Ye=null,sd=!1,Zl=0,Ms=null,a)throw Error(o(300));r===null||mn||(r=r.dependencies,r!==null&&Yu(r)&&(mn=!0))}function r_(r,a,s,c){Ye=r;var m=0;do{if(Os&&(Ms=null),Zl=0,Os=!1,25<=m)throw Error(o(301));if(m+=1,pn=Pt=null,r.updateQueue!=null){var y=r.updateQueue;y.lastEffect=null,y.events=null,y.stores=null,y.memoCache!=null&&(y.memoCache.index=0)}he.H=z_,y=a(s,c)}while(Os);return y}function AO(){var r=he.H,a=r.useState()[0];return a=typeof a.then=="function"?ec(a):a,r=r.useState()[0],(Pt===null?null:Pt.memoizedState)!==r&&(Ye.flags|=1024),a}function ch(){var r=ld!==0;return ld=0,r}function uh(r,a,s){a.updateQueue=r.updateQueue,a.flags&=-2053,r.lanes&=~s}function dh(r){if(sd){for(r=r.memoizedState;r!==null;){var a=r.queue;a!==null&&(a.pending=null),r=r.next}sd=!1}Hi=0,pn=Pt=Ye=null,Os=!1,Zl=ld=0,Ms=null}function Gn(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return pn===null?Ye.memoizedState=pn=r:pn=pn.next=r,pn}function sn(){if(Pt===null){var r=Ye.alternate;r=r===null?null:r.memoizedState}else r=Pt.next;var a=pn===null?Ye.memoizedState:pn.next;if(a!==null)pn=a,Pt=r;else{if(r===null)throw Ye.alternate===null?Error(o(467)):Error(o(310));Pt=r,r={memoizedState:Pt.memoizedState,baseState:Pt.baseState,baseQueue:Pt.baseQueue,queue:Pt.queue,next:null},pn===null?Ye.memoizedState=pn=r:pn=pn.next=r}return pn}function cd(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ec(r){var a=Zl;return Zl+=1,Ms===null&&(Ms=[]),r=Kx(Ms,r,a),a=Ye,(pn===null?a.memoizedState:pn.next)===null&&(a=a.alternate,he.H=a===null||a.memoizedState===null?q_:kh),r}function ud(r){if(typeof r=="object"&&r){if(typeof r.then=="function")return ec(r);if(r.$$typeof===U)return In(r)}throw Error(o(438,String(r)))}function fh(r){var a=null,s=Ye.updateQueue;if(s!==null&&(a=s.memoCache),a==null){var c=Ye.alternate;c!==null&&(c=c.updateQueue,c!==null&&(c=c.memoCache,c!=null&&(a={data:c.data.map(function(m){return m.slice()}),index:0})))}if(a??(a={data:[],index:0}),s===null&&(s=cd(),Ye.updateQueue=s),s.memoCache=a,s=a.data[a.index],s===void 0)for(s=a.data[a.index]=Array(r),c=0;c<r;c++)s[c]=Te;return a.index++,s}function Bi(r,a){return typeof a=="function"?a(r):a}function dd(r){return ph(sn(),Pt,r)}function ph(r,a,s){var c=r.queue;if(c===null)throw Error(o(311));c.lastRenderedReducer=s;var m=r.baseQueue,y=c.pending;if(y!==null){if(m!==null){var C=m.next;m.next=y.next,y.next=C}a.baseQueue=m=y,c.pending=null}if(y=r.baseState,m===null)r.memoizedState=y;else{a=m.next;var R=C=null,H=null,ie=a,ge=!1;do{var ve=ie.lane&-536870913;if(ve===ie.lane?(Hi&ve)===ve:(lt&ve)===ve){var se=ie.revertLane;if(se===0)H!==null&&(H=H.next={lane:0,revertLane:0,gesture:null,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null}),ve===Rs&&(ge=!0);else if((Hi&se)===se){ie=ie.next,se===Rs&&(ge=!0);continue}else ve={lane:0,revertLane:ie.revertLane,gesture:null,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null},H===null?(R=H=ve,C=y):H=H.next=ve,Ye.lanes|=se,ja|=se;ve=ie.action,Mo&&s(y,ve),y=ie.hasEagerState?ie.eagerState:s(y,ve)}else se={lane:ve,revertLane:ie.revertLane,gesture:ie.gesture,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null},H===null?(R=H=se,C=y):H=H.next=se,Ye.lanes|=ve,ja|=ve;ie=ie.next}while(ie!==null&&ie!==a);if(H===null?C=y:H.next=R,!yr(y,r.memoizedState)&&(mn=!0,ge&&(s=Is,s!==null)))throw s;r.memoizedState=y,r.baseState=C,r.baseQueue=H,c.lastRenderedState=y}return m===null&&(c.lanes=0),[r.memoizedState,c.dispatch]}function mh(r){var a=sn(),s=a.queue;if(s===null)throw Error(o(311));s.lastRenderedReducer=r;var c=s.dispatch,m=s.pending,y=a.memoizedState;if(m!==null){s.pending=null;var C=m=m.next;do y=r(y,C.action),C=C.next;while(C!==m);yr(y,a.memoizedState)||(mn=!0),a.memoizedState=y,a.baseQueue===null&&(a.baseState=y),s.lastRenderedState=y}return[y,c]}function i_(r,a,s){var c=Ye,m=sn(),y=dt;if(y){if(s===void 0)throw Error(o(407));s=s()}else s=a();var C=!yr((Pt||m).memoizedState,s);if(C&&(m.memoizedState=s,mn=!0),m=m.queue,yh(s_.bind(null,c,m,r),[r]),m.getSnapshot!==a||C||pn!==null&&pn.memoizedState.tag&1){if(c.flags|=2048,Ns(9,{destroy:void 0},o_.bind(null,c,m,s,a),null),zt===null)throw Error(o(349));y||Hi&127||a_(c,a,s)}return s}function a_(r,a,s){r.flags|=16384,r={getSnapshot:a,value:s},a=Ye.updateQueue,a===null?(a=cd(),Ye.updateQueue=a,a.stores=[r]):(s=a.stores,s===null?a.stores=[r]:s.push(r))}function o_(r,a,s,c){a.value=s,a.getSnapshot=c,l_(a)&&c_(r)}function s_(r,a,s){return s(function(){l_(a)&&c_(r)})}function l_(r){var a=r.getSnapshot;r=r.value;try{var s=a();return!yr(r,s)}catch{return!0}}function c_(r){var a=Co(r,2);a!==null&&or(a,r,2)}function hh(r){var a=Gn();if(typeof r=="function"){var s=r;if(r=s(),Mo){et(!0);try{s()}finally{et(!1)}}}return a.memoizedState=a.baseState=r,a.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bi,lastRenderedState:r},a}function u_(r,a,s,c){return r.baseState=s,ph(r,Pt,typeof c=="function"?c:Bi)}function LO(r,a,s,c,m){if(md(r))throw Error(o(485));if(r=a.action,r!==null){var y={payload:m,action:r,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(C){y.listeners.push(C)}};he.T===null?y.isTransition=!1:s(!0),c(y),s=a.pending,s===null?(y.next=a.pending=y,d_(a,y)):(y.next=s.next,a.pending=s.next=y)}}function d_(r,a){var s=a.action,c=a.payload,m=r.state;if(a.isTransition){var y=he.T,C={};he.T=C;try{var R=s(m,c),H=he.S;H!==null&&H(C,R),f_(r,a,R)}catch(ie){gh(r,a,ie)}finally{y!==null&&C.types!==null&&(y.types=C.types),he.T=y}}else try{y=s(m,c),f_(r,a,y)}catch(ie){gh(r,a,ie)}}function f_(r,a,s){typeof s=="object"&&s&&typeof s.then=="function"?s.then(function(c){p_(r,a,c)},function(c){return gh(r,a,c)}):p_(r,a,s)}function p_(r,a,s){a.status="fulfilled",a.value=s,m_(a),r.state=s,a=r.pending,a!==null&&(s=a.next,s===a?r.pending=null:(s=s.next,a.next=s,d_(r,s)))}function gh(r,a,s){var c=r.pending;if(r.pending=null,c!==null){c=c.next;do a.status="rejected",a.reason=s,m_(a),a=a.next;while(a!==c)}r.action=null}function m_(r){r=r.listeners;for(var a=0;a<r.length;a++)(0,r[a])()}function h_(r,a){return a}function g_(r,a){if(dt){var s=zt.formState;if(s!==null){e:{var c=Ye;if(dt){if(Bt){t:{for(var m=Bt,y=$r;m.nodeType!==8;){if(!y){m=null;break t}if(m=Hr(m.nextSibling),m===null){m=null;break t}}y=m.data,m=y==="F!"||y==="F"?m:null}if(m){Bt=Hr(m.nextSibling),c=m.data==="F!";break e}}Ia(c)}c=!1}c&&(a=s[0])}}return s=Gn(),s.memoizedState=s.baseState=a,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:h_,lastRenderedState:a},s.queue=c,s=M_.bind(null,Ye,c),c.dispatch=s,c=hh(!1),y=_h.bind(null,Ye,!1,c.queue),c=Gn(),m={state:a,dispatch:null,action:r,pending:null},c.queue=m,s=LO.bind(null,Ye,m,y,s),m.dispatch=s,c.memoizedState=r,[a,s,!1]}function y_(r){return v_(sn(),Pt,r)}function v_(r,a,s){if(a=ph(r,a,h_)[0],r=dd(Bi)[0],typeof a=="object"&&a&&typeof a.then=="function")try{var c=ec(a)}catch(C){throw C===As?td:C}else c=a;a=sn();var m=a.queue,y=m.dispatch;return s!==a.memoizedState&&(Ye.flags|=2048,Ns(9,{destroy:void 0},PO.bind(null,m,s),null)),[c,y,r]}function PO(r,a){r.action=a}function b_(r){var a=sn(),s=Pt;if(s!==null)return v_(a,s,r);sn(),a=a.memoizedState,s=sn();var c=s.queue.dispatch;return s.memoizedState=r,[a,c,!1]}function Ns(r,a,s,c){return r={tag:r,create:s,deps:c,inst:a,next:null},a=Ye.updateQueue,a===null&&(a=cd(),Ye.updateQueue=a),s=a.lastEffect,s===null?a.lastEffect=r.next=r:(c=s.next,s.next=r,r.next=c,a.lastEffect=r),r}function w_(){return sn().memoizedState}function fd(r,a,s,c){var m=Gn();Ye.flags|=r,m.memoizedState=Ns(1|a,{destroy:void 0},s,c===void 0?null:c)}function pd(r,a,s,c){var m=sn();c=c===void 0?null:c;var y=m.memoizedState.inst;Pt!==null&&c!==null&&sh(c,Pt.memoizedState.deps)?m.memoizedState=Ns(a,y,s,c):(Ye.flags|=r,m.memoizedState=Ns(1|a,y,s,c))}function x_(r,a){fd(8390656,8,r,a)}function yh(r,a){pd(2048,8,r,a)}function OO(r){Ye.flags|=4;var a=Ye.updateQueue;if(a===null)a=cd(),Ye.updateQueue=a,a.events=[r];else{var s=a.events;s===null?a.events=[r]:s.push(r)}}function __(r){var a=sn().memoizedState;return OO({ref:a,nextImpl:r}),function(){if(xt&2)throw Error(o(440));return a.impl.apply(void 0,arguments)}}function k_(r,a){return pd(4,2,r,a)}function C_(r,a){return pd(4,4,r,a)}function S_(r,a){if(typeof a=="function"){r=r();var s=a(r);return function(){typeof s=="function"?s():a(null)}}if(a!=null)return r=r(),a.current=r,function(){a.current=null}}function E_(r,a,s){s=s==null?null:s.concat([r]),pd(4,4,S_.bind(null,a,r),s)}function vh(){}function T_(r,a){var s=sn();a=a===void 0?null:a;var c=s.memoizedState;return a!==null&&sh(a,c[1])?c[0]:(s.memoizedState=[r,a],r)}function D_(r,a){var s=sn();a=a===void 0?null:a;var c=s.memoizedState;if(a!==null&&sh(a,c[1]))return c[0];if(c=r(),Mo){et(!0);try{r()}finally{et(!1)}}return s.memoizedState=[c,a],c}function bh(r,a,s){return s===void 0||Hi&1073741824&&!(lt&261930)?r.memoizedState=a:(r.memoizedState=s,r=Ek(),Ye.lanes|=r,ja|=r,s)}function R_(r,a,s,c){return yr(s,a)?s:Ps.current===null?!(Hi&42)||Hi&1073741824&&!(lt&261930)?(mn=!0,r.memoizedState=s):(r=Ek(),Ye.lanes|=r,ja|=r,a):(r=bh(r,s,c),yr(r,a)||(mn=!0),r)}function I_(r,a,s,c,m){var y=G.p;G.p=y!==0&&8>y?y:8;var C=he.T,R={};he.T=R,_h(r,!1,a,s);try{var H=m(),ie=he.S;ie!==null&&ie(R,H),typeof H=="object"&&H&&typeof H.then=="function"?tc(r,a,RO(H,c),Vr(r)):tc(r,a,c,Vr(r))}catch(ge){tc(r,a,{then:function(){},status:"rejected",reason:ge},Vr())}finally{G.p=y,C!==null&&R.types!==null&&(C.types=R.types),he.T=C}}function MO(){}function wh(r,a,s,c){if(r.tag!==5)throw Error(o(476));var m=A_(r).queue;I_(r,m,a,je,s===null?MO:function(){return L_(r),s(c)})}function A_(r){var a=r.memoizedState;if(a!==null)return a;a={memoizedState:je,baseState:je,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bi,lastRenderedState:je},next:null};var s={};return a.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bi,lastRenderedState:s},next:null},r.memoizedState=a,r=r.alternate,r!==null&&(r.memoizedState=a),a}function L_(r){var a=A_(r);a.next===null&&(a=r.alternate.memoizedState),tc(r,a.next.queue,{},Vr())}function xh(){return In(vc)}function P_(){return sn().memoizedState}function O_(){return sn().memoizedState}function NO(r){for(var a=r.return;a!==null;){switch(a.tag){case 24:case 3:var s=Vr();r=Po(s);var c=Oo(a,r,s);c!==null&&(or(c,a,s),Xl(c,a,s)),a={cache:Xm()},r.payload=a;return}a=a.return}}function jO(r,a,s){var c=Vr();s={lane:c,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},md(r)?N_(a,s):(s=zm(r,a,s,c),s!==null&&(or(s,r,c),j_(s,a,c)))}function M_(r,a,s){tc(r,a,s,Vr())}function tc(r,a,s,c){var m={lane:c,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(md(r))N_(a,m);else{var y=r.alternate;if(r.lanes===0&&(y===null||y.lanes===0)&&(y=a.lastRenderedReducer,y!==null))try{var C=a.lastRenderedState,R=y(C,s);if(m.hasEagerState=!0,m.eagerState=R,yr(R,C))return Qu(r,a,m,0),zt===null&&Ku(),!1}catch{}if(s=zm(r,a,m,c),s!==null)return or(s,r,c),j_(s,a,c),!0}return!1}function _h(r,a,s,c){if(c={lane:2,revertLane:eg(),gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},md(r)){if(a)throw Error(o(479))}else a=zm(r,s,c,2),a!==null&&or(a,r,2)}function md(r){var a=r.alternate;return r===Ye||a!==null&&a===Ye}function N_(r,a){Os=sd=!0;var s=r.pending;s===null?a.next=a:(a.next=s.next,s.next=a),r.pending=a}function j_(r,a,s){if(s&4194048){var c=a.lanes;c&=r.pendingLanes,s|=c,a.lanes=s,mr(r,s)}}var nc={readContext:In,use:ud,useCallback:Zt,useContext:Zt,useEffect:Zt,useImperativeHandle:Zt,useLayoutEffect:Zt,useInsertionEffect:Zt,useMemo:Zt,useReducer:Zt,useRef:Zt,useState:Zt,useDebugValue:Zt,useDeferredValue:Zt,useTransition:Zt,useSyncExternalStore:Zt,useId:Zt,useHostTransitionStatus:Zt,useFormState:Zt,useActionState:Zt,useOptimistic:Zt,useMemoCache:Zt,useCacheRefresh:Zt};nc.useEffectEvent=Zt;var q_={readContext:In,use:ud,useCallback:function(r,a){return Gn().memoizedState=[r,a===void 0?null:a],r},useContext:In,useEffect:x_,useImperativeHandle:function(r,a,s){s=s==null?null:s.concat([r]),fd(4194308,4,S_.bind(null,a,r),s)},useLayoutEffect:function(r,a){return fd(4194308,4,r,a)},useInsertionEffect:function(r,a){fd(4,2,r,a)},useMemo:function(r,a){var s=Gn();a=a===void 0?null:a;var c=r();if(Mo){et(!0);try{r()}finally{et(!1)}}return s.memoizedState=[c,a],c},useReducer:function(r,a,s){var c=Gn();if(s!==void 0){var m=s(a);if(Mo){et(!0);try{s(a)}finally{et(!1)}}}else m=a;return c.memoizedState=c.baseState=m,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:m},c.queue=r,r=r.dispatch=jO.bind(null,Ye,r),[c.memoizedState,r]},useRef:function(r){var a=Gn();return r={current:r},a.memoizedState=r},useState:function(r){r=hh(r);var a=r.queue,s=M_.bind(null,Ye,a);return a.dispatch=s,[r.memoizedState,s]},useDebugValue:vh,useDeferredValue:function(r,a){return bh(Gn(),r,a)},useTransition:function(){var r=hh(!1);return r=I_.bind(null,Ye,r.queue,!0,!1),Gn().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,a,s){var c=Ye,m=Gn();if(dt){if(s===void 0)throw Error(o(407));s=s()}else{if(s=a(),zt===null)throw Error(o(349));lt&127||a_(c,a,s)}m.memoizedState=s;var y={value:s,getSnapshot:a};return m.queue=y,x_(s_.bind(null,c,y,r),[r]),c.flags|=2048,Ns(9,{destroy:void 0},o_.bind(null,c,y,s,a),null),s},useId:function(){var r=Gn(),a=zt.identifierPrefix;if(dt){var s=xi,c=wi;s=(c&~(1<<32-wt(c)-1)).toString(32)+s,a="_"+a+"R_"+s,s=ld++,0<s&&(a+="H"+s.toString(32)),a+="_"}else s=IO++,a="_"+a+"r_"+s.toString(32)+"_";return r.memoizedState=a},useHostTransitionStatus:xh,useFormState:g_,useActionState:g_,useOptimistic:function(r){var a=Gn();a.memoizedState=a.baseState=r;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return a.queue=s,a=_h.bind(null,Ye,!0,s),s.dispatch=a,[r,a]},useMemoCache:fh,useCacheRefresh:function(){return Gn().memoizedState=NO.bind(null,Ye)},useEffectEvent:function(r){var a=Gn(),s={impl:r};return a.memoizedState=s,function(){if(xt&2)throw Error(o(440));return s.impl.apply(void 0,arguments)}}},kh={readContext:In,use:ud,useCallback:T_,useContext:In,useEffect:yh,useImperativeHandle:E_,useInsertionEffect:k_,useLayoutEffect:C_,useMemo:D_,useReducer:dd,useRef:w_,useState:function(){return dd(Bi)},useDebugValue:vh,useDeferredValue:function(r,a){return R_(sn(),Pt.memoizedState,r,a)},useTransition:function(){var r=dd(Bi)[0],a=sn().memoizedState;return[typeof r=="boolean"?r:ec(r),a]},useSyncExternalStore:i_,useId:P_,useHostTransitionStatus:xh,useFormState:y_,useActionState:y_,useOptimistic:function(r,a){return u_(sn(),Pt,r,a)},useMemoCache:fh,useCacheRefresh:O_};kh.useEffectEvent=__;var z_={readContext:In,use:ud,useCallback:T_,useContext:In,useEffect:yh,useImperativeHandle:E_,useInsertionEffect:k_,useLayoutEffect:C_,useMemo:D_,useReducer:mh,useRef:w_,useState:function(){return mh(Bi)},useDebugValue:vh,useDeferredValue:function(r,a){var s=sn();return Pt===null?bh(s,r,a):R_(s,Pt.memoizedState,r,a)},useTransition:function(){var r=mh(Bi)[0],a=sn().memoizedState;return[typeof r=="boolean"?r:ec(r),a]},useSyncExternalStore:i_,useId:P_,useHostTransitionStatus:xh,useFormState:b_,useActionState:b_,useOptimistic:function(r,a){var s=sn();return Pt===null?(s.baseState=r,[r,s.queue.dispatch]):u_(s,Pt,r,a)},useMemoCache:fh,useCacheRefresh:O_};z_.useEffectEvent=__;function Ch(r,a,s,c){a=r.memoizedState,s=s(c,a),s=s==null?a:S({},a,s),r.memoizedState=s,r.lanes===0&&(r.updateQueue.baseState=s)}var Sh={enqueueSetState:function(r,a,s){r=r._reactInternals;var c=Vr(),m=Po(c);m.payload=a,s!=null&&(m.callback=s),a=Oo(r,m,c),a!==null&&(or(a,r,c),Xl(a,r,c))},enqueueReplaceState:function(r,a,s){r=r._reactInternals;var c=Vr(),m=Po(c);m.tag=1,m.payload=a,s!=null&&(m.callback=s),a=Oo(r,m,c),a!==null&&(or(a,r,c),Xl(a,r,c))},enqueueForceUpdate:function(r,a){r=r._reactInternals;var s=Vr(),c=Po(s);c.tag=2,a!=null&&(c.callback=a),a=Oo(r,c,s),a!==null&&(or(a,r,s),Xl(a,r,s))}};function F_(r,a,s,c,m,y,C){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(c,y,C):a.prototype&&a.prototype.isPureReactComponent?!Vl(s,c)||!Vl(m,y):!0}function $_(r,a,s,c){r=a.state,typeof a.componentWillReceiveProps=="function"&&a.componentWillReceiveProps(s,c),typeof a.UNSAFE_componentWillReceiveProps=="function"&&a.UNSAFE_componentWillReceiveProps(s,c),a.state!==r&&Sh.enqueueReplaceState(a,a.state,null)}function No(r,a){var s=a;if("ref"in a)for(var c in s={},a)c!=="ref"&&(s[c]=a[c]);if(r=r.defaultProps)for(var m in s===a&&(s=S({},s)),r)s[m]===void 0&&(s[m]=r[m]);return s}function qO(r){Uu(r)}function zO(r){console.error(r)}function FO(r){Uu(r)}function hd(r,a){try{var s=r.onUncaughtError;s(a.value,{componentStack:a.stack})}catch(c){setTimeout(function(){throw c})}}function V_(r,a,s){try{var c=r.onCaughtError;c(s.value,{componentStack:s.stack,errorBoundary:a.tag===1?a.stateNode:null})}catch(m){setTimeout(function(){throw m})}}function Eh(r,a,s){return s=Po(s),s.tag=3,s.payload={element:null},s.callback=function(){hd(r,a)},s}function H_(r){return r=Po(r),r.tag=3,r}function B_(r,a,s,c){var m=s.type.getDerivedStateFromError;if(typeof m=="function"){var y=c.value;r.payload=function(){return m(y)},r.callback=function(){V_(a,s,c)}}var C=s.stateNode;C!==null&&typeof C.componentDidCatch=="function"&&(r.callback=function(){V_(a,s,c),typeof m!="function"&&(qa===null?qa=new Set([this]):qa.add(this));var R=c.stack;this.componentDidCatch(c.value,{componentStack:R===null?"":R})})}function $O(r,a,s,c,m){if(s.flags|=32768,typeof c=="object"&&c&&typeof c.then=="function"){if(a=s.alternate,a!==null&&Ds(a,s,m,!0),s=br.current,s!==null){switch(s.tag){case 31:case 13:return ai===null?Td():s.alternate===null&&en===0&&(en=3),s.flags&=-257,s.flags|=65536,s.lanes=m,c===nd?s.flags|=16384:(a=s.updateQueue,a===null?s.updateQueue=new Set([c]):a.add(c),Jh(r,c,m)),!1;case 22:return s.flags|=65536,c===nd?s.flags|=16384:(a=s.updateQueue,a===null?(a={transitions:null,markerInstances:null,retryQueue:new Set([c])},s.updateQueue=a):(s=a.retryQueue,s===null?a.retryQueue=new Set([c]):s.add(c)),Jh(r,c,m)),!1}throw Error(o(435,s.tag))}return Jh(r,c,m),Td(),!1}if(dt)return a=br.current,a===null?(c!==Wm&&(a=Error(o(423),{cause:c}),Wl(qr(a,s))),r=r.current.alternate,r.flags|=65536,m&=-m,r.lanes|=m,c=qr(c,s),m=Eh(r.stateNode,c,m),nh(r,m),en!==4&&(en=2)):(!(a.flags&65536)&&(a.flags|=256),a.flags|=65536,a.lanes=m,c!==Wm&&(r=Error(o(422),{cause:c}),Wl(qr(r,s)))),!1;var y=Error(o(520),{cause:c});if(y=qr(y,s),uc===null?uc=[y]:uc.push(y),en!==4&&(en=2),a===null)return!0;c=qr(c,s),s=a;do{switch(s.tag){case 3:return s.flags|=65536,r=m&-m,s.lanes|=r,r=Eh(s.stateNode,c,r),nh(s,r),!1;case 1:if(a=s.type,y=s.stateNode,!(s.flags&128)&&(typeof a.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(qa===null||!qa.has(y))))return s.flags|=65536,m&=-m,s.lanes|=m,m=H_(m),B_(m,r,s,c),nh(s,m),!1}s=s.return}while(s!==null);return!1}var Th=Error(o(461)),mn=!1;function An(r,a,s,c){a.child=r===null?Jx(a,null,s,c):Lo(a,r.child,s,c)}function W_(r,a,s,c,m){s=s.render;var y=a.ref;if("ref"in c){var C={};for(var R in c)R!=="ref"&&(C[R]=c[R])}else C=c;return Do(a),c=lh(r,a,s,C,y,m),R=ch(),r!==null&&!mn?(uh(r,a,m),Wi(r,a,m)):(dt&&R&&Hm(a),a.flags|=1,An(r,a,c,m),a.child)}function U_(r,a,s,c,m){if(r===null){var y=s.type;return typeof y=="function"&&!Fm(y)&&y.defaultProps===void 0&&s.compare===null?(a.tag=15,a.type=y,K_(r,a,y,c,m)):(r=Xu(s.type,null,c,a,a.mode,m),r.ref=a.ref,r.return=a,a.child=r)}if(y=r.child,!Mh(r,m)){var C=y.memoizedProps;if(s=s.compare,s=s===null?Vl:s,s(C,c)&&r.ref===a.ref)return Wi(r,a,m)}return a.flags|=1,r=zi(y,c),r.ref=a.ref,r.return=a,a.child=r}function K_(r,a,s,c,m){if(r!==null){var y=r.memoizedProps;if(Vl(y,c)&&r.ref===a.ref)if(mn=!1,a.pendingProps=c=y,Mh(r,m))r.flags&131072&&(mn=!0);else return a.lanes=r.lanes,Wi(r,a,m)}return Dh(r,a,s,c,m)}function Q_(r,a,s,c){var m=c.children,y=r===null?null:r.memoizedState;if(r===null&&a.stateNode===null&&(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.mode==="hidden"){if(a.flags&128){if(y=y===null?s:y.baseLanes|s,r!==null){for(c=a.child=r.child,m=0;c!==null;)m=m|c.lanes|c.childLanes,c=c.sibling;c=m&~y}else c=0,a.child=null;return G_(r,a,y,s,c)}if(s&536870912)a.memoizedState={baseLanes:0,cachePool:null},r!==null&&ed(a,y===null?null:y.cachePool),y===null?ih():e_(a,y),t_(a);else return c=a.lanes=536870912,G_(r,a,y===null?s:y.baseLanes|s,s,c)}else y===null?(r!==null&&ed(a,null),ih(),Oa(a)):(ed(a,y.cachePool),e_(a,y),Oa(a),a.memoizedState=null);return An(r,a,m,s),a.child}function rc(r,a){return r!==null&&r.tag===22||a.stateNode!==null||(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.sibling}function G_(r,a,s,c,m){var y=Ym();return y=y===null?null:{parent:fn._currentValue,pool:y},a.memoizedState={baseLanes:s,cachePool:y},r!==null&&ed(a,null),ih(),t_(a),r!==null&&Ds(r,a,c,!0),a.childLanes=m,null}function gd(r,a){return a=vd({mode:a.mode,children:a.children},r.mode),a.ref=r.ref,r.child=a,a.return=r,a}function X_(r,a,s){return Lo(a,r.child,null,s),r=gd(a,a.pendingProps),r.flags|=2,wr(a),a.memoizedState=null,r}function VO(r,a,s){var c=a.pendingProps,m=(a.flags&128)!=0;if(a.flags&=-129,r===null){if(dt){if(c.mode==="hidden")return r=gd(a,c),a.lanes=536870912,rc(null,r);if(oh(a),(r=Bt)?(r=cC(r,$r),r=r!==null&&r.data==="&"?r:null,r!==null&&(a.memoizedState={dehydrated:r,treeContext:Da===null?null:{id:wi,overflow:xi},retryLane:536870912,hydrationErrors:null},s=Nx(r),s.return=a,a.child=s,Rn=a,Bt=null)):r=null,r===null)throw Ia(a);return a.lanes=536870912,null}return gd(a,c)}var y=r.memoizedState;if(y!==null){var C=y.dehydrated;if(oh(a),m)if(a.flags&256)a.flags&=-257,a=X_(r,a,s);else if(a.memoizedState!==null)a.child=r.child,a.flags|=128,a=null;else throw Error(o(558));else if(mn||Ds(r,a,s,!1),m=(s&r.childLanes)!==0,mn||m){if(c=zt,c!==null&&(C=A(c,s),C!==0&&C!==y.retryLane))throw y.retryLane=C,Co(r,C),or(c,r,C),Th;Td(),a=X_(r,a,s)}else r=y.treeContext,Bt=Hr(C.nextSibling),Rn=a,dt=!0,Ra=null,$r=!1,r!==null&&zx(a,r),a=gd(a,c),a.flags|=4096;return a}return r=zi(r.child,{mode:c.mode,children:c.children}),r.ref=a.ref,a.child=r,r.return=a,r}function yd(r,a){var s=a.ref;if(s===null)r!==null&&r.ref!==null&&(a.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(o(284));(r===null||r.ref!==s)&&(a.flags|=4194816)}}function Dh(r,a,s,c,m){return Do(a),s=lh(r,a,s,c,void 0,m),c=ch(),r!==null&&!mn?(uh(r,a,m),Wi(r,a,m)):(dt&&c&&Hm(a),a.flags|=1,An(r,a,s,m),a.child)}function J_(r,a,s,c,m,y){return Do(a),a.updateQueue=null,s=r_(a,c,s,m),n_(r),c=ch(),r!==null&&!mn?(uh(r,a,y),Wi(r,a,y)):(dt&&c&&Hm(a),a.flags|=1,An(r,a,s,y),a.child)}function Y_(r,a,s,c,m){if(Do(a),a.stateNode===null){var y=Cs,C=s.contextType;typeof C=="object"&&C&&(y=In(C)),y=new s(c,y),a.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,y.updater=Sh,a.stateNode=y,y._reactInternals=a,y=a.stateNode,y.props=c,y.state=a.memoizedState,y.refs={},eh(a),C=s.contextType,y.context=typeof C=="object"&&C?In(C):Cs,y.state=a.memoizedState,C=s.getDerivedStateFromProps,typeof C=="function"&&(Ch(a,s,C,c),y.state=a.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof y.getSnapshotBeforeUpdate=="function"||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(C=y.state,typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount(),C!==y.state&&Sh.enqueueReplaceState(y,y.state,null),Yl(a,c,y,m),Jl(),y.state=a.memoizedState),typeof y.componentDidMount=="function"&&(a.flags|=4194308),c=!0}else if(r===null){y=a.stateNode;var R=a.memoizedProps,H=No(s,R);y.props=H;var ie=y.context,ge=s.contextType;C=Cs,typeof ge=="object"&&ge&&(C=In(ge));var ve=s.getDerivedStateFromProps;ge=typeof ve=="function"||typeof y.getSnapshotBeforeUpdate=="function",R=a.pendingProps!==R,ge||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(R||ie!==C)&&$_(a,y,c,C),La=!1;var se=a.memoizedState;y.state=se,Yl(a,c,y,m),Jl(),ie=a.memoizedState,R||se!==ie||La?(typeof ve=="function"&&(Ch(a,s,ve,c),ie=a.memoizedState),(H=La||F_(a,s,H,c,se,ie,C))?(ge||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount()),typeof y.componentDidMount=="function"&&(a.flags|=4194308)):(typeof y.componentDidMount=="function"&&(a.flags|=4194308),a.memoizedProps=c,a.memoizedState=ie),y.props=c,y.state=ie,y.context=C,c=H):(typeof y.componentDidMount=="function"&&(a.flags|=4194308),c=!1)}else{y=a.stateNode,th(r,a),C=a.memoizedProps,ge=No(s,C),y.props=ge,ve=a.pendingProps,se=y.context,ie=s.contextType,H=Cs,typeof ie=="object"&&ie&&(H=In(ie)),R=s.getDerivedStateFromProps,(ie=typeof R=="function"||typeof y.getSnapshotBeforeUpdate=="function")||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(C!==ve||se!==H)&&$_(a,y,c,H),La=!1,se=a.memoizedState,y.state=se,Yl(a,c,y,m),Jl();var fe=a.memoizedState;C!==ve||se!==fe||La||r!==null&&r.dependencies!==null&&Yu(r.dependencies)?(typeof R=="function"&&(Ch(a,s,R,c),fe=a.memoizedState),(ge=La||F_(a,s,ge,c,se,fe,H)||r!==null&&r.dependencies!==null&&Yu(r.dependencies))?(ie||typeof y.UNSAFE_componentWillUpdate!="function"&&typeof y.componentWillUpdate!="function"||(typeof y.componentWillUpdate=="function"&&y.componentWillUpdate(c,fe,H),typeof y.UNSAFE_componentWillUpdate=="function"&&y.UNSAFE_componentWillUpdate(c,fe,H)),typeof y.componentDidUpdate=="function"&&(a.flags|=4),typeof y.getSnapshotBeforeUpdate=="function"&&(a.flags|=1024)):(typeof y.componentDidUpdate!="function"||C===r.memoizedProps&&se===r.memoizedState||(a.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||C===r.memoizedProps&&se===r.memoizedState||(a.flags|=1024),a.memoizedProps=c,a.memoizedState=fe),y.props=c,y.state=fe,y.context=H,c=ge):(typeof y.componentDidUpdate!="function"||C===r.memoizedProps&&se===r.memoizedState||(a.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||C===r.memoizedProps&&se===r.memoizedState||(a.flags|=1024),c=!1)}return y=c,yd(r,a),c=(a.flags&128)!=0,y||c?(y=a.stateNode,s=c&&typeof s.getDerivedStateFromError!="function"?null:y.render(),a.flags|=1,r!==null&&c?(a.child=Lo(a,r.child,null,m),a.child=Lo(a,null,s,m)):An(r,a,s,m),a.memoizedState=y.state,r=a.child):r=Wi(r,a,m),r}function Z_(r,a,s,c){return Eo(),a.flags|=256,An(r,a,s,c),a.child}var Rh={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ih(r){return{baseLanes:r,cachePool:Wx()}}function Ah(r,a,s){return r=r===null?0:r.childLanes&~s,a&&(r|=_r),r}function ek(r,a,s){var c=a.pendingProps,m=!1,y=(a.flags&128)!=0,C;if((C=y)||(C=r!==null&&r.memoizedState===null?!1:(on.current&2)!=0),C&&(m=!0,a.flags&=-129),C=(a.flags&32)!=0,a.flags&=-33,r===null){if(dt){if(m?Pa(a):Oa(a),(r=Bt)?(r=cC(r,$r),r=r!==null&&r.data!=="&"?r:null,r!==null&&(a.memoizedState={dehydrated:r,treeContext:Da===null?null:{id:wi,overflow:xi},retryLane:536870912,hydrationErrors:null},s=Nx(r),s.return=a,a.child=s,Rn=a,Bt=null)):r=null,r===null)throw Ia(a);return fg(r)?a.lanes=32:a.lanes=536870912,null}var R=c.children;return c=c.fallback,m?(Oa(a),m=a.mode,R=vd({mode:"hidden",children:R},m),c=So(c,m,s,null),R.return=a,c.return=a,R.sibling=c,a.child=R,c=a.child,c.memoizedState=Ih(s),c.childLanes=Ah(r,C,s),a.memoizedState=Rh,rc(null,c)):(Pa(a),Lh(a,R))}var H=r.memoizedState;if(H!==null&&(R=H.dehydrated,R!==null)){if(y)a.flags&256?(Pa(a),a.flags&=-257,a=Ph(r,a,s)):a.memoizedState===null?(Oa(a),R=c.fallback,m=a.mode,c=vd({mode:"visible",children:c.children},m),R=So(R,m,s,null),R.flags|=2,c.return=a,R.return=a,c.sibling=R,a.child=c,Lo(a,r.child,null,s),c=a.child,c.memoizedState=Ih(s),c.childLanes=Ah(r,C,s),a.memoizedState=Rh,a=rc(null,c)):(Oa(a),a.child=r.child,a.flags|=128,a=null);else if(Pa(a),fg(R)){if(C=R.nextSibling&&R.nextSibling.dataset,C)var ie=C.dgst;C=ie,c=Error(o(419)),c.stack="",c.digest=C,Wl({value:c,source:null,stack:null}),a=Ph(r,a,s)}else if(mn||Ds(r,a,s,!1),C=(s&r.childLanes)!==0,mn||C){if(C=zt,C!==null&&(c=A(C,s),c!==0&&c!==H.retryLane))throw H.retryLane=c,Co(r,c),or(C,r,c),Th;dg(R)||Td(),a=Ph(r,a,s)}else dg(R)?(a.flags|=192,a.child=r.child,a=null):(r=H.treeContext,Bt=Hr(R.nextSibling),Rn=a,dt=!0,Ra=null,$r=!1,r!==null&&zx(a,r),a=Lh(a,c.children),a.flags|=4096);return a}return m?(Oa(a),R=c.fallback,m=a.mode,H=r.child,ie=H.sibling,c=zi(H,{mode:"hidden",children:c.children}),c.subtreeFlags=H.subtreeFlags&65011712,ie===null?(R=So(R,m,s,null),R.flags|=2):R=zi(ie,R),R.return=a,c.return=a,c.sibling=R,a.child=c,rc(null,c),c=a.child,R=r.child.memoizedState,R===null?R=Ih(s):(m=R.cachePool,m===null?m=Wx():(H=fn._currentValue,m=m.parent===H?m:{parent:H,pool:H}),R={baseLanes:R.baseLanes|s,cachePool:m}),c.memoizedState=R,c.childLanes=Ah(r,C,s),a.memoizedState=Rh,rc(r.child,c)):(Pa(a),s=r.child,r=s.sibling,s=zi(s,{mode:"visible",children:c.children}),s.return=a,s.sibling=null,r!==null&&(C=a.deletions,C===null?(a.deletions=[r],a.flags|=16):C.push(r)),a.child=s,a.memoizedState=null,s)}function Lh(r,a){return a=vd({mode:"visible",children:a},r.mode),a.return=r,r.child=a}function vd(r,a){return r=vr(22,r,null,a),r.lanes=0,r}function Ph(r,a,s){return Lo(a,r.child,null,s),r=Lh(a,a.pendingProps.children),r.flags|=2,a.memoizedState=null,r}function tk(r,a,s){r.lanes|=a;var c=r.alternate;c!==null&&(c.lanes|=a),Qm(r.return,a,s)}function Oh(r,a,s,c,m,y){var C=r.memoizedState;C===null?r.memoizedState={isBackwards:a,rendering:null,renderingStartTime:0,last:c,tail:s,tailMode:m,treeForkCount:y}:(C.isBackwards=a,C.rendering=null,C.renderingStartTime=0,C.last=c,C.tail=s,C.tailMode=m,C.treeForkCount=y)}function nk(r,a,s){var c=a.pendingProps,m=c.revealOrder,y=c.tail;c=c.children;var C=on.current,R=(C&2)!=0;if(R?(C=C&1|2,a.flags|=128):C&=1,Oe(on,C),An(r,a,c,s),c=dt?Bl:0,!R&&r!==null&&r.flags&128)e:for(r=a.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&tk(r,s,a);else if(r.tag===19)tk(r,s,a);else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===a)break e;for(;r.sibling===null;){if(r.return===null||r.return===a)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}switch(m){case"forwards":for(s=a.child,m=null;s!==null;)r=s.alternate,r!==null&&od(r)===null&&(m=s),s=s.sibling;s=m,s===null?(m=a.child,a.child=null):(m=s.sibling,s.sibling=null),Oh(a,!1,m,s,y,c);break;case"backwards":case"unstable_legacy-backwards":for(s=null,m=a.child,a.child=null;m!==null;){if(r=m.alternate,r!==null&&od(r)===null){a.child=m;break}r=m.sibling,m.sibling=s,s=m,m=r}Oh(a,!0,s,null,y,c);break;case"together":Oh(a,!1,null,null,void 0,c);break;default:a.memoizedState=null}return a.child}function Wi(r,a,s){if(r!==null&&(a.dependencies=r.dependencies),ja|=a.lanes,(s&a.childLanes)===0)if(r!==null){if(Ds(r,a,s,!1),(s&a.childLanes)===0)return null}else return null;if(r!==null&&a.child!==r.child)throw Error(o(153));if(a.child!==null){for(r=a.child,s=zi(r,r.pendingProps),a.child=s,s.return=a;r.sibling!==null;)r=r.sibling,s=s.sibling=zi(r,r.pendingProps),s.return=a;s.sibling=null}return a.child}function Mh(r,a){return(r.lanes&a)===0?(r=r.dependencies,!!(r!==null&&Yu(r))):!0}function HO(r,a,s){switch(a.tag){case 3:gn(a,a.stateNode.containerInfo),Aa(a,fn,r.memoizedState.cache),Eo();break;case 27:case 5:cn(a);break;case 4:gn(a,a.stateNode.containerInfo);break;case 10:Aa(a,a.type,a.memoizedProps.value);break;case 31:if(a.memoizedState!==null)return a.flags|=128,oh(a),null;break;case 13:var c=a.memoizedState;if(c!==null)return c.dehydrated===null?(s&a.child.childLanes)===0?(Pa(a),r=Wi(r,a,s),r===null?null:r.sibling):ek(r,a,s):(Pa(a),a.flags|=128,null);Pa(a);break;case 19:var m=(r.flags&128)!=0;if(c=(s&a.childLanes)!==0,c||(c=(Ds(r,a,s,!1),(s&a.childLanes)!==0)),m){if(c)return nk(r,a,s);a.flags|=128}if(m=a.memoizedState,m!==null&&(m.rendering=null,m.tail=null,m.lastEffect=null),Oe(on,on.current),c)break;return null;case 22:return a.lanes=0,Q_(r,a,s,a.pendingProps);case 24:Aa(a,fn,r.memoizedState.cache)}return Wi(r,a,s)}function rk(r,a,s){if(r!==null)if(r.memoizedProps!==a.pendingProps)mn=!0;else{if(!Mh(r,s)&&!(a.flags&128))return mn=!1,HO(r,a,s);mn=!!(r.flags&131072)}else mn=!1,dt&&a.flags&1048576&&qx(a,Bl,a.index);switch(a.lanes=0,a.tag){case 16:e:{var c=a.pendingProps;if(r=Io(a.elementType),a.type=r,typeof r=="function")Fm(r)?(c=No(r,c),a.tag=1,a=Y_(null,a,r,c,s)):(a.tag=0,a=Dh(null,a,r,c,s));else{if(r!=null){var m=r.$$typeof;if(m===me){a.tag=11,a=W_(null,a,r,c,s);break e}else if(m===ae){a.tag=14,a=U_(null,a,r,c,s);break e}}throw a=ce(r)||r,Error(o(306,a,""))}}return a;case 0:return Dh(r,a,a.type,a.pendingProps,s);case 1:return c=a.type,m=No(c,a.pendingProps),Y_(r,a,c,m,s);case 3:e:{if(gn(a,a.stateNode.containerInfo),r===null)throw Error(o(387));c=a.pendingProps;var y=a.memoizedState;m=y.element,th(r,a),Yl(a,c,null,s);var C=a.memoizedState;if(c=C.cache,Aa(a,fn,c),c!==y.cache&&Gm(a,[fn],s,!0),Jl(),c=C.element,y.isDehydrated)if(y={element:c,isDehydrated:!1,cache:C.cache},a.updateQueue.baseState=y,a.memoizedState=y,a.flags&256){a=Z_(r,a,c,s);break e}else if(c!==m){m=qr(Error(o(424)),a),Wl(m),a=Z_(r,a,c,s);break e}else for((r=a.stateNode.containerInfo,r.nodeType)===9?r=r.body:r=r.nodeName==="HTML"?r.ownerDocument.body:r,Bt=Hr(r.firstChild),Rn=a,dt=!0,Ra=null,$r=!0,s=Jx(a,null,c,s),a.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling;else{if(Eo(),c===m){a=Wi(r,a,s);break e}An(r,a,c,s)}a=a.child}return a;case 26:return yd(r,a),r===null?(s=hC(a.type,null,a.pendingProps,null))?a.memoizedState=s:dt||(s=a.type,r=a.pendingProps,c=Od(bt.current).createElement(s),c[Ue]=a,c[Ke]=r,Ln(c,s,r),an(c),a.stateNode=c):a.memoizedState=hC(a.type,r.memoizedProps,a.pendingProps,r.memoizedState),null;case 27:return cn(a),r===null&&dt&&(c=a.stateNode=fC(a.type,a.pendingProps,bt.current),Rn=a,$r=!0,m=Bt,Va(a.type)?(pg=m,Bt=Hr(c.firstChild)):Bt=m),An(r,a,a.pendingProps.children,s),yd(r,a),r===null&&(a.flags|=4194304),a.child;case 5:return r===null&&dt&&((m=c=Bt)&&(c=yM(c,a.type,a.pendingProps,$r),c===null?m=!1:(a.stateNode=c,Rn=a,Bt=Hr(c.firstChild),$r=!1,m=!0)),m||Ia(a)),cn(a),m=a.type,y=a.pendingProps,C=r===null?null:r.memoizedProps,c=y.children,lg(m,y)?c=null:C!==null&&lg(m,C)&&(a.flags|=32),a.memoizedState!==null&&(m=lh(r,a,AO,null,null,s),vc._currentValue=m),yd(r,a),An(r,a,c,s),a.child;case 6:return r===null&&dt&&((r=s=Bt)&&(s=vM(s,a.pendingProps,$r),s===null?r=!1:(a.stateNode=s,Rn=a,Bt=null,r=!0)),r||Ia(a)),null;case 13:return ek(r,a,s);case 4:return gn(a,a.stateNode.containerInfo),c=a.pendingProps,r===null?a.child=Lo(a,null,c,s):An(r,a,c,s),a.child;case 11:return W_(r,a,a.type,a.pendingProps,s);case 7:return An(r,a,a.pendingProps,s),a.child;case 8:return An(r,a,a.pendingProps.children,s),a.child;case 12:return An(r,a,a.pendingProps.children,s),a.child;case 10:return c=a.pendingProps,Aa(a,a.type,c.value),An(r,a,c.children,s),a.child;case 9:return m=a.type._context,c=a.pendingProps.children,Do(a),m=In(m),c=c(m),a.flags|=1,An(r,a,c,s),a.child;case 14:return U_(r,a,a.type,a.pendingProps,s);case 15:return K_(r,a,a.type,a.pendingProps,s);case 19:return nk(r,a,s);case 31:return VO(r,a,s);case 22:return Q_(r,a,s,a.pendingProps);case 24:return Do(a),c=In(fn),r===null?(m=Ym(),m===null&&(m=zt,y=Xm(),m.pooledCache=y,y.refCount++,y!==null&&(m.pooledCacheLanes|=s),m=y),a.memoizedState={parent:c,cache:m},eh(a),Aa(a,fn,m)):((r.lanes&s)!==0&&(th(r,a),Yl(a,null,null,s),Jl()),m=r.memoizedState,y=a.memoizedState,m.parent===c?(c=y.cache,Aa(a,fn,c),c!==m.cache&&Gm(a,[fn],s,!0)):(m={parent:c,cache:c},a.memoizedState=m,a.lanes===0&&(a.memoizedState=a.updateQueue.baseState=m),Aa(a,fn,c))),An(r,a,a.pendingProps.children,s),a.child;case 29:throw a.pendingProps}throw Error(o(156,a.tag))}function Ui(r){r.flags|=4}function Nh(r,a,s,c,m){if((a=(r.mode&32)!=0)&&(a=!1),a){if(r.flags|=16777216,(m&335544128)===m)if(r.stateNode.complete)r.flags|=8192;else if(Ik())r.flags|=8192;else throw Ao=nd,Zm}else r.flags&=-16777217}function ik(r,a){if(a.type!=="stylesheet"||a.state.loading&4)r.flags&=-16777217;else if(r.flags|=16777216,!wC(a))if(Ik())r.flags|=8192;else throw Ao=nd,Zm}function bd(r,a){a!==null&&(r.flags|=4),r.flags&16384&&(a=r.tag===22?536870912:Pi(),r.lanes|=a,Fs|=a)}function ic(r,a){if(!dt)switch(r.tailMode){case"hidden":a=r.tail;for(var s=null;a!==null;)a.alternate!==null&&(s=a),a=a.sibling;s===null?r.tail=null:s.sibling=null;break;case"collapsed":s=r.tail;for(var c=null;s!==null;)s.alternate!==null&&(c=s),s=s.sibling;c===null?a||r.tail===null?r.tail=null:r.tail.sibling=null:c.sibling=null}}function Wt(r){var a=r.alternate!==null&&r.alternate.child===r.child,s=0,c=0;if(a)for(var m=r.child;m!==null;)s|=m.lanes|m.childLanes,c|=m.subtreeFlags&65011712,c|=m.flags&65011712,m.return=r,m=m.sibling;else for(m=r.child;m!==null;)s|=m.lanes|m.childLanes,c|=m.subtreeFlags,c|=m.flags,m.return=r,m=m.sibling;return r.subtreeFlags|=c,r.childLanes=s,a}function BO(r,a,s){var c=a.pendingProps;switch(Bm(a),a.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Wt(a),null;case 1:return Wt(a),null;case 3:return s=a.stateNode,c=null,r!==null&&(c=r.memoizedState.cache),a.memoizedState.cache!==c&&(a.flags|=2048),Vi(fn),Xe(),s.pendingContext&&(s.pendingContext=(s.context=s.pendingContext,null)),(r===null||r.child===null)&&(Ts(a)?Ui(a):r===null||r.memoizedState.isDehydrated&&!(a.flags&256)||(a.flags|=1024,Um())),Wt(a),null;case 26:var m=a.type,y=a.memoizedState;return r===null?(Ui(a),y===null?(Wt(a),Nh(a,m,null,c,s)):(Wt(a),ik(a,y))):y?y===r.memoizedState?(Wt(a),a.flags&=-16777217):(Ui(a),Wt(a),ik(a,y)):(r=r.memoizedProps,r!==c&&Ui(a),Wt(a),Nh(a,m,r,c,s)),null;case 27:if(Ct(a),s=bt.current,m=a.type,r!==null&&a.stateNode!=null)r.memoizedProps!==c&&Ui(a);else{if(!c){if(a.stateNode===null)throw Error(o(166));return Wt(a),null}r=Be.current,Ts(a)?Fx(a,r):(r=fC(m,c,s),a.stateNode=r,Ui(a))}return Wt(a),null;case 5:if(Ct(a),m=a.type,r!==null&&a.stateNode!=null)r.memoizedProps!==c&&Ui(a);else{if(!c){if(a.stateNode===null)throw Error(o(166));return Wt(a),null}if(y=Be.current,Ts(a))Fx(a,y);else{var C=Od(bt.current);switch(y){case 1:y=C.createElementNS("http://www.w3.org/2000/svg",m);break;case 2:y=C.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;default:switch(m){case"svg":y=C.createElementNS("http://www.w3.org/2000/svg",m);break;case"math":y=C.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;case"script":y=C.createElement("div"),y.innerHTML="<script><\/script>",y=y.removeChild(y.firstChild);break;case"select":y=typeof c.is=="string"?C.createElement("select",{is:c.is}):C.createElement("select"),c.multiple?y.multiple=!0:c.size&&(y.size=c.size);break;default:y=typeof c.is=="string"?C.createElement(m,{is:c.is}):C.createElement(m)}}y[Ue]=a,y[Ke]=c;e:for(C=a.child;C!==null;){if(C.tag===5||C.tag===6)y.appendChild(C.stateNode);else if(C.tag!==4&&C.tag!==27&&C.child!==null){C.child.return=C,C=C.child;continue}if(C===a)break e;for(;C.sibling===null;){if(C.return===null||C.return===a)break e;C=C.return}C.sibling.return=C.return,C=C.sibling}a.stateNode=y;e:switch(Ln(y,m,c),m){case"button":case"input":case"select":case"textarea":c=!!c.autoFocus;break e;case"img":c=!0;break e;default:c=!1}c&&Ui(a)}}return Wt(a),Nh(a,a.type,r===null?null:r.memoizedProps,a.pendingProps,s),null;case 6:if(r&&a.stateNode!=null)r.memoizedProps!==c&&Ui(a);else{if(typeof c!="string"&&a.stateNode===null)throw Error(o(166));if(r=bt.current,Ts(a)){if(r=a.stateNode,s=a.memoizedProps,c=null,m=Rn,m!==null)switch(m.tag){case 27:case 5:c=m.memoizedProps}r[Ue]=a,r=!!(r.nodeValue===s||c!==null&&c.suppressHydrationWarning===!0||tC(r.nodeValue,s)),r||Ia(a,!0)}else r=Od(r).createTextNode(c),r[Ue]=a,a.stateNode=r}return Wt(a),null;case 31:if(s=a.memoizedState,r===null||r.memoizedState!==null){if(c=Ts(a),s!==null){if(r===null){if(!c)throw Error(o(318));if(r=a.memoizedState,r=r===null?null:r.dehydrated,!r)throw Error(o(557));r[Ue]=a}else Eo(),!(a.flags&128)&&(a.memoizedState=null),a.flags|=4;Wt(a),r=!1}else s=Um(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=s),r=!0;if(!r)return a.flags&256?(wr(a),a):(wr(a),null);if(a.flags&128)throw Error(o(558))}return Wt(a),null;case 13:if(c=a.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(m=Ts(a),c!==null&&c.dehydrated!==null){if(r===null){if(!m)throw Error(o(318));if(m=a.memoizedState,m=m===null?null:m.dehydrated,!m)throw Error(o(317));m[Ue]=a}else Eo(),!(a.flags&128)&&(a.memoizedState=null),a.flags|=4;Wt(a),m=!1}else m=Um(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=m),m=!0;if(!m)return a.flags&256?(wr(a),a):(wr(a),null)}return wr(a),a.flags&128?(a.lanes=s,a):(s=c!==null,r=r!==null&&r.memoizedState!==null,s&&(c=a.child,m=null,c.alternate!==null&&c.alternate.memoizedState!==null&&c.alternate.memoizedState.cachePool!==null&&(m=c.alternate.memoizedState.cachePool.pool),y=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(y=c.memoizedState.cachePool.pool),y!==m&&(c.flags|=2048)),s!==r&&s&&(a.child.flags|=8192),bd(a,a.updateQueue),Wt(a),null);case 4:return Xe(),r===null&&Jk(a.stateNode.containerInfo),Wt(a),null;case 10:return Vi(a.type),Wt(a),null;case 19:if(Fe(on),c=a.memoizedState,c===null)return Wt(a),null;if(m=(a.flags&128)!=0,y=c.rendering,y===null)if(m)ic(c,!1);else{if(en!==0||r!==null&&r.flags&128)for(r=a.child;r!==null;){if(y=od(r),y!==null){for(a.flags|=128,ic(c,!1),r=y.updateQueue,a.updateQueue=r,bd(a,r),a.subtreeFlags=0,r=s,s=a.child;s!==null;)Mx(s,r),s=s.sibling;return Oe(on,on.current&1|2),dt&&Fi(a,c.treeForkCount),a.child}r=r.sibling}c.tail!==null&&Yt()>Cd&&(a.flags|=128,m=!0,ic(c,!1),a.lanes=4194304)}else{if(!m)if(r=od(y),r!==null){if(a.flags|=128,m=!0,r=r.updateQueue,a.updateQueue=r,bd(a,r),ic(c,!0),c.tail===null&&c.tailMode==="hidden"&&!y.alternate&&!dt)return Wt(a),null}else 2*Yt()-c.renderingStartTime>Cd&&s!==536870912&&(a.flags|=128,m=!0,ic(c,!1),a.lanes=4194304);c.isBackwards?(y.sibling=a.child,a.child=y):(r=c.last,r===null?a.child=y:r.sibling=y,c.last=y)}return c.tail===null?(Wt(a),null):(r=c.tail,c.rendering=r,c.tail=r.sibling,c.renderingStartTime=Yt(),r.sibling=null,s=on.current,Oe(on,m?s&1|2:s&1),dt&&Fi(a,c.treeForkCount),r);case 22:case 23:return wr(a),ah(),c=a.memoizedState!==null,r===null?c&&(a.flags|=8192):r.memoizedState!==null!==c&&(a.flags|=8192),c?s&536870912&&!(a.flags&128)&&(Wt(a),a.subtreeFlags&6&&(a.flags|=8192)):Wt(a),s=a.updateQueue,s!==null&&bd(a,s.retryQueue),s=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(s=r.memoizedState.cachePool.pool),c=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(c=a.memoizedState.cachePool.pool),c!==s&&(a.flags|=2048),r!==null&&Fe(Ro),null;case 24:return s=null,r!==null&&(s=r.memoizedState.cache),a.memoizedState.cache!==s&&(a.flags|=2048),Vi(fn),Wt(a),null;case 25:return null;case 30:return null}throw Error(o(156,a.tag))}function WO(r,a){switch(Bm(a),a.tag){case 1:return r=a.flags,r&65536?(a.flags=r&-65537|128,a):null;case 3:return Vi(fn),Xe(),r=a.flags,r&65536&&!(r&128)?(a.flags=r&-65537|128,a):null;case 26:case 27:case 5:return Ct(a),null;case 31:if(a.memoizedState!==null){if(wr(a),a.alternate===null)throw Error(o(340));Eo()}return r=a.flags,r&65536?(a.flags=r&-65537|128,a):null;case 13:if(wr(a),r=a.memoizedState,r!==null&&r.dehydrated!==null){if(a.alternate===null)throw Error(o(340));Eo()}return r=a.flags,r&65536?(a.flags=r&-65537|128,a):null;case 19:return Fe(on),null;case 4:return Xe(),null;case 10:return Vi(a.type),null;case 22:case 23:return wr(a),ah(),r!==null&&Fe(Ro),r=a.flags,r&65536?(a.flags=r&-65537|128,a):null;case 24:return Vi(fn),null;case 25:return null;default:return null}}function ak(r,a){switch(Bm(a),a.tag){case 3:Vi(fn),Xe();break;case 26:case 27:case 5:Ct(a);break;case 4:Xe();break;case 31:a.memoizedState!==null&&wr(a);break;case 13:wr(a);break;case 19:Fe(on);break;case 10:Vi(a.type);break;case 22:case 23:wr(a),ah(),r!==null&&Fe(Ro);break;case 24:Vi(fn)}}function ac(r,a){try{var s=a.updateQueue,c=s===null?null:s.lastEffect;if(c!==null){var m=c.next;s=m;do{if((s.tag&r)===r){c=void 0;var y=s.create,C=s.inst;c=y(),C.destroy=c}s=s.next}while(s!==m)}}catch(R){It(a,a.return,R)}}function Ma(r,a,s){try{var c=a.updateQueue,m=c===null?null:c.lastEffect;if(m!==null){var y=m.next;c=y;do{if((c.tag&r)===r){var C=c.inst,R=C.destroy;if(R!==void 0){C.destroy=void 0,m=a;var H=s,ie=R;try{ie()}catch(ge){It(m,H,ge)}}}c=c.next}while(c!==y)}}catch(ge){It(a,a.return,ge)}}function ok(r){var a=r.updateQueue;if(a!==null){var s=r.stateNode;try{Zx(a,s)}catch(c){It(r,r.return,c)}}}function sk(r,a,s){s.props=No(r.type,r.memoizedProps),s.state=r.memoizedState;try{s.componentWillUnmount()}catch(c){It(r,a,c)}}function oc(r,a){try{var s=r.ref;if(s!==null){switch(r.tag){case 26:case 27:case 5:var c=r.stateNode;break;case 30:c=r.stateNode;break;default:c=r.stateNode}typeof s=="function"?r.refCleanup=s(c):s.current=c}}catch(m){It(r,a,m)}}function _i(r,a){var s=r.ref,c=r.refCleanup;if(s!==null)if(typeof c=="function")try{c()}catch(m){It(r,a,m)}finally{r.refCleanup=null,r=r.alternate,r!=null&&(r.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(m){It(r,a,m)}else s.current=null}function lk(r){var a=r.type,s=r.memoizedProps,c=r.stateNode;try{e:switch(a){case"button":case"input":case"select":case"textarea":s.autoFocus&&c.focus();break e;case"img":s.src?c.src=s.src:s.srcSet&&(c.srcset=s.srcSet)}}catch(m){It(r,r.return,m)}}function jh(r,a,s){try{var c=r.stateNode;dM(c,r.type,s,a),c[Ke]=a}catch(m){It(r,r.return,m)}}function ck(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&Va(r.type)||r.tag===4}function qh(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||ck(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.tag===27&&Va(r.type)||r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function zh(r,a,s){var c=r.tag;if(c===5||c===6)r=r.stateNode,a?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(r,a):(a=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,a.appendChild(r),s=s._reactRootContainer,s!=null||a.onclick!==null||(a.onclick=Nr));else if(c!==4&&(c===27&&Va(r.type)&&(s=r.stateNode,a=null),r=r.child,r!==null))for(zh(r,a,s),r=r.sibling;r!==null;)zh(r,a,s),r=r.sibling}function wd(r,a,s){var c=r.tag;if(c===5||c===6)r=r.stateNode,a?s.insertBefore(r,a):s.appendChild(r);else if(c!==4&&(c===27&&Va(r.type)&&(s=r.stateNode),r=r.child,r!==null))for(wd(r,a,s),r=r.sibling;r!==null;)wd(r,a,s),r=r.sibling}function uk(r){var a=r.stateNode,s=r.memoizedProps;try{for(var c=r.type,m=a.attributes;m.length;)a.removeAttributeNode(m[0]);Ln(a,c,s),a[Ue]=r,a[Ke]=s}catch(y){It(r,r.return,y)}}var Ki=!1,hn=!1,Fh=!1,dk=typeof WeakSet=="function"?WeakSet:Set,Dn=null;function UO(r,a){if(r=r.containerInfo,og=$d,r=Ex(r),Pm(r)){if("selectionStart"in r)var s={start:r.selectionStart,end:r.selectionEnd};else e:{s=(s=r.ownerDocument)&&s.defaultView||window;var c=s.getSelection&&s.getSelection();if(c&&c.rangeCount!==0){s=c.anchorNode;var m=c.anchorOffset,y=c.focusNode;c=c.focusOffset;try{s.nodeType,y.nodeType}catch{s=null;break e}var C=0,R=-1,H=-1,ie=0,ge=0,ve=r,se=null;t:for(;;){for(var fe;ve!==s||m!==0&&ve.nodeType!==3||(R=C+m),ve!==y||c!==0&&ve.nodeType!==3||(H=C+c),ve.nodeType===3&&(C+=ve.nodeValue.length),(fe=ve.firstChild)!==null;)se=ve,ve=fe;for(;;){if(ve===r)break t;if(se===s&&++ie===m&&(R=C),se===y&&++ge===c&&(H=C),(fe=ve.nextSibling)!==null)break;ve=se,se=ve.parentNode}ve=fe}s=R===-1||H===-1?null:{start:R,end:H}}else s=null}s||(s={start:0,end:0})}else s=null;for(sg={focusedElem:r,selectionRange:s},$d=!1,Dn=a;Dn!==null;)if(a=Dn,r=a.child,a.subtreeFlags&1028&&r!==null)r.return=a,Dn=r;else for(;Dn!==null;){switch(a=Dn,y=a.alternate,r=a.flags,a.tag){case 0:if(r&4&&(r=a.updateQueue,r=r===null?null:r.events,r!==null))for(s=0;s<r.length;s++)m=r[s],m.ref.impl=m.nextImpl;break;case 11:case 15:break;case 1:if(r&1024&&y!==null){r=void 0,s=a,m=y.memoizedProps,y=y.memoizedState,c=s.stateNode;try{var Ae=No(s.type,m);r=c.getSnapshotBeforeUpdate(Ae,y),c.__reactInternalSnapshotBeforeUpdate=r}catch(Ve){It(s,s.return,Ve)}}break;case 3:if(r&1024){if(r=a.stateNode.containerInfo,s=r.nodeType,s===9)ug(r);else if(s===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":ug(r);break;default:r.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(r&1024)throw Error(o(163))}if(r=a.sibling,r!==null){r.return=a.return,Dn=r;break}Dn=a.return}}function fk(r,a,s){var c=s.flags;switch(s.tag){case 0:case 11:case 15:Gi(r,s),c&4&&ac(5,s);break;case 1:if(Gi(r,s),c&4)if(r=s.stateNode,a===null)try{r.componentDidMount()}catch(C){It(s,s.return,C)}else{var m=No(s.type,a.memoizedProps);a=a.memoizedState;try{r.componentDidUpdate(m,a,r.__reactInternalSnapshotBeforeUpdate)}catch(C){It(s,s.return,C)}}c&64&&ok(s),c&512&&oc(s,s.return);break;case 3:if(Gi(r,s),c&64&&(r=s.updateQueue,r!==null)){if(a=null,s.child!==null)switch(s.child.tag){case 27:case 5:a=s.child.stateNode;break;case 1:a=s.child.stateNode}try{Zx(r,a)}catch(C){It(s,s.return,C)}}break;case 27:a===null&&c&4&&uk(s);case 26:case 5:Gi(r,s),a===null&&c&4&&lk(s),c&512&&oc(s,s.return);break;case 12:Gi(r,s);break;case 31:Gi(r,s),c&4&&hk(r,s);break;case 13:Gi(r,s),c&4&&gk(r,s),c&64&&(r=s.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(s=tM.bind(null,s),bM(r,s))));break;case 22:if(c=s.memoizedState!==null||Ki,!c){a=a!==null&&a.memoizedState!==null||hn,m=Ki;var y=hn;Ki=c,(hn=a)&&!y?Xi(r,s,(s.subtreeFlags&8772)!=0):Gi(r,s),Ki=m,hn=y}break;case 30:break;default:Gi(r,s)}}function pk(r){var a=r.alternate;a!==null&&(r.alternate=null,pk(a)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(a=r.stateNode,a!==null&&Sn(a)),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}var Gt=null,nr=!1;function Qi(r,a,s){for(s=s.child;s!==null;)mk(r,a,s),s=s.sibling}function mk(r,a,s){if(rn&&typeof rn.onCommitFiberUnmount=="function")try{rn.onCommitFiberUnmount(Or,s)}catch{}switch(s.tag){case 26:hn||_i(s,a),Qi(r,a,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:hn||_i(s,a);var c=Gt,m=nr;Va(s.type)&&(Gt=s.stateNode,nr=!1),Qi(r,a,s),hc(s.stateNode),Gt=c,nr=m;break;case 5:hn||_i(s,a);case 6:if(c=Gt,m=nr,Gt=null,Qi(r,a,s),Gt=c,nr=m,Gt!==null)if(nr)try{(Gt.nodeType===9?Gt.body:Gt.nodeName==="HTML"?Gt.ownerDocument.body:Gt).removeChild(s.stateNode)}catch(y){It(s,a,y)}else try{Gt.removeChild(s.stateNode)}catch(y){It(s,a,y)}break;case 18:Gt!==null&&(nr?(r=Gt,sC(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,s.stateNode),Qs(r)):sC(Gt,s.stateNode));break;case 4:c=Gt,m=nr,Gt=s.stateNode.containerInfo,nr=!0,Qi(r,a,s),Gt=c,nr=m;break;case 0:case 11:case 14:case 15:Ma(2,s,a),hn||Ma(4,s,a),Qi(r,a,s);break;case 1:hn||(_i(s,a),c=s.stateNode,typeof c.componentWillUnmount=="function"&&sk(s,a,c)),Qi(r,a,s);break;case 21:Qi(r,a,s);break;case 22:hn=(c=hn)||s.memoizedState!==null,Qi(r,a,s),hn=c;break;default:Qi(r,a,s)}}function hk(r,a){if(a.memoizedState===null&&(r=a.alternate,r!==null&&(r=r.memoizedState,r!==null))){r=r.dehydrated;try{Qs(r)}catch(s){It(a,a.return,s)}}}function gk(r,a){if(a.memoizedState===null&&(r=a.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null))))try{Qs(r)}catch(s){It(a,a.return,s)}}function KO(r){switch(r.tag){case 31:case 13:case 19:var a=r.stateNode;return a===null&&(a=r.stateNode=new dk),a;case 22:return r=r.stateNode,a=r._retryCache,a===null&&(a=r._retryCache=new dk),a;default:throw Error(o(435,r.tag))}}function xd(r,a){var s=KO(r);a.forEach(function(c){if(!s.has(c)){s.add(c);var m=nM.bind(null,r,c);c.then(m,m)}})}function rr(r,a){var s=a.deletions;if(s!==null)for(var c=0;c<s.length;c++){var m=s[c],y=r,C=a,R=C;e:for(;R!==null;){switch(R.tag){case 27:if(Va(R.type)){Gt=R.stateNode,nr=!1;break e}break;case 5:Gt=R.stateNode,nr=!1;break e;case 3:case 4:Gt=R.stateNode.containerInfo,nr=!0;break e}R=R.return}if(Gt===null)throw Error(o(160));mk(y,C,m),Gt=null,nr=!1,y=m.alternate,y!==null&&(y.return=null),m.return=null}if(a.subtreeFlags&13886)for(a=a.child;a!==null;)yk(a,r),a=a.sibling}var oi=null;function yk(r,a){var s=r.alternate,c=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:rr(a,r),ir(r),c&4&&(Ma(3,r,r.return),ac(3,r),Ma(5,r,r.return));break;case 1:rr(a,r),ir(r),c&512&&(hn||s===null||_i(s,s.return)),c&64&&Ki&&(r=r.updateQueue,r!==null&&(c=r.callbacks,c!==null&&(s=r.shared.hiddenCallbacks,r.shared.hiddenCallbacks=s===null?c:s.concat(c))));break;case 26:var m=oi;if(rr(a,r),ir(r),c&512&&(hn||s===null||_i(s,s.return)),c&4){var y=s===null?null:s.memoizedState;if(c=r.memoizedState,s===null)if(c===null)if(r.stateNode===null){e:{c=r.type,s=r.memoizedProps,m=m.ownerDocument||m;t:switch(c){case"title":y=m.getElementsByTagName("title")[0],(!y||y[mt]||y[Ue]||y.namespaceURI==="http://www.w3.org/2000/svg"||y.hasAttribute("itemprop"))&&(y=m.createElement(c),m.head.insertBefore(y,m.querySelector("head > title"))),Ln(y,c,s),y[Ue]=r,an(y),c=y;break e;case"link":var C=vC("link","href",m).get(c+(s.href||""));if(C){for(var R=0;R<C.length;R++)if(y=C[R],y.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&y.getAttribute("rel")===(s.rel==null?null:s.rel)&&y.getAttribute("title")===(s.title==null?null:s.title)&&y.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){C.splice(R,1);break t}}y=m.createElement(c),Ln(y,c,s),m.head.appendChild(y);break;case"meta":if(C=vC("meta","content",m).get(c+(s.content||""))){for(R=0;R<C.length;R++)if(y=C[R],y.getAttribute("content")===(s.content==null?null:""+s.content)&&y.getAttribute("name")===(s.name==null?null:s.name)&&y.getAttribute("property")===(s.property==null?null:s.property)&&y.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&y.getAttribute("charset")===(s.charSet==null?null:s.charSet)){C.splice(R,1);break t}}y=m.createElement(c),Ln(y,c,s),m.head.appendChild(y);break;default:throw Error(o(468,c))}y[Ue]=r,an(y),c=y}r.stateNode=c}else bC(m,r.type,r.stateNode);else r.stateNode=yC(m,c,r.memoizedProps);else y===c?c===null&&r.stateNode!==null&&jh(r,r.memoizedProps,s.memoizedProps):(y===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):y.count--,c===null?bC(m,r.type,r.stateNode):yC(m,c,r.memoizedProps))}break;case 27:rr(a,r),ir(r),c&512&&(hn||s===null||_i(s,s.return)),s!==null&&c&4&&jh(r,r.memoizedProps,s.memoizedProps);break;case 5:if(rr(a,r),ir(r),c&512&&(hn||s===null||_i(s,s.return)),r.flags&32){m=r.stateNode;try{Ni(m,"")}catch(Ae){It(r,r.return,Ae)}}c&4&&r.stateNode!=null&&(m=r.memoizedProps,jh(r,m,s===null?m:s.memoizedProps)),c&1024&&(Fh=!0);break;case 6:if(rr(a,r),ir(r),c&4){if(r.stateNode===null)throw Error(o(162));c=r.memoizedProps,s=r.stateNode;try{s.nodeValue=c}catch(Ae){It(r,r.return,Ae)}}break;case 3:if(jd=null,m=oi,oi=Md(a.containerInfo),rr(a,r),oi=m,ir(r),c&4&&s!==null&&s.memoizedState.isDehydrated)try{Qs(a.containerInfo)}catch(Ae){It(r,r.return,Ae)}Fh&&(Fh=!1,vk(r));break;case 4:c=oi,oi=Md(r.stateNode.containerInfo),rr(a,r),ir(r),oi=c;break;case 12:rr(a,r),ir(r);break;case 31:rr(a,r),ir(r),c&4&&(c=r.updateQueue,c!==null&&(r.updateQueue=null,xd(r,c)));break;case 13:rr(a,r),ir(r),r.child.flags&8192&&r.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(kd=Yt()),c&4&&(c=r.updateQueue,c!==null&&(r.updateQueue=null,xd(r,c)));break;case 22:m=r.memoizedState!==null;var H=s!==null&&s.memoizedState!==null,ie=Ki,ge=hn;if(Ki=ie||m,hn=ge||H,rr(a,r),hn=ge,Ki=ie,ir(r),c&8192)e:for(a=r.stateNode,a._visibility=m?a._visibility&-2:a._visibility|1,m&&(s===null||H||Ki||hn||jo(r)),s=null,a=r;;){if(a.tag===5||a.tag===26){if(s===null){H=s=a;try{if(y=H.stateNode,m)C=y.style,typeof C.setProperty=="function"?C.setProperty("display","none","important"):C.display="none";else{R=H.stateNode;var ve=H.memoizedProps.style,se=ve!=null&&ve.hasOwnProperty("display")?ve.display:null;R.style.display=se==null||typeof se=="boolean"?"":(""+se).trim()}}catch(Ae){It(H,H.return,Ae)}}}else if(a.tag===6){if(s===null){H=a;try{H.stateNode.nodeValue=m?"":H.memoizedProps}catch(Ae){It(H,H.return,Ae)}}}else if(a.tag===18){if(s===null){H=a;try{var fe=H.stateNode;m?lC(fe,!0):lC(H.stateNode,!1)}catch(Ae){It(H,H.return,Ae)}}}else if((a.tag!==22&&a.tag!==23||a.memoizedState===null||a===r)&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===r)break e;for(;a.sibling===null;){if(a.return===null||a.return===r)break e;s===a&&(s=null),a=a.return}s===a&&(s=null),a.sibling.return=a.return,a=a.sibling}c&4&&(c=r.updateQueue,c!==null&&(s=c.retryQueue,s!==null&&(c.retryQueue=null,xd(r,s))));break;case 19:rr(a,r),ir(r),c&4&&(c=r.updateQueue,c!==null&&(r.updateQueue=null,xd(r,c)));break;case 30:break;case 21:break;default:rr(a,r),ir(r)}}function ir(r){var a=r.flags;if(a&2){try{for(var s,c=r.return;c!==null;){if(ck(c)){s=c;break}c=c.return}if(s==null)throw Error(o(160));switch(s.tag){case 27:var m=s.stateNode;wd(r,qh(r),m);break;case 5:var y=s.stateNode;s.flags&32&&(Ni(y,""),s.flags&=-33),wd(r,qh(r),y);break;case 3:case 4:var C=s.stateNode.containerInfo;zh(r,qh(r),C);break;default:throw Error(o(161))}}catch(R){It(r,r.return,R)}r.flags&=-3}a&4096&&(r.flags&=-4097)}function vk(r){if(r.subtreeFlags&1024)for(r=r.child;r!==null;){var a=r;vk(a),a.tag===5&&a.flags&1024&&a.stateNode.reset(),r=r.sibling}}function Gi(r,a){if(a.subtreeFlags&8772)for(a=a.child;a!==null;)fk(r,a.alternate,a),a=a.sibling}function jo(r){for(r=r.child;r!==null;){var a=r;switch(a.tag){case 0:case 11:case 14:case 15:Ma(4,a,a.return),jo(a);break;case 1:_i(a,a.return);var s=a.stateNode;typeof s.componentWillUnmount=="function"&&sk(a,a.return,s),jo(a);break;case 27:hc(a.stateNode);case 26:case 5:_i(a,a.return),jo(a);break;case 22:a.memoizedState===null&&jo(a);break;case 30:jo(a);break;default:jo(a)}r=r.sibling}}function Xi(r,a,s){for(s&&(s=(a.subtreeFlags&8772)!=0),a=a.child;a!==null;){var c=a.alternate,m=r,y=a,C=y.flags;switch(y.tag){case 0:case 11:case 15:Xi(m,y,s),ac(4,y);break;case 1:if(Xi(m,y,s),c=y,m=c.stateNode,typeof m.componentDidMount=="function")try{m.componentDidMount()}catch(ie){It(c,c.return,ie)}if(c=y,m=c.updateQueue,m!==null){var R=c.stateNode;try{var H=m.shared.hiddenCallbacks;if(H!==null)for(m.shared.hiddenCallbacks=null,m=0;m<H.length;m++)Yx(H[m],R)}catch(ie){It(c,c.return,ie)}}s&&C&64&&ok(y),oc(y,y.return);break;case 27:uk(y);case 26:case 5:Xi(m,y,s),s&&c===null&&C&4&&lk(y),oc(y,y.return);break;case 12:Xi(m,y,s);break;case 31:Xi(m,y,s),s&&C&4&&hk(m,y);break;case 13:Xi(m,y,s),s&&C&4&&gk(m,y);break;case 22:y.memoizedState===null&&Xi(m,y,s),oc(y,y.return);break;case 30:break;default:Xi(m,y,s)}a=a.sibling}}function $h(r,a){var s=null;r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(s=r.memoizedState.cachePool.pool),r=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(r=a.memoizedState.cachePool.pool),r!==s&&(r!=null&&r.refCount++,s!=null&&Ul(s))}function Vh(r,a){r=null,a.alternate!==null&&(r=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==r&&(a.refCount++,r!=null&&Ul(r))}function si(r,a,s,c){if(a.subtreeFlags&10256)for(a=a.child;a!==null;)bk(r,a,s,c),a=a.sibling}function bk(r,a,s,c){var m=a.flags;switch(a.tag){case 0:case 11:case 15:si(r,a,s,c),m&2048&&ac(9,a);break;case 1:si(r,a,s,c);break;case 3:si(r,a,s,c),m&2048&&(r=null,a.alternate!==null&&(r=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==r&&(a.refCount++,r!=null&&Ul(r)));break;case 12:if(m&2048){si(r,a,s,c),r=a.stateNode;try{var y=a.memoizedProps,C=y.id,R=y.onPostCommit;typeof R=="function"&&R(C,a.alternate===null?"mount":"update",r.passiveEffectDuration,-0)}catch(H){It(a,a.return,H)}}else si(r,a,s,c);break;case 31:si(r,a,s,c);break;case 13:si(r,a,s,c);break;case 23:break;case 22:y=a.stateNode,C=a.alternate,a.memoizedState===null?y._visibility&2?si(r,a,s,c):(y._visibility|=2,js(r,a,s,c,(a.subtreeFlags&10256)!=0||!1)):y._visibility&2?si(r,a,s,c):sc(r,a),m&2048&&$h(C,a);break;case 24:si(r,a,s,c),m&2048&&Vh(a.alternate,a);break;default:si(r,a,s,c)}}function js(r,a,s,c,m){for(m&&(m=(a.subtreeFlags&10256)!=0||!1),a=a.child;a!==null;){var y=r,C=a,R=s,H=c,ie=C.flags;switch(C.tag){case 0:case 11:case 15:js(y,C,R,H,m),ac(8,C);break;case 23:break;case 22:var ge=C.stateNode;C.memoizedState===null?(ge._visibility|=2,js(y,C,R,H,m)):ge._visibility&2?js(y,C,R,H,m):sc(y,C),m&&ie&2048&&$h(C.alternate,C);break;case 24:js(y,C,R,H,m),m&&ie&2048&&Vh(C.alternate,C);break;default:js(y,C,R,H,m)}a=a.sibling}}function sc(r,a){if(a.subtreeFlags&10256)for(a=a.child;a!==null;){var s=r,c=a,m=c.flags;switch(c.tag){case 22:sc(s,c),m&2048&&$h(c.alternate,c);break;case 24:sc(s,c),m&2048&&Vh(c.alternate,c);break;default:sc(s,c)}a=a.sibling}}var lc=8192;function qs(r,a,s){if(r.subtreeFlags&lc)for(r=r.child;r!==null;)wk(r,a,s),r=r.sibling}function wk(r,a,s){switch(r.tag){case 26:qs(r,a,s),r.flags&lc&&r.memoizedState!==null&&AM(s,oi,r.memoizedState,r.memoizedProps);break;case 5:qs(r,a,s);break;case 3:case 4:var c=oi;oi=Md(r.stateNode.containerInfo),qs(r,a,s),oi=c;break;case 22:r.memoizedState===null&&(c=r.alternate,c!==null&&c.memoizedState!==null?(c=lc,lc=16777216,qs(r,a,s),lc=c):qs(r,a,s));break;default:qs(r,a,s)}}function xk(r){var a=r.alternate;if(a!==null&&(r=a.child,r!==null)){a.child=null;do a=r.sibling,r.sibling=null,r=a;while(r!==null)}}function cc(r){var a=r.deletions;if(r.flags&16){if(a!==null)for(var s=0;s<a.length;s++){var c=a[s];Dn=c,kk(c,r)}xk(r)}if(r.subtreeFlags&10256)for(r=r.child;r!==null;)_k(r),r=r.sibling}function _k(r){switch(r.tag){case 0:case 11:case 15:cc(r),r.flags&2048&&Ma(9,r,r.return);break;case 3:cc(r);break;case 12:cc(r);break;case 22:var a=r.stateNode;r.memoizedState!==null&&a._visibility&2&&(r.return===null||r.return.tag!==13)?(a._visibility&=-3,_d(r)):cc(r);break;default:cc(r)}}function _d(r){var a=r.deletions;if(r.flags&16){if(a!==null)for(var s=0;s<a.length;s++){var c=a[s];Dn=c,kk(c,r)}xk(r)}for(r=r.child;r!==null;){switch(a=r,a.tag){case 0:case 11:case 15:Ma(8,a,a.return),_d(a);break;case 22:s=a.stateNode,s._visibility&2&&(s._visibility&=-3,_d(a));break;default:_d(a)}r=r.sibling}}function kk(r,a){for(;Dn!==null;){var s=Dn;switch(s.tag){case 0:case 11:case 15:Ma(8,s,a);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var c=s.memoizedState.cachePool.pool;c!=null&&c.refCount++}break;case 24:Ul(s.memoizedState.cache)}if(c=s.child,c!==null)c.return=s,Dn=c;else e:for(s=r;Dn!==null;){c=Dn;var m=c.sibling,y=c.return;if(pk(c),c===s){Dn=null;break e}if(m!==null){m.return=y,Dn=m;break e}Dn=y}}}var QO={getCacheForType:function(r){var a=In(fn),s=a.data.get(r);return s===void 0&&(s=r(),a.data.set(r,s)),s},cacheSignal:function(){return In(fn).controller.signal}},GO=typeof WeakMap=="function"?WeakMap:Map,xt=0,zt=null,at=null,lt=0,Rt=0,xr=null,Na=!1,zs=!1,Hh=!1,Ji=0,en=0,ja=0,qo=0,Bh=0,_r=0,Fs=0,uc=null,ar=null,Wh=!1,kd=0,Ck=0,Cd=1/0,Sd=null,qa=null,wn=0,za=null,$s=null,Yi=0,Uh=0,Kh=null,Sk=null,dc=0,Qh=null;function Vr(){return xt&2&<!==0?lt&-lt:he.T===null?re():eg()}function Ek(){if(_r===0)if(!(lt&536870912)||dt){var r=Dt;Dt<<=1,!(Dt&3932160)&&(Dt=262144),_r=r}else _r=536870912;return r=br.current,r!==null&&(r.flags|=32),_r}function or(r,a,s){(r===zt&&(Rt===2||Rt===9)||r.cancelPendingCommit!==null)&&(Vs(r,0),Fa(r,lt,_r,!1)),zn(r,s),(!(xt&2)||r!==zt)&&(r===zt&&(!(xt&2)&&(qo|=s),en===4&&Fa(r,lt,_r,!1)),Zi(r))}function Tk(r,a,s){if(xt&6)throw Error(o(327));var c=!s&&(a&127)==0&&(a&r.expiredLanes)===0||Cn(r,a),m=c?YO(r,a):Xh(r,a,!0),y=c;do{if(m===0){zs&&!c&&Fa(r,a,0,!1);break}else{if(s=r.current.alternate,y&&!XO(s)){m=Xh(r,a,!1),y=!1;continue}if(m===2){if(y=a,r.errorRecoveryDisabledLanes&y)var C=0;else C=r.pendingLanes&-536870913,C=C===0?C&536870912?536870912:0:C;if(C!==0){a=C;e:{var R=r;m=uc;var H=R.current.memoizedState.isDehydrated;if(H&&(Vs(R,C).flags|=256),C=Xh(R,C,!1),C!==2){if(Hh&&!H){R.errorRecoveryDisabledLanes|=y,qo|=y,m=4;break e}y=ar,ar=m,y!==null&&(ar===null?ar=y:ar.push.apply(ar,y))}m=C}if(y=!1,m!==2)continue}}if(m===1){Vs(r,0),Fa(r,a,0,!0);break}e:{switch(c=r,y=m,y){case 0:case 1:throw Error(o(345));case 4:if((a&4194048)!==a)break;case 6:Fa(c,a,_r,!Na);break e;case 2:ar=null;break;case 3:case 5:break;default:throw Error(o(329))}if((a&62914560)===a&&(m=kd+300-Yt(),10<m)){if(Fa(c,a,_r,!Na),ei(c,0,!0)!==0)break e;Yi=a,c.timeoutHandle=aC(Dk.bind(null,c,s,ar,Sd,Wh,a,_r,qo,Fs,Na,y,"Throttled",-0,0),m);break e}Dk(c,s,ar,Sd,Wh,a,_r,qo,Fs,Na,y,null,-0,0)}}break}while(!0);Zi(r)}function Dk(r,a,s,c,m,y,C,R,H,ie,ge,ve,se,fe){if(r.timeoutHandle=-1,ve=a.subtreeFlags,ve&8192||(ve&16785408)==16785408){ve={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Nr},wk(a,y,ve);var Ae=(y&62914560)===y?kd-Yt():(y&4194048)===y?Ck-Yt():0;if(Ae=LM(ve,Ae),Ae!==null){Yi=y,r.cancelPendingCommit=Ae(Nk.bind(null,r,a,y,s,c,m,C,R,H,ge,ve,null,se,fe)),Fa(r,y,C,!ie);return}}Nk(r,a,y,s,c,m,C,R,H)}function XO(r){for(var a=r;;){var s=a.tag;if((s===0||s===11||s===15)&&a.flags&16384&&(s=a.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var c=0;c<s.length;c++){var m=s[c],y=m.getSnapshot;m=m.value;try{if(!yr(y(),m))return!1}catch{return!1}}if(s=a.child,a.subtreeFlags&16384&&s!==null)s.return=a,a=s;else{if(a===r)break;for(;a.sibling===null;){if(a.return===null||a.return===r)return!0;a=a.return}a.sibling.return=a.return,a=a.sibling}}return!0}function Fa(r,a,s,c){a&=~Bh,a&=~qo,r.suspendedLanes|=a,r.pingedLanes&=~a,c&&(r.warmLanes|=a),c=r.expirationTimes;for(var m=a;0<m;){var y=31-wt(m),C=1<<y;c[y]=-1,m&=~C}s!==0&&Wn(r,s,a)}function Ed(){return xt&6?!0:(fc(0,!1),!1)}function Gh(){if(at!==null){if(Rt===0)var r=at.return;else r=at,$i=To=null,dh(r),Ls=null,Ql=0,r=at;for(;r!==null;)ak(r.alternate,r),r=r.return;at=null}}function Vs(r,a){var s=r.timeoutHandle;s!==-1&&(r.timeoutHandle=-1,mM(s)),s=r.cancelPendingCommit,s!==null&&(r.cancelPendingCommit=null,s()),Yi=0,Gh(),zt=r,at=s=zi(r.current,null),lt=a,Rt=0,xr=null,Na=!1,zs=Cn(r,a),Hh=!1,Fs=_r=Bh=qo=ja=en=0,ar=uc=null,Wh=!1,a&8&&(a|=a&32);var c=r.entangledLanes;if(c!==0)for(r=r.entanglements,c&=a;0<c;){var m=31-wt(c),y=1<<m;a|=r[m],c&=~y}return Ji=a,Ku(),s}function Rk(r,a){Ye=null,he.H=nc,a===As||a===td?(a=Qx(),Rt=3):a===Zm?(a=Qx(),Rt=4):Rt=a===Th?8:typeof a=="object"&&a&&typeof a.then=="function"?6:1,xr=a,at===null&&(en=1,hd(r,qr(a,r.current)))}function Ik(){var r=br.current;return r===null?!0:(lt&4194048)===lt?ai===null:(lt&62914560)===lt||lt&536870912?r===ai:!1}function Ak(){var r=he.H;return he.H=nc,r===null?nc:r}function Lk(){var r=he.A;return he.A=QO,r}function Td(){en=4,Na||(lt&4194048)!==lt&&br.current!==null||(zs=!0),!(ja&134217727)&&!(qo&134217727)||zt===null||Fa(zt,lt,_r,!1)}function Xh(r,a,s){var c=xt;xt|=2;var m=Ak(),y=Lk();(zt!==r||lt!==a)&&(Sd=null,Vs(r,a)),a=!1;var C=en;e:do try{if(Rt!==0&&at!==null){var R=at,H=xr;switch(Rt){case 8:Gh(),C=6;break e;case 3:case 2:case 9:case 6:br.current===null&&(a=!0);var ie=Rt;if(Rt=0,xr=null,Hs(r,R,H,ie),s&&zs){C=0;break e}break;default:ie=Rt,Rt=0,xr=null,Hs(r,R,H,ie)}}JO(),C=en;break}catch(ge){Rk(r,ge)}while(!0);return a&&r.shellSuspendCounter++,$i=To=null,xt=c,he.H=m,he.A=y,at===null&&(zt=null,lt=0,Ku()),C}function JO(){for(;at!==null;)Pk(at)}function YO(r,a){var s=xt;xt|=2;var c=Ak(),m=Lk();zt!==r||lt!==a?(Sd=null,Cd=Yt()+500,Vs(r,a)):zs=Cn(r,a);e:do try{if(Rt!==0&&at!==null){a=at;var y=xr;t:switch(Rt){case 1:Rt=0,xr=null,Hs(r,a,y,1);break;case 2:case 9:if(Ux(y)){Rt=0,xr=null,Ok(a);break}a=function(){Rt!==2&&Rt!==9||zt!==r||(Rt=7),Zi(r)},y.then(a,a);break e;case 3:Rt=7;break e;case 4:Rt=5;break e;case 7:Ux(y)?(Rt=0,xr=null,Ok(a)):(Rt=0,xr=null,Hs(r,a,y,7));break;case 5:var C=null;switch(at.tag){case 26:C=at.memoizedState;case 5:case 27:var R=at;if(C?wC(C):R.stateNode.complete){Rt=0,xr=null;var H=R.sibling;if(H!==null)at=H;else{var ie=R.return;ie===null?at=null:(at=ie,Dd(ie))}break t}}Rt=0,xr=null,Hs(r,a,y,5);break;case 6:Rt=0,xr=null,Hs(r,a,y,6);break;case 8:Gh(),en=6;break e;default:throw Error(o(462))}}ZO();break}catch(ge){Rk(r,ge)}while(!0);return $i=To=null,he.H=c,he.A=m,xt=s,at===null?(zt=null,lt=0,Ku(),en):0}function ZO(){for(;at!==null&&!xa();)Pk(at)}function Pk(r){var a=rk(r.alternate,r,Ji);r.memoizedProps=r.pendingProps,a===null?Dd(r):at=a}function Ok(r){var a=r,s=a.alternate;switch(a.tag){case 15:case 0:a=J_(s,a,a.pendingProps,a.type,void 0,lt);break;case 11:a=J_(s,a,a.pendingProps,a.type.render,a.ref,lt);break;case 5:dh(a);default:ak(s,a),a=at=Mx(a,Ji),a=rk(s,a,Ji)}r.memoizedProps=r.pendingProps,a===null?Dd(r):at=a}function Hs(r,a,s,c){$i=To=null,dh(a),Ls=null,Ql=0;var m=a.return;try{if($O(r,m,a,s,lt)){en=1,hd(r,qr(s,r.current)),at=null;return}}catch(y){if(m!==null)throw at=m,y;en=1,hd(r,qr(s,r.current)),at=null;return}a.flags&32768?(dt||c===1?r=!0:zs||lt&536870912?r=!1:(Na=r=!0,(c===2||c===9||c===3||c===6)&&(c=br.current,c!==null&&c.tag===13&&(c.flags|=16384))),Mk(a,r)):Dd(a)}function Dd(r){var a=r;do{if(a.flags&32768){Mk(a,Na);return}r=a.return;var s=BO(a.alternate,a,Ji);if(s!==null){at=s;return}if(a=a.sibling,a!==null){at=a;return}at=a=r}while(a!==null);en===0&&(en=5)}function Mk(r,a){do{var s=WO(r.alternate,r);if(s!==null){s.flags&=32767,at=s;return}if(s=r.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!a&&(r=r.sibling,r!==null)){at=r;return}at=r=s}while(r!==null);en=6,at=null}function Nk(r,a,s,c,m,y,C,R,H){r.cancelPendingCommit=null;do Rd();while(wn!==0);if(xt&6)throw Error(o(327));if(a!==null){if(a===r.current)throw Error(o(177));if(y=a.lanes|a.childLanes,y|=qm,Oi(r,s,y,C,R,H),r===zt&&(at=zt=null,lt=0),$s=a,za=r,Yi=s,Uh=y,Kh=m,Sk=c,a.subtreeFlags&10256||a.flags&10256?(r.callbackNode=null,r.callbackPriority=0,rM(Vt,function(){return $k(),null})):(r.callbackNode=null,r.callbackPriority=0),c=(a.flags&13878)!=0,a.subtreeFlags&13878||c){c=he.T,he.T=null,m=G.p,G.p=2,C=xt,xt|=4;try{UO(r,a,s)}finally{xt=C,G.p=m,he.T=c}}wn=1,jk(),qk(),zk()}}function jk(){if(wn===1){wn=0;var r=za,a=$s,s=(a.flags&13878)!=0;if(a.subtreeFlags&13878||s){s=he.T,he.T=null;var c=G.p;G.p=2;var m=xt;xt|=4;try{yk(a,r);var y=sg,C=Ex(r.containerInfo),R=y.focusedElem,H=y.selectionRange;if(C!==R&&R&&R.ownerDocument&&Sx(R.ownerDocument.documentElement,R)){if(H!==null&&Pm(R)){var ie=H.start,ge=H.end;if(ge===void 0&&(ge=ie),"selectionStart"in R)R.selectionStart=ie,R.selectionEnd=Math.min(ge,R.value.length);else{var ve=R.ownerDocument||document,se=ve&&ve.defaultView||window;if(se.getSelection){var fe=se.getSelection(),Ae=R.textContent.length,Ve=Math.min(H.start,Ae),Mt=H.end===void 0?Ve:Math.min(H.end,Ae);!fe.extend&&Ve>Mt&&(C=Mt,Mt=Ve,Ve=C);var K=Cx(R,Ve),B=Cx(R,Mt);if(K&&B&&(fe.rangeCount!==1||fe.anchorNode!==K.node||fe.anchorOffset!==K.offset||fe.focusNode!==B.node||fe.focusOffset!==B.offset)){var ee=ve.createRange();ee.setStart(K.node,K.offset),fe.removeAllRanges(),Ve>Mt?(fe.addRange(ee),fe.extend(B.node,B.offset)):(ee.setEnd(B.node,B.offset),fe.addRange(ee))}}}}for(ve=[],fe=R;fe=fe.parentNode;)fe.nodeType===1&&ve.push({element:fe,left:fe.scrollLeft,top:fe.scrollTop});for(typeof R.focus=="function"&&R.focus(),R=0;R<ve.length;R++){var ye=ve[R];ye.element.scrollLeft=ye.left,ye.element.scrollTop=ye.top}}$d=!!og,sg=og=null}finally{xt=m,G.p=c,he.T=s}}r.current=a,wn=2}}function qk(){if(wn===2){wn=0;var r=za,a=$s,s=(a.flags&8772)!=0;if(a.subtreeFlags&8772||s){s=he.T,he.T=null;var c=G.p;G.p=2;var m=xt;xt|=4;try{fk(r,a.alternate,a)}finally{xt=m,G.p=c,he.T=s}}wn=3}}function zk(){if(wn===4||wn===3){wn=0,Ii();var r=za,a=$s,s=Yi,c=Sk;a.subtreeFlags&10256||a.flags&10256?wn=5:(wn=0,$s=za=null,Fk(r,r.pendingLanes));var m=r.pendingLanes;if(m===0&&(qa=null),q(s),a=a.stateNode,rn&&typeof rn.onCommitFiberRoot=="function")try{rn.onCommitFiberRoot(Or,a,void 0,(a.current.flags&128)==128)}catch{}if(c!==null){a=he.T,m=G.p,G.p=2,he.T=null;try{for(var y=r.onRecoverableError,C=0;C<c.length;C++){var R=c[C];y(R.value,{componentStack:R.stack})}}finally{he.T=a,G.p=m}}Yi&3&&Rd(),Zi(r),m=r.pendingLanes,s&261930&&m&42?r===Qh?dc++:(dc=0,Qh=r):dc=0,fc(0,!1)}}function Fk(r,a){(r.pooledCacheLanes&=a)===0&&(a=r.pooledCache,a!=null&&(r.pooledCache=null,Ul(a)))}function Rd(){return jk(),qk(),zk(),$k()}function $k(){if(wn!==5)return!1;var r=za,a=Uh;Uh=0;var s=q(Yi),c=he.T,m=G.p;try{G.p=32>s?32:s,he.T=null,s=Kh,Kh=null;var y=za,C=Yi;if(wn=0,$s=za=null,Yi=0,xt&6)throw Error(o(331));var R=xt;if(xt|=4,_k(y.current),bk(y,y.current,C,s),xt=R,fc(0,!1),rn&&typeof rn.onPostCommitFiberRoot=="function")try{rn.onPostCommitFiberRoot(Or,y)}catch{}return!0}finally{G.p=m,he.T=c,Fk(r,a)}}function Vk(r,a,s){a=qr(s,a),a=Eh(r.stateNode,a,2),r=Oo(r,a,2),r!==null&&(zn(r,2),Zi(r))}function It(r,a,s){if(r.tag===3)Vk(r,r,s);else for(;a!==null;){if(a.tag===3){Vk(a,r,s);break}else if(a.tag===1){var c=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(qa===null||!qa.has(c))){r=qr(s,r),s=H_(2),c=Oo(a,s,2),c!==null&&(B_(s,c,a,r),zn(c,2),Zi(c));break}}a=a.return}}function Jh(r,a,s){var c=r.pingCache;if(c===null){c=r.pingCache=new GO;var m=new Set;c.set(a,m)}else m=c.get(a),m===void 0&&(m=new Set,c.set(a,m));m.has(s)||(Hh=!0,m.add(s),r=eM.bind(null,r,a,s),a.then(r,r))}function eM(r,a,s){var c=r.pingCache;c!==null&&c.delete(a),r.pingedLanes|=r.suspendedLanes&s,r.warmLanes&=~s,zt===r&&(lt&s)===s&&(en===4||en===3&&(lt&62914560)===lt&&300>Yt()-kd?!(xt&2)&&Vs(r,0):Bh|=s,Fs===lt&&(Fs=0)),Zi(r)}function Hk(r,a){a===0&&(a=Pi()),r=Co(r,a),r!==null&&(zn(r,a),Zi(r))}function tM(r){var a=r.memoizedState,s=0;a!==null&&(s=a.retryLane),Hk(r,s)}function nM(r,a){var s=0;switch(r.tag){case 31:case 13:var c=r.stateNode,m=r.memoizedState;m!==null&&(s=m.retryLane);break;case 19:c=r.stateNode;break;case 22:c=r.stateNode._retryCache;break;default:throw Error(o(314))}c!==null&&c.delete(a),Hk(r,s)}function rM(r,a){return jn(r,a)}var Id=null,Bs=null,Yh=!1,Ad=!1,Zh=!1,$a=0;function Zi(r){r!==Bs&&r.next===null&&(Bs===null?Id=Bs=r:Bs=Bs.next=r),Ad=!0,Yh||(Yh=!0,aM())}function fc(r,a){if(!Zh&&Ad){Zh=!0;do for(var s=!1,c=Id;c!==null;){if(!a)if(r!==0){var m=c.pendingLanes;if(m===0)var y=0;else{var C=c.suspendedLanes,R=c.pingedLanes;y=(1<<31-wt(42|r)+1)-1,y&=m&~(C&~R),y=y&201326741?y&201326741|1:y?y|2:0}y!==0&&(s=!0,Kk(c,y))}else y=lt,y=ei(c,c===zt?y:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),!(y&3)||Cn(c,y)||(s=!0,Kk(c,y));c=c.next}while(s);Zh=!1}}function iM(){Bk()}function Bk(){Ad=Yh=!1;var r=0;$a!==0&&pM()&&(r=$a);for(var a=Yt(),s=null,c=Id;c!==null;){var m=c.next,y=Wk(c,a);y===0?(c.next=null,s===null?Id=m:s.next=m,m===null&&(Bs=s)):(s=c,(r!==0||y&3)&&(Ad=!0)),c=m}wn!==0&&wn!==5||fc(r,!1),$a!==0&&($a=0)}function Wk(r,a){for(var s=r.suspendedLanes,c=r.pingedLanes,m=r.expirationTimes,y=r.pendingLanes&-62914561;0<y;){var C=31-wt(y),R=1<<C,H=m[C];H===-1?((R&s)===0||(R&c)!==0)&&(m[C]=pr(R,a)):H<=a&&(r.expiredLanes|=R),y&=~R}if(a=zt,s=lt,s=ei(r,r===a?s:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),c=r.callbackNode,s===0||r===a&&(Rt===2||Rt===9)||r.cancelPendingCommit!==null)return c!==null&&c!==null&&yn(c),r.callbackNode=null,r.callbackPriority=0;if(!(s&3)||Cn(r,s)){if(a=s&-s,a===r.callbackPriority)return a;switch(c!==null&&yn(c),q(s)){case 2:case 8:s=hi;break;case 32:s=Vt;break;case 268435456:s=St;break;default:s=Vt}return c=Uk.bind(null,r),s=jn(s,c),r.callbackPriority=a,r.callbackNode=s,a}return c!==null&&c!==null&&yn(c),r.callbackPriority=2,r.callbackNode=null,2}function Uk(r,a){if(wn!==0&&wn!==5)return r.callbackNode=null,r.callbackPriority=0,null;var s=r.callbackNode;if(Rd()&&r.callbackNode!==s)return null;var c=lt;return c=ei(r,r===zt?c:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),c===0?null:(Tk(r,c,a),Wk(r,Yt()),r.callbackNode!=null&&r.callbackNode===s?Uk.bind(null,r):null)}function Kk(r,a){if(Rd())return null;Tk(r,a,!0)}function aM(){hM(function(){xt&6?jn(vn,iM):Bk()})}function eg(){if($a===0){var r=Rs;r===0&&(r=Mr,Mr<<=1,!(Mr&261888)&&(Mr=256)),$a=r}return $a}function Qk(r){return r==null||typeof r=="symbol"||typeof r=="boolean"?null:typeof r=="function"?r:ys(""+r)}function Gk(r,a){var s=a.ownerDocument.createElement("input");return s.name=a.name,s.value=a.value,r.id&&s.setAttribute("form",r.id),a.parentNode.insertBefore(s,a),r=new FormData(r),s.parentNode.removeChild(s),r}function oM(r,a,s,c,m){if(a==="submit"&&s&&s.stateNode===m){var y=Qk((m[Ke]||null).action),C=c.submitter;C&&(a=(a=C[Ke]||null)?Qk(a.formAction):C.getAttribute("formAction"),a!==null&&(y=a,C=null));var R=new f("action","action",null,c,m);r.push({event:R,listeners:[{instance:null,listener:function(){if(c.defaultPrevented){if($a!==0){var H=C?Gk(m,C):new FormData(m);wh(s,{pending:!0,data:H,method:m.method,action:y},null,H)}}else typeof y=="function"&&(R.preventDefault(),H=C?Gk(m,C):new FormData(m),wh(s,{pending:!0,data:H,method:m.method,action:y},y,H))},currentTarget:m}]})}}for(var tg=0;tg<jm.length;tg++){var ng=jm[tg];ii(ng.toLowerCase(),"on"+(ng[0].toUpperCase()+ng.slice(1)))}ii(Rx,"onAnimationEnd"),ii(Ix,"onAnimationIteration"),ii(Ax,"onAnimationStart"),ii("dblclick","onDoubleClick"),ii("focusin","onFocus"),ii("focusout","onBlur"),ii(xO,"onTransitionRun"),ii(_O,"onTransitionStart"),ii(kO,"onTransitionCancel"),ii(Lx,"onTransitionEnd"),Ca("onMouseEnter",["mouseout","mouseover"]),Ca("onMouseLeave",["mouseout","mouseover"]),Ca("onPointerEnter",["pointerout","pointerover"]),Ca("onPointerLeave",["pointerout","pointerover"]),vi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),vi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),vi("onBeforeInput",["compositionend","keypress","textInput","paste"]),vi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),vi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),vi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var pc="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(" "),sM=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(pc));function Xk(r,a){a=(a&4)!=0;for(var s=0;s<r.length;s++){var c=r[s],m=c.event;c=c.listeners;e:{var y=void 0;if(a)for(var C=c.length-1;0<=C;C--){var R=c[C],H=R.instance,ie=R.currentTarget;if(R=R.listener,H!==y&&m.isPropagationStopped())break e;y=R,m.currentTarget=ie;try{y(m)}catch(ge){Uu(ge)}m.currentTarget=null,y=H}else for(C=0;C<c.length;C++){if(R=c[C],H=R.instance,ie=R.currentTarget,R=R.listener,H!==y&&m.isPropagationStopped())break e;y=R,m.currentTarget=ie;try{y(m)}catch(ge){Uu(ge)}m.currentTarget=null,y=H}}}}function ot(r,a){var s=a[Nt];s===void 0&&(s=a[Nt]=new Set);var c=r+"__bubble";s.has(c)||(Yk(a,r,2,!1),s.add(c))}function rg(r,a,s){var c=0;a&&(c|=4),Yk(s,r,c,a)}var Ld="_reactListening"+Math.random().toString(36).slice(2);function Jk(r){if(!r[Ld]){r[Ld]=!0,Ll.forEach(function(s){s!=="selectionchange"&&(sM.has(s)||rg(s,!1,r),rg(s,!0,r))});var a=r.nodeType===9?r:r.ownerDocument;a===null||a[Ld]||(a[Ld]=!0,rg("selectionchange",!1,a))}}function Yk(r,a,s,c){switch(SC(a)){case 2:var m=jM;break;case 8:m=qM;break;default:m=vg}s=m.bind(null,a,s,r),m=void 0,!jl||a!=="touchstart"&&a!=="touchmove"&&a!=="wheel"||(m=!0),c?m===void 0?r.addEventListener(a,s,!0):r.addEventListener(a,s,{capture:!0,passive:m}):m===void 0?r.addEventListener(a,s,!1):r.addEventListener(a,s,{passive:m})}function ig(r,a,s,c,m){var y=c;if(!(a&1)&&!(a&2)&&c!==null)e:for(;;){if(c===null)return;var C=c.tag;if(C===3||C===4){var R=c.stateNode.containerInfo;if(R===m)break;if(C===4)for(C=c.return;C!==null;){var H=C.tag;if((H===3||H===4)&&C.stateNode.containerInfo===m)return;C=C.return}for(;R!==null;){if(C=hr(R),C===null)return;if(H=C.tag,H===5||H===6||H===26||H===27){c=y=C;continue e}R=R.parentNode}}c=c.return}Vu(function(){var ie=y,ge=Ml(s),ve=[];e:{var se=Px.get(r);if(se!==void 0){var fe=f,Ae=r;switch(r){case"keypress":if(bo(s)===0)break e;case"keydown":case"keyup":fe=Ie;break;case"focusin":Ae="focus",fe=F;break;case"focusout":Ae="blur",fe=F;break;case"beforeblur":case"afterblur":fe=F;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":fe=I;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":fe=L;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":fe=ht;break;case Rx:case Ix:case Ax:fe=N;break;case Lx:fe=tt;break;case"scroll":case"scrollend":fe=v;break;case"wheel":fe=qt;break;case"copy":case"cut":case"paste":fe=le;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":fe=$e;break;case"toggle":case"beforetoggle":fe=Ht}var Ve=(a&4)!=0,Mt=!Ve&&(r==="scroll"||r==="scrollend"),K=Ve?se===null?null:se+"Capture":se;Ve=[];for(var B=ie,ee;B!==null;){var ye=B;if(ee=ye.stateNode,ye=ye.tag,ye!==5&&ye!==26&&ye!==27||ee===null||K===null||(ye=go(B,K),ye!=null&&Ve.push(mc(B,ye,ee))),Mt)break;B=B.return}0<Ve.length&&(se=new fe(se,Ae,null,s,ge),ve.push({event:se,listeners:Ve}))}}if(!(a&7)){e:{if(se=r==="mouseover"||r==="pointerover",fe=r==="mouseout"||r==="pointerout",se&&s!==En&&(Ae=s.relatedTarget||s.fromElement)&&(hr(Ae)||Ae[ut]))break e;if((fe||se)&&(se=ge.window===ge?ge:(se=ge.ownerDocument)?se.defaultView||se.parentWindow:window,fe?(Ae=s.relatedTarget||s.toElement,fe=ie,Ae=Ae?hr(Ae):null,Ae!==null&&(Mt=u(Ae),Ve=Ae.tag,Ae!==Mt||Ve!==5&&Ve!==27&&Ve!==6)&&(Ae=null)):(fe=null,Ae=ie),fe!==Ae)){if(Ve=I,ye="onMouseLeave",K="onMouseEnter",B="mouse",(r==="pointerout"||r==="pointerover")&&(Ve=$e,ye="onPointerLeave",K="onPointerEnter",B="pointer"),Mt=fe==null?se:Un(fe),ee=Ae==null?se:Un(Ae),se=new Ve(ye,B+"leave",fe,s,ge),se.target=Mt,se.relatedTarget=ee,ye=null,hr(ge)===ie&&(Ve=new Ve(K,B+"enter",Ae,s,ge),Ve.target=ee,Ve.relatedTarget=Mt,ye=Ve),Mt=ye,fe&&Ae)t:{for(Ve=lM,K=fe,B=Ae,ee=0,ye=K;ye;ye=Ve(ye))ee++;ye=0;for(var ze=B;ze;ze=Ve(ze))ye++;for(;0<ee-ye;)K=Ve(K),ee--;for(;0<ye-ee;)B=Ve(B),ye--;for(;ee--;){if(K===B||B!==null&&K===B.alternate){Ve=K;break t}K=Ve(K),B=Ve(B)}Ve=null}else Ve=null;fe!==null&&Zk(ve,se,fe,Ve,!1),Ae!==null&&Mt!==null&&Zk(ve,Mt,Ae,Ve,!0)}}e:{if(se=ie?Un(ie):window,fe=se.nodeName&&se.nodeName.toLowerCase(),fe==="select"||fe==="input"&&se.type==="file")var _t=vx;else if(gx(se))if(bx)_t=vO;else{_t=gO;var Le=hO}else fe=se.nodeName,!fe||fe.toLowerCase()!=="input"||se.type!=="checkbox"&&se.type!=="radio"?ie&&ho(ie.elementType)&&(_t=vx):_t=yO;if(_t&&(_t=_t(r,ie))){yx(ve,_t,s,ge);break e}Le&&Le(r,se,ie),r==="focusout"&&ie&&se.type==="number"&&ie.memoizedProps.value!=null&&Mi(se,"number",se.value)}switch(Le=ie?Un(ie):window,r){case"focusin":(gx(Le)||Le.contentEditable==="true")&&(xs=Le,Om=ie,Hl=null);break;case"focusout":Hl=Om=xs=null;break;case"mousedown":Mm=!0;break;case"contextmenu":case"mouseup":case"dragend":Mm=!1,Tx(ve,s,ge);break;case"selectionchange":if(wO)break;case"keydown":case"keyup":Tx(ve,s,ge)}var Ze;if(Ge)e:{switch(r){case"compositionstart":var ct="onCompositionStart";break e;case"compositionend":ct="onCompositionEnd";break e;case"compositionupdate":ct="onCompositionUpdate";break e}ct=void 0}else ws?Bu(r,s)&&(ct="onCompositionEnd"):r==="keydown"&&s.keyCode===229&&(ct="onCompositionStart");ct&&(bn&&s.locale!=="ko"&&(ws||ct!=="onCompositionStart"?ct==="onCompositionEnd"&&ws&&(Ze=ql()):(ri=ge,vs="value"in ri?ri.value:ri.textContent,ws=!0)),Le=Pd(ie,ct),0<Le.length&&(ct=new oe(ct,r,null,s,ge),ve.push({event:ct,listeners:Le}),Ze?ct.data=Ze:(Ze=bs(s),Ze!==null&&(ct.data=Ze)))),(Ze=dn?dO(r,s):fO(r,s))&&(ct=Pd(ie,"onBeforeInput"),0<ct.length&&(Le=new oe("onBeforeInput","beforeinput",null,s,ge),ve.push({event:Le,listeners:ct}),Le.data=Ze)),oM(ve,r,ie,s,ge)}Xk(ve,a)})}function mc(r,a,s){return{instance:r,listener:a,currentTarget:s}}function Pd(r,a){for(var s=a+"Capture",c=[];r!==null;){var m=r,y=m.stateNode;if(m=m.tag,m!==5&&m!==26&&m!==27||y===null||(m=go(r,s),m!=null&&c.unshift(mc(r,m,y)),m=go(r,a),m!=null&&c.push(mc(r,m,y))),r.tag===3)return c;r=r.return}return[]}function lM(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5&&r.tag!==27);return r||null}function Zk(r,a,s,c,m){for(var y=a._reactName,C=[];s!==null&&s!==c;){var R=s,H=R.alternate,ie=R.stateNode;if(R=R.tag,H!==null&&H===c)break;R!==5&&R!==26&&R!==27||ie===null||(H=ie,m?(ie=go(s,y),ie!=null&&C.unshift(mc(s,ie,H))):m||(ie=go(s,y),ie!=null&&C.push(mc(s,ie,H)))),s=s.return}C.length!==0&&r.push({event:a,listeners:C})}var cM=/\r\n?/g,uM=/\u0000|\uFFFD/g;function eC(r){return(typeof r=="string"?r:""+r).replace(cM,`
|
|
10
|
+
`).replace(uM,"")}function tC(r,a){return a=eC(a),eC(r)===a}function Ot(r,a,s,c,m,y){switch(s){case"children":typeof c=="string"?a==="body"||a==="textarea"&&c===""||Ni(r,c):(typeof c=="number"||typeof c=="bigint")&&a!=="body"&&Ni(r,""+c);break;case"className":mo(r,"class",c);break;case"tabIndex":mo(r,"tabindex",c);break;case"dir":case"role":case"viewBox":case"width":case"height":mo(r,s,c);break;case"style":zu(r,c,y);break;case"data":if(a!=="object"){mo(r,"data",c);break}case"src":case"href":if(c===""&&(a!=="a"||s!=="href")){r.removeAttribute(s);break}if(c==null||typeof c=="function"||typeof c=="symbol"||typeof c=="boolean"){r.removeAttribute(s);break}c=ys(""+c),r.setAttribute(s,c);break;case"action":case"formAction":if(typeof c=="function"){r.setAttribute(s,"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 y=="function"&&(s==="formAction"?(a!=="input"&&Ot(r,a,"name",m.name,m,null),Ot(r,a,"formEncType",m.formEncType,m,null),Ot(r,a,"formMethod",m.formMethod,m,null),Ot(r,a,"formTarget",m.formTarget,m,null)):(Ot(r,a,"encType",m.encType,m,null),Ot(r,a,"method",m.method,m,null),Ot(r,a,"target",m.target,m,null)));if(c==null||typeof c=="symbol"||typeof c=="boolean"){r.removeAttribute(s);break}c=ys(""+c),r.setAttribute(s,c);break;case"onClick":c!=null&&(r.onclick=Nr);break;case"onScroll":c!=null&&ot("scroll",r);break;case"onScrollEnd":c!=null&&ot("scrollend",r);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(o(61));if(s=c.__html,s!=null){if(m.children!=null)throw Error(o(60));r.innerHTML=s}}break;case"multiple":r.multiple=c&&typeof c!="function"&&typeof c!="symbol";break;case"muted":r.muted=c&&typeof c!="function"&&typeof c!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(c==null||typeof c=="function"||typeof c=="boolean"||typeof c=="symbol"){r.removeAttribute("xlink:href");break}s=ys(""+c),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":c!=null&&typeof c!="function"&&typeof c!="symbol"?r.setAttribute(s,""+c):r.removeAttribute(s);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":c&&typeof c!="function"&&typeof c!="symbol"?r.setAttribute(s,""):r.removeAttribute(s);break;case"capture":case"download":c===!0?r.setAttribute(s,""):c!==!1&&c!=null&&typeof c!="function"&&typeof c!="symbol"?r.setAttribute(s,c):r.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":c!=null&&typeof c!="function"&&typeof c!="symbol"&&!isNaN(c)&&1<=c?r.setAttribute(s,c):r.removeAttribute(s);break;case"rowSpan":case"start":c==null||typeof c=="function"||typeof c=="symbol"||isNaN(c)?r.removeAttribute(s):r.setAttribute(s,c);break;case"popover":ot("beforetoggle",r),ot("toggle",r),po(r,"popover",c);break;case"xlinkActuate":ti(r,"http://www.w3.org/1999/xlink","xlink:actuate",c);break;case"xlinkArcrole":ti(r,"http://www.w3.org/1999/xlink","xlink:arcrole",c);break;case"xlinkRole":ti(r,"http://www.w3.org/1999/xlink","xlink:role",c);break;case"xlinkShow":ti(r,"http://www.w3.org/1999/xlink","xlink:show",c);break;case"xlinkTitle":ti(r,"http://www.w3.org/1999/xlink","xlink:title",c);break;case"xlinkType":ti(r,"http://www.w3.org/1999/xlink","xlink:type",c);break;case"xmlBase":ti(r,"http://www.w3.org/XML/1998/namespace","xml:base",c);break;case"xmlLang":ti(r,"http://www.w3.org/XML/1998/namespace","xml:lang",c);break;case"xmlSpace":ti(r,"http://www.w3.org/XML/1998/namespace","xml:space",c);break;case"is":po(r,"is",c);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=gs.get(s)||s,po(r,s,c))}}function ag(r,a,s,c,m,y){switch(s){case"style":zu(r,c,y);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(o(61));if(s=c.__html,s!=null){if(m.children!=null)throw Error(o(60));r.innerHTML=s}}break;case"children":typeof c=="string"?Ni(r,c):(typeof c=="number"||typeof c=="bigint")&&Ni(r,""+c);break;case"onScroll":c!=null&&ot("scroll",r);break;case"onScrollEnd":c!=null&&ot("scrollend",r);break;case"onClick":c!=null&&(r.onclick=Nr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Ou.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(m=s.endsWith("Capture"),a=s.slice(2,m?s.length-7:void 0),y=r[Ke]||null,y=y==null?null:y[s],typeof y=="function"&&r.removeEventListener(a,y,m),typeof c=="function")){typeof y!="function"&&y!==null&&(s in r?r[s]=null:r.hasAttribute(s)&&r.removeAttribute(s)),r.addEventListener(a,c,m);break e}s in r?r[s]=c:c===!0?r.setAttribute(s,""):po(r,s,c)}}}function Ln(r,a,s){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ot("error",r),ot("load",r);var c=!1,m=!1,y;for(y in s)if(s.hasOwnProperty(y)){var C=s[y];if(C!=null)switch(y){case"src":c=!0;break;case"srcSet":m=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,a));default:Ot(r,a,y,C,s,null)}}m&&Ot(r,a,"srcSet",s.srcSet,s,null),c&&Ot(r,a,"src",s.src,s,null);return;case"input":ot("invalid",r);var R=y=C=m=null,H=null,ie=null;for(c in s)if(s.hasOwnProperty(c)){var ge=s[c];if(ge!=null)switch(c){case"name":m=ge;break;case"type":C=ge;break;case"checked":H=ge;break;case"defaultChecked":ie=ge;break;case"value":y=ge;break;case"defaultValue":R=ge;break;case"children":case"dangerouslySetInnerHTML":if(ge!=null)throw Error(o(137,a));break;default:Ot(r,a,c,ge,s,null)}}qu(r,y,R,H,ie,C,m,!1);return;case"select":for(m in ot("invalid",r),c=C=y=null,s)if(s.hasOwnProperty(m)&&(R=s[m],R!=null))switch(m){case"value":y=R;break;case"defaultValue":C=R;break;case"multiple":c=R;default:Ot(r,a,m,R,s,null)}a=y,s=C,r.multiple=!!c,a==null?s!=null&&Ea(r,!!c,s,!0):Ea(r,!!c,a,!1);return;case"textarea":for(C in ot("invalid",r),y=m=c=null,s)if(s.hasOwnProperty(C)&&(R=s[C],R!=null))switch(C){case"value":c=R;break;case"defaultValue":m=R;break;case"children":y=R;break;case"dangerouslySetInnerHTML":if(R!=null)throw Error(o(91));break;default:Ot(r,a,C,R,s,null)}hs(r,c,m,y);return;case"option":for(H in s)s.hasOwnProperty(H)&&(c=s[H],c!=null)&&(H==="selected"?r.selected=c&&typeof c!="function"&&typeof c!="symbol":Ot(r,a,H,c,s,null));return;case"dialog":ot("beforetoggle",r),ot("toggle",r),ot("cancel",r),ot("close",r);break;case"iframe":case"object":ot("load",r);break;case"video":case"audio":for(c=0;c<pc.length;c++)ot(pc[c],r);break;case"image":ot("error",r),ot("load",r);break;case"details":ot("toggle",r);break;case"embed":case"source":case"link":ot("error",r),ot("load",r);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ie in s)if(s.hasOwnProperty(ie)&&(c=s[ie],c!=null))switch(ie){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,a));default:Ot(r,a,ie,c,s,null)}return;default:if(ho(a)){for(ge in s)s.hasOwnProperty(ge)&&(c=s[ge],c!==void 0&&ag(r,a,ge,c,s,void 0));return}}for(R in s)s.hasOwnProperty(R)&&(c=s[R],c!=null&&Ot(r,a,R,c,s,null))}function dM(r,a,s,c){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var m=null,y=null,C=null,R=null,H=null,ie=null,ge=null;for(fe in s){var ve=s[fe];if(s.hasOwnProperty(fe)&&ve!=null)switch(fe){case"checked":break;case"value":break;case"defaultValue":H=ve;default:c.hasOwnProperty(fe)||Ot(r,a,fe,null,c,ve)}}for(var se in c){var fe=c[se];if(ve=s[se],c.hasOwnProperty(se)&&(fe!=null||ve!=null))switch(se){case"type":y=fe;break;case"name":m=fe;break;case"checked":ie=fe;break;case"defaultChecked":ge=fe;break;case"value":C=fe;break;case"defaultValue":R=fe;break;case"children":case"dangerouslySetInnerHTML":if(fe!=null)throw Error(o(137,a));break;default:fe!==ve&&Ot(r,a,se,fe,c,ve)}}Sa(r,C,R,H,ie,ge,y,m);return;case"select":for(y in fe=C=R=se=null,s)if(H=s[y],s.hasOwnProperty(y)&&H!=null)switch(y){case"value":break;case"multiple":fe=H;default:c.hasOwnProperty(y)||Ot(r,a,y,null,c,H)}for(m in c)if(y=c[m],H=s[m],c.hasOwnProperty(m)&&(y!=null||H!=null))switch(m){case"value":se=y;break;case"defaultValue":R=y;break;case"multiple":C=y;default:y!==H&&Ot(r,a,m,y,c,H)}a=R,s=C,c=fe,se==null?!!c!=!!s&&(a==null?Ea(r,!!s,s?[]:"",!1):Ea(r,!!s,a,!0)):Ea(r,!!s,se,!1);return;case"textarea":for(R in fe=se=null,s)if(m=s[R],s.hasOwnProperty(R)&&m!=null&&!c.hasOwnProperty(R))switch(R){case"value":break;case"children":break;default:Ot(r,a,R,null,c,m)}for(C in c)if(m=c[C],y=s[C],c.hasOwnProperty(C)&&(m!=null||y!=null))switch(C){case"value":se=m;break;case"defaultValue":fe=m;break;case"children":break;case"dangerouslySetInnerHTML":if(m!=null)throw Error(o(91));break;default:m!==y&&Ot(r,a,C,m,c,y)}Ta(r,se,fe);return;case"option":for(var Ae in s)se=s[Ae],s.hasOwnProperty(Ae)&&se!=null&&!c.hasOwnProperty(Ae)&&(Ae==="selected"?r.selected=!1:Ot(r,a,Ae,null,c,se));for(H in c)se=c[H],fe=s[H],c.hasOwnProperty(H)&&se!==fe&&(se!=null||fe!=null)&&(H==="selected"?r.selected=se&&typeof se!="function"&&typeof se!="symbol":Ot(r,a,H,se,c,fe));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 Ve in s)se=s[Ve],s.hasOwnProperty(Ve)&&se!=null&&!c.hasOwnProperty(Ve)&&Ot(r,a,Ve,null,c,se);for(ie in c)if(se=c[ie],fe=s[ie],c.hasOwnProperty(ie)&&se!==fe&&(se!=null||fe!=null))switch(ie){case"children":case"dangerouslySetInnerHTML":if(se!=null)throw Error(o(137,a));break;default:Ot(r,a,ie,se,c,fe)}return;default:if(ho(a)){for(var Mt in s)se=s[Mt],s.hasOwnProperty(Mt)&&se!==void 0&&!c.hasOwnProperty(Mt)&&ag(r,a,Mt,void 0,c,se);for(ge in c)se=c[ge],fe=s[ge],!c.hasOwnProperty(ge)||se===fe||se===void 0&&fe===void 0||ag(r,a,ge,se,c,fe);return}}for(var K in s)se=s[K],s.hasOwnProperty(K)&&se!=null&&!c.hasOwnProperty(K)&&Ot(r,a,K,null,c,se);for(ve in c)se=c[ve],fe=s[ve],!c.hasOwnProperty(ve)||se===fe||se==null&&fe==null||Ot(r,a,ve,se,c,fe)}function nC(r){switch(r){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function fM(){if(typeof performance.getEntriesByType=="function"){for(var r=0,a=0,s=performance.getEntriesByType("resource"),c=0;c<s.length;c++){var m=s[c],y=m.transferSize,C=m.initiatorType,R=m.duration;if(y&&R&&nC(C)){for(C=0,R=m.responseEnd,c+=1;c<s.length;c++){var H=s[c],ie=H.startTime;if(ie>R)break;var ge=H.transferSize,ve=H.initiatorType;ge&&nC(ve)&&(H=H.responseEnd,C+=ge*(H<R?1:(R-ie)/(H-ie)))}if(--c,a+=8*(y+C)/(m.duration/1e3),r++,10<r)break}}if(0<r)return a/r/1e6}return navigator.connection&&(r=navigator.connection.downlink,typeof r=="number")?r:5}var og=null,sg=null;function Od(r){return r.nodeType===9?r:r.ownerDocument}function rC(r){switch(r){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function iC(r,a){if(r===0)switch(a){case"svg":return 1;case"math":return 2;default:return 0}return r===1&&a==="foreignObject"?0:r}function lg(r,a){return r==="textarea"||r==="noscript"||typeof a.children=="string"||typeof a.children=="number"||typeof a.children=="bigint"||typeof a.dangerouslySetInnerHTML=="object"&&a.dangerouslySetInnerHTML!==null&&a.dangerouslySetInnerHTML.__html!=null}var cg=null;function pM(){var r=window.event;return r&&r.type==="popstate"?r===cg?!1:(cg=r,!0):(cg=null,!1)}var aC=typeof setTimeout=="function"?setTimeout:void 0,mM=typeof clearTimeout=="function"?clearTimeout:void 0,oC=typeof Promise=="function"?Promise:void 0,hM=typeof queueMicrotask=="function"?queueMicrotask:oC===void 0?aC:function(r){return oC.resolve(null).then(r).catch(gM)};function gM(r){setTimeout(function(){throw r})}function Va(r){return r==="head"}function sC(r,a){var s=a,c=0;do{var m=s.nextSibling;if(r.removeChild(s),m&&m.nodeType===8)if(s=m.data,s==="/$"||s==="/&"){if(c===0){r.removeChild(m),Qs(a);return}c--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")c++;else if(s==="html")hc(r.ownerDocument.documentElement);else if(s==="head"){s=r.ownerDocument.head,hc(s);for(var y=s.firstChild;y;){var C=y.nextSibling,R=y.nodeName;y[mt]||R==="SCRIPT"||R==="STYLE"||R==="LINK"&&y.rel.toLowerCase()==="stylesheet"||s.removeChild(y),y=C}}else s==="body"&&hc(r.ownerDocument.body);s=m}while(s);Qs(a)}function lC(r,a){var s=r;r=0;do{var c=s.nextSibling;if(s.nodeType===1?a?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(a?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),c&&c.nodeType===8)if(s=c.data,s==="/$"){if(r===0)break;r--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||r++;s=c}while(s)}function ug(r){var a=r.firstChild;for(a&&a.nodeType===10&&(a=a.nextSibling);a;){var s=a;switch(a=a.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":ug(s),Sn(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}r.removeChild(s)}}function yM(r,a,s,c){for(;r.nodeType===1;){var m=s;if(r.nodeName.toLowerCase()!==a.toLowerCase()){if(!c&&(r.nodeName!=="INPUT"||r.type!=="hidden"))break}else if(c){if(!r[mt])switch(a){case"meta":if(!r.hasAttribute("itemprop"))break;return r;case"link":if(y=r.getAttribute("rel"),y==="stylesheet"&&r.hasAttribute("data-precedence")||y!==m.rel||r.getAttribute("href")!==(m.href==null||m.href===""?null:m.href)||r.getAttribute("crossorigin")!==(m.crossOrigin==null?null:m.crossOrigin)||r.getAttribute("title")!==(m.title==null?null:m.title))break;return r;case"style":if(r.hasAttribute("data-precedence"))break;return r;case"script":if(y=r.getAttribute("src"),(y!==(m.src==null?null:m.src)||r.getAttribute("type")!==(m.type==null?null:m.type)||r.getAttribute("crossorigin")!==(m.crossOrigin==null?null:m.crossOrigin))&&y&&r.hasAttribute("async")&&!r.hasAttribute("itemprop"))break;return r;default:return r}}else if(a==="input"&&r.type==="hidden"){var y=m.name==null?null:""+m.name;if(m.type==="hidden"&&r.getAttribute("name")===y)return r}else return r;if(r=Hr(r.nextSibling),r===null)break}return null}function vM(r,a,s){if(a==="")return null;for(;r.nodeType!==3;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!s||(r=Hr(r.nextSibling),r===null))return null;return r}function cC(r,a){for(;r.nodeType!==8;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!a||(r=Hr(r.nextSibling),r===null))return null;return r}function dg(r){return r.data==="$?"||r.data==="$~"}function fg(r){return r.data==="$!"||r.data==="$?"&&r.ownerDocument.readyState!=="loading"}function bM(r,a){var s=r.ownerDocument;if(r.data==="$~")r._reactRetry=a;else if(r.data!=="$?"||s.readyState!=="loading")a();else{var c=function(){a(),s.removeEventListener("DOMContentLoaded",c)};s.addEventListener("DOMContentLoaded",c),r._reactRetry=c}}function Hr(r){for(;r!=null;r=r.nextSibling){var a=r.nodeType;if(a===1||a===3)break;if(a===8){if(a=r.data,a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"||a==="F!"||a==="F")break;if(a==="/$"||a==="/&")return null}}return r}var pg=null;function uC(r){r=r.nextSibling;for(var a=0;r;){if(r.nodeType===8){var s=r.data;if(s==="/$"||s==="/&"){if(a===0)return Hr(r.nextSibling);a--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||a++}r=r.nextSibling}return null}function dC(r){r=r.previousSibling;for(var a=0;r;){if(r.nodeType===8){var s=r.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(a===0)return r;a--}else s!=="/$"&&s!=="/&"||a++}r=r.previousSibling}return null}function fC(r,a,s){switch(a=Od(s),r){case"html":if(r=a.documentElement,!r)throw Error(o(452));return r;case"head":if(r=a.head,!r)throw Error(o(453));return r;case"body":if(r=a.body,!r)throw Error(o(454));return r;default:throw Error(o(451))}}function hc(r){for(var a=r.attributes;a.length;)r.removeAttributeNode(a[0]);Sn(r)}var Br=new Map,pC=new Set;function Md(r){return typeof r.getRootNode=="function"?r.getRootNode():r.nodeType===9?r:r.ownerDocument}var ea=G.d;G.d={f:wM,r:xM,D:_M,C:kM,L:CM,m:SM,X:TM,S:EM,M:DM};function wM(){var r=ea.f(),a=Ed();return r||a}function xM(r){var a=yi(r);a!==null&&a.tag===5&&a.type==="form"?L_(a):ea.r(r)}var Ws=typeof document>"u"?null:document;function mC(r,a,s){var c=Ws;if(c&&typeof a=="string"&&a){var m=gr(a);m='link[rel="'+r+'"][href="'+m+'"]',typeof s=="string"&&(m+='[crossorigin="'+s+'"]'),pC.has(m)||(pC.add(m),r={rel:r,crossOrigin:s,href:a},c.querySelector(m)===null&&(a=c.createElement("link"),Ln(a,"link",r),an(a),c.head.appendChild(a)))}}function _M(r){ea.D(r),mC("dns-prefetch",r,null)}function kM(r,a){ea.C(r,a),mC("preconnect",r,a)}function CM(r,a,s){ea.L(r,a,s);var c=Ws;if(c&&r&&a){var m='link[rel="preload"][as="'+gr(a)+'"]';a==="image"&&s&&s.imageSrcSet?(m+='[imagesrcset="'+gr(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(m+='[imagesizes="'+gr(s.imageSizes)+'"]')):m+='[href="'+gr(r)+'"]';var y=m;switch(a){case"style":y=Us(r);break;case"script":y=Ks(r)}Br.has(y)||(r=S({rel:"preload",href:a==="image"&&s&&s.imageSrcSet?void 0:r,as:a},s),Br.set(y,r),c.querySelector(m)!==null||a==="style"&&c.querySelector(gc(y))||a==="script"&&c.querySelector(yc(y))||(a=c.createElement("link"),Ln(a,"link",r),an(a),c.head.appendChild(a)))}}function SM(r,a){ea.m(r,a);var s=Ws;if(s&&r){var c=a&&typeof a.as=="string"?a.as:"script",m='link[rel="modulepreload"][as="'+gr(c)+'"][href="'+gr(r)+'"]',y=m;switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":y=Ks(r)}if(!Br.has(y)&&(r=S({rel:"modulepreload",href:r},a),Br.set(y,r),s.querySelector(m)===null)){switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(yc(y)))return}c=s.createElement("link"),Ln(c,"link",r),an(c),s.head.appendChild(c)}}}function EM(r,a,s){ea.S(r,a,s);var c=Ws;if(c&&r){var m=ka(c).hoistableStyles,y=Us(r);a||(a="default");var C=m.get(y);if(!C){var R={loading:0,preload:null};if(C=c.querySelector(gc(y)))R.loading=5;else{r=S({rel:"stylesheet",href:r,"data-precedence":a},s),(s=Br.get(y))&&mg(r,s);var H=C=c.createElement("link");an(H),Ln(H,"link",r),H._p=new Promise(function(ie,ge){H.onload=ie,H.onerror=ge}),H.addEventListener("load",function(){R.loading|=1}),H.addEventListener("error",function(){R.loading|=2}),R.loading|=4,Nd(C,a,c)}C={type:"stylesheet",instance:C,count:1,state:R},m.set(y,C)}}}function TM(r,a){ea.X(r,a);var s=Ws;if(s&&r){var c=ka(s).hoistableScripts,m=Ks(r),y=c.get(m);y||(y=s.querySelector(yc(m)),y||(r=S({src:r,async:!0},a),(a=Br.get(m))&&hg(r,a),y=s.createElement("script"),an(y),Ln(y,"link",r),s.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},c.set(m,y))}}function DM(r,a){ea.M(r,a);var s=Ws;if(s&&r){var c=ka(s).hoistableScripts,m=Ks(r),y=c.get(m);y||(y=s.querySelector(yc(m)),y||(r=S({src:r,async:!0,type:"module"},a),(a=Br.get(m))&&hg(r,a),y=s.createElement("script"),an(y),Ln(y,"link",r),s.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},c.set(m,y))}}function hC(r,a,s,c){var m=(m=bt.current)?Md(m):null;if(!m)throw Error(o(446));switch(r){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(a=Us(s.href),s=ka(m).hoistableStyles,c=s.get(a),c||(c={type:"style",instance:null,count:0,state:null},s.set(a,c)),c):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){r=Us(s.href);var y=ka(m).hoistableStyles,C=y.get(r);if(C||(m=m.ownerDocument||m,C={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},y.set(r,C),(y=m.querySelector(gc(r)))&&!y._p&&(C.instance=y,C.state.loading=5),Br.has(r)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},Br.set(r,s),y||RM(m,r,s,C.state))),a&&c===null)throw Error(o(528,""));return C}if(a&&c!==null)throw Error(o(529,""));return null;case"script":return a=s.async,s=s.src,typeof s=="string"&&a&&typeof a!="function"&&typeof a!="symbol"?(a=Ks(s),s=ka(m).hoistableScripts,c=s.get(a),c||(c={type:"script",instance:null,count:0,state:null},s.set(a,c)),c):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,r))}}function Us(r){return'href="'+gr(r)+'"'}function gc(r){return'link[rel="stylesheet"]['+r+"]"}function gC(r){return S({},r,{"data-precedence":r.precedence,precedence:null})}function RM(r,a,s,c){r.querySelector('link[rel="preload"][as="style"]['+a+"]")?c.loading=1:(a=r.createElement("link"),c.preload=a,a.addEventListener("load",function(){return c.loading|=1}),a.addEventListener("error",function(){return c.loading|=2}),Ln(a,"link",s),an(a),r.head.appendChild(a))}function Ks(r){return'[src="'+gr(r)+'"]'}function yc(r){return"script[async]"+r}function yC(r,a,s){if(a.count++,a.instance===null)switch(a.type){case"style":var c=r.querySelector('style[data-href~="'+gr(s.href)+'"]');if(c)return a.instance=c,an(c),c;var m=S({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return c=(r.ownerDocument||r).createElement("style"),an(c),Ln(c,"style",m),Nd(c,s.precedence,r),a.instance=c;case"stylesheet":m=Us(s.href);var y=r.querySelector(gc(m));if(y)return a.state.loading|=4,a.instance=y,an(y),y;c=gC(s),(m=Br.get(m))&&mg(c,m),y=(r.ownerDocument||r).createElement("link"),an(y);var C=y;return C._p=new Promise(function(R,H){C.onload=R,C.onerror=H}),Ln(y,"link",c),a.state.loading|=4,Nd(y,s.precedence,r),a.instance=y;case"script":return y=Ks(s.src),(m=r.querySelector(yc(y)))?(a.instance=m,an(m),m):(c=s,(m=Br.get(y))&&(c=S({},s),hg(c,m)),r=r.ownerDocument||r,m=r.createElement("script"),an(m),Ln(m,"link",c),r.head.appendChild(m),a.instance=m);case"void":return null;default:throw Error(o(443,a.type))}else a.type==="stylesheet"&&!(a.state.loading&4)&&(c=a.instance,a.state.loading|=4,Nd(c,s.precedence,r));return a.instance}function Nd(r,a,s){for(var c=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),m=c.length?c[c.length-1]:null,y=m,C=0;C<c.length;C++){var R=c[C];if(R.dataset.precedence===a)y=R;else if(y!==m)break}y?y.parentNode.insertBefore(r,y.nextSibling):(a=s.nodeType===9?s.head:s,a.insertBefore(r,a.firstChild))}function mg(r,a){r.crossOrigin??(r.crossOrigin=a.crossOrigin),r.referrerPolicy??(r.referrerPolicy=a.referrerPolicy),r.title??(r.title=a.title)}function hg(r,a){r.crossOrigin??(r.crossOrigin=a.crossOrigin),r.referrerPolicy??(r.referrerPolicy=a.referrerPolicy),r.integrity??(r.integrity=a.integrity)}var jd=null;function vC(r,a,s){if(jd===null){var c=new Map,m=jd=new Map;m.set(s,c)}else m=jd,c=m.get(s),c||(c=new Map,m.set(s,c));if(c.has(r))return c;for(c.set(r,null),s=s.getElementsByTagName(r),m=0;m<s.length;m++){var y=s[m];if(!(y[mt]||y[Ue]||r==="link"&&y.getAttribute("rel")==="stylesheet")&&y.namespaceURI!=="http://www.w3.org/2000/svg"){var C=y.getAttribute(a)||"";C=r+C;var R=c.get(C);R?R.push(y):c.set(C,[y])}}return c}function bC(r,a,s){r=r.ownerDocument||r,r.head.insertBefore(s,a==="title"?r.querySelector("head > title"):null)}function IM(r,a,s){if(s===1||a.itemProp!=null)return!1;switch(r){case"meta":case"title":return!0;case"style":if(typeof a.precedence!="string"||typeof a.href!="string"||a.href==="")break;return!0;case"link":if(typeof a.rel!="string"||typeof a.href!="string"||a.href===""||a.onLoad||a.onError)break;return a.rel==="stylesheet"?(r=a.disabled,typeof a.precedence=="string"&&r==null):!0;case"script":if(a.async&&typeof a.async!="function"&&typeof a.async!="symbol"&&!a.onLoad&&!a.onError&&a.src&&typeof a.src=="string")return!0}return!1}function wC(r){return!(r.type==="stylesheet"&&!(r.state.loading&3))}function AM(r,a,s,c){if(s.type==="stylesheet"&&(typeof c.media!="string"||matchMedia(c.media).matches!==!1)&&!(s.state.loading&4)){if(s.instance===null){var m=Us(c.href),y=a.querySelector(gc(m));if(y){a=y._p,typeof a=="object"&&a&&typeof a.then=="function"&&(r.count++,r=qd.bind(r),a.then(r,r)),s.state.loading|=4,s.instance=y,an(y);return}y=a.ownerDocument||a,c=gC(c),(m=Br.get(m))&&mg(c,m),y=y.createElement("link"),an(y);var C=y;C._p=new Promise(function(R,H){C.onload=R,C.onerror=H}),Ln(y,"link",c),s.instance=y}r.stylesheets===null&&(r.stylesheets=new Map),r.stylesheets.set(s,a),(a=s.state.preload)&&!(s.state.loading&3)&&(r.count++,s=qd.bind(r),a.addEventListener("load",s),a.addEventListener("error",s))}}var gg=0;function LM(r,a){return r.stylesheets&&r.count===0&&Fd(r,r.stylesheets),0<r.count||0<r.imgCount?function(s){var c=setTimeout(function(){if(r.stylesheets&&Fd(r,r.stylesheets),r.unsuspend){var y=r.unsuspend;r.unsuspend=null,y()}},6e4+a);0<r.imgBytes&&gg===0&&(gg=62500*fM());var m=setTimeout(function(){if(r.waitingForImages=!1,r.count===0&&(r.stylesheets&&Fd(r,r.stylesheets),r.unsuspend)){var y=r.unsuspend;r.unsuspend=null,y()}},(r.imgBytes>gg?50:800)+a);return r.unsuspend=s,function(){r.unsuspend=null,clearTimeout(c),clearTimeout(m)}}:null}function qd(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Fd(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var zd=null;function Fd(r,a){r.stylesheets=null,r.unsuspend!==null&&(r.count++,zd=new Map,a.forEach(PM,r),zd=null,qd.call(r))}function PM(r,a){if(!(a.state.loading&4)){var s=zd.get(r);if(s)var c=s.get(null);else{s=new Map,zd.set(r,s);for(var m=r.querySelectorAll("link[data-precedence],style[data-precedence]"),y=0;y<m.length;y++){var C=m[y];(C.nodeName==="LINK"||C.getAttribute("media")!=="not all")&&(s.set(C.dataset.precedence,C),c=C)}c&&s.set(null,c)}m=a.instance,C=m.getAttribute("data-precedence"),y=s.get(C)||c,y===c&&s.set(null,m),s.set(C,m),this.count++,c=qd.bind(this),m.addEventListener("load",c),m.addEventListener("error",c),y?y.parentNode.insertBefore(m,y.nextSibling):(r=r.nodeType===9?r.head:r,r.insertBefore(m,r.firstChild)),a.state.loading|=4}}var vc={$$typeof:U,Provider:null,Consumer:null,_currentValue:je,_currentValue2:je,_threadCount:0};function OM(r,a,s,c,m,y,C,R,H){this.tag=1,this.containerInfo=r,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=gi(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=gi(0),this.hiddenUpdates=gi(null),this.identifierPrefix=c,this.onUncaughtError=m,this.onCaughtError=y,this.onRecoverableError=C,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=H,this.incompleteTransitions=new Map}function MM(r,a,s,c,m,y,C,R,H,ie,ge,ve){return r=new OM(r,a,s,C,H,ie,ge,ve,R),a=1,y===!0&&(a|=24),y=vr(3,null,null,a),r.current=y,y.stateNode=r,a=Xm(),a.refCount++,r.pooledCache=a,a.refCount++,y.memoizedState={element:c,isDehydrated:s,cache:a},eh(y),r}function NM(r){return r?(r=Cs,r):Cs}function xC(r,a,s,c,m,y){m=NM(m),c.context===null?c.context=m:c.pendingContext=m,c=Po(a),c.payload={element:s},y=y===void 0?null:y,y!==null&&(c.callback=y),s=Oo(r,c,a),s!==null&&(or(s,r,a),Xl(s,r,a))}function _C(r,a){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var s=r.retryLane;r.retryLane=s!==0&&s<a?s:a}}function yg(r,a){_C(r,a),(r=r.alternate)&&_C(r,a)}function kC(r){if(r.tag===13||r.tag===31){var a=Co(r,67108864);a!==null&&or(a,r,67108864),yg(r,67108864)}}function CC(r){if(r.tag===13||r.tag===31){var a=Vr();a=rt(a);var s=Co(r,a);s!==null&&or(s,r,a),yg(r,a)}}var $d=!0;function jM(r,a,s,c){var m=he.T;he.T=null;var y=G.p;try{G.p=2,vg(r,a,s,c)}finally{G.p=y,he.T=m}}function qM(r,a,s,c){var m=he.T;he.T=null;var y=G.p;try{G.p=8,vg(r,a,s,c)}finally{G.p=y,he.T=m}}function vg(r,a,s,c){if($d){var m=bg(c);if(m===null)ig(r,a,c,Vd,s),EC(r,c);else if(FM(m,r,a,s,c))c.stopPropagation();else if(EC(r,c),a&4&&-1<zM.indexOf(r)){for(;m!==null;){var y=yi(m);if(y!==null)switch(y.tag){case 3:if(y=y.stateNode,y.current.memoizedState.isDehydrated){var C=qn(y.pendingLanes);if(C!==0){var R=y;for(R.pendingLanes|=2,R.entangledLanes|=2;C;){var H=1<<31-wt(C);R.entanglements[1]|=H,C&=~H}Zi(y),!(xt&6)&&(Cd=Yt()+500,fc(0,!1))}}break;case 31:case 13:R=Co(y,2),R!==null&&or(R,y,2),Ed(),yg(y,2)}if(y=bg(c),y===null&&ig(r,a,c,Vd,s),y===m)break;m=y}m!==null&&c.stopPropagation()}else ig(r,a,c,null,s)}}function bg(r){return r=Ml(r),wg(r)}var Vd=null;function wg(r){if(Vd=null,r=hr(r),r!==null){var a=u(r);if(a===null)r=null;else{var s=a.tag;if(s===13){if(r=d(a),r!==null)return r;r=null}else if(s===31){if(r=p(a),r!==null)return r;r=null}else if(s===3){if(a.stateNode.current.memoizedState.isDehydrated)return a.tag===3?a.stateNode.containerInfo:null;r=null}else a!==r&&(r=null)}}return Vd=r,null}function SC(r){switch(r){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(Ai()){case vn:return 2;case hi:return 8;case Vt:case Zr:return 32;case St:return 268435456;default:return 32}default:return 32}}var xg=!1,Ha=null,Ba=null,Wa=null,bc=new Map,wc=new Map,Ua=[],zM="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 EC(r,a){switch(r){case"focusin":case"focusout":Ha=null;break;case"dragenter":case"dragleave":Ba=null;break;case"mouseover":case"mouseout":Wa=null;break;case"pointerover":case"pointerout":bc.delete(a.pointerId);break;case"gotpointercapture":case"lostpointercapture":wc.delete(a.pointerId)}}function xc(r,a,s,c,m,y){return r===null||r.nativeEvent!==y?(r={blockedOn:a,domEventName:s,eventSystemFlags:c,nativeEvent:y,targetContainers:[m]},a!==null&&(a=yi(a),a!==null&&kC(a)),r):(r.eventSystemFlags|=c,a=r.targetContainers,m!==null&&a.indexOf(m)===-1&&a.push(m),r)}function FM(r,a,s,c,m){switch(a){case"focusin":return Ha=xc(Ha,r,a,s,c,m),!0;case"dragenter":return Ba=xc(Ba,r,a,s,c,m),!0;case"mouseover":return Wa=xc(Wa,r,a,s,c,m),!0;case"pointerover":var y=m.pointerId;return bc.set(y,xc(bc.get(y)||null,r,a,s,c,m)),!0;case"gotpointercapture":return y=m.pointerId,wc.set(y,xc(wc.get(y)||null,r,a,s,c,m)),!0}return!1}function TC(r){var a=hr(r.target);if(a!==null){var s=u(a);if(s!==null){if(a=s.tag,a===13){if(a=d(s),a!==null){r.blockedOn=a,we(r.priority,function(){CC(s)});return}}else if(a===31){if(a=p(s),a!==null){r.blockedOn=a,we(r.priority,function(){CC(s)});return}}else if(a===3&&s.stateNode.current.memoizedState.isDehydrated){r.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}r.blockedOn=null}function Hd(r){if(r.blockedOn!==null)return!1;for(var a=r.targetContainers;0<a.length;){var s=bg(r.nativeEvent);if(s===null){s=r.nativeEvent;var c=new s.constructor(s.type,s);En=c,s.target.dispatchEvent(c),En=null}else return a=yi(s),a!==null&&kC(a),r.blockedOn=s,!1;a.shift()}return!0}function DC(r,a,s){Hd(r)&&s.delete(a)}function $M(){xg=!1,Ha!==null&&Hd(Ha)&&(Ha=null),Ba!==null&&Hd(Ba)&&(Ba=null),Wa!==null&&Hd(Wa)&&(Wa=null),bc.forEach(DC),wc.forEach(DC)}function Bd(r,a){r.blockedOn===a&&(r.blockedOn=null,xg||(xg=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,$M)))}var Wd=null;function RC(r){Wd!==r&&(Wd=r,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Wd===r&&(Wd=null);for(var a=0;a<r.length;a+=3){var s=r[a],c=r[a+1],m=r[a+2];if(typeof c!="function"){if(wg(c||s)===null)continue;break}var y=yi(s);y!==null&&(r.splice(a,3),a-=3,wh(y,{pending:!0,data:m,method:s.method,action:c},c,m))}}))}function Qs(r){function a(H){return Bd(H,r)}Ha!==null&&Bd(Ha,r),Ba!==null&&Bd(Ba,r),Wa!==null&&Bd(Wa,r),bc.forEach(a),wc.forEach(a);for(var s=0;s<Ua.length;s++){var c=Ua[s];c.blockedOn===r&&(c.blockedOn=null)}for(;0<Ua.length&&(s=Ua[0],s.blockedOn===null);)TC(s),s.blockedOn===null&&Ua.shift();if(s=(r.ownerDocument||r).$$reactFormReplay,s!=null)for(c=0;c<s.length;c+=3){var m=s[c],y=s[c+1],C=m[Ke]||null;if(typeof y=="function")C||RC(s);else if(C){var R=null;if(y&&y.hasAttribute("formAction")){if(m=y,C=y[Ke]||null)R=C.formAction;else if(wg(m)!==null)continue}else R=C.action;typeof R=="function"?s[c+1]=R:(s.splice(c,3),c-=3),RC(s)}}}function VM(){function r(y){y.canIntercept&&y.info==="react-transition"&&y.intercept({handler:function(){return new Promise(function(C){return m=C})},focusReset:"manual",scroll:"manual"})}function a(){m!==null&&(m(),m=null),c||setTimeout(s,20)}function s(){if(!c&&!navigation.transition){var y=navigation.currentEntry;y&&y.url!=null&&navigation.navigate(y.url,{state:y.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var c=!1,m=null;return navigation.addEventListener("navigate",r),navigation.addEventListener("navigatesuccess",a),navigation.addEventListener("navigateerror",a),setTimeout(s,100),function(){c=!0,navigation.removeEventListener("navigate",r),navigation.removeEventListener("navigatesuccess",a),navigation.removeEventListener("navigateerror",a),m!==null&&(m(),m=null)}}}function _g(r){this._internalRoot=r}kg.prototype.render=_g.prototype.render=function(r){var a=this._internalRoot;if(a===null)throw Error(o(409));var s=a.current;xC(s,Vr(),r,a,null,null)},kg.prototype.unmount=_g.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var a=r.containerInfo;xC(r.current,2,null,r,null,null),Ed(),a[ut]=null}};function kg(r){this._internalRoot=r}kg.prototype.unstable_scheduleHydration=function(r){if(r){var a=re();r={blockedOn:null,target:r,priority:a};for(var s=0;s<Ua.length&&a!==0&&a<Ua[s].priority;s++);Ua.splice(s,0,r),s===0&&TC(r)}};var IC=n.version;if(IC!=="19.2.4")throw Error(o(527,IC,"19.2.4"));G.findDOMNode=function(r){var a=r._reactInternals;if(a===void 0)throw typeof r.render=="function"?Error(o(188)):(r=Object.keys(r).join(","),Error(o(268,r)));return r=w(a),r=r===null?null:x(r),r=r===null?null:r.stateNode,r};var HM={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:he,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ud=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ud.isDisabled&&Ud.supportsFiber)try{Or=Ud.inject(HM),rn=Ud}catch{}}e.createRoot=function(r,a){if(!l(r))throw Error(o(299));var s=!1,c="",m=qO,y=zO,C=FO;return a!=null&&(a.unstable_strictMode===!0&&(s=!0),a.identifierPrefix!==void 0&&(c=a.identifierPrefix),a.onUncaughtError!==void 0&&(m=a.onUncaughtError),a.onCaughtError!==void 0&&(y=a.onCaughtError),a.onRecoverableError!==void 0&&(C=a.onRecoverableError)),a=MM(r,1,!1,null,null,s,c,null,m,y,C,VM),r[ut]=a.current,Jk(r),new _g(a)}})),yf=Pe(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(i){console.error(i)}}n(),t.exports=Za()})),BigInt.prototype.toJSON=function(){return JSON.rawJSON(this.toString())},R0=function(e){try{return JSON.parse(e,(t,n)=>$f(n))}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,n)=>typeof n=="string"?n==="\u25D0NaN\u25D0"?NaN:n==="\u25D0Infinity\u25D0"?1/0:n==="\u25D0-Infinity\u25D0"?-1/0:$f(n):$f(n))}catch{return{}}},wT=function(e){if(e.length===0)return"";let t=Object.keys(e[0]);return[`| ${t.join(" | ")} |`,`|${t.map(()=>"---").join("|")}|`,...e.map(n=>`| ${t.map(i=>PT(n[i])).join(" | ")} |`)].join(`
|
|
11
11
|
`)};function PT(e){if(e==null)return"";if(Array.isArray(e)||typeof e=="object")return my(JSON.stringify(e));let t=String(e),n=/\[([^\]]+)]\((https?:\/\/[^)]+)\)/g,i=new Map,o=0;t=t.replaceAll(n,l=>{let u=`__MDLINK_${o++}__`;return i.set(u,l),u}),t=t.replaceAll(/(https?:\/\/\S+)/g,"[$1]($1)");for(let[l,u]of i)t=t.replace(l,u);return my(t)}function my(e){return e.replaceAll("\\","\\\\").replaceAll("|","\\|").replaceAll(`
|
|
12
|
-
`," ").replaceAll("\r","")}function $f(e){return typeof e=="object"&&e&&"$bigint"in e&&typeof e.$bigint=="string"?BigInt(e.$bigint):e}oy="object-id",_T="random-id";var hy="abcdefghijklmnopqrstuvwxyz",gy=hy+hy.toUpperCase(),yy=new Set;Uo="__scratch__",Rr="setup",Ga={create(){let e=0,t;do{let n="";for(let i=0;i<4;i++)n+=gy[Math.floor(Math.random()*gy.length)];t=n,e++}while(yy.has(t)&&e<100);if(e>=100)throw Error("Failed to generate unique CellId after 100 attempts");return yy.add(t),t}},lr={create(e){return Vn(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 n=lr.findElement(t);if(n)return n;let i=t.getRootNode();if(t=i instanceof ShadowRoot?i.host:t.parentElement,t===i)break}return null}},dE=function(e){let t=null,n=lr.findElementThroughShadowDOMs(e);return n&&(t=lr.parse(n.id)),t},Tf={parse(e){return e.getAttribute(oy)},parseOrThrow(e){let t=Tf.parse(e);return Vn(t,"<marimo-ui-element/> missing object-id attribute"),t}},AE={create(e){return`output-${e}`}},ay=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 n=new URL(window.location.href);n.searchParams.set(e,t),window.history.replaceState({},"",n.toString())}getSearchParam(e){return new URL(window.location.href).searchParams.get(e)}},Mf=function(e){return I0(e??"")},_E=function(e){return ki.mapValues(e.dataset,t=>typeof t=="string"?Mf(t):t)},HE=function(e,t){let n=e.parentElement?Tf.parse(e.parentElement):void 0;return n&&t.has(n)?t.lookupValue(n):Mf(e.dataset.initialValue)},X0=function(){if(a5())return document.title||null;if(Gd()){let n=ay.getFilename();if(n)return n}let e=document.querySelector("marimo-filename");l5(e,"marimo-filename tag not found");let t=e.innerHTML;return t.length===0?null:t};var Re=Ud(Kd(),1),M=Ud(f5(),1),Vc="Checkbox",[OT,q6]=zC(Vc),[MT,Vf]=OT(Vc);function NT(e){let{__scopeCheckbox:t,checked:n,children:i,defaultChecked:o,disabled:l,form:u,name:d,onCheckedChange:p,required:g,value:w="on",internal_do_not_use_render:x}=e,[S,E]=$C({prop:n,defaultProp:o??!1,onChange:p,caller:Vc}),[T,O]=Re.useState(null),[j,z]=Re.useState(null),V=Re.useRef(!1),P=T?!!u||!!T.closest("form"):!0,U={checked:S,disabled:l,setChecked:E,control:T,setControl:O,name:d,form:u,value:w,hasConsumerStoppedPropagationRef:V,required:g,defaultChecked:sa(o)?!1:o,isFormControl:P,bubbleInput:j,setBubbleInput:z};return(0,M.jsx)(MT,{scope:t,...U,children:jT(x)?x(U):i})}var vy="CheckboxTrigger",by=Re.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...i},o)=>{let{control:l,value:u,disabled:d,checked:p,required:g,setControl:w,setChecked:x,hasConsumerStoppedPropagationRef:S,isFormControl:E,bubbleInput:T}=Vf(vy,e),O=Qd(o,w),j=Re.useRef(p);return Re.useEffect(()=>{let z=l==null?void 0:l.form;if(z){let V=()=>x(j.current);return z.addEventListener("reset",V),()=>z.removeEventListener("reset",V)}},[l,x]),(0,M.jsx)(ta.button,{type:"button",role:"checkbox","aria-checked":sa(p)?"mixed":p,"aria-required":g,"data-state":Cy(p),"data-disabled":d?"":void 0,disabled:d,value:u,...i,ref:O,onKeyDown:Wr(t,z=>{z.key==="Enter"&&z.preventDefault()}),onClick:Wr(n,z=>{x(V=>sa(V)?!0:!V),T&&E&&(S.current=z.isPropagationStopped(),S.current||z.stopPropagation())})})});by.displayName=vy;var Hf=Re.forwardRef((e,t)=>{let{__scopeCheckbox:n,name:i,checked:o,defaultChecked:l,required:u,disabled:d,value:p,onCheckedChange:g,form:w,...x}=e;return(0,M.jsx)(NT,{__scopeCheckbox:n,checked:o,defaultChecked:l,disabled:d,required:u,onCheckedChange:g,name:i,form:w,value:p,internal_do_not_use_render:({isFormControl:S})=>(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(by,{...x,ref:t,__scopeCheckbox:n}),S&&(0,M.jsx)(ky,{__scopeCheckbox:n})]})})});Hf.displayName=Vc;var wy="CheckboxIndicator",xy=Re.forwardRef((e,t)=>{let{__scopeCheckbox:n,forceMount:i,...o}=e,l=Vf(wy,n);return(0,M.jsx)(FC,{present:i||sa(l.checked)||l.checked===!0,children:(0,M.jsx)(ta.span,{"data-state":Cy(l.checked),"data-disabled":l.disabled?"":void 0,...o,ref:t,style:{pointerEvents:"none",...e.style}})})});xy.displayName=wy;var _y="CheckboxBubbleInput",ky=Re.forwardRef(({__scopeCheckbox:e,...t},n)=>{let{control:i,hasConsumerStoppedPropagationRef:o,checked:l,defaultChecked:u,required:d,disabled:p,name:g,value:w,form:x,bubbleInput:S,setBubbleInput:E}=Vf(_y,e),T=Qd(n,E),O=_5(l),j=v5(i);Re.useEffect(()=>{let V=S;if(!V)return;let P=window.HTMLInputElement.prototype,U=Object.getOwnPropertyDescriptor(P,"checked").set,me=!o.current;if(O!==l&&U){let $=new Event("click",{bubbles:me});V.indeterminate=sa(l),U.call(V,sa(l)?!1:l),V.dispatchEvent($)}},[S,O,l,o]);let z=Re.useRef(sa(l)?!1:l);return(0,M.jsx)(ta.input,{type:"checkbox","aria-hidden":!0,defaultChecked:u??z.current,required:d,disabled:p,name:g,value:w,form:x,...t,tabIndex:-1,ref:T,style:{...t.style,...j,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});ky.displayName=_y;function jT(e){return typeof e=="function"}function sa(e){return e==="indeterminate"}function Cy(e){return sa(e)?"indeterminate":e?"checked":"unchecked"}var qT=Ud(PC(),1),Bf="ToastProvider",[Wf,zT,FT]=b5("Toast"),[Sy,z6]=zC("Toast",[FT]),[$T,Hc]=Sy(Bf),Ey=e=>{let{__scopeToast:t,label:n="Notification",duration:i=5e3,swipeDirection:o="right",swipeThreshold:l=50,children:u}=e,[d,p]=Re.useState(null),[g,w]=Re.useState(0),x=Re.useRef(!1),S=Re.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${Bf}\`. Expected non-empty \`string\`.`),(0,M.jsx)(Wf.Provider,{scope:t,children:(0,M.jsx)($T,{scope:t,label:n,duration:i,swipeDirection:o,swipeThreshold:l,toastCount:g,viewport:d,onViewportChange:p,onToastAdd:Re.useCallback(()=>w(E=>E+1),[]),onToastRemove:Re.useCallback(()=>w(E=>E-1),[]),isFocusedToastEscapeKeyDownRef:x,isClosePausedRef:S,children:u})})};Ey.displayName=Bf;var Ty="ToastViewport",VT=["F8"],Uf="toast.viewportPause",Kf="toast.viewportResume",Dy=Re.forwardRef((e,t)=>{let{__scopeToast:n,hotkey:i=VT,label:o="Notifications ({hotkey})",...l}=e,u=Hc(Ty,n),d=zT(n),p=Re.useRef(null),g=Re.useRef(null),w=Re.useRef(null),x=Re.useRef(null),S=Qd(t,x,u.onViewportChange),E=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),T=u.toastCount>0;Re.useEffect(()=>{let j=z=>{var V;i.length!==0&&i.every(P=>z[P]||z.code===P)&&((V=x.current)==null||V.focus())};return document.addEventListener("keydown",j),()=>document.removeEventListener("keydown",j)},[i]),Re.useEffect(()=>{let j=p.current,z=x.current;if(T&&j&&z){let V=()=>{if(!u.isClosePausedRef.current){let $=new CustomEvent(Uf);z.dispatchEvent($),u.isClosePausedRef.current=!0}},P=()=>{if(u.isClosePausedRef.current){let $=new CustomEvent(Kf);z.dispatchEvent($),u.isClosePausedRef.current=!1}},U=$=>{j.contains($.relatedTarget)||P()},me=()=>{j.contains(document.activeElement)||P()};return j.addEventListener("focusin",V),j.addEventListener("focusout",U),j.addEventListener("pointermove",V),j.addEventListener("pointerleave",me),window.addEventListener("blur",V),window.addEventListener("focus",P),()=>{j.removeEventListener("focusin",V),j.removeEventListener("focusout",U),j.removeEventListener("pointermove",V),j.removeEventListener("pointerleave",me),window.removeEventListener("blur",V),window.removeEventListener("focus",P)}}},[T,u.isClosePausedRef]);let O=Re.useCallback(({tabbingDirection:j})=>{let z=d().map(V=>{let P=V.ref.current,U=[P,...t3(P)];return j==="forwards"?U:U.reverse()});return(j==="forwards"?z.reverse():z).flat()},[d]);return Re.useEffect(()=>{let j=x.current;if(j){let z=V=>{var U,me,$;let P=V.altKey||V.ctrlKey||V.metaKey;if(V.key==="Tab"&&!P){let W=document.activeElement,ae=V.shiftKey;if(V.target===j&&ae){(U=g.current)==null||U.focus();return}let xe=O({tabbingDirection:ae?"backwards":"forwards"}),_e=xe.findIndex(Te=>Te===W);Xf(xe.slice(_e+1))?V.preventDefault():ae?(me=g.current)==null||me.focus():($=w.current)==null||$.focus()}};return j.addEventListener("keydown",z),()=>j.removeEventListener("keydown",z)}},[d,O]),(0,M.jsxs)(y5,{ref:p,role:"region","aria-label":o.replace("{hotkey}",E),tabIndex:-1,style:{pointerEvents:T?void 0:"none"},children:[T&&(0,M.jsx)(Qf,{ref:g,onFocusFromOutsideViewport:()=>{Xf(O({tabbingDirection:"forwards"}))}}),(0,M.jsx)(Wf.Slot,{scope:n,children:(0,M.jsx)(ta.ol,{tabIndex:-1,...l,ref:S})}),T&&(0,M.jsx)(Qf,{ref:w,onFocusFromOutsideViewport:()=>{Xf(O({tabbingDirection:"backwards"}))}})]})});Dy.displayName=Ty;var Ry="ToastFocusProxy",Qf=Re.forwardRef((e,t)=>{let{__scopeToast:n,onFocusFromOutsideViewport:i,...o}=e,l=Hc(Ry,n);return(0,M.jsx)(VC,{tabIndex:0,...o,ref:t,style:{position:"fixed"},onFocus:u=>{var p;let d=u.relatedTarget;(p=l.viewport)!=null&&p.contains(d)||i()}})});Qf.displayName=Ry;var ll="Toast",HT="toast.swipeStart",BT="toast.swipeMove",WT="toast.swipeCancel",UT="toast.swipeEnd",Iy=Re.forwardRef((e,t)=>{let{forceMount:n,open:i,defaultOpen:o,onOpenChange:l,...u}=e,[d,p]=$C({prop:i,defaultProp:o??!0,onChange:l,caller:ll});return(0,M.jsx)(FC,{present:n||d,children:(0,M.jsx)(GT,{open:d,...u,ref:t,onClose:()=>p(!1),onPause:Xd(e.onPause),onResume:Xd(e.onResume),onSwipeStart:Wr(e.onSwipeStart,g=>{g.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Wr(e.onSwipeMove,g=>{let{x:w,y:x}=g.detail.delta;g.currentTarget.setAttribute("data-swipe","move"),g.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${w}px`),g.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${x}px`)}),onSwipeCancel:Wr(e.onSwipeCancel,g=>{g.currentTarget.setAttribute("data-swipe","cancel"),g.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),g.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),g.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),g.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:Wr(e.onSwipeEnd,g=>{let{x:w,y:x}=g.detail.delta;g.currentTarget.setAttribute("data-swipe","end"),g.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),g.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),g.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${w}px`),g.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${x}px`),p(!1)})})})});Iy.displayName=ll;var[KT,QT]=Sy(ll,{onClose(){}}),GT=Re.forwardRef((e,t)=>{let{__scopeToast:n,type:i="foreground",duration:o,open:l,onClose:u,onEscapeKeyDown:d,onPause:p,onResume:g,onSwipeStart:w,onSwipeMove:x,onSwipeCancel:S,onSwipeEnd:E,...T}=e,O=Hc(ll,n),[j,z]=Re.useState(null),V=Qd(t,Y=>z(Y)),P=Re.useRef(null),U=Re.useRef(null),me=o||O.duration,$=Re.useRef(0),W=Re.useRef(me),ae=Re.useRef(0),{onToastAdd:xe,onToastRemove:_e}=O,Te=Xd(()=>{var Y;j!=null&&j.contains(document.activeElement)&&((Y=O.viewport)==null||Y.focus()),u()}),Z=Re.useCallback(Y=>{!Y||Y===1/0||(window.clearTimeout(ae.current),$.current=new Date().getTime(),ae.current=window.setTimeout(Te,Y))},[Te]);Re.useEffect(()=>{let Y=O.viewport;if(Y){let ce=()=>{Z(W.current),g==null||g()},te=()=>{let he=new Date().getTime()-$.current;W.current-=he,window.clearTimeout(ae.current),p==null||p()};return Y.addEventListener(Uf,te),Y.addEventListener(Kf,ce),()=>{Y.removeEventListener(Uf,te),Y.removeEventListener(Kf,ce)}}},[O.viewport,me,p,g,Z]),Re.useEffect(()=>{l&&!O.isClosePausedRef.current&&Z(me)},[l,me,O.isClosePausedRef,Z]),Re.useEffect(()=>(xe(),()=>_e()),[xe,_e]);let Q=Re.useMemo(()=>j?jy(j):null,[j]);return O.viewport?(0,M.jsxs)(M.Fragment,{children:[Q&&(0,M.jsx)(XT,{__scopeToast:n,role:"status","aria-live":i==="foreground"?"assertive":"polite",children:Q}),(0,M.jsx)(KT,{scope:n,onClose:Te,children:qT.createPortal((0,M.jsx)(Wf.ItemSlot,{scope:n,children:(0,M.jsx)(g5,{asChild:!0,onEscapeKeyDown:Wr(d,()=>{O.isFocusedToastEscapeKeyDownRef.current||Te(),O.isFocusedToastEscapeKeyDownRef.current=!1}),children:(0,M.jsx)(ta.li,{tabIndex:0,"data-state":l?"open":"closed","data-swipe-direction":O.swipeDirection,...T,ref:V,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:Wr(e.onKeyDown,Y=>{Y.key==="Escape"&&(d==null||d(Y.nativeEvent),Y.nativeEvent.defaultPrevented||(O.isFocusedToastEscapeKeyDownRef.current=!0,Te()))}),onPointerDown:Wr(e.onPointerDown,Y=>{Y.button===0&&(P.current={x:Y.clientX,y:Y.clientY})}),onPointerMove:Wr(e.onPointerMove,Y=>{if(!P.current)return;let ce=Y.clientX-P.current.x,te=Y.clientY-P.current.y,he=!!U.current,G=["left","right"].includes(O.swipeDirection),Ne=["left","up"].includes(O.swipeDirection)?Math.min:Math.max,qe=G?Ne(0,ce):0,Qe=G?0:Ne(0,te),He=Y.pointerType==="touch"?10:2,Fe={x:qe,y:Qe},Oe={originalEvent:Y,delta:Fe};he?(U.current=Fe,Bc(BT,x,Oe,{discrete:!1})):qy(Fe,O.swipeDirection,He)?(U.current=Fe,Bc(HT,w,Oe,{discrete:!1}),Y.target.setPointerCapture(Y.pointerId)):(Math.abs(ce)>He||Math.abs(te)>He)&&(P.current=null)}),onPointerUp:Wr(e.onPointerUp,Y=>{let ce=U.current,te=Y.target;if(te.hasPointerCapture(Y.pointerId)&&te.releasePointerCapture(Y.pointerId),U.current=null,P.current=null,ce){let he=Y.currentTarget,G={originalEvent:Y,delta:ce};qy(ce,O.swipeDirection,O.swipeThreshold)?Bc(UT,E,G,{discrete:!0}):Bc(WT,S,G,{discrete:!0}),he.addEventListener("click",Ne=>Ne.preventDefault(),{once:!0})}})})})}),O.viewport)})]}):null}),XT=e=>{let{__scopeToast:t,children:n,...i}=e,o=Hc(ll,t),[l,u]=Re.useState(!1),[d,p]=Re.useState(!1);return ZT(()=>u(!0)),Re.useEffect(()=>{let g=window.setTimeout(()=>p(!0),1e3);return()=>window.clearTimeout(g)},[]),d?null:(0,M.jsx)(h5,{asChild:!0,children:(0,M.jsx)(VC,{...i,children:l&&(0,M.jsxs)(M.Fragment,{children:[o.label," ",n]})})})},JT="ToastTitle",Ay=Re.forwardRef((e,t)=>{let{__scopeToast:n,...i}=e;return(0,M.jsx)(ta.div,{...i,ref:t})});Ay.displayName=JT;var YT="ToastDescription",Ly=Re.forwardRef((e,t)=>{let{__scopeToast:n,...i}=e;return(0,M.jsx)(ta.div,{...i,ref:t})});Ly.displayName=YT;var Py="ToastAction",Oy=Re.forwardRef((e,t)=>{let{altText:n,...i}=e;return n.trim()?(0,M.jsx)(Ny,{altText:n,asChild:!0,children:(0,M.jsx)(Gf,{...i,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${Py}\`. Expected non-empty \`string\`.`),null)});Oy.displayName=Py;var My="ToastClose",Gf=Re.forwardRef((e,t)=>{let{__scopeToast:n,...i}=e,o=QT(My,n);return(0,M.jsx)(Ny,{asChild:!0,children:(0,M.jsx)(ta.button,{type:"button",...i,ref:t,onClick:Wr(e.onClick,o.onClose)})})});Gf.displayName=My;var Ny=Re.forwardRef((e,t)=>{let{__scopeToast:n,altText:i,...o}=e;return(0,M.jsx)(ta.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":i||void 0,...o,ref:t})});function jy(e){let t=[];return Array.from(e.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&t.push(n.textContent),e3(n)){let i=n.ariaHidden||n.hidden||n.style.display==="none",o=n.dataset.radixToastAnnounceExclude==="";if(!i)if(o){let l=n.dataset.radixToastAnnounceAlt;l&&t.push(l)}else t.push(...jy(n))}}),t}function Bc(e,t,n,{discrete:i}){let o=n.originalEvent.currentTarget,l=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),i?p5(o,l):o.dispatchEvent(l)}var qy=(e,t,n=0)=>{let i=Math.abs(e.x),o=Math.abs(e.y),l=i>o;return t==="left"||t==="right"?l&&i>n:!l&&o>n};function ZT(e=()=>{}){let t=Xd(e);m5(()=>{let n=0,i=0;return n=window.requestAnimationFrame(()=>i=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(i)}},[t])}function e3(e){return e.nodeType===e.ELEMENT_NODE}function t3(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:i=>{let o=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||o?NodeFilter.FILTER_SKIP:i.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Xf(e){let t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var n3=Ey,zy=Dy,Fy=Iy,$y=Ay,Vy=Ly,Hy=Oy,By=Gf,r3=Symbol("");jE=function(e,t){return je(e,function(n,i,o){i(this,t(n(this),o))})};function Jf(e,t){let n=null,i=new Map,o=new Set,l=d=>{let p;if(t===void 0)p=i.get(d);else for(let[w,x]of i)if(t(w,d)){p=x;break}if(p!==void 0)if(n!=null&&n(p[1],d))l.remove(d);else return p[0];let g=e(d);return i.set(d,[g,Date.now()]),u("CREATE",d,g),g},u=(d,p,g)=>{for(let w of o)w({type:d,param:p,atom:g})};return l.unstable_listen=d=>(o.add(d),()=>{o.delete(d)}),l.getParams=()=>i.keys(),l.remove=d=>{if(t===void 0){if(!i.has(d))return;let[p]=i.get(d);i.delete(d),u("REMOVE",d,p)}else for(let[p,[g]]of i)if(t(p,d)){i.delete(p),u("REMOVE",p,g);break}},l.setShouldRemove=d=>{if(n=d,n)for(let[p,[g,w]]of i)n(w,p)&&(i.delete(p),u("REMOVE",p,g))},l}var Yf=(e,t,n)=>(t.has(n)?t:t.set(n,e())).get(n),i3=new WeakMap,a3=(e,t,n,i)=>Yf(e,Yf(()=>new WeakMap,Yf(()=>new WeakMap,i3,t),n),i);function o3(e,t,n=Object.is){return a3(()=>{let i=Symbol(),o=([u,d])=>{if(d===i)return t(u);let p=t(u,d);return n(d,p)?d:p},l=je(u=>{let d=u(l);return o([u(e),d])});return l.init=i,l},e,t,n)}var Wy=(e,t,n)=>(t.has(n)?t:t.set(n,e())).get(n),s3=new WeakMap,l3=(e,t,n)=>Wy(e,Wy(()=>new WeakMap,s3,t),n),c3={},Uy=e=>!!e.write,u3=e=>typeof e=="function";function d3(e,t){return l3(()=>{let n=new WeakMap,i=(u,d)=>{let p=n.get(u);if(p)return p;let g=d&&n.get(d),w=[],x=[];return u.forEach((S,E)=>{let T=t?t(S):E;x[E]=T;let O=g&&g.atomList[g.keyList.indexOf(T)];if(O){w[E]=O;return}let j=z=>{let V=z(o),P=z(e),U=i(P,V==null?void 0:V.arr).keyList.indexOf(T);if(U<0||U>=P.length){let me=u[i(u).keyList.indexOf(T)];if(me)return me;throw Error("splitAtom: index out of bounds for read")}return P[U]};w[E]=Uy(e)?je(j,(z,V,P)=>{let U=z(o),me=z(e),$=i(me,U==null?void 0:U.arr).keyList.indexOf(T);if($<0||$>=me.length)throw Error("splitAtom: index out of bounds for write");let W=u3(P)?P(me[$]):P;Object.is(me[$],W)||V(e,[...me.slice(0,$),W,...me.slice($+1)])}):je(j)}),p=g&&g.keyList.length===x.length&&g.keyList.every((S,E)=>S===x[E])?g:{arr:u,atomList:w,keyList:x},n.set(u,p),p},o=je(u=>{let d=u(o);return i(u(e),d==null?void 0:d.arr)});o.init=void 0;let l=Uy(e)?je(u=>u(o).atomList,(u,d,p)=>{switch(p.type){case"remove":{let g=u(l).indexOf(p.atom);if(g>=0){let w=u(e);d(e,[...w.slice(0,g),...w.slice(g+1)])}break}case"insert":{let g=p.before?u(l).indexOf(p.before):u(l).length;if(g>=0){let w=u(e);d(e,[...w.slice(0,g),p.value,...w.slice(g)])}break}case"move":{let g=u(l).indexOf(p.atom),w=p.before?u(l).indexOf(p.before):u(l).length;if(g>=0&&w>=0){let x=u(e);g<w?d(e,[...x.slice(0,g),...x.slice(g+1,w),x[g],...x.slice(w)]):d(e,[...x.slice(0,w),x[g],...x.slice(w,g),...x.slice(g+1)])}break}}}):je(u=>u(o).atomList);return l},e,t||c3)}var Ky=e=>typeof(e==null?void 0:e.then)=="function";function Qy(e=()=>{try{return window.localStorage}catch{return}},t){var d;let n,i,o={getItem:(p,g)=>{var S;let w=E=>{if(E||(E=""),n!==E){try{i=JSON.parse(E,t==null?void 0:t.reviver)}catch{return g}n=E}return i},x=((S=e())==null?void 0:S.getItem(p))??null;return Ky(x)?x.then(w):w(x)},setItem:(p,g)=>{var w;return(w=e())==null?void 0:w.setItem(p,JSON.stringify(g,t==null?void 0:t.replacer))},removeItem:p=>{var g;return(g=e())==null?void 0:g.removeItem(p)}},l=p=>(g,w,x)=>p(g,S=>{let E;try{E=JSON.parse(S||"")}catch{E=x}w(E)}),u;try{u=(d=e())==null?void 0:d.subscribe}catch{}return!u&&typeof window<"u"&&typeof window.addEventListener=="function"&&window.Storage&&(u=(p,g)=>{if(!(e()instanceof window.Storage))return()=>{};let w=x=>{x.storageArea===e()&&x.key===p&&g(x.newValue)};return window.addEventListener("storage",w),()=>{window.removeEventListener("storage",w)}}),u&&(o.subscribe=l(u)),o}var f3=Qy();Pc=function(e,t,n=f3,i){let o=je(i!=null&&i.getOnInit?n.getItem(e,t):t);return o.onMount=l=>{l(n.getItem(e,t));let u;return n.subscribe&&(u=n.subscribe(e,l,t)),u},je(l=>l(o),(l,u,d)=>{let p=typeof d=="function"?d(l(o)):d;return p===r3?(u(o,t),n.removeItem(e)):Ky(p)?p.then(g=>(u(o,g),n.setItem(e,g))):(u(o,p),n.setItem(e,p))})},Jn=function(e){let t,n,i;return typeof e=="object"?(t=e.hashFunction,n=e.expiring,i=e.tags):t=e,(o,l,u)=>{if(u.value!=null)u.value=Gy(u.value,t,n,i);else if(u.get!=null)u.get=Gy(u.get,t,n,i);else throw"Only put a Memoize() decorator on a method or get accessor."}};var Zf=new Map;function Gy(e,t,n=0,i){let o=Symbol("__memoized_map__");return function(...l){let u;this.hasOwnProperty(o)||Object.defineProperty(this,o,{configurable:!1,enumerable:!1,writable:!1,value:new Map});let d=this[o];if(Array.isArray(i))for(let p of i)Zf.has(p)?Zf.get(p).push(d):Zf.set(p,[d]);if(t||l.length>0||n>0){let p;p=t===!0?l.map(x=>x.toString()).join("!"):t?t.apply(this,l):l[0];let g=`${p}__timestamp`,w=!1;if(n>0)if(!d.has(g))w=!0;else{let x=d.get(g);w=Date.now()-x>n}d.has(p)&&!w?u=d.get(p):(u=e.apply(this,l),d.set(p,u),n>0&&d.set(g,Date.now()))}else{let p=this;d.has(p)?u=d.get(p):(u=e.apply(this,l),d.set(p,u))}return u}}ol=je(X0()),DE=je(null),Nc=je(null),hS=je(void 0);var p3=class{constructor(){pe(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 m3(){let{hasLocalStorage:e,hasSessionStorage:t}=o6();return e?window.localStorage:t?window.sessionStorage:new p3}il=m3();let la;sE=class{constructor(e,t=il){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)}},xf=class{constructor(e,t,n=il){this.schema=e,this.getDefaultValue=t,this.storage=n}get(e){try{let t=this.storage.getItem(e);if(t==null)return this.getDefaultValue();let n=this.schema.safeParse(JSON.parse(t));return n.success?n.data:(Se.warn("Error parsing zod local storage",n.error),this.getDefaultValue())}catch(t){return Se.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)}},E0=class extends xf{constructor(e,t,n){let i=Me.get(ol);super(t,n),this.filename=i;try{this.unsubscribeFromFilename=Me.sub(ol,()=>{let o=Me.get(ol);this.handleFilenameChange(e,o)})}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 n=this.get(e);this.remove(e),this.filename=t,this.set(e,n)}}dispose(){this.unsubscribeFromFilename&&(this.unsubscribeFromFilename=(this.unsubscribeFromFilename(),null))}},la="marimo:notebook-col-sizes";function h3(){return{widths:[]}}var Go=new E0(la,MC({widths:e5(t5([YM(),ZM("contentWidth")]).default("contentWidth"))}),h3);MS={getColumnWidth:e=>Go.get(la).widths[e]??"contentWidth",saveColumnWidth:(e,t)=>{let n=Go.get(la).widths;if(n[e])n[e]=t;else{for(;n.length<=e;)n.push("contentWidth");n[e]=t}Go.set(la,{widths:n})},clearStorage:()=>{Go.remove(la)}};function g3(e,t){let n=Go.get(la).widths,i=kc(n,e,t);Go.set(la,{widths:i})}var Xy,Jy,Yy,Qr,Zy,ev,tv,nv,Yn,rv,iv,av,ov,sv,lv,ln;function cr(e,t,n,i,o){var l={};return Object.keys(i).forEach(function(u){l[u]=i[u]}),l.enumerable=!!l.enumerable,l.configurable=!!l.configurable,("value"in l||l.initializer)&&(l.writable=!0),l=n.slice().reverse().reduce(function(u,d){return d(e,t,u)||u},l),o&&l.initializer!==void 0&&(l.value=l.initializer?l.initializer.call(o):void 0,l.initializer=void 0),l.initializer===void 0?(Object.defineProperty(e,t,l),null):l}let Za=(Xy=Jn(),Jy=Jn(),Yy=Jn(),Qr=class{constructor(e,t,n){this.value=e,this.isCollapsed=t,this.children=n}geDescendantCount(){let e=0,t=[...this.children];for(;t.length>0;){let n=t.pop();e++;for(let i=n.children.length-1;i>=0;i--)t.push(n.children[i])}return e}getDescendants(){let e=[],t=[...this.children];for(;t.length>0;){let n=t.pop();e.push(n.value);for(let i=n.children.length-1;i>=0;i--)t.push(n.children[i])}return e}get inOrderIds(){let e=[],t=n=>{e.push(n.value);for(let i of n.children)t(i)};for(let n of this.children)t(n);return e}toString(){return this.isCollapsed?`${this.value} (collapsed)`:String(this.value)}equals(e){return this.value===e.value}},cr(Qr.prototype,"geDescendantCount",[Xy],Object.getOwnPropertyDescriptor(Qr.prototype,"geDescendantCount"),Qr.prototype),cr(Qr.prototype,"getDescendants",[Jy],Object.getOwnPropertyDescriptor(Qr.prototype,"getDescendants"),Qr.prototype),cr(Qr.prototype,"inOrderIds",[Yy],Object.getOwnPropertyDescriptor(Qr.prototype,"inOrderIds"),Qr.prototype),Qr);var y3=0;let Xo;Xo=(Zy=Jn(),ev=Jn(),tv=Jn(),nv=Jn(),Yn=class Qo{constructor(t,n){this.nodes=t,this.id=n}static from(t){let n=`tree_${y3++}`;return new Qo(t.map(i=>new Za(i,!1,[])),n)}static fromWithPreviousShape(t,n){var l;if(!n)return Qo.from(t);let i=n.id,o=new Qo(t.map(u=>new Za(u,!1,[])),i);for(let u of t)if(n.isCollapsed(u)){let d=((l=n._nodeMap.get(u))==null?void 0:l.children)??[];for(let p=d.length-1;p>=0;p--){let g=d[p];if(o._nodeMap.has(g.value)){o=o.collapse(u,g.value);break}}}return o}withNodes(t){return new Qo(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 n of this.nodes)t.set(n.value,n);return t}getDescendants(t){let n=this._nodeMap.get(t);return n?n.getDescendants():(Se.warn(`Node ${t} not found in tree. Valid ids: ${this.topLevelIds}`),[])}isCollapsed(t){let n=this._nodeMap.get(t);return n?n.isCollapsed:(Se.warn(`Node ${t} not found in tree. Valid ids: ${this.topLevelIds}`),!1)}indexOfOrThrow(t){let n=this.nodes.findIndex(i=>i.value===t);if(n===-1)throw Error(`Node ${t} not found in tree. Valid ids: ${this.topLevelIds}`);return n}slice(t,n){return this.nodes.slice(t,n).map(i=>i.value)}moveToFront(t){let n=this.indexOfOrThrow(t);return this.withNodes(kc(this.nodes,n,0))}moveToBack(t){let n=this.indexOfOrThrow(t);return this.withNodes(kc(this.nodes,n,this.nodes.length-1))}collapse(t,n){let i=this.nodes.findIndex(p=>p.value===t);if(i===-1)throw Error(`Node ${t} not found in tree. Valid ids: ${this.topLevelIds}`);let o=n===void 0?this.nodes.length:this.nodes.findIndex(p=>p.value===n);if(o===-1)throw Error(`Node ${n} not found in tree`);if(o<i)throw Error(`Node ${n} is before node ${t}`);let l=[...this.nodes],u=l[i];if(u.isCollapsed)throw Error(`Node ${t} is already collapsed`);let d=l.splice(i+1,o-i);return l[i]=new Za(u.value,!0,d),this.withNodes(l)}collapseAll(t){let n=[...this.nodes];if(t.length===0)throw Error("No collapse ranges provided");if(t.length!==n.length)throw Error(`Collapse ranges length ${t.length} does not match tree length ${n.length}`);let i=n.length-1;for(;i>=0;){let o=n[i],l=t[i];if(!o.isCollapsed&&l){let{id:u,until:d}=l;if(u!==o.value)throw Error(`Node ${o.value} does not match collapse range id ${u}`);let p=d===void 0?n.length:n.findIndex(w=>w.value===d);if(p===-1)throw Error(`Node ${d} not found in tree`);if(p<i)throw Error(`Node ${d} is before node ${u}`);let g=n.splice(i+1,p-i);n[i]=new Za(o.value,!0,g),i--}else i--}return this.withNodes(n)}expand(t){let n=this.nodes.findIndex(l=>l.value===t);if(n===-1)throw Error(`Node ${t} not found in tree. Valid ids: ${this.topLevelIds}`);let i=[...this.nodes],o=i[n];return o.isCollapsed?(i[n]=new Za(o.value,!1,[]),i=Lg(i,n+1,o.children),this.withNodes(i)):this}expandAll(){let t=[...this.nodes],n=0;for(;n<t.length;){let i=t[n];i.isCollapsed&&(t[n]=new Za(i.value,!1,[]),t=Lg(t,n+1,i.children)),n++}return this.withNodes(t)}move(t,n){return this.withNodes(kc(this.nodes,t,n))}at(t){var n;return(n=this.nodes.at(t))==null?void 0:n.value}atOrThrow(t){let n=this.nodes.at(t);if(n===void 0)throw Error(`Node at index ${t} not found in tree`);return n.value}first(){return this.atOrThrow(0)}last(){return this.atOrThrow(this.nodes.length-1)}after(t){let n=this.indexOfOrThrow(t);if(n!==this.nodes.length-1)return this.at(n+1)}before(t){let n=this.indexOfOrThrow(t);if(n!==0)return this.at(n-1)}insert(t,n){return this.withNodes(sS(this.nodes,n,new Za(t,!1,[])))}insertAtEnd(t){return this.insert(t,this.nodes.length)}insertAtStart(t){return this.insert(t,0)}deleteAtIndex(t){let n=this.atOrThrow(t),i=this.expand(n);return i.withNodes(a6(i.nodes,t))}delete(t){let n=this.indexOfOrThrow(t);return this.deleteAtIndex(n)}getCount(t){var n;return((n=this._nodeMap.get(t))==null?void 0:n.geDescendantCount())??0}findAndExpandDeep(t){let n=this.find(t);return n.length===0?this:n.reduce((i,o)=>i.expand(o),this)}find(t){function n(i,o){for(let l of i){if(l.value===t)return[...o,t];let u=n(l.children,[...o,l.value]);if(u.length>0)return u}return[]}return n(this.nodes,[])}split(t){let n=this.nodes.findIndex(l=>l.value===t);if(n===-1)throw Error(`Node ${t} not found in tree`);let i=this.nodes.slice(0,n),o=this.nodes.slice(n);return i.length===0?[Qo.from([]),this.withNodes(o)]:[this.withNodes(i),Qo.from([]).withNodes(o)]}equals(t){return this.nodes.length===t.nodes.length&&this.nodes.every((n,i)=>n.value===t.nodes[i].value)}toString(){let t=0,n="",i=o=>{for(let l of o)n+=`${" ".repeat(t*2)}${l.toString()}
|
|
13
|
-
`,t+=1,i(l.children),--t};return i(this.nodes),n}},cr(Yn.prototype,"topLevelIds",[Zy],Object.getOwnPropertyDescriptor(Yn.prototype,"topLevelIds"),Yn.prototype),cr(Yn.prototype,"inOrderIds",[ev],Object.getOwnPropertyDescriptor(Yn.prototype,"inOrderIds"),Yn.prototype),cr(Yn.prototype,"idSet",[tv],Object.getOwnPropertyDescriptor(Yn.prototype,"idSet"),Yn.prototype),cr(Yn.prototype,"_nodeMap",[nv],Object.getOwnPropertyDescriptor(Yn.prototype,"_nodeMap"),Yn.prototype),Yn),al=(rv=Jn(),iv=Jn(),av=Jn(),ov=Jn(),sv=Jn(),lv=Jn(),ln=class Pn{constructor(t){this.columns=t,t.length===0&&(this.columns=[Xo.from([])])}static from(t){return new Pn(t.map(n=>Xo.from(n)))}static fromWithPreviousShape(t,n){if(!n)return Pn.from([t]);let i=n.getColumns(),o=Array.from({length:i.length},()=>[]),l=0;for(let u of t){let d=i.findIndex(p=>p.idSet.has(u));d===-1?o[l].push(u):(l=d,o[d].push(u))}return new Pn(o.map((u,d)=>Xo.fromWithPreviousShape(u,i[d])))}isEmpty(){return this.columns.length===0?!0:this.columns.every(t=>t.nodes.length===0)}static fromIdsAndColumns(t){let n=Math.max(1,...t.map(([,l])=>(l??0)+1)),i=Array.from({length:n},()=>[]),o=0;for(let[l,u]of t)u==null||u<0?i[o].push(l):(i[u].push(l),o=u);return Pn.from(i)}get topLevelIds(){return this.columns.map(t=>t.topLevelIds)}get iterateTopLevelIds(){let t=this.columns;function*n(){for(let i of t)for(let o of i.topLevelIds)yield o}return n()}get inOrderIds(){return this.columns.flatMap(t=>t.inOrderIds)}get colLength(){return this.columns.length}get idLength(){return this.columns.reduce((t,n)=>t+n.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 n=this.columns[t];if(!n)throw Error(`Column ${t} not found`);return n}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,n=[]){return new Pn(this.columns.flatMap(i=>i.id===t?[i,Xo.from(n)]:[i]))}insertBreakpoint(t){let n=this.findWithId(t),[i,o]=n.split(t);return new Pn(this.columns.flatMap(l=>l===n?[i,o].filter(Boolean):[l]))}delete(t){if(this.columns.length<=1)return this;let n=this.indexOfOrThrow(t),i=n===0?1:n-1,o=[...this.columns],l=o[n];return o[i]=l.withNodes([...o[i].nodes,...l.nodes]),o.splice(n,1),new Pn(o)}mergeAllColumns(){if(this.columns.length<=1)return this;let t=this.columns.flatMap(i=>i.nodes),n=this.columns[0];return new Pn([n.withNodes(t)])}moveWithinColumn(t,n,i){return this.transform(t,o=>o.move(n,i))}moveAcrossColumns(t,n,i,o){let l=this.indexOfOrThrow(t),u=this.indexOfOrThrow(i),d=[...this.columns],p=d[l],g=p.nodes.findIndex(S=>S.value===n);if(g===-1)throw Error(`Node ${n} not found in column ${t}`);let w=p.nodes[g];d[l]=p.withNodes(p.nodes.filter((S,E)=>E!==g));let x=d[u];if(o){let S=x.indexOfOrThrow(o);d[u]=x.withNodes(sS(x.nodes,S,w))}else d[u]=x.withNodes([w,...x.nodes]);return new Pn(d)}moveCellsRelativeTo(t,n,i){if(t.length===0)return this;let o=new Set(t),l=this.findWithId(n),u=this.indexOfOrThrow(l.id),d=[];for(let S of t){let E=this.findWithId(S),T=E.nodes.find(O=>O.value===S);if(!T)throw Error(`Node ${S} not found in column ${E.id}`);d.push(T)}let p=this.columns.map(S=>S.withNodes(S.nodes.filter(E=>!o.has(E.value)))),g=p[u],w=g.nodes.findIndex(S=>S.value===n);w===-1?w=g.nodes.length:i==="after"&&(w+=1);let x=Lg(g.nodes,w,d);return p[u]=g.withNodes(x),new Pn(p)}indexOfOrThrow(t){let n=this.columns.findIndex(i=>i.id===t);if(n===-1)throw Error(`Column ${t} not found. Possible values: ${this.getColumnIds().join(", ")}`);return n}moveColumn(t,n){if(t===n)return this;let i=this.indexOfOrThrow(t),o=n==="_left_"?i-1:n==="_right_"?i+1:this.indexOfOrThrow(n);return g3(i,o),new Pn(kc([...this.columns],i,o))}moveToNewColumn(t){let n=this.findWithId(t),i=this.columns.map(l=>l.id===n.id?l.delete(t):l),o=Xo.from([t]);return new Pn([...i,o])}findWithId(t){let n=this.columns.find(i=>i.inOrderIds.includes(t));if(!n)throw Se.log(`Possible values: ${this.columns.map(i=>i.inOrderIds).join(", ")}`),Error(`Cell ${t} not found in any column`);return n}transformWithCellId(t,n){let i=!1,o=this.columns.map(l=>{if(l.inOrderIds.includes(t)){let u=n(l);return l!==u&&(i=!0),u}return l});return i?new Pn(o):this}setupCellExists(){return this.columns.some(t=>t.topLevelIds.includes(Rr))}insertId(t,n,i){return this.transform(n,o=>o.insert(t,i))}deleteById(t){return this.transformWithCellId(t,n=>n.delete(t))}placeCells(t){if(t.length===0)return this;let n=this.deleteById(t[0].id);for(let{id:o}of t.slice(1))n=n.deleteById(o);let i=[...t].toSorted((o,l)=>o.columnId===l.columnId?o.index-l.index:o.columnId.localeCompare(l.columnId));for(let{id:o,columnId:l,index:u}of i)n=n.insertId(o,l,u);return n}compact(){return this.columns.length===1||!this.columns.some(t=>t.nodes.length===0)?this:new Pn(this.columns.filter(t=>t.nodes.length>0))}transform(t,n){let i=this._columnMap.get(t);if(!i)return Se.warn(`Column ${t} not found`),this;let o=n(i);return i===o?this:new Pn(this.columns.map(l=>l.id===t?o:l))}transformAll(t){let n=!1,i=this.columns.map(o=>{let l=t(o);return o.equals(l)||(n=!0),l});return n?new Pn(i):this}},cr(ln.prototype,"isEmpty",[rv],Object.getOwnPropertyDescriptor(ln.prototype,"isEmpty"),ln.prototype),cr(ln.prototype,"topLevelIds",[iv],Object.getOwnPropertyDescriptor(ln.prototype,"topLevelIds"),ln.prototype),cr(ln.prototype,"inOrderIds",[av],Object.getOwnPropertyDescriptor(ln.prototype,"inOrderIds"),ln.prototype),cr(ln.prototype,"idLength",[ov],Object.getOwnPropertyDescriptor(ln.prototype,"idLength"),ln.prototype),cr(ln.prototype,"_columnMap",[sv],Object.getOwnPropertyDescriptor(ln.prototype,"_columnMap"),ln.prototype),cr(ln.prototype,"getColumnIds",[lv],Object.getOwnPropertyDescriptor(ln.prototype,"getColumnIds"),ln.prototype),ln);let ep,tp,np,cv,rp,uv,dv,fv,pv,ip,ap,mv,op,sp;ep=Pe((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(i){i.Root="root",i.Text="text",i.Directive="directive",i.Comment="comment",i.Script="script",i.Style="style",i.Tag="tag",i.CDATA="cdata",i.Doctype="doctype"})(t=e.ElementType||(e.ElementType={}));function n(i){return i.type===t.Tag||i.type===t.Script||i.type===t.Style}e.isTag=n,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})),tp=Pe((e=>{var t=e&&e.__extends||(function(){var $=function(W,ae){return $=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(xe,_e){xe.__proto__=_e}||function(xe,_e){for(var Te in _e)Object.prototype.hasOwnProperty.call(_e,Te)&&(xe[Te]=_e[Te])},$(W,ae)};return function(W,ae){if(typeof ae!="function"&&ae!==null)throw TypeError("Class extends value "+String(ae)+" is not a constructor or null");$(W,ae);function xe(){this.constructor=W}W.prototype=ae===null?Object.create(ae):(xe.prototype=ae.prototype,new xe)}})(),n=e&&e.__assign||function(){return n=Object.assign||function($){for(var W,ae=1,xe=arguments.length;ae<xe;ae++)for(var _e in W=arguments[ae],W)Object.prototype.hasOwnProperty.call(W,_e)&&($[_e]=W[_e]);return $},n.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 i=ep(),o=(function(){function $(){this.parent=null,this.prev=null,this.next=null,this.startIndex=null,this.endIndex=null}return Object.defineProperty($.prototype,"parentNode",{get:function(){return this.parent},set:function(W){this.parent=W},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"previousSibling",{get:function(){return this.prev},set:function(W){this.prev=W},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"nextSibling",{get:function(){return this.next},set:function(W){this.next=W},enumerable:!1,configurable:!0}),$.prototype.cloneNode=function(W){return W===void 0&&(W=!1),U(this,W)},$})();e.Node=o;var l=(function($){t(W,$);function W(ae){var xe=$.call(this)||this;return xe.data=ae,xe}return Object.defineProperty(W.prototype,"nodeValue",{get:function(){return this.data},set:function(ae){this.data=ae},enumerable:!1,configurable:!0}),W})(o);e.DataNode=l;var u=(function($){t(W,$);function W(){var ae=$!==null&&$.apply(this,arguments)||this;return ae.type=i.ElementType.Text,ae}return Object.defineProperty(W.prototype,"nodeType",{get:function(){return 3},enumerable:!1,configurable:!0}),W})(l);e.Text=u;var d=(function($){t(W,$);function W(){var ae=$!==null&&$.apply(this,arguments)||this;return ae.type=i.ElementType.Comment,ae}return Object.defineProperty(W.prototype,"nodeType",{get:function(){return 8},enumerable:!1,configurable:!0}),W})(l);e.Comment=d;var p=(function($){t(W,$);function W(ae,xe){var _e=$.call(this,xe)||this;return _e.name=ae,_e.type=i.ElementType.Directive,_e}return Object.defineProperty(W.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),W})(l);e.ProcessingInstruction=p;var g=(function($){t(W,$);function W(ae){var xe=$.call(this)||this;return xe.children=ae,xe}return Object.defineProperty(W.prototype,"firstChild",{get:function(){return this.children[0]??null},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"lastChild",{get:function(){return this.children.length>0?this.children[this.children.length-1]:null},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"childNodes",{get:function(){return this.children},set:function(ae){this.children=ae},enumerable:!1,configurable:!0}),W})(o);e.NodeWithChildren=g;var w=(function($){t(W,$);function W(){var ae=$!==null&&$.apply(this,arguments)||this;return ae.type=i.ElementType.CDATA,ae}return Object.defineProperty(W.prototype,"nodeType",{get:function(){return 4},enumerable:!1,configurable:!0}),W})(g);e.CDATA=w;var x=(function($){t(W,$);function W(){var ae=$!==null&&$.apply(this,arguments)||this;return ae.type=i.ElementType.Root,ae}return Object.defineProperty(W.prototype,"nodeType",{get:function(){return 9},enumerable:!1,configurable:!0}),W})(g);e.Document=x;var S=(function($){t(W,$);function W(ae,xe,_e,Te){_e===void 0&&(_e=[]),Te===void 0&&(Te=ae==="script"?i.ElementType.Script:ae==="style"?i.ElementType.Style:i.ElementType.Tag);var Z=$.call(this,_e)||this;return Z.name=ae,Z.attribs=xe,Z.type=Te,Z}return Object.defineProperty(W.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"tagName",{get:function(){return this.name},set:function(ae){this.name=ae},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"attributes",{get:function(){var ae=this;return Object.keys(this.attribs).map(function(xe){var _e,Te;return{name:xe,value:ae.attribs[xe],namespace:(_e=ae["x-attribsNamespace"])==null?void 0:_e[xe],prefix:(Te=ae["x-attribsPrefix"])==null?void 0:Te[xe]}})},enumerable:!1,configurable:!0}),W})(g);e.Element=S;function E($){return(0,i.isTag)($)}e.isTag=E;function T($){return $.type===i.ElementType.CDATA}e.isCDATA=T;function O($){return $.type===i.ElementType.Text}e.isText=O;function j($){return $.type===i.ElementType.Comment}e.isComment=j;function z($){return $.type===i.ElementType.Directive}e.isDirective=z;function V($){return $.type===i.ElementType.Root}e.isDocument=V;function P($){return Object.prototype.hasOwnProperty.call($,"children")}e.hasChildren=P;function U($,W){W===void 0&&(W=!1);var ae;if(O($))ae=new u($.data);else if(j($))ae=new d($.data);else if(E($)){var xe=W?me($.children):[],_e=new S($.name,n({},$.attribs),xe);xe.forEach(function(Y){return Y.parent=_e}),$.namespace!=null&&(_e.namespace=$.namespace),$["x-attribsNamespace"]&&(_e["x-attribsNamespace"]=n({},$["x-attribsNamespace"])),$["x-attribsPrefix"]&&(_e["x-attribsPrefix"]=n({},$["x-attribsPrefix"])),ae=_e}else if(T($)){var xe=W?me($.children):[],Te=new w(xe);xe.forEach(function(ce){return ce.parent=Te}),ae=Te}else if(V($)){var xe=W?me($.children):[],Z=new x(xe);xe.forEach(function(ce){return ce.parent=Z}),$["x-mode"]&&(Z["x-mode"]=$["x-mode"]),ae=Z}else if(z($)){var Q=new p($.name,$.data);$["x-name"]!=null&&(Q["x-name"]=$["x-name"],Q["x-publicId"]=$["x-publicId"],Q["x-systemId"]=$["x-systemId"]),ae=Q}else throw Error(`Not implemented yet: ${$.type}`);return ae.startIndex=$.startIndex,ae.endIndex=$.endIndex,$.sourceCodeLocation!=null&&(ae.sourceCodeLocation=$.sourceCodeLocation),ae}e.cloneNode=U;function me($){for(var W=$.map(function(xe){return U(xe,!0)}),ae=1;ae<W.length;ae++)W[ae].prev=W[ae-1],W[ae-1].next=W[ae];return W}})),np=Pe((e=>{var t=e&&e.__createBinding||(Object.create?(function(d,p,g,w){w===void 0&&(w=g);var x=Object.getOwnPropertyDescriptor(p,g);(!x||("get"in x?!p.__esModule:x.writable||x.configurable))&&(x={enumerable:!0,get:function(){return p[g]}}),Object.defineProperty(d,w,x)}):(function(d,p,g,w){w===void 0&&(w=g),d[w]=p[g]})),n=e&&e.__exportStar||function(d,p){for(var g in d)g!=="default"&&!Object.prototype.hasOwnProperty.call(p,g)&&t(p,d,g)};Object.defineProperty(e,"__esModule",{value:!0}),e.DomHandler=void 0;var i=ep(),o=tp();n(tp(),e);var l={withStartIndices:!1,withEndIndices:!1,xmlMode:!1},u=(function(){function d(p,g,w){this.dom=[],this.root=new o.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null,typeof g=="function"&&(w=g,g=l),typeof p=="object"&&(g=p,p=void 0),this.callback=p??null,this.options=g??l,this.elementCB=w??null}return d.prototype.onparserinit=function(p){this.parser=p},d.prototype.onreset=function(){this.dom=[],this.root=new o.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(p){this.handleCallback(p)},d.prototype.onclosetag=function(){this.lastNode=null;var p=this.tagStack.pop();this.options.withEndIndices&&(p.endIndex=this.parser.endIndex),this.elementCB&&this.elementCB(p)},d.prototype.onopentag=function(p,g){var w=this.options.xmlMode?i.ElementType.Tag:void 0,x=new o.Element(p,g,void 0,w);this.addNode(x),this.tagStack.push(x)},d.prototype.ontext=function(p){var g=this.lastNode;if(g&&g.type===i.ElementType.Text)g.data+=p,this.options.withEndIndices&&(g.endIndex=this.parser.endIndex);else{var w=new o.Text(p);this.addNode(w),this.lastNode=w}},d.prototype.oncomment=function(p){if(this.lastNode&&this.lastNode.type===i.ElementType.Comment){this.lastNode.data+=p;return}var g=new o.Comment(p);this.addNode(g),this.lastNode=g},d.prototype.oncommentend=function(){this.lastNode=null},d.prototype.oncdatastart=function(){var p=new o.Text(""),g=new o.CDATA([p]);this.addNode(g),p.parent=g,this.lastNode=p},d.prototype.oncdataend=function(){this.lastNode=null},d.prototype.onprocessinginstruction=function(p,g){var w=new o.ProcessingInstruction(p,g);this.addNode(w)},d.prototype.handleCallback=function(p){if(typeof this.callback=="function")this.callback(p,this.dom);else if(p)throw p},d.prototype.addNode=function(p){var g=this.tagStack[this.tagStack.length-1],w=g.children[g.children.length-1];this.options.withStartIndices&&(p.startIndex=this.parser.startIndex),this.options.withEndIndices&&(p.endIndex=this.parser.endIndex),g.children.push(p),w&&(p.prev=w,w.next=p),p.parent=g,this.lastNode=null},d})();e.DomHandler=u,e.default=u})),cv=Pe((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,n){return t[n.toLowerCase()]=n,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")})),rp=Pe((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatAttributes=o,e.escapeSpecialCharacters=u,e.revertEscapedCharacters=d,e.formatDOM=p;var t=np(),n=cv();function i(g){return n.CASE_SENSITIVE_TAG_NAMES_MAP[g]}function o(g){for(var w={},x=0,S=g.length;x<S;x++){var E=g[x];w[E.name]=E.value}return w}function l(g){return g=g.toLowerCase(),i(g)||g}function u(g){return g.replace(n.CARRIAGE_RETURN_REGEX,n.CARRIAGE_RETURN_PLACEHOLDER)}function d(g){return g.replace(n.CARRIAGE_RETURN_PLACEHOLDER_REGEX,n.CARRIAGE_RETURN)}function p(g,w,x){w===void 0&&(w=null);for(var S=[],E,T=0,O=g.length;T<O;T++){var j=g[T];switch(j.nodeType){case 1:var z=l(j.nodeName);E=new t.Element(z,o(j.attributes)),E.children=p(z==="template"?j.content.childNodes:j.childNodes,E);break;case 3:E=new t.Text(d(j.nodeValue));break;case 8:E=new t.Comment(j.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}})),uv=Pe((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=j;var t=rp(),n="html",i="head",o="body",l=/<([a-zA-Z]+[0-9]?)/,u=/<head[^]*>/i,d=/<body[^]*>/i,p=function(z,V){throw Error("This browser does not support `document.implementation.createHTMLDocument`")},g=function(z,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";g=function(z,V){return V&&(z=`<${V}>${z}</${V}>`),x.parseFromString(z,S)},p=g}if(typeof document=="object"&&document.implementation){var E=document.implementation.createHTMLDocument();p=function(z,V){if(V){var P=E.documentElement.querySelector(V);return P&&(P.innerHTML=z),E}return E.documentElement.innerHTML=z,E}}var T=typeof document=="object"&&document.createElement("template"),O;T&&T.content&&(O=function(z){return T.innerHTML=z,T.content.childNodes});function j(z){var V,P;z=(0,t.escapeSpecialCharacters)(z);var U=z.match(l),me=U&&U[1]?U[1].toLowerCase():"";switch(me){case n:var $=g(z);if(!u.test(z)){var ae=$.querySelector(i);(V=ae==null?void 0:ae.parentNode)==null||V.removeChild(ae)}if(!d.test(z)){var ae=$.querySelector(o);(P=ae==null?void 0:ae.parentNode)==null||P.removeChild(ae)}return $.querySelectorAll(n);case i:case o:var W=p(z).querySelectorAll(me);return d.test(z)&&u.test(z)?W[0].parentNode.childNodes:W;default:if(O)return O(z);var ae=p(z,o).querySelector(o);return ae.childNodes}}})),dv=Pe((e=>{var t=e&&e.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=l;var n=t(uv()),i=rp(),o=/<(![a-zA-Z\s]+)>/;function l(u){if(typeof u!="string")throw TypeError("First argument must be a string");if(!u)return[];var d=u.match(o),p=d?d[1]:void 0;return(0,i.formatDOM)((0,n.default)(u),null,p)}})),fv=Pe((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}})),pv=Pe((e=>{var t=0,n=1,i=2,o=3,l=4,u=5,d=6;function p(P){return w.hasOwnProperty(P)?w[P]:null}function g(P,U,me,$,W,ae,xe){this.acceptsBooleans=U===i||U===o||U===l,this.attributeName=$,this.attributeNamespace=W,this.mustUseProperty=me,this.propertyName=P,this.type=U,this.sanitizeURL=ae,this.removeEmptyString=xe}var w={};["children","dangerouslySetInnerHTML","defaultValue","defaultChecked","innerHTML","suppressContentEditableWarning","suppressHydrationWarning","style"].forEach(P=>{w[P]=new g(P,t,!1,P,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(([P,U])=>{w[P]=new g(P,n,!1,U,null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(P=>{w[P]=new g(P,i,!1,P.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(P=>{w[P]=new g(P,i,!1,P,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(P=>{w[P]=new g(P,o,!1,P.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(P=>{w[P]=new g(P,o,!0,P,null,!1,!1)}),["capture","download"].forEach(P=>{w[P]=new g(P,l,!1,P,null,!1,!1)}),["cols","rows","size","span"].forEach(P=>{w[P]=new g(P,d,!1,P,null,!1,!1)}),["rowSpan","start"].forEach(P=>{w[P]=new g(P,u,!1,P.toLowerCase(),null,!1,!1)});var x=/[\-\:]([a-z])/g,S=P=>P[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(P=>{let U=P.replace(x,S);w[U]=new g(U,n,!1,P,null,!1,!1)}),["xlink:actuate","xlink:arcrole","xlink:role","xlink:show","xlink:title","xlink:type"].forEach(P=>{let U=P.replace(x,S);w[U]=new g(U,n,!1,P,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(P=>{let U=P.replace(x,S);w[U]=new g(U,n,!1,P,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(P=>{w[P]=new g(P,n,!1,P.toLowerCase(),null,!1,!1)});var E="xlinkHref";w[E]=new g("xlinkHref",n,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(P=>{w[P]=new g(P,n,!1,P.toLowerCase(),null,!0,!0)});var{CAMELCASE:T,SAME:O,possibleStandardNames:j}=fv(),z=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(j).reduce((P,U)=>{let me=j[U];return me===O?P[U]=U:me===T?P[U.toLowerCase()]=U:P[U]=me,P},{});e.BOOLEAN=o,e.BOOLEANISH_STRING=i,e.NUMERIC=u,e.OVERLOADED_BOOLEAN=l,e.POSITIVE_NUMERIC=d,e.RESERVED=t,e.STRING=n,e.getPropertyInfo=p,e.isCustomAttribute=z,e.possibleStandardNames=V})),ip=Pe((e=>{var t=e&&e.__importDefault||function(p){return p&&p.__esModule?p:{default:p}};Object.defineProperty(e,"__esModule",{value:!0}),e.returnFirstArg=e.canTextBeChildOfNode=e.ELEMENTS_WITH_NO_TEXT_CHILDREN=e.PRESERVE_CUSTOM_ATTRIBUTES=void 0,e.isCustomComponent=l,e.setStyleProp=d;var n=Kd(),i=t(s6()),o=new Set(["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"]);function l(p,g){return p.includes("-")?!o.has(p):!!(g&&typeof g.is=="string")}var u={reactCompat:!0};function d(p,g){if(typeof p=="string"){if(!p.trim()){g.style={};return}try{g.style=(0,i.default)(p,u)}catch{g.style={}}}}e.PRESERVE_CUSTOM_ATTRIBUTES=Number(n.version.split(".")[0])>=16,e.ELEMENTS_WITH_NO_TEXT_CHILDREN=new Set(["tr","tbody","thead","tfoot","colgroup","table","head","html","frameset"]),e.canTextBeChildOfNode=function(p){return!e.ELEMENTS_WITH_NO_TEXT_CHILDREN.has(p.name)},e.returnFirstArg=function(p){return p}})),ap=Pe((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=u;var t=pv(),n=ip(),i=["checked","value"],o=["input","select","textarea"],l={reset:!0,submit:!0};function u(p,g){p===void 0&&(p={});var w={},x=!!(p.type&&l[p.type]);for(var S in p){var E=p[S];if((0,t.isCustomAttribute)(S)){w[S]=E;continue}var T=S.toLowerCase(),O=d(T);if(O){var j=(0,t.getPropertyInfo)(O);switch(i.includes(O)&&o.includes(g)&&!x&&(O=d("default"+T)),w[O]=E,j&&j.type){case t.BOOLEAN:w[O]=!0;break;case t.OVERLOADED_BOOLEAN:E===""&&(w[O]=!0);break}continue}n.PRESERVE_CUSTOM_ATTRIBUTES&&(w[S]=E)}return(0,n.setStyleProp)(p.style,w),w}function d(p){return t.possibleStandardNames[p]}})),mv=Pe((e=>{var t=e&&e.__importDefault||function(p){return p&&p.__esModule?p:{default:p}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=u;var n=Kd(),i=t(ap()),o=ip(),l={cloneElement:n.cloneElement,createElement:n.createElement,isValidElement:n.isValidElement};function u(p,g){g===void 0&&(g={});for(var w=[],x=typeof g.replace=="function",S=g.transform||o.returnFirstArg,E=g.library||l,T=E.cloneElement,O=E.createElement,j=E.isValidElement,z=p.length,V=0;V<z;V++){var P=p[V];if(x){var U=g.replace(P,V);if(j(U)){z>1&&(U=T(U,{key:U.key||V})),w.push(S(U,P,V));continue}}if(P.type==="text"){var me=!P.data.trim().length;if(me&&P.parent&&!(0,o.canTextBeChildOfNode)(P.parent)||g.trim&&me)continue;w.push(S(P.data,P,V));continue}var $=P,W={};d($)?((0,o.setStyleProp)($.attribs.style,$.attribs),W=$.attribs):$.attribs&&(W=(0,i.default)($.attribs,$.name));var ae=void 0;switch(P.type){case"script":case"style":P.children[0]&&(W.dangerouslySetInnerHTML={__html:P.children[0].data});break;case"tag":P.name==="textarea"&&P.children[0]?W.defaultValue=P.children[0].data:P.children&&P.children.length&&(ae=u(P.children,g));break;default:continue}z>1&&(W.key=V),w.push(S(O(P.name,W,ae),P,V))}return w.length===1?w[0]:w}function d(p){return o.PRESERVE_CUSTOM_ATTRIBUTES&&p.type==="tag"&&(0,o.isCustomComponent)(p.name,p.attribs)}})),op=Pe((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=u;var n=t(dv());e.htmlToDOM=n.default,e.attributesToProps=t(ap()).default;var i=t(mv());e.domToReact=i.default;var o=np();Object.defineProperty(e,"Comment",{enumerable:!0,get:function(){return o.Comment}}),Object.defineProperty(e,"Element",{enumerable:!0,get:function(){return o.Element}}),Object.defineProperty(e,"ProcessingInstruction",{enumerable:!0,get:function(){return o.ProcessingInstruction}}),Object.defineProperty(e,"Text",{enumerable:!0,get:function(){return o.Text}});var l={lowerCaseAttributeNames:!1};function u(d,p){if(typeof d!="string")throw TypeError("First argument must be a string");return d?(0,i.default)((0,n.default)(d,(p==null?void 0:p.htmlparser2)||l),p):[]}})),sp=Ud(op(),1),Ka=op(),Kg=sp.default.default||sp.default;let Wc;Wc=(e,t)=>{let[n,...i]=t.split("."),o=(e.attribs.class||"").split(" ");return e.tagName===n&&i.every(l=>o.includes(l))},LS=e=>{var t;return e&&Wc(e,"span.nb")&&e.firstChild instanceof Ka.Text&&((t=e.firstChild.nodeValue)==null?void 0:t.includes("__marimo__"))},_0=function(e){var t,n,i;if(e instanceof Ka.Element&&e.firstChild instanceof Ka.Text&&Wc(e,"span.nb")){let o=e.next;if(o&&o instanceof Ka.Text){let l=o.next;if(l&&l instanceof Ka.Element&&l.firstChild instanceof Ka.Text&&Wc(l,"span.m")){let u=Number.parseInt(l.firstChild.nodeValue||"0",10);if((t=e.firstChild.nodeValue)!=null&&t.includes("__marimo__")){let d=(n=/__marimo__cell_(\w+)_/.exec(e.firstChild.nodeValue))==null?void 0:n[1];if(d&&u)return{kind:"cell",cellId:d,lineNumber:u}}else{let d=(i=/"(.+?)"/.exec(e.firstChild.nodeValue))==null?void 0:i[1];if(d&&u)return{kind:"file",filePath:d,lineNumber:u}}}}}return null},g0=function(e){let t=[];return Kg(e,{replace:n=>{let i=_0(n);if(i)return t.push(i),"dummy"}}),t};function hv(e){return t=>{let n=!1;for(let i of t)i&&(n=e(i)||n);return n}}const v3=hv(L5),b3=hv(P5);let Jo,lp,cp,gv,ca,Yo,Uc,yv,up,vv,bv,wv,xv,Kc,_v,eo,dp,Qc,kv,fp,Cv,Gc,Gr,tn,Xc,Sv,pp,Ev,Tv,Dv,Rv,mp,Iv,Av,Lv,Jc,Zo,Ti,es,On,ua,Yc,cl,ul,dl,hp,fl,gp,Pv,Ov,Mv,Zc,Nv,yp,pl,jv,qv,zv,Fv,$v,Vv,Hv,Bv,eu,Wv,Uv,Kv,Qv,Gv,Xv,Jv,Yv,Zv,e1,t1,tu,n1,r1,i1,a1,o1,s1,l1,c1,u1,d1,f1,p1,m1,vp,bp,h1,g1,y1,v1,b1,w1,x1,_1,k1,C1,S1,ne,nu,Ut,ru,E1,T1,D1,R1,I1,A1,L1,P1,O1,M1,N1,j1,q1,z1,F1,$1,V1,H1,B1,W1,U1,K1,Q1,G1;Jo=Pe((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.stringArray=e.array=e.func=e.error=e.number=e.string=e.boolean=void 0;function t(p){return p===!0||p===!1}e.boolean=t;function n(p){return typeof p=="string"||p instanceof String}e.string=n;function i(p){return typeof p=="number"||p instanceof Number}e.number=i;function o(p){return p instanceof Error}e.error=o;function l(p){return typeof p=="function"}e.func=l;function u(p){return Array.isArray(p)}e.array=u;function d(p){return u(p)&&p.every(g=>n(g))}e.stringArray=d})),lp=Pe((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Message=e.NotificationType9=e.NotificationType8=e.NotificationType7=e.NotificationType6=e.NotificationType5=e.NotificationType4=e.NotificationType3=e.NotificationType2=e.NotificationType1=e.NotificationType0=e.NotificationType=e.RequestType9=e.RequestType8=e.RequestType7=e.RequestType6=e.RequestType5=e.RequestType4=e.RequestType3=e.RequestType2=e.RequestType1=e.RequestType=e.RequestType0=e.AbstractMessageSignature=e.ParameterStructures=e.ResponseError=e.ErrorCodes=void 0;var t=Jo(),n;(function(u){u.ParseError=-32700,u.InvalidRequest=-32600,u.MethodNotFound=-32601,u.InvalidParams=-32602,u.InternalError=-32603,u.jsonrpcReservedErrorRangeStart=-32099,u.serverErrorStart=-32099,u.MessageWriteError=-32099,u.MessageReadError=-32098,u.PendingResponseRejected=-32097,u.ConnectionInactive=-32096,u.ServerNotInitialized=-32002,u.UnknownErrorCode=-32001,u.jsonrpcReservedErrorRangeEnd=-32e3,u.serverErrorEnd=-32e3})(n||(e.ErrorCodes=n={})),e.ResponseError=class ET extends Error{constructor(d,p,g){super(p),this.code=t.number(d)?d:n.UnknownErrorCode,this.data=g,Object.setPrototypeOf(this,ET.prototype)}toJson(){let d={code:this.code,message:this.message};return this.data!==void 0&&(d.data=this.data),d}};var i=class zf{constructor(d){this.kind=d}static is(d){return d===zf.auto||d===zf.byName||d===zf.byPosition}toString(){return this.kind}};e.ParameterStructures=i,i.auto=new i("auto"),i.byPosition=new i("byPosition"),i.byName=new i("byName");var o=class{constructor(u,d){this.method=u,this.numberOfParams=d}get parameterStructures(){return i.auto}};e.AbstractMessageSignature=o,e.RequestType0=class extends o{constructor(u){super(u,0)}},e.RequestType=class extends o{constructor(u,d=i.auto){super(u,1),this._parameterStructures=d}get parameterStructures(){return this._parameterStructures}},e.RequestType1=class extends o{constructor(u,d=i.auto){super(u,1),this._parameterStructures=d}get parameterStructures(){return this._parameterStructures}},e.RequestType2=class extends o{constructor(u){super(u,2)}},e.RequestType3=class extends o{constructor(u){super(u,3)}},e.RequestType4=class extends o{constructor(u){super(u,4)}},e.RequestType5=class extends o{constructor(u){super(u,5)}},e.RequestType6=class extends o{constructor(u){super(u,6)}},e.RequestType7=class extends o{constructor(u){super(u,7)}},e.RequestType8=class extends o{constructor(u){super(u,8)}},e.RequestType9=class extends o{constructor(u){super(u,9)}},e.NotificationType=class extends o{constructor(u,d=i.auto){super(u,1),this._parameterStructures=d}get parameterStructures(){return this._parameterStructures}},e.NotificationType0=class extends o{constructor(u){super(u,0)}},e.NotificationType1=class extends o{constructor(u,d=i.auto){super(u,1),this._parameterStructures=d}get parameterStructures(){return this._parameterStructures}},e.NotificationType2=class extends o{constructor(u){super(u,2)}},e.NotificationType3=class extends o{constructor(u){super(u,3)}},e.NotificationType4=class extends o{constructor(u){super(u,4)}},e.NotificationType5=class extends o{constructor(u){super(u,5)}},e.NotificationType6=class extends o{constructor(u){super(u,6)}},e.NotificationType7=class extends o{constructor(u){super(u,7)}},e.NotificationType8=class extends o{constructor(u){super(u,8)}},e.NotificationType9=class extends o{constructor(u){super(u,9)}};var l;(function(u){function d(w){let x=w;return x&&t.string(x.method)&&(t.string(x.id)||t.number(x.id))}u.isRequest=d;function p(w){let x=w;return x&&t.string(x.method)&&w.id===void 0}u.isNotification=p;function g(w){let x=w;return x&&(x.result!==void 0||!!x.error)&&(t.string(x.id)||t.number(x.id)||x.id===null)}u.isResponse=g})(l||(e.Message=l={}))})),cp=Pe((e=>{var t;Object.defineProperty(e,"__esModule",{value:!0}),e.LRUCache=e.LinkedMap=e.Touch=void 0;var n;(function(o){o.None=0,o.First=1,o.AsOld=o.First,o.Last=2,o.AsNew=o.Last})(n||(e.Touch=n={}));var i=class{constructor(){this[t]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){var o;return(o=this._head)==null?void 0:o.value}get last(){var o;return(o=this._tail)==null?void 0:o.value}has(o){return this._map.has(o)}get(o,l=n.None){let u=this._map.get(o);if(u)return l!==n.None&&this.touch(u,l),u.value}set(o,l,u=n.None){let d=this._map.get(o);if(d)d.value=l,u!==n.None&&this.touch(d,u);else{switch(d={key:o,value:l,next:void 0,previous:void 0},u){case n.None:this.addItemLast(d);break;case n.First:this.addItemFirst(d);break;case n.Last:this.addItemLast(d);break;default:this.addItemLast(d);break}this._map.set(o,d),this._size++}return this}delete(o){return!!this.remove(o)}remove(o){let l=this._map.get(o);if(l)return this._map.delete(o),this.removeItem(l),this._size--,l.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw Error("Invalid list");let o=this._head;return this._map.delete(o.key),this.removeItem(o),this._size--,o.value}forEach(o,l){let u=this._state,d=this._head;for(;d;){if(l?o.bind(l)(d.value,d.key,this):o(d.value,d.key,this),this._state!==u)throw Error("LinkedMap got modified during iteration.");d=d.next}}keys(){let o=this._state,l=this._head,u={[Symbol.iterator]:()=>u,next:()=>{if(this._state!==o)throw Error("LinkedMap got modified during iteration.");if(l){let d={value:l.key,done:!1};return l=l.next,d}else return{value:void 0,done:!0}}};return u}values(){let o=this._state,l=this._head,u={[Symbol.iterator]:()=>u,next:()=>{if(this._state!==o)throw Error("LinkedMap got modified during iteration.");if(l){let d={value:l.value,done:!1};return l=l.next,d}else return{value:void 0,done:!0}}};return u}entries(){let o=this._state,l=this._head,u={[Symbol.iterator]:()=>u,next:()=>{if(this._state!==o)throw Error("LinkedMap got modified during iteration.");if(l){let d={value:[l.key,l.value],done:!1};return l=l.next,d}else return{value:void 0,done:!0}}};return u}[(t=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(o){if(o>=this.size)return;if(o===0){this.clear();return}let l=this._head,u=this.size;for(;l&&u>o;)this._map.delete(l.key),l=l.next,u--;this._head=l,this._size=u,l&&(l.previous=void 0),this._state++}addItemFirst(o){if(!this._head&&!this._tail)this._tail=o;else if(this._head)o.next=this._head,this._head.previous=o;else throw Error("Invalid list");this._head=o,this._state++}addItemLast(o){if(!this._head&&!this._tail)this._head=o;else if(this._tail)o.previous=this._tail,this._tail.next=o;else throw Error("Invalid list");this._tail=o,this._state++}removeItem(o){if(o===this._head&&o===this._tail)this._head=void 0,this._tail=void 0;else if(o===this._head){if(!o.next)throw Error("Invalid list");o.next.previous=void 0,this._head=o.next}else if(o===this._tail){if(!o.previous)throw Error("Invalid list");o.previous.next=void 0,this._tail=o.previous}else{let l=o.next,u=o.previous;if(!l||!u)throw Error("Invalid list");l.previous=u,u.next=l}o.next=void 0,o.previous=void 0,this._state++}touch(o,l){if(!this._head||!this._tail)throw Error("Invalid list");if(!(l!==n.First&&l!==n.Last)){if(l===n.First){if(o===this._head)return;let u=o.next,d=o.previous;o===this._tail?(d.next=void 0,this._tail=d):(u.previous=d,d.next=u),o.previous=void 0,o.next=this._head,this._head.previous=o,this._head=o,this._state++}else if(l===n.Last){if(o===this._tail)return;let u=o.next,d=o.previous;o===this._head?(u.previous=void 0,this._head=u):(u.previous=d,d.next=u),o.next=void 0,o.previous=this._tail,this._tail.next=o,this._tail=o,this._state++}}}toJSON(){let o=[];return this.forEach((l,u)=>{o.push([u,l])}),o}fromJSON(o){this.clear();for(let[l,u]of o)this.set(l,u)}};e.LinkedMap=i,e.LRUCache=class extends i{constructor(o,l=1){super(),this._limit=o,this._ratio=Math.min(Math.max(0,l),1)}get limit(){return this._limit}set limit(o){this._limit=o,this.checkTrim()}get ratio(){return this._ratio}set ratio(o){this._ratio=Math.min(Math.max(0,o),1),this.checkTrim()}get(o,l=n.AsNew){return super.get(o,l)}peek(o){return super.get(o,n.None)}set(o,l){return super.set(o,l,n.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}}})),gv=Pe((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Disposable=void 0;var t;(function(n){function i(o){return{dispose:o}}n.create=i})(t||(e.Disposable=t={}))})),ca=Pe((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t;function n(){if(t===void 0)throw Error("No runtime abstraction layer installed");return t}(function(i){function o(l){if(l===void 0)throw Error("No runtime abstraction layer provided");t=l}i.install=o})(n||(n={})),e.default=n})),Yo=Pe((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Emitter=e.Event=void 0;var t=ca(),n;(function(l){let u={dispose(){}};l.None=function(){return u}})(n||(e.Event=n={}));var i=class{add(l,u=null,d){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(l),this._contexts.push(u),Array.isArray(d)&&d.push({dispose:()=>this.remove(l,u)})}remove(l,u=null){if(!this._callbacks)return;let d=!1;for(let p=0,g=this._callbacks.length;p<g;p++)if(this._callbacks[p]===l)if(this._contexts[p]===u){this._callbacks.splice(p,1),this._contexts.splice(p,1);return}else d=!0;if(d)throw Error("When adding a listener with a context, you should remove it with the same context")}invoke(...l){if(!this._callbacks)return[];let u=[],d=this._callbacks.slice(0),p=this._contexts.slice(0);for(let g=0,w=d.length;g<w;g++)try{u.push(d[g].apply(p[g],l))}catch(x){(0,t.default)().console.error(x)}return u}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},o=class TT{constructor(u){this._options=u}get event(){return this._event||(this._event=(u,d,p)=>{this._callbacks||(this._callbacks=new i),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(u,d);let g={dispose:()=>{this._callbacks&&(this._callbacks.remove(u,d),g.dispose=TT._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(p)&&p.push(g),g}),this._event}fire(u){this._callbacks&&this._callbacks.invoke.call(this._callbacks,u)}dispose(){this._callbacks&&(this._callbacks=(this._callbacks.dispose(),void 0))}};e.Emitter=o,o._noop=function(){}})),Uc=Pe((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CancellationTokenSource=e.CancellationToken=void 0;var t=ca(),n=Jo(),i=Yo(),o;(function(d){d.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:i.Event.None}),d.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:i.Event.None});function p(g){let w=g;return w&&(w===d.None||w===d.Cancelled||n.boolean(w.isCancellationRequested)&&!!w.onCancellationRequested)}d.is=p})(o||(e.CancellationToken=o={}));var l=Object.freeze(function(d,p){let g=(0,t.default)().timer.setTimeout(d.bind(p),0);return{dispose(){g.dispose()}}}),u=class{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?l:(this._emitter||(this._emitter=new i.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter=(this._emitter.dispose(),void 0))}};e.CancellationTokenSource=class{get token(){return this._token||(this._token=new u),this._token}cancel(){this._token?this._token.cancel():this._token=o.Cancelled}dispose(){this._token?this._token instanceof u&&this._token.dispose():this._token=o.None}}})),yv=Pe((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SharedArrayReceiverStrategy=e.SharedArraySenderStrategy=void 0;var t=Uc(),n;(function(l){l.Continue=0,l.Cancelled=1})(n||(n={})),e.SharedArraySenderStrategy=class{constructor(){this.buffers=new Map}enableCancellation(l){if(l.id===null)return;let u=new SharedArrayBuffer(4),d=new Int32Array(u,0,1);d[0]=n.Continue,this.buffers.set(l.id,u),l.$cancellationData=u}async sendCancellation(l,u){let d=this.buffers.get(u);if(d===void 0)return;let p=new Int32Array(d,0,1);Atomics.store(p,0,n.Cancelled)}cleanup(l){this.buffers.delete(l)}dispose(){this.buffers.clear()}};var i=class{constructor(l){this.data=new Int32Array(l,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===n.Cancelled}get onCancellationRequested(){throw Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},o=class{constructor(l){this.token=new i(l)}cancel(){}dispose(){}};e.SharedArrayReceiverStrategy=class{constructor(){this.kind="request"}createCancellationTokenSource(l){let u=l.$cancellationData;return u===void 0?new t.CancellationTokenSource:new o(u)}}})),up=Pe((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Semaphore=void 0;var t=ca();e.Semaphore=class{constructor(n=1){if(n<=0)throw Error("Capacity must be greater than 0");this._capacity=n,this._active=0,this._waiting=[]}lock(n){return new Promise((i,o)=>{this._waiting.push({thunk:n,resolve:i,reject:o}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,t.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;let n=this._waiting.shift();if(this._active++,this._active>this._capacity)throw Error("To many thunks active");try{let i=n.thunk();i instanceof Promise?i.then(o=>{this._active--,n.resolve(o),this.runNext()},o=>{this._active--,n.reject(o),this.runNext()}):(this._active--,n.resolve(i),this.runNext())}catch(i){this._active--,n.reject(i),this.runNext()}}}})),vv=Pe((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ReadableStreamMessageReader=e.AbstractMessageReader=e.MessageReader=void 0;var t=ca(),n=Jo(),i=Yo(),o=up(),l;(function(p){function g(w){let x=w;return x&&n.func(x.listen)&&n.func(x.dispose)&&n.func(x.onError)&&n.func(x.onClose)&&n.func(x.onPartialMessage)}p.is=g})(l||(e.MessageReader=l={}));var u=class{constructor(){this.errorEmitter=new i.Emitter,this.closeEmitter=new i.Emitter,this.partialMessageEmitter=new i.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(p){this.errorEmitter.fire(this.asError(p))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(p){this.partialMessageEmitter.fire(p)}asError(p){return p instanceof Error?p:Error(`Reader received error. Reason: ${n.string(p.message)?p.message:"unknown"}`)}};e.AbstractMessageReader=u;var d;(function(p){function g(w){let x,S,E=new Map,T,O=new Map;if(w===void 0||typeof w=="string")x=w??"utf-8";else{if(x=w.charset??"utf-8",w.contentDecoder!==void 0&&(S=w.contentDecoder,E.set(S.name,S)),w.contentDecoders!==void 0)for(let j of w.contentDecoders)E.set(j.name,j);if(w.contentTypeDecoder!==void 0&&(T=w.contentTypeDecoder,O.set(T.name,T)),w.contentTypeDecoders!==void 0)for(let j of w.contentTypeDecoders)O.set(j.name,j)}return T===void 0&&(T=(0,t.default)().applicationJson.decoder,O.set(T.name,T)),{charset:x,contentDecoder:S,contentDecoders:E,contentTypeDecoder:T,contentTypeDecoders:O}}p.fromOptions=g})(d||(d={})),e.ReadableStreamMessageReader=class extends u{constructor(p,g){super(),this.readable=p,this.options=d.fromOptions(g),this.buffer=(0,t.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new o.Semaphore(1)}set partialMessageTimeout(p){this._partialMessageTimeout=p}get partialMessageTimeout(){return this._partialMessageTimeout}listen(p){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=p;let g=this.readable.onData(w=>{this.onData(w)});return this.readable.onError(w=>this.fireError(w)),this.readable.onClose(()=>this.fireClose()),g}onData(p){try{for(this.buffer.append(p);;){if(this.nextMessageLength===-1){let w=this.buffer.tryReadHeaders(!0);if(!w)return;let x=w.get("content-length");if(!x){this.fireError(Error(`Header must provide a Content-Length property.
|
|
14
|
-
${JSON.stringify(Object.fromEntries(w))}`));return}let S=parseInt(x);if(isNaN(S)){this.fireError(Error(`Content-Length value must be a number. Got ${x}`));return}this.nextMessageLength=S}let g=this.buffer.tryReadBody(this.nextMessageLength);if(g===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{let w=this.options.contentDecoder===void 0?g:await this.options.contentDecoder.decode(g),x=await this.options.contentTypeDecoder.decode(w,this.options);this.callback(x)}).catch(w=>{this.fireError(w)})}}catch(g){this.fireError(g)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer=(this.partialMessageTimer.dispose(),void 0))}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,t.default)().timer.setTimeout((p,g)=>{this.partialMessageTimer=void 0,p===this.messageToken&&(this.firePartialMessage({messageToken:p,waitingTime:g}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}}})),bv=Pe((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.WriteableStreamMessageWriter=e.AbstractMessageWriter=e.MessageWriter=void 0;var t=
|
|
12
|
+
`," ").replaceAll("\r","")}function $f(e){return typeof e=="object"&&e&&"$bigint"in e&&typeof e.$bigint=="string"?BigInt(e.$bigint):e}oy="object-id",_T="random-id";var hy="abcdefghijklmnopqrstuvwxyz",gy=hy+hy.toUpperCase(),yy=new Set;Uo="__scratch__",Rr="setup",Xa={create(){let e=0,t;do{let n="";for(let i=0;i<4;i++)n+=gy[Math.floor(Math.random()*gy.length)];t=n,e++}while(yy.has(t)&&e<100);if(e>=100)throw Error("Failed to generate unique CellId after 100 attempts");return yy.add(t),t}},lr={create(e){return Vn(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 n=lr.findElement(t);if(n)return n;let i=t.getRootNode();if(t=i instanceof ShadowRoot?i.host:t.parentElement,t===i)break}return null}},dE=function(e){let t=null,n=lr.findElementThroughShadowDOMs(e);return n&&(t=lr.parse(n.id)),t},Df={parse(e){return e.getAttribute(oy)},parseOrThrow(e){let t=Df.parse(e);return Vn(t,"<marimo-ui-element/> missing object-id attribute"),t}},IE={create(e){return`output-${e}`}},ay=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 n=new URL(window.location.href);n.searchParams.set(e,t),window.history.replaceState({},"",n.toString())}getSearchParam(e){return new URL(window.location.href).searchParams.get(e)}},jf=function(e){return R0(e??"")},kE=function(e){return ki.mapValues(e.dataset,t=>typeof t=="string"?jf(t):t)},VE=function(e,t){let n=e.parentElement?Df.parse(e.parentElement):void 0;return n&&t.has(n)?t.lookupValue(n):jf(e.dataset.initialValue)},X0=function(){if(a5())return document.title||null;if(Xd()){let n=ay.getFilename();if(n)return n}let e=document.querySelector("marimo-filename");l5(e,"marimo-filename tag not found");let t=e.innerHTML;return t.length===0?null:t};var Re=Kd(Qd(),1),M=Kd(f5(),1),Hc="Checkbox",[OT,z6]=zC(Hc),[MT,Vf]=OT(Hc);function NT(e){let{__scopeCheckbox:t,checked:n,children:i,defaultChecked:o,disabled:l,form:u,name:d,onCheckedChange:p,required:g,value:w="on",internal_do_not_use_render:x}=e,[S,E]=$C({prop:n,defaultProp:o??!1,onChange:p,caller:Hc}),[T,O]=Re.useState(null),[j,z]=Re.useState(null),V=Re.useRef(!1),P=T?!!u||!!T.closest("form"):!0,U={checked:S,disabled:l,setChecked:E,control:T,setControl:O,name:d,form:u,value:w,hasConsumerStoppedPropagationRef:V,required:g,defaultChecked:la(o)?!1:o,isFormControl:P,bubbleInput:j,setBubbleInput:z};return(0,M.jsx)(MT,{scope:t,...U,children:jT(x)?x(U):i})}var vy="CheckboxTrigger",by=Re.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...i},o)=>{let{control:l,value:u,disabled:d,checked:p,required:g,setControl:w,setChecked:x,hasConsumerStoppedPropagationRef:S,isFormControl:E,bubbleInput:T}=Vf(vy,e),O=Gd(o,w),j=Re.useRef(p);return Re.useEffect(()=>{let z=l==null?void 0:l.form;if(z){let V=()=>x(j.current);return z.addEventListener("reset",V),()=>z.removeEventListener("reset",V)}},[l,x]),(0,M.jsx)(ta.button,{type:"button",role:"checkbox","aria-checked":la(p)?"mixed":p,"aria-required":g,"data-state":Cy(p),"data-disabled":d?"":void 0,disabled:d,value:u,...i,ref:O,onKeyDown:Wr(t,z=>{z.key==="Enter"&&z.preventDefault()}),onClick:Wr(n,z=>{x(V=>la(V)?!0:!V),T&&E&&(S.current=z.isPropagationStopped(),S.current||z.stopPropagation())})})});by.displayName=vy;var Hf=Re.forwardRef((e,t)=>{let{__scopeCheckbox:n,name:i,checked:o,defaultChecked:l,required:u,disabled:d,value:p,onCheckedChange:g,form:w,...x}=e;return(0,M.jsx)(NT,{__scopeCheckbox:n,checked:o,defaultChecked:l,disabled:d,required:u,onCheckedChange:g,name:i,form:w,value:p,internal_do_not_use_render:({isFormControl:S})=>(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(by,{...x,ref:t,__scopeCheckbox:n}),S&&(0,M.jsx)(ky,{__scopeCheckbox:n})]})})});Hf.displayName=Hc;var wy="CheckboxIndicator",xy=Re.forwardRef((e,t)=>{let{__scopeCheckbox:n,forceMount:i,...o}=e,l=Vf(wy,n);return(0,M.jsx)(FC,{present:i||la(l.checked)||l.checked===!0,children:(0,M.jsx)(ta.span,{"data-state":Cy(l.checked),"data-disabled":l.disabled?"":void 0,...o,ref:t,style:{pointerEvents:"none",...e.style}})})});xy.displayName=wy;var _y="CheckboxBubbleInput",ky=Re.forwardRef(({__scopeCheckbox:e,...t},n)=>{let{control:i,hasConsumerStoppedPropagationRef:o,checked:l,defaultChecked:u,required:d,disabled:p,name:g,value:w,form:x,bubbleInput:S,setBubbleInput:E}=Vf(_y,e),T=Gd(n,E),O=_5(l),j=v5(i);Re.useEffect(()=>{let V=S;if(!V)return;let P=window.HTMLInputElement.prototype,U=Object.getOwnPropertyDescriptor(P,"checked").set,me=!o.current;if(O!==l&&U){let $=new Event("click",{bubbles:me});V.indeterminate=la(l),U.call(V,la(l)?!1:l),V.dispatchEvent($)}},[S,O,l,o]);let z=Re.useRef(la(l)?!1:l);return(0,M.jsx)(ta.input,{type:"checkbox","aria-hidden":!0,defaultChecked:u??z.current,required:d,disabled:p,name:g,value:w,form:x,...t,tabIndex:-1,ref:T,style:{...t.style,...j,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});ky.displayName=_y;function jT(e){return typeof e=="function"}function la(e){return e==="indeterminate"}function Cy(e){return la(e)?"indeterminate":e?"checked":"unchecked"}var qT=Kd(PC(),1),Bf="ToastProvider",[Wf,zT,FT]=b5("Toast"),[Sy,F6]=zC("Toast",[FT]),[$T,Bc]=Sy(Bf),Ey=e=>{let{__scopeToast:t,label:n="Notification",duration:i=5e3,swipeDirection:o="right",swipeThreshold:l=50,children:u}=e,[d,p]=Re.useState(null),[g,w]=Re.useState(0),x=Re.useRef(!1),S=Re.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${Bf}\`. Expected non-empty \`string\`.`),(0,M.jsx)(Wf.Provider,{scope:t,children:(0,M.jsx)($T,{scope:t,label:n,duration:i,swipeDirection:o,swipeThreshold:l,toastCount:g,viewport:d,onViewportChange:p,onToastAdd:Re.useCallback(()=>w(E=>E+1),[]),onToastRemove:Re.useCallback(()=>w(E=>E-1),[]),isFocusedToastEscapeKeyDownRef:x,isClosePausedRef:S,children:u})})};Ey.displayName=Bf;var Ty="ToastViewport",VT=["F8"],Uf="toast.viewportPause",Kf="toast.viewportResume",Dy=Re.forwardRef((e,t)=>{let{__scopeToast:n,hotkey:i=VT,label:o="Notifications ({hotkey})",...l}=e,u=Bc(Ty,n),d=zT(n),p=Re.useRef(null),g=Re.useRef(null),w=Re.useRef(null),x=Re.useRef(null),S=Gd(t,x,u.onViewportChange),E=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),T=u.toastCount>0;Re.useEffect(()=>{let j=z=>{var V;i.length!==0&&i.every(P=>z[P]||z.code===P)&&((V=x.current)==null||V.focus())};return document.addEventListener("keydown",j),()=>document.removeEventListener("keydown",j)},[i]),Re.useEffect(()=>{let j=p.current,z=x.current;if(T&&j&&z){let V=()=>{if(!u.isClosePausedRef.current){let $=new CustomEvent(Uf);z.dispatchEvent($),u.isClosePausedRef.current=!0}},P=()=>{if(u.isClosePausedRef.current){let $=new CustomEvent(Kf);z.dispatchEvent($),u.isClosePausedRef.current=!1}},U=$=>{j.contains($.relatedTarget)||P()},me=()=>{j.contains(document.activeElement)||P()};return j.addEventListener("focusin",V),j.addEventListener("focusout",U),j.addEventListener("pointermove",V),j.addEventListener("pointerleave",me),window.addEventListener("blur",V),window.addEventListener("focus",P),()=>{j.removeEventListener("focusin",V),j.removeEventListener("focusout",U),j.removeEventListener("pointermove",V),j.removeEventListener("pointerleave",me),window.removeEventListener("blur",V),window.removeEventListener("focus",P)}}},[T,u.isClosePausedRef]);let O=Re.useCallback(({tabbingDirection:j})=>{let z=d().map(V=>{let P=V.ref.current,U=[P,...t3(P)];return j==="forwards"?U:U.reverse()});return(j==="forwards"?z.reverse():z).flat()},[d]);return Re.useEffect(()=>{let j=x.current;if(j){let z=V=>{var U,me,$;let P=V.altKey||V.ctrlKey||V.metaKey;if(V.key==="Tab"&&!P){let W=document.activeElement,ae=V.shiftKey;if(V.target===j&&ae){(U=g.current)==null||U.focus();return}let xe=O({tabbingDirection:ae?"backwards":"forwards"}),_e=xe.findIndex(Te=>Te===W);Xf(xe.slice(_e+1))?V.preventDefault():ae?(me=g.current)==null||me.focus():($=w.current)==null||$.focus()}};return j.addEventListener("keydown",z),()=>j.removeEventListener("keydown",z)}},[d,O]),(0,M.jsxs)(y5,{ref:p,role:"region","aria-label":o.replace("{hotkey}",E),tabIndex:-1,style:{pointerEvents:T?void 0:"none"},children:[T&&(0,M.jsx)(Qf,{ref:g,onFocusFromOutsideViewport:()=>{Xf(O({tabbingDirection:"forwards"}))}}),(0,M.jsx)(Wf.Slot,{scope:n,children:(0,M.jsx)(ta.ol,{tabIndex:-1,...l,ref:S})}),T&&(0,M.jsx)(Qf,{ref:w,onFocusFromOutsideViewport:()=>{Xf(O({tabbingDirection:"backwards"}))}})]})});Dy.displayName=Ty;var Ry="ToastFocusProxy",Qf=Re.forwardRef((e,t)=>{let{__scopeToast:n,onFocusFromOutsideViewport:i,...o}=e,l=Bc(Ry,n);return(0,M.jsx)(VC,{tabIndex:0,...o,ref:t,style:{position:"fixed"},onFocus:u=>{var p;let d=u.relatedTarget;(p=l.viewport)!=null&&p.contains(d)||i()}})});Qf.displayName=Ry;var ll="Toast",HT="toast.swipeStart",BT="toast.swipeMove",WT="toast.swipeCancel",UT="toast.swipeEnd",Iy=Re.forwardRef((e,t)=>{let{forceMount:n,open:i,defaultOpen:o,onOpenChange:l,...u}=e,[d,p]=$C({prop:i,defaultProp:o??!0,onChange:l,caller:ll});return(0,M.jsx)(FC,{present:n||d,children:(0,M.jsx)(GT,{open:d,...u,ref:t,onClose:()=>p(!1),onPause:Jd(e.onPause),onResume:Jd(e.onResume),onSwipeStart:Wr(e.onSwipeStart,g=>{g.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Wr(e.onSwipeMove,g=>{let{x:w,y:x}=g.detail.delta;g.currentTarget.setAttribute("data-swipe","move"),g.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${w}px`),g.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${x}px`)}),onSwipeCancel:Wr(e.onSwipeCancel,g=>{g.currentTarget.setAttribute("data-swipe","cancel"),g.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),g.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),g.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),g.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:Wr(e.onSwipeEnd,g=>{let{x:w,y:x}=g.detail.delta;g.currentTarget.setAttribute("data-swipe","end"),g.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),g.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),g.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${w}px`),g.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${x}px`),p(!1)})})})});Iy.displayName=ll;var[KT,QT]=Sy(ll,{onClose(){}}),GT=Re.forwardRef((e,t)=>{let{__scopeToast:n,type:i="foreground",duration:o,open:l,onClose:u,onEscapeKeyDown:d,onPause:p,onResume:g,onSwipeStart:w,onSwipeMove:x,onSwipeCancel:S,onSwipeEnd:E,...T}=e,O=Bc(ll,n),[j,z]=Re.useState(null),V=Gd(t,Y=>z(Y)),P=Re.useRef(null),U=Re.useRef(null),me=o||O.duration,$=Re.useRef(0),W=Re.useRef(me),ae=Re.useRef(0),{onToastAdd:xe,onToastRemove:_e}=O,Te=Jd(()=>{var Y;j!=null&&j.contains(document.activeElement)&&((Y=O.viewport)==null||Y.focus()),u()}),Z=Re.useCallback(Y=>{!Y||Y===1/0||(window.clearTimeout(ae.current),$.current=new Date().getTime(),ae.current=window.setTimeout(Te,Y))},[Te]);Re.useEffect(()=>{let Y=O.viewport;if(Y){let ce=()=>{Z(W.current),g==null||g()},te=()=>{let he=new Date().getTime()-$.current;W.current-=he,window.clearTimeout(ae.current),p==null||p()};return Y.addEventListener(Uf,te),Y.addEventListener(Kf,ce),()=>{Y.removeEventListener(Uf,te),Y.removeEventListener(Kf,ce)}}},[O.viewport,me,p,g,Z]),Re.useEffect(()=>{l&&!O.isClosePausedRef.current&&Z(me)},[l,me,O.isClosePausedRef,Z]),Re.useEffect(()=>(xe(),()=>_e()),[xe,_e]);let Q=Re.useMemo(()=>j?jy(j):null,[j]);return O.viewport?(0,M.jsxs)(M.Fragment,{children:[Q&&(0,M.jsx)(XT,{__scopeToast:n,role:"status","aria-live":i==="foreground"?"assertive":"polite",children:Q}),(0,M.jsx)(KT,{scope:n,onClose:Te,children:qT.createPortal((0,M.jsx)(Wf.ItemSlot,{scope:n,children:(0,M.jsx)(g5,{asChild:!0,onEscapeKeyDown:Wr(d,()=>{O.isFocusedToastEscapeKeyDownRef.current||Te(),O.isFocusedToastEscapeKeyDownRef.current=!1}),children:(0,M.jsx)(ta.li,{tabIndex:0,"data-state":l?"open":"closed","data-swipe-direction":O.swipeDirection,...T,ref:V,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:Wr(e.onKeyDown,Y=>{Y.key==="Escape"&&(d==null||d(Y.nativeEvent),Y.nativeEvent.defaultPrevented||(O.isFocusedToastEscapeKeyDownRef.current=!0,Te()))}),onPointerDown:Wr(e.onPointerDown,Y=>{Y.button===0&&(P.current={x:Y.clientX,y:Y.clientY})}),onPointerMove:Wr(e.onPointerMove,Y=>{if(!P.current)return;let ce=Y.clientX-P.current.x,te=Y.clientY-P.current.y,he=!!U.current,G=["left","right"].includes(O.swipeDirection),je=["left","up"].includes(O.swipeDirection)?Math.min:Math.max,qe=G?je(0,ce):0,Qe=G?0:je(0,te),He=Y.pointerType==="touch"?10:2,Fe={x:qe,y:Qe},Oe={originalEvent:Y,delta:Fe};he?(U.current=Fe,Wc(BT,x,Oe,{discrete:!1})):qy(Fe,O.swipeDirection,He)?(U.current=Fe,Wc(HT,w,Oe,{discrete:!1}),Y.target.setPointerCapture(Y.pointerId)):(Math.abs(ce)>He||Math.abs(te)>He)&&(P.current=null)}),onPointerUp:Wr(e.onPointerUp,Y=>{let ce=U.current,te=Y.target;if(te.hasPointerCapture(Y.pointerId)&&te.releasePointerCapture(Y.pointerId),U.current=null,P.current=null,ce){let he=Y.currentTarget,G={originalEvent:Y,delta:ce};qy(ce,O.swipeDirection,O.swipeThreshold)?Wc(UT,E,G,{discrete:!0}):Wc(WT,S,G,{discrete:!0}),he.addEventListener("click",je=>je.preventDefault(),{once:!0})}})})})}),O.viewport)})]}):null}),XT=e=>{let{__scopeToast:t,children:n,...i}=e,o=Bc(ll,t),[l,u]=Re.useState(!1),[d,p]=Re.useState(!1);return ZT(()=>u(!0)),Re.useEffect(()=>{let g=window.setTimeout(()=>p(!0),1e3);return()=>window.clearTimeout(g)},[]),d?null:(0,M.jsx)(h5,{asChild:!0,children:(0,M.jsx)(VC,{...i,children:l&&(0,M.jsxs)(M.Fragment,{children:[o.label," ",n]})})})},JT="ToastTitle",Ay=Re.forwardRef((e,t)=>{let{__scopeToast:n,...i}=e;return(0,M.jsx)(ta.div,{...i,ref:t})});Ay.displayName=JT;var YT="ToastDescription",Ly=Re.forwardRef((e,t)=>{let{__scopeToast:n,...i}=e;return(0,M.jsx)(ta.div,{...i,ref:t})});Ly.displayName=YT;var Py="ToastAction",Oy=Re.forwardRef((e,t)=>{let{altText:n,...i}=e;return n.trim()?(0,M.jsx)(Ny,{altText:n,asChild:!0,children:(0,M.jsx)(Gf,{...i,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${Py}\`. Expected non-empty \`string\`.`),null)});Oy.displayName=Py;var My="ToastClose",Gf=Re.forwardRef((e,t)=>{let{__scopeToast:n,...i}=e,o=QT(My,n);return(0,M.jsx)(Ny,{asChild:!0,children:(0,M.jsx)(ta.button,{type:"button",...i,ref:t,onClick:Wr(e.onClick,o.onClose)})})});Gf.displayName=My;var Ny=Re.forwardRef((e,t)=>{let{__scopeToast:n,altText:i,...o}=e;return(0,M.jsx)(ta.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":i||void 0,...o,ref:t})});function jy(e){let t=[];return Array.from(e.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&t.push(n.textContent),e3(n)){let i=n.ariaHidden||n.hidden||n.style.display==="none",o=n.dataset.radixToastAnnounceExclude==="";if(!i)if(o){let l=n.dataset.radixToastAnnounceAlt;l&&t.push(l)}else t.push(...jy(n))}}),t}function Wc(e,t,n,{discrete:i}){let o=n.originalEvent.currentTarget,l=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),i?p5(o,l):o.dispatchEvent(l)}var qy=(e,t,n=0)=>{let i=Math.abs(e.x),o=Math.abs(e.y),l=i>o;return t==="left"||t==="right"?l&&i>n:!l&&o>n};function ZT(e=()=>{}){let t=Jd(e);m5(()=>{let n=0,i=0;return n=window.requestAnimationFrame(()=>i=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(i)}},[t])}function e3(e){return e.nodeType===e.ELEMENT_NODE}function t3(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:i=>{let o=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||o?NodeFilter.FILTER_SKIP:i.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Xf(e){let t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var n3=Ey,zy=Dy,Fy=Iy,$y=Ay,Vy=Ly,Hy=Oy,By=Gf,r3=Symbol("");NE=function(e,t){return Ne(e,function(n,i,o){i(this,t(n(this),o))})};function Jf(e,t){let n=null,i=new Map,o=new Set,l=d=>{let p;if(t===void 0)p=i.get(d);else for(let[w,x]of i)if(t(w,d)){p=x;break}if(p!==void 0)if(n!=null&&n(p[1],d))l.remove(d);else return p[0];let g=e(d);return i.set(d,[g,Date.now()]),u("CREATE",d,g),g},u=(d,p,g)=>{for(let w of o)w({type:d,param:p,atom:g})};return l.unstable_listen=d=>(o.add(d),()=>{o.delete(d)}),l.getParams=()=>i.keys(),l.remove=d=>{if(t===void 0){if(!i.has(d))return;let[p]=i.get(d);i.delete(d),u("REMOVE",d,p)}else for(let[p,[g]]of i)if(t(p,d)){i.delete(p),u("REMOVE",p,g);break}},l.setShouldRemove=d=>{if(n=d,n)for(let[p,[g,w]]of i)n(w,p)&&(i.delete(p),u("REMOVE",p,g))},l}var Yf=(e,t,n)=>(t.has(n)?t:t.set(n,e())).get(n),i3=new WeakMap,a3=(e,t,n,i)=>Yf(e,Yf(()=>new WeakMap,Yf(()=>new WeakMap,i3,t),n),i);function o3(e,t,n=Object.is){return a3(()=>{let i=Symbol(),o=([u,d])=>{if(d===i)return t(u);let p=t(u,d);return n(d,p)?d:p},l=Ne(u=>{let d=u(l);return o([u(e),d])});return l.init=i,l},e,t,n)}var Wy=(e,t,n)=>(t.has(n)?t:t.set(n,e())).get(n),s3=new WeakMap,l3=(e,t,n)=>Wy(e,Wy(()=>new WeakMap,s3,t),n),c3={},Uy=e=>!!e.write,u3=e=>typeof e=="function";function d3(e,t){return l3(()=>{let n=new WeakMap,i=(u,d)=>{let p=n.get(u);if(p)return p;let g=d&&n.get(d),w=[],x=[];return u.forEach((S,E)=>{let T=t?t(S):E;x[E]=T;let O=g&&g.atomList[g.keyList.indexOf(T)];if(O){w[E]=O;return}let j=z=>{let V=z(o),P=z(e),U=i(P,V==null?void 0:V.arr).keyList.indexOf(T);if(U<0||U>=P.length){let me=u[i(u).keyList.indexOf(T)];if(me)return me;throw Error("splitAtom: index out of bounds for read")}return P[U]};w[E]=Uy(e)?Ne(j,(z,V,P)=>{let U=z(o),me=z(e),$=i(me,U==null?void 0:U.arr).keyList.indexOf(T);if($<0||$>=me.length)throw Error("splitAtom: index out of bounds for write");let W=u3(P)?P(me[$]):P;Object.is(me[$],W)||V(e,[...me.slice(0,$),W,...me.slice($+1)])}):Ne(j)}),p=g&&g.keyList.length===x.length&&g.keyList.every((S,E)=>S===x[E])?g:{arr:u,atomList:w,keyList:x},n.set(u,p),p},o=Ne(u=>{let d=u(o);return i(u(e),d==null?void 0:d.arr)});o.init=void 0;let l=Uy(e)?Ne(u=>u(o).atomList,(u,d,p)=>{switch(p.type){case"remove":{let g=u(l).indexOf(p.atom);if(g>=0){let w=u(e);d(e,[...w.slice(0,g),...w.slice(g+1)])}break}case"insert":{let g=p.before?u(l).indexOf(p.before):u(l).length;if(g>=0){let w=u(e);d(e,[...w.slice(0,g),p.value,...w.slice(g)])}break}case"move":{let g=u(l).indexOf(p.atom),w=p.before?u(l).indexOf(p.before):u(l).length;if(g>=0&&w>=0){let x=u(e);g<w?d(e,[...x.slice(0,g),...x.slice(g+1,w),x[g],...x.slice(w)]):d(e,[...x.slice(0,w),x[g],...x.slice(w,g),...x.slice(g+1)])}break}}}):Ne(u=>u(o).atomList);return l},e,t||c3)}var Ky=e=>typeof(e==null?void 0:e.then)=="function";function Qy(e=()=>{try{return window.localStorage}catch{return}},t){var d;let n,i,o={getItem:(p,g)=>{var S;let w=E=>{if(E||(E=""),n!==E){try{i=JSON.parse(E,t==null?void 0:t.reviver)}catch{return g}n=E}return i},x=((S=e())==null?void 0:S.getItem(p))??null;return Ky(x)?x.then(w):w(x)},setItem:(p,g)=>{var w;return(w=e())==null?void 0:w.setItem(p,JSON.stringify(g,t==null?void 0:t.replacer))},removeItem:p=>{var g;return(g=e())==null?void 0:g.removeItem(p)}},l=p=>(g,w,x)=>p(g,S=>{let E;try{E=JSON.parse(S||"")}catch{E=x}w(E)}),u;try{u=(d=e())==null?void 0:d.subscribe}catch{}return!u&&typeof window<"u"&&typeof window.addEventListener=="function"&&window.Storage&&(u=(p,g)=>{if(!(e()instanceof window.Storage))return()=>{};let w=x=>{x.storageArea===e()&&x.key===p&&g(x.newValue)};return window.addEventListener("storage",w),()=>{window.removeEventListener("storage",w)}}),u&&(o.subscribe=l(u)),o}var f3=Qy();Oc=function(e,t,n=f3,i){let o=Ne(i!=null&&i.getOnInit?n.getItem(e,t):t);return o.onMount=l=>{l(n.getItem(e,t));let u;return n.subscribe&&(u=n.subscribe(e,l,t)),u},Ne(l=>l(o),(l,u,d)=>{let p=typeof d=="function"?d(l(o)):d;return p===r3?(u(o,t),n.removeItem(e)):Ky(p)?p.then(g=>(u(o,g),n.setItem(e,g))):(u(o,p),n.setItem(e,p))})},Jn=function(e){let t,n,i;return typeof e=="object"?(t=e.hashFunction,n=e.expiring,i=e.tags):t=e,(o,l,u)=>{if(u.value!=null)u.value=Gy(u.value,t,n,i);else if(u.get!=null)u.get=Gy(u.get,t,n,i);else throw"Only put a Memoize() decorator on a method or get accessor."}};var Zf=new Map;function Gy(e,t,n=0,i){let o=Symbol("__memoized_map__");return function(...l){let u;this.hasOwnProperty(o)||Object.defineProperty(this,o,{configurable:!1,enumerable:!1,writable:!1,value:new Map});let d=this[o];if(Array.isArray(i))for(let p of i)Zf.has(p)?Zf.get(p).push(d):Zf.set(p,[d]);if(t||l.length>0||n>0){let p;p=t===!0?l.map(x=>x.toString()).join("!"):t?t.apply(this,l):l[0];let g=`${p}__timestamp`,w=!1;if(n>0)if(!d.has(g))w=!0;else{let x=d.get(g);w=Date.now()-x>n}d.has(p)&&!w?u=d.get(p):(u=e.apply(this,l),d.set(p,u),n>0&&d.set(g,Date.now()))}else{let p=this;d.has(p)?u=d.get(p):(u=e.apply(this,l),d.set(p,u))}return u}}ol=Ne(X0()),TE=Ne(null),Nc=Ne(null),hS=Ne(void 0);var p3=class{constructor(){pe(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 m3(){let{hasLocalStorage:e,hasSessionStorage:t}=s6();return e?window.localStorage:t?window.sessionStorage:new p3}il=m3();let ca;oE=class{constructor(e,t=il){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)}},xf=class{constructor(e,t,n=il){this.schema=e,this.getDefaultValue=t,this.storage=n}get(e){try{let t=this.storage.getItem(e);if(t==null)return this.getDefaultValue();let n=this.schema.safeParse(JSON.parse(t));return n.success?n.data:(Se.warn("Error parsing zod local storage",n.error),this.getDefaultValue())}catch(t){return Se.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)}},E0=class extends xf{constructor(e,t,n){let i=Me.get(ol);super(t,n),this.filename=i;try{this.unsubscribeFromFilename=Me.sub(ol,()=>{let o=Me.get(ol);this.handleFilenameChange(e,o)})}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 n=this.get(e);this.remove(e),this.filename=t,this.set(e,n)}}dispose(){this.unsubscribeFromFilename&&(this.unsubscribeFromFilename=(this.unsubscribeFromFilename(),null))}},ca="marimo:notebook-col-sizes";function h3(){return{widths:[]}}var Go=new E0(ca,MC({widths:e5(t5([YM(),ZM("contentWidth")]).default("contentWidth"))}),h3);MS={getColumnWidth:e=>Go.get(ca).widths[e]??"contentWidth",saveColumnWidth:(e,t)=>{let n=Go.get(ca).widths;if(n[e])n[e]=t;else{for(;n.length<=e;)n.push("contentWidth");n[e]=t}Go.set(ca,{widths:n})},clearStorage:()=>{Go.remove(ca)}};function g3(e,t){let n=Go.get(ca).widths,i=kc(n,e,t);Go.set(ca,{widths:i})}var Xy,Jy,Yy,Qr,Zy,ev,tv,nv,Yn,rv,iv,av,ov,sv,lv,ln;function cr(e,t,n,i,o){var l={};return Object.keys(i).forEach(function(u){l[u]=i[u]}),l.enumerable=!!l.enumerable,l.configurable=!!l.configurable,("value"in l||l.initializer)&&(l.writable=!0),l=n.slice().reverse().reduce(function(u,d){return d(e,t,u)||u},l),o&&l.initializer!==void 0&&(l.value=l.initializer?l.initializer.call(o):void 0,l.initializer=void 0),l.initializer===void 0?(Object.defineProperty(e,t,l),null):l}let eo=(Xy=Jn(),Jy=Jn(),Yy=Jn(),Qr=class{constructor(e,t,n){this.value=e,this.isCollapsed=t,this.children=n}geDescendantCount(){let e=0,t=[...this.children];for(;t.length>0;){let n=t.pop();e++;for(let i=n.children.length-1;i>=0;i--)t.push(n.children[i])}return e}getDescendants(){let e=[],t=[...this.children];for(;t.length>0;){let n=t.pop();e.push(n.value);for(let i=n.children.length-1;i>=0;i--)t.push(n.children[i])}return e}get inOrderIds(){let e=[],t=n=>{e.push(n.value);for(let i of n.children)t(i)};for(let n of this.children)t(n);return e}toString(){return this.isCollapsed?`${this.value} (collapsed)`:String(this.value)}equals(e){return this.value===e.value}},cr(Qr.prototype,"geDescendantCount",[Xy],Object.getOwnPropertyDescriptor(Qr.prototype,"geDescendantCount"),Qr.prototype),cr(Qr.prototype,"getDescendants",[Jy],Object.getOwnPropertyDescriptor(Qr.prototype,"getDescendants"),Qr.prototype),cr(Qr.prototype,"inOrderIds",[Yy],Object.getOwnPropertyDescriptor(Qr.prototype,"inOrderIds"),Qr.prototype),Qr);var y3=0;let Xo;Xo=(Zy=Jn(),ev=Jn(),tv=Jn(),nv=Jn(),Yn=class Qo{constructor(t,n){this.nodes=t,this.id=n}static from(t){let n=`tree_${y3++}`;return new Qo(t.map(i=>new eo(i,!1,[])),n)}static fromWithPreviousShape(t,n){var l;if(!n)return Qo.from(t);let i=n.id,o=new Qo(t.map(u=>new eo(u,!1,[])),i);for(let u of t)if(n.isCollapsed(u)){let d=((l=n._nodeMap.get(u))==null?void 0:l.children)??[];for(let p=d.length-1;p>=0;p--){let g=d[p];if(o._nodeMap.has(g.value)){o=o.collapse(u,g.value);break}}}return o}withNodes(t){return new Qo(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 n of this.nodes)t.set(n.value,n);return t}getDescendants(t){let n=this._nodeMap.get(t);return n?n.getDescendants():(Se.warn(`Node ${t} not found in tree. Valid ids: ${this.topLevelIds}`),[])}isCollapsed(t){let n=this._nodeMap.get(t);return n?n.isCollapsed:(Se.warn(`Node ${t} not found in tree. Valid ids: ${this.topLevelIds}`),!1)}indexOfOrThrow(t){let n=this.nodes.findIndex(i=>i.value===t);if(n===-1)throw Error(`Node ${t} not found in tree. Valid ids: ${this.topLevelIds}`);return n}slice(t,n){return this.nodes.slice(t,n).map(i=>i.value)}moveToFront(t){let n=this.indexOfOrThrow(t);return this.withNodes(kc(this.nodes,n,0))}moveToBack(t){let n=this.indexOfOrThrow(t);return this.withNodes(kc(this.nodes,n,this.nodes.length-1))}collapse(t,n){let i=this.nodes.findIndex(p=>p.value===t);if(i===-1)throw Error(`Node ${t} not found in tree. Valid ids: ${this.topLevelIds}`);let o=n===void 0?this.nodes.length:this.nodes.findIndex(p=>p.value===n);if(o===-1)throw Error(`Node ${n} not found in tree`);if(o<i)throw Error(`Node ${n} is before node ${t}`);let l=[...this.nodes],u=l[i];if(u.isCollapsed)throw Error(`Node ${t} is already collapsed`);let d=l.splice(i+1,o-i);return l[i]=new eo(u.value,!0,d),this.withNodes(l)}collapseAll(t){let n=[...this.nodes];if(t.length===0)throw Error("No collapse ranges provided");if(t.length!==n.length)throw Error(`Collapse ranges length ${t.length} does not match tree length ${n.length}`);let i=n.length-1;for(;i>=0;){let o=n[i],l=t[i];if(!o.isCollapsed&&l){let{id:u,until:d}=l;if(u!==o.value)throw Error(`Node ${o.value} does not match collapse range id ${u}`);let p=d===void 0?n.length:n.findIndex(w=>w.value===d);if(p===-1)throw Error(`Node ${d} not found in tree`);if(p<i)throw Error(`Node ${d} is before node ${u}`);let g=n.splice(i+1,p-i);n[i]=new eo(o.value,!0,g),i--}else i--}return this.withNodes(n)}expand(t){let n=this.nodes.findIndex(l=>l.value===t);if(n===-1)throw Error(`Node ${t} not found in tree. Valid ids: ${this.topLevelIds}`);let i=[...this.nodes],o=i[n];return o.isCollapsed?(i[n]=new eo(o.value,!1,[]),i=Lg(i,n+1,o.children),this.withNodes(i)):this}expandAll(){let t=[...this.nodes],n=0;for(;n<t.length;){let i=t[n];i.isCollapsed&&(t[n]=new eo(i.value,!1,[]),t=Lg(t,n+1,i.children)),n++}return this.withNodes(t)}move(t,n){return this.withNodes(kc(this.nodes,t,n))}at(t){var n;return(n=this.nodes.at(t))==null?void 0:n.value}atOrThrow(t){let n=this.nodes.at(t);if(n===void 0)throw Error(`Node at index ${t} not found in tree`);return n.value}first(){return this.atOrThrow(0)}last(){return this.atOrThrow(this.nodes.length-1)}after(t){let n=this.indexOfOrThrow(t);if(n!==this.nodes.length-1)return this.at(n+1)}before(t){let n=this.indexOfOrThrow(t);if(n!==0)return this.at(n-1)}insert(t,n){return this.withNodes(sS(this.nodes,n,new eo(t,!1,[])))}insertAtEnd(t){return this.insert(t,this.nodes.length)}insertAtStart(t){return this.insert(t,0)}deleteAtIndex(t){let n=this.atOrThrow(t),i=this.expand(n);return i.withNodes(o6(i.nodes,t))}delete(t){let n=this.indexOfOrThrow(t);return this.deleteAtIndex(n)}getCount(t){var n;return((n=this._nodeMap.get(t))==null?void 0:n.geDescendantCount())??0}findAndExpandDeep(t){let n=this.find(t);return n.length===0?this:n.reduce((i,o)=>i.expand(o),this)}find(t){function n(i,o){for(let l of i){if(l.value===t)return[...o,t];let u=n(l.children,[...o,l.value]);if(u.length>0)return u}return[]}return n(this.nodes,[])}split(t){let n=this.nodes.findIndex(l=>l.value===t);if(n===-1)throw Error(`Node ${t} not found in tree`);let i=this.nodes.slice(0,n),o=this.nodes.slice(n);return i.length===0?[Qo.from([]),this.withNodes(o)]:[this.withNodes(i),Qo.from([]).withNodes(o)]}equals(t){return this.nodes.length===t.nodes.length&&this.nodes.every((n,i)=>n.value===t.nodes[i].value)}toString(){let t=0,n="",i=o=>{for(let l of o)n+=`${" ".repeat(t*2)}${l.toString()}
|
|
13
|
+
`,t+=1,i(l.children),--t};return i(this.nodes),n}},cr(Yn.prototype,"topLevelIds",[Zy],Object.getOwnPropertyDescriptor(Yn.prototype,"topLevelIds"),Yn.prototype),cr(Yn.prototype,"inOrderIds",[ev],Object.getOwnPropertyDescriptor(Yn.prototype,"inOrderIds"),Yn.prototype),cr(Yn.prototype,"idSet",[tv],Object.getOwnPropertyDescriptor(Yn.prototype,"idSet"),Yn.prototype),cr(Yn.prototype,"_nodeMap",[nv],Object.getOwnPropertyDescriptor(Yn.prototype,"_nodeMap"),Yn.prototype),Yn),al=(rv=Jn(),iv=Jn(),av=Jn(),ov=Jn(),sv=Jn(),lv=Jn(),ln=class Pn{constructor(t){this.columns=t,t.length===0&&(this.columns=[Xo.from([])])}static from(t){return new Pn(t.map(n=>Xo.from(n)))}static fromWithPreviousShape(t,n){if(!n)return Pn.from([t]);let i=n.getColumns(),o=Array.from({length:i.length},()=>[]),l=0;for(let u of t){let d=i.findIndex(p=>p.idSet.has(u));d===-1?o[l].push(u):(l=d,o[d].push(u))}return new Pn(o.map((u,d)=>Xo.fromWithPreviousShape(u,i[d])))}isEmpty(){return this.columns.length===0?!0:this.columns.every(t=>t.nodes.length===0)}static fromIdsAndColumns(t){let n=Math.max(1,...t.map(([,l])=>(l??0)+1)),i=Array.from({length:n},()=>[]),o=0;for(let[l,u]of t)u==null||u<0?i[o].push(l):(i[u].push(l),o=u);return Pn.from(i)}get topLevelIds(){return this.columns.map(t=>t.topLevelIds)}get iterateTopLevelIds(){let t=this.columns;function*n(){for(let i of t)for(let o of i.topLevelIds)yield o}return n()}get inOrderIds(){return this.columns.flatMap(t=>t.inOrderIds)}get colLength(){return this.columns.length}get idLength(){return this.columns.reduce((t,n)=>t+n.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 n=this.columns[t];if(!n)throw Error(`Column ${t} not found`);return n}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,n=[]){return new Pn(this.columns.flatMap(i=>i.id===t?[i,Xo.from(n)]:[i]))}insertBreakpoint(t){let n=this.findWithId(t),[i,o]=n.split(t);return new Pn(this.columns.flatMap(l=>l===n?[i,o].filter(Boolean):[l]))}delete(t){if(this.columns.length<=1)return this;let n=this.indexOfOrThrow(t),i=n===0?1:n-1,o=[...this.columns],l=o[n];return o[i]=l.withNodes([...o[i].nodes,...l.nodes]),o.splice(n,1),new Pn(o)}mergeAllColumns(){if(this.columns.length<=1)return this;let t=this.columns.flatMap(i=>i.nodes),n=this.columns[0];return new Pn([n.withNodes(t)])}moveWithinColumn(t,n,i){return this.transform(t,o=>o.move(n,i))}moveAcrossColumns(t,n,i,o){let l=this.indexOfOrThrow(t),u=this.indexOfOrThrow(i),d=[...this.columns],p=d[l],g=p.nodes.findIndex(S=>S.value===n);if(g===-1)throw Error(`Node ${n} not found in column ${t}`);let w=p.nodes[g];d[l]=p.withNodes(p.nodes.filter((S,E)=>E!==g));let x=d[u];if(o){let S=x.indexOfOrThrow(o);d[u]=x.withNodes(sS(x.nodes,S,w))}else d[u]=x.withNodes([w,...x.nodes]);return new Pn(d)}moveCellsRelativeTo(t,n,i){if(t.length===0)return this;let o=new Set(t),l=this.findWithId(n),u=this.indexOfOrThrow(l.id),d=[];for(let S of t){let E=this.findWithId(S),T=E.nodes.find(O=>O.value===S);if(!T)throw Error(`Node ${S} not found in column ${E.id}`);d.push(T)}let p=this.columns.map(S=>S.withNodes(S.nodes.filter(E=>!o.has(E.value)))),g=p[u],w=g.nodes.findIndex(S=>S.value===n);w===-1?w=g.nodes.length:i==="after"&&(w+=1);let x=Lg(g.nodes,w,d);return p[u]=g.withNodes(x),new Pn(p)}indexOfOrThrow(t){let n=this.columns.findIndex(i=>i.id===t);if(n===-1)throw Error(`Column ${t} not found. Possible values: ${this.getColumnIds().join(", ")}`);return n}moveColumn(t,n){if(t===n)return this;let i=this.indexOfOrThrow(t),o=n==="_left_"?i-1:n==="_right_"?i+1:this.indexOfOrThrow(n);return g3(i,o),new Pn(kc([...this.columns],i,o))}moveToNewColumn(t){let n=this.findWithId(t),i=this.columns.map(l=>l.id===n.id?l.delete(t):l),o=Xo.from([t]);return new Pn([...i,o])}findWithId(t){let n=this.columns.find(i=>i.inOrderIds.includes(t));if(!n)throw Se.log(`Possible values: ${this.columns.map(i=>i.inOrderIds).join(", ")}`),Error(`Cell ${t} not found in any column`);return n}transformWithCellId(t,n){let i=!1,o=this.columns.map(l=>{if(l.inOrderIds.includes(t)){let u=n(l);return l!==u&&(i=!0),u}return l});return i?new Pn(o):this}setupCellExists(){return this.columns.some(t=>t.topLevelIds.includes(Rr))}insertId(t,n,i){return this.transform(n,o=>o.insert(t,i))}deleteById(t){return this.transformWithCellId(t,n=>n.delete(t))}placeCells(t){if(t.length===0)return this;let n=this.deleteById(t[0].id);for(let{id:o}of t.slice(1))n=n.deleteById(o);let i=[...t].toSorted((o,l)=>o.columnId===l.columnId?o.index-l.index:o.columnId.localeCompare(l.columnId));for(let{id:o,columnId:l,index:u}of i)n=n.insertId(o,l,u);return n}compact(){return this.columns.length===1||!this.columns.some(t=>t.nodes.length===0)?this:new Pn(this.columns.filter(t=>t.nodes.length>0))}transform(t,n){let i=this._columnMap.get(t);if(!i)return Se.warn(`Column ${t} not found`),this;let o=n(i);return i===o?this:new Pn(this.columns.map(l=>l.id===t?o:l))}transformAll(t){let n=!1,i=this.columns.map(o=>{let l=t(o);return o.equals(l)||(n=!0),l});return n?new Pn(i):this}},cr(ln.prototype,"isEmpty",[rv],Object.getOwnPropertyDescriptor(ln.prototype,"isEmpty"),ln.prototype),cr(ln.prototype,"topLevelIds",[iv],Object.getOwnPropertyDescriptor(ln.prototype,"topLevelIds"),ln.prototype),cr(ln.prototype,"inOrderIds",[av],Object.getOwnPropertyDescriptor(ln.prototype,"inOrderIds"),ln.prototype),cr(ln.prototype,"idLength",[ov],Object.getOwnPropertyDescriptor(ln.prototype,"idLength"),ln.prototype),cr(ln.prototype,"_columnMap",[sv],Object.getOwnPropertyDescriptor(ln.prototype,"_columnMap"),ln.prototype),cr(ln.prototype,"getColumnIds",[lv],Object.getOwnPropertyDescriptor(ln.prototype,"getColumnIds"),ln.prototype),ln);let ep,tp,np,cv,rp,uv,dv,fv,pv,ip,ap,mv,op,sp;ep=Pe((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(i){i.Root="root",i.Text="text",i.Directive="directive",i.Comment="comment",i.Script="script",i.Style="style",i.Tag="tag",i.CDATA="cdata",i.Doctype="doctype"})(t=e.ElementType||(e.ElementType={}));function n(i){return i.type===t.Tag||i.type===t.Script||i.type===t.Style}e.isTag=n,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})),tp=Pe((e=>{var t=e&&e.__extends||(function(){var $=function(W,ae){return $=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(xe,_e){xe.__proto__=_e}||function(xe,_e){for(var Te in _e)Object.prototype.hasOwnProperty.call(_e,Te)&&(xe[Te]=_e[Te])},$(W,ae)};return function(W,ae){if(typeof ae!="function"&&ae!==null)throw TypeError("Class extends value "+String(ae)+" is not a constructor or null");$(W,ae);function xe(){this.constructor=W}W.prototype=ae===null?Object.create(ae):(xe.prototype=ae.prototype,new xe)}})(),n=e&&e.__assign||function(){return n=Object.assign||function($){for(var W,ae=1,xe=arguments.length;ae<xe;ae++)for(var _e in W=arguments[ae],W)Object.prototype.hasOwnProperty.call(W,_e)&&($[_e]=W[_e]);return $},n.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 i=ep(),o=(function(){function $(){this.parent=null,this.prev=null,this.next=null,this.startIndex=null,this.endIndex=null}return Object.defineProperty($.prototype,"parentNode",{get:function(){return this.parent},set:function(W){this.parent=W},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"previousSibling",{get:function(){return this.prev},set:function(W){this.prev=W},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"nextSibling",{get:function(){return this.next},set:function(W){this.next=W},enumerable:!1,configurable:!0}),$.prototype.cloneNode=function(W){return W===void 0&&(W=!1),U(this,W)},$})();e.Node=o;var l=(function($){t(W,$);function W(ae){var xe=$.call(this)||this;return xe.data=ae,xe}return Object.defineProperty(W.prototype,"nodeValue",{get:function(){return this.data},set:function(ae){this.data=ae},enumerable:!1,configurable:!0}),W})(o);e.DataNode=l;var u=(function($){t(W,$);function W(){var ae=$!==null&&$.apply(this,arguments)||this;return ae.type=i.ElementType.Text,ae}return Object.defineProperty(W.prototype,"nodeType",{get:function(){return 3},enumerable:!1,configurable:!0}),W})(l);e.Text=u;var d=(function($){t(W,$);function W(){var ae=$!==null&&$.apply(this,arguments)||this;return ae.type=i.ElementType.Comment,ae}return Object.defineProperty(W.prototype,"nodeType",{get:function(){return 8},enumerable:!1,configurable:!0}),W})(l);e.Comment=d;var p=(function($){t(W,$);function W(ae,xe){var _e=$.call(this,xe)||this;return _e.name=ae,_e.type=i.ElementType.Directive,_e}return Object.defineProperty(W.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),W})(l);e.ProcessingInstruction=p;var g=(function($){t(W,$);function W(ae){var xe=$.call(this)||this;return xe.children=ae,xe}return Object.defineProperty(W.prototype,"firstChild",{get:function(){return this.children[0]??null},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"lastChild",{get:function(){return this.children.length>0?this.children[this.children.length-1]:null},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"childNodes",{get:function(){return this.children},set:function(ae){this.children=ae},enumerable:!1,configurable:!0}),W})(o);e.NodeWithChildren=g;var w=(function($){t(W,$);function W(){var ae=$!==null&&$.apply(this,arguments)||this;return ae.type=i.ElementType.CDATA,ae}return Object.defineProperty(W.prototype,"nodeType",{get:function(){return 4},enumerable:!1,configurable:!0}),W})(g);e.CDATA=w;var x=(function($){t(W,$);function W(){var ae=$!==null&&$.apply(this,arguments)||this;return ae.type=i.ElementType.Root,ae}return Object.defineProperty(W.prototype,"nodeType",{get:function(){return 9},enumerable:!1,configurable:!0}),W})(g);e.Document=x;var S=(function($){t(W,$);function W(ae,xe,_e,Te){_e===void 0&&(_e=[]),Te===void 0&&(Te=ae==="script"?i.ElementType.Script:ae==="style"?i.ElementType.Style:i.ElementType.Tag);var Z=$.call(this,_e)||this;return Z.name=ae,Z.attribs=xe,Z.type=Te,Z}return Object.defineProperty(W.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"tagName",{get:function(){return this.name},set:function(ae){this.name=ae},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"attributes",{get:function(){var ae=this;return Object.keys(this.attribs).map(function(xe){var _e,Te;return{name:xe,value:ae.attribs[xe],namespace:(_e=ae["x-attribsNamespace"])==null?void 0:_e[xe],prefix:(Te=ae["x-attribsPrefix"])==null?void 0:Te[xe]}})},enumerable:!1,configurable:!0}),W})(g);e.Element=S;function E($){return(0,i.isTag)($)}e.isTag=E;function T($){return $.type===i.ElementType.CDATA}e.isCDATA=T;function O($){return $.type===i.ElementType.Text}e.isText=O;function j($){return $.type===i.ElementType.Comment}e.isComment=j;function z($){return $.type===i.ElementType.Directive}e.isDirective=z;function V($){return $.type===i.ElementType.Root}e.isDocument=V;function P($){return Object.prototype.hasOwnProperty.call($,"children")}e.hasChildren=P;function U($,W){W===void 0&&(W=!1);var ae;if(O($))ae=new u($.data);else if(j($))ae=new d($.data);else if(E($)){var xe=W?me($.children):[],_e=new S($.name,n({},$.attribs),xe);xe.forEach(function(Y){return Y.parent=_e}),$.namespace!=null&&(_e.namespace=$.namespace),$["x-attribsNamespace"]&&(_e["x-attribsNamespace"]=n({},$["x-attribsNamespace"])),$["x-attribsPrefix"]&&(_e["x-attribsPrefix"]=n({},$["x-attribsPrefix"])),ae=_e}else if(T($)){var xe=W?me($.children):[],Te=new w(xe);xe.forEach(function(ce){return ce.parent=Te}),ae=Te}else if(V($)){var xe=W?me($.children):[],Z=new x(xe);xe.forEach(function(ce){return ce.parent=Z}),$["x-mode"]&&(Z["x-mode"]=$["x-mode"]),ae=Z}else if(z($)){var Q=new p($.name,$.data);$["x-name"]!=null&&(Q["x-name"]=$["x-name"],Q["x-publicId"]=$["x-publicId"],Q["x-systemId"]=$["x-systemId"]),ae=Q}else throw Error(`Not implemented yet: ${$.type}`);return ae.startIndex=$.startIndex,ae.endIndex=$.endIndex,$.sourceCodeLocation!=null&&(ae.sourceCodeLocation=$.sourceCodeLocation),ae}e.cloneNode=U;function me($){for(var W=$.map(function(xe){return U(xe,!0)}),ae=1;ae<W.length;ae++)W[ae].prev=W[ae-1],W[ae-1].next=W[ae];return W}})),np=Pe((e=>{var t=e&&e.__createBinding||(Object.create?(function(d,p,g,w){w===void 0&&(w=g);var x=Object.getOwnPropertyDescriptor(p,g);(!x||("get"in x?!p.__esModule:x.writable||x.configurable))&&(x={enumerable:!0,get:function(){return p[g]}}),Object.defineProperty(d,w,x)}):(function(d,p,g,w){w===void 0&&(w=g),d[w]=p[g]})),n=e&&e.__exportStar||function(d,p){for(var g in d)g!=="default"&&!Object.prototype.hasOwnProperty.call(p,g)&&t(p,d,g)};Object.defineProperty(e,"__esModule",{value:!0}),e.DomHandler=void 0;var i=ep(),o=tp();n(tp(),e);var l={withStartIndices:!1,withEndIndices:!1,xmlMode:!1},u=(function(){function d(p,g,w){this.dom=[],this.root=new o.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null,typeof g=="function"&&(w=g,g=l),typeof p=="object"&&(g=p,p=void 0),this.callback=p??null,this.options=g??l,this.elementCB=w??null}return d.prototype.onparserinit=function(p){this.parser=p},d.prototype.onreset=function(){this.dom=[],this.root=new o.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(p){this.handleCallback(p)},d.prototype.onclosetag=function(){this.lastNode=null;var p=this.tagStack.pop();this.options.withEndIndices&&(p.endIndex=this.parser.endIndex),this.elementCB&&this.elementCB(p)},d.prototype.onopentag=function(p,g){var w=this.options.xmlMode?i.ElementType.Tag:void 0,x=new o.Element(p,g,void 0,w);this.addNode(x),this.tagStack.push(x)},d.prototype.ontext=function(p){var g=this.lastNode;if(g&&g.type===i.ElementType.Text)g.data+=p,this.options.withEndIndices&&(g.endIndex=this.parser.endIndex);else{var w=new o.Text(p);this.addNode(w),this.lastNode=w}},d.prototype.oncomment=function(p){if(this.lastNode&&this.lastNode.type===i.ElementType.Comment){this.lastNode.data+=p;return}var g=new o.Comment(p);this.addNode(g),this.lastNode=g},d.prototype.oncommentend=function(){this.lastNode=null},d.prototype.oncdatastart=function(){var p=new o.Text(""),g=new o.CDATA([p]);this.addNode(g),p.parent=g,this.lastNode=p},d.prototype.oncdataend=function(){this.lastNode=null},d.prototype.onprocessinginstruction=function(p,g){var w=new o.ProcessingInstruction(p,g);this.addNode(w)},d.prototype.handleCallback=function(p){if(typeof this.callback=="function")this.callback(p,this.dom);else if(p)throw p},d.prototype.addNode=function(p){var g=this.tagStack[this.tagStack.length-1],w=g.children[g.children.length-1];this.options.withStartIndices&&(p.startIndex=this.parser.startIndex),this.options.withEndIndices&&(p.endIndex=this.parser.endIndex),g.children.push(p),w&&(p.prev=w,w.next=p),p.parent=g,this.lastNode=null},d})();e.DomHandler=u,e.default=u})),cv=Pe((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,n){return t[n.toLowerCase()]=n,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")})),rp=Pe((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatAttributes=o,e.escapeSpecialCharacters=u,e.revertEscapedCharacters=d,e.formatDOM=p;var t=np(),n=cv();function i(g){return n.CASE_SENSITIVE_TAG_NAMES_MAP[g]}function o(g){for(var w={},x=0,S=g.length;x<S;x++){var E=g[x];w[E.name]=E.value}return w}function l(g){return g=g.toLowerCase(),i(g)||g}function u(g){return g.replace(n.CARRIAGE_RETURN_REGEX,n.CARRIAGE_RETURN_PLACEHOLDER)}function d(g){return g.replace(n.CARRIAGE_RETURN_PLACEHOLDER_REGEX,n.CARRIAGE_RETURN)}function p(g,w,x){w===void 0&&(w=null);for(var S=[],E,T=0,O=g.length;T<O;T++){var j=g[T];switch(j.nodeType){case 1:var z=l(j.nodeName);E=new t.Element(z,o(j.attributes)),E.children=p(z==="template"?j.content.childNodes:j.childNodes,E);break;case 3:E=new t.Text(d(j.nodeValue));break;case 8:E=new t.Comment(j.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}})),uv=Pe((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=j;var t=rp(),n="html",i="head",o="body",l=/<([a-zA-Z]+[0-9]?)/,u=/<head[^]*>/i,d=/<body[^]*>/i,p=function(z,V){throw Error("This browser does not support `document.implementation.createHTMLDocument`")},g=function(z,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";g=function(z,V){return V&&(z=`<${V}>${z}</${V}>`),x.parseFromString(z,S)},p=g}if(typeof document=="object"&&document.implementation){var E=document.implementation.createHTMLDocument();p=function(z,V){if(V){var P=E.documentElement.querySelector(V);return P&&(P.innerHTML=z),E}return E.documentElement.innerHTML=z,E}}var T=typeof document=="object"&&document.createElement("template"),O;T&&T.content&&(O=function(z){return T.innerHTML=z,T.content.childNodes});function j(z){var V,P;z=(0,t.escapeSpecialCharacters)(z);var U=z.match(l),me=U&&U[1]?U[1].toLowerCase():"";switch(me){case n:var $=g(z);if(!u.test(z)){var ae=$.querySelector(i);(V=ae==null?void 0:ae.parentNode)==null||V.removeChild(ae)}if(!d.test(z)){var ae=$.querySelector(o);(P=ae==null?void 0:ae.parentNode)==null||P.removeChild(ae)}return $.querySelectorAll(n);case i:case o:var W=p(z).querySelectorAll(me);return d.test(z)&&u.test(z)?W[0].parentNode.childNodes:W;default:if(O)return O(z);var ae=p(z,o).querySelector(o);return ae.childNodes}}})),dv=Pe((e=>{var t=e&&e.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=l;var n=t(uv()),i=rp(),o=/<(![a-zA-Z\s]+)>/;function l(u){if(typeof u!="string")throw TypeError("First argument must be a string");if(!u)return[];var d=u.match(o),p=d?d[1]:void 0;return(0,i.formatDOM)((0,n.default)(u),null,p)}})),fv=Pe((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}})),pv=Pe((e=>{var t=0,n=1,i=2,o=3,l=4,u=5,d=6;function p(P){return w.hasOwnProperty(P)?w[P]:null}function g(P,U,me,$,W,ae,xe){this.acceptsBooleans=U===i||U===o||U===l,this.attributeName=$,this.attributeNamespace=W,this.mustUseProperty=me,this.propertyName=P,this.type=U,this.sanitizeURL=ae,this.removeEmptyString=xe}var w={};["children","dangerouslySetInnerHTML","defaultValue","defaultChecked","innerHTML","suppressContentEditableWarning","suppressHydrationWarning","style"].forEach(P=>{w[P]=new g(P,t,!1,P,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(([P,U])=>{w[P]=new g(P,n,!1,U,null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(P=>{w[P]=new g(P,i,!1,P.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(P=>{w[P]=new g(P,i,!1,P,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(P=>{w[P]=new g(P,o,!1,P.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(P=>{w[P]=new g(P,o,!0,P,null,!1,!1)}),["capture","download"].forEach(P=>{w[P]=new g(P,l,!1,P,null,!1,!1)}),["cols","rows","size","span"].forEach(P=>{w[P]=new g(P,d,!1,P,null,!1,!1)}),["rowSpan","start"].forEach(P=>{w[P]=new g(P,u,!1,P.toLowerCase(),null,!1,!1)});var x=/[\-\:]([a-z])/g,S=P=>P[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(P=>{let U=P.replace(x,S);w[U]=new g(U,n,!1,P,null,!1,!1)}),["xlink:actuate","xlink:arcrole","xlink:role","xlink:show","xlink:title","xlink:type"].forEach(P=>{let U=P.replace(x,S);w[U]=new g(U,n,!1,P,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(P=>{let U=P.replace(x,S);w[U]=new g(U,n,!1,P,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(P=>{w[P]=new g(P,n,!1,P.toLowerCase(),null,!1,!1)});var E="xlinkHref";w[E]=new g("xlinkHref",n,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(P=>{w[P]=new g(P,n,!1,P.toLowerCase(),null,!0,!0)});var{CAMELCASE:T,SAME:O,possibleStandardNames:j}=fv(),z=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(j).reduce((P,U)=>{let me=j[U];return me===O?P[U]=U:me===T?P[U.toLowerCase()]=U:P[U]=me,P},{});e.BOOLEAN=o,e.BOOLEANISH_STRING=i,e.NUMERIC=u,e.OVERLOADED_BOOLEAN=l,e.POSITIVE_NUMERIC=d,e.RESERVED=t,e.STRING=n,e.getPropertyInfo=p,e.isCustomAttribute=z,e.possibleStandardNames=V})),ip=Pe((e=>{var t=e&&e.__importDefault||function(p){return p&&p.__esModule?p:{default:p}};Object.defineProperty(e,"__esModule",{value:!0}),e.returnFirstArg=e.canTextBeChildOfNode=e.ELEMENTS_WITH_NO_TEXT_CHILDREN=e.PRESERVE_CUSTOM_ATTRIBUTES=void 0,e.isCustomComponent=l,e.setStyleProp=d;var n=Qd(),i=t(l6()),o=new Set(["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"]);function l(p,g){return p.includes("-")?!o.has(p):!!(g&&typeof g.is=="string")}var u={reactCompat:!0};function d(p,g){if(typeof p=="string"){if(!p.trim()){g.style={};return}try{g.style=(0,i.default)(p,u)}catch{g.style={}}}}e.PRESERVE_CUSTOM_ATTRIBUTES=Number(n.version.split(".")[0])>=16,e.ELEMENTS_WITH_NO_TEXT_CHILDREN=new Set(["tr","tbody","thead","tfoot","colgroup","table","head","html","frameset"]),e.canTextBeChildOfNode=function(p){return!e.ELEMENTS_WITH_NO_TEXT_CHILDREN.has(p.name)},e.returnFirstArg=function(p){return p}})),ap=Pe((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=u;var t=pv(),n=ip(),i=["checked","value"],o=["input","select","textarea"],l={reset:!0,submit:!0};function u(p,g){p===void 0&&(p={});var w={},x=!!(p.type&&l[p.type]);for(var S in p){var E=p[S];if((0,t.isCustomAttribute)(S)){w[S]=E;continue}var T=S.toLowerCase(),O=d(T);if(O){var j=(0,t.getPropertyInfo)(O);switch(i.includes(O)&&o.includes(g)&&!x&&(O=d("default"+T)),w[O]=E,j&&j.type){case t.BOOLEAN:w[O]=!0;break;case t.OVERLOADED_BOOLEAN:E===""&&(w[O]=!0);break}continue}n.PRESERVE_CUSTOM_ATTRIBUTES&&(w[S]=E)}return(0,n.setStyleProp)(p.style,w),w}function d(p){return t.possibleStandardNames[p]}})),mv=Pe((e=>{var t=e&&e.__importDefault||function(p){return p&&p.__esModule?p:{default:p}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=u;var n=Qd(),i=t(ap()),o=ip(),l={cloneElement:n.cloneElement,createElement:n.createElement,isValidElement:n.isValidElement};function u(p,g){g===void 0&&(g={});for(var w=[],x=typeof g.replace=="function",S=g.transform||o.returnFirstArg,E=g.library||l,T=E.cloneElement,O=E.createElement,j=E.isValidElement,z=p.length,V=0;V<z;V++){var P=p[V];if(x){var U=g.replace(P,V);if(j(U)){z>1&&(U=T(U,{key:U.key||V})),w.push(S(U,P,V));continue}}if(P.type==="text"){var me=!P.data.trim().length;if(me&&P.parent&&!(0,o.canTextBeChildOfNode)(P.parent)||g.trim&&me)continue;w.push(S(P.data,P,V));continue}var $=P,W={};d($)?((0,o.setStyleProp)($.attribs.style,$.attribs),W=$.attribs):$.attribs&&(W=(0,i.default)($.attribs,$.name));var ae=void 0;switch(P.type){case"script":case"style":P.children[0]&&(W.dangerouslySetInnerHTML={__html:P.children[0].data});break;case"tag":P.name==="textarea"&&P.children[0]?W.defaultValue=P.children[0].data:P.children&&P.children.length&&(ae=u(P.children,g));break;default:continue}z>1&&(W.key=V),w.push(S(O(P.name,W,ae),P,V))}return w.length===1?w[0]:w}function d(p){return o.PRESERVE_CUSTOM_ATTRIBUTES&&p.type==="tag"&&(0,o.isCustomComponent)(p.name,p.attribs)}})),op=Pe((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=u;var n=t(dv());e.htmlToDOM=n.default,e.attributesToProps=t(ap()).default;var i=t(mv());e.domToReact=i.default;var o=np();Object.defineProperty(e,"Comment",{enumerable:!0,get:function(){return o.Comment}}),Object.defineProperty(e,"Element",{enumerable:!0,get:function(){return o.Element}}),Object.defineProperty(e,"ProcessingInstruction",{enumerable:!0,get:function(){return o.ProcessingInstruction}}),Object.defineProperty(e,"Text",{enumerable:!0,get:function(){return o.Text}});var l={lowerCaseAttributeNames:!1};function u(d,p){if(typeof d!="string")throw TypeError("First argument must be a string");return d?(0,i.default)((0,n.default)(d,(p==null?void 0:p.htmlparser2)||l),p):[]}})),sp=Kd(op(),1),Qa=op(),Kg=sp.default.default||sp.default;let Uc;Uc=(e,t)=>{let[n,...i]=t.split("."),o=(e.attribs.class||"").split(" ");return e.tagName===n&&i.every(l=>o.includes(l))},LS=e=>{var t;return e&&Uc(e,"span.nb")&&e.firstChild instanceof Qa.Text&&((t=e.firstChild.nodeValue)==null?void 0:t.includes("__marimo__"))},_0=function(e){var t,n,i;if(e instanceof Qa.Element&&e.firstChild instanceof Qa.Text&&Uc(e,"span.nb")){let o=e.next;if(o&&o instanceof Qa.Text){let l=o.next;if(l&&l instanceof Qa.Element&&l.firstChild instanceof Qa.Text&&Uc(l,"span.m")){let u=Number.parseInt(l.firstChild.nodeValue||"0",10);if((t=e.firstChild.nodeValue)!=null&&t.includes("__marimo__")){let d=(n=/__marimo__cell_(\w+)_/.exec(e.firstChild.nodeValue))==null?void 0:n[1];if(d&&u)return{kind:"cell",cellId:d,lineNumber:u}}else{let d=(i=/"(.+?)"/.exec(e.firstChild.nodeValue))==null?void 0:i[1];if(d&&u)return{kind:"file",filePath:d,lineNumber:u}}}}}return null},g0=function(e){let t=[];return Kg(e,{replace:n=>{let i=_0(n);if(i)return t.push(i),"dummy"}}),t};function hv(e){return t=>{let n=!1;for(let i of t)i&&(n=e(i)||n);return n}}const v3=hv(L5),b3=hv(P5);let Jo,lp,cp,gv,ua,Yo,Kc,yv,up,vv,bv,wv,xv,Qc,_v,to,dp,Gc,kv,fp,Cv,Xc,Gr,tn,Jc,Sv,pp,Ev,Tv,Dv,Rv,mp,Iv,Av,Lv,Yc,Zo,Ti,es,On,da,Zc,cl,ul,dl,hp,fl,gp,Pv,Ov,Mv,eu,Nv,yp,pl,jv,qv,zv,Fv,$v,Vv,Hv,Bv,tu,Wv,Uv,Kv,Qv,Gv,Xv,Jv,Yv,Zv,e1,t1,nu,n1,r1,i1,a1,o1,s1,l1,c1,u1,d1,f1,p1,m1,vp,bp,h1,g1,y1,v1,b1,w1,x1,_1,k1,C1,S1,ne,ru,Ut,iu,E1,T1,D1,R1,I1,A1,L1,P1,O1,M1,N1,j1,q1,z1,F1,$1,V1,H1,B1,W1,U1,K1,Q1,G1;Jo=Pe((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.stringArray=e.array=e.func=e.error=e.number=e.string=e.boolean=void 0;function t(p){return p===!0||p===!1}e.boolean=t;function n(p){return typeof p=="string"||p instanceof String}e.string=n;function i(p){return typeof p=="number"||p instanceof Number}e.number=i;function o(p){return p instanceof Error}e.error=o;function l(p){return typeof p=="function"}e.func=l;function u(p){return Array.isArray(p)}e.array=u;function d(p){return u(p)&&p.every(g=>n(g))}e.stringArray=d})),lp=Pe((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Message=e.NotificationType9=e.NotificationType8=e.NotificationType7=e.NotificationType6=e.NotificationType5=e.NotificationType4=e.NotificationType3=e.NotificationType2=e.NotificationType1=e.NotificationType0=e.NotificationType=e.RequestType9=e.RequestType8=e.RequestType7=e.RequestType6=e.RequestType5=e.RequestType4=e.RequestType3=e.RequestType2=e.RequestType1=e.RequestType=e.RequestType0=e.AbstractMessageSignature=e.ParameterStructures=e.ResponseError=e.ErrorCodes=void 0;var t=Jo(),n;(function(u){u.ParseError=-32700,u.InvalidRequest=-32600,u.MethodNotFound=-32601,u.InvalidParams=-32602,u.InternalError=-32603,u.jsonrpcReservedErrorRangeStart=-32099,u.serverErrorStart=-32099,u.MessageWriteError=-32099,u.MessageReadError=-32098,u.PendingResponseRejected=-32097,u.ConnectionInactive=-32096,u.ServerNotInitialized=-32002,u.UnknownErrorCode=-32001,u.jsonrpcReservedErrorRangeEnd=-32e3,u.serverErrorEnd=-32e3})(n||(e.ErrorCodes=n={})),e.ResponseError=class ET extends Error{constructor(d,p,g){super(p),this.code=t.number(d)?d:n.UnknownErrorCode,this.data=g,Object.setPrototypeOf(this,ET.prototype)}toJson(){let d={code:this.code,message:this.message};return this.data!==void 0&&(d.data=this.data),d}};var i=class zf{constructor(d){this.kind=d}static is(d){return d===zf.auto||d===zf.byName||d===zf.byPosition}toString(){return this.kind}};e.ParameterStructures=i,i.auto=new i("auto"),i.byPosition=new i("byPosition"),i.byName=new i("byName");var o=class{constructor(u,d){this.method=u,this.numberOfParams=d}get parameterStructures(){return i.auto}};e.AbstractMessageSignature=o,e.RequestType0=class extends o{constructor(u){super(u,0)}},e.RequestType=class extends o{constructor(u,d=i.auto){super(u,1),this._parameterStructures=d}get parameterStructures(){return this._parameterStructures}},e.RequestType1=class extends o{constructor(u,d=i.auto){super(u,1),this._parameterStructures=d}get parameterStructures(){return this._parameterStructures}},e.RequestType2=class extends o{constructor(u){super(u,2)}},e.RequestType3=class extends o{constructor(u){super(u,3)}},e.RequestType4=class extends o{constructor(u){super(u,4)}},e.RequestType5=class extends o{constructor(u){super(u,5)}},e.RequestType6=class extends o{constructor(u){super(u,6)}},e.RequestType7=class extends o{constructor(u){super(u,7)}},e.RequestType8=class extends o{constructor(u){super(u,8)}},e.RequestType9=class extends o{constructor(u){super(u,9)}},e.NotificationType=class extends o{constructor(u,d=i.auto){super(u,1),this._parameterStructures=d}get parameterStructures(){return this._parameterStructures}},e.NotificationType0=class extends o{constructor(u){super(u,0)}},e.NotificationType1=class extends o{constructor(u,d=i.auto){super(u,1),this._parameterStructures=d}get parameterStructures(){return this._parameterStructures}},e.NotificationType2=class extends o{constructor(u){super(u,2)}},e.NotificationType3=class extends o{constructor(u){super(u,3)}},e.NotificationType4=class extends o{constructor(u){super(u,4)}},e.NotificationType5=class extends o{constructor(u){super(u,5)}},e.NotificationType6=class extends o{constructor(u){super(u,6)}},e.NotificationType7=class extends o{constructor(u){super(u,7)}},e.NotificationType8=class extends o{constructor(u){super(u,8)}},e.NotificationType9=class extends o{constructor(u){super(u,9)}};var l;(function(u){function d(w){let x=w;return x&&t.string(x.method)&&(t.string(x.id)||t.number(x.id))}u.isRequest=d;function p(w){let x=w;return x&&t.string(x.method)&&w.id===void 0}u.isNotification=p;function g(w){let x=w;return x&&(x.result!==void 0||!!x.error)&&(t.string(x.id)||t.number(x.id)||x.id===null)}u.isResponse=g})(l||(e.Message=l={}))})),cp=Pe((e=>{var t;Object.defineProperty(e,"__esModule",{value:!0}),e.LRUCache=e.LinkedMap=e.Touch=void 0;var n;(function(o){o.None=0,o.First=1,o.AsOld=o.First,o.Last=2,o.AsNew=o.Last})(n||(e.Touch=n={}));var i=class{constructor(){this[t]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){var o;return(o=this._head)==null?void 0:o.value}get last(){var o;return(o=this._tail)==null?void 0:o.value}has(o){return this._map.has(o)}get(o,l=n.None){let u=this._map.get(o);if(u)return l!==n.None&&this.touch(u,l),u.value}set(o,l,u=n.None){let d=this._map.get(o);if(d)d.value=l,u!==n.None&&this.touch(d,u);else{switch(d={key:o,value:l,next:void 0,previous:void 0},u){case n.None:this.addItemLast(d);break;case n.First:this.addItemFirst(d);break;case n.Last:this.addItemLast(d);break;default:this.addItemLast(d);break}this._map.set(o,d),this._size++}return this}delete(o){return!!this.remove(o)}remove(o){let l=this._map.get(o);if(l)return this._map.delete(o),this.removeItem(l),this._size--,l.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw Error("Invalid list");let o=this._head;return this._map.delete(o.key),this.removeItem(o),this._size--,o.value}forEach(o,l){let u=this._state,d=this._head;for(;d;){if(l?o.bind(l)(d.value,d.key,this):o(d.value,d.key,this),this._state!==u)throw Error("LinkedMap got modified during iteration.");d=d.next}}keys(){let o=this._state,l=this._head,u={[Symbol.iterator]:()=>u,next:()=>{if(this._state!==o)throw Error("LinkedMap got modified during iteration.");if(l){let d={value:l.key,done:!1};return l=l.next,d}else return{value:void 0,done:!0}}};return u}values(){let o=this._state,l=this._head,u={[Symbol.iterator]:()=>u,next:()=>{if(this._state!==o)throw Error("LinkedMap got modified during iteration.");if(l){let d={value:l.value,done:!1};return l=l.next,d}else return{value:void 0,done:!0}}};return u}entries(){let o=this._state,l=this._head,u={[Symbol.iterator]:()=>u,next:()=>{if(this._state!==o)throw Error("LinkedMap got modified during iteration.");if(l){let d={value:[l.key,l.value],done:!1};return l=l.next,d}else return{value:void 0,done:!0}}};return u}[(t=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(o){if(o>=this.size)return;if(o===0){this.clear();return}let l=this._head,u=this.size;for(;l&&u>o;)this._map.delete(l.key),l=l.next,u--;this._head=l,this._size=u,l&&(l.previous=void 0),this._state++}addItemFirst(o){if(!this._head&&!this._tail)this._tail=o;else if(this._head)o.next=this._head,this._head.previous=o;else throw Error("Invalid list");this._head=o,this._state++}addItemLast(o){if(!this._head&&!this._tail)this._head=o;else if(this._tail)o.previous=this._tail,this._tail.next=o;else throw Error("Invalid list");this._tail=o,this._state++}removeItem(o){if(o===this._head&&o===this._tail)this._head=void 0,this._tail=void 0;else if(o===this._head){if(!o.next)throw Error("Invalid list");o.next.previous=void 0,this._head=o.next}else if(o===this._tail){if(!o.previous)throw Error("Invalid list");o.previous.next=void 0,this._tail=o.previous}else{let l=o.next,u=o.previous;if(!l||!u)throw Error("Invalid list");l.previous=u,u.next=l}o.next=void 0,o.previous=void 0,this._state++}touch(o,l){if(!this._head||!this._tail)throw Error("Invalid list");if(!(l!==n.First&&l!==n.Last)){if(l===n.First){if(o===this._head)return;let u=o.next,d=o.previous;o===this._tail?(d.next=void 0,this._tail=d):(u.previous=d,d.next=u),o.previous=void 0,o.next=this._head,this._head.previous=o,this._head=o,this._state++}else if(l===n.Last){if(o===this._tail)return;let u=o.next,d=o.previous;o===this._head?(u.previous=void 0,this._head=u):(u.previous=d,d.next=u),o.next=void 0,o.previous=this._tail,this._tail.next=o,this._tail=o,this._state++}}}toJSON(){let o=[];return this.forEach((l,u)=>{o.push([u,l])}),o}fromJSON(o){this.clear();for(let[l,u]of o)this.set(l,u)}};e.LinkedMap=i,e.LRUCache=class extends i{constructor(o,l=1){super(),this._limit=o,this._ratio=Math.min(Math.max(0,l),1)}get limit(){return this._limit}set limit(o){this._limit=o,this.checkTrim()}get ratio(){return this._ratio}set ratio(o){this._ratio=Math.min(Math.max(0,o),1),this.checkTrim()}get(o,l=n.AsNew){return super.get(o,l)}peek(o){return super.get(o,n.None)}set(o,l){return super.set(o,l,n.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}}})),gv=Pe((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Disposable=void 0;var t;(function(n){function i(o){return{dispose:o}}n.create=i})(t||(e.Disposable=t={}))})),ua=Pe((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t;function n(){if(t===void 0)throw Error("No runtime abstraction layer installed");return t}(function(i){function o(l){if(l===void 0)throw Error("No runtime abstraction layer provided");t=l}i.install=o})(n||(n={})),e.default=n})),Yo=Pe((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Emitter=e.Event=void 0;var t=ua(),n;(function(l){let u={dispose(){}};l.None=function(){return u}})(n||(e.Event=n={}));var i=class{add(l,u=null,d){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(l),this._contexts.push(u),Array.isArray(d)&&d.push({dispose:()=>this.remove(l,u)})}remove(l,u=null){if(!this._callbacks)return;let d=!1;for(let p=0,g=this._callbacks.length;p<g;p++)if(this._callbacks[p]===l)if(this._contexts[p]===u){this._callbacks.splice(p,1),this._contexts.splice(p,1);return}else d=!0;if(d)throw Error("When adding a listener with a context, you should remove it with the same context")}invoke(...l){if(!this._callbacks)return[];let u=[],d=this._callbacks.slice(0),p=this._contexts.slice(0);for(let g=0,w=d.length;g<w;g++)try{u.push(d[g].apply(p[g],l))}catch(x){(0,t.default)().console.error(x)}return u}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},o=class TT{constructor(u){this._options=u}get event(){return this._event||(this._event=(u,d,p)=>{this._callbacks||(this._callbacks=new i),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(u,d);let g={dispose:()=>{this._callbacks&&(this._callbacks.remove(u,d),g.dispose=TT._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(p)&&p.push(g),g}),this._event}fire(u){this._callbacks&&this._callbacks.invoke.call(this._callbacks,u)}dispose(){this._callbacks&&(this._callbacks=(this._callbacks.dispose(),void 0))}};e.Emitter=o,o._noop=function(){}})),Kc=Pe((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CancellationTokenSource=e.CancellationToken=void 0;var t=ua(),n=Jo(),i=Yo(),o;(function(d){d.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:i.Event.None}),d.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:i.Event.None});function p(g){let w=g;return w&&(w===d.None||w===d.Cancelled||n.boolean(w.isCancellationRequested)&&!!w.onCancellationRequested)}d.is=p})(o||(e.CancellationToken=o={}));var l=Object.freeze(function(d,p){let g=(0,t.default)().timer.setTimeout(d.bind(p),0);return{dispose(){g.dispose()}}}),u=class{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?l:(this._emitter||(this._emitter=new i.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter=(this._emitter.dispose(),void 0))}};e.CancellationTokenSource=class{get token(){return this._token||(this._token=new u),this._token}cancel(){this._token?this._token.cancel():this._token=o.Cancelled}dispose(){this._token?this._token instanceof u&&this._token.dispose():this._token=o.None}}})),yv=Pe((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SharedArrayReceiverStrategy=e.SharedArraySenderStrategy=void 0;var t=Kc(),n;(function(l){l.Continue=0,l.Cancelled=1})(n||(n={})),e.SharedArraySenderStrategy=class{constructor(){this.buffers=new Map}enableCancellation(l){if(l.id===null)return;let u=new SharedArrayBuffer(4),d=new Int32Array(u,0,1);d[0]=n.Continue,this.buffers.set(l.id,u),l.$cancellationData=u}async sendCancellation(l,u){let d=this.buffers.get(u);if(d===void 0)return;let p=new Int32Array(d,0,1);Atomics.store(p,0,n.Cancelled)}cleanup(l){this.buffers.delete(l)}dispose(){this.buffers.clear()}};var i=class{constructor(l){this.data=new Int32Array(l,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===n.Cancelled}get onCancellationRequested(){throw Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},o=class{constructor(l){this.token=new i(l)}cancel(){}dispose(){}};e.SharedArrayReceiverStrategy=class{constructor(){this.kind="request"}createCancellationTokenSource(l){let u=l.$cancellationData;return u===void 0?new t.CancellationTokenSource:new o(u)}}})),up=Pe((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Semaphore=void 0;var t=ua();e.Semaphore=class{constructor(n=1){if(n<=0)throw Error("Capacity must be greater than 0");this._capacity=n,this._active=0,this._waiting=[]}lock(n){return new Promise((i,o)=>{this._waiting.push({thunk:n,resolve:i,reject:o}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,t.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;let n=this._waiting.shift();if(this._active++,this._active>this._capacity)throw Error("To many thunks active");try{let i=n.thunk();i instanceof Promise?i.then(o=>{this._active--,n.resolve(o),this.runNext()},o=>{this._active--,n.reject(o),this.runNext()}):(this._active--,n.resolve(i),this.runNext())}catch(i){this._active--,n.reject(i),this.runNext()}}}})),vv=Pe((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ReadableStreamMessageReader=e.AbstractMessageReader=e.MessageReader=void 0;var t=ua(),n=Jo(),i=Yo(),o=up(),l;(function(p){function g(w){let x=w;return x&&n.func(x.listen)&&n.func(x.dispose)&&n.func(x.onError)&&n.func(x.onClose)&&n.func(x.onPartialMessage)}p.is=g})(l||(e.MessageReader=l={}));var u=class{constructor(){this.errorEmitter=new i.Emitter,this.closeEmitter=new i.Emitter,this.partialMessageEmitter=new i.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(p){this.errorEmitter.fire(this.asError(p))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(p){this.partialMessageEmitter.fire(p)}asError(p){return p instanceof Error?p:Error(`Reader received error. Reason: ${n.string(p.message)?p.message:"unknown"}`)}};e.AbstractMessageReader=u;var d;(function(p){function g(w){let x,S,E=new Map,T,O=new Map;if(w===void 0||typeof w=="string")x=w??"utf-8";else{if(x=w.charset??"utf-8",w.contentDecoder!==void 0&&(S=w.contentDecoder,E.set(S.name,S)),w.contentDecoders!==void 0)for(let j of w.contentDecoders)E.set(j.name,j);if(w.contentTypeDecoder!==void 0&&(T=w.contentTypeDecoder,O.set(T.name,T)),w.contentTypeDecoders!==void 0)for(let j of w.contentTypeDecoders)O.set(j.name,j)}return T===void 0&&(T=(0,t.default)().applicationJson.decoder,O.set(T.name,T)),{charset:x,contentDecoder:S,contentDecoders:E,contentTypeDecoder:T,contentTypeDecoders:O}}p.fromOptions=g})(d||(d={})),e.ReadableStreamMessageReader=class extends u{constructor(p,g){super(),this.readable=p,this.options=d.fromOptions(g),this.buffer=(0,t.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new o.Semaphore(1)}set partialMessageTimeout(p){this._partialMessageTimeout=p}get partialMessageTimeout(){return this._partialMessageTimeout}listen(p){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=p;let g=this.readable.onData(w=>{this.onData(w)});return this.readable.onError(w=>this.fireError(w)),this.readable.onClose(()=>this.fireClose()),g}onData(p){try{for(this.buffer.append(p);;){if(this.nextMessageLength===-1){let w=this.buffer.tryReadHeaders(!0);if(!w)return;let x=w.get("content-length");if(!x){this.fireError(Error(`Header must provide a Content-Length property.
|
|
14
|
+
${JSON.stringify(Object.fromEntries(w))}`));return}let S=parseInt(x);if(isNaN(S)){this.fireError(Error(`Content-Length value must be a number. Got ${x}`));return}this.nextMessageLength=S}let g=this.buffer.tryReadBody(this.nextMessageLength);if(g===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{let w=this.options.contentDecoder===void 0?g:await this.options.contentDecoder.decode(g),x=await this.options.contentTypeDecoder.decode(w,this.options);this.callback(x)}).catch(w=>{this.fireError(w)})}}catch(g){this.fireError(g)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer=(this.partialMessageTimer.dispose(),void 0))}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,t.default)().timer.setTimeout((p,g)=>{this.partialMessageTimer=void 0,p===this.messageToken&&(this.firePartialMessage({messageToken:p,waitingTime:g}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}}})),bv=Pe((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.WriteableStreamMessageWriter=e.AbstractMessageWriter=e.MessageWriter=void 0;var t=ua(),n=Jo(),i=up(),o=Yo(),l="Content-Length: ",u=`\r
|
|
15
15
|
`,d;(function(w){function x(S){let E=S;return E&&n.func(E.dispose)&&n.func(E.onClose)&&n.func(E.onError)&&n.func(E.write)}w.is=x})(d||(e.MessageWriter=d={}));var p=class{constructor(){this.errorEmitter=new o.Emitter,this.closeEmitter=new o.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(w,x,S){this.errorEmitter.fire([this.asError(w),x,S])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(w){return w instanceof Error?w:Error(`Writer received error. Reason: ${n.string(w.message)?w.message:"unknown"}`)}};e.AbstractMessageWriter=p;var g;(function(w){function x(S){return S===void 0||typeof S=="string"?{charset:S??"utf-8",contentTypeEncoder:(0,t.default)().applicationJson.encoder}:{charset:S.charset??"utf-8",contentEncoder:S.contentEncoder,contentTypeEncoder:S.contentTypeEncoder??(0,t.default)().applicationJson.encoder}}w.fromOptions=x})(g||(g={})),e.WriteableStreamMessageWriter=class extends p{constructor(w,x){super(),this.writable=w,this.options=g.fromOptions(x),this.errorCount=0,this.writeSemaphore=new i.Semaphore(1),this.writable.onError(S=>this.fireError(S)),this.writable.onClose(()=>this.fireClose())}async write(w){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(w,this.options).then(x=>this.options.contentEncoder===void 0?x:this.options.contentEncoder.encode(x)).then(x=>{let S=[];return S.push(l,x.byteLength.toString(),u),S.push(u),this.doWrite(w,S,x)},x=>{throw this.fireError(x),x}))}async doWrite(w,x,S){try{return await this.writable.write(x.join(""),"ascii"),this.writable.write(S)}catch(E){return this.handleError(E,w),Promise.reject(E)}}handleError(w,x){this.errorCount++,this.fireError(w,x,this.errorCount)}end(){this.writable.end()}}})),wv=Pe((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractMessageBuffer=void 0;var t=13,n=10,i=`\r
|
|
16
16
|
`;e.AbstractMessageBuffer=class{constructor(o="utf-8"){this._encoding=o,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(o){let l=typeof o=="string"?this.fromString(o,this._encoding):o;this._chunks.push(l),this._totalLength+=l.byteLength}tryReadHeaders(o=!1){if(this._chunks.length===0)return;let l=0,u=0,d=0,p=0;e:for(;u<this._chunks.length;){let S=this._chunks[u];for(d=0;d<S.length;){switch(S[d]){case t:switch(l){case 0:l=1;break;case 2:l=3;break;default:l=0}break;case n:switch(l){case 1:l=2;break;case 3:l=4,d++;break e;default:l=0}break;default:l=0}d++}p+=S.byteLength,u++}if(l!==4)return;let g=this._read(p+d),w=new Map,x=this.toString(g,"ascii").split(i);if(x.length<2)return w;for(let S=0;S<x.length-2;S++){let E=x[S],T=E.indexOf(":");if(T===-1)throw Error(`Message header must separate key and value using ':'
|
|
17
|
-
${E}`);let O=E.substr(0,T),j=E.substr(T+1).trim();w.set(o?O.toLowerCase():O,j)}return w}tryReadBody(o){if(!(this._totalLength<o))return this._read(o)}get numberOfBytes(){return this._totalLength}_read(o){if(o===0)return this.emptyBuffer();if(o>this._totalLength)throw Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===o){let d=this._chunks[0];return this._chunks.shift(),this._totalLength-=o,this.asNative(d)}if(this._chunks[0].byteLength>o){let d=this._chunks[0],p=this.asNative(d,o);return this._chunks[0]=d.slice(o),this._totalLength-=o,p}let l=this.allocNative(o),u=0;for(;o>0;){let d=this._chunks[0];if(d.byteLength>o){let p=d.slice(0,o);l.set(p,u),u+=o,this._chunks[0]=d.slice(o),this._totalLength-=o,o-=o}else l.set(d,u),u+=d.byteLength,this._chunks.shift(),this._totalLength-=d.byteLength,o-=d.byteLength}return l}}})),xv=Pe((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createMessageConnection=e.ConnectionOptions=e.MessageStrategy=e.CancellationStrategy=e.CancellationSenderStrategy=e.CancellationReceiverStrategy=e.RequestCancellationReceiverStrategy=e.IdCancellationReceiverStrategy=e.ConnectionStrategy=e.ConnectionError=e.ConnectionErrors=e.LogTraceNotification=e.SetTraceNotification=e.TraceFormat=e.TraceValues=e.Trace=e.NullLogger=e.ProgressType=e.ProgressToken=void 0;var t=
|
|
17
|
+
${E}`);let O=E.substr(0,T),j=E.substr(T+1).trim();w.set(o?O.toLowerCase():O,j)}return w}tryReadBody(o){if(!(this._totalLength<o))return this._read(o)}get numberOfBytes(){return this._totalLength}_read(o){if(o===0)return this.emptyBuffer();if(o>this._totalLength)throw Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===o){let d=this._chunks[0];return this._chunks.shift(),this._totalLength-=o,this.asNative(d)}if(this._chunks[0].byteLength>o){let d=this._chunks[0],p=this.asNative(d,o);return this._chunks[0]=d.slice(o),this._totalLength-=o,p}let l=this.allocNative(o),u=0;for(;o>0;){let d=this._chunks[0];if(d.byteLength>o){let p=d.slice(0,o);l.set(p,u),u+=o,this._chunks[0]=d.slice(o),this._totalLength-=o,o-=o}else l.set(d,u),u+=d.byteLength,this._chunks.shift(),this._totalLength-=d.byteLength,o-=d.byteLength}return l}}})),xv=Pe((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createMessageConnection=e.ConnectionOptions=e.MessageStrategy=e.CancellationStrategy=e.CancellationSenderStrategy=e.CancellationReceiverStrategy=e.RequestCancellationReceiverStrategy=e.IdCancellationReceiverStrategy=e.ConnectionStrategy=e.ConnectionError=e.ConnectionErrors=e.LogTraceNotification=e.SetTraceNotification=e.TraceFormat=e.TraceValues=e.Trace=e.NullLogger=e.ProgressType=e.ProgressToken=void 0;var t=ua(),n=Jo(),i=lp(),o=cp(),l=Yo(),u=Kc(),d;(function(Z){Z.type=new i.NotificationType("$/cancelRequest")})(d||(d={}));var p;(function(Z){function Q(Y){return typeof Y=="string"||typeof Y=="number"}Z.is=Q})(p||(e.ProgressToken=p={}));var g;(function(Z){Z.type=new i.NotificationType("$/progress")})(g||(g={})),e.ProgressType=class{constructor(){}};var w;(function(Z){function Q(Y){return n.func(Y)}Z.is=Q})(w||(w={})),e.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var x;(function(Z){Z[Z.Off=0]="Off",Z[Z.Messages=1]="Messages",Z[Z.Compact=2]="Compact",Z[Z.Verbose=3]="Verbose"})(x||(e.Trace=x={}));var S;(function(Z){Z.Off="off",Z.Messages="messages",Z.Compact="compact",Z.Verbose="verbose"})(S||(e.TraceValues=S={})),(function(Z){function Q(ce){if(!n.string(ce))return Z.Off;switch(ce=ce.toLowerCase(),ce){case"off":return Z.Off;case"messages":return Z.Messages;case"compact":return Z.Compact;case"verbose":return Z.Verbose;default:return Z.Off}}Z.fromString=Q;function Y(ce){switch(ce){case Z.Off:return"off";case Z.Messages:return"messages";case Z.Compact:return"compact";case Z.Verbose:return"verbose";default:return"off"}}Z.toString=Y})(x||(e.Trace=x={}));var E;(function(Z){Z.Text="text",Z.JSON="json"})(E||(e.TraceFormat=E={})),(function(Z){function Q(Y){return n.string(Y)?(Y=Y.toLowerCase(),Y==="json"?Z.JSON:Z.Text):Z.Text}Z.fromString=Q})(E||(e.TraceFormat=E={}));var T;(function(Z){Z.type=new i.NotificationType("$/setTrace")})(T||(e.SetTraceNotification=T={}));var O;(function(Z){Z.type=new i.NotificationType("$/logTrace")})(O||(e.LogTraceNotification=O={}));var j;(function(Z){Z[Z.Closed=1]="Closed",Z[Z.Disposed=2]="Disposed",Z[Z.AlreadyListening=3]="AlreadyListening"})(j||(e.ConnectionErrors=j={}));var z=class DT extends Error{constructor(Q,Y){super(Y),this.code=Q,Object.setPrototypeOf(this,DT.prototype)}};e.ConnectionError=z;var V;(function(Z){function Q(Y){let ce=Y;return ce&&n.func(ce.cancelUndispatched)}Z.is=Q})(V||(e.ConnectionStrategy=V={}));var P;(function(Z){function Q(Y){let ce=Y;return ce&&(ce.kind===void 0||ce.kind==="id")&&n.func(ce.createCancellationTokenSource)&&(ce.dispose===void 0||n.func(ce.dispose))}Z.is=Q})(P||(e.IdCancellationReceiverStrategy=P={}));var U;(function(Z){function Q(Y){let ce=Y;return ce&&ce.kind==="request"&&n.func(ce.createCancellationTokenSource)&&(ce.dispose===void 0||n.func(ce.dispose))}Z.is=Q})(U||(e.RequestCancellationReceiverStrategy=U={}));var me;(function(Z){Z.Message=Object.freeze({createCancellationTokenSource(Y){return new u.CancellationTokenSource}});function Q(Y){return P.is(Y)||U.is(Y)}Z.is=Q})(me||(e.CancellationReceiverStrategy=me={}));var $;(function(Z){Z.Message=Object.freeze({sendCancellation(Y,ce){return Y.sendNotification(d.type,{id:ce})},cleanup(Y){}});function Q(Y){let ce=Y;return ce&&n.func(ce.sendCancellation)&&n.func(ce.cleanup)}Z.is=Q})($||(e.CancellationSenderStrategy=$={}));var W;(function(Z){Z.Message=Object.freeze({receiver:me.Message,sender:$.Message});function Q(Y){let ce=Y;return ce&&me.is(ce.receiver)&&$.is(ce.sender)}Z.is=Q})(W||(e.CancellationStrategy=W={}));var ae;(function(Z){function Q(Y){let ce=Y;return ce&&n.func(ce.handleMessage)}Z.is=Q})(ae||(e.MessageStrategy=ae={}));var xe;(function(Z){function Q(Y){let ce=Y;return ce&&(W.is(ce.cancellationStrategy)||V.is(ce.connectionStrategy)||ae.is(ce.messageStrategy))}Z.is=Q})(xe||(e.ConnectionOptions=xe={}));var _e;(function(Z){Z[Z.New=1]="New",Z[Z.Listening=2]="Listening",Z[Z.Closed=3]="Closed",Z[Z.Disposed=4]="Disposed"})(_e||(_e={}));function Te(Z,Q,Y,ce){let te=Y===void 0?e.NullLogger:Y,he=0,G=0,je=0,qe,Qe=new Map,He,Fe=new Map,Oe=new Map,Be,gt=new o.LinkedMap,bt=new Map,Mn=new Set,gn=new Map,Xe=x.Off,cn=E.Text,Ct,kn=_e.New,Lr=new l.Emitter,yt=new l.Emitter,Yr=new l.Emitter,un=new l.Emitter,Ri=new l.Emitter,Nn=ce&&ce.cancellationStrategy?ce.cancellationStrategy:W.Message;function Pr(q){if(q===null)throw Error("Can't send requests with id null since the response can't be correlated.");return"req-"+q.toString()}function jn(q){return q===null?"res-unknown-"+(++je).toString():"res-"+q.toString()}function yn(){return"not-"+(++G).toString()}function xa(q,re){i.Message.isRequest(re)?q.set(Pr(re.id),re):i.Message.isResponse(re)?q.set(jn(re.id),re):q.set(yn(),re)}function Ii(q){}function Yt(){return kn===_e.Listening}function Ai(){return kn===_e.Closed}function vn(){return kn===_e.Disposed}function hi(){(kn===_e.New||kn===_e.Listening)&&(kn=_e.Closed,yt.fire(void 0))}function Vt(q){Lr.fire([q,void 0,void 0])}function Zr(q){Lr.fire(q)}Z.onClose(hi),Z.onError(Vt),Q.onClose(hi),Q.onError(Zr);function St(){Be||gt.size===0||(Be=(0,t.default)().timer.setImmediate(()=>{Be=void 0,_a()}))}function Li(q){i.Message.isRequest(q)?rn(q):i.Message.isNotification(q)?wt(q):i.Message.isResponse(q)?et(q):Et(q)}function _a(){if(gt.size===0)return;let q=gt.shift();try{let re=ce==null?void 0:ce.messageStrategy;ae.is(re)?re.handleMessage(q,Li):Li(q)}finally{St()}}let Or=q=>{try{if(i.Message.isNotification(q)&&q.method===d.type.method){let re=q.params.id,we=Pr(re),De=gt.get(we);if(i.Message.isRequest(De)){let Ke=ce==null?void 0:ce.connectionStrategy,ut=Ke&&Ke.cancelUndispatched?Ke.cancelUndispatched(De,Ii):void 0;if(ut&&(ut.error!==void 0||ut.result!==void 0)){gt.delete(we),gn.delete(re),ut.id=De.id,Dt(ut,q.method,Date.now()),Q.write(ut).catch(()=>te.error("Sending response for canceled message failed."));return}}let Ue=gn.get(re);if(Ue!==void 0){Ue.cancel(),qn(q);return}else Mn.add(re)}xa(gt,q)}finally{St()}};function rn(q){if(vn())return;function re(it,jt,st){let mt={jsonrpc:"2.0",id:q.id};it instanceof i.ResponseError?mt.error=it.toJson():mt.result=it===void 0?null:it,Dt(mt,jt,st),Q.write(mt).catch(()=>te.error("Sending response failed."))}function we(it,jt,st){let mt={jsonrpc:"2.0",id:q.id,error:it.toJson()};Dt(mt,jt,st),Q.write(mt).catch(()=>te.error("Sending response failed."))}function De(it,jt,st){it===void 0&&(it=null);let mt={jsonrpc:"2.0",id:q.id,result:it};Dt(mt,jt,st),Q.write(mt).catch(()=>te.error("Sending response failed."))}fr(q);let Ue=Qe.get(q.method),Ke,ut;Ue&&(Ke=Ue.type,ut=Ue.handler);let Nt=Date.now();if(ut||qe){let it=q.id??String(Date.now()),jt=P.is(Nn.receiver)?Nn.receiver.createCancellationTokenSource(it):Nn.receiver.createCancellationTokenSource(q);q.id!==null&&Mn.has(q.id)&&jt.cancel(),q.id!==null&&gn.set(it,jt);try{let st;if(ut)if(q.params===void 0){if(Ke!==void 0&&Ke.numberOfParams!==0){we(new i.ResponseError(i.ErrorCodes.InvalidParams,`Request ${q.method} defines ${Ke.numberOfParams} params but received none.`),q.method,Nt);return}st=ut(jt.token)}else if(Array.isArray(q.params)){if(Ke!==void 0&&Ke.parameterStructures===i.ParameterStructures.byName){we(new i.ResponseError(i.ErrorCodes.InvalidParams,`Request ${q.method} defines parameters by name but received parameters by position`),q.method,Nt);return}st=ut(...q.params,jt.token)}else{if(Ke!==void 0&&Ke.parameterStructures===i.ParameterStructures.byPosition){we(new i.ResponseError(i.ErrorCodes.InvalidParams,`Request ${q.method} defines parameters by position but received parameters by name`),q.method,Nt);return}st=ut(q.params,jt.token)}else qe&&(st=qe(q.method,q.params,jt.token));let mt=st;st?mt.then?mt.then(Sn=>{gn.delete(it),re(Sn,q.method,Nt)},Sn=>{gn.delete(it),Sn instanceof i.ResponseError?we(Sn,q.method,Nt):Sn&&n.string(Sn.message)?we(new i.ResponseError(i.ErrorCodes.InternalError,`Request ${q.method} failed with message: ${Sn.message}`),q.method,Nt):we(new i.ResponseError(i.ErrorCodes.InternalError,`Request ${q.method} failed unexpectedly without providing any details.`),q.method,Nt)}):(gn.delete(it),re(st,q.method,Nt)):(gn.delete(it),De(st,q.method,Nt))}catch(st){gn.delete(it),st instanceof i.ResponseError?re(st,q.method,Nt):st&&n.string(st.message)?we(new i.ResponseError(i.ErrorCodes.InternalError,`Request ${q.method} failed with message: ${st.message}`),q.method,Nt):we(new i.ResponseError(i.ErrorCodes.InternalError,`Request ${q.method} failed unexpectedly without providing any details.`),q.method,Nt)}}else we(new i.ResponseError(i.ErrorCodes.MethodNotFound,`Unhandled method ${q.method}`),q.method,Nt)}function et(q){if(!vn())if(q.id===null)q.error?te.error(`Received response message without id: Error is:
|
|
18
18
|
${JSON.stringify(q.error,void 0,4)}`):te.error("Received response message without id. No further error information provided.");else{let re=q.id,we=bt.get(re);if(ei(q,we),we!==void 0){bt.delete(re);try{if(q.error){let De=q.error;we.reject(new i.ResponseError(De.code,De.message,De.data))}else if(q.result!==void 0)we.resolve(q.result);else throw Error("Should never happen.")}catch(De){De.message?te.error(`Response handler '${we.method}' failed with message: ${De.message}`):te.error(`Response handler '${we.method}' failed unexpectedly.`)}}}}function wt(q){if(vn())return;let re,we;if(q.method===d.type.method){let De=q.params.id;Mn.delete(De),qn(q);return}else{let De=Fe.get(q.method);De&&(we=De.handler,re=De.type)}if(we||He)try{if(qn(q),we)if(q.params===void 0)re!==void 0&&re.numberOfParams!==0&&re.parameterStructures!==i.ParameterStructures.byName&&te.error(`Notification ${q.method} defines ${re.numberOfParams} params but received none.`),we();else if(Array.isArray(q.params)){let De=q.params;q.method===g.type.method&&De.length===2&&p.is(De[0])?we({token:De[0],value:De[1]}):(re!==void 0&&(re.parameterStructures===i.ParameterStructures.byName&&te.error(`Notification ${q.method} defines parameters by name but received parameters by position`),re.numberOfParams!==q.params.length&&te.error(`Notification ${q.method} defines ${re.numberOfParams} params but received ${De.length} arguments`)),we(...De))}else re!==void 0&&re.parameterStructures===i.ParameterStructures.byPosition&&te.error(`Notification ${q.method} defines parameters by position but received parameters by name`),we(q.params);else He&&He(q.method,q.params)}catch(De){De.message?te.error(`Notification handler '${q.method}' failed with message: ${De.message}`):te.error(`Notification handler '${q.method}' failed unexpectedly.`)}else Yr.fire(q)}function Et(q){if(!q){te.error("Received empty message.");return}te.error(`Received message which is neither a response nor a notification message:
|
|
19
19
|
${JSON.stringify(q,null,4)}`);let re=q;if(n.string(re.id)||n.number(re.id)){let we=re.id,De=bt.get(we);De&&De.reject(Error("The received response has neither a result nor an error property."))}}function Tt(q){if(q!=null)switch(Xe){case x.Verbose:return JSON.stringify(q,null,4);case x.Compact:return JSON.stringify(q);default:return}}function Bn(q){if(!(Xe===x.Off||!Ct))if(cn===E.Text){let re;(Xe===x.Verbose||Xe===x.Compact)&&q.params&&(re=`Params: ${Tt(q.params)}
|
|
20
20
|
|
|
@@ -40,11 +40,11 @@ ${JSON.stringify(q,null,4)}`);let re=q;if(n.string(re.id)||n.number(re.id)){let
|
|
|
40
40
|
|
|
41
41
|
`:q.error===void 0&&(we=`No result returned.
|
|
42
42
|
|
|
43
|
-
`)),re){let De=q.error?` Request failed: ${q.error.message} (${q.error.code}).`:"";Ct.log(`Received response '${re.method} - (${q.id})' in ${Date.now()-re.timerStart}ms.${De}`,we)}else Ct.log(`Received response ${q.id} without active response promise.`,we)}else Cn("receive-response",q)}function Cn(q,re){if(!Ct||Xe===x.Off)return;let we={isLSPMessage:!0,type:q,message:re,timestamp:Date.now()};Ct.log(we)}function pr(){if(Ai())throw new z(j.Closed,"Connection is closed.");if(vn())throw new z(j.Disposed,"Connection is disposed.")}function Pi(){if(Yt())throw new z(j.AlreadyListening,"Connection is already listening")}function gi(){if(!Yt())throw Error("Call listen() first.")}function zn(q){return q===void 0?null:q}function Oi(q){if(q!==null)return q}function Wn(q){return q!=null&&!Array.isArray(q)&&typeof q=="object"}function mr(q,re){switch(q){case i.ParameterStructures.auto:return Wn(re)?Oi(re):[zn(re)];case i.ParameterStructures.byName:if(!Wn(re))throw Error("Received parameters by name but param is not an object literal.");return Oi(re);case i.ParameterStructures.byPosition:return[zn(re)];default:throw Error(`Unknown parameter structure ${q.toString()}`)}}function A(q,re){let we,De=q.numberOfParams;switch(De){case 0:we=void 0;break;case 1:we=mr(q.parameterStructures,re[0]);break;default:we=[];for(let Ue=0;Ue<re.length&&Ue<De;Ue++)we.push(zn(re[Ue]));if(re.length<De)for(let Ue=re.length;Ue<De;Ue++)we.push(null);break}return we}let rt={sendNotification:(q,...re)=>{pr();let we,De;if(n.string(q)){we=q;let Ke=re[0],ut=0,Nt=i.ParameterStructures.auto;i.ParameterStructures.is(Ke)&&(ut=1,Nt=Ke);let it=re.length,jt=it-ut;switch(jt){case 0:De=void 0;break;case 1:De=mr(Nt,re[ut]);break;default:if(Nt===i.ParameterStructures.byName)throw Error(`Received ${jt} parameters for 'by Name' notification parameter structure.`);De=re.slice(ut,it).map(st=>zn(st));break}}else{let Ke=re;we=q.method,De=A(q,Ke)}let Ue={jsonrpc:"2.0",method:we,params:De};return Mr(Ue),Q.write(Ue).catch(Ke=>{throw te.error("Sending notification failed."),Ke})},onNotification:(q,re)=>{pr();let we;return n.func(q)?He=q:re&&(n.string(q)?(we=q,Fe.set(q,{type:void 0,handler:re})):(we=q.method,Fe.set(q.method,{type:q,handler:re}))),{dispose:()=>{we===void 0?He=void 0:Fe.delete(we)}}},onProgress:(q,re,we)=>{if(Oe.has(re))throw Error(`Progress handler for token ${re} already registered`);return Oe.set(re,we),{dispose:()=>{Oe.delete(re)}}},sendProgress:(q,re,we)=>rt.sendNotification(g.type,{token:re,value:we}),onUnhandledProgress:un.event,sendRequest:(q,...re)=>{pr(),gi();let we,De,Ue;if(n.string(q)){we=q;let it=re[0],jt=re[re.length-1],st=0,mt=i.ParameterStructures.auto;i.ParameterStructures.is(it)&&(st=1,mt=it);let Sn=re.length;u.CancellationToken.is(jt)&&(--Sn,Ue=jt);let hr=Sn-st;switch(hr){case 0:De=void 0;break;case 1:De=mr(mt,re[st]);break;default:if(mt===i.ParameterStructures.byName)throw Error(`Received ${hr} parameters for 'by Name' request parameter structure.`);De=re.slice(st,Sn).map(yi=>zn(yi));break}}else{let it=re;we=q.method,De=A(q,it);let jt=q.numberOfParams;Ue=u.CancellationToken.is(it[jt])?it[jt]:void 0}let Ke=he++,ut;Ue&&(ut=Ue.onCancellationRequested(()=>{let it=Nn.sender.sendCancellation(rt,Ke);return it===void 0?(te.log(`Received no promise from cancellation strategy when cancelling id ${Ke}`),Promise.resolve()):it.catch(()=>{te.log(`Sending cancellation messages for id ${Ke} failed`)})}));let Nt={jsonrpc:"2.0",id:Ke,method:we,params:De};return Bn(Nt),typeof Nn.sender.enableCancellation=="function"&&Nn.sender.enableCancellation(Nt),new Promise(async(it,jt)=>{let st={method:we,timerStart:Date.now(),resolve:mt=>{it(mt),Nn.sender.cleanup(Ke),ut==null||ut.dispose()},reject:mt=>{jt(mt),Nn.sender.cleanup(Ke),ut==null||ut.dispose()}};try{await Q.write(Nt),bt.set(Ke,st)}catch(mt){throw te.error("Sending request failed."),st.reject(new i.ResponseError(i.ErrorCodes.MessageWriteError,mt.message?mt.message:"Unknown reason")),mt}})},onRequest:(q,re)=>{pr();let we=null;return w.is(q)?(we=void 0,qe=q):n.string(q)?(we=null,re!==void 0&&(we=q,Qe.set(q,{handler:re,type:void 0}))):re!==void 0&&(we=q.method,Qe.set(q.method,{type:q,handler:re})),{dispose:()=>{we!==null&&(we===void 0?qe=void 0:Qe.delete(we))}}},hasPendingResponse:()=>bt.size>0,trace:async(q,re,we)=>{let De=!1,Ue=E.Text;we!==void 0&&(n.boolean(we)?De=we:(De=we.sendNotification||!1,Ue=we.traceFormat||E.Text)),Xe=q,cn=Ue,Ct=Xe===x.Off?void 0:re,De&&!Ai()&&!vn()&&await rt.sendNotification(T.type,{value:x.toString(q)})},onError:Lr.event,onClose:yt.event,onUnhandledNotification:Yr.event,onDispose:Ri.event,end:()=>{Q.end()},dispose:()=>{if(vn())return;kn=_e.Disposed,Ri.fire(void 0);let q=new i.ResponseError(i.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let re of bt.values())re.reject(q);bt=new Map,gn=new Map,Mn=new Set,gt=new o.LinkedMap,n.func(Q.dispose)&&Q.dispose(),n.func(Z.dispose)&&Z.dispose()},listen:()=>{pr(),Pi(),kn=_e.Listening,Z.listen(Or)},inspect:()=>{(0,t.default)().console.log("inspect")}};return rt.onNotification(O.type,q=>{if(Xe===x.Off||!Ct)return;let re=Xe===x.Verbose||Xe===x.Compact;Ct.log(q.message,re?q.verbose:void 0)}),rt.onNotification(g.type,q=>{let re=Oe.get(q.token);re?re(q.value):un.fire(q)}),rt}e.createMessageConnection=Te})),Kc=Pe((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ProgressType=e.ProgressToken=e.createMessageConnection=e.NullLogger=e.ConnectionOptions=e.ConnectionStrategy=e.AbstractMessageBuffer=e.WriteableStreamMessageWriter=e.AbstractMessageWriter=e.MessageWriter=e.ReadableStreamMessageReader=e.AbstractMessageReader=e.MessageReader=e.SharedArrayReceiverStrategy=e.SharedArraySenderStrategy=e.CancellationToken=e.CancellationTokenSource=e.Emitter=e.Event=e.Disposable=e.LRUCache=e.Touch=e.LinkedMap=e.ParameterStructures=e.NotificationType9=e.NotificationType8=e.NotificationType7=e.NotificationType6=e.NotificationType5=e.NotificationType4=e.NotificationType3=e.NotificationType2=e.NotificationType1=e.NotificationType0=e.NotificationType=e.ErrorCodes=e.ResponseError=e.RequestType9=e.RequestType8=e.RequestType7=e.RequestType6=e.RequestType5=e.RequestType4=e.RequestType3=e.RequestType2=e.RequestType1=e.RequestType0=e.RequestType=e.Message=e.RAL=void 0,e.MessageStrategy=e.CancellationStrategy=e.CancellationSenderStrategy=e.CancellationReceiverStrategy=e.ConnectionError=e.ConnectionErrors=e.LogTraceNotification=e.SetTraceNotification=e.TraceFormat=e.TraceValues=e.Trace=void 0;var t=lp();Object.defineProperty(e,"Message",{enumerable:!0,get:function(){return t.Message}}),Object.defineProperty(e,"RequestType",{enumerable:!0,get:function(){return t.RequestType}}),Object.defineProperty(e,"RequestType0",{enumerable:!0,get:function(){return t.RequestType0}}),Object.defineProperty(e,"RequestType1",{enumerable:!0,get:function(){return t.RequestType1}}),Object.defineProperty(e,"RequestType2",{enumerable:!0,get:function(){return t.RequestType2}}),Object.defineProperty(e,"RequestType3",{enumerable:!0,get:function(){return t.RequestType3}}),Object.defineProperty(e,"RequestType4",{enumerable:!0,get:function(){return t.RequestType4}}),Object.defineProperty(e,"RequestType5",{enumerable:!0,get:function(){return t.RequestType5}}),Object.defineProperty(e,"RequestType6",{enumerable:!0,get:function(){return t.RequestType6}}),Object.defineProperty(e,"RequestType7",{enumerable:!0,get:function(){return t.RequestType7}}),Object.defineProperty(e,"RequestType8",{enumerable:!0,get:function(){return t.RequestType8}}),Object.defineProperty(e,"RequestType9",{enumerable:!0,get:function(){return t.RequestType9}}),Object.defineProperty(e,"ResponseError",{enumerable:!0,get:function(){return t.ResponseError}}),Object.defineProperty(e,"ErrorCodes",{enumerable:!0,get:function(){return t.ErrorCodes}}),Object.defineProperty(e,"NotificationType",{enumerable:!0,get:function(){return t.NotificationType}}),Object.defineProperty(e,"NotificationType0",{enumerable:!0,get:function(){return t.NotificationType0}}),Object.defineProperty(e,"NotificationType1",{enumerable:!0,get:function(){return t.NotificationType1}}),Object.defineProperty(e,"NotificationType2",{enumerable:!0,get:function(){return t.NotificationType2}}),Object.defineProperty(e,"NotificationType3",{enumerable:!0,get:function(){return t.NotificationType3}}),Object.defineProperty(e,"NotificationType4",{enumerable:!0,get:function(){return t.NotificationType4}}),Object.defineProperty(e,"NotificationType5",{enumerable:!0,get:function(){return t.NotificationType5}}),Object.defineProperty(e,"NotificationType6",{enumerable:!0,get:function(){return t.NotificationType6}}),Object.defineProperty(e,"NotificationType7",{enumerable:!0,get:function(){return t.NotificationType7}}),Object.defineProperty(e,"NotificationType8",{enumerable:!0,get:function(){return t.NotificationType8}}),Object.defineProperty(e,"NotificationType9",{enumerable:!0,get:function(){return t.NotificationType9}}),Object.defineProperty(e,"ParameterStructures",{enumerable:!0,get:function(){return t.ParameterStructures}});var n=cp();Object.defineProperty(e,"LinkedMap",{enumerable:!0,get:function(){return n.LinkedMap}}),Object.defineProperty(e,"LRUCache",{enumerable:!0,get:function(){return n.LRUCache}}),Object.defineProperty(e,"Touch",{enumerable:!0,get:function(){return n.Touch}});var i=gv();Object.defineProperty(e,"Disposable",{enumerable:!0,get:function(){return i.Disposable}});var o=Yo();Object.defineProperty(e,"Event",{enumerable:!0,get:function(){return o.Event}}),Object.defineProperty(e,"Emitter",{enumerable:!0,get:function(){return o.Emitter}});var l=Uc();Object.defineProperty(e,"CancellationTokenSource",{enumerable:!0,get:function(){return l.CancellationTokenSource}}),Object.defineProperty(e,"CancellationToken",{enumerable:!0,get:function(){return l.CancellationToken}});var u=yv();Object.defineProperty(e,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return u.SharedArraySenderStrategy}}),Object.defineProperty(e,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return u.SharedArrayReceiverStrategy}});var d=vv();Object.defineProperty(e,"MessageReader",{enumerable:!0,get:function(){return d.MessageReader}}),Object.defineProperty(e,"AbstractMessageReader",{enumerable:!0,get:function(){return d.AbstractMessageReader}}),Object.defineProperty(e,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return d.ReadableStreamMessageReader}});var p=bv();Object.defineProperty(e,"MessageWriter",{enumerable:!0,get:function(){return p.MessageWriter}}),Object.defineProperty(e,"AbstractMessageWriter",{enumerable:!0,get:function(){return p.AbstractMessageWriter}}),Object.defineProperty(e,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return p.WriteableStreamMessageWriter}});var g=wv();Object.defineProperty(e,"AbstractMessageBuffer",{enumerable:!0,get:function(){return g.AbstractMessageBuffer}});var w=xv();Object.defineProperty(e,"ConnectionStrategy",{enumerable:!0,get:function(){return w.ConnectionStrategy}}),Object.defineProperty(e,"ConnectionOptions",{enumerable:!0,get:function(){return w.ConnectionOptions}}),Object.defineProperty(e,"NullLogger",{enumerable:!0,get:function(){return w.NullLogger}}),Object.defineProperty(e,"createMessageConnection",{enumerable:!0,get:function(){return w.createMessageConnection}}),Object.defineProperty(e,"ProgressToken",{enumerable:!0,get:function(){return w.ProgressToken}}),Object.defineProperty(e,"ProgressType",{enumerable:!0,get:function(){return w.ProgressType}}),Object.defineProperty(e,"Trace",{enumerable:!0,get:function(){return w.Trace}}),Object.defineProperty(e,"TraceValues",{enumerable:!0,get:function(){return w.TraceValues}}),Object.defineProperty(e,"TraceFormat",{enumerable:!0,get:function(){return w.TraceFormat}}),Object.defineProperty(e,"SetTraceNotification",{enumerable:!0,get:function(){return w.SetTraceNotification}}),Object.defineProperty(e,"LogTraceNotification",{enumerable:!0,get:function(){return w.LogTraceNotification}}),Object.defineProperty(e,"ConnectionErrors",{enumerable:!0,get:function(){return w.ConnectionErrors}}),Object.defineProperty(e,"ConnectionError",{enumerable:!0,get:function(){return w.ConnectionError}}),Object.defineProperty(e,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return w.CancellationReceiverStrategy}}),Object.defineProperty(e,"CancellationSenderStrategy",{enumerable:!0,get:function(){return w.CancellationSenderStrategy}}),Object.defineProperty(e,"CancellationStrategy",{enumerable:!0,get:function(){return w.CancellationStrategy}}),Object.defineProperty(e,"MessageStrategy",{enumerable:!0,get:function(){return w.MessageStrategy}}),e.RAL=ca().default})),_v=Pe((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=Kc(),n=class RT extends t.AbstractMessageBuffer{constructor(g="utf-8"){super(g),this.asciiDecoder=new TextDecoder("ascii")}emptyBuffer(){return RT.emptyBuffer}fromString(g,w){return new TextEncoder().encode(g)}toString(g,w){return w==="ascii"?this.asciiDecoder.decode(g):new TextDecoder(w).decode(g)}asNative(g,w){return w===void 0?g:g.slice(0,w)}allocNative(g){return new Uint8Array(g)}};n.emptyBuffer=new Uint8Array;var i=class{constructor(p){this.socket=p,this._onData=new t.Emitter,this._messageListener=g=>{g.data.arrayBuffer().then(w=>{this._onData.fire(new Uint8Array(w))},()=>{(0,t.RAL)().console.error("Converting blob to array buffer failed.")})},this.socket.addEventListener("message",this._messageListener)}onClose(p){return this.socket.addEventListener("close",p),t.Disposable.create(()=>this.socket.removeEventListener("close",p))}onError(p){return this.socket.addEventListener("error",p),t.Disposable.create(()=>this.socket.removeEventListener("error",p))}onEnd(p){return this.socket.addEventListener("end",p),t.Disposable.create(()=>this.socket.removeEventListener("end",p))}onData(p){return this._onData.event(p)}},o=class{constructor(p){this.socket=p}onClose(p){return this.socket.addEventListener("close",p),t.Disposable.create(()=>this.socket.removeEventListener("close",p))}onError(p){return this.socket.addEventListener("error",p),t.Disposable.create(()=>this.socket.removeEventListener("error",p))}onEnd(p){return this.socket.addEventListener("end",p),t.Disposable.create(()=>this.socket.removeEventListener("end",p))}write(p,g){if(typeof p=="string"){if(g!==void 0&&g!=="utf-8")throw Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${g}`);this.socket.send(p)}else this.socket.send(p);return Promise.resolve()}end(){this.socket.close()}},l=new TextEncoder,u=Object.freeze({messageBuffer:Object.freeze({create:p=>new n(p)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(p,g)=>{if(g.charset!=="utf-8")throw Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${g.charset}`);return Promise.resolve(l.encode(JSON.stringify(p,void 0,0)))}}),decoder:Object.freeze({name:"application/json",decode:(p,g)=>{if(!(p instanceof Uint8Array))throw Error("In a Browser environments only Uint8Arrays are supported.");return Promise.resolve(JSON.parse(new TextDecoder(g.charset).decode(p)))}})}),stream:Object.freeze({asReadableStream:p=>new i(p),asWritableStream:p=>new o(p)}),console,timer:Object.freeze({setTimeout(p,g,...w){let x=setTimeout(p,g,...w);return{dispose:()=>clearTimeout(x)}},setImmediate(p,...g){let w=setTimeout(p,0,...g);return{dispose:()=>clearTimeout(w)}},setInterval(p,g,...w){let x=setInterval(p,g,...w);return{dispose:()=>clearInterval(x)}}})});function d(){return u}(function(p){function g(){t.RAL.install(u)}p.install=g})(d||(d={})),e.default=d})),eo=Pe((e=>{var t=e&&e.__createBinding||(Object.create?(function(l,u,d,p){p===void 0&&(p=d);var g=Object.getOwnPropertyDescriptor(u,d);(!g||("get"in g?!u.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return u[d]}}),Object.defineProperty(l,p,g)}):(function(l,u,d,p){p===void 0&&(p=d),l[p]=u[d]})),n=e&&e.__exportStar||function(l,u){for(var d in l)d!=="default"&&!Object.prototype.hasOwnProperty.call(u,d)&&t(u,l,d)};Object.defineProperty(e,"__esModule",{value:!0}),e.createMessageConnection=e.BrowserMessageWriter=e.BrowserMessageReader=void 0,_v().default.install();var i=Kc();n(Kc(),e),e.BrowserMessageReader=class extends i.AbstractMessageReader{constructor(l){super(),this._onData=new i.Emitter,this._messageListener=u=>{this._onData.fire(u.data)},l.addEventListener("error",u=>this.fireError(u)),l.onmessage=this._messageListener}listen(l){return this._onData.event(l)}},e.BrowserMessageWriter=class extends i.AbstractMessageWriter{constructor(l){super(),this.port=l,this.errorCount=0,l.addEventListener("error",u=>this.fireError(u))}write(l){try{return this.port.postMessage(l),Promise.resolve()}catch(u){return this.handleError(u,l),Promise.reject(u)}}handleError(l,u){this.errorCount++,this.fireError(l,u,this.errorCount)}end(){}};function o(l,u,d,p){return d===void 0&&(d=i.NullLogger),i.ConnectionStrategy.is(p)&&(p={connectionStrategy:p}),(0,i.createMessageConnection)(l,u,d,p)}e.createMessageConnection=o})),dp=Pe(((e,t)=>{t.exports=eo()})),Qc=GM({AnnotatedTextEdit:()=>ua,ChangeAnnotation:()=>es,ChangeAnnotationIdentifier:()=>On,CodeAction:()=>r1,CodeActionContext:()=>n1,CodeActionKind:()=>t1,CodeActionTriggerKind:()=>tu,CodeDescription:()=>Lv,CodeLens:()=>i1,Color:()=>pp,ColorInformation:()=>Ev,ColorPresentation:()=>Tv,Command:()=>Zo,CompletionItem:()=>Hv,CompletionItemKind:()=>jv,CompletionItemLabelDetails:()=>Vv,CompletionItemTag:()=>zv,CompletionList:()=>Bv,CreateFile:()=>cl,DeleteFile:()=>dl,Diagnostic:()=>Jc,DiagnosticRelatedInformation:()=>mp,DiagnosticSeverity:()=>Iv,DiagnosticTag:()=>Av,DocumentHighlight:()=>Gv,DocumentHighlightKind:()=>Qv,DocumentLink:()=>o1,DocumentSymbol:()=>e1,DocumentUri:()=>kv,EOL:()=>k1,FoldingRange:()=>Rv,FoldingRangeKind:()=>Dv,FormattingOptions:()=>a1,Hover:()=>Wv,InlayHint:()=>h1,InlayHintKind:()=>vp,InlayHintLabelPart:()=>bp,InlineCompletionContext:()=>x1,InlineCompletionItem:()=>y1,InlineCompletionList:()=>v1,InlineCompletionTriggerKind:()=>b1,InlineValueContext:()=>m1,InlineValueEvaluatableExpression:()=>p1,InlineValueText:()=>d1,InlineValueVariableLookup:()=>f1,InsertReplaceEdit:()=>Fv,InsertTextFormat:()=>qv,InsertTextMode:()=>$v,Location:()=>Xc,LocationLink:()=>Sv,MarkedString:()=>eu,MarkupContent:()=>pl,MarkupKind:()=>yp,OptionalVersionedTextDocumentIdentifier:()=>Zc,ParameterInformation:()=>Uv,Position:()=>Gr,Range:()=>tn,RenameFile:()=>ul,SelectedCompletionInfo:()=>w1,SelectionRange:()=>s1,SemanticTokenModifiers:()=>c1,SemanticTokenTypes:()=>l1,SemanticTokens:()=>u1,SignatureInformation:()=>Kv,StringValue:()=>g1,SymbolInformation:()=>Yv,SymbolKind:()=>Xv,SymbolTag:()=>Jv,TextDocument:()=>C1,TextDocumentEdit:()=>Yc,TextDocumentIdentifier:()=>Ov,TextDocumentItem:()=>Nv,TextEdit:()=>Ti,URI:()=>fp,VersionedTextDocumentIdentifier:()=>Mv,WorkspaceChange:()=>Pv,WorkspaceEdit:()=>hp,WorkspaceFolder:()=>_1,WorkspaceSymbol:()=>Zv,integer:()=>Cv,uinteger:()=>Gc},1),nu=QM((()=>{(function(e){function t(n){return typeof n=="string"}e.is=t})(kv||(kv={})),(function(e){function t(n){return typeof n=="string"}e.is=t})(fp||(fp={})),(function(e){e.MIN_VALUE=-2147483648,e.MAX_VALUE=2147483647;function t(n){return typeof n=="number"&&e.MIN_VALUE<=n&&n<=e.MAX_VALUE}e.is=t})(Cv||(Cv={})),(function(e){e.MIN_VALUE=0,e.MAX_VALUE=2147483647;function t(n){return typeof n=="number"&&e.MIN_VALUE<=n&&n<=e.MAX_VALUE}e.is=t})(Gc||(Gc={})),(function(e){function t(i,o){return i===Number.MAX_VALUE&&(i=Gc.MAX_VALUE),o===Number.MAX_VALUE&&(o=Gc.MAX_VALUE),{line:i,character:o}}e.create=t;function n(i){let o=i;return ne.objectLiteral(o)&&ne.uinteger(o.line)&&ne.uinteger(o.character)}e.is=n})(Gr||(Gr={})),(function(e){function t(i,o,l,u){if(ne.uinteger(i)&&ne.uinteger(o)&&ne.uinteger(l)&&ne.uinteger(u))return{start:Gr.create(i,o),end:Gr.create(l,u)};if(Gr.is(i)&&Gr.is(o))return{start:i,end:o};throw Error(`Range#create called with invalid arguments[${i}, ${o}, ${l}, ${u}]`)}e.create=t;function n(i){let o=i;return ne.objectLiteral(o)&&Gr.is(o.start)&&Gr.is(o.end)}e.is=n})(tn||(tn={})),(function(e){function t(i,o){return{uri:i,range:o}}e.create=t;function n(i){let o=i;return ne.objectLiteral(o)&&tn.is(o.range)&&(ne.string(o.uri)||ne.undefined(o.uri))}e.is=n})(Xc||(Xc={})),(function(e){function t(i,o,l,u){return{targetUri:i,targetRange:o,targetSelectionRange:l,originSelectionRange:u}}e.create=t;function n(i){let o=i;return ne.objectLiteral(o)&&tn.is(o.targetRange)&&ne.string(o.targetUri)&&tn.is(o.targetSelectionRange)&&(tn.is(o.originSelectionRange)||ne.undefined(o.originSelectionRange))}e.is=n})(Sv||(Sv={})),(function(e){function t(i,o,l,u){return{red:i,green:o,blue:l,alpha:u}}e.create=t;function n(i){let o=i;return ne.objectLiteral(o)&&ne.numberRange(o.red,0,1)&&ne.numberRange(o.green,0,1)&&ne.numberRange(o.blue,0,1)&&ne.numberRange(o.alpha,0,1)}e.is=n})(pp||(pp={})),(function(e){function t(i,o){return{range:i,color:o}}e.create=t;function n(i){let o=i;return ne.objectLiteral(o)&&tn.is(o.range)&&pp.is(o.color)}e.is=n})(Ev||(Ev={})),(function(e){function t(i,o,l){return{label:i,textEdit:o,additionalTextEdits:l}}e.create=t;function n(i){let o=i;return ne.objectLiteral(o)&&ne.string(o.label)&&(ne.undefined(o.textEdit)||Ti.is(o))&&(ne.undefined(o.additionalTextEdits)||ne.typedArray(o.additionalTextEdits,Ti.is))}e.is=n})(Tv||(Tv={})),(function(e){e.Comment="comment",e.Imports="imports",e.Region="region"})(Dv||(Dv={})),(function(e){function t(i,o,l,u,d,p){let g={startLine:i,endLine:o};return ne.defined(l)&&(g.startCharacter=l),ne.defined(u)&&(g.endCharacter=u),ne.defined(d)&&(g.kind=d),ne.defined(p)&&(g.collapsedText=p),g}e.create=t;function n(i){let o=i;return ne.objectLiteral(o)&&ne.uinteger(o.startLine)&&ne.uinteger(o.startLine)&&(ne.undefined(o.startCharacter)||ne.uinteger(o.startCharacter))&&(ne.undefined(o.endCharacter)||ne.uinteger(o.endCharacter))&&(ne.undefined(o.kind)||ne.string(o.kind))}e.is=n})(Rv||(Rv={})),(function(e){function t(i,o){return{location:i,message:o}}e.create=t;function n(i){let o=i;return ne.defined(o)&&Xc.is(o.location)&&ne.string(o.message)}e.is=n})(mp||(mp={})),(function(e){e.Error=1,e.Warning=2,e.Information=3,e.Hint=4})(Iv||(Iv={})),(function(e){e.Unnecessary=1,e.Deprecated=2})(Av||(Av={})),(function(e){function t(n){let i=n;return ne.objectLiteral(i)&&ne.string(i.href)}e.is=t})(Lv||(Lv={})),(function(e){function t(i,o,l,u,d,p){let g={range:i,message:o};return ne.defined(l)&&(g.severity=l),ne.defined(u)&&(g.code=u),ne.defined(d)&&(g.source=d),ne.defined(p)&&(g.relatedInformation=p),g}e.create=t;function n(i){var l;let o=i;return ne.defined(o)&&tn.is(o.range)&&ne.string(o.message)&&(ne.number(o.severity)||ne.undefined(o.severity))&&(ne.integer(o.code)||ne.string(o.code)||ne.undefined(o.code))&&(ne.undefined(o.codeDescription)||ne.string((l=o.codeDescription)==null?void 0:l.href))&&(ne.string(o.source)||ne.undefined(o.source))&&(ne.undefined(o.relatedInformation)||ne.typedArray(o.relatedInformation,mp.is))}e.is=n})(Jc||(Jc={})),(function(e){function t(i,o,...l){let u={title:i,command:o};return ne.defined(l)&&l.length>0&&(u.arguments=l),u}e.create=t;function n(i){let o=i;return ne.defined(o)&&ne.string(o.title)&&ne.string(o.command)}e.is=n})(Zo||(Zo={})),(function(e){function t(l,u){return{range:l,newText:u}}e.replace=t;function n(l,u){return{range:{start:l,end:l},newText:u}}e.insert=n;function i(l){return{range:l,newText:""}}e.del=i;function o(l){let u=l;return ne.objectLiteral(u)&&ne.string(u.newText)&&tn.is(u.range)}e.is=o})(Ti||(Ti={})),(function(e){function t(i,o,l){let u={label:i};return o!==void 0&&(u.needsConfirmation=o),l!==void 0&&(u.description=l),u}e.create=t;function n(i){let o=i;return ne.objectLiteral(o)&&ne.string(o.label)&&(ne.boolean(o.needsConfirmation)||o.needsConfirmation===void 0)&&(ne.string(o.description)||o.description===void 0)}e.is=n})(es||(es={})),(function(e){function t(n){let i=n;return ne.string(i)}e.is=t})(On||(On={})),(function(e){function t(l,u,d){return{range:l,newText:u,annotationId:d}}e.replace=t;function n(l,u,d){return{range:{start:l,end:l},newText:u,annotationId:d}}e.insert=n;function i(l,u){return{range:l,newText:"",annotationId:u}}e.del=i;function o(l){let u=l;return Ti.is(u)&&(es.is(u.annotationId)||On.is(u.annotationId))}e.is=o})(ua||(ua={})),(function(e){function t(i,o){return{textDocument:i,edits:o}}e.create=t;function n(i){let o=i;return ne.defined(o)&&Zc.is(o.textDocument)&&Array.isArray(o.edits)}e.is=n})(Yc||(Yc={})),(function(e){function t(i,o,l){let u={kind:"create",uri:i};return o!==void 0&&(o.overwrite!==void 0||o.ignoreIfExists!==void 0)&&(u.options=o),l!==void 0&&(u.annotationId=l),u}e.create=t;function n(i){let o=i;return o&&o.kind==="create"&&ne.string(o.uri)&&(o.options===void 0||(o.options.overwrite===void 0||ne.boolean(o.options.overwrite))&&(o.options.ignoreIfExists===void 0||ne.boolean(o.options.ignoreIfExists)))&&(o.annotationId===void 0||On.is(o.annotationId))}e.is=n})(cl||(cl={})),(function(e){function t(i,o,l,u){let d={kind:"rename",oldUri:i,newUri:o};return l!==void 0&&(l.overwrite!==void 0||l.ignoreIfExists!==void 0)&&(d.options=l),u!==void 0&&(d.annotationId=u),d}e.create=t;function n(i){let o=i;return o&&o.kind==="rename"&&ne.string(o.oldUri)&&ne.string(o.newUri)&&(o.options===void 0||(o.options.overwrite===void 0||ne.boolean(o.options.overwrite))&&(o.options.ignoreIfExists===void 0||ne.boolean(o.options.ignoreIfExists)))&&(o.annotationId===void 0||On.is(o.annotationId))}e.is=n})(ul||(ul={})),(function(e){function t(i,o,l){let u={kind:"delete",uri:i};return o!==void 0&&(o.recursive!==void 0||o.ignoreIfNotExists!==void 0)&&(u.options=o),l!==void 0&&(u.annotationId=l),u}e.create=t;function n(i){let o=i;return o&&o.kind==="delete"&&ne.string(o.uri)&&(o.options===void 0||(o.options.recursive===void 0||ne.boolean(o.options.recursive))&&(o.options.ignoreIfNotExists===void 0||ne.boolean(o.options.ignoreIfNotExists)))&&(o.annotationId===void 0||On.is(o.annotationId))}e.is=n})(dl||(dl={})),(function(e){function t(n){let i=n;return i&&(i.changes!==void 0||i.documentChanges!==void 0)&&(i.documentChanges===void 0||i.documentChanges.every(o=>ne.string(o.kind)?cl.is(o)||ul.is(o)||dl.is(o):Yc.is(o)))}e.is=t})(hp||(hp={})),fl=class{constructor(e,t){this.edits=e,this.changeAnnotations=t}insert(e,t,n){let i,o;if(n===void 0?i=Ti.insert(e,t):On.is(n)?(o=n,i=ua.insert(e,t,n)):(this.assertChangeAnnotations(this.changeAnnotations),o=this.changeAnnotations.manage(n),i=ua.insert(e,t,o)),this.edits.push(i),o!==void 0)return o}replace(e,t,n){let i,o;if(n===void 0?i=Ti.replace(e,t):On.is(n)?(o=n,i=ua.replace(e,t,n)):(this.assertChangeAnnotations(this.changeAnnotations),o=this.changeAnnotations.manage(n),i=ua.replace(e,t,o)),this.edits.push(i),o!==void 0)return o}delete(e,t){let n,i;if(t===void 0?n=Ti.del(e):On.is(t)?(i=t,n=ua.del(e,t)):(this.assertChangeAnnotations(this.changeAnnotations),i=this.changeAnnotations.manage(t),n=ua.del(e,i)),this.edits.push(n),i!==void 0)return i}add(e){this.edits.push(e)}all(){return this.edits}clear(){this.edits.splice(0,this.edits.length)}assertChangeAnnotations(e){if(e===void 0)throw Error("Text edit change is not configured to manage change annotations.")}},gp=class{constructor(e){this._annotations=e===void 0?Object.create(null):e,this._counter=0,this._size=0}all(){return this._annotations}get size(){return this._size}manage(e,t){let n;if(On.is(e)?n=e:(n=this.nextId(),t=e),this._annotations[n]!==void 0)throw Error(`Id ${n} is already in use.`);if(t===void 0)throw Error(`No annotation provided for id ${n}`);return this._annotations[n]=t,this._size++,n}nextId(){return this._counter++,this._counter.toString()}},Pv=class{constructor(e){this._textEditChanges=Object.create(null),e===void 0?this._workspaceEdit={}:(this._workspaceEdit=e,e.documentChanges?(this._changeAnnotations=new gp(e.changeAnnotations),e.changeAnnotations=this._changeAnnotations.all(),e.documentChanges.forEach(t=>{if(Yc.is(t)){let n=new fl(t.edits,this._changeAnnotations);this._textEditChanges[t.textDocument.uri]=n}})):e.changes&&Object.keys(e.changes).forEach(t=>{let n=new fl(e.changes[t]);this._textEditChanges[t]=n}))}get edit(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit}getTextEditChange(e){if(Zc.is(e)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw Error("Workspace edit is not configured for document changes.");let t={uri:e.uri,version:e.version},n=this._textEditChanges[t.uri];if(!n){let i=[],o={textDocument:t,edits:i};this._workspaceEdit.documentChanges.push(o),n=new fl(i,this._changeAnnotations),this._textEditChanges[t.uri]=n}return n}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw Error("Workspace edit is not configured for normal text edit changes.");let t=this._textEditChanges[e];if(!t){let n=[];this._workspaceEdit.changes[e]=n,t=new fl(n),this._textEditChanges[e]=t}return t}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new gp,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())}initChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))}createFile(e,t,n){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw Error("Workspace edit is not configured for document changes.");let i;es.is(t)||On.is(t)?i=t:n=t;let o,l;if(i===void 0?o=cl.create(e,n):(l=On.is(i)?i:this._changeAnnotations.manage(i),o=cl.create(e,n,l)),this._workspaceEdit.documentChanges.push(o),l!==void 0)return l}renameFile(e,t,n,i){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw Error("Workspace edit is not configured for document changes.");let o;es.is(n)||On.is(n)?o=n:i=n;let l,u;if(o===void 0?l=ul.create(e,t,i):(u=On.is(o)?o:this._changeAnnotations.manage(o),l=ul.create(e,t,i,u)),this._workspaceEdit.documentChanges.push(l),u!==void 0)return u}deleteFile(e,t,n){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw Error("Workspace edit is not configured for document changes.");let i;es.is(t)||On.is(t)?i=t:n=t;let o,l;if(i===void 0?o=dl.create(e,n):(l=On.is(i)?i:this._changeAnnotations.manage(i),o=dl.create(e,n,l)),this._workspaceEdit.documentChanges.push(o),l!==void 0)return l}},(function(e){function t(i){return{uri:i}}e.create=t;function n(i){let o=i;return ne.defined(o)&&ne.string(o.uri)}e.is=n})(Ov||(Ov={})),(function(e){function t(i,o){return{uri:i,version:o}}e.create=t;function n(i){let o=i;return ne.defined(o)&&ne.string(o.uri)&&ne.integer(o.version)}e.is=n})(Mv||(Mv={})),(function(e){function t(i,o){return{uri:i,version:o}}e.create=t;function n(i){let o=i;return ne.defined(o)&&ne.string(o.uri)&&(o.version===null||ne.integer(o.version))}e.is=n})(Zc||(Zc={})),(function(e){function t(i,o,l,u){return{uri:i,languageId:o,version:l,text:u}}e.create=t;function n(i){let o=i;return ne.defined(o)&&ne.string(o.uri)&&ne.string(o.languageId)&&ne.integer(o.version)&&ne.string(o.text)}e.is=n})(Nv||(Nv={})),(function(e){e.PlainText="plaintext",e.Markdown="markdown";function t(n){let i=n;return i===e.PlainText||i===e.Markdown}e.is=t})(yp||(yp={})),(function(e){function t(n){let i=n;return ne.objectLiteral(n)&&yp.is(i.kind)&&ne.string(i.value)}e.is=t})(pl||(pl={})),(function(e){e.Text=1,e.Method=2,e.Function=3,e.Constructor=4,e.Field=5,e.Variable=6,e.Class=7,e.Interface=8,e.Module=9,e.Property=10,e.Unit=11,e.Value=12,e.Enum=13,e.Keyword=14,e.Snippet=15,e.Color=16,e.File=17,e.Reference=18,e.Folder=19,e.EnumMember=20,e.Constant=21,e.Struct=22,e.Event=23,e.Operator=24,e.TypeParameter=25})(jv||(jv={})),(function(e){e.PlainText=1,e.Snippet=2})(qv||(qv={})),(function(e){e.Deprecated=1})(zv||(zv={})),(function(e){function t(i,o,l){return{newText:i,insert:o,replace:l}}e.create=t;function n(i){let o=i;return o&&ne.string(o.newText)&&tn.is(o.insert)&&tn.is(o.replace)}e.is=n})(Fv||(Fv={})),(function(e){e.asIs=1,e.adjustIndentation=2})($v||($v={})),(function(e){function t(n){let i=n;return i&&(ne.string(i.detail)||i.detail===void 0)&&(ne.string(i.description)||i.description===void 0)}e.is=t})(Vv||(Vv={})),(function(e){function t(n){return{label:n}}e.create=t})(Hv||(Hv={})),(function(e){function t(n,i){return{items:n||[],isIncomplete:!!i}}e.create=t})(Bv||(Bv={})),(function(e){function t(i){return i.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}e.fromPlainText=t;function n(i){let o=i;return ne.string(o)||ne.objectLiteral(o)&&ne.string(o.language)&&ne.string(o.value)}e.is=n})(eu||(eu={})),(function(e){function t(n){let i=n;return!!i&&ne.objectLiteral(i)&&(pl.is(i.contents)||eu.is(i.contents)||ne.typedArray(i.contents,eu.is))&&(n.range===void 0||tn.is(n.range))}e.is=t})(Wv||(Wv={})),(function(e){function t(n,i){return i?{label:n,documentation:i}:{label:n}}e.create=t})(Uv||(Uv={})),(function(e){function t(n,i,...o){let l={label:n};return ne.defined(i)&&(l.documentation=i),ne.defined(o)?l.parameters=o:l.parameters=[],l}e.create=t})(Kv||(Kv={})),(function(e){e.Text=1,e.Read=2,e.Write=3})(Qv||(Qv={})),(function(e){function t(n,i){let o={range:n};return ne.number(i)&&(o.kind=i),o}e.create=t})(Gv||(Gv={})),(function(e){e.File=1,e.Module=2,e.Namespace=3,e.Package=4,e.Class=5,e.Method=6,e.Property=7,e.Field=8,e.Constructor=9,e.Enum=10,e.Interface=11,e.Function=12,e.Variable=13,e.Constant=14,e.String=15,e.Number=16,e.Boolean=17,e.Array=18,e.Object=19,e.Key=20,e.Null=21,e.EnumMember=22,e.Struct=23,e.Event=24,e.Operator=25,e.TypeParameter=26})(Xv||(Xv={})),(function(e){e.Deprecated=1})(Jv||(Jv={})),(function(e){function t(n,i,o,l,u){let d={name:n,kind:i,location:{uri:l,range:o}};return u&&(d.containerName=u),d}e.create=t})(Yv||(Yv={})),(function(e){function t(n,i,o,l){return l===void 0?{name:n,kind:i,location:{uri:o}}:{name:n,kind:i,location:{uri:o,range:l}}}e.create=t})(Zv||(Zv={})),(function(e){function t(i,o,l,u,d,p){let g={name:i,detail:o,kind:l,range:u,selectionRange:d};return p!==void 0&&(g.children=p),g}e.create=t;function n(i){let o=i;return o&&ne.string(o.name)&&ne.number(o.kind)&&tn.is(o.range)&&tn.is(o.selectionRange)&&(o.detail===void 0||ne.string(o.detail))&&(o.deprecated===void 0||ne.boolean(o.deprecated))&&(o.children===void 0||Array.isArray(o.children))&&(o.tags===void 0||Array.isArray(o.tags))}e.is=n})(e1||(e1={})),(function(e){e.Empty="",e.QuickFix="quickfix",e.Refactor="refactor",e.RefactorExtract="refactor.extract",e.RefactorInline="refactor.inline",e.RefactorRewrite="refactor.rewrite",e.Source="source",e.SourceOrganizeImports="source.organizeImports",e.SourceFixAll="source.fixAll"})(t1||(t1={})),(function(e){e.Invoked=1,e.Automatic=2})(tu||(tu={})),(function(e){function t(i,o,l){let u={diagnostics:i};return o!=null&&(u.only=o),l!=null&&(u.triggerKind=l),u}e.create=t;function n(i){let o=i;return ne.defined(o)&&ne.typedArray(o.diagnostics,Jc.is)&&(o.only===void 0||ne.typedArray(o.only,ne.string))&&(o.triggerKind===void 0||o.triggerKind===tu.Invoked||o.triggerKind===tu.Automatic)}e.is=n})(n1||(n1={})),(function(e){function t(i,o,l){let u={title:i},d=!0;return typeof o=="string"?(d=!1,u.kind=o):Zo.is(o)?u.command=o:u.edit=o,d&&l!==void 0&&(u.kind=l),u}e.create=t;function n(i){let o=i;return o&&ne.string(o.title)&&(o.diagnostics===void 0||ne.typedArray(o.diagnostics,Jc.is))&&(o.kind===void 0||ne.string(o.kind))&&(o.edit!==void 0||o.command!==void 0)&&(o.command===void 0||Zo.is(o.command))&&(o.isPreferred===void 0||ne.boolean(o.isPreferred))&&(o.edit===void 0||hp.is(o.edit))}e.is=n})(r1||(r1={})),(function(e){function t(i,o){let l={range:i};return ne.defined(o)&&(l.data=o),l}e.create=t;function n(i){let o=i;return ne.defined(o)&&tn.is(o.range)&&(ne.undefined(o.command)||Zo.is(o.command))}e.is=n})(i1||(i1={})),(function(e){function t(i,o){return{tabSize:i,insertSpaces:o}}e.create=t;function n(i){let o=i;return ne.defined(o)&&ne.uinteger(o.tabSize)&&ne.boolean(o.insertSpaces)}e.is=n})(a1||(a1={})),(function(e){function t(i,o,l){return{range:i,target:o,data:l}}e.create=t;function n(i){let o=i;return ne.defined(o)&&tn.is(o.range)&&(ne.undefined(o.target)||ne.string(o.target))}e.is=n})(o1||(o1={})),(function(e){function t(i,o){return{range:i,parent:o}}e.create=t;function n(i){let o=i;return ne.objectLiteral(o)&&tn.is(o.range)&&(o.parent===void 0||e.is(o.parent))}e.is=n})(s1||(s1={})),(function(e){e.namespace="namespace",e.type="type",e.class="class",e.enum="enum",e.interface="interface",e.struct="struct",e.typeParameter="typeParameter",e.parameter="parameter",e.variable="variable",e.property="property",e.enumMember="enumMember",e.event="event",e.function="function",e.method="method",e.macro="macro",e.keyword="keyword",e.modifier="modifier",e.comment="comment",e.string="string",e.number="number",e.regexp="regexp",e.operator="operator",e.decorator="decorator"})(l1||(l1={})),(function(e){e.declaration="declaration",e.definition="definition",e.readonly="readonly",e.static="static",e.deprecated="deprecated",e.abstract="abstract",e.async="async",e.modification="modification",e.documentation="documentation",e.defaultLibrary="defaultLibrary"})(c1||(c1={})),(function(e){function t(n){let i=n;return ne.objectLiteral(i)&&(i.resultId===void 0||typeof i.resultId=="string")&&Array.isArray(i.data)&&(i.data.length===0||typeof i.data[0]=="number")}e.is=t})(u1||(u1={})),(function(e){function t(i,o){return{range:i,text:o}}e.create=t;function n(i){let o=i;return o!=null&&tn.is(o.range)&&ne.string(o.text)}e.is=n})(d1||(d1={})),(function(e){function t(i,o,l){return{range:i,variableName:o,caseSensitiveLookup:l}}e.create=t;function n(i){let o=i;return o!=null&&tn.is(o.range)&&ne.boolean(o.caseSensitiveLookup)&&(ne.string(o.variableName)||o.variableName===void 0)}e.is=n})(f1||(f1={})),(function(e){function t(i,o){return{range:i,expression:o}}e.create=t;function n(i){let o=i;return o!=null&&tn.is(o.range)&&(ne.string(o.expression)||o.expression===void 0)}e.is=n})(p1||(p1={})),(function(e){function t(i,o){return{frameId:i,stoppedLocation:o}}e.create=t;function n(i){let o=i;return ne.defined(o)&&tn.is(i.stoppedLocation)}e.is=n})(m1||(m1={})),(function(e){e.Type=1,e.Parameter=2;function t(n){return n===1||n===2}e.is=t})(vp||(vp={})),(function(e){function t(i){return{value:i}}e.create=t;function n(i){let o=i;return ne.objectLiteral(o)&&(o.tooltip===void 0||ne.string(o.tooltip)||pl.is(o.tooltip))&&(o.location===void 0||Xc.is(o.location))&&(o.command===void 0||Zo.is(o.command))}e.is=n})(bp||(bp={})),(function(e){function t(i,o,l){let u={position:i,label:o};return l!==void 0&&(u.kind=l),u}e.create=t;function n(i){let o=i;return ne.objectLiteral(o)&&Gr.is(o.position)&&(ne.string(o.label)||ne.typedArray(o.label,bp.is))&&(o.kind===void 0||vp.is(o.kind))&&o.textEdits===void 0||ne.typedArray(o.textEdits,Ti.is)&&(o.tooltip===void 0||ne.string(o.tooltip)||pl.is(o.tooltip))&&(o.paddingLeft===void 0||ne.boolean(o.paddingLeft))&&(o.paddingRight===void 0||ne.boolean(o.paddingRight))}e.is=n})(h1||(h1={})),(function(e){function t(n){return{kind:"snippet",value:n}}e.createSnippet=t})(g1||(g1={})),(function(e){function t(n,i,o,l){return{insertText:n,filterText:i,range:o,command:l}}e.create=t})(y1||(y1={})),(function(e){function t(n){return{items:n}}e.create=t})(v1||(v1={})),(function(e){e.Invoked=0,e.Automatic=1})(b1||(b1={})),(function(e){function t(n,i){return{range:n,text:i}}e.create=t})(w1||(w1={})),(function(e){function t(n,i){return{triggerKind:n,selectedCompletionInfo:i}}e.create=t})(x1||(x1={})),(function(e){function t(n){let i=n;return ne.objectLiteral(i)&&fp.is(i.uri)&&ne.string(i.name)}e.is=t})(_1||(_1={})),k1=[`
|
|
43
|
+
`)),re){let De=q.error?` Request failed: ${q.error.message} (${q.error.code}).`:"";Ct.log(`Received response '${re.method} - (${q.id})' in ${Date.now()-re.timerStart}ms.${De}`,we)}else Ct.log(`Received response ${q.id} without active response promise.`,we)}else Cn("receive-response",q)}function Cn(q,re){if(!Ct||Xe===x.Off)return;let we={isLSPMessage:!0,type:q,message:re,timestamp:Date.now()};Ct.log(we)}function pr(){if(Ai())throw new z(j.Closed,"Connection is closed.");if(vn())throw new z(j.Disposed,"Connection is disposed.")}function Pi(){if(Yt())throw new z(j.AlreadyListening,"Connection is already listening")}function gi(){if(!Yt())throw Error("Call listen() first.")}function zn(q){return q===void 0?null:q}function Oi(q){if(q!==null)return q}function Wn(q){return q!=null&&!Array.isArray(q)&&typeof q=="object"}function mr(q,re){switch(q){case i.ParameterStructures.auto:return Wn(re)?Oi(re):[zn(re)];case i.ParameterStructures.byName:if(!Wn(re))throw Error("Received parameters by name but param is not an object literal.");return Oi(re);case i.ParameterStructures.byPosition:return[zn(re)];default:throw Error(`Unknown parameter structure ${q.toString()}`)}}function A(q,re){let we,De=q.numberOfParams;switch(De){case 0:we=void 0;break;case 1:we=mr(q.parameterStructures,re[0]);break;default:we=[];for(let Ue=0;Ue<re.length&&Ue<De;Ue++)we.push(zn(re[Ue]));if(re.length<De)for(let Ue=re.length;Ue<De;Ue++)we.push(null);break}return we}let rt={sendNotification:(q,...re)=>{pr();let we,De;if(n.string(q)){we=q;let Ke=re[0],ut=0,Nt=i.ParameterStructures.auto;i.ParameterStructures.is(Ke)&&(ut=1,Nt=Ke);let it=re.length,jt=it-ut;switch(jt){case 0:De=void 0;break;case 1:De=mr(Nt,re[ut]);break;default:if(Nt===i.ParameterStructures.byName)throw Error(`Received ${jt} parameters for 'by Name' notification parameter structure.`);De=re.slice(ut,it).map(st=>zn(st));break}}else{let Ke=re;we=q.method,De=A(q,Ke)}let Ue={jsonrpc:"2.0",method:we,params:De};return Mr(Ue),Q.write(Ue).catch(Ke=>{throw te.error("Sending notification failed."),Ke})},onNotification:(q,re)=>{pr();let we;return n.func(q)?He=q:re&&(n.string(q)?(we=q,Fe.set(q,{type:void 0,handler:re})):(we=q.method,Fe.set(q.method,{type:q,handler:re}))),{dispose:()=>{we===void 0?He=void 0:Fe.delete(we)}}},onProgress:(q,re,we)=>{if(Oe.has(re))throw Error(`Progress handler for token ${re} already registered`);return Oe.set(re,we),{dispose:()=>{Oe.delete(re)}}},sendProgress:(q,re,we)=>rt.sendNotification(g.type,{token:re,value:we}),onUnhandledProgress:un.event,sendRequest:(q,...re)=>{pr(),gi();let we,De,Ue;if(n.string(q)){we=q;let it=re[0],jt=re[re.length-1],st=0,mt=i.ParameterStructures.auto;i.ParameterStructures.is(it)&&(st=1,mt=it);let Sn=re.length;u.CancellationToken.is(jt)&&(--Sn,Ue=jt);let hr=Sn-st;switch(hr){case 0:De=void 0;break;case 1:De=mr(mt,re[st]);break;default:if(mt===i.ParameterStructures.byName)throw Error(`Received ${hr} parameters for 'by Name' request parameter structure.`);De=re.slice(st,Sn).map(yi=>zn(yi));break}}else{let it=re;we=q.method,De=A(q,it);let jt=q.numberOfParams;Ue=u.CancellationToken.is(it[jt])?it[jt]:void 0}let Ke=he++,ut;Ue&&(ut=Ue.onCancellationRequested(()=>{let it=Nn.sender.sendCancellation(rt,Ke);return it===void 0?(te.log(`Received no promise from cancellation strategy when cancelling id ${Ke}`),Promise.resolve()):it.catch(()=>{te.log(`Sending cancellation messages for id ${Ke} failed`)})}));let Nt={jsonrpc:"2.0",id:Ke,method:we,params:De};return Bn(Nt),typeof Nn.sender.enableCancellation=="function"&&Nn.sender.enableCancellation(Nt),new Promise(async(it,jt)=>{let st={method:we,timerStart:Date.now(),resolve:mt=>{it(mt),Nn.sender.cleanup(Ke),ut==null||ut.dispose()},reject:mt=>{jt(mt),Nn.sender.cleanup(Ke),ut==null||ut.dispose()}};try{await Q.write(Nt),bt.set(Ke,st)}catch(mt){throw te.error("Sending request failed."),st.reject(new i.ResponseError(i.ErrorCodes.MessageWriteError,mt.message?mt.message:"Unknown reason")),mt}})},onRequest:(q,re)=>{pr();let we=null;return w.is(q)?(we=void 0,qe=q):n.string(q)?(we=null,re!==void 0&&(we=q,Qe.set(q,{handler:re,type:void 0}))):re!==void 0&&(we=q.method,Qe.set(q.method,{type:q,handler:re})),{dispose:()=>{we!==null&&(we===void 0?qe=void 0:Qe.delete(we))}}},hasPendingResponse:()=>bt.size>0,trace:async(q,re,we)=>{let De=!1,Ue=E.Text;we!==void 0&&(n.boolean(we)?De=we:(De=we.sendNotification||!1,Ue=we.traceFormat||E.Text)),Xe=q,cn=Ue,Ct=Xe===x.Off?void 0:re,De&&!Ai()&&!vn()&&await rt.sendNotification(T.type,{value:x.toString(q)})},onError:Lr.event,onClose:yt.event,onUnhandledNotification:Yr.event,onDispose:Ri.event,end:()=>{Q.end()},dispose:()=>{if(vn())return;kn=_e.Disposed,Ri.fire(void 0);let q=new i.ResponseError(i.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let re of bt.values())re.reject(q);bt=new Map,gn=new Map,Mn=new Set,gt=new o.LinkedMap,n.func(Q.dispose)&&Q.dispose(),n.func(Z.dispose)&&Z.dispose()},listen:()=>{pr(),Pi(),kn=_e.Listening,Z.listen(Or)},inspect:()=>{(0,t.default)().console.log("inspect")}};return rt.onNotification(O.type,q=>{if(Xe===x.Off||!Ct)return;let re=Xe===x.Verbose||Xe===x.Compact;Ct.log(q.message,re?q.verbose:void 0)}),rt.onNotification(g.type,q=>{let re=Oe.get(q.token);re?re(q.value):un.fire(q)}),rt}e.createMessageConnection=Te})),Qc=Pe((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ProgressType=e.ProgressToken=e.createMessageConnection=e.NullLogger=e.ConnectionOptions=e.ConnectionStrategy=e.AbstractMessageBuffer=e.WriteableStreamMessageWriter=e.AbstractMessageWriter=e.MessageWriter=e.ReadableStreamMessageReader=e.AbstractMessageReader=e.MessageReader=e.SharedArrayReceiverStrategy=e.SharedArraySenderStrategy=e.CancellationToken=e.CancellationTokenSource=e.Emitter=e.Event=e.Disposable=e.LRUCache=e.Touch=e.LinkedMap=e.ParameterStructures=e.NotificationType9=e.NotificationType8=e.NotificationType7=e.NotificationType6=e.NotificationType5=e.NotificationType4=e.NotificationType3=e.NotificationType2=e.NotificationType1=e.NotificationType0=e.NotificationType=e.ErrorCodes=e.ResponseError=e.RequestType9=e.RequestType8=e.RequestType7=e.RequestType6=e.RequestType5=e.RequestType4=e.RequestType3=e.RequestType2=e.RequestType1=e.RequestType0=e.RequestType=e.Message=e.RAL=void 0,e.MessageStrategy=e.CancellationStrategy=e.CancellationSenderStrategy=e.CancellationReceiverStrategy=e.ConnectionError=e.ConnectionErrors=e.LogTraceNotification=e.SetTraceNotification=e.TraceFormat=e.TraceValues=e.Trace=void 0;var t=lp();Object.defineProperty(e,"Message",{enumerable:!0,get:function(){return t.Message}}),Object.defineProperty(e,"RequestType",{enumerable:!0,get:function(){return t.RequestType}}),Object.defineProperty(e,"RequestType0",{enumerable:!0,get:function(){return t.RequestType0}}),Object.defineProperty(e,"RequestType1",{enumerable:!0,get:function(){return t.RequestType1}}),Object.defineProperty(e,"RequestType2",{enumerable:!0,get:function(){return t.RequestType2}}),Object.defineProperty(e,"RequestType3",{enumerable:!0,get:function(){return t.RequestType3}}),Object.defineProperty(e,"RequestType4",{enumerable:!0,get:function(){return t.RequestType4}}),Object.defineProperty(e,"RequestType5",{enumerable:!0,get:function(){return t.RequestType5}}),Object.defineProperty(e,"RequestType6",{enumerable:!0,get:function(){return t.RequestType6}}),Object.defineProperty(e,"RequestType7",{enumerable:!0,get:function(){return t.RequestType7}}),Object.defineProperty(e,"RequestType8",{enumerable:!0,get:function(){return t.RequestType8}}),Object.defineProperty(e,"RequestType9",{enumerable:!0,get:function(){return t.RequestType9}}),Object.defineProperty(e,"ResponseError",{enumerable:!0,get:function(){return t.ResponseError}}),Object.defineProperty(e,"ErrorCodes",{enumerable:!0,get:function(){return t.ErrorCodes}}),Object.defineProperty(e,"NotificationType",{enumerable:!0,get:function(){return t.NotificationType}}),Object.defineProperty(e,"NotificationType0",{enumerable:!0,get:function(){return t.NotificationType0}}),Object.defineProperty(e,"NotificationType1",{enumerable:!0,get:function(){return t.NotificationType1}}),Object.defineProperty(e,"NotificationType2",{enumerable:!0,get:function(){return t.NotificationType2}}),Object.defineProperty(e,"NotificationType3",{enumerable:!0,get:function(){return t.NotificationType3}}),Object.defineProperty(e,"NotificationType4",{enumerable:!0,get:function(){return t.NotificationType4}}),Object.defineProperty(e,"NotificationType5",{enumerable:!0,get:function(){return t.NotificationType5}}),Object.defineProperty(e,"NotificationType6",{enumerable:!0,get:function(){return t.NotificationType6}}),Object.defineProperty(e,"NotificationType7",{enumerable:!0,get:function(){return t.NotificationType7}}),Object.defineProperty(e,"NotificationType8",{enumerable:!0,get:function(){return t.NotificationType8}}),Object.defineProperty(e,"NotificationType9",{enumerable:!0,get:function(){return t.NotificationType9}}),Object.defineProperty(e,"ParameterStructures",{enumerable:!0,get:function(){return t.ParameterStructures}});var n=cp();Object.defineProperty(e,"LinkedMap",{enumerable:!0,get:function(){return n.LinkedMap}}),Object.defineProperty(e,"LRUCache",{enumerable:!0,get:function(){return n.LRUCache}}),Object.defineProperty(e,"Touch",{enumerable:!0,get:function(){return n.Touch}});var i=gv();Object.defineProperty(e,"Disposable",{enumerable:!0,get:function(){return i.Disposable}});var o=Yo();Object.defineProperty(e,"Event",{enumerable:!0,get:function(){return o.Event}}),Object.defineProperty(e,"Emitter",{enumerable:!0,get:function(){return o.Emitter}});var l=Kc();Object.defineProperty(e,"CancellationTokenSource",{enumerable:!0,get:function(){return l.CancellationTokenSource}}),Object.defineProperty(e,"CancellationToken",{enumerable:!0,get:function(){return l.CancellationToken}});var u=yv();Object.defineProperty(e,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return u.SharedArraySenderStrategy}}),Object.defineProperty(e,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return u.SharedArrayReceiverStrategy}});var d=vv();Object.defineProperty(e,"MessageReader",{enumerable:!0,get:function(){return d.MessageReader}}),Object.defineProperty(e,"AbstractMessageReader",{enumerable:!0,get:function(){return d.AbstractMessageReader}}),Object.defineProperty(e,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return d.ReadableStreamMessageReader}});var p=bv();Object.defineProperty(e,"MessageWriter",{enumerable:!0,get:function(){return p.MessageWriter}}),Object.defineProperty(e,"AbstractMessageWriter",{enumerable:!0,get:function(){return p.AbstractMessageWriter}}),Object.defineProperty(e,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return p.WriteableStreamMessageWriter}});var g=wv();Object.defineProperty(e,"AbstractMessageBuffer",{enumerable:!0,get:function(){return g.AbstractMessageBuffer}});var w=xv();Object.defineProperty(e,"ConnectionStrategy",{enumerable:!0,get:function(){return w.ConnectionStrategy}}),Object.defineProperty(e,"ConnectionOptions",{enumerable:!0,get:function(){return w.ConnectionOptions}}),Object.defineProperty(e,"NullLogger",{enumerable:!0,get:function(){return w.NullLogger}}),Object.defineProperty(e,"createMessageConnection",{enumerable:!0,get:function(){return w.createMessageConnection}}),Object.defineProperty(e,"ProgressToken",{enumerable:!0,get:function(){return w.ProgressToken}}),Object.defineProperty(e,"ProgressType",{enumerable:!0,get:function(){return w.ProgressType}}),Object.defineProperty(e,"Trace",{enumerable:!0,get:function(){return w.Trace}}),Object.defineProperty(e,"TraceValues",{enumerable:!0,get:function(){return w.TraceValues}}),Object.defineProperty(e,"TraceFormat",{enumerable:!0,get:function(){return w.TraceFormat}}),Object.defineProperty(e,"SetTraceNotification",{enumerable:!0,get:function(){return w.SetTraceNotification}}),Object.defineProperty(e,"LogTraceNotification",{enumerable:!0,get:function(){return w.LogTraceNotification}}),Object.defineProperty(e,"ConnectionErrors",{enumerable:!0,get:function(){return w.ConnectionErrors}}),Object.defineProperty(e,"ConnectionError",{enumerable:!0,get:function(){return w.ConnectionError}}),Object.defineProperty(e,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return w.CancellationReceiverStrategy}}),Object.defineProperty(e,"CancellationSenderStrategy",{enumerable:!0,get:function(){return w.CancellationSenderStrategy}}),Object.defineProperty(e,"CancellationStrategy",{enumerable:!0,get:function(){return w.CancellationStrategy}}),Object.defineProperty(e,"MessageStrategy",{enumerable:!0,get:function(){return w.MessageStrategy}}),e.RAL=ua().default})),_v=Pe((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=Qc(),n=class RT extends t.AbstractMessageBuffer{constructor(g="utf-8"){super(g),this.asciiDecoder=new TextDecoder("ascii")}emptyBuffer(){return RT.emptyBuffer}fromString(g,w){return new TextEncoder().encode(g)}toString(g,w){return w==="ascii"?this.asciiDecoder.decode(g):new TextDecoder(w).decode(g)}asNative(g,w){return w===void 0?g:g.slice(0,w)}allocNative(g){return new Uint8Array(g)}};n.emptyBuffer=new Uint8Array;var i=class{constructor(p){this.socket=p,this._onData=new t.Emitter,this._messageListener=g=>{g.data.arrayBuffer().then(w=>{this._onData.fire(new Uint8Array(w))},()=>{(0,t.RAL)().console.error("Converting blob to array buffer failed.")})},this.socket.addEventListener("message",this._messageListener)}onClose(p){return this.socket.addEventListener("close",p),t.Disposable.create(()=>this.socket.removeEventListener("close",p))}onError(p){return this.socket.addEventListener("error",p),t.Disposable.create(()=>this.socket.removeEventListener("error",p))}onEnd(p){return this.socket.addEventListener("end",p),t.Disposable.create(()=>this.socket.removeEventListener("end",p))}onData(p){return this._onData.event(p)}},o=class{constructor(p){this.socket=p}onClose(p){return this.socket.addEventListener("close",p),t.Disposable.create(()=>this.socket.removeEventListener("close",p))}onError(p){return this.socket.addEventListener("error",p),t.Disposable.create(()=>this.socket.removeEventListener("error",p))}onEnd(p){return this.socket.addEventListener("end",p),t.Disposable.create(()=>this.socket.removeEventListener("end",p))}write(p,g){if(typeof p=="string"){if(g!==void 0&&g!=="utf-8")throw Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${g}`);this.socket.send(p)}else this.socket.send(p);return Promise.resolve()}end(){this.socket.close()}},l=new TextEncoder,u=Object.freeze({messageBuffer:Object.freeze({create:p=>new n(p)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(p,g)=>{if(g.charset!=="utf-8")throw Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${g.charset}`);return Promise.resolve(l.encode(JSON.stringify(p,void 0,0)))}}),decoder:Object.freeze({name:"application/json",decode:(p,g)=>{if(!(p instanceof Uint8Array))throw Error("In a Browser environments only Uint8Arrays are supported.");return Promise.resolve(JSON.parse(new TextDecoder(g.charset).decode(p)))}})}),stream:Object.freeze({asReadableStream:p=>new i(p),asWritableStream:p=>new o(p)}),console,timer:Object.freeze({setTimeout(p,g,...w){let x=setTimeout(p,g,...w);return{dispose:()=>clearTimeout(x)}},setImmediate(p,...g){let w=setTimeout(p,0,...g);return{dispose:()=>clearTimeout(w)}},setInterval(p,g,...w){let x=setInterval(p,g,...w);return{dispose:()=>clearInterval(x)}}})});function d(){return u}(function(p){function g(){t.RAL.install(u)}p.install=g})(d||(d={})),e.default=d})),to=Pe((e=>{var t=e&&e.__createBinding||(Object.create?(function(l,u,d,p){p===void 0&&(p=d);var g=Object.getOwnPropertyDescriptor(u,d);(!g||("get"in g?!u.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return u[d]}}),Object.defineProperty(l,p,g)}):(function(l,u,d,p){p===void 0&&(p=d),l[p]=u[d]})),n=e&&e.__exportStar||function(l,u){for(var d in l)d!=="default"&&!Object.prototype.hasOwnProperty.call(u,d)&&t(u,l,d)};Object.defineProperty(e,"__esModule",{value:!0}),e.createMessageConnection=e.BrowserMessageWriter=e.BrowserMessageReader=void 0,_v().default.install();var i=Qc();n(Qc(),e),e.BrowserMessageReader=class extends i.AbstractMessageReader{constructor(l){super(),this._onData=new i.Emitter,this._messageListener=u=>{this._onData.fire(u.data)},l.addEventListener("error",u=>this.fireError(u)),l.onmessage=this._messageListener}listen(l){return this._onData.event(l)}},e.BrowserMessageWriter=class extends i.AbstractMessageWriter{constructor(l){super(),this.port=l,this.errorCount=0,l.addEventListener("error",u=>this.fireError(u))}write(l){try{return this.port.postMessage(l),Promise.resolve()}catch(u){return this.handleError(u,l),Promise.reject(u)}}handleError(l,u){this.errorCount++,this.fireError(l,u,this.errorCount)}end(){}};function o(l,u,d,p){return d===void 0&&(d=i.NullLogger),i.ConnectionStrategy.is(p)&&(p={connectionStrategy:p}),(0,i.createMessageConnection)(l,u,d,p)}e.createMessageConnection=o})),dp=Pe(((e,t)=>{t.exports=to()})),Gc=GM({AnnotatedTextEdit:()=>da,ChangeAnnotation:()=>es,ChangeAnnotationIdentifier:()=>On,CodeAction:()=>r1,CodeActionContext:()=>n1,CodeActionKind:()=>t1,CodeActionTriggerKind:()=>nu,CodeDescription:()=>Lv,CodeLens:()=>i1,Color:()=>pp,ColorInformation:()=>Ev,ColorPresentation:()=>Tv,Command:()=>Zo,CompletionItem:()=>Hv,CompletionItemKind:()=>jv,CompletionItemLabelDetails:()=>Vv,CompletionItemTag:()=>zv,CompletionList:()=>Bv,CreateFile:()=>cl,DeleteFile:()=>dl,Diagnostic:()=>Yc,DiagnosticRelatedInformation:()=>mp,DiagnosticSeverity:()=>Iv,DiagnosticTag:()=>Av,DocumentHighlight:()=>Gv,DocumentHighlightKind:()=>Qv,DocumentLink:()=>o1,DocumentSymbol:()=>e1,DocumentUri:()=>kv,EOL:()=>k1,FoldingRange:()=>Rv,FoldingRangeKind:()=>Dv,FormattingOptions:()=>a1,Hover:()=>Wv,InlayHint:()=>h1,InlayHintKind:()=>vp,InlayHintLabelPart:()=>bp,InlineCompletionContext:()=>x1,InlineCompletionItem:()=>y1,InlineCompletionList:()=>v1,InlineCompletionTriggerKind:()=>b1,InlineValueContext:()=>m1,InlineValueEvaluatableExpression:()=>p1,InlineValueText:()=>d1,InlineValueVariableLookup:()=>f1,InsertReplaceEdit:()=>Fv,InsertTextFormat:()=>qv,InsertTextMode:()=>$v,Location:()=>Jc,LocationLink:()=>Sv,MarkedString:()=>tu,MarkupContent:()=>pl,MarkupKind:()=>yp,OptionalVersionedTextDocumentIdentifier:()=>eu,ParameterInformation:()=>Uv,Position:()=>Gr,Range:()=>tn,RenameFile:()=>ul,SelectedCompletionInfo:()=>w1,SelectionRange:()=>s1,SemanticTokenModifiers:()=>c1,SemanticTokenTypes:()=>l1,SemanticTokens:()=>u1,SignatureInformation:()=>Kv,StringValue:()=>g1,SymbolInformation:()=>Yv,SymbolKind:()=>Xv,SymbolTag:()=>Jv,TextDocument:()=>C1,TextDocumentEdit:()=>Zc,TextDocumentIdentifier:()=>Ov,TextDocumentItem:()=>Nv,TextEdit:()=>Ti,URI:()=>fp,VersionedTextDocumentIdentifier:()=>Mv,WorkspaceChange:()=>Pv,WorkspaceEdit:()=>hp,WorkspaceFolder:()=>_1,WorkspaceSymbol:()=>Zv,integer:()=>Cv,uinteger:()=>Xc},1),ru=QM((()=>{(function(e){function t(n){return typeof n=="string"}e.is=t})(kv||(kv={})),(function(e){function t(n){return typeof n=="string"}e.is=t})(fp||(fp={})),(function(e){e.MIN_VALUE=-2147483648,e.MAX_VALUE=2147483647;function t(n){return typeof n=="number"&&e.MIN_VALUE<=n&&n<=e.MAX_VALUE}e.is=t})(Cv||(Cv={})),(function(e){e.MIN_VALUE=0,e.MAX_VALUE=2147483647;function t(n){return typeof n=="number"&&e.MIN_VALUE<=n&&n<=e.MAX_VALUE}e.is=t})(Xc||(Xc={})),(function(e){function t(i,o){return i===Number.MAX_VALUE&&(i=Xc.MAX_VALUE),o===Number.MAX_VALUE&&(o=Xc.MAX_VALUE),{line:i,character:o}}e.create=t;function n(i){let o=i;return ne.objectLiteral(o)&&ne.uinteger(o.line)&&ne.uinteger(o.character)}e.is=n})(Gr||(Gr={})),(function(e){function t(i,o,l,u){if(ne.uinteger(i)&&ne.uinteger(o)&&ne.uinteger(l)&&ne.uinteger(u))return{start:Gr.create(i,o),end:Gr.create(l,u)};if(Gr.is(i)&&Gr.is(o))return{start:i,end:o};throw Error(`Range#create called with invalid arguments[${i}, ${o}, ${l}, ${u}]`)}e.create=t;function n(i){let o=i;return ne.objectLiteral(o)&&Gr.is(o.start)&&Gr.is(o.end)}e.is=n})(tn||(tn={})),(function(e){function t(i,o){return{uri:i,range:o}}e.create=t;function n(i){let o=i;return ne.objectLiteral(o)&&tn.is(o.range)&&(ne.string(o.uri)||ne.undefined(o.uri))}e.is=n})(Jc||(Jc={})),(function(e){function t(i,o,l,u){return{targetUri:i,targetRange:o,targetSelectionRange:l,originSelectionRange:u}}e.create=t;function n(i){let o=i;return ne.objectLiteral(o)&&tn.is(o.targetRange)&&ne.string(o.targetUri)&&tn.is(o.targetSelectionRange)&&(tn.is(o.originSelectionRange)||ne.undefined(o.originSelectionRange))}e.is=n})(Sv||(Sv={})),(function(e){function t(i,o,l,u){return{red:i,green:o,blue:l,alpha:u}}e.create=t;function n(i){let o=i;return ne.objectLiteral(o)&&ne.numberRange(o.red,0,1)&&ne.numberRange(o.green,0,1)&&ne.numberRange(o.blue,0,1)&&ne.numberRange(o.alpha,0,1)}e.is=n})(pp||(pp={})),(function(e){function t(i,o){return{range:i,color:o}}e.create=t;function n(i){let o=i;return ne.objectLiteral(o)&&tn.is(o.range)&&pp.is(o.color)}e.is=n})(Ev||(Ev={})),(function(e){function t(i,o,l){return{label:i,textEdit:o,additionalTextEdits:l}}e.create=t;function n(i){let o=i;return ne.objectLiteral(o)&&ne.string(o.label)&&(ne.undefined(o.textEdit)||Ti.is(o))&&(ne.undefined(o.additionalTextEdits)||ne.typedArray(o.additionalTextEdits,Ti.is))}e.is=n})(Tv||(Tv={})),(function(e){e.Comment="comment",e.Imports="imports",e.Region="region"})(Dv||(Dv={})),(function(e){function t(i,o,l,u,d,p){let g={startLine:i,endLine:o};return ne.defined(l)&&(g.startCharacter=l),ne.defined(u)&&(g.endCharacter=u),ne.defined(d)&&(g.kind=d),ne.defined(p)&&(g.collapsedText=p),g}e.create=t;function n(i){let o=i;return ne.objectLiteral(o)&&ne.uinteger(o.startLine)&&ne.uinteger(o.startLine)&&(ne.undefined(o.startCharacter)||ne.uinteger(o.startCharacter))&&(ne.undefined(o.endCharacter)||ne.uinteger(o.endCharacter))&&(ne.undefined(o.kind)||ne.string(o.kind))}e.is=n})(Rv||(Rv={})),(function(e){function t(i,o){return{location:i,message:o}}e.create=t;function n(i){let o=i;return ne.defined(o)&&Jc.is(o.location)&&ne.string(o.message)}e.is=n})(mp||(mp={})),(function(e){e.Error=1,e.Warning=2,e.Information=3,e.Hint=4})(Iv||(Iv={})),(function(e){e.Unnecessary=1,e.Deprecated=2})(Av||(Av={})),(function(e){function t(n){let i=n;return ne.objectLiteral(i)&&ne.string(i.href)}e.is=t})(Lv||(Lv={})),(function(e){function t(i,o,l,u,d,p){let g={range:i,message:o};return ne.defined(l)&&(g.severity=l),ne.defined(u)&&(g.code=u),ne.defined(d)&&(g.source=d),ne.defined(p)&&(g.relatedInformation=p),g}e.create=t;function n(i){var l;let o=i;return ne.defined(o)&&tn.is(o.range)&&ne.string(o.message)&&(ne.number(o.severity)||ne.undefined(o.severity))&&(ne.integer(o.code)||ne.string(o.code)||ne.undefined(o.code))&&(ne.undefined(o.codeDescription)||ne.string((l=o.codeDescription)==null?void 0:l.href))&&(ne.string(o.source)||ne.undefined(o.source))&&(ne.undefined(o.relatedInformation)||ne.typedArray(o.relatedInformation,mp.is))}e.is=n})(Yc||(Yc={})),(function(e){function t(i,o,...l){let u={title:i,command:o};return ne.defined(l)&&l.length>0&&(u.arguments=l),u}e.create=t;function n(i){let o=i;return ne.defined(o)&&ne.string(o.title)&&ne.string(o.command)}e.is=n})(Zo||(Zo={})),(function(e){function t(l,u){return{range:l,newText:u}}e.replace=t;function n(l,u){return{range:{start:l,end:l},newText:u}}e.insert=n;function i(l){return{range:l,newText:""}}e.del=i;function o(l){let u=l;return ne.objectLiteral(u)&&ne.string(u.newText)&&tn.is(u.range)}e.is=o})(Ti||(Ti={})),(function(e){function t(i,o,l){let u={label:i};return o!==void 0&&(u.needsConfirmation=o),l!==void 0&&(u.description=l),u}e.create=t;function n(i){let o=i;return ne.objectLiteral(o)&&ne.string(o.label)&&(ne.boolean(o.needsConfirmation)||o.needsConfirmation===void 0)&&(ne.string(o.description)||o.description===void 0)}e.is=n})(es||(es={})),(function(e){function t(n){let i=n;return ne.string(i)}e.is=t})(On||(On={})),(function(e){function t(l,u,d){return{range:l,newText:u,annotationId:d}}e.replace=t;function n(l,u,d){return{range:{start:l,end:l},newText:u,annotationId:d}}e.insert=n;function i(l,u){return{range:l,newText:"",annotationId:u}}e.del=i;function o(l){let u=l;return Ti.is(u)&&(es.is(u.annotationId)||On.is(u.annotationId))}e.is=o})(da||(da={})),(function(e){function t(i,o){return{textDocument:i,edits:o}}e.create=t;function n(i){let o=i;return ne.defined(o)&&eu.is(o.textDocument)&&Array.isArray(o.edits)}e.is=n})(Zc||(Zc={})),(function(e){function t(i,o,l){let u={kind:"create",uri:i};return o!==void 0&&(o.overwrite!==void 0||o.ignoreIfExists!==void 0)&&(u.options=o),l!==void 0&&(u.annotationId=l),u}e.create=t;function n(i){let o=i;return o&&o.kind==="create"&&ne.string(o.uri)&&(o.options===void 0||(o.options.overwrite===void 0||ne.boolean(o.options.overwrite))&&(o.options.ignoreIfExists===void 0||ne.boolean(o.options.ignoreIfExists)))&&(o.annotationId===void 0||On.is(o.annotationId))}e.is=n})(cl||(cl={})),(function(e){function t(i,o,l,u){let d={kind:"rename",oldUri:i,newUri:o};return l!==void 0&&(l.overwrite!==void 0||l.ignoreIfExists!==void 0)&&(d.options=l),u!==void 0&&(d.annotationId=u),d}e.create=t;function n(i){let o=i;return o&&o.kind==="rename"&&ne.string(o.oldUri)&&ne.string(o.newUri)&&(o.options===void 0||(o.options.overwrite===void 0||ne.boolean(o.options.overwrite))&&(o.options.ignoreIfExists===void 0||ne.boolean(o.options.ignoreIfExists)))&&(o.annotationId===void 0||On.is(o.annotationId))}e.is=n})(ul||(ul={})),(function(e){function t(i,o,l){let u={kind:"delete",uri:i};return o!==void 0&&(o.recursive!==void 0||o.ignoreIfNotExists!==void 0)&&(u.options=o),l!==void 0&&(u.annotationId=l),u}e.create=t;function n(i){let o=i;return o&&o.kind==="delete"&&ne.string(o.uri)&&(o.options===void 0||(o.options.recursive===void 0||ne.boolean(o.options.recursive))&&(o.options.ignoreIfNotExists===void 0||ne.boolean(o.options.ignoreIfNotExists)))&&(o.annotationId===void 0||On.is(o.annotationId))}e.is=n})(dl||(dl={})),(function(e){function t(n){let i=n;return i&&(i.changes!==void 0||i.documentChanges!==void 0)&&(i.documentChanges===void 0||i.documentChanges.every(o=>ne.string(o.kind)?cl.is(o)||ul.is(o)||dl.is(o):Zc.is(o)))}e.is=t})(hp||(hp={})),fl=class{constructor(e,t){this.edits=e,this.changeAnnotations=t}insert(e,t,n){let i,o;if(n===void 0?i=Ti.insert(e,t):On.is(n)?(o=n,i=da.insert(e,t,n)):(this.assertChangeAnnotations(this.changeAnnotations),o=this.changeAnnotations.manage(n),i=da.insert(e,t,o)),this.edits.push(i),o!==void 0)return o}replace(e,t,n){let i,o;if(n===void 0?i=Ti.replace(e,t):On.is(n)?(o=n,i=da.replace(e,t,n)):(this.assertChangeAnnotations(this.changeAnnotations),o=this.changeAnnotations.manage(n),i=da.replace(e,t,o)),this.edits.push(i),o!==void 0)return o}delete(e,t){let n,i;if(t===void 0?n=Ti.del(e):On.is(t)?(i=t,n=da.del(e,t)):(this.assertChangeAnnotations(this.changeAnnotations),i=this.changeAnnotations.manage(t),n=da.del(e,i)),this.edits.push(n),i!==void 0)return i}add(e){this.edits.push(e)}all(){return this.edits}clear(){this.edits.splice(0,this.edits.length)}assertChangeAnnotations(e){if(e===void 0)throw Error("Text edit change is not configured to manage change annotations.")}},gp=class{constructor(e){this._annotations=e===void 0?Object.create(null):e,this._counter=0,this._size=0}all(){return this._annotations}get size(){return this._size}manage(e,t){let n;if(On.is(e)?n=e:(n=this.nextId(),t=e),this._annotations[n]!==void 0)throw Error(`Id ${n} is already in use.`);if(t===void 0)throw Error(`No annotation provided for id ${n}`);return this._annotations[n]=t,this._size++,n}nextId(){return this._counter++,this._counter.toString()}},Pv=class{constructor(e){this._textEditChanges=Object.create(null),e===void 0?this._workspaceEdit={}:(this._workspaceEdit=e,e.documentChanges?(this._changeAnnotations=new gp(e.changeAnnotations),e.changeAnnotations=this._changeAnnotations.all(),e.documentChanges.forEach(t=>{if(Zc.is(t)){let n=new fl(t.edits,this._changeAnnotations);this._textEditChanges[t.textDocument.uri]=n}})):e.changes&&Object.keys(e.changes).forEach(t=>{let n=new fl(e.changes[t]);this._textEditChanges[t]=n}))}get edit(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit}getTextEditChange(e){if(eu.is(e)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw Error("Workspace edit is not configured for document changes.");let t={uri:e.uri,version:e.version},n=this._textEditChanges[t.uri];if(!n){let i=[],o={textDocument:t,edits:i};this._workspaceEdit.documentChanges.push(o),n=new fl(i,this._changeAnnotations),this._textEditChanges[t.uri]=n}return n}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw Error("Workspace edit is not configured for normal text edit changes.");let t=this._textEditChanges[e];if(!t){let n=[];this._workspaceEdit.changes[e]=n,t=new fl(n),this._textEditChanges[e]=t}return t}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new gp,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())}initChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))}createFile(e,t,n){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw Error("Workspace edit is not configured for document changes.");let i;es.is(t)||On.is(t)?i=t:n=t;let o,l;if(i===void 0?o=cl.create(e,n):(l=On.is(i)?i:this._changeAnnotations.manage(i),o=cl.create(e,n,l)),this._workspaceEdit.documentChanges.push(o),l!==void 0)return l}renameFile(e,t,n,i){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw Error("Workspace edit is not configured for document changes.");let o;es.is(n)||On.is(n)?o=n:i=n;let l,u;if(o===void 0?l=ul.create(e,t,i):(u=On.is(o)?o:this._changeAnnotations.manage(o),l=ul.create(e,t,i,u)),this._workspaceEdit.documentChanges.push(l),u!==void 0)return u}deleteFile(e,t,n){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw Error("Workspace edit is not configured for document changes.");let i;es.is(t)||On.is(t)?i=t:n=t;let o,l;if(i===void 0?o=dl.create(e,n):(l=On.is(i)?i:this._changeAnnotations.manage(i),o=dl.create(e,n,l)),this._workspaceEdit.documentChanges.push(o),l!==void 0)return l}},(function(e){function t(i){return{uri:i}}e.create=t;function n(i){let o=i;return ne.defined(o)&&ne.string(o.uri)}e.is=n})(Ov||(Ov={})),(function(e){function t(i,o){return{uri:i,version:o}}e.create=t;function n(i){let o=i;return ne.defined(o)&&ne.string(o.uri)&&ne.integer(o.version)}e.is=n})(Mv||(Mv={})),(function(e){function t(i,o){return{uri:i,version:o}}e.create=t;function n(i){let o=i;return ne.defined(o)&&ne.string(o.uri)&&(o.version===null||ne.integer(o.version))}e.is=n})(eu||(eu={})),(function(e){function t(i,o,l,u){return{uri:i,languageId:o,version:l,text:u}}e.create=t;function n(i){let o=i;return ne.defined(o)&&ne.string(o.uri)&&ne.string(o.languageId)&&ne.integer(o.version)&&ne.string(o.text)}e.is=n})(Nv||(Nv={})),(function(e){e.PlainText="plaintext",e.Markdown="markdown";function t(n){let i=n;return i===e.PlainText||i===e.Markdown}e.is=t})(yp||(yp={})),(function(e){function t(n){let i=n;return ne.objectLiteral(n)&&yp.is(i.kind)&&ne.string(i.value)}e.is=t})(pl||(pl={})),(function(e){e.Text=1,e.Method=2,e.Function=3,e.Constructor=4,e.Field=5,e.Variable=6,e.Class=7,e.Interface=8,e.Module=9,e.Property=10,e.Unit=11,e.Value=12,e.Enum=13,e.Keyword=14,e.Snippet=15,e.Color=16,e.File=17,e.Reference=18,e.Folder=19,e.EnumMember=20,e.Constant=21,e.Struct=22,e.Event=23,e.Operator=24,e.TypeParameter=25})(jv||(jv={})),(function(e){e.PlainText=1,e.Snippet=2})(qv||(qv={})),(function(e){e.Deprecated=1})(zv||(zv={})),(function(e){function t(i,o,l){return{newText:i,insert:o,replace:l}}e.create=t;function n(i){let o=i;return o&&ne.string(o.newText)&&tn.is(o.insert)&&tn.is(o.replace)}e.is=n})(Fv||(Fv={})),(function(e){e.asIs=1,e.adjustIndentation=2})($v||($v={})),(function(e){function t(n){let i=n;return i&&(ne.string(i.detail)||i.detail===void 0)&&(ne.string(i.description)||i.description===void 0)}e.is=t})(Vv||(Vv={})),(function(e){function t(n){return{label:n}}e.create=t})(Hv||(Hv={})),(function(e){function t(n,i){return{items:n||[],isIncomplete:!!i}}e.create=t})(Bv||(Bv={})),(function(e){function t(i){return i.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}e.fromPlainText=t;function n(i){let o=i;return ne.string(o)||ne.objectLiteral(o)&&ne.string(o.language)&&ne.string(o.value)}e.is=n})(tu||(tu={})),(function(e){function t(n){let i=n;return!!i&&ne.objectLiteral(i)&&(pl.is(i.contents)||tu.is(i.contents)||ne.typedArray(i.contents,tu.is))&&(n.range===void 0||tn.is(n.range))}e.is=t})(Wv||(Wv={})),(function(e){function t(n,i){return i?{label:n,documentation:i}:{label:n}}e.create=t})(Uv||(Uv={})),(function(e){function t(n,i,...o){let l={label:n};return ne.defined(i)&&(l.documentation=i),ne.defined(o)?l.parameters=o:l.parameters=[],l}e.create=t})(Kv||(Kv={})),(function(e){e.Text=1,e.Read=2,e.Write=3})(Qv||(Qv={})),(function(e){function t(n,i){let o={range:n};return ne.number(i)&&(o.kind=i),o}e.create=t})(Gv||(Gv={})),(function(e){e.File=1,e.Module=2,e.Namespace=3,e.Package=4,e.Class=5,e.Method=6,e.Property=7,e.Field=8,e.Constructor=9,e.Enum=10,e.Interface=11,e.Function=12,e.Variable=13,e.Constant=14,e.String=15,e.Number=16,e.Boolean=17,e.Array=18,e.Object=19,e.Key=20,e.Null=21,e.EnumMember=22,e.Struct=23,e.Event=24,e.Operator=25,e.TypeParameter=26})(Xv||(Xv={})),(function(e){e.Deprecated=1})(Jv||(Jv={})),(function(e){function t(n,i,o,l,u){let d={name:n,kind:i,location:{uri:l,range:o}};return u&&(d.containerName=u),d}e.create=t})(Yv||(Yv={})),(function(e){function t(n,i,o,l){return l===void 0?{name:n,kind:i,location:{uri:o}}:{name:n,kind:i,location:{uri:o,range:l}}}e.create=t})(Zv||(Zv={})),(function(e){function t(i,o,l,u,d,p){let g={name:i,detail:o,kind:l,range:u,selectionRange:d};return p!==void 0&&(g.children=p),g}e.create=t;function n(i){let o=i;return o&&ne.string(o.name)&&ne.number(o.kind)&&tn.is(o.range)&&tn.is(o.selectionRange)&&(o.detail===void 0||ne.string(o.detail))&&(o.deprecated===void 0||ne.boolean(o.deprecated))&&(o.children===void 0||Array.isArray(o.children))&&(o.tags===void 0||Array.isArray(o.tags))}e.is=n})(e1||(e1={})),(function(e){e.Empty="",e.QuickFix="quickfix",e.Refactor="refactor",e.RefactorExtract="refactor.extract",e.RefactorInline="refactor.inline",e.RefactorRewrite="refactor.rewrite",e.Source="source",e.SourceOrganizeImports="source.organizeImports",e.SourceFixAll="source.fixAll"})(t1||(t1={})),(function(e){e.Invoked=1,e.Automatic=2})(nu||(nu={})),(function(e){function t(i,o,l){let u={diagnostics:i};return o!=null&&(u.only=o),l!=null&&(u.triggerKind=l),u}e.create=t;function n(i){let o=i;return ne.defined(o)&&ne.typedArray(o.diagnostics,Yc.is)&&(o.only===void 0||ne.typedArray(o.only,ne.string))&&(o.triggerKind===void 0||o.triggerKind===nu.Invoked||o.triggerKind===nu.Automatic)}e.is=n})(n1||(n1={})),(function(e){function t(i,o,l){let u={title:i},d=!0;return typeof o=="string"?(d=!1,u.kind=o):Zo.is(o)?u.command=o:u.edit=o,d&&l!==void 0&&(u.kind=l),u}e.create=t;function n(i){let o=i;return o&&ne.string(o.title)&&(o.diagnostics===void 0||ne.typedArray(o.diagnostics,Yc.is))&&(o.kind===void 0||ne.string(o.kind))&&(o.edit!==void 0||o.command!==void 0)&&(o.command===void 0||Zo.is(o.command))&&(o.isPreferred===void 0||ne.boolean(o.isPreferred))&&(o.edit===void 0||hp.is(o.edit))}e.is=n})(r1||(r1={})),(function(e){function t(i,o){let l={range:i};return ne.defined(o)&&(l.data=o),l}e.create=t;function n(i){let o=i;return ne.defined(o)&&tn.is(o.range)&&(ne.undefined(o.command)||Zo.is(o.command))}e.is=n})(i1||(i1={})),(function(e){function t(i,o){return{tabSize:i,insertSpaces:o}}e.create=t;function n(i){let o=i;return ne.defined(o)&&ne.uinteger(o.tabSize)&&ne.boolean(o.insertSpaces)}e.is=n})(a1||(a1={})),(function(e){function t(i,o,l){return{range:i,target:o,data:l}}e.create=t;function n(i){let o=i;return ne.defined(o)&&tn.is(o.range)&&(ne.undefined(o.target)||ne.string(o.target))}e.is=n})(o1||(o1={})),(function(e){function t(i,o){return{range:i,parent:o}}e.create=t;function n(i){let o=i;return ne.objectLiteral(o)&&tn.is(o.range)&&(o.parent===void 0||e.is(o.parent))}e.is=n})(s1||(s1={})),(function(e){e.namespace="namespace",e.type="type",e.class="class",e.enum="enum",e.interface="interface",e.struct="struct",e.typeParameter="typeParameter",e.parameter="parameter",e.variable="variable",e.property="property",e.enumMember="enumMember",e.event="event",e.function="function",e.method="method",e.macro="macro",e.keyword="keyword",e.modifier="modifier",e.comment="comment",e.string="string",e.number="number",e.regexp="regexp",e.operator="operator",e.decorator="decorator"})(l1||(l1={})),(function(e){e.declaration="declaration",e.definition="definition",e.readonly="readonly",e.static="static",e.deprecated="deprecated",e.abstract="abstract",e.async="async",e.modification="modification",e.documentation="documentation",e.defaultLibrary="defaultLibrary"})(c1||(c1={})),(function(e){function t(n){let i=n;return ne.objectLiteral(i)&&(i.resultId===void 0||typeof i.resultId=="string")&&Array.isArray(i.data)&&(i.data.length===0||typeof i.data[0]=="number")}e.is=t})(u1||(u1={})),(function(e){function t(i,o){return{range:i,text:o}}e.create=t;function n(i){let o=i;return o!=null&&tn.is(o.range)&&ne.string(o.text)}e.is=n})(d1||(d1={})),(function(e){function t(i,o,l){return{range:i,variableName:o,caseSensitiveLookup:l}}e.create=t;function n(i){let o=i;return o!=null&&tn.is(o.range)&&ne.boolean(o.caseSensitiveLookup)&&(ne.string(o.variableName)||o.variableName===void 0)}e.is=n})(f1||(f1={})),(function(e){function t(i,o){return{range:i,expression:o}}e.create=t;function n(i){let o=i;return o!=null&&tn.is(o.range)&&(ne.string(o.expression)||o.expression===void 0)}e.is=n})(p1||(p1={})),(function(e){function t(i,o){return{frameId:i,stoppedLocation:o}}e.create=t;function n(i){let o=i;return ne.defined(o)&&tn.is(i.stoppedLocation)}e.is=n})(m1||(m1={})),(function(e){e.Type=1,e.Parameter=2;function t(n){return n===1||n===2}e.is=t})(vp||(vp={})),(function(e){function t(i){return{value:i}}e.create=t;function n(i){let o=i;return ne.objectLiteral(o)&&(o.tooltip===void 0||ne.string(o.tooltip)||pl.is(o.tooltip))&&(o.location===void 0||Jc.is(o.location))&&(o.command===void 0||Zo.is(o.command))}e.is=n})(bp||(bp={})),(function(e){function t(i,o,l){let u={position:i,label:o};return l!==void 0&&(u.kind=l),u}e.create=t;function n(i){let o=i;return ne.objectLiteral(o)&&Gr.is(o.position)&&(ne.string(o.label)||ne.typedArray(o.label,bp.is))&&(o.kind===void 0||vp.is(o.kind))&&o.textEdits===void 0||ne.typedArray(o.textEdits,Ti.is)&&(o.tooltip===void 0||ne.string(o.tooltip)||pl.is(o.tooltip))&&(o.paddingLeft===void 0||ne.boolean(o.paddingLeft))&&(o.paddingRight===void 0||ne.boolean(o.paddingRight))}e.is=n})(h1||(h1={})),(function(e){function t(n){return{kind:"snippet",value:n}}e.createSnippet=t})(g1||(g1={})),(function(e){function t(n,i,o,l){return{insertText:n,filterText:i,range:o,command:l}}e.create=t})(y1||(y1={})),(function(e){function t(n){return{items:n}}e.create=t})(v1||(v1={})),(function(e){e.Invoked=0,e.Automatic=1})(b1||(b1={})),(function(e){function t(n,i){return{range:n,text:i}}e.create=t})(w1||(w1={})),(function(e){function t(n,i){return{triggerKind:n,selectedCompletionInfo:i}}e.create=t})(x1||(x1={})),(function(e){function t(n){let i=n;return ne.objectLiteral(i)&&fp.is(i.uri)&&ne.string(i.name)}e.is=t})(_1||(_1={})),k1=[`
|
|
44
44
|
`,`\r
|
|
45
45
|
`,"\r"],(function(e){function t(l,u,d,p){return new S1(l,u,d,p)}e.create=t;function n(l){let u=l;return!!(ne.defined(u)&&ne.string(u.uri)&&(ne.undefined(u.languageId)||ne.string(u.languageId))&&ne.uinteger(u.lineCount)&&ne.func(u.getText)&&ne.func(u.positionAt)&&ne.func(u.offsetAt))}e.is=n;function i(l,u){let d=l.getText(),p=o(u,(w,x)=>{let S=w.range.start.line-x.range.start.line;return S===0?w.range.start.character-x.range.start.character:S}),g=d.length;for(let w=p.length-1;w>=0;w--){let x=p[w],S=l.offsetAt(x.range.start),E=l.offsetAt(x.range.end);if(E<=g)d=d.substring(0,S)+x.newText+d.substring(E,d.length);else throw Error("Overlapping edit");g=S}return d}e.applyEdits=i;function o(l,u){if(l.length<=1)return l;let d=l.length/2|0,p=l.slice(0,d),g=l.slice(d);o(p,u),o(g,u);let w=0,x=0,S=0;for(;w<p.length&&x<g.length;)u(p[w],g[x])<=0?l[S++]=p[w++]:l[S++]=g[x++];for(;w<p.length;)l[S++]=p[w++];for(;x<g.length;)l[S++]=g[x++];return l}})(C1||(C1={})),S1=class{constructor(e,t,n,i){this._uri=e,this._languageId=t,this._version=n,this._content=i,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let t=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(t,n)}return this._content}update(e,t){this._content=e.text,this._version=t,this._lineOffsets=void 0}getLineOffsets(){if(this._lineOffsets===void 0){let e=[],t=this._content,n=!0;for(let i=0;i<t.length;i++){n&&(n=(e.push(i),!1));let o=t.charAt(i);n=o==="\r"||o===`
|
|
46
46
|
`,o==="\r"&&i+1<t.length&&t.charAt(i+1)===`
|
|
47
|
-
`&&i++}n&&t.length>0&&e.push(t.length),this._lineOffsets=e}return this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let t=this.getLineOffsets(),n=0,i=t.length;if(i===0)return Gr.create(0,e);for(;n<i;){let l=Math.floor((n+i)/2);t[l]>e?i=l:n=l+1}let o=n-1;return Gr.create(o,e-t[o])}offsetAt(e){let t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;let n=t[e.line],i=e.line+1<t.length?t[e.line+1]:this._content.length;return Math.max(Math.min(n+e.character,i),n)}get lineCount(){return this.getLineOffsets().length}},(function(e){let t=Object.prototype.toString;function n(E){return E!==void 0}e.defined=n;function i(E){return E===void 0}e.undefined=i;function o(E){return E===!0||E===!1}e.boolean=o;function l(E){return t.call(E)==="[object String]"}e.string=l;function u(E){return t.call(E)==="[object Number]"}e.number=u;function d(E,T,O){return t.call(E)==="[object Number]"&&T<=E&&E<=O}e.numberRange=d;function p(E){return t.call(E)==="[object Number]"&&-2147483648<=E&&E<=2147483647}e.integer=p;function g(E){return t.call(E)==="[object Number]"&&0<=E&&E<=2147483647}e.uinteger=g;function w(E){return t.call(E)==="[object Function]"}e.func=w;function x(E){return typeof E=="object"&&!!E}e.objectLiteral=x;function S(E,T){return Array.isArray(E)&&E.every(T)}e.typedArray=S})(ne||(ne={}))})),Ut=Pe((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ProtocolNotificationType=e.ProtocolNotificationType0=e.ProtocolRequestType=e.ProtocolRequestType0=e.RegistrationType=e.MessageDirection=void 0;var t=eo(),n;(function(i){i.clientToServer="clientToServer",i.serverToClient="serverToClient",i.both="both"})(n||(e.MessageDirection=n={})),e.RegistrationType=class{constructor(i){this.method=i}},e.ProtocolRequestType0=class extends t.RequestType0{constructor(i){super(i)}},e.ProtocolRequestType=class extends t.RequestType{constructor(i){super(i,t.ParameterStructures.byName)}},e.ProtocolNotificationType0=class extends t.NotificationType0{constructor(i){super(i)}},e.ProtocolNotificationType=class extends t.NotificationType{constructor(i){super(i,t.ParameterStructures.byName)}}})),ru=Pe((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.objectLiteral=e.typedArray=e.stringArray=e.array=e.func=e.error=e.number=e.string=e.boolean=void 0;function t(w){return w===!0||w===!1}e.boolean=t;function n(w){return typeof w=="string"||w instanceof String}e.string=n;function i(w){return typeof w=="number"||w instanceof Number}e.number=i;function o(w){return w instanceof Error}e.error=o;function l(w){return typeof w=="function"}e.func=l;function u(w){return Array.isArray(w)}e.array=u;function d(w){return u(w)&&w.every(x=>n(x))}e.stringArray=d;function p(w,x){return Array.isArray(w)&&w.every(x)}e.typedArray=p;function g(w){return typeof w=="object"&&!!w}e.objectLiteral=g})),E1=Pe((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ImplementationRequest=void 0;var t=Ut(),n;(function(i){i.method="textDocument/implementation",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(n||(e.ImplementationRequest=n={}))})),T1=Pe((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TypeDefinitionRequest=void 0;var t=Ut(),n;(function(i){i.method="textDocument/typeDefinition",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(n||(e.TypeDefinitionRequest=n={}))})),D1=Pe((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DidChangeWorkspaceFoldersNotification=e.WorkspaceFoldersRequest=void 0;var t=Ut(),n;(function(o){o.method="workspace/workspaceFolders",o.messageDirection=t.MessageDirection.serverToClient,o.type=new t.ProtocolRequestType0(o.method)})(n||(e.WorkspaceFoldersRequest=n={}));var i;(function(o){o.method="workspace/didChangeWorkspaceFolders",o.messageDirection=t.MessageDirection.clientToServer,o.type=new t.ProtocolNotificationType(o.method)})(i||(e.DidChangeWorkspaceFoldersNotification=i={}))})),R1=Pe((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ConfigurationRequest=void 0;var t=Ut(),n;(function(i){i.method="workspace/configuration",i.messageDirection=t.MessageDirection.serverToClient,i.type=new t.ProtocolRequestType(i.method)})(n||(e.ConfigurationRequest=n={}))})),I1=Pe((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ColorPresentationRequest=e.DocumentColorRequest=void 0;var t=Ut(),n;(function(o){o.method="textDocument/documentColor",o.messageDirection=t.MessageDirection.clientToServer,o.type=new t.ProtocolRequestType(o.method)})(n||(e.DocumentColorRequest=n={}));var i;(function(o){o.method="textDocument/colorPresentation",o.messageDirection=t.MessageDirection.clientToServer,o.type=new t.ProtocolRequestType(o.method)})(i||(e.ColorPresentationRequest=i={}))})),A1=Pe((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.FoldingRangeRefreshRequest=e.FoldingRangeRequest=void 0;var t=Ut(),n;(function(o){o.method="textDocument/foldingRange",o.messageDirection=t.MessageDirection.clientToServer,o.type=new t.ProtocolRequestType(o.method)})(n||(e.FoldingRangeRequest=n={}));var i;(function(o){o.method="workspace/foldingRange/refresh",o.messageDirection=t.MessageDirection.serverToClient,o.type=new t.ProtocolRequestType0(o.method)})(i||(e.FoldingRangeRefreshRequest=i={}))})),L1=Pe((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DeclarationRequest=void 0;var t=Ut(),n;(function(i){i.method="textDocument/declaration",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(n||(e.DeclarationRequest=n={}))})),P1=Pe((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SelectionRangeRequest=void 0;var t=Ut(),n;(function(i){i.method="textDocument/selectionRange",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(n||(e.SelectionRangeRequest=n={}))})),O1=Pe((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.WorkDoneProgressCancelNotification=e.WorkDoneProgressCreateRequest=e.WorkDoneProgress=void 0;var t=eo(),n=Ut(),i;(function(u){u.type=new t.ProgressType;function d(p){return p===u.type}u.is=d})(i||(e.WorkDoneProgress=i={}));var o;(function(u){u.method="window/workDoneProgress/create",u.messageDirection=n.MessageDirection.serverToClient,u.type=new n.ProtocolRequestType(u.method)})(o||(e.WorkDoneProgressCreateRequest=o={}));var l;(function(u){u.method="window/workDoneProgress/cancel",u.messageDirection=n.MessageDirection.clientToServer,u.type=new n.ProtocolNotificationType(u.method)})(l||(e.WorkDoneProgressCancelNotification=l={}))})),M1=Pe((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CallHierarchyOutgoingCallsRequest=e.CallHierarchyIncomingCallsRequest=e.CallHierarchyPrepareRequest=void 0;var t=Ut(),n;(function(l){l.method="textDocument/prepareCallHierarchy",l.messageDirection=t.MessageDirection.clientToServer,l.type=new t.ProtocolRequestType(l.method)})(n||(e.CallHierarchyPrepareRequest=n={}));var i;(function(l){l.method="callHierarchy/incomingCalls",l.messageDirection=t.MessageDirection.clientToServer,l.type=new t.ProtocolRequestType(l.method)})(i||(e.CallHierarchyIncomingCallsRequest=i={}));var o;(function(l){l.method="callHierarchy/outgoingCalls",l.messageDirection=t.MessageDirection.clientToServer,l.type=new t.ProtocolRequestType(l.method)})(o||(e.CallHierarchyOutgoingCallsRequest=o={}))})),N1=Pe((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SemanticTokensRefreshRequest=e.SemanticTokensRangeRequest=e.SemanticTokensDeltaRequest=e.SemanticTokensRequest=e.SemanticTokensRegistrationType=e.TokenFormat=void 0;var t=Ut(),n;(function(p){p.Relative="relative"})(n||(e.TokenFormat=n={}));var i;(function(p){p.method="textDocument/semanticTokens",p.type=new t.RegistrationType(p.method)})(i||(e.SemanticTokensRegistrationType=i={}));var o;(function(p){p.method="textDocument/semanticTokens/full",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method),p.registrationMethod=i.method})(o||(e.SemanticTokensRequest=o={}));var l;(function(p){p.method="textDocument/semanticTokens/full/delta",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method),p.registrationMethod=i.method})(l||(e.SemanticTokensDeltaRequest=l={}));var u;(function(p){p.method="textDocument/semanticTokens/range",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method),p.registrationMethod=i.method})(u||(e.SemanticTokensRangeRequest=u={}));var d;(function(p){p.method="workspace/semanticTokens/refresh",p.messageDirection=t.MessageDirection.serverToClient,p.type=new t.ProtocolRequestType0(p.method)})(d||(e.SemanticTokensRefreshRequest=d={}))})),j1=Pe((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ShowDocumentRequest=void 0;var t=Ut(),n;(function(i){i.method="window/showDocument",i.messageDirection=t.MessageDirection.serverToClient,i.type=new t.ProtocolRequestType(i.method)})(n||(e.ShowDocumentRequest=n={}))})),q1=Pe((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.LinkedEditingRangeRequest=void 0;var t=Ut(),n;(function(i){i.method="textDocument/linkedEditingRange",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(n||(e.LinkedEditingRangeRequest=n={}))})),z1=Pe((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.WillDeleteFilesRequest=e.DidDeleteFilesNotification=e.DidRenameFilesNotification=e.WillRenameFilesRequest=e.DidCreateFilesNotification=e.WillCreateFilesRequest=e.FileOperationPatternKind=void 0;var t=Ut(),n;(function(g){g.file="file",g.folder="folder"})(n||(e.FileOperationPatternKind=n={}));var i;(function(g){g.method="workspace/willCreateFiles",g.messageDirection=t.MessageDirection.clientToServer,g.type=new t.ProtocolRequestType(g.method)})(i||(e.WillCreateFilesRequest=i={}));var o;(function(g){g.method="workspace/didCreateFiles",g.messageDirection=t.MessageDirection.clientToServer,g.type=new t.ProtocolNotificationType(g.method)})(o||(e.DidCreateFilesNotification=o={}));var l;(function(g){g.method="workspace/willRenameFiles",g.messageDirection=t.MessageDirection.clientToServer,g.type=new t.ProtocolRequestType(g.method)})(l||(e.WillRenameFilesRequest=l={}));var u;(function(g){g.method="workspace/didRenameFiles",g.messageDirection=t.MessageDirection.clientToServer,g.type=new t.ProtocolNotificationType(g.method)})(u||(e.DidRenameFilesNotification=u={}));var d;(function(g){g.method="workspace/didDeleteFiles",g.messageDirection=t.MessageDirection.clientToServer,g.type=new t.ProtocolNotificationType(g.method)})(d||(e.DidDeleteFilesNotification=d={}));var p;(function(g){g.method="workspace/willDeleteFiles",g.messageDirection=t.MessageDirection.clientToServer,g.type=new t.ProtocolRequestType(g.method)})(p||(e.WillDeleteFilesRequest=p={}))})),F1=Pe((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MonikerRequest=e.MonikerKind=e.UniquenessLevel=void 0;var t=Ut(),n;(function(l){l.document="document",l.project="project",l.group="group",l.scheme="scheme",l.global="global"})(n||(e.UniquenessLevel=n={}));var i;(function(l){l.$import="import",l.$export="export",l.local="local"})(i||(e.MonikerKind=i={}));var o;(function(l){l.method="textDocument/moniker",l.messageDirection=t.MessageDirection.clientToServer,l.type=new t.ProtocolRequestType(l.method)})(o||(e.MonikerRequest=o={}))})),$1=Pe((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TypeHierarchySubtypesRequest=e.TypeHierarchySupertypesRequest=e.TypeHierarchyPrepareRequest=void 0;var t=Ut(),n;(function(l){l.method="textDocument/prepareTypeHierarchy",l.messageDirection=t.MessageDirection.clientToServer,l.type=new t.ProtocolRequestType(l.method)})(n||(e.TypeHierarchyPrepareRequest=n={}));var i;(function(l){l.method="typeHierarchy/supertypes",l.messageDirection=t.MessageDirection.clientToServer,l.type=new t.ProtocolRequestType(l.method)})(i||(e.TypeHierarchySupertypesRequest=i={}));var o;(function(l){l.method="typeHierarchy/subtypes",l.messageDirection=t.MessageDirection.clientToServer,l.type=new t.ProtocolRequestType(l.method)})(o||(e.TypeHierarchySubtypesRequest=o={}))})),V1=Pe((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.InlineValueRefreshRequest=e.InlineValueRequest=void 0;var t=Ut(),n;(function(o){o.method="textDocument/inlineValue",o.messageDirection=t.MessageDirection.clientToServer,o.type=new t.ProtocolRequestType(o.method)})(n||(e.InlineValueRequest=n={}));var i;(function(o){o.method="workspace/inlineValue/refresh",o.messageDirection=t.MessageDirection.serverToClient,o.type=new t.ProtocolRequestType0(o.method)})(i||(e.InlineValueRefreshRequest=i={}))})),H1=Pe((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.InlayHintRefreshRequest=e.InlayHintResolveRequest=e.InlayHintRequest=void 0;var t=Ut(),n;(function(l){l.method="textDocument/inlayHint",l.messageDirection=t.MessageDirection.clientToServer,l.type=new t.ProtocolRequestType(l.method)})(n||(e.InlayHintRequest=n={}));var i;(function(l){l.method="inlayHint/resolve",l.messageDirection=t.MessageDirection.clientToServer,l.type=new t.ProtocolRequestType(l.method)})(i||(e.InlayHintResolveRequest=i={}));var o;(function(l){l.method="workspace/inlayHint/refresh",l.messageDirection=t.MessageDirection.serverToClient,l.type=new t.ProtocolRequestType0(l.method)})(o||(e.InlayHintRefreshRequest=o={}))})),B1=Pe((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DiagnosticRefreshRequest=e.WorkspaceDiagnosticRequest=e.DocumentDiagnosticRequest=e.DocumentDiagnosticReportKind=e.DiagnosticServerCancellationData=void 0;var t=eo(),n=ru(),i=Ut(),o;(function(g){function w(x){let S=x;return S&&n.boolean(S.retriggerRequest)}g.is=w})(o||(e.DiagnosticServerCancellationData=o={}));var l;(function(g){g.Full="full",g.Unchanged="unchanged"})(l||(e.DocumentDiagnosticReportKind=l={}));var u;(function(g){g.method="textDocument/diagnostic",g.messageDirection=i.MessageDirection.clientToServer,g.type=new i.ProtocolRequestType(g.method),g.partialResult=new t.ProgressType})(u||(e.DocumentDiagnosticRequest=u={}));var d;(function(g){g.method="workspace/diagnostic",g.messageDirection=i.MessageDirection.clientToServer,g.type=new i.ProtocolRequestType(g.method),g.partialResult=new t.ProgressType})(d||(e.WorkspaceDiagnosticRequest=d={}));var p;(function(g){g.method="workspace/diagnostic/refresh",g.messageDirection=i.MessageDirection.serverToClient,g.type=new i.ProtocolRequestType0(g.method)})(p||(e.DiagnosticRefreshRequest=p={}))})),W1=Pe((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DidCloseNotebookDocumentNotification=e.DidSaveNotebookDocumentNotification=e.DidChangeNotebookDocumentNotification=e.NotebookCellArrayChange=e.DidOpenNotebookDocumentNotification=e.NotebookDocumentSyncRegistrationType=e.NotebookDocument=e.NotebookCell=e.ExecutionSummary=e.NotebookCellKind=void 0;var t=(nu(),Cg(Qc)),n=ru(),i=Ut(),o;(function(T){T.Markup=1,T.Code=2;function O(j){return j===1||j===2}T.is=O})(o||(e.NotebookCellKind=o={}));var l;(function(T){function O(V,P){let U={executionOrder:V};return(P===!0||P===!1)&&(U.success=P),U}T.create=O;function j(V){let P=V;return n.objectLiteral(P)&&t.uinteger.is(P.executionOrder)&&(P.success===void 0||n.boolean(P.success))}T.is=j;function z(V,P){return V===P?!0:V==null||P==null?!1:V.executionOrder===P.executionOrder&&V.success===P.success}T.equals=z})(l||(e.ExecutionSummary=l={}));var u;(function(T){function O(P,U){return{kind:P,document:U}}T.create=O;function j(P){let U=P;return n.objectLiteral(U)&&o.is(U.kind)&&t.DocumentUri.is(U.document)&&(U.metadata===void 0||n.objectLiteral(U.metadata))}T.is=j;function z(P,U){let me=new Set;return P.document!==U.document&&me.add("document"),P.kind!==U.kind&&me.add("kind"),P.executionSummary!==U.executionSummary&&me.add("executionSummary"),(P.metadata!==void 0||U.metadata!==void 0)&&!V(P.metadata,U.metadata)&&me.add("metadata"),(P.executionSummary!==void 0||U.executionSummary!==void 0)&&!l.equals(P.executionSummary,U.executionSummary)&&me.add("executionSummary"),me}T.diff=z;function V(P,U){if(P===U)return!0;if(P==null||U==null||typeof P!=typeof U||typeof P!="object")return!1;let me=Array.isArray(P),$=Array.isArray(U);if(me!==$)return!1;if(me&&$){if(P.length!==U.length)return!1;for(let W=0;W<P.length;W++)if(!V(P[W],U[W]))return!1}if(n.objectLiteral(P)&&n.objectLiteral(U)){let W=Object.keys(P),ae=Object.keys(U);if(W.length!==ae.length||(W.sort(),ae.sort(),!V(W,ae)))return!1;for(let xe=0;xe<W.length;xe++){let _e=W[xe];if(!V(P[_e],U[_e]))return!1}}return!0}})(u||(e.NotebookCell=u={}));var d;(function(T){function O(z,V,P,U){return{uri:z,notebookType:V,version:P,cells:U}}T.create=O;function j(z){let V=z;return n.objectLiteral(V)&&n.string(V.uri)&&t.integer.is(V.version)&&n.typedArray(V.cells,u.is)}T.is=j})(d||(e.NotebookDocument=d={}));var p;(function(T){T.method="notebookDocument/sync",T.messageDirection=i.MessageDirection.clientToServer,T.type=new i.RegistrationType(T.method)})(p||(e.NotebookDocumentSyncRegistrationType=p={}));var g;(function(T){T.method="notebookDocument/didOpen",T.messageDirection=i.MessageDirection.clientToServer,T.type=new i.ProtocolNotificationType(T.method),T.registrationMethod=p.method})(g||(e.DidOpenNotebookDocumentNotification=g={}));var w;(function(T){function O(z){let V=z;return n.objectLiteral(V)&&t.uinteger.is(V.start)&&t.uinteger.is(V.deleteCount)&&(V.cells===void 0||n.typedArray(V.cells,u.is))}T.is=O;function j(z,V,P){let U={start:z,deleteCount:V};return P!==void 0&&(U.cells=P),U}T.create=j})(w||(e.NotebookCellArrayChange=w={}));var x;(function(T){T.method="notebookDocument/didChange",T.messageDirection=i.MessageDirection.clientToServer,T.type=new i.ProtocolNotificationType(T.method),T.registrationMethod=p.method})(x||(e.DidChangeNotebookDocumentNotification=x={}));var S;(function(T){T.method="notebookDocument/didSave",T.messageDirection=i.MessageDirection.clientToServer,T.type=new i.ProtocolNotificationType(T.method),T.registrationMethod=p.method})(S||(e.DidSaveNotebookDocumentNotification=S={}));var E;(function(T){T.method="notebookDocument/didClose",T.messageDirection=i.MessageDirection.clientToServer,T.type=new i.ProtocolNotificationType(T.method),T.registrationMethod=p.method})(E||(e.DidCloseNotebookDocumentNotification=E={}))})),U1=Pe((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.InlineCompletionRequest=void 0;var t=Ut(),n;(function(i){i.method="textDocument/inlineCompletion",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(n||(e.InlineCompletionRequest=n={}))})),K1=Pe((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.WorkspaceSymbolRequest=e.CodeActionResolveRequest=e.CodeActionRequest=e.DocumentSymbolRequest=e.DocumentHighlightRequest=e.ReferencesRequest=e.DefinitionRequest=e.SignatureHelpRequest=e.SignatureHelpTriggerKind=e.HoverRequest=e.CompletionResolveRequest=e.CompletionRequest=e.CompletionTriggerKind=e.PublishDiagnosticsNotification=e.WatchKind=e.RelativePattern=e.FileChangeType=e.DidChangeWatchedFilesNotification=e.WillSaveTextDocumentWaitUntilRequest=e.WillSaveTextDocumentNotification=e.TextDocumentSaveReason=e.DidSaveTextDocumentNotification=e.DidCloseTextDocumentNotification=e.DidChangeTextDocumentNotification=e.TextDocumentContentChangeEvent=e.DidOpenTextDocumentNotification=e.TextDocumentSyncKind=e.TelemetryEventNotification=e.LogMessageNotification=e.ShowMessageRequest=e.ShowMessageNotification=e.MessageType=e.DidChangeConfigurationNotification=e.ExitNotification=e.ShutdownRequest=e.InitializedNotification=e.InitializeErrorCodes=e.InitializeRequest=e.WorkDoneProgressOptions=e.TextDocumentRegistrationOptions=e.StaticRegistrationOptions=e.PositionEncodingKind=e.FailureHandlingKind=e.ResourceOperationKind=e.UnregistrationRequest=e.RegistrationRequest=e.DocumentSelector=e.NotebookCellTextDocumentFilter=e.NotebookDocumentFilter=e.TextDocumentFilter=void 0,e.MonikerRequest=e.MonikerKind=e.UniquenessLevel=e.WillDeleteFilesRequest=e.DidDeleteFilesNotification=e.WillRenameFilesRequest=e.DidRenameFilesNotification=e.WillCreateFilesRequest=e.DidCreateFilesNotification=e.FileOperationPatternKind=e.LinkedEditingRangeRequest=e.ShowDocumentRequest=e.SemanticTokensRegistrationType=e.SemanticTokensRefreshRequest=e.SemanticTokensRangeRequest=e.SemanticTokensDeltaRequest=e.SemanticTokensRequest=e.TokenFormat=e.CallHierarchyPrepareRequest=e.CallHierarchyOutgoingCallsRequest=e.CallHierarchyIncomingCallsRequest=e.WorkDoneProgressCancelNotification=e.WorkDoneProgressCreateRequest=e.WorkDoneProgress=e.SelectionRangeRequest=e.DeclarationRequest=e.FoldingRangeRefreshRequest=e.FoldingRangeRequest=e.ColorPresentationRequest=e.DocumentColorRequest=e.ConfigurationRequest=e.DidChangeWorkspaceFoldersNotification=e.WorkspaceFoldersRequest=e.TypeDefinitionRequest=e.ImplementationRequest=e.ApplyWorkspaceEditRequest=e.ExecuteCommandRequest=e.PrepareRenameRequest=e.RenameRequest=e.PrepareSupportDefaultBehavior=e.DocumentOnTypeFormattingRequest=e.DocumentRangesFormattingRequest=e.DocumentRangeFormattingRequest=e.DocumentFormattingRequest=e.DocumentLinkResolveRequest=e.DocumentLinkRequest=e.CodeLensRefreshRequest=e.CodeLensResolveRequest=e.CodeLensRequest=e.WorkspaceSymbolResolveRequest=void 0,e.InlineCompletionRequest=e.DidCloseNotebookDocumentNotification=e.DidSaveNotebookDocumentNotification=e.DidChangeNotebookDocumentNotification=e.NotebookCellArrayChange=e.DidOpenNotebookDocumentNotification=e.NotebookDocumentSyncRegistrationType=e.NotebookDocument=e.NotebookCell=e.ExecutionSummary=e.NotebookCellKind=e.DiagnosticRefreshRequest=e.WorkspaceDiagnosticRequest=e.DocumentDiagnosticRequest=e.DocumentDiagnosticReportKind=e.DiagnosticServerCancellationData=e.InlayHintRefreshRequest=e.InlayHintResolveRequest=e.InlayHintRequest=e.InlineValueRefreshRequest=e.InlineValueRequest=e.TypeHierarchySupertypesRequest=e.TypeHierarchySubtypesRequest=e.TypeHierarchyPrepareRequest=void 0;var t=Ut(),n=(nu(),Cg(Qc)),i=ru(),o=E1();Object.defineProperty(e,"ImplementationRequest",{enumerable:!0,get:function(){return o.ImplementationRequest}});var l=T1();Object.defineProperty(e,"TypeDefinitionRequest",{enumerable:!0,get:function(){return l.TypeDefinitionRequest}});var u=D1();Object.defineProperty(e,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return u.WorkspaceFoldersRequest}}),Object.defineProperty(e,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return u.DidChangeWorkspaceFoldersNotification}});var d=R1();Object.defineProperty(e,"ConfigurationRequest",{enumerable:!0,get:function(){return d.ConfigurationRequest}});var p=I1();Object.defineProperty(e,"DocumentColorRequest",{enumerable:!0,get:function(){return p.DocumentColorRequest}}),Object.defineProperty(e,"ColorPresentationRequest",{enumerable:!0,get:function(){return p.ColorPresentationRequest}});var g=A1();Object.defineProperty(e,"FoldingRangeRequest",{enumerable:!0,get:function(){return g.FoldingRangeRequest}}),Object.defineProperty(e,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return g.FoldingRangeRefreshRequest}});var w=L1();Object.defineProperty(e,"DeclarationRequest",{enumerable:!0,get:function(){return w.DeclarationRequest}});var x=P1();Object.defineProperty(e,"SelectionRangeRequest",{enumerable:!0,get:function(){return x.SelectionRangeRequest}});var S=O1();Object.defineProperty(e,"WorkDoneProgress",{enumerable:!0,get:function(){return S.WorkDoneProgress}}),Object.defineProperty(e,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return S.WorkDoneProgressCreateRequest}}),Object.defineProperty(e,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return S.WorkDoneProgressCancelNotification}});var E=M1();Object.defineProperty(e,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return E.CallHierarchyIncomingCallsRequest}}),Object.defineProperty(e,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return E.CallHierarchyOutgoingCallsRequest}}),Object.defineProperty(e,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return E.CallHierarchyPrepareRequest}});var T=N1();Object.defineProperty(e,"TokenFormat",{enumerable:!0,get:function(){return T.TokenFormat}}),Object.defineProperty(e,"SemanticTokensRequest",{enumerable:!0,get:function(){return T.SemanticTokensRequest}}),Object.defineProperty(e,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return T.SemanticTokensDeltaRequest}}),Object.defineProperty(e,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return T.SemanticTokensRangeRequest}}),Object.defineProperty(e,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return T.SemanticTokensRefreshRequest}}),Object.defineProperty(e,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return T.SemanticTokensRegistrationType}});var O=j1();Object.defineProperty(e,"ShowDocumentRequest",{enumerable:!0,get:function(){return O.ShowDocumentRequest}});var j=q1();Object.defineProperty(e,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return j.LinkedEditingRangeRequest}});var z=z1();Object.defineProperty(e,"FileOperationPatternKind",{enumerable:!0,get:function(){return z.FileOperationPatternKind}}),Object.defineProperty(e,"DidCreateFilesNotification",{enumerable:!0,get:function(){return z.DidCreateFilesNotification}}),Object.defineProperty(e,"WillCreateFilesRequest",{enumerable:!0,get:function(){return z.WillCreateFilesRequest}}),Object.defineProperty(e,"DidRenameFilesNotification",{enumerable:!0,get:function(){return z.DidRenameFilesNotification}}),Object.defineProperty(e,"WillRenameFilesRequest",{enumerable:!0,get:function(){return z.WillRenameFilesRequest}}),Object.defineProperty(e,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return z.DidDeleteFilesNotification}}),Object.defineProperty(e,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return z.WillDeleteFilesRequest}});var V=F1();Object.defineProperty(e,"UniquenessLevel",{enumerable:!0,get:function(){return V.UniquenessLevel}}),Object.defineProperty(e,"MonikerKind",{enumerable:!0,get:function(){return V.MonikerKind}}),Object.defineProperty(e,"MonikerRequest",{enumerable:!0,get:function(){return V.MonikerRequest}});var P=$1();Object.defineProperty(e,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return P.TypeHierarchyPrepareRequest}}),Object.defineProperty(e,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return P.TypeHierarchySubtypesRequest}}),Object.defineProperty(e,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return P.TypeHierarchySupertypesRequest}});var U=V1();Object.defineProperty(e,"InlineValueRequest",{enumerable:!0,get:function(){return U.InlineValueRequest}}),Object.defineProperty(e,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return U.InlineValueRefreshRequest}});var me=H1();Object.defineProperty(e,"InlayHintRequest",{enumerable:!0,get:function(){return me.InlayHintRequest}}),Object.defineProperty(e,"InlayHintResolveRequest",{enumerable:!0,get:function(){return me.InlayHintResolveRequest}}),Object.defineProperty(e,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return me.InlayHintRefreshRequest}});var $=B1();Object.defineProperty(e,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return $.DiagnosticServerCancellationData}}),Object.defineProperty(e,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return $.DocumentDiagnosticReportKind}}),Object.defineProperty(e,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return $.DocumentDiagnosticRequest}}),Object.defineProperty(e,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return $.WorkspaceDiagnosticRequest}}),Object.defineProperty(e,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return $.DiagnosticRefreshRequest}});var W=W1();Object.defineProperty(e,"NotebookCellKind",{enumerable:!0,get:function(){return W.NotebookCellKind}}),Object.defineProperty(e,"ExecutionSummary",{enumerable:!0,get:function(){return W.ExecutionSummary}}),Object.defineProperty(e,"NotebookCell",{enumerable:!0,get:function(){return W.NotebookCell}}),Object.defineProperty(e,"NotebookDocument",{enumerable:!0,get:function(){return W.NotebookDocument}}),Object.defineProperty(e,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return W.NotebookDocumentSyncRegistrationType}}),Object.defineProperty(e,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return W.DidOpenNotebookDocumentNotification}}),Object.defineProperty(e,"NotebookCellArrayChange",{enumerable:!0,get:function(){return W.NotebookCellArrayChange}}),Object.defineProperty(e,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return W.DidChangeNotebookDocumentNotification}}),Object.defineProperty(e,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return W.DidSaveNotebookDocumentNotification}}),Object.defineProperty(e,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return W.DidCloseNotebookDocumentNotification}});var ae=U1();Object.defineProperty(e,"InlineCompletionRequest",{enumerable:!0,get:function(){return ae.InlineCompletionRequest}});var xe;(function(A){function rt(q){let re=q;return i.string(re)||i.string(re.language)||i.string(re.scheme)||i.string(re.pattern)}A.is=rt})(xe||(e.TextDocumentFilter=xe={}));var _e;(function(A){function rt(q){let re=q;return i.objectLiteral(re)&&(i.string(re.notebookType)||i.string(re.scheme)||i.string(re.pattern))}A.is=rt})(_e||(e.NotebookDocumentFilter=_e={}));var Te;(function(A){function rt(q){let re=q;return i.objectLiteral(re)&&(i.string(re.notebook)||_e.is(re.notebook))&&(re.language===void 0||i.string(re.language))}A.is=rt})(Te||(e.NotebookCellTextDocumentFilter=Te={}));var Z;(function(A){function rt(q){if(!Array.isArray(q))return!1;for(let re of q)if(!i.string(re)&&!xe.is(re)&&!Te.is(re))return!1;return!0}A.is=rt})(Z||(e.DocumentSelector=Z={}));var Q;(function(A){A.method="client/registerCapability",A.messageDirection=t.MessageDirection.serverToClient,A.type=new t.ProtocolRequestType(A.method)})(Q||(e.RegistrationRequest=Q={}));var Y;(function(A){A.method="client/unregisterCapability",A.messageDirection=t.MessageDirection.serverToClient,A.type=new t.ProtocolRequestType(A.method)})(Y||(e.UnregistrationRequest=Y={}));var ce;(function(A){A.Create="create",A.Rename="rename",A.Delete="delete"})(ce||(e.ResourceOperationKind=ce={}));var te;(function(A){A.Abort="abort",A.Transactional="transactional",A.TextOnlyTransactional="textOnlyTransactional",A.Undo="undo"})(te||(e.FailureHandlingKind=te={}));var he;(function(A){A.UTF8="utf-8",A.UTF16="utf-16",A.UTF32="utf-32"})(he||(e.PositionEncodingKind=he={}));var G;(function(A){function rt(q){let re=q;return re&&i.string(re.id)&&re.id.length>0}A.hasId=rt})(G||(e.StaticRegistrationOptions=G={}));var Ne;(function(A){function rt(q){let re=q;return re&&(re.documentSelector===null||Z.is(re.documentSelector))}A.is=rt})(Ne||(e.TextDocumentRegistrationOptions=Ne={}));var qe;(function(A){function rt(re){let we=re;return i.objectLiteral(we)&&(we.workDoneProgress===void 0||i.boolean(we.workDoneProgress))}A.is=rt;function q(re){let we=re;return we&&i.boolean(we.workDoneProgress)}A.hasWorkDoneProgress=q})(qe||(e.WorkDoneProgressOptions=qe={}));var Qe;(function(A){A.method="initialize",A.messageDirection=t.MessageDirection.clientToServer,A.type=new t.ProtocolRequestType(A.method)})(Qe||(e.InitializeRequest=Qe={}));var He;(function(A){A.unknownProtocolVersion=1})(He||(e.InitializeErrorCodes=He={}));var Fe;(function(A){A.method="initialized",A.messageDirection=t.MessageDirection.clientToServer,A.type=new t.ProtocolNotificationType(A.method)})(Fe||(e.InitializedNotification=Fe={}));var Oe;(function(A){A.method="shutdown",A.messageDirection=t.MessageDirection.clientToServer,A.type=new t.ProtocolRequestType0(A.method)})(Oe||(e.ShutdownRequest=Oe={}));var Be;(function(A){A.method="exit",A.messageDirection=t.MessageDirection.clientToServer,A.type=new t.ProtocolNotificationType0(A.method)})(Be||(e.ExitNotification=Be={}));var gt;(function(A){A.method="workspace/didChangeConfiguration",A.messageDirection=t.MessageDirection.clientToServer,A.type=new t.ProtocolNotificationType(A.method)})(gt||(e.DidChangeConfigurationNotification=gt={}));var bt;(function(A){A.Error=1,A.Warning=2,A.Info=3,A.Log=4,A.Debug=5})(bt||(e.MessageType=bt={}));var Mn;(function(A){A.method="window/showMessage",A.messageDirection=t.MessageDirection.serverToClient,A.type=new t.ProtocolNotificationType(A.method)})(Mn||(e.ShowMessageNotification=Mn={}));var gn;(function(A){A.method="window/showMessageRequest",A.messageDirection=t.MessageDirection.serverToClient,A.type=new t.ProtocolRequestType(A.method)})(gn||(e.ShowMessageRequest=gn={}));var Xe;(function(A){A.method="window/logMessage",A.messageDirection=t.MessageDirection.serverToClient,A.type=new t.ProtocolNotificationType(A.method)})(Xe||(e.LogMessageNotification=Xe={}));var cn;(function(A){A.method="telemetry/event",A.messageDirection=t.MessageDirection.serverToClient,A.type=new t.ProtocolNotificationType(A.method)})(cn||(e.TelemetryEventNotification=cn={}));var Ct;(function(A){A.None=0,A.Full=1,A.Incremental=2})(Ct||(e.TextDocumentSyncKind=Ct={}));var kn;(function(A){A.method="textDocument/didOpen",A.messageDirection=t.MessageDirection.clientToServer,A.type=new t.ProtocolNotificationType(A.method)})(kn||(e.DidOpenTextDocumentNotification=kn={}));var Lr;(function(A){function rt(re){let we=re;return we!=null&&typeof we.text=="string"&&we.range!==void 0&&(we.rangeLength===void 0||typeof we.rangeLength=="number")}A.isIncremental=rt;function q(re){let we=re;return we!=null&&typeof we.text=="string"&&we.range===void 0&&we.rangeLength===void 0}A.isFull=q})(Lr||(e.TextDocumentContentChangeEvent=Lr={}));var yt;(function(A){A.method="textDocument/didChange",A.messageDirection=t.MessageDirection.clientToServer,A.type=new t.ProtocolNotificationType(A.method)})(yt||(e.DidChangeTextDocumentNotification=yt={}));var Yr;(function(A){A.method="textDocument/didClose",A.messageDirection=t.MessageDirection.clientToServer,A.type=new t.ProtocolNotificationType(A.method)})(Yr||(e.DidCloseTextDocumentNotification=Yr={}));var un;(function(A){A.method="textDocument/didSave",A.messageDirection=t.MessageDirection.clientToServer,A.type=new t.ProtocolNotificationType(A.method)})(un||(e.DidSaveTextDocumentNotification=un={}));var Ri;(function(A){A.Manual=1,A.AfterDelay=2,A.FocusOut=3})(Ri||(e.TextDocumentSaveReason=Ri={}));var Nn;(function(A){A.method="textDocument/willSave",A.messageDirection=t.MessageDirection.clientToServer,A.type=new t.ProtocolNotificationType(A.method)})(Nn||(e.WillSaveTextDocumentNotification=Nn={}));var Pr;(function(A){A.method="textDocument/willSaveWaitUntil",A.messageDirection=t.MessageDirection.clientToServer,A.type=new t.ProtocolRequestType(A.method)})(Pr||(e.WillSaveTextDocumentWaitUntilRequest=Pr={}));var jn;(function(A){A.method="workspace/didChangeWatchedFiles",A.messageDirection=t.MessageDirection.clientToServer,A.type=new t.ProtocolNotificationType(A.method)})(jn||(e.DidChangeWatchedFilesNotification=jn={}));var yn;(function(A){A.Created=1,A.Changed=2,A.Deleted=3})(yn||(e.FileChangeType=yn={}));var wa;(function(A){function rt(q){let re=q;return i.objectLiteral(re)&&(n.URI.is(re.baseUri)||n.WorkspaceFolder.is(re.baseUri))&&i.string(re.pattern)}A.is=rt})(wa||(e.RelativePattern=wa={}));var Ii;(function(A){A.Create=1,A.Change=2,A.Delete=4})(Ii||(e.WatchKind=Ii={}));var Yt;(function(A){A.method="textDocument/publishDiagnostics",A.messageDirection=t.MessageDirection.serverToClient,A.type=new t.ProtocolNotificationType(A.method)})(Yt||(e.PublishDiagnosticsNotification=Yt={}));var Ai;(function(A){A.Invoked=1,A.TriggerCharacter=2,A.TriggerForIncompleteCompletions=3})(Ai||(e.CompletionTriggerKind=Ai={}));var vn;(function(A){A.method="textDocument/completion",A.messageDirection=t.MessageDirection.clientToServer,A.type=new t.ProtocolRequestType(A.method)})(vn||(e.CompletionRequest=vn={}));var hi;(function(A){A.method="completionItem/resolve",A.messageDirection=t.MessageDirection.clientToServer,A.type=new t.ProtocolRequestType(A.method)})(hi||(e.CompletionResolveRequest=hi={}));var Vt;(function(A){A.method="textDocument/hover",A.messageDirection=t.MessageDirection.clientToServer,A.type=new t.ProtocolRequestType(A.method)})(Vt||(e.HoverRequest=Vt={}));var Zr;(function(A){A.Invoked=1,A.TriggerCharacter=2,A.ContentChange=3})(Zr||(e.SignatureHelpTriggerKind=Zr={}));var St;(function(A){A.method="textDocument/signatureHelp",A.messageDirection=t.MessageDirection.clientToServer,A.type=new t.ProtocolRequestType(A.method)})(St||(e.SignatureHelpRequest=St={}));var Li;(function(A){A.method="textDocument/definition",A.messageDirection=t.MessageDirection.clientToServer,A.type=new t.ProtocolRequestType(A.method)})(Li||(e.DefinitionRequest=Li={}));var xa;(function(A){A.method="textDocument/references",A.messageDirection=t.MessageDirection.clientToServer,A.type=new t.ProtocolRequestType(A.method)})(xa||(e.ReferencesRequest=xa={}));var Or;(function(A){A.method="textDocument/documentHighlight",A.messageDirection=t.MessageDirection.clientToServer,A.type=new t.ProtocolRequestType(A.method)})(Or||(e.DocumentHighlightRequest=Or={}));var rn;(function(A){A.method="textDocument/documentSymbol",A.messageDirection=t.MessageDirection.clientToServer,A.type=new t.ProtocolRequestType(A.method)})(rn||(e.DocumentSymbolRequest=rn={}));var et;(function(A){A.method="textDocument/codeAction",A.messageDirection=t.MessageDirection.clientToServer,A.type=new t.ProtocolRequestType(A.method)})(et||(e.CodeActionRequest=et={}));var wt;(function(A){A.method="codeAction/resolve",A.messageDirection=t.MessageDirection.clientToServer,A.type=new t.ProtocolRequestType(A.method)})(wt||(e.CodeActionResolveRequest=wt={}));var Et;(function(A){A.method="workspace/symbol",A.messageDirection=t.MessageDirection.clientToServer,A.type=new t.ProtocolRequestType(A.method)})(Et||(e.WorkspaceSymbolRequest=Et={}));var Tt;(function(A){A.method="workspaceSymbol/resolve",A.messageDirection=t.MessageDirection.clientToServer,A.type=new t.ProtocolRequestType(A.method)})(Tt||(e.WorkspaceSymbolResolveRequest=Tt={}));var Bn;(function(A){A.method="textDocument/codeLens",A.messageDirection=t.MessageDirection.clientToServer,A.type=new t.ProtocolRequestType(A.method)})(Bn||(e.CodeLensRequest=Bn={}));var Mr;(function(A){A.method="codeLens/resolve",A.messageDirection=t.MessageDirection.clientToServer,A.type=new t.ProtocolRequestType(A.method)})(Mr||(e.CodeLensResolveRequest=Mr={}));var Dt;(function(A){A.method="workspace/codeLens/refresh",A.messageDirection=t.MessageDirection.serverToClient,A.type=new t.ProtocolRequestType0(A.method)})(Dt||(e.CodeLensRefreshRequest=Dt={}));var fr;(function(A){A.method="textDocument/documentLink",A.messageDirection=t.MessageDirection.clientToServer,A.type=new t.ProtocolRequestType(A.method)})(fr||(e.DocumentLinkRequest=fr={}));var qn;(function(A){A.method="documentLink/resolve",A.messageDirection=t.MessageDirection.clientToServer,A.type=new t.ProtocolRequestType(A.method)})(qn||(e.DocumentLinkResolveRequest=qn={}));var ei;(function(A){A.method="textDocument/formatting",A.messageDirection=t.MessageDirection.clientToServer,A.type=new t.ProtocolRequestType(A.method)})(ei||(e.DocumentFormattingRequest=ei={}));var Cn;(function(A){A.method="textDocument/rangeFormatting",A.messageDirection=t.MessageDirection.clientToServer,A.type=new t.ProtocolRequestType(A.method)})(Cn||(e.DocumentRangeFormattingRequest=Cn={}));var pr;(function(A){A.method="textDocument/rangesFormatting",A.messageDirection=t.MessageDirection.clientToServer,A.type=new t.ProtocolRequestType(A.method)})(pr||(e.DocumentRangesFormattingRequest=pr={}));var Pi;(function(A){A.method="textDocument/onTypeFormatting",A.messageDirection=t.MessageDirection.clientToServer,A.type=new t.ProtocolRequestType(A.method)})(Pi||(e.DocumentOnTypeFormattingRequest=Pi={}));var gi;(function(A){A.Identifier=1})(gi||(e.PrepareSupportDefaultBehavior=gi={}));var zn;(function(A){A.method="textDocument/rename",A.messageDirection=t.MessageDirection.clientToServer,A.type=new t.ProtocolRequestType(A.method)})(zn||(e.RenameRequest=zn={}));var Oi;(function(A){A.method="textDocument/prepareRename",A.messageDirection=t.MessageDirection.clientToServer,A.type=new t.ProtocolRequestType(A.method)})(Oi||(e.PrepareRenameRequest=Oi={}));var Wn;(function(A){A.method="workspace/executeCommand",A.messageDirection=t.MessageDirection.clientToServer,A.type=new t.ProtocolRequestType(A.method)})(Wn||(e.ExecuteCommandRequest=Wn={}));var mr;(function(A){A.method="workspace/applyEdit",A.messageDirection=t.MessageDirection.serverToClient,A.type=new t.ProtocolRequestType("workspace/applyEdit")})(mr||(e.ApplyWorkspaceEditRequest=mr={}))})),Q1=Pe((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createProtocolConnection=void 0;var t=eo();function n(i,o,l,u){return t.ConnectionStrategy.is(u)&&(u={connectionStrategy:u}),(0,t.createMessageConnection)(i,o,l,u)}e.createProtocolConnection=n})),G1=Pe((e=>{var t=e&&e.__createBinding||(Object.create?(function(l,u,d,p){p===void 0&&(p=d);var g=Object.getOwnPropertyDescriptor(u,d);(!g||("get"in g?!u.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return u[d]}}),Object.defineProperty(l,p,g)}):(function(l,u,d,p){p===void 0&&(p=d),l[p]=u[d]})),n=e&&e.__exportStar||function(l,u){for(var d in l)d!=="default"&&!Object.prototype.hasOwnProperty.call(u,d)&&t(u,l,d)};Object.defineProperty(e,"__esModule",{value:!0}),e.LSPErrorCodes=e.createProtocolConnection=void 0,n(eo(),e),n((nu(),Cg(Qc)),e),n(Ut(),e),n(K1(),e);var i=Q1();Object.defineProperty(e,"createProtocolConnection",{enumerable:!0,get:function(){return i.createProtocolConnection}});var o;(function(l){l.lspReservedErrorRangeStart=-32899,l.RequestFailed=-32803,l.ServerCancelled=-32802,l.ContentModified=-32801,l.RequestCancelled=-32800,l.lspReservedErrorRangeEnd=-32800})(o||(e.LSPErrorCodes=o={}))})),vf=Pe((e=>{var t=e&&e.__createBinding||(Object.create?(function(l,u,d,p){p===void 0&&(p=d);var g=Object.getOwnPropertyDescriptor(u,d);(!g||("get"in g?!u.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return u[d]}}),Object.defineProperty(l,p,g)}):(function(l,u,d,p){p===void 0&&(p=d),l[p]=u[d]})),n=e&&e.__exportStar||function(l,u){for(var d in l)d!=="default"&&!Object.prototype.hasOwnProperty.call(u,d)&&t(u,l,d)};Object.defineProperty(e,"__esModule",{value:!0}),e.createProtocolConnection=void 0;var i=dp();n(dp(),e),n(G1(),e);function o(l,u,d,p){return(0,i.createMessageConnection)(l,u,d,p)}e.createProtocolConnection=o}));function Kt(e,t){if(!(Number.isInteger(t.line)&&Number.isInteger(t.character))||t.line<0||t.character<0)return;if(t.line>=e.lines)return t.line===e.lines&&t.character===0?e.length:void 0;let n=e.line(t.line+1);return Math.min(n.from+t.character,n.to)}function ur(e,t){let n=Number.isFinite(t)?Math.max(0,Math.min(t,e.length)):0,i=e.lineAt(n);return{character:n-i.from,line:i.number-1}}var iu=new tf.Renderer,w3=iu.code;iu.code=e=>e.text.trim()?w3.call(iu,e):"";function X1(e){return tf(e,{async:!1,gfm:!0,breaks:!0,renderer:iu})}function wp(e){return e.replace(/[&<>"']/g,t=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[t]??t)}function J1(e){let t=e.trim();if(t.startsWith("//"))return!1;try{let n=new URL(t,"https://codemirror.invalid/");return n.protocol==="http:"||n.protocol==="https:"||n.protocol==="mailto:"}catch{return!1}}var x3=5;function _3(e,t){let n=e;for(let i=0;i<x3;i++){let o=n;for(let l of t)o=o.replace(l,"");if(o===n)return{html:n,stable:!0};n=o}return{html:n,stable:!1}}function k3(e){if(typeof document>"u"){let{html:n,stable:i}=_3(e,[/<\s*\/?\s*(?:script|style|iframe|object|embed|img)\b[^>]*>/gi,/\s+on[a-z]+\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/gi,/\s+srcdoc\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/gi]);return i?n.replace(/\s+((?:xlink:)?href|src)\s*=\s*("[^"]*"|'[^']*'|[^\s>]+)/gi,(o,l,u)=>J1(u[0]==='"'||u[0]==="'"?u.slice(1,-1):u)?o:` ${l}=""`):wp(e)}let t=document.createElement("template");t.innerHTML=e;for(let n of t.content.querySelectorAll("script, style, iframe, object, embed, img"))n.remove();for(let n of t.content.querySelectorAll("*"))for(let i of[...n.attributes]){let o=i.name.toLowerCase();(o.startsWith("on")||o==="srcdoc"||(o==="href"||o==="src"||o==="xlink:href")&&!J1(i.value))&&n.removeAttribute(i.name)}return t.innerHTML}function C3(e,t=X1){return Y1(e,t,new WeakSet)}function Y1(e,t,n){if(!e)return"";if(typeof e=="object"){if(n.has(e))return"";n.add(e)}if(eb(e)){let i=e.value;if(typeof i!="string")return"";let o=wp(i);return e.kind==="markdown"&&(o=t(i.trim())),o}return Array.isArray(e)?e.map(i=>Y1(i,t,n)).filter(Boolean).join(`
|
|
47
|
+
`&&i++}n&&t.length>0&&e.push(t.length),this._lineOffsets=e}return this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let t=this.getLineOffsets(),n=0,i=t.length;if(i===0)return Gr.create(0,e);for(;n<i;){let l=Math.floor((n+i)/2);t[l]>e?i=l:n=l+1}let o=n-1;return Gr.create(o,e-t[o])}offsetAt(e){let t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;let n=t[e.line],i=e.line+1<t.length?t[e.line+1]:this._content.length;return Math.max(Math.min(n+e.character,i),n)}get lineCount(){return this.getLineOffsets().length}},(function(e){let t=Object.prototype.toString;function n(E){return E!==void 0}e.defined=n;function i(E){return E===void 0}e.undefined=i;function o(E){return E===!0||E===!1}e.boolean=o;function l(E){return t.call(E)==="[object String]"}e.string=l;function u(E){return t.call(E)==="[object Number]"}e.number=u;function d(E,T,O){return t.call(E)==="[object Number]"&&T<=E&&E<=O}e.numberRange=d;function p(E){return t.call(E)==="[object Number]"&&-2147483648<=E&&E<=2147483647}e.integer=p;function g(E){return t.call(E)==="[object Number]"&&0<=E&&E<=2147483647}e.uinteger=g;function w(E){return t.call(E)==="[object Function]"}e.func=w;function x(E){return typeof E=="object"&&!!E}e.objectLiteral=x;function S(E,T){return Array.isArray(E)&&E.every(T)}e.typedArray=S})(ne||(ne={}))})),Ut=Pe((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ProtocolNotificationType=e.ProtocolNotificationType0=e.ProtocolRequestType=e.ProtocolRequestType0=e.RegistrationType=e.MessageDirection=void 0;var t=to(),n;(function(i){i.clientToServer="clientToServer",i.serverToClient="serverToClient",i.both="both"})(n||(e.MessageDirection=n={})),e.RegistrationType=class{constructor(i){this.method=i}},e.ProtocolRequestType0=class extends t.RequestType0{constructor(i){super(i)}},e.ProtocolRequestType=class extends t.RequestType{constructor(i){super(i,t.ParameterStructures.byName)}},e.ProtocolNotificationType0=class extends t.NotificationType0{constructor(i){super(i)}},e.ProtocolNotificationType=class extends t.NotificationType{constructor(i){super(i,t.ParameterStructures.byName)}}})),iu=Pe((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.objectLiteral=e.typedArray=e.stringArray=e.array=e.func=e.error=e.number=e.string=e.boolean=void 0;function t(w){return w===!0||w===!1}e.boolean=t;function n(w){return typeof w=="string"||w instanceof String}e.string=n;function i(w){return typeof w=="number"||w instanceof Number}e.number=i;function o(w){return w instanceof Error}e.error=o;function l(w){return typeof w=="function"}e.func=l;function u(w){return Array.isArray(w)}e.array=u;function d(w){return u(w)&&w.every(x=>n(x))}e.stringArray=d;function p(w,x){return Array.isArray(w)&&w.every(x)}e.typedArray=p;function g(w){return typeof w=="object"&&!!w}e.objectLiteral=g})),E1=Pe((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ImplementationRequest=void 0;var t=Ut(),n;(function(i){i.method="textDocument/implementation",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(n||(e.ImplementationRequest=n={}))})),T1=Pe((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TypeDefinitionRequest=void 0;var t=Ut(),n;(function(i){i.method="textDocument/typeDefinition",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(n||(e.TypeDefinitionRequest=n={}))})),D1=Pe((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DidChangeWorkspaceFoldersNotification=e.WorkspaceFoldersRequest=void 0;var t=Ut(),n;(function(o){o.method="workspace/workspaceFolders",o.messageDirection=t.MessageDirection.serverToClient,o.type=new t.ProtocolRequestType0(o.method)})(n||(e.WorkspaceFoldersRequest=n={}));var i;(function(o){o.method="workspace/didChangeWorkspaceFolders",o.messageDirection=t.MessageDirection.clientToServer,o.type=new t.ProtocolNotificationType(o.method)})(i||(e.DidChangeWorkspaceFoldersNotification=i={}))})),R1=Pe((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ConfigurationRequest=void 0;var t=Ut(),n;(function(i){i.method="workspace/configuration",i.messageDirection=t.MessageDirection.serverToClient,i.type=new t.ProtocolRequestType(i.method)})(n||(e.ConfigurationRequest=n={}))})),I1=Pe((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ColorPresentationRequest=e.DocumentColorRequest=void 0;var t=Ut(),n;(function(o){o.method="textDocument/documentColor",o.messageDirection=t.MessageDirection.clientToServer,o.type=new t.ProtocolRequestType(o.method)})(n||(e.DocumentColorRequest=n={}));var i;(function(o){o.method="textDocument/colorPresentation",o.messageDirection=t.MessageDirection.clientToServer,o.type=new t.ProtocolRequestType(o.method)})(i||(e.ColorPresentationRequest=i={}))})),A1=Pe((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.FoldingRangeRefreshRequest=e.FoldingRangeRequest=void 0;var t=Ut(),n;(function(o){o.method="textDocument/foldingRange",o.messageDirection=t.MessageDirection.clientToServer,o.type=new t.ProtocolRequestType(o.method)})(n||(e.FoldingRangeRequest=n={}));var i;(function(o){o.method="workspace/foldingRange/refresh",o.messageDirection=t.MessageDirection.serverToClient,o.type=new t.ProtocolRequestType0(o.method)})(i||(e.FoldingRangeRefreshRequest=i={}))})),L1=Pe((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DeclarationRequest=void 0;var t=Ut(),n;(function(i){i.method="textDocument/declaration",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(n||(e.DeclarationRequest=n={}))})),P1=Pe((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SelectionRangeRequest=void 0;var t=Ut(),n;(function(i){i.method="textDocument/selectionRange",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(n||(e.SelectionRangeRequest=n={}))})),O1=Pe((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.WorkDoneProgressCancelNotification=e.WorkDoneProgressCreateRequest=e.WorkDoneProgress=void 0;var t=to(),n=Ut(),i;(function(u){u.type=new t.ProgressType;function d(p){return p===u.type}u.is=d})(i||(e.WorkDoneProgress=i={}));var o;(function(u){u.method="window/workDoneProgress/create",u.messageDirection=n.MessageDirection.serverToClient,u.type=new n.ProtocolRequestType(u.method)})(o||(e.WorkDoneProgressCreateRequest=o={}));var l;(function(u){u.method="window/workDoneProgress/cancel",u.messageDirection=n.MessageDirection.clientToServer,u.type=new n.ProtocolNotificationType(u.method)})(l||(e.WorkDoneProgressCancelNotification=l={}))})),M1=Pe((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CallHierarchyOutgoingCallsRequest=e.CallHierarchyIncomingCallsRequest=e.CallHierarchyPrepareRequest=void 0;var t=Ut(),n;(function(l){l.method="textDocument/prepareCallHierarchy",l.messageDirection=t.MessageDirection.clientToServer,l.type=new t.ProtocolRequestType(l.method)})(n||(e.CallHierarchyPrepareRequest=n={}));var i;(function(l){l.method="callHierarchy/incomingCalls",l.messageDirection=t.MessageDirection.clientToServer,l.type=new t.ProtocolRequestType(l.method)})(i||(e.CallHierarchyIncomingCallsRequest=i={}));var o;(function(l){l.method="callHierarchy/outgoingCalls",l.messageDirection=t.MessageDirection.clientToServer,l.type=new t.ProtocolRequestType(l.method)})(o||(e.CallHierarchyOutgoingCallsRequest=o={}))})),N1=Pe((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SemanticTokensRefreshRequest=e.SemanticTokensRangeRequest=e.SemanticTokensDeltaRequest=e.SemanticTokensRequest=e.SemanticTokensRegistrationType=e.TokenFormat=void 0;var t=Ut(),n;(function(p){p.Relative="relative"})(n||(e.TokenFormat=n={}));var i;(function(p){p.method="textDocument/semanticTokens",p.type=new t.RegistrationType(p.method)})(i||(e.SemanticTokensRegistrationType=i={}));var o;(function(p){p.method="textDocument/semanticTokens/full",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method),p.registrationMethod=i.method})(o||(e.SemanticTokensRequest=o={}));var l;(function(p){p.method="textDocument/semanticTokens/full/delta",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method),p.registrationMethod=i.method})(l||(e.SemanticTokensDeltaRequest=l={}));var u;(function(p){p.method="textDocument/semanticTokens/range",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method),p.registrationMethod=i.method})(u||(e.SemanticTokensRangeRequest=u={}));var d;(function(p){p.method="workspace/semanticTokens/refresh",p.messageDirection=t.MessageDirection.serverToClient,p.type=new t.ProtocolRequestType0(p.method)})(d||(e.SemanticTokensRefreshRequest=d={}))})),j1=Pe((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ShowDocumentRequest=void 0;var t=Ut(),n;(function(i){i.method="window/showDocument",i.messageDirection=t.MessageDirection.serverToClient,i.type=new t.ProtocolRequestType(i.method)})(n||(e.ShowDocumentRequest=n={}))})),q1=Pe((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.LinkedEditingRangeRequest=void 0;var t=Ut(),n;(function(i){i.method="textDocument/linkedEditingRange",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(n||(e.LinkedEditingRangeRequest=n={}))})),z1=Pe((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.WillDeleteFilesRequest=e.DidDeleteFilesNotification=e.DidRenameFilesNotification=e.WillRenameFilesRequest=e.DidCreateFilesNotification=e.WillCreateFilesRequest=e.FileOperationPatternKind=void 0;var t=Ut(),n;(function(g){g.file="file",g.folder="folder"})(n||(e.FileOperationPatternKind=n={}));var i;(function(g){g.method="workspace/willCreateFiles",g.messageDirection=t.MessageDirection.clientToServer,g.type=new t.ProtocolRequestType(g.method)})(i||(e.WillCreateFilesRequest=i={}));var o;(function(g){g.method="workspace/didCreateFiles",g.messageDirection=t.MessageDirection.clientToServer,g.type=new t.ProtocolNotificationType(g.method)})(o||(e.DidCreateFilesNotification=o={}));var l;(function(g){g.method="workspace/willRenameFiles",g.messageDirection=t.MessageDirection.clientToServer,g.type=new t.ProtocolRequestType(g.method)})(l||(e.WillRenameFilesRequest=l={}));var u;(function(g){g.method="workspace/didRenameFiles",g.messageDirection=t.MessageDirection.clientToServer,g.type=new t.ProtocolNotificationType(g.method)})(u||(e.DidRenameFilesNotification=u={}));var d;(function(g){g.method="workspace/didDeleteFiles",g.messageDirection=t.MessageDirection.clientToServer,g.type=new t.ProtocolNotificationType(g.method)})(d||(e.DidDeleteFilesNotification=d={}));var p;(function(g){g.method="workspace/willDeleteFiles",g.messageDirection=t.MessageDirection.clientToServer,g.type=new t.ProtocolRequestType(g.method)})(p||(e.WillDeleteFilesRequest=p={}))})),F1=Pe((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MonikerRequest=e.MonikerKind=e.UniquenessLevel=void 0;var t=Ut(),n;(function(l){l.document="document",l.project="project",l.group="group",l.scheme="scheme",l.global="global"})(n||(e.UniquenessLevel=n={}));var i;(function(l){l.$import="import",l.$export="export",l.local="local"})(i||(e.MonikerKind=i={}));var o;(function(l){l.method="textDocument/moniker",l.messageDirection=t.MessageDirection.clientToServer,l.type=new t.ProtocolRequestType(l.method)})(o||(e.MonikerRequest=o={}))})),$1=Pe((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TypeHierarchySubtypesRequest=e.TypeHierarchySupertypesRequest=e.TypeHierarchyPrepareRequest=void 0;var t=Ut(),n;(function(l){l.method="textDocument/prepareTypeHierarchy",l.messageDirection=t.MessageDirection.clientToServer,l.type=new t.ProtocolRequestType(l.method)})(n||(e.TypeHierarchyPrepareRequest=n={}));var i;(function(l){l.method="typeHierarchy/supertypes",l.messageDirection=t.MessageDirection.clientToServer,l.type=new t.ProtocolRequestType(l.method)})(i||(e.TypeHierarchySupertypesRequest=i={}));var o;(function(l){l.method="typeHierarchy/subtypes",l.messageDirection=t.MessageDirection.clientToServer,l.type=new t.ProtocolRequestType(l.method)})(o||(e.TypeHierarchySubtypesRequest=o={}))})),V1=Pe((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.InlineValueRefreshRequest=e.InlineValueRequest=void 0;var t=Ut(),n;(function(o){o.method="textDocument/inlineValue",o.messageDirection=t.MessageDirection.clientToServer,o.type=new t.ProtocolRequestType(o.method)})(n||(e.InlineValueRequest=n={}));var i;(function(o){o.method="workspace/inlineValue/refresh",o.messageDirection=t.MessageDirection.serverToClient,o.type=new t.ProtocolRequestType0(o.method)})(i||(e.InlineValueRefreshRequest=i={}))})),H1=Pe((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.InlayHintRefreshRequest=e.InlayHintResolveRequest=e.InlayHintRequest=void 0;var t=Ut(),n;(function(l){l.method="textDocument/inlayHint",l.messageDirection=t.MessageDirection.clientToServer,l.type=new t.ProtocolRequestType(l.method)})(n||(e.InlayHintRequest=n={}));var i;(function(l){l.method="inlayHint/resolve",l.messageDirection=t.MessageDirection.clientToServer,l.type=new t.ProtocolRequestType(l.method)})(i||(e.InlayHintResolveRequest=i={}));var o;(function(l){l.method="workspace/inlayHint/refresh",l.messageDirection=t.MessageDirection.serverToClient,l.type=new t.ProtocolRequestType0(l.method)})(o||(e.InlayHintRefreshRequest=o={}))})),B1=Pe((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DiagnosticRefreshRequest=e.WorkspaceDiagnosticRequest=e.DocumentDiagnosticRequest=e.DocumentDiagnosticReportKind=e.DiagnosticServerCancellationData=void 0;var t=to(),n=iu(),i=Ut(),o;(function(g){function w(x){let S=x;return S&&n.boolean(S.retriggerRequest)}g.is=w})(o||(e.DiagnosticServerCancellationData=o={}));var l;(function(g){g.Full="full",g.Unchanged="unchanged"})(l||(e.DocumentDiagnosticReportKind=l={}));var u;(function(g){g.method="textDocument/diagnostic",g.messageDirection=i.MessageDirection.clientToServer,g.type=new i.ProtocolRequestType(g.method),g.partialResult=new t.ProgressType})(u||(e.DocumentDiagnosticRequest=u={}));var d;(function(g){g.method="workspace/diagnostic",g.messageDirection=i.MessageDirection.clientToServer,g.type=new i.ProtocolRequestType(g.method),g.partialResult=new t.ProgressType})(d||(e.WorkspaceDiagnosticRequest=d={}));var p;(function(g){g.method="workspace/diagnostic/refresh",g.messageDirection=i.MessageDirection.serverToClient,g.type=new i.ProtocolRequestType0(g.method)})(p||(e.DiagnosticRefreshRequest=p={}))})),W1=Pe((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DidCloseNotebookDocumentNotification=e.DidSaveNotebookDocumentNotification=e.DidChangeNotebookDocumentNotification=e.NotebookCellArrayChange=e.DidOpenNotebookDocumentNotification=e.NotebookDocumentSyncRegistrationType=e.NotebookDocument=e.NotebookCell=e.ExecutionSummary=e.NotebookCellKind=void 0;var t=(ru(),Cg(Gc)),n=iu(),i=Ut(),o;(function(T){T.Markup=1,T.Code=2;function O(j){return j===1||j===2}T.is=O})(o||(e.NotebookCellKind=o={}));var l;(function(T){function O(V,P){let U={executionOrder:V};return(P===!0||P===!1)&&(U.success=P),U}T.create=O;function j(V){let P=V;return n.objectLiteral(P)&&t.uinteger.is(P.executionOrder)&&(P.success===void 0||n.boolean(P.success))}T.is=j;function z(V,P){return V===P?!0:V==null||P==null?!1:V.executionOrder===P.executionOrder&&V.success===P.success}T.equals=z})(l||(e.ExecutionSummary=l={}));var u;(function(T){function O(P,U){return{kind:P,document:U}}T.create=O;function j(P){let U=P;return n.objectLiteral(U)&&o.is(U.kind)&&t.DocumentUri.is(U.document)&&(U.metadata===void 0||n.objectLiteral(U.metadata))}T.is=j;function z(P,U){let me=new Set;return P.document!==U.document&&me.add("document"),P.kind!==U.kind&&me.add("kind"),P.executionSummary!==U.executionSummary&&me.add("executionSummary"),(P.metadata!==void 0||U.metadata!==void 0)&&!V(P.metadata,U.metadata)&&me.add("metadata"),(P.executionSummary!==void 0||U.executionSummary!==void 0)&&!l.equals(P.executionSummary,U.executionSummary)&&me.add("executionSummary"),me}T.diff=z;function V(P,U){if(P===U)return!0;if(P==null||U==null||typeof P!=typeof U||typeof P!="object")return!1;let me=Array.isArray(P),$=Array.isArray(U);if(me!==$)return!1;if(me&&$){if(P.length!==U.length)return!1;for(let W=0;W<P.length;W++)if(!V(P[W],U[W]))return!1}if(n.objectLiteral(P)&&n.objectLiteral(U)){let W=Object.keys(P),ae=Object.keys(U);if(W.length!==ae.length||(W.sort(),ae.sort(),!V(W,ae)))return!1;for(let xe=0;xe<W.length;xe++){let _e=W[xe];if(!V(P[_e],U[_e]))return!1}}return!0}})(u||(e.NotebookCell=u={}));var d;(function(T){function O(z,V,P,U){return{uri:z,notebookType:V,version:P,cells:U}}T.create=O;function j(z){let V=z;return n.objectLiteral(V)&&n.string(V.uri)&&t.integer.is(V.version)&&n.typedArray(V.cells,u.is)}T.is=j})(d||(e.NotebookDocument=d={}));var p;(function(T){T.method="notebookDocument/sync",T.messageDirection=i.MessageDirection.clientToServer,T.type=new i.RegistrationType(T.method)})(p||(e.NotebookDocumentSyncRegistrationType=p={}));var g;(function(T){T.method="notebookDocument/didOpen",T.messageDirection=i.MessageDirection.clientToServer,T.type=new i.ProtocolNotificationType(T.method),T.registrationMethod=p.method})(g||(e.DidOpenNotebookDocumentNotification=g={}));var w;(function(T){function O(z){let V=z;return n.objectLiteral(V)&&t.uinteger.is(V.start)&&t.uinteger.is(V.deleteCount)&&(V.cells===void 0||n.typedArray(V.cells,u.is))}T.is=O;function j(z,V,P){let U={start:z,deleteCount:V};return P!==void 0&&(U.cells=P),U}T.create=j})(w||(e.NotebookCellArrayChange=w={}));var x;(function(T){T.method="notebookDocument/didChange",T.messageDirection=i.MessageDirection.clientToServer,T.type=new i.ProtocolNotificationType(T.method),T.registrationMethod=p.method})(x||(e.DidChangeNotebookDocumentNotification=x={}));var S;(function(T){T.method="notebookDocument/didSave",T.messageDirection=i.MessageDirection.clientToServer,T.type=new i.ProtocolNotificationType(T.method),T.registrationMethod=p.method})(S||(e.DidSaveNotebookDocumentNotification=S={}));var E;(function(T){T.method="notebookDocument/didClose",T.messageDirection=i.MessageDirection.clientToServer,T.type=new i.ProtocolNotificationType(T.method),T.registrationMethod=p.method})(E||(e.DidCloseNotebookDocumentNotification=E={}))})),U1=Pe((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.InlineCompletionRequest=void 0;var t=Ut(),n;(function(i){i.method="textDocument/inlineCompletion",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(n||(e.InlineCompletionRequest=n={}))})),K1=Pe((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.WorkspaceSymbolRequest=e.CodeActionResolveRequest=e.CodeActionRequest=e.DocumentSymbolRequest=e.DocumentHighlightRequest=e.ReferencesRequest=e.DefinitionRequest=e.SignatureHelpRequest=e.SignatureHelpTriggerKind=e.HoverRequest=e.CompletionResolveRequest=e.CompletionRequest=e.CompletionTriggerKind=e.PublishDiagnosticsNotification=e.WatchKind=e.RelativePattern=e.FileChangeType=e.DidChangeWatchedFilesNotification=e.WillSaveTextDocumentWaitUntilRequest=e.WillSaveTextDocumentNotification=e.TextDocumentSaveReason=e.DidSaveTextDocumentNotification=e.DidCloseTextDocumentNotification=e.DidChangeTextDocumentNotification=e.TextDocumentContentChangeEvent=e.DidOpenTextDocumentNotification=e.TextDocumentSyncKind=e.TelemetryEventNotification=e.LogMessageNotification=e.ShowMessageRequest=e.ShowMessageNotification=e.MessageType=e.DidChangeConfigurationNotification=e.ExitNotification=e.ShutdownRequest=e.InitializedNotification=e.InitializeErrorCodes=e.InitializeRequest=e.WorkDoneProgressOptions=e.TextDocumentRegistrationOptions=e.StaticRegistrationOptions=e.PositionEncodingKind=e.FailureHandlingKind=e.ResourceOperationKind=e.UnregistrationRequest=e.RegistrationRequest=e.DocumentSelector=e.NotebookCellTextDocumentFilter=e.NotebookDocumentFilter=e.TextDocumentFilter=void 0,e.MonikerRequest=e.MonikerKind=e.UniquenessLevel=e.WillDeleteFilesRequest=e.DidDeleteFilesNotification=e.WillRenameFilesRequest=e.DidRenameFilesNotification=e.WillCreateFilesRequest=e.DidCreateFilesNotification=e.FileOperationPatternKind=e.LinkedEditingRangeRequest=e.ShowDocumentRequest=e.SemanticTokensRegistrationType=e.SemanticTokensRefreshRequest=e.SemanticTokensRangeRequest=e.SemanticTokensDeltaRequest=e.SemanticTokensRequest=e.TokenFormat=e.CallHierarchyPrepareRequest=e.CallHierarchyOutgoingCallsRequest=e.CallHierarchyIncomingCallsRequest=e.WorkDoneProgressCancelNotification=e.WorkDoneProgressCreateRequest=e.WorkDoneProgress=e.SelectionRangeRequest=e.DeclarationRequest=e.FoldingRangeRefreshRequest=e.FoldingRangeRequest=e.ColorPresentationRequest=e.DocumentColorRequest=e.ConfigurationRequest=e.DidChangeWorkspaceFoldersNotification=e.WorkspaceFoldersRequest=e.TypeDefinitionRequest=e.ImplementationRequest=e.ApplyWorkspaceEditRequest=e.ExecuteCommandRequest=e.PrepareRenameRequest=e.RenameRequest=e.PrepareSupportDefaultBehavior=e.DocumentOnTypeFormattingRequest=e.DocumentRangesFormattingRequest=e.DocumentRangeFormattingRequest=e.DocumentFormattingRequest=e.DocumentLinkResolveRequest=e.DocumentLinkRequest=e.CodeLensRefreshRequest=e.CodeLensResolveRequest=e.CodeLensRequest=e.WorkspaceSymbolResolveRequest=void 0,e.InlineCompletionRequest=e.DidCloseNotebookDocumentNotification=e.DidSaveNotebookDocumentNotification=e.DidChangeNotebookDocumentNotification=e.NotebookCellArrayChange=e.DidOpenNotebookDocumentNotification=e.NotebookDocumentSyncRegistrationType=e.NotebookDocument=e.NotebookCell=e.ExecutionSummary=e.NotebookCellKind=e.DiagnosticRefreshRequest=e.WorkspaceDiagnosticRequest=e.DocumentDiagnosticRequest=e.DocumentDiagnosticReportKind=e.DiagnosticServerCancellationData=e.InlayHintRefreshRequest=e.InlayHintResolveRequest=e.InlayHintRequest=e.InlineValueRefreshRequest=e.InlineValueRequest=e.TypeHierarchySupertypesRequest=e.TypeHierarchySubtypesRequest=e.TypeHierarchyPrepareRequest=void 0;var t=Ut(),n=(ru(),Cg(Gc)),i=iu(),o=E1();Object.defineProperty(e,"ImplementationRequest",{enumerable:!0,get:function(){return o.ImplementationRequest}});var l=T1();Object.defineProperty(e,"TypeDefinitionRequest",{enumerable:!0,get:function(){return l.TypeDefinitionRequest}});var u=D1();Object.defineProperty(e,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return u.WorkspaceFoldersRequest}}),Object.defineProperty(e,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return u.DidChangeWorkspaceFoldersNotification}});var d=R1();Object.defineProperty(e,"ConfigurationRequest",{enumerable:!0,get:function(){return d.ConfigurationRequest}});var p=I1();Object.defineProperty(e,"DocumentColorRequest",{enumerable:!0,get:function(){return p.DocumentColorRequest}}),Object.defineProperty(e,"ColorPresentationRequest",{enumerable:!0,get:function(){return p.ColorPresentationRequest}});var g=A1();Object.defineProperty(e,"FoldingRangeRequest",{enumerable:!0,get:function(){return g.FoldingRangeRequest}}),Object.defineProperty(e,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return g.FoldingRangeRefreshRequest}});var w=L1();Object.defineProperty(e,"DeclarationRequest",{enumerable:!0,get:function(){return w.DeclarationRequest}});var x=P1();Object.defineProperty(e,"SelectionRangeRequest",{enumerable:!0,get:function(){return x.SelectionRangeRequest}});var S=O1();Object.defineProperty(e,"WorkDoneProgress",{enumerable:!0,get:function(){return S.WorkDoneProgress}}),Object.defineProperty(e,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return S.WorkDoneProgressCreateRequest}}),Object.defineProperty(e,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return S.WorkDoneProgressCancelNotification}});var E=M1();Object.defineProperty(e,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return E.CallHierarchyIncomingCallsRequest}}),Object.defineProperty(e,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return E.CallHierarchyOutgoingCallsRequest}}),Object.defineProperty(e,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return E.CallHierarchyPrepareRequest}});var T=N1();Object.defineProperty(e,"TokenFormat",{enumerable:!0,get:function(){return T.TokenFormat}}),Object.defineProperty(e,"SemanticTokensRequest",{enumerable:!0,get:function(){return T.SemanticTokensRequest}}),Object.defineProperty(e,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return T.SemanticTokensDeltaRequest}}),Object.defineProperty(e,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return T.SemanticTokensRangeRequest}}),Object.defineProperty(e,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return T.SemanticTokensRefreshRequest}}),Object.defineProperty(e,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return T.SemanticTokensRegistrationType}});var O=j1();Object.defineProperty(e,"ShowDocumentRequest",{enumerable:!0,get:function(){return O.ShowDocumentRequest}});var j=q1();Object.defineProperty(e,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return j.LinkedEditingRangeRequest}});var z=z1();Object.defineProperty(e,"FileOperationPatternKind",{enumerable:!0,get:function(){return z.FileOperationPatternKind}}),Object.defineProperty(e,"DidCreateFilesNotification",{enumerable:!0,get:function(){return z.DidCreateFilesNotification}}),Object.defineProperty(e,"WillCreateFilesRequest",{enumerable:!0,get:function(){return z.WillCreateFilesRequest}}),Object.defineProperty(e,"DidRenameFilesNotification",{enumerable:!0,get:function(){return z.DidRenameFilesNotification}}),Object.defineProperty(e,"WillRenameFilesRequest",{enumerable:!0,get:function(){return z.WillRenameFilesRequest}}),Object.defineProperty(e,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return z.DidDeleteFilesNotification}}),Object.defineProperty(e,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return z.WillDeleteFilesRequest}});var V=F1();Object.defineProperty(e,"UniquenessLevel",{enumerable:!0,get:function(){return V.UniquenessLevel}}),Object.defineProperty(e,"MonikerKind",{enumerable:!0,get:function(){return V.MonikerKind}}),Object.defineProperty(e,"MonikerRequest",{enumerable:!0,get:function(){return V.MonikerRequest}});var P=$1();Object.defineProperty(e,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return P.TypeHierarchyPrepareRequest}}),Object.defineProperty(e,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return P.TypeHierarchySubtypesRequest}}),Object.defineProperty(e,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return P.TypeHierarchySupertypesRequest}});var U=V1();Object.defineProperty(e,"InlineValueRequest",{enumerable:!0,get:function(){return U.InlineValueRequest}}),Object.defineProperty(e,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return U.InlineValueRefreshRequest}});var me=H1();Object.defineProperty(e,"InlayHintRequest",{enumerable:!0,get:function(){return me.InlayHintRequest}}),Object.defineProperty(e,"InlayHintResolveRequest",{enumerable:!0,get:function(){return me.InlayHintResolveRequest}}),Object.defineProperty(e,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return me.InlayHintRefreshRequest}});var $=B1();Object.defineProperty(e,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return $.DiagnosticServerCancellationData}}),Object.defineProperty(e,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return $.DocumentDiagnosticReportKind}}),Object.defineProperty(e,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return $.DocumentDiagnosticRequest}}),Object.defineProperty(e,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return $.WorkspaceDiagnosticRequest}}),Object.defineProperty(e,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return $.DiagnosticRefreshRequest}});var W=W1();Object.defineProperty(e,"NotebookCellKind",{enumerable:!0,get:function(){return W.NotebookCellKind}}),Object.defineProperty(e,"ExecutionSummary",{enumerable:!0,get:function(){return W.ExecutionSummary}}),Object.defineProperty(e,"NotebookCell",{enumerable:!0,get:function(){return W.NotebookCell}}),Object.defineProperty(e,"NotebookDocument",{enumerable:!0,get:function(){return W.NotebookDocument}}),Object.defineProperty(e,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return W.NotebookDocumentSyncRegistrationType}}),Object.defineProperty(e,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return W.DidOpenNotebookDocumentNotification}}),Object.defineProperty(e,"NotebookCellArrayChange",{enumerable:!0,get:function(){return W.NotebookCellArrayChange}}),Object.defineProperty(e,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return W.DidChangeNotebookDocumentNotification}}),Object.defineProperty(e,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return W.DidSaveNotebookDocumentNotification}}),Object.defineProperty(e,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return W.DidCloseNotebookDocumentNotification}});var ae=U1();Object.defineProperty(e,"InlineCompletionRequest",{enumerable:!0,get:function(){return ae.InlineCompletionRequest}});var xe;(function(A){function rt(q){let re=q;return i.string(re)||i.string(re.language)||i.string(re.scheme)||i.string(re.pattern)}A.is=rt})(xe||(e.TextDocumentFilter=xe={}));var _e;(function(A){function rt(q){let re=q;return i.objectLiteral(re)&&(i.string(re.notebookType)||i.string(re.scheme)||i.string(re.pattern))}A.is=rt})(_e||(e.NotebookDocumentFilter=_e={}));var Te;(function(A){function rt(q){let re=q;return i.objectLiteral(re)&&(i.string(re.notebook)||_e.is(re.notebook))&&(re.language===void 0||i.string(re.language))}A.is=rt})(Te||(e.NotebookCellTextDocumentFilter=Te={}));var Z;(function(A){function rt(q){if(!Array.isArray(q))return!1;for(let re of q)if(!i.string(re)&&!xe.is(re)&&!Te.is(re))return!1;return!0}A.is=rt})(Z||(e.DocumentSelector=Z={}));var Q;(function(A){A.method="client/registerCapability",A.messageDirection=t.MessageDirection.serverToClient,A.type=new t.ProtocolRequestType(A.method)})(Q||(e.RegistrationRequest=Q={}));var Y;(function(A){A.method="client/unregisterCapability",A.messageDirection=t.MessageDirection.serverToClient,A.type=new t.ProtocolRequestType(A.method)})(Y||(e.UnregistrationRequest=Y={}));var ce;(function(A){A.Create="create",A.Rename="rename",A.Delete="delete"})(ce||(e.ResourceOperationKind=ce={}));var te;(function(A){A.Abort="abort",A.Transactional="transactional",A.TextOnlyTransactional="textOnlyTransactional",A.Undo="undo"})(te||(e.FailureHandlingKind=te={}));var he;(function(A){A.UTF8="utf-8",A.UTF16="utf-16",A.UTF32="utf-32"})(he||(e.PositionEncodingKind=he={}));var G;(function(A){function rt(q){let re=q;return re&&i.string(re.id)&&re.id.length>0}A.hasId=rt})(G||(e.StaticRegistrationOptions=G={}));var je;(function(A){function rt(q){let re=q;return re&&(re.documentSelector===null||Z.is(re.documentSelector))}A.is=rt})(je||(e.TextDocumentRegistrationOptions=je={}));var qe;(function(A){function rt(re){let we=re;return i.objectLiteral(we)&&(we.workDoneProgress===void 0||i.boolean(we.workDoneProgress))}A.is=rt;function q(re){let we=re;return we&&i.boolean(we.workDoneProgress)}A.hasWorkDoneProgress=q})(qe||(e.WorkDoneProgressOptions=qe={}));var Qe;(function(A){A.method="initialize",A.messageDirection=t.MessageDirection.clientToServer,A.type=new t.ProtocolRequestType(A.method)})(Qe||(e.InitializeRequest=Qe={}));var He;(function(A){A.unknownProtocolVersion=1})(He||(e.InitializeErrorCodes=He={}));var Fe;(function(A){A.method="initialized",A.messageDirection=t.MessageDirection.clientToServer,A.type=new t.ProtocolNotificationType(A.method)})(Fe||(e.InitializedNotification=Fe={}));var Oe;(function(A){A.method="shutdown",A.messageDirection=t.MessageDirection.clientToServer,A.type=new t.ProtocolRequestType0(A.method)})(Oe||(e.ShutdownRequest=Oe={}));var Be;(function(A){A.method="exit",A.messageDirection=t.MessageDirection.clientToServer,A.type=new t.ProtocolNotificationType0(A.method)})(Be||(e.ExitNotification=Be={}));var gt;(function(A){A.method="workspace/didChangeConfiguration",A.messageDirection=t.MessageDirection.clientToServer,A.type=new t.ProtocolNotificationType(A.method)})(gt||(e.DidChangeConfigurationNotification=gt={}));var bt;(function(A){A.Error=1,A.Warning=2,A.Info=3,A.Log=4,A.Debug=5})(bt||(e.MessageType=bt={}));var Mn;(function(A){A.method="window/showMessage",A.messageDirection=t.MessageDirection.serverToClient,A.type=new t.ProtocolNotificationType(A.method)})(Mn||(e.ShowMessageNotification=Mn={}));var gn;(function(A){A.method="window/showMessageRequest",A.messageDirection=t.MessageDirection.serverToClient,A.type=new t.ProtocolRequestType(A.method)})(gn||(e.ShowMessageRequest=gn={}));var Xe;(function(A){A.method="window/logMessage",A.messageDirection=t.MessageDirection.serverToClient,A.type=new t.ProtocolNotificationType(A.method)})(Xe||(e.LogMessageNotification=Xe={}));var cn;(function(A){A.method="telemetry/event",A.messageDirection=t.MessageDirection.serverToClient,A.type=new t.ProtocolNotificationType(A.method)})(cn||(e.TelemetryEventNotification=cn={}));var Ct;(function(A){A.None=0,A.Full=1,A.Incremental=2})(Ct||(e.TextDocumentSyncKind=Ct={}));var kn;(function(A){A.method="textDocument/didOpen",A.messageDirection=t.MessageDirection.clientToServer,A.type=new t.ProtocolNotificationType(A.method)})(kn||(e.DidOpenTextDocumentNotification=kn={}));var Lr;(function(A){function rt(re){let we=re;return we!=null&&typeof we.text=="string"&&we.range!==void 0&&(we.rangeLength===void 0||typeof we.rangeLength=="number")}A.isIncremental=rt;function q(re){let we=re;return we!=null&&typeof we.text=="string"&&we.range===void 0&&we.rangeLength===void 0}A.isFull=q})(Lr||(e.TextDocumentContentChangeEvent=Lr={}));var yt;(function(A){A.method="textDocument/didChange",A.messageDirection=t.MessageDirection.clientToServer,A.type=new t.ProtocolNotificationType(A.method)})(yt||(e.DidChangeTextDocumentNotification=yt={}));var Yr;(function(A){A.method="textDocument/didClose",A.messageDirection=t.MessageDirection.clientToServer,A.type=new t.ProtocolNotificationType(A.method)})(Yr||(e.DidCloseTextDocumentNotification=Yr={}));var un;(function(A){A.method="textDocument/didSave",A.messageDirection=t.MessageDirection.clientToServer,A.type=new t.ProtocolNotificationType(A.method)})(un||(e.DidSaveTextDocumentNotification=un={}));var Ri;(function(A){A.Manual=1,A.AfterDelay=2,A.FocusOut=3})(Ri||(e.TextDocumentSaveReason=Ri={}));var Nn;(function(A){A.method="textDocument/willSave",A.messageDirection=t.MessageDirection.clientToServer,A.type=new t.ProtocolNotificationType(A.method)})(Nn||(e.WillSaveTextDocumentNotification=Nn={}));var Pr;(function(A){A.method="textDocument/willSaveWaitUntil",A.messageDirection=t.MessageDirection.clientToServer,A.type=new t.ProtocolRequestType(A.method)})(Pr||(e.WillSaveTextDocumentWaitUntilRequest=Pr={}));var jn;(function(A){A.method="workspace/didChangeWatchedFiles",A.messageDirection=t.MessageDirection.clientToServer,A.type=new t.ProtocolNotificationType(A.method)})(jn||(e.DidChangeWatchedFilesNotification=jn={}));var yn;(function(A){A.Created=1,A.Changed=2,A.Deleted=3})(yn||(e.FileChangeType=yn={}));var xa;(function(A){function rt(q){let re=q;return i.objectLiteral(re)&&(n.URI.is(re.baseUri)||n.WorkspaceFolder.is(re.baseUri))&&i.string(re.pattern)}A.is=rt})(xa||(e.RelativePattern=xa={}));var Ii;(function(A){A.Create=1,A.Change=2,A.Delete=4})(Ii||(e.WatchKind=Ii={}));var Yt;(function(A){A.method="textDocument/publishDiagnostics",A.messageDirection=t.MessageDirection.serverToClient,A.type=new t.ProtocolNotificationType(A.method)})(Yt||(e.PublishDiagnosticsNotification=Yt={}));var Ai;(function(A){A.Invoked=1,A.TriggerCharacter=2,A.TriggerForIncompleteCompletions=3})(Ai||(e.CompletionTriggerKind=Ai={}));var vn;(function(A){A.method="textDocument/completion",A.messageDirection=t.MessageDirection.clientToServer,A.type=new t.ProtocolRequestType(A.method)})(vn||(e.CompletionRequest=vn={}));var hi;(function(A){A.method="completionItem/resolve",A.messageDirection=t.MessageDirection.clientToServer,A.type=new t.ProtocolRequestType(A.method)})(hi||(e.CompletionResolveRequest=hi={}));var Vt;(function(A){A.method="textDocument/hover",A.messageDirection=t.MessageDirection.clientToServer,A.type=new t.ProtocolRequestType(A.method)})(Vt||(e.HoverRequest=Vt={}));var Zr;(function(A){A.Invoked=1,A.TriggerCharacter=2,A.ContentChange=3})(Zr||(e.SignatureHelpTriggerKind=Zr={}));var St;(function(A){A.method="textDocument/signatureHelp",A.messageDirection=t.MessageDirection.clientToServer,A.type=new t.ProtocolRequestType(A.method)})(St||(e.SignatureHelpRequest=St={}));var Li;(function(A){A.method="textDocument/definition",A.messageDirection=t.MessageDirection.clientToServer,A.type=new t.ProtocolRequestType(A.method)})(Li||(e.DefinitionRequest=Li={}));var _a;(function(A){A.method="textDocument/references",A.messageDirection=t.MessageDirection.clientToServer,A.type=new t.ProtocolRequestType(A.method)})(_a||(e.ReferencesRequest=_a={}));var Or;(function(A){A.method="textDocument/documentHighlight",A.messageDirection=t.MessageDirection.clientToServer,A.type=new t.ProtocolRequestType(A.method)})(Or||(e.DocumentHighlightRequest=Or={}));var rn;(function(A){A.method="textDocument/documentSymbol",A.messageDirection=t.MessageDirection.clientToServer,A.type=new t.ProtocolRequestType(A.method)})(rn||(e.DocumentSymbolRequest=rn={}));var et;(function(A){A.method="textDocument/codeAction",A.messageDirection=t.MessageDirection.clientToServer,A.type=new t.ProtocolRequestType(A.method)})(et||(e.CodeActionRequest=et={}));var wt;(function(A){A.method="codeAction/resolve",A.messageDirection=t.MessageDirection.clientToServer,A.type=new t.ProtocolRequestType(A.method)})(wt||(e.CodeActionResolveRequest=wt={}));var Et;(function(A){A.method="workspace/symbol",A.messageDirection=t.MessageDirection.clientToServer,A.type=new t.ProtocolRequestType(A.method)})(Et||(e.WorkspaceSymbolRequest=Et={}));var Tt;(function(A){A.method="workspaceSymbol/resolve",A.messageDirection=t.MessageDirection.clientToServer,A.type=new t.ProtocolRequestType(A.method)})(Tt||(e.WorkspaceSymbolResolveRequest=Tt={}));var Bn;(function(A){A.method="textDocument/codeLens",A.messageDirection=t.MessageDirection.clientToServer,A.type=new t.ProtocolRequestType(A.method)})(Bn||(e.CodeLensRequest=Bn={}));var Mr;(function(A){A.method="codeLens/resolve",A.messageDirection=t.MessageDirection.clientToServer,A.type=new t.ProtocolRequestType(A.method)})(Mr||(e.CodeLensResolveRequest=Mr={}));var Dt;(function(A){A.method="workspace/codeLens/refresh",A.messageDirection=t.MessageDirection.serverToClient,A.type=new t.ProtocolRequestType0(A.method)})(Dt||(e.CodeLensRefreshRequest=Dt={}));var fr;(function(A){A.method="textDocument/documentLink",A.messageDirection=t.MessageDirection.clientToServer,A.type=new t.ProtocolRequestType(A.method)})(fr||(e.DocumentLinkRequest=fr={}));var qn;(function(A){A.method="documentLink/resolve",A.messageDirection=t.MessageDirection.clientToServer,A.type=new t.ProtocolRequestType(A.method)})(qn||(e.DocumentLinkResolveRequest=qn={}));var ei;(function(A){A.method="textDocument/formatting",A.messageDirection=t.MessageDirection.clientToServer,A.type=new t.ProtocolRequestType(A.method)})(ei||(e.DocumentFormattingRequest=ei={}));var Cn;(function(A){A.method="textDocument/rangeFormatting",A.messageDirection=t.MessageDirection.clientToServer,A.type=new t.ProtocolRequestType(A.method)})(Cn||(e.DocumentRangeFormattingRequest=Cn={}));var pr;(function(A){A.method="textDocument/rangesFormatting",A.messageDirection=t.MessageDirection.clientToServer,A.type=new t.ProtocolRequestType(A.method)})(pr||(e.DocumentRangesFormattingRequest=pr={}));var Pi;(function(A){A.method="textDocument/onTypeFormatting",A.messageDirection=t.MessageDirection.clientToServer,A.type=new t.ProtocolRequestType(A.method)})(Pi||(e.DocumentOnTypeFormattingRequest=Pi={}));var gi;(function(A){A.Identifier=1})(gi||(e.PrepareSupportDefaultBehavior=gi={}));var zn;(function(A){A.method="textDocument/rename",A.messageDirection=t.MessageDirection.clientToServer,A.type=new t.ProtocolRequestType(A.method)})(zn||(e.RenameRequest=zn={}));var Oi;(function(A){A.method="textDocument/prepareRename",A.messageDirection=t.MessageDirection.clientToServer,A.type=new t.ProtocolRequestType(A.method)})(Oi||(e.PrepareRenameRequest=Oi={}));var Wn;(function(A){A.method="workspace/executeCommand",A.messageDirection=t.MessageDirection.clientToServer,A.type=new t.ProtocolRequestType(A.method)})(Wn||(e.ExecuteCommandRequest=Wn={}));var mr;(function(A){A.method="workspace/applyEdit",A.messageDirection=t.MessageDirection.serverToClient,A.type=new t.ProtocolRequestType("workspace/applyEdit")})(mr||(e.ApplyWorkspaceEditRequest=mr={}))})),Q1=Pe((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createProtocolConnection=void 0;var t=to();function n(i,o,l,u){return t.ConnectionStrategy.is(u)&&(u={connectionStrategy:u}),(0,t.createMessageConnection)(i,o,l,u)}e.createProtocolConnection=n})),G1=Pe((e=>{var t=e&&e.__createBinding||(Object.create?(function(l,u,d,p){p===void 0&&(p=d);var g=Object.getOwnPropertyDescriptor(u,d);(!g||("get"in g?!u.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return u[d]}}),Object.defineProperty(l,p,g)}):(function(l,u,d,p){p===void 0&&(p=d),l[p]=u[d]})),n=e&&e.__exportStar||function(l,u){for(var d in l)d!=="default"&&!Object.prototype.hasOwnProperty.call(u,d)&&t(u,l,d)};Object.defineProperty(e,"__esModule",{value:!0}),e.LSPErrorCodes=e.createProtocolConnection=void 0,n(to(),e),n((ru(),Cg(Gc)),e),n(Ut(),e),n(K1(),e);var i=Q1();Object.defineProperty(e,"createProtocolConnection",{enumerable:!0,get:function(){return i.createProtocolConnection}});var o;(function(l){l.lspReservedErrorRangeStart=-32899,l.RequestFailed=-32803,l.ServerCancelled=-32802,l.ContentModified=-32801,l.RequestCancelled=-32800,l.lspReservedErrorRangeEnd=-32800})(o||(e.LSPErrorCodes=o={}))})),bf=Pe((e=>{var t=e&&e.__createBinding||(Object.create?(function(l,u,d,p){p===void 0&&(p=d);var g=Object.getOwnPropertyDescriptor(u,d);(!g||("get"in g?!u.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return u[d]}}),Object.defineProperty(l,p,g)}):(function(l,u,d,p){p===void 0&&(p=d),l[p]=u[d]})),n=e&&e.__exportStar||function(l,u){for(var d in l)d!=="default"&&!Object.prototype.hasOwnProperty.call(u,d)&&t(u,l,d)};Object.defineProperty(e,"__esModule",{value:!0}),e.createProtocolConnection=void 0;var i=dp();n(dp(),e),n(G1(),e);function o(l,u,d,p){return(0,i.createMessageConnection)(l,u,d,p)}e.createProtocolConnection=o}));function Kt(e,t){if(!(Number.isInteger(t.line)&&Number.isInteger(t.character))||t.line<0||t.character<0)return;if(t.line>=e.lines)return t.line===e.lines&&t.character===0?e.length:void 0;let n=e.line(t.line+1);return Math.min(n.from+t.character,n.to)}function ur(e,t){let n=Number.isFinite(t)?Math.max(0,Math.min(t,e.length)):0,i=e.lineAt(n);return{character:n-i.from,line:i.number-1}}var au=new nf.Renderer,w3=au.code;au.code=e=>e.text.trim()?w3.call(au,e):"";function X1(e){return nf(e,{async:!1,gfm:!0,breaks:!0,renderer:au})}function wp(e){return e.replace(/[&<>"']/g,t=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[t]??t)}function J1(e){let t=e.trim();if(t.startsWith("//"))return!1;try{let n=new URL(t,"https://codemirror.invalid/");return n.protocol==="http:"||n.protocol==="https:"||n.protocol==="mailto:"}catch{return!1}}var x3=5;function _3(e,t){let n=e;for(let i=0;i<x3;i++){let o=n;for(let l of t)o=o.replace(l,"");if(o===n)return{html:n,stable:!0};n=o}return{html:n,stable:!1}}function k3(e){if(typeof document>"u"){let{html:n,stable:i}=_3(e,[/<\s*\/?\s*(?:script|style|iframe|object|embed|img)\b[^>]*>/gi,/\s+on[a-z]+\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/gi,/\s+srcdoc\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/gi]);return i?n.replace(/\s+((?:xlink:)?href|src)\s*=\s*("[^"]*"|'[^']*'|[^\s>]+)/gi,(o,l,u)=>J1(u[0]==='"'||u[0]==="'"?u.slice(1,-1):u)?o:` ${l}=""`):wp(e)}let t=document.createElement("template");t.innerHTML=e;for(let n of t.content.querySelectorAll("script, style, iframe, object, embed, img"))n.remove();for(let n of t.content.querySelectorAll("*"))for(let i of[...n.attributes]){let o=i.name.toLowerCase();(o.startsWith("on")||o==="srcdoc"||(o==="href"||o==="src"||o==="xlink:href")&&!J1(i.value))&&n.removeAttribute(i.name)}return t.innerHTML}function C3(e,t=X1){return Y1(e,t,new WeakSet)}function Y1(e,t,n){if(!e)return"";if(typeof e=="object"){if(n.has(e))return"";n.add(e)}if(eb(e)){let i=e.value;if(typeof i!="string")return"";let o=wp(i);return e.kind==="markdown"&&(o=t(i.trim())),o}return Array.isArray(e)?e.map(i=>Y1(i,t,n)).filter(Boolean).join(`
|
|
48
48
|
|
|
49
49
|
`):typeof e=="string"?wp(e):nb(e)?t(`\`\`\`${typeof e.language=="string"?e.language.replace(/[^\w+-]/g,""):""}
|
|
50
50
|
${e.value??""}
|
|
@@ -61,44 +61,44 @@ ${e.value??""}
|
|
|
61
61
|
z-index: 100;
|
|
62
62
|
max-width: 300px;
|
|
63
63
|
box-shadow: 0 2px 8px rgba(0,0,0,.15);
|
|
64
|
-
`,n.textContent=t;let i=e.coordsAtPos(e.state.selection.main.head);i&&(n.style.left=`${i.left}px`,n.style.top=`${i.bottom+5}px`),document.body.appendChild(n),setTimeout(()=>{n.style.opacity="0",n.style.transition="opacity 0.2s",setTimeout(()=>n.remove(),200)},3e3)}function xp(e){return rb(e,new WeakSet)}function rb(e,t){if(e==null)return!0;if(Array.isArray(e))return t.has(e)?!0:(t.add(e),e.length===0||e.every(i=>rb(i,t)));if(typeof e=="string")return ib(e);let n=e.value;return typeof n=="string"?ib(n):!0}function ib(e){return e==null?!0:typeof e=="string"?e.trim()===""||/^[\s\n`]*$/.test(e):!1}function I3(e,t){let n=[];return t.iterChanges((i,o,l,u,d)=>{let p=d.toString();if(i===0&&o===e.length){n.push({text:p});return}let g=ur(e,i),w=ur(e,o);n.push({range:{start:g,end:w},text:p})}),n.sort((i,o)=>{if(!i.range)return 1;if(!o.range)return-1;let l=i.range.start.line??-1,u=o.range.start.line??-1;if(l!==u)return u-l;let d=i.range.start.character??-1;return(o.range.start.character??-1)-d}),n}var ab=vf(),A3=Object.fromEntries(Object.entries(ab.CompletionItemKind).map(([e,t])=>[t,e]));function L3(e){var t;return!!(e.deprecated||(t=e.tags)!=null&&t.includes(ab.CompletionItemTag.Deprecated))}function P3(e){return e.deprecated?"cm-deprecated":""}function O3(e){return"insert"in e}function M3(e,t){if(!t)return e;let n={...e};if(n.commitCharacters??(n.commitCharacters=t.commitCharacters),n.insertTextFormat??(n.insertTextFormat=t.insertTextFormat),n.insertTextMode??(n.insertTextMode=t.insertTextMode),n.data===void 0&&(n.data=t.data),n.textEdit==null&&t.editRange){let i=n.textEditText??n.insertText??n.label;n.textEdit=O3(t.editRange)?{newText:i,insert:t.editRange.insert,replace:t.editRange.replace}:{newText:i,range:t.editRange}}return n}function N3(e,t,n,i){let{textEdit:o,insertText:l,label:u}=t,d=n,p=i,g=l||u;if(o){let w=T3(o)?o.range:R3(o)?o.replace:void 0;if(w){g=o.newText;let x=Kt(e,w.start),S=Kt(e,w.end);x!=null&&S!=null&&x<=S&&(d=x,p=S)}}return{from:d,to:p,newText:g}}function ob(e,t,n,i){let o=[];for(let l of t){let u=Kt(e,l.range.start),d=Kt(e,l.range.end);u==null||d==null||u>d||d>n&&u<i||o.push({from:u,to:d,insert:l.newText})}return o}function j3(e,t,n){return i=>i<=e?i:i-(t-e)+n}function q3(e){let{view:t,originalDoc:n,mainFrom:i,mainTo:o,insertedLength:l,resolveItem:u}=e,d=t.state.doc,p=j3(i,o,l);u().then(g=>{let w=g==null?void 0:g.additionalTextEdits;if(!(w!=null&&w.length)||t.state.doc!==d)return;let x=ob(n,w,i,o).map(S=>({...S,from:p(S.from),to:p(S.to)}));x.length!==0&&t.dispatch({changes:x,userEvent:"input.complete"})}).catch(g=>{console.error("Failed to resolve completion item:",g)})}var _p;(function(e){e.PlainText=1,e.Snippet=2})(_p||(_p={}));var z3=/^\$\{(\d+)\|((?:\\.|[^\\}])*)\|\}/,F3=/^\$\{([A-Za-z_][A-Za-z0-9_]*)(?::([^}]*))?\}/,$3=/^\$[A-Za-z_][A-Za-z0-9_]*/,V3=/^(?:\\.|[^,])*/,H3=/^\{0(?=[:}])/;function sb(e,t){var o;let n="",i=0;for(;i<e.length;){let l=e[i];if(l==="\\"&&i+1<e.length){n+=e.slice(i,i+2),i+=2;continue}if(l==="$"){let u=e.slice(i),d=z3.exec(u);if(d){let w=((o=V3.exec(d[2]??""))==null?void 0:o[0])??"";n+=t(d[1]??"",w),i+=d[0].length;continue}let p=F3.exec(u);if(p){n+=p[2]??"",i+=p[0].length;continue}let g=$3.exec(u);if(g){i+=g[0].length;continue}}n+=l,i+=1}return n}function B3(e){let t=0;for(let n of e.matchAll(/\$\{?(\d+)/g))t=Math.max(t,Number(n[1]));return String(t+1)}function W3(e){let t=sb(e,(l,u)=>`\${${l}:${u}}`),n=B3(t),i="",o=0;for(;o<t.length;){let l=t[o];if(l==="\\"&&o+1<t.length){let u=t[o+1];u==="$"?t[o+2]==="{"?(i+="$\\{",o+=3):(i+="$",o+=2):u==="{"||u==="}"?(i+=`\\${u}`,o+=2):u==="\\"?(i+="\\",o+=2):(i+=u,o+=2)}else if(l==="$"){let u=t.slice(o+1),d=H3.exec(u),p=/^\d+/.exec(u);if(d)i+=`\${${n}`,o+=1+d[0].length;else if(p){let g=p[0]==="0"?n:p[0];i+=`\${${g}}`,o+=1+p[0].length}else i+=l,o+=1}else l==="#"&&t[o+1]==="{"?(i+="#\\{",o+=2):(i+=l,o+=1)}return i}function U3(e){let t=sb(e,(o,l)=>l),n="",i=0;for(;i<t.length;){let o=t[i];if(o==="\\"&&i+1<t.length)n+=t[i+1],i+=2;else if(o==="$"){let l=/^\{(\d+)(?::([^}]*))?\}/.exec(t.slice(i+1));if(l)n+=l[2]??"",i+=1+l[0].length;else{let u=/^\d+/.exec(t.slice(i+1));u?i+=1+u[0].length:(n+=o,i+=1)}}else n+=o,i+=1}return n}function K3(e,t){var j;let{detail:n,labelDetails:i,label:o,kind:l,documentation:u,additionalTextEdits:d,insertTextFormat:p,commitCharacters:g,filterText:w}=e,x=typeof o=="string"?o:"",S=null,E=()=>(S??(S=t.resolveItem(e)),S),T={label:x,detail:(i==null?void 0:i.detail)||n,apply(z,V,P,U){let me=z.state,{from:$,to:W,newText:ae}=N3(me.doc,e,P,U);($>U||W<U)&&($=P,W=U);let xe=ae,_e=ob(me.doc,d??[],$,W),Te=Q=>{d||!t.hasResolveProvider||q3({view:z,originalDoc:me.doc,mainFrom:$,mainTo:W,insertedLength:Q,resolveItem:E})};if(p===_p.Snippet&&t.useSnippetOnCompletion){let Q=$,Y=W;if(_e.length>0){let te=me.changes(_e);z.dispatch({changes:te}),Q=te.mapPos(Q,1),Y=te.mapPos(Y,1)}let ce=z.state.doc.length;u6(W3(xe))(z,null,Q,Y),Te(z.state.doc.length-ce+(Y-Q));return}if(p===_p.Snippet&&(xe=U3(xe)),_e.length===0){z.dispatch(l6(me,xe,$,W)),Te(xe.length);return}let Z=me.changes([{from:$,to:W,insert:xe},..._e]);z.dispatch({changes:Z,selection:{anchor:Z.mapPos($,-1)+xe.length},userEvent:"input.complete"})},type:l?(j=A3[l])==null?void 0:j.toLowerCase():void 0};w!=null&&w!==x&&(T.label=w,T.displayLabel=x),g!=null&&g.length&&(T.commitCharacters=g),L3(e)&&(T.deprecated=!0);let O=z=>{let V=document.createElement("div");return V.classList.add("documentation"),ml(V,z,{allowHTMLContent:t.allowHTMLContent,markdownRenderer:t.markdownRenderer}),V};return t.hasResolveProvider?T.info=async()=>{var z;try{let V=((z=await E())==null?void 0:z.documentation)||u;return!V||xp(V)?null:O(V)}catch(V){return console.error("Failed to resolve completion item:",V),!u||xp(u)?null:O(u)}}:u&&(T.info=()=>O(u)),T}function Q3(e,t,n,i=!0){let o=[t?G3(t):X3,n==="python"?J3:void 0].filter(Boolean),l=[...e];if(t&&i){let u=t.toLowerCase();/^\w+$/.test(u)&&(l=l.filter(({label:d,filterText:p})=>(typeof p=="string"?p:da(d)).toLowerCase().startsWith(u)))}for(let u of o)l.sort(u);return l}function G3(e){return(t,n)=>{let i=lb(t).startsWith(e),o=lb(n).startsWith(e);if(i&&!o)return-1;if(!i&&o)return 1;let l=typeof t.sortText=="string"?t.sortText:da(t.label),u=typeof n.sortText=="string"?n.sortText:da(n.label);return l.localeCompare(u)}}function X3(e,t){let n=typeof e.sortText=="string"?e.sortText:da(e.label),i=typeof t.sortText=="string"?t.sortText:da(t.label);return n.localeCompare(i)}function J3(e,t){let n=da(e.label).endsWith("="),i=da(t.label).endsWith("=");return n&&!i?-1:!n&&i?1:0}function lb(e){return typeof e.filterText=="string"?e.filterText:da(e.label)}function da(e){return typeof e=="string"?e:""}function cb(e){let t=new Proxy({},{get(){throw Error(e)}});return function(n){return n[0]??t}}var ub=cb("No document URI provided. Pass one to the extension or use documentUri.of()."),db=cb("No language ID provided. Pass one to the extension or use languageId.of().");function Y3(e){if(e!==e.trim())return!1;try{return!!new URL(e).protocol}catch{return!1}}const fb=Gs.define({combine(e){if(e.length===0)return ub(e);let t=ub(e);if(!(t&&Y3(t)))throw Error("Document URI must be a non-empty absolute URI");return t}}),Z3=Gs.define({combine(e){if(e.length===0)return db(e);let t=db(e);if(!t.trim())throw Error("Language ID must be a non-empty string");return t}}),fa={ParseError:-32700,InvalidRequest:-32600,MethodNotFound:-32601,InvalidParams:-32602,InternalError:-32603,RequestTimeout:-32001};var to=class extends Error{constructor(t,n,i){super(n);pe(this,"code");pe(this,"data");this.name="RPCError",this.code=t,this.data=i}},eD=1e4;function pb(e){return e.id!=null}function kp(e){return e instanceof Error?e:new to(fa.InternalError,String(e))}let mb,hb,gb,yb,Cp,vb,nn,hl,bb;mb=class{constructor(e){pe(this,"transport");pe(this,"pending",new Map);pe(this,"disconnect");pe(this,"disconnectClose");pe(this,"connected");pe(this,"nextId",0);pe(this,"closed",!1);pe(this,"isConnected",!1);pe(this,"closeError");pe(this,"notificationHandler");pe(this,"requestHandler");var t;this.transport=e,this.disconnect=e.onMessage(n=>this.receive(n)),this.disconnectClose=(t=e.onClose)==null?void 0:t.call(e,n=>{this.closeError??(this.closeError=n);for(let i of[...this.pending.keys()])this.settle(i,o=>o.reject(n))}),this.connected=e.connect(),this.connected.then(()=>{this.isConnected=!0},()=>{}),this.connected.catch(()=>{})}onNotification(e){this.notificationHandler=e}onRequest(e){this.requestHandler=e}request(e,t,n=eD){if(this.closed)return Promise.reject(new to(fa.InternalError,"Client closed"));if(this.closeError)return Promise.reject(this.closeError);let i=this.nextId++;return new Promise((o,l)=>{let u=setTimeout(()=>{this.pending.delete(i),l(new to(fa.RequestTimeout,`Request "${e}" timed out after ${n}ms`))},n);this.pending.set(i,{resolve:o,reject:l,timer:u});let d=()=>{if(this.pending.has(i))try{this.transport.send({jsonrpc:"2.0",id:i,method:e,params:t})}catch(p){this.settle(i,g=>g.reject(kp(p)))}};if(this.isConnected){d();return}this.connected.then(d,p=>this.settle(i,g=>g.reject(kp(p))))})}notify(e,t){let n=this.dispatch({jsonrpc:"2.0",method:e,params:t});return n.catch(()=>{}),n}respond(e){return this.dispatch(e)}close(){var e;if(!this.closed){this.closed=!0;for(let t of this.pending.values())clearTimeout(t.timer),t.reject(new to(fa.InternalError,"Client closed"));this.pending.clear(),this.disconnect(),(e=this.disconnectClose)==null||e.call(this),this.transport.close()}}dispatch(e){if(this.closed)return Promise.resolve();if(this.isConnected)try{return this.transport.send(e),Promise.resolve()}catch(t){return Promise.reject(kp(t))}return this.connected.then(()=>{this.closed||this.transport.send(e)})}settle(e,t){let n=this.pending.get(e);n&&(clearTimeout(n.timer),this.pending.delete(e),t(n))}receive(e){var i,o;if(this.closed||typeof e!="object"||!e||Array.isArray(e)||e.jsonrpc!=="2.0")return;if(typeof e.method=="string"){pb(e)?(i=this.requestHandler)==null||i.call(this,e):(o=this.notificationHandler)==null||o.call(this,e);return}if(!pb(e))return;let t=e,n=t.id;if(typeof n=="string"&&!this.pending.has(n)&&/^\d+$/.test(n)){let l=Number(n);this.pending.has(l)&&(n=l)}this.settle(n,l=>{if("error"in t){let u=t.error;if(typeof u!="object"||!u||typeof u.code!="number"||typeof u.message!="string"){l.reject(new to(fa.InvalidRequest,"Malformed JSON-RPC error response",u));return}l.reject(new to(u.code,u.message,u.data))}else"result"in t?l.resolve(t.result):l.reject(new to(fa.InvalidRequest,"Malformed JSON-RPC response: missing result or error"))})}},hb=1e4,gb=2048,yb="Language server: ",Cp={"textDocument/hover":"hoverProvider","textDocument/completion":"completionProvider","textDocument/definition":"definitionProvider","textDocument/declaration":"declarationProvider","textDocument/typeDefinition":"typeDefinitionProvider","textDocument/implementation":"implementationProvider","textDocument/references":"referencesProvider","textDocument/documentHighlight":"documentHighlightProvider","textDocument/documentSymbol":"documentSymbolProvider","textDocument/codeAction":"codeActionProvider","textDocument/codeLens":"codeLensProvider","textDocument/documentLink":"documentLinkProvider","textDocument/formatting":"documentFormattingProvider","textDocument/rangeFormatting":"documentRangeFormattingProvider","textDocument/onTypeFormatting":"documentOnTypeFormattingProvider","textDocument/rename":"renameProvider","textDocument/prepareRename":"renameProvider","textDocument/signatureHelp":"signatureHelpProvider","textDocument/foldingRange":"foldingRangeProvider","textDocument/selectionRange":"selectionRangeProvider","workspace/symbol":"workspaceSymbolProvider","workspace/executeCommand":"executeCommandProvider"},nl=class{constructor({rootUri:e,workspaceFolders:t,transport:n,initializationOptions:i,capabilities:o,timeout:l=hb,getWorkspaceConfiguration:u}){pe(this,"ready");pe(this,"capabilities");pe(this,"advertisedCapabilities");pe(this,"initializePromise");pe(this,"rootUri");pe(this,"workspaceFolders");pe(this,"timeout");pe(this,"client");pe(this,"initializationOptions");pe(this,"clientCapabilities");pe(this,"notificationListeners",new Set);pe(this,"documentOpenCounts",new Map);pe(this,"serverRequestHandlers",new Map);pe(this,"dynamicCapabilities",new Map);pe(this,"isClosed",!1);if(!e)throw Error("rootUri must be a non-empty URI");this.rootUri=e,this.workspaceFolders=t,this.initializationOptions=i,this.clientCapabilities=o,this.timeout=l,this.ready=!1,this.capabilities=null,this.client=new mb(n),this.client.onNotification(d=>{this.processNotification(d)}),this.client.onRequest(d=>{this.handleServerRequest(d)}),this.onRequest("workspace/configuration",d=>u?u(d):((d==null?void 0:d.items)??[]).map(()=>null)),this.onRequest("client/registerCapability",d=>{let p=d==null?void 0:d.registrations;if(!Array.isArray(p))return null;for(let g of p)!g||typeof g.id!="string"||g.id.length===0||typeof g.method!="string"||this.dynamicCapabilities.has(g.id)||this.dynamicCapabilities.set(g.id,g);return null}),this.onRequest("client/unregisterCapability",d=>{let p=d==null?void 0:d.unregisterations;if(!Array.isArray(p))return null;for(let g of p)this.dynamicCapabilities.delete(g.id);return null}),this.onRequest("workspace/applyEdit",()=>({applied:!1,failureReason:"workspace/applyEdit is not supported"})),this.onRequest("window/showMessageRequest",d=>{if(d!=null&&d.message){let p=String(d.message).replace(/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]/g,"").slice(0,gb-17);console.info(`${yb}${p}`)}return null}),this.onRequest("window/workDoneProgress/create",()=>null),this.initializePromise=this.initialize(),this.initializePromise.catch(d=>{console.error("Language server initialization failed",d)})}getInitializationOptions(){let e={textDocument:{hover:{dynamicRegistration:!0,contentFormat:["markdown","plaintext"]},moniker:{},synchronization:{dynamicRegistration:!1,willSave:!0,didSave:!0,willSaveWaitUntil:!0},codeAction:{dynamicRegistration:!0,codeActionLiteralSupport:{codeActionKind:{valueSet:["","quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}},resolveSupport:{properties:["edit"]}},completion:{dynamicRegistration:!1,completionItem:{snippetSupport:!0,commitCharactersSupport:!0,documentationFormat:["markdown","plaintext"],deprecatedSupport:!0,preselectSupport:!1,insertReplaceSupport:!0,tagSupport:{valueSet:[1]},resolveSupport:{properties:["documentation","detail","additionalTextEdits"]}},completionList:{itemDefaults:["commitCharacters","editRange","insertTextFormat","insertTextMode","data"]},contextSupport:!1},signatureHelp:{dynamicRegistration:!1,signatureInformation:{documentationFormat:["markdown","plaintext"]}},declaration:{dynamicRegistration:!1,linkSupport:!0},definition:{dynamicRegistration:!0,linkSupport:!0},typeDefinition:{dynamicRegistration:!1,linkSupport:!0},implementation:{dynamicRegistration:!1,linkSupport:!0},rename:{dynamicRegistration:!0,prepareSupport:!0},publishDiagnostics:{relatedInformation:!0,tagSupport:{valueSet:[1,2]},versionSupport:!0,codeDescriptionSupport:!0,dataSupport:!0}},workspace:{didChangeConfiguration:{dynamicRegistration:!1}}};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 e=this.getInitializationOptions();this.advertisedCapabilities=e==null?void 0:e.capabilities;let t=await this.request("initialize",e,this.timeout*3);if(!t||typeof t!="object"||!("capabilities"in t)||typeof t.capabilities!="object"||t.capabilities===null)throw Error("Invalid initialize response: missing server capabilities");this.isClosed||(this.capabilities=t.capabilities,this.notify("initialized",{}),this.ready=!0)}close(){if(!this.isClosed){if(this.isClosed=!0,this.ready=!1,this.notificationListeners.clear(),this.serverRequestHandlers.clear(),this.dynamicCapabilities.clear(),this.documentOpenCounts.clear(),this.capabilities){this.client.request("shutdown",null,this.timeout).catch(()=>{}).then(()=>{this.client.notify("exit",void 0).catch(()=>{}),this.client.close()});return}this.client.close()}}onRequest(e,t){return this.serverRequestHandlers.set(e,t),()=>{this.serverRequestHandlers.get(e)===t&&this.serverRequestHandlers.delete(e)}}mayRegisterDynamically(e){var i,o,l;let[t,n]=e.split("/");return t!=="textDocument"||!n?!1:((l=(o=(i=this.advertisedCapabilities)==null?void 0:i.textDocument)==null?void 0:o[n])==null?void 0:l.dynamicRegistration)===!0}hasCapability(e){var n;for(let i of this.dynamicCapabilities.values())if(i.method===e)return!0;let t=Cp[e];return t?!!((n=this.capabilities)!=null&&n[t]):!1}async handleServerRequest(e){let t=this.serverRequestHandlers.get(e.method),n;if(!t)n={jsonrpc:"2.0",id:e.id,error:{code:fa.MethodNotFound,message:`Method not found: ${e.method}`}};else try{let i=await t(e.params);n={jsonrpc:"2.0",id:e.id,result:i===void 0?null:i}}catch(i){n={jsonrpc:"2.0",id:e.id,error:{code:fa.InternalError,message:i instanceof Error?i.message:String(i)}}}this.isClosed||this.client.respond(n).catch(()=>{})}textDocumentDidOpen(e){let t=e.textDocument.uri,n=this.documentOpenCounts.get(t)??0;return this.documentOpenCounts.set(t,n+1),n>0?Promise.resolve(!1):this.notify("textDocument/didOpen",e).then(()=>!0)}textDocumentDidChange(e){return this.notify("textDocument/didChange",e)}textDocumentDidClose(e){let t=e.textDocument.uri,n=this.documentOpenCounts.get(t)??0;return n>1?(this.documentOpenCounts.set(t,n-1),Promise.resolve(void 0)):(this.documentOpenCounts.delete(t),this.notify("textDocument/didClose",e))}textDocumentWillSave(e){return this.notify("textDocument/willSave",e)}async textDocumentWillSaveWaitUntil(e){return await this.request("textDocument/willSaveWaitUntil",e,this.timeout)}textDocumentDidSave(e){return this.notify("textDocument/didSave",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 codeActionResolve(e){return await this.request("codeAction/resolve",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,n){if(e==="initialize")return this.client.request(e,t,n);let i=this.hasCapability(e),o=!(this.ready||this.capabilities)&&this.mayRegisterDynamically(e);return this.initializePromise.then(()=>{if(this.isClosed)throw Error("Language server client is closed");if(Cp[e]&&!o&&!(i||this.hasCapability(e)))throw Error(`Language server does not support method ${e}`);return this.client.request(e,t,n)})}notify(e,t){return this.client.notify(e,t)}processNotification(e){for(let t of this.notificationListeners)try{Promise.resolve(t(e)).catch(n=>{console.error("Notification listener failed",n)})}catch(n){console.error("Notification listener failed",n)}}},vb=(co=class{constructor(t,n){pe(this,"url");pe(this,"protocols");pe(this,"socket");pe(this,"opened",!1);pe(this,"closed",!1);pe(this,"rejectConnect");pe(this,"handlers",new Set);pe(this,"closeHandlers",new Set);pe(this,"outbox",[]);this.url=t,this.protocols=n}connect(){var t,n;return/^wss?:\/\//i.test(this.url)?(this.url.toLowerCase().startsWith("ws://")&&typeof location<"u"&&location.protocol==="https:"&&console.warn(`Insecure WebSocket ${this.url} may be blocked from an HTTPS page`),(t=this.rejectConnect)==null||t.call(this,Error(`WebSocket connection to ${this.url} was replaced`)),this.rejectConnect=void 0,(n=this.socket)==null||n.close(),this.opened=!1,this.closed=!1,new Promise((i,o)=>{let l=new WebSocket(this.url,this.protocols);this.socket=l,this.rejectConnect=o,l.addEventListener("open",()=>{if(this.socket===l){this.opened=!0,this.rejectConnect=void 0;for(let u of this.outbox)l.send(u);this.outbox=[],i()}}),l.addEventListener("message",u=>{this.socket===l&&this.receiveFrame(u.data,l)}),l.addEventListener("error",()=>{if(this.socket!==l)return;let u=Error(`WebSocket connection to ${this.url} failed`);this.opened?this.emitClose(u):o(u)}),l.addEventListener("close",()=>{this.socket===l&&(this.opened?this.closed||this.emitClose(Error(`WebSocket connection to ${this.url} closed`)):o(Error(`WebSocket to ${this.url} closed before opening`)))})})):Promise.reject(Error(`Invalid WebSocket URL: ${this.url||"(empty)"}`))}send(t){if(this.closed)return;let n=JSON.stringify(t);this.socket&&this.socket.readyState===WebSocket.OPEN?this.socket.send(n):this.outbox.length<co.OUTBOX_LIMIT&&this.outbox.push(n)}onMessage(t){return this.handlers.add(t),()=>{this.handlers.delete(t)}}onClose(t){return this.closeHandlers.add(t),()=>{this.closeHandlers.delete(t)}}close(){var t,n;(t=this.rejectConnect)==null||t.call(this,Error(`WebSocket to ${this.url} closed`)),this.rejectConnect=void 0,this.closed=!0,this.opened=!1,this.handlers.clear(),this.closeHandlers.clear(),this.outbox=[],(n=this.socket)==null||n.close(),this.socket=void 0}receiveFrame(t,n){if(t instanceof ArrayBuffer||Object.prototype.toString.call(t)==="[object ArrayBuffer]"){this.dispatchFrame(new TextDecoder().decode(t));return}if(typeof Blob<"u"&&t instanceof Blob){t.text().then(i=>{this.socket===n&&this.dispatchFrame(i)});return}this.dispatchFrame(String(t))}dispatchFrame(t){if(this.closed)return;let n;try{n=JSON.parse(t)}catch{return}if(typeof n!="object"||!n||Array.isArray(n))return;let i=n;for(let o of this.handlers)try{o(i)}catch(l){console.error("WebSocket message handler failed",l)}}emitClose(t){this.opened=!1,this.closed=!0;for(let n of this.closeHandlers)try{n(t)}catch(i){console.error("WebSocket close handler failed",i)}}},pe(co,"OUTBOX_LIMIT",1e3),co),nn=vf(),hl=console.log,bb=2**31-1;function tD(){return String(Date.now()+Math.random())}function gl(e){return e!=null&&typeof e.command=="string"}function pa(e,t){return e.line===t.line?e.character-t.character:e.line-t.line}function nD(e,t){let n=pa(e.start,e.end)===0,i=pa(t.start,t.end)===0;return n||i?pa(e.start,t.end)<=0&&pa(t.start,e.end)<=0:pa(e.start,t.end)<0&&pa(t.start,e.end)<0}function rD(e,t){if(gl(e))return!0;let n=e.diagnostics;return!n||n.length===0?!0:n.some(i=>nD(i.range,t.range))}function iD(e){let t;try{t=new URL(e)}catch{return!1}return t.protocol==="http:"||t.protocol==="https:"||t.protocol==="mailto:"}var Sp=sr.define();let au,Ep;au=li.define({create:()=>new Map,update(e,t){let n=e;for(let i of t.effects)if(i.is(Sp)){n===e&&(n=new Map(e));for(let o of[...n.keys()])o.startsWith(`${i.value.pluginId}:`)&&n.delete(o);for(let[o,l]of i.value.anchors)n.set(o,l)}if(t.docChanged&&n.size>0){n===e&&(n=new Map(e));for(let[i,o]of n)n.set(i,{from:t.changes.mapPos(o.from,1),to:t.changes.mapPos(o.to,o.from===o.to?1:-1)})}return n}}),Ic=sr.define(),$c=li.define({create:()=>null,update(e,t){for(let n of t.effects)if(n.is(Ic))return n.value;if(e&&t.docChanged){let n=t.changes.mapPos(e.pos),i=e.end==null?void 0:t.changes.mapPos(e.end);return{...e,pos:n,end:i}}return e},provide:e=>QC.from(e)}),Ep=GC.define();var aD=20,ou=new WeakMap;function oD(e,t){let n=ou.get(e);n?n.push(t):ou.set(e,[t])}function sD(e,t){let n=ou.get(e);if(!n)return;let i=n.indexOf(t);i!==-1&&n.splice(i,1),n.length===0&&ou.delete(e)}var lD=class{constructor(e){pe(this,"documentVersion");pe(this,"pluginId");pe(this,"pendingDocumentChanges",new Set);pe(this,"client");pe(this,"documentUri");pe(this,"languageId");pe(this,"view");pe(this,"allowHTMLContent");pe(this,"useSnippetOnCompletion");pe(this,"clientSideFiltering");pe(this,"sendIncrementalChanges");pe(this,"featureOptions");pe(this,"onGoToDefinition");pe(this,"onShowLocation");pe(this,"markdownRenderer");pe(this,"codeActionsConfig");pe(this,"disposeListener");pe(this,"destroyed",!1);pe(this,"documentOpened",!1);pe(this,"documentTextSnapshotted",!1);pe(this,"documentOpenCarriedText",!0);pe(this,"documentReady");pe(this,"signatureHelpRequestId",0);pe(this,"closeCodeActionMenu");pe(this,"closeRenamePopup");pe(this,"lastSeenDiagnosticsVersion",null);let{client:t,documentUri:n,languageId:i,view:o,featureOptions:l,sendIncrementalChanges:u=!0,allowHTMLContent:d=!1,useSnippetOnCompletion:p=!1,clientSideFiltering:g=!1,onGoToDefinition:w,onShowLocation:x,markdownRenderer:S=X1,codeActionsConfig:E}=e;this.documentVersion=0,this.pluginId=tD(),this.client=t,this.documentUri=n,this.languageId=i,this.view=o,this.allowHTMLContent=d,this.useSnippetOnCompletion=p,this.clientSideFiltering=g,this.sendIncrementalChanges=u,this.featureOptions=l,this.onGoToDefinition=w,this.onShowLocation=x,this.markdownRenderer=S,this.codeActionsConfig=E,oD(o,this),this.disposeListener=t.onNotification(this.processNotification.bind(this)),this.documentReady=this.initialize().catch(T=>{console.error("Language server initialization failed",T)})}update({state:e,docChanged:t,startState:{doc:n},changes:i}){if(!t)return;let o=this.resolveTextDocumentSyncKind();o!==nn.TextDocumentSyncKind.None&&(this.sendIncrementalChanges&&o===nn.TextDocumentSyncKind.Incremental?this.trackDocumentChanges(I3(n,i)):this.trackDocumentChanges([{text:e.doc.toString()}]))}trackDocumentChanges(e){let t=this.sendChanges(e);this.pendingDocumentChanges.add(t),t.finally(()=>this.pendingDocumentChanges.delete(t))}destroy(){var e,t,n;this.destroyed=!0,(e=this.disposeListener)==null||e.call(this),this.disposeListener=void 0,(t=this.closeCodeActionMenu)==null||t.call(this),(n=this.closeRenamePopup)==null||n.call(this),this.view.state.field(au,!1)&&this.view.dispatch({effects:Sp.of({pluginId:this.pluginId,anchors:new Map})}),sD(this.view,this),this.closeDocument()}closeDocument(){this.documentOpened&&this.client.ready&&(this.documentOpened=!1,Promise.resolve(this.client.textDocumentDidClose({textDocument:{uri:this.documentUri}})).catch(e=>{console.error("Failed to send didClose",e)}))}async initialize({documentText:e}={}){if(this.client.initializePromise&&await this.client.initializePromise,this.destroyed)return;let t=e??this.view.state.doc.toString();this.documentTextSnapshotted=!0,this.documentOpenCarriedText=await this.client.textDocumentDidOpen({textDocument:{uri:this.documentUri,languageId:this.languageId,text:t,version:this.documentVersion}})!==!1,this.documentOpened=!0,this.destroyed&&this.closeDocument()}resolveTextDocumentSyncKind(){var t;let e=(t=this.client.capabilities)==null?void 0:t.textDocumentSync;return e==null?this.sendIncrementalChanges?nn.TextDocumentSyncKind.Incremental:nn.TextDocumentSyncKind.Full:typeof e=="number"?e:e.change??nn.TextDocumentSyncKind.None}async sendChanges(e){let t=this.documentTextSnapshotted;if(!(!this.documentOpened&&(await this.documentReady,!t&&this.documentOpenCarriedText))&&this.client.ready)try{await this.client.textDocumentDidChange({textDocument:{uri:this.documentUri,version:++this.documentVersion},contentChanges:e})}catch(n){console.error(n)}}async documentDidSave(e=nn.TextDocumentSaveReason.Manual){var l;if(!this.client.ready||(await Promise.all(this.pendingDocumentChanges),this.destroyed||!this.client.ready))return;let t=(l=this.client.capabilities)==null?void 0:l.textDocumentSync,n=typeof t=="object"&&t?t:void 0;if(n!=null&&n.willSave){try{await this.client.textDocumentWillSave({textDocument:{uri:this.documentUri},reason:e})}catch(u){console.error("Failed to send willSave",u)}if(this.destroyed||!this.client.ready)return}if(n!=null&&n.willSaveWaitUntil){try{let u=await this.client.textDocumentWillSaveWaitUntil({textDocument:{uri:this.documentUri},reason:e});u&&u.length>0&&!this.destroyed&&(this.applyEdits(this.view,u),await Promise.all(this.pendingDocumentChanges))}catch(u){console.error("Failed during willSaveWaitUntil",u)}if(this.destroyed||!this.client.ready)return}let i=n==null?void 0:n.save;if(i==null||i===!1)return;let o=typeof i=="object"&&i.includeText;try{await this.client.textDocumentDidSave({textDocument:{uri:this.documentUri},text:o?this.view.state.doc.toString():void 0})}catch(u){console.error("Failed to send didSave",u)}}requestDiagnostics(e){this.sendChanges([{text:e.state.doc.toString()}])}async requestHoverTooltip(e,{line:t,character:n}){if(!this.featureOptions.hoverEnabled||!(this.client.ready&&this.client.hasCapability("textDocument/hover")))return null;let i;try{i=await this.client.textDocumentHover({textDocument:{uri:this.documentUri},position:{line:t,character:n}})}catch{return null}if(!i)return null;let{contents:o,range:l}=i,u=Kt(e.state.doc,{line:t,character:n}),d;if(l&&(u=Kt(e.state.doc,l.start),d=Kt(e.state.doc,l.end)),u==null||xp(o))return null;let p=document.createElement("div");return p.classList.add("documentation","cm-lsp-hover-tooltip"),ml(p,o,{allowHTMLContent:this.allowHTMLContent,markdownRenderer:this.markdownRenderer}),{pos:u,end:d,create:g=>({dom:p}),above:!0}}async requestCompletion(e,{line:t,character:n},{triggerKind:i,triggerCharacter:o}){if(!this.featureOptions.completionEnabled||(await Promise.all(this.pendingDocumentChanges),!(this.client.ready&&this.client.hasCapability("textDocument/completion"))))return null;let l;try{l=await this.client.textDocumentCompletion({textDocument:{uri:this.documentUri},position:{line:t,character:n},context:{triggerKind:i,triggerCharacter:o}})}catch{return null}if(!l)return null;let u=D3(l)?l:{isIncomplete:!1,items:l};if(!Array.isArray(u.items))return null;let d=u.items.map(T=>M3(T,u.itemDefaults)),p=this.clientSideFiltering&&!u.isIncomplete,g=E3(d),w=g?e.matchBefore(g)??e.matchBefore(/[a-zA-Z0-9_]+/):e.matchBefore(/[a-zA-Z0-9_]+/),{pos:x}=e,S=Q3(d,w==null?void 0:w.text,this.languageId,!p);w&&(x=w.from);let E=S.map(T=>{var O,j;return K3(T,{allowHTMLContent:this.allowHTMLContent,useSnippetOnCompletion:this.useSnippetOnCompletion,hasResolveProvider:((j=(O=this.client.capabilities)==null?void 0:O.completionProvider)==null?void 0:j.resolveProvider)??!1,resolveItem:this.client.completionItemResolve.bind(this.client)})});return p?{from:x,options:E,validFor:/^\w*$/}:{from:x,options:E,filter:!1}}async requestDefinition(e,{line:t,character:n}){if(!this.featureOptions.definitionEnabled||!(this.client.ready&&this.client.hasCapability("textDocument/definition")))return;let i;try{i=await this.client.textDocumentDefinition({textDocument:{uri:this.documentUri},position:{line:t,character:n}})}catch{return}if(!i||this.destroyed)return;let o=Array.isArray(i)?i:[i];if(o.length===0)return;let l=o[0];if(!l||typeof l!="object")return;let u="uri"in l&&typeof l.uri=="string"?l.uri:"targetUri"in l&&typeof l.targetUri=="string"?l.targetUri:void 0,d="range"in l?l.range:"targetRange"in l?l.targetRange:void 0;if(!(u&&(d!=null&&d.start)&&d.end))return;let p=u!==this.documentUri,g={uri:u,range:d,isExternalDocument:p};if(!p){let w=Kt(e.state.doc,d.start),x=Kt(e.state.doc,d.end);if(w==null||x==null||w>x)return;e.dispatch(e.state.update({selection:{anchor:w,head:x}}))}return this.onGoToDefinition&&this.onGoToDefinition(g),g}processNotification(e){try{e.method==="textDocument/publishDiagnostics"&&e.params&&this.processDiagnostics(e.params).catch(t=>hl(t))}catch(t){hl(t)}}async processDiagnostics(e){if(!e||e.uri!==this.documentUri||!Array.isArray(e.diagnostics))return;if(e.version!=null){if(typeof e.version!="number"||!Number.isInteger(e.version)||e.version<0||e.version>bb||this.lastSeenDiagnosticsVersion!=null&&e.version<this.lastSeenDiagnosticsVersion)return;this.lastSeenDiagnosticsVersion=e.version}else if(this.lastSeenDiagnosticsVersion!=null)return;if(!this.featureOptions.diagnosticsEnabled){this.clearDiagnostics();return}let t={[nn.DiagnosticSeverity.Error]:"error",[nn.DiagnosticSeverity.Warning]:"warning",[nn.DiagnosticSeverity.Information]:"info",[nn.DiagnosticSeverity.Hint]:"hint"},n=this.view.state.doc,i=e.diagnostics.filter(d=>{if(!d||typeof d!="object"||!d.range||typeof d.message!="string"&&(typeof d.message!="object"||d.message===null||typeof d.message.value!="string"))return!1;let p=Kt(n,d.range.start),g=Kt(n,d.range.end);return p!=null&&g!=null&&p<=g});if(e.diagnostics.length>0&&i.length===0)return;let o=[];try{o=await this.requestCodeActionsForDiagnostics(i)??[]}catch(d){console.error("Failed to fetch code actions",d)}if(this.destroyed||e.version!=null&&this.lastSeenDiagnosticsVersion!=null&&e.version<this.lastSeenDiagnosticsVersion||this.view.state.doc!==n)return;let l=new Map,u=i.map((d,p)=>{var me;let{range:g,message:w,severity:x,code:S,source:E,tags:T}=d,O=Kt(n,g.start),j=Kt(n,g.end);if(O==null||j==null||O>j)return null;(me=d.relatedInformation)==null||me.forEach(($,W)=>{if($.location.uri!==this.documentUri)return;let ae=Kt(n,$.location.range.start),xe=Kt(n,$.location.range.end);ae==null||xe==null||l.set(`${this.pluginId}:${p}:${W}`,{from:ae,to:xe})});let z=o.filter($=>rD($,d)).map($=>{var W;return{name:"command"in $&&typeof $.command=="object"&&((W=$.command)==null?void 0:W.title)||$.title,apply:()=>{this.applyCodeAction($)}}}),V=E||this.languageId,P=S!=null&&S!==""?`${V}(${S})`:V,U=[this.pluginId];return T!=null&&T.includes(nn.DiagnosticTag.Unnecessary)&&U.push("cm-lsp-unnecessary"),T!=null&&T.includes(nn.DiagnosticTag.Deprecated)&&U.push("cm-lsp-deprecated"),{from:O,to:j,severity:t[x??nn.DiagnosticSeverity.Error]??"error",message:tb(w),renderMessage:$=>this.renderDiagnosticMessage($,d,p),source:P,markClass:U.join(" "),actions:z.length>0?z:void 0,lspDiagnostic:d}});this.setOwnDiagnostics(u.filter(d=>d!=null),l)}setOwnDiagnostics(e,t=new Map){let n=this.view.state,i=[];aS(n,(d,p,g)=>{this.ownsDiagnostic(d)||i.push({...d,from:p,to:g})});let o=X5(n,[...i,...e]),l=o.effects,u=Array.isArray(l)?[...l]:l?[l]:[];u.push(Sp.of({pluginId:this.pluginId,anchors:t})),this.view.dispatch({...o,effects:u})}ownsDiagnostic(e){var t;return((t=e.markClass)==null?void 0:t.split(" ").includes(this.pluginId))??!1}renderDiagnosticMessage(e,t,n){let{message:i,code:o,source:l,codeDescription:u,relatedInformation:d}=t,p=document.createElement("div");p.classList.add("cm-lsp-diagnostic-message");let g=document.createElement("div");if(ml(g,{kind:"markdown",value:tb(i)},{allowHTMLContent:this.allowHTMLContent,markdownRenderer:this.markdownRenderer}),p.appendChild(g),(u==null?void 0:u.href)&&iD(u.href)){let w=l||this.languageId,x=o!=null&&o!==""?`${w}(${o})`:w,S=document.createElement("a");S.className="cm-diagnostic-code-link",S.href=u.href,S.target="_blank",S.rel="noopener noreferrer",S.textContent=x,p.appendChild(S)}if(d&&d.length>0){let w=document.createElement("div");w.className="cm-diagnostic-related",d.forEach((x,S)=>{w.appendChild(this.renderRelatedInformation(e,x,`${this.pluginId}:${n}:${S}`))}),p.appendChild(w)}return p}renderRelatedInformation(e,t,n){let{location:i,message:o}=t,{uri:l,range:u}=i,d=l!==this.documentUri,p=()=>{var j;if(d)return null;let T=(j=e.state.field(au,!1))==null?void 0:j.get(n);if(T)return T;let O=Kt(e.state.doc,u.start);return O==null?null:{from:O,to:Kt(e.state.doc,u.end)??O}},g=document.createElement("div");g.className="cm-diagnostic-related-item";let w=document.createElement("span");w.className="cm-diagnostic-related-message",w.textContent=o,g.appendChild(w);let x=p(),S=x&&!d?ur(e.state.doc,x.from):u.start,E=document.createElement("span");if(E.className="cm-diagnostic-related-location",E.textContent=` ${l}:${S.line+1}:${S.character+1}`,g.appendChild(E),!d||this.onShowLocation){g.classList.add("cm-diagnostic-related-clickable"),g.setAttribute("role","button"),g.tabIndex=0;let T=()=>{var j;if(d){(j=this.onShowLocation)==null||j.call(this,{uri:l,range:u,isExternalDocument:d});return}let O=p();O!=null&&e.dispatch({selection:{anchor:O.from,head:O.to},scrollIntoView:!0})};g.addEventListener("click",T),g.addEventListener("keydown",O=>{(O.key==="Enter"||O.key===" ")&&(O.preventDefault(),T())})}return g}clearDiagnostics(){this.setOwnDiagnostics([])}async requestCodeActionsForDiagnostics(e){let t=e[0];if(!t||!this.featureOptions.codeActionsEnabled||!(this.client.ready&&this.client.hasCapability("textDocument/codeAction")))return null;let n=t.range.start,i=t.range.end;for(let o of e)pa(o.range.start,n)<0&&(n=o.range.start),pa(o.range.end,i)>0&&(i=o.range.end);return await this.client.textDocumentCodeAction({textDocument:{uri:this.documentUri},range:{start:n,end:i},context:{diagnostics:e}})}async requestCodeActions(e,t,n){return!this.featureOptions.codeActionsEnabled||!(this.client.ready&&this.client.hasCapability("textDocument/codeAction"))?null:await this.client.textDocumentCodeAction({textDocument:{uri:this.documentUri},range:t,context:{diagnostics:this.diagnosticsInRange(e,t),...n?{only:n}:{}}})}async requestCodeActionsAtSelection(e){let{from:t,to:n}=e.state.selection.main;return await this.requestCodeActions(e,{start:ur(e.state.doc,t),end:ur(e.state.doc,n)})}diagnosticsInRange(e,t){let n=e.state.doc,i=Kt(n,t.start),o=Kt(n,t.end);if(i==null||o==null)return[];let l={error:nn.DiagnosticSeverity.Error,warning:nn.DiagnosticSeverity.Warning,info:nn.DiagnosticSeverity.Information,hint:nn.DiagnosticSeverity.Hint},u=[];return aS(e.state,(d,p,g)=>{if(p>o||g<i)return;let w={start:ur(n,p),end:ur(n,g)},x=d.lspDiagnostic;x?u.push({...x,range:w}):u.push({range:w,message:d.message,severity:l[d.severity],source:d.source})}),u}async applyCodeAction(e){let t=await this.resolveCodeAction(e);if(!this.destroyed){if(gl(t)){hl("Executing command:",t);return}t.edit&&await this.applyWorkspaceEdit(this.view,t.edit),t.command?hl("Executing command:",t.command):t.edit||Jt(this.view,`Code action "${e.title}" has nothing to apply`)}}async resolveCodeAction(e){if(gl(e)||e.edit||e.command||!this.serverSupportsCodeActionResolve())return e;try{return await this.client.codeActionResolve(e)??e}catch(t){return console.error("Failed to resolve code action",t),e}}serverSupportsCodeActionResolve(){var t,n;let e=(t=this.client.capabilities)==null?void 0:t.codeActionProvider;if(typeof e=="object"&&e.resolveProvider)return!0;for(let i of this.client.dynamicCapabilities.values())if(i.method==="textDocument/codeAction"&&((n=i.registerOptions)!=null&&n.resolveProvider))return!0;return!1}async showCodeActionsMenu(e){var o;let t=e.state,n=await this.requestCodeActionsAtSelection(e);if(this.destroyed||e.state.doc!==t.doc||!e.state.selection.main.eq(t.selection.main))return!1;if(!n||n.length===0)return Jt(e,"No code actions available"),!1;let i=async l=>{await this.applyCodeAction(l)};return(o=this.codeActionsConfig)!=null&&o.renderMenu?(this.codeActionsConfig.renderMenu(n,i),!0):(this.showDefaultCodeActionsMenu(e,n,i),!0)}showDefaultCodeActionsMenu(e,t,n){var x;(x=this.closeCodeActionMenu)==null||x.call(this);let i=document.createElement("div");i.className="cm-code-action-menu",i.setAttribute("role","listbox"),i.style.cssText="position: absolute; display: flex; flex-direction: column; padding: 2px; background: white; border: 1px solid #ddd; box-shadow: 0 2px 8px rgba(0,0,0,.15); z-index: 99;";let o=S=>{i.contains(S.target)||l()},l=()=>{this.closeCodeActionMenu===l&&(this.closeCodeActionMenu=void 0),i.remove(),document.removeEventListener("mousedown",o)};this.closeCodeActionMenu=l;let u=t.map(S=>{let E=document.createElement("button");E.type="button",E.className="cm-code-action-item",E.style.cssText="display: flex; gap: 8px; align-items: baseline; padding: 4px 8px; border: none; background: none; text-align: left; cursor: pointer; font: inherit;";let T=document.createElement("span");if(T.textContent=S.title,E.appendChild(T),!gl(S)&&S.kind){let O=document.createElement("span");O.className="cm-code-action-kind",O.style.cssText="color: #888; font-size: 85%; margin-left: auto;",O.textContent=S.kind,E.appendChild(O)}return!gl(S)&&S.disabled&&(E.disabled=!0,E.title=S.disabled.reason,E.style.opacity="0.5",E.style.cursor="default"),E.addEventListener("click",()=>{l(),e.focus(),n(S)}),i.appendChild(E),E}),d=u.findIndex(S=>!S.disabled),p=S=>{var E;d=S,(E=u[S])==null||E.focus()},g=S=>{var E;for(let T=d+S;T>=0&&T<u.length;T+=S)if(!((E=u[T])!=null&&E.disabled)){p(T);return}};i.tabIndex=-1,i.addEventListener("keydown",S=>{if(S.key==="Escape")l(),e.focus();else if(S.key==="ArrowDown")g(1);else if(S.key==="ArrowUp")g(-1);else if(S.key==="Enter"){let E=u[d];E&&!E.disabled&&E.click()}else return;S.preventDefault(),S.stopPropagation()});let w=e.coordsAtPos(e.state.selection.main.from);w&&(i.style.left=`${w.left+window.scrollX}px`,i.style.top=`${w.bottom+window.scrollY+5}px`),document.addEventListener("mousedown",o),document.body.appendChild(i),d===-1?i.focus():p(d)}async requestRename(e,{line:t,character:n}){var i;if(this.featureOptions.renameEnabled){if(!this.client.ready){Jt(e,"Language server not ready");return}if(!this.client.hasCapability("textDocument/rename")){Jt(e,"Rename not supported by language server");return}try{let o=await this.client.textDocumentPrepareRename({textDocument:{uri:this.documentUri},position:{line:t,character:n}}).catch(()=>this.prepareRenameFallback(e,{line:t,character:n}));if(!o){Jt(e,"Cannot rename this symbol");return}let l;if("defaultBehavior"in o){if(!o.defaultBehavior){Jt(e,"Cannot rename this symbol");return}let j=this.prepareRenameFallback(e,{line:t,character:n});if(!j){Jt(e,"Cannot rename this symbol");return}l=j}else l=o;let u=document.createElement("div");u.className="cm-rename-popup",u.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 d=document.createElement("input");d.type="text",d.style.cssText="width: 200px; padding: 4px; border: 1px solid #ddd;";let p="range"in l?l.range:l,g=Kt(e.state.doc,p.start);if(g==null)return;let w=Kt(e.state.doc,p.end);d.value="placeholder"in l?l.placeholder:w==null?"":e.state.doc.sliceString(g,w);let x=d.value;u.appendChild(d);let S=e.coordsAtPos(g);if(!S)return;u.style.left=`${S.left}px`,u.style.top=`${S.bottom+5}px`;let E=j=>{u.contains(j.target)||T()},T=()=>{u.remove(),document.removeEventListener("mousedown",E),this.closeRenamePopup===T&&(this.closeRenamePopup=void 0)},O=async()=>{let j=d.value.trim();if(!j){Jt(e,"New name cannot be empty"),T();return}if(/[\r\n]/.test(j)){Jt(e,"New name must be a single line"),T();return}if(j===x){T();return}try{let z=e.state.doc,V=await this.client.textDocumentRename({textDocument:{uri:this.documentUri},position:{line:t,character:n},newName:j});if(this.destroyed||e.state.doc!==z)return;await this.applyRenameEdit(e,V)}catch(z){Jt(e,`Rename failed: ${z instanceof Error?z.message:"Unknown error"}`)}finally{T()}};d.addEventListener("keydown",j=>{j.key==="Enter"?O():j.key==="Escape"&&T(),j.stopPropagation()}),(i=this.closeRenamePopup)==null||i.call(this),this.closeRenamePopup=T,document.addEventListener("mousedown",E),document.body.appendChild(u),d.focus(),d.select()}catch(o){Jt(e,`Rename failed: ${o instanceof Error?o.message:"Unknown error"}`)}}}async requestSignatureHelp(e,{line:t,character:n},i=void 0){var o,l;if(!(this.featureOptions.signatureHelpEnabled&&this.client.ready&&this.client.hasCapability("textDocument/signatureHelp")))return null;try{let u=await this.client.textDocumentSignatureHelp({textDocument:{uri:this.documentUri},position:{line:t,character:n},context:{isRetrigger:!1,triggerKind:1,triggerCharacter:i}});if(!(u!=null&&u.signatures)||u.signatures.length===0)return null;let d=this.createTooltipContainer(),p=u.activeSignature??0,g=u.signatures[p]||u.signatures[0];if(!g)return null;let w=u.activeParameter??g.activeParameter??0,x=this.createSignatureElement(g,w);d.appendChild(x),g.documentation&&d.appendChild(this.createDocumentationElement(g.documentation));let S=(o=g.parameters)==null?void 0:o[w];S!=null&&S.documentation&&d.appendChild(this.createParameterDocElement(S.documentation));let E=Kt(e.state.doc,{line:t,character:n});return E==null?null:{pos:E,end:E,create:T=>({dom:d}),above:((l=this.featureOptions.signatureHelpOptions)==null?void 0:l.position)==="above"}}catch(u){return console.error("Signature help error:",u),null}}async showSignatureHelpTooltip(e,t,n){let i=++this.signatureHelpRequestId,o=await this.requestSignatureHelp(e,ur(e.state.doc,t),n);this.destroyed||i!==this.signatureHelpRequestId||e.dispatch({effects:Ic.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){var u;let n=document.createElement("div");if(n.classList.add("cm-signature"),n.style.cssText="font-family: monospace; margin-bottom: 4px;",!e.label||typeof e.label!="string")return n.textContent="Signature information unavailable",n;let i=e.label,o=e.parameters||[];if(o.length===0||!o[t])return n.textContent=i,n;let l=o[t].label;if(typeof l=="string"){let d=i.indexOf("(")+1;for(let g=0;g<t;g++){let w=(u=o[g])==null?void 0:u.label;if(typeof w=="string"){let x=i.indexOf(w,d);x!==-1&&(d=x+w.length)}}let p=i.indexOf(l,d);p===-1?n.textContent=i:this.applyRangeHighlighting(n,i,p,p+l.length)}else Array.isArray(l)&&l.length===2?this.applyRangeHighlighting(n,i,l[0],l[1]):n.textContent=i;return n}applyRangeHighlighting(e,t,n,i){if(!(Number.isInteger(n)&&Number.isInteger(i))||n<0||i<0||n>t.length||i>t.length){e.textContent=t;return}let o=Math.min(n,i),l=Math.max(n,i);if(o===l){e.textContent=t;return}e.textContent="";let u=t.substring(0,o),d=t.substring(o,l),p=t.substring(l);e.appendChild(document.createTextNode(u));let g=document.createElement("span");g.classList.add("cm-signature-active-param"),g.style.cssText="font-weight: bold; text-decoration: underline;",g.textContent=d,e.appendChild(g),e.appendChild(document.createTextNode(p))}createDocumentationElement(e){let t=document.createElement("div");return t.classList.add("cm-signature-docs"),t.style.cssText="margin-top: 4px; color: #666;",ml(t,e,{allowHTMLContent:this.allowHTMLContent,markdownRenderer:this.markdownRenderer}),t}createParameterDocElement(e){let t=document.createElement("div");return t.classList.add("cm-parameter-docs"),t.style.cssText="margin-top: 4px; font-style: italic; border-top: 1px solid #eee; padding-top: 4px;",ml(t,e,{allowHTMLContent:this.allowHTMLContent,markdownRenderer:this.markdownRenderer}),t}prepareRenameFallback(e,{line:t,character:n}){let i=e.state.doc.line(t+1).text,o=/\w+/g,l,u=n,d=n;for(;(l=o.exec(i))!==null;){let p=l.index,g=l.index+l[0].length;if(n>=p&&n<=g){u=p,d=g;break}}return u===n&&d===n?null:{range:{start:{line:t,character:u},end:{line:t,character:d}},placeholder:i.slice(u,d)}}applyEdits(e,t){let n=e.state.doc,i=[];for(let l of t){if(!l||typeof l!="object"||!l.range||typeof l.newText!="string")return!1;let u=Kt(n,l.range.start),d=Kt(n,l.range.end);if(u==null||d==null||u>d)return!1;i.push({from:u,to:d,insert:l.newText})}if(i.length===0)return!1;let o=[...i].sort((l,u)=>l.from-u.from||l.to-u.to);for(let l=1;l<o.length;l++){let u=o[l-1],d=o[l];if(u&&d&&(d.from<u.to||d.from===d.to&&u.from===u.to&&d.from===u.from))return Jt(e,"Workspace edit ranges overlap"),!1}return e.dispatch(e.state.update({changes:i})),!0}async applyWorkspaceEdit(e,t){var u;if(!t)return Jt(e,"No edit returned from language server"),!1;let n=t.changes&&typeof t.changes=="object"?t.changes:{},i=Array.isArray(t.documentChanges)?t.documentChanges:[];if(Object.keys(n).length===0&&i.length===0)return Jt(e,"No changes to apply"),!1;if(i.length>0){let d=[];for(let p of i){if(typeof p!="object"||!p||!("textDocument"in p))return Jt(e,"File creation, deletion, or renaming operations not supported yet"),!1;if(typeof p.textDocument!="object"||p.textDocument===null)return Jt(e,"Malformed workspace edit"),!1;if(p.textDocument.uri!==this.documentUri)return Jt(e,"Multi-file edits not supported yet"),!1;if(p.textDocument.version!=null&&p.textDocument.version!==this.documentVersion)return Jt(e,"Workspace edit is stale because the document changed"),!1;if(!Array.isArray(p.edits))return!1;for(let g of p.edits){if(typeof g!="object"||!g||!("newText"in g))return Jt(e,"Snippet edits not supported yet"),!1;d.push(g)}}return d.length===0?!1:this.applyEdits(e,d)}let o=Object.entries(n);if(o.some(([d])=>d!==this.documentUri))return Jt(e,"Multi-file edits not supported yet"),!1;let l=(u=o[0])==null?void 0:u[1];return Array.isArray(l)?this.applyEdits(e,l):!1}async applyRenameEdit(e,t){return this.applyWorkspaceEdit(e,t)}};r0=function(e){var d,p;let t={rename:"F2",goToDefinition:"F12",signatureHelp:"Mod-Shift-Space",codeActions:"Mod-.",...e.keyboardShortcuts},n=e.client,i={diagnosticsEnabled:!0,hoverEnabled:!0,completionEnabled:!0,definitionEnabled:!0,renameEnabled:!0,codeActionsEnabled:!0,signatureHelpEnabled:!0,signatureActivateOnTyping:!1,signatureHelpOptions:{position:"below"},...e},o=Cr.define(g=>new lD({client:n,documentUri:e.documentUri??g.state.facet(fb),languageId:e.languageId??g.state.facet(Z3),view:g,featureOptions:i,sendIncrementalChanges:e.sendIncrementalChanges,allowHTMLContent:e.allowHTMLContent,useSnippetOnCompletion:e.useSnippetOnCompletion,clientSideFiltering:e.clientSideFiltering,onGoToDefinition:e.onGoToDefinition,onShowLocation:e.onShowLocation,markdownRenderer:e.markdownRenderer,codeActionsConfig:e.codeActionsConfig})),l=g=>g.plugin(o),u=[o];if(i.diagnosticsEnabled&&u.push(au,At.baseTheme({".cm-lsp-unnecessary":{opacity:"0.6"},".cm-lsp-deprecated":{textDecoration:"line-through"},".cm-diagnostic-related":{marginTop:"4px",display:"flex",flexDirection:"column",gap:"2px"},".cm-diagnostic-related-clickable":{cursor:"pointer"},".cm-diagnostic-related-location":{opacity:"0.7"},".cm-diagnostic-code-link":{display:"inline-block",marginTop:"4px"}})),u.push(Si.of([{key:t.signatureHelp,run:g=>{let w=l(g);if(!(w&&i.signatureHelpEnabled))return!1;let x=g.state.selection.main.head;return w.showSignatureHelpTooltip(g,x),!0}},{key:t.rename,run:g=>{let w=l(g);if(!(w&&i.renameEnabled))return!1;let x=g.state.selection.main.head;return w.requestRename(g,ur(g.state.doc,x)),!0}},{key:t.codeActions,run:g=>{let w=l(g);return w&&i.codeActionsEnabled?(w.showCodeActionsMenu(g).catch(x=>Jt(g,`Code actions failed: ${x instanceof Error?x.message:"Unknown error"}`)),!0):!1}},{key:t.goToDefinition,run:g=>{let w=l(g);if(!(w&&i.definitionEnabled))return!1;let x=g.state.selection.main.head;return w.requestDefinition(g,ur(g.state.doc,x)).catch(S=>Jt(g,`Go to definition failed: ${S instanceof Error?S.message:"Unknown error"}`)),!0}}])),i.hoverEnabled&&u.push(Ig((g,w)=>{let x=l(g);return x==null?null:x.requestHoverTooltip(g,ur(g.state.doc,w))},e.hoverConfig)),i.signatureHelpEnabled){u.push($c);let g=w=>w.state.field($c)?(w.dispatch({effects:Ic.of(null)}),!0):!1;u.push(At.domEventHandlers({mousedown:(w,x)=>(g(x),!1)})),u.push(Si.of([{key:")",run:w=>(g(w),!1)},{key:"Escape",run:w=>g(w)}])),u.push(At.updateListener.of(w=>{if(!(l(w.view)&&i.signatureActivateOnTyping)||!w.state.field($c)||!(w.selectionSet||w.docChanged))return;let x=w.state.selection.main.head;fD(w.state.doc,x)||queueMicrotask(()=>{g(w.view)})})),u.push(At.updateListener.of(async w=>{var j,z;let x=l(w.view);if(!(x&&w.docChanged)||w.transactions.some(V=>V.annotation(Ep))||!x.client.hasCapability("textDocument/signatureHelp")||!i.signatureActivateOnTyping)return;let S=((z=(j=x.client.capabilities)==null?void 0:j.signatureHelpProvider)==null?void 0:z.triggerCharacters)||["(",","],E=w.changes,T=-1,O;E.iterChanges((V,P,U,me,$)=>{if(T>=0)return;let W=uD($.toString(),U,S);W&&(T=W.triggerPos,O=W.triggerCharacter)}),T>=0&&x.showSignatureHelpTooltip(w.view,T,O)}))}if(i.completionEnabled){let g=(d=e.completionConfig)==null?void 0:d.optionClass;u.push(At.baseTheme({".cm-tooltip-autocomplete li.cm-deprecated .cm-completionLabel":{textDecoration:"line-through"}}),ef({...e.completionConfig,optionClass:w=>[P3(w),(g==null?void 0:g(w))??""].filter(Boolean).join(" "),override:[async w=>{var O,j;let x=w.view?l(w.view):null;if(x==null)return null;let{state:S,pos:E}=w,T=cD(w,((j=(O=x.client.capabilities)==null?void 0:O.completionProvider)==null?void 0:j.triggerCharacters)??[],e.completionMatchBefore);return T==null?null:await x.requestCompletion(w,ur(S.doc,E),T)},...((p=e.completionConfig)==null?void 0:p.override)||[]]}))}return u.push(At.domEventHandlers({click:(g,w)=>{if(i.definitionEnabled&&t.goToDefinition==="ctrlcmd"&&(g.ctrlKey||g.metaKey)){let x=w.posAtCoords({x:g.clientX,y:g.clientY}),S=l(w);x&&S&&(S.requestDefinition(w,ur(w.state.doc,x)).catch(E=>Jt(w,`Go to definition failed: ${E instanceof Error?E.message:"Unknown error"}`)),g.preventDefault())}}})),u};function cD(e,t,n){let{state:i,pos:o,explicit:l}=e,u=i.doc.lineAt(o),d=nn.CompletionTriggerKind.Invoked,p,g=u.text[o-u.from-1]||"",w=t==null?void 0:t.includes(g);return!l&&w&&(d=nn.CompletionTriggerKind.TriggerCharacter,p=g),!l&&d===nn.CompletionTriggerKind.Invoked&&!e.matchBefore(n||/(\w+|\w+\.|\/|,)$/)?null:{triggerKind:d,triggerCharacter:p}}function uD(e,t,n){if(!e)return null;for(let i of n){let o=e.indexOf(i);if(o!==-1)return{triggerPos:t+o+1,triggerCharacter:i}}return null}function dD(e){let t=0;for(let n of e)n==="("?t++:n===")"&&t--;return t}function fD(e,t,n=aD){let i=e.lineAt(t),o=Math.max(1,i.number-n),l=e.line(o).from;return dD(e.sliceString(l,t))>0}cf=function(e,t,n={}){let{preserveCursor:i=!0,effects:o,userEvent:l}=n,u=e.state.doc;if(u.toString()!==t)if(i&&e.hasFocus){let d=e.state.selection.main.head,p=u.lineAt(d),g=p.number,w=d-p.from,x=e.state.update({changes:{from:0,to:u.length,insert:t}}).state.doc,S;if(g<=x.lines){let E=x.line(g),T=E.length;S=E.from+Math.min(w,T)}else S=x.line(x.lines).to;e.dispatch({changes:{from:0,to:u.length,insert:t},annotations:Ep.of(!0),selection:{anchor:S},effects:o,userEvent:l})}else e.dispatch({changes:{from:0,to:u.length,insert:t},effects:o,userEvent:l})},Fo=function(){return Gs.define({combine:e=>e.find(t=>t!==void 0)})};const wb=Fo(),xb=Fo(),Tp=Fo(),su=Fo(),_b=Fo();US=function({cellId:e,completionConfig:t,hotkeys:n,placeholderType:i,lspConfig:o,diagnosticsConfig:l}){return[su.of(e),wb.of(t),xb.of(n),Tp.of(i),_b.of({...o,diagnostics:l})]},pf=new Jd,$0=function(e){return e==="application/vnd.marimo+error"},a0=function(e){return e==="application/vnd.marimo+traceback"},Sc=function(e){return $0(e)||a0(e)};function pD(e){return Object.values(e.cellRuntime).some(t=>t.status==="running")}function mD(e){return Object.values(e.cellRuntime).filter(t=>t.status==="running"||t.status==="queued").length}function hD(e){return B0(e).length>0}DS=function(e){return e.cellIds.inOrderIds.map(t=>e.cellData[t])},p0=function({cellHandles:e}){var n;let t={};for(let[i,o]of ki.entries(e))(n=o.current)!=null&&n.editorView&&(t[i]=o.current.editorView);return t},uy=function(e){let{cellIds:t,cellData:n}=e,i=[];for(let o of t.inOrderIds)n[o].config.disabled&&i.push(o);return i},f0=function(e){let{cellIds:t,cellData:n}=e,i=[];for(let o of t.inOrderIds)n[o].config.disabled||i.push(o);return i};function gD(e){return e.history.length>0}function yD(e){let t=e.history[e.history.length-1];return t&&t.type==="move"?"Undo move":"Undo cell deletion"}kS=function(e,t){let n=e.cellIds.findWithId(t).getDescendants(t);return{stale:n.some(i=>{var o,l;return((o=e.cellRuntime[i])==null?void 0:o.staleInputs)||((l=e.cellData[i])==null?void 0:l.edited)}),errored:n.some(i=>{var o;return(o=e.cellRuntime[i])==null?void 0:o.errored}),runningOrQueued:n.some(i=>{var o,l;return((o=e.cellRuntime[i])==null?void 0:o.status)==="running"||((l=e.cellRuntime[i])==null?void 0:l.status)==="queued"})}},B0=function(e){let{cellIds:t,cellData:n,cellRuntime:i}=e;return t.inOrderIds.filter(o=>ly({executionTime:i[o].runElapsedTimeMs??n[o].lastExecutionTime,status:i[o].status,errored:i[o].errored,interrupted:i[o].interrupted,stopped:i[o].stopped})||n[o].edited||i[o].interrupted||i[o].staleInputs&&!(i[o].status==="disabled-transitively"||n[o].config.disabled))},ly=function({executionTime:e,status:t,errored:n,interrupted:i,stopped:o}){return e===null&&t!=="queued"&&t!=="running"&&!(n||i||o)},kT=function({edited:e,interrupted:t,staleInputs:n,disabled:i,status:o}){return e||t||n&&!(i||o==="disabled-transitively")},vE=function({needsRun:e,errored:t,stopped:n,disabled:i,status:o}){return{"needs-run":e,"has-error":t,stopped:n,disabled:i??!1,stale:o==="disabled-transitively"}},SS=function({errored:e,stopped:t}){return{published:!0,"has-error":e,stopped:t}},VS=function({errored:e,interrupted:t,stopped:n,output:i,showErrorTracebacks:o}){let l=Sc(i==null?void 0:i.mimetype),u=o&&l&&Array.isArray(i==null?void 0:i.data)&&i.data.some(d=>d.type==="exception"&&"traceback"in d&&d.traceback);return(e||t||n||l)&&!u},Lt=Gs.define({combine:e=>e[0]}),aa=Gs.define({combine:e=>e[0]});var vD={...Og,caseInsensitiveIdentifiers:!0,identifierQuotes:"`"};const kb=nf.define(vD),bD=nf.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"}),Cb=nf.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 wD=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 lu(e){return wD.has(e)}function Sb(e){let t=e.dialect;if(!lu(t))return Se.debug("Unknown dialect",{dialect:t}),yl;switch(t){case"postgresql":case"postgres":return Og;case"mysql":return y6;case"sqlite":return h6;case"mssql":case"sqlserver":case"microsoft sql server":return b6;case"duckdb":return Cb;case"mariadb":return w6;case"cassandra":return x6;case"oracledb":case"oracle":return m6;case"bigquery":return kb;case"dremio":return bD;case"timescaledb":return Og;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 Se.debug("Unsupported dialect",{dialect:t}),yl;default:return Zs(t),yl}}var xD={...v6,caseInsensitiveIdentifiers:!0,identifierQuotes:"'"};let yl;yl=nf.define(xD),ia="__marimo_duckdb",Ho=new Set([ia]),BE="memory",ZE=function(e,t){var i;if(!e)return t;let n=((i=e.schemaPath)!=null&&i.length?e.schemaPath:[e.schema]).filter(Boolean);return[e.database,...n,t].join(".")},Mc=function(e){return e===""},J0=function(e){return e.schemas_resolved!==!1},ry=function(e){return e.tables_resolved!==!1},D0=function(e){return e.child_schemas_resolved!==!1},jf=function(e,t){let n=t==null?void 0:t.trim().toLowerCase();return n?ry(e)&&e.tables.some(i=>i.name.toLowerCase().includes(n))?!0:D0(e)?(e.child_schemas??[]).some(i=>jf(i,n)):!1:!1},SE=function(e,t){return!(t!=null&&t.trim())||!J0(e)?!1:e.schemas.some(n=>jf(n,t))};var vl={formatTablePath:e=>e.join("."),formatSelectClause:(e,t)=>`SELECT ${e} FROM ${t} LIMIT 100`};function _D(e){if(e=e.toLowerCase(),!lu(e))return vl;switch(e){case"bigquery":{let t=kb.spec.identifierQuotes;return{formatTablePath:n=>`${t}${n.join(".")}${t}`,formatSelectClause:vl.formatSelectClause}}case"mssql":case"sqlserver":case"microsoft sql server":return{formatTablePath:vl.formatTablePath,formatSelectClause:(t,n)=>`SELECT TOP 100 ${t} FROM ${n}`};case"timescaledb":case"postgres":case"postgresql":case"duckdb":case"dremio":return{formatTablePath:t=>t.map(n=>`"${n}"`).join("."),formatSelectClause:(t,n)=>`SELECT ${t==="*"?"*":`"${t}"`} FROM ${n} 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 vl;default:return Zs(e),vl}}LE=function({table:e,columnName:t,sqlTableContext:n}){if(n){let{engine:i,schema:o,defaultSchema:l,defaultDatabase:u,database:d,dialect:p}=n,g=[e.name];Mc(o)||o!==l&&g.unshift(o),d!==u&&g.unshift(d);let w=_D(p),x=w.formatTablePath(g),S=w.formatSelectClause(t,x);return i==="__marimo_duckdb"?`_df = mo.sql(f"""
|
|
64
|
+
`,n.textContent=t;let i=e.coordsAtPos(e.state.selection.main.head);i&&(n.style.left=`${i.left}px`,n.style.top=`${i.bottom+5}px`),document.body.appendChild(n),setTimeout(()=>{n.style.opacity="0",n.style.transition="opacity 0.2s",setTimeout(()=>n.remove(),200)},3e3)}function xp(e){return rb(e,new WeakSet)}function rb(e,t){if(e==null)return!0;if(Array.isArray(e))return t.has(e)?!0:(t.add(e),e.length===0||e.every(i=>rb(i,t)));if(typeof e=="string")return ib(e);let n=e.value;return typeof n=="string"?ib(n):!0}function ib(e){return e==null?!0:typeof e=="string"?e.trim()===""||/^[\s\n`]*$/.test(e):!1}function I3(e,t){let n=[];return t.iterChanges((i,o,l,u,d)=>{let p=d.toString();if(i===0&&o===e.length){n.push({text:p});return}let g=ur(e,i),w=ur(e,o);n.push({range:{start:g,end:w},text:p})}),n.sort((i,o)=>{if(!i.range)return 1;if(!o.range)return-1;let l=i.range.start.line??-1,u=o.range.start.line??-1;if(l!==u)return u-l;let d=i.range.start.character??-1;return(o.range.start.character??-1)-d}),n}var ab=bf(),A3=Object.fromEntries(Object.entries(ab.CompletionItemKind).map(([e,t])=>[t,e]));function L3(e){var t;return!!(e.deprecated||(t=e.tags)!=null&&t.includes(ab.CompletionItemTag.Deprecated))}function P3(e){return e.deprecated?"cm-deprecated":""}function O3(e){return"insert"in e}function M3(e,t){if(!t)return e;let n={...e};if(n.commitCharacters??(n.commitCharacters=t.commitCharacters),n.insertTextFormat??(n.insertTextFormat=t.insertTextFormat),n.insertTextMode??(n.insertTextMode=t.insertTextMode),n.data===void 0&&(n.data=t.data),n.textEdit==null&&t.editRange){let i=n.textEditText??n.insertText??n.label;n.textEdit=O3(t.editRange)?{newText:i,insert:t.editRange.insert,replace:t.editRange.replace}:{newText:i,range:t.editRange}}return n}function N3(e,t,n,i){let{textEdit:o,insertText:l,label:u}=t,d=n,p=i,g=l||u;if(o){let w=T3(o)?o.range:R3(o)?o.replace:void 0;if(w){g=o.newText;let x=Kt(e,w.start),S=Kt(e,w.end);x!=null&&S!=null&&x<=S&&(d=x,p=S)}}return{from:d,to:p,newText:g}}function ob(e,t,n,i){let o=[];for(let l of t){let u=Kt(e,l.range.start),d=Kt(e,l.range.end);u==null||d==null||u>d||d>n&&u<i||o.push({from:u,to:d,insert:l.newText})}return o}function j3(e,t,n){return i=>i<=e?i:i-(t-e)+n}function q3(e){let{view:t,originalDoc:n,mainFrom:i,mainTo:o,insertedLength:l,resolveItem:u}=e,d=t.state.doc,p=j3(i,o,l);u().then(g=>{let w=g==null?void 0:g.additionalTextEdits;if(!(w!=null&&w.length)||t.state.doc!==d)return;let x=ob(n,w,i,o).map(S=>({...S,from:p(S.from),to:p(S.to)}));x.length!==0&&t.dispatch({changes:x,userEvent:"input.complete"})}).catch(g=>{console.error("Failed to resolve completion item:",g)})}var _p;(function(e){e.PlainText=1,e.Snippet=2})(_p||(_p={}));var z3=/^\$\{(\d+)\|((?:\\.|[^\\}])*)\|\}/,F3=/^\$\{([A-Za-z_][A-Za-z0-9_]*)(?::([^}]*))?\}/,$3=/^\$[A-Za-z_][A-Za-z0-9_]*/,V3=/^(?:\\.|[^,])*/,H3=/^\{0(?=[:}])/;function sb(e,t){var o;let n="",i=0;for(;i<e.length;){let l=e[i];if(l==="\\"&&i+1<e.length){n+=e.slice(i,i+2),i+=2;continue}if(l==="$"){let u=e.slice(i),d=z3.exec(u);if(d){let w=((o=V3.exec(d[2]??""))==null?void 0:o[0])??"";n+=t(d[1]??"",w),i+=d[0].length;continue}let p=F3.exec(u);if(p){n+=p[2]??"",i+=p[0].length;continue}let g=$3.exec(u);if(g){i+=g[0].length;continue}}n+=l,i+=1}return n}function B3(e){let t=0;for(let n of e.matchAll(/\$\{?(\d+)/g))t=Math.max(t,Number(n[1]));return String(t+1)}function W3(e){let t=sb(e,(l,u)=>`\${${l}:${u}}`),n=B3(t),i="",o=0;for(;o<t.length;){let l=t[o];if(l==="\\"&&o+1<t.length){let u=t[o+1];u==="$"?t[o+2]==="{"?(i+="$\\{",o+=3):(i+="$",o+=2):u==="{"||u==="}"?(i+=`\\${u}`,o+=2):u==="\\"?(i+="\\",o+=2):(i+=u,o+=2)}else if(l==="$"){let u=t.slice(o+1),d=H3.exec(u),p=/^\d+/.exec(u);if(d)i+=`\${${n}`,o+=1+d[0].length;else if(p){let g=p[0]==="0"?n:p[0];i+=`\${${g}}`,o+=1+p[0].length}else i+=l,o+=1}else l==="#"&&t[o+1]==="{"?(i+="#\\{",o+=2):(i+=l,o+=1)}return i}function U3(e){let t=sb(e,(o,l)=>l),n="",i=0;for(;i<t.length;){let o=t[i];if(o==="\\"&&i+1<t.length)n+=t[i+1],i+=2;else if(o==="$"){let l=/^\{(\d+)(?::([^}]*))?\}/.exec(t.slice(i+1));if(l)n+=l[2]??"",i+=1+l[0].length;else{let u=/^\d+/.exec(t.slice(i+1));u?i+=1+u[0].length:(n+=o,i+=1)}}else n+=o,i+=1}return n}function K3(e,t){var j;let{detail:n,labelDetails:i,label:o,kind:l,documentation:u,additionalTextEdits:d,insertTextFormat:p,commitCharacters:g,filterText:w}=e,x=typeof o=="string"?o:"",S=null,E=()=>(S??(S=t.resolveItem(e)),S),T={label:x,detail:(i==null?void 0:i.detail)||n,apply(z,V,P,U){let me=z.state,{from:$,to:W,newText:ae}=N3(me.doc,e,P,U);($>U||W<U)&&($=P,W=U);let xe=ae,_e=ob(me.doc,d??[],$,W),Te=Q=>{d||!t.hasResolveProvider||q3({view:z,originalDoc:me.doc,mainFrom:$,mainTo:W,insertedLength:Q,resolveItem:E})};if(p===_p.Snippet&&t.useSnippetOnCompletion){let Q=$,Y=W;if(_e.length>0){let te=me.changes(_e);z.dispatch({changes:te}),Q=te.mapPos(Q,1),Y=te.mapPos(Y,1)}let ce=z.state.doc.length;d6(W3(xe))(z,null,Q,Y),Te(z.state.doc.length-ce+(Y-Q));return}if(p===_p.Snippet&&(xe=U3(xe)),_e.length===0){z.dispatch(c6(me,xe,$,W)),Te(xe.length);return}let Z=me.changes([{from:$,to:W,insert:xe},..._e]);z.dispatch({changes:Z,selection:{anchor:Z.mapPos($,-1)+xe.length},userEvent:"input.complete"})},type:l?(j=A3[l])==null?void 0:j.toLowerCase():void 0};w!=null&&w!==x&&(T.label=w,T.displayLabel=x),g!=null&&g.length&&(T.commitCharacters=g),L3(e)&&(T.deprecated=!0);let O=z=>{let V=document.createElement("div");return V.classList.add("documentation"),ml(V,z,{allowHTMLContent:t.allowHTMLContent,markdownRenderer:t.markdownRenderer}),V};return t.hasResolveProvider?T.info=async()=>{var z;try{let V=((z=await E())==null?void 0:z.documentation)||u;return!V||xp(V)?null:O(V)}catch(V){return console.error("Failed to resolve completion item:",V),!u||xp(u)?null:O(u)}}:u&&(T.info=()=>O(u)),T}function Q3(e,t,n,i=!0){let o=[t?G3(t):X3,n==="python"?J3:void 0].filter(Boolean),l=[...e];if(t&&i){let u=t.toLowerCase();/^\w+$/.test(u)&&(l=l.filter(({label:d,filterText:p})=>(typeof p=="string"?p:fa(d)).toLowerCase().startsWith(u)))}for(let u of o)l.sort(u);return l}function G3(e){return(t,n)=>{let i=lb(t).startsWith(e),o=lb(n).startsWith(e);if(i&&!o)return-1;if(!i&&o)return 1;let l=typeof t.sortText=="string"?t.sortText:fa(t.label),u=typeof n.sortText=="string"?n.sortText:fa(n.label);return l.localeCompare(u)}}function X3(e,t){let n=typeof e.sortText=="string"?e.sortText:fa(e.label),i=typeof t.sortText=="string"?t.sortText:fa(t.label);return n.localeCompare(i)}function J3(e,t){let n=fa(e.label).endsWith("="),i=fa(t.label).endsWith("=");return n&&!i?-1:!n&&i?1:0}function lb(e){return typeof e.filterText=="string"?e.filterText:fa(e.label)}function fa(e){return typeof e=="string"?e:""}function cb(e){let t=new Proxy({},{get(){throw Error(e)}});return function(n){return n[0]??t}}var ub=cb("No document URI provided. Pass one to the extension or use documentUri.of()."),db=cb("No language ID provided. Pass one to the extension or use languageId.of().");function Y3(e){if(e!==e.trim())return!1;try{return!!new URL(e).protocol}catch{return!1}}const fb=Gs.define({combine(e){if(e.length===0)return ub(e);let t=ub(e);if(!(t&&Y3(t)))throw Error("Document URI must be a non-empty absolute URI");return t}}),Z3=Gs.define({combine(e){if(e.length===0)return db(e);let t=db(e);if(!t.trim())throw Error("Language ID must be a non-empty string");return t}}),pa={ParseError:-32700,InvalidRequest:-32600,MethodNotFound:-32601,InvalidParams:-32602,InternalError:-32603,RequestTimeout:-32001};var no=class extends Error{constructor(t,n,i){super(n);pe(this,"code");pe(this,"data");this.name="RPCError",this.code=t,this.data=i}},eD=1e4;function pb(e){return e.id!=null}function kp(e){return e instanceof Error?e:new no(pa.InternalError,String(e))}let mb,hb,gb,yb,Cp,vb,nn,hl,bb;mb=class{constructor(e){pe(this,"transport");pe(this,"pending",new Map);pe(this,"disconnect");pe(this,"disconnectClose");pe(this,"connected");pe(this,"nextId",0);pe(this,"closed",!1);pe(this,"isConnected",!1);pe(this,"closeError");pe(this,"notificationHandler");pe(this,"requestHandler");var t;this.transport=e,this.disconnect=e.onMessage(n=>this.receive(n)),this.disconnectClose=(t=e.onClose)==null?void 0:t.call(e,n=>{this.closeError??(this.closeError=n);for(let i of[...this.pending.keys()])this.settle(i,o=>o.reject(n))}),this.connected=e.connect(),this.connected.then(()=>{this.isConnected=!0},()=>{}),this.connected.catch(()=>{})}onNotification(e){this.notificationHandler=e}onRequest(e){this.requestHandler=e}request(e,t,n=eD){if(this.closed)return Promise.reject(new no(pa.InternalError,"Client closed"));if(this.closeError)return Promise.reject(this.closeError);let i=this.nextId++;return new Promise((o,l)=>{let u=setTimeout(()=>{this.pending.delete(i),l(new no(pa.RequestTimeout,`Request "${e}" timed out after ${n}ms`))},n);this.pending.set(i,{resolve:o,reject:l,timer:u});let d=()=>{if(this.pending.has(i))try{this.transport.send({jsonrpc:"2.0",id:i,method:e,params:t})}catch(p){this.settle(i,g=>g.reject(kp(p)))}};if(this.isConnected){d();return}this.connected.then(d,p=>this.settle(i,g=>g.reject(kp(p))))})}notify(e,t){let n=this.dispatch({jsonrpc:"2.0",method:e,params:t});return n.catch(()=>{}),n}respond(e){return this.dispatch(e)}close(){var e;if(!this.closed){this.closed=!0;for(let t of this.pending.values())clearTimeout(t.timer),t.reject(new no(pa.InternalError,"Client closed"));this.pending.clear(),this.disconnect(),(e=this.disconnectClose)==null||e.call(this),this.transport.close()}}dispatch(e){if(this.closed)return Promise.resolve();if(this.isConnected)try{return this.transport.send(e),Promise.resolve()}catch(t){return Promise.reject(kp(t))}return this.connected.then(()=>{this.closed||this.transport.send(e)})}settle(e,t){let n=this.pending.get(e);n&&(clearTimeout(n.timer),this.pending.delete(e),t(n))}receive(e){var i,o;if(this.closed||typeof e!="object"||!e||Array.isArray(e)||e.jsonrpc!=="2.0")return;if(typeof e.method=="string"){pb(e)?(i=this.requestHandler)==null||i.call(this,e):(o=this.notificationHandler)==null||o.call(this,e);return}if(!pb(e))return;let t=e,n=t.id;if(typeof n=="string"&&!this.pending.has(n)&&/^\d+$/.test(n)){let l=Number(n);this.pending.has(l)&&(n=l)}this.settle(n,l=>{if("error"in t){let u=t.error;if(typeof u!="object"||!u||typeof u.code!="number"||typeof u.message!="string"){l.reject(new no(pa.InvalidRequest,"Malformed JSON-RPC error response",u));return}l.reject(new no(u.code,u.message,u.data))}else"result"in t?l.resolve(t.result):l.reject(new no(pa.InvalidRequest,"Malformed JSON-RPC response: missing result or error"))})}},hb=1e4,gb=2048,yb="Language server: ",Cp={"textDocument/hover":"hoverProvider","textDocument/completion":"completionProvider","textDocument/definition":"definitionProvider","textDocument/declaration":"declarationProvider","textDocument/typeDefinition":"typeDefinitionProvider","textDocument/implementation":"implementationProvider","textDocument/references":"referencesProvider","textDocument/documentHighlight":"documentHighlightProvider","textDocument/documentSymbol":"documentSymbolProvider","textDocument/codeAction":"codeActionProvider","textDocument/codeLens":"codeLensProvider","textDocument/documentLink":"documentLinkProvider","textDocument/formatting":"documentFormattingProvider","textDocument/rangeFormatting":"documentRangeFormattingProvider","textDocument/onTypeFormatting":"documentOnTypeFormattingProvider","textDocument/rename":"renameProvider","textDocument/prepareRename":"renameProvider","textDocument/signatureHelp":"signatureHelpProvider","textDocument/foldingRange":"foldingRangeProvider","textDocument/selectionRange":"selectionRangeProvider","workspace/symbol":"workspaceSymbolProvider","workspace/executeCommand":"executeCommandProvider"},nl=class{constructor({rootUri:e,workspaceFolders:t,transport:n,initializationOptions:i,capabilities:o,timeout:l=hb,getWorkspaceConfiguration:u}){pe(this,"ready");pe(this,"capabilities");pe(this,"advertisedCapabilities");pe(this,"initializePromise");pe(this,"rootUri");pe(this,"workspaceFolders");pe(this,"timeout");pe(this,"client");pe(this,"initializationOptions");pe(this,"clientCapabilities");pe(this,"notificationListeners",new Set);pe(this,"documentOpenCounts",new Map);pe(this,"serverRequestHandlers",new Map);pe(this,"dynamicCapabilities",new Map);pe(this,"isClosed",!1);if(!e)throw Error("rootUri must be a non-empty URI");this.rootUri=e,this.workspaceFolders=t,this.initializationOptions=i,this.clientCapabilities=o,this.timeout=l,this.ready=!1,this.capabilities=null,this.client=new mb(n),this.client.onNotification(d=>{this.processNotification(d)}),this.client.onRequest(d=>{this.handleServerRequest(d)}),this.onRequest("workspace/configuration",d=>u?u(d):((d==null?void 0:d.items)??[]).map(()=>null)),this.onRequest("client/registerCapability",d=>{let p=d==null?void 0:d.registrations;if(!Array.isArray(p))return null;for(let g of p)!g||typeof g.id!="string"||g.id.length===0||typeof g.method!="string"||this.dynamicCapabilities.has(g.id)||this.dynamicCapabilities.set(g.id,g);return null}),this.onRequest("client/unregisterCapability",d=>{let p=d==null?void 0:d.unregisterations;if(!Array.isArray(p))return null;for(let g of p)this.dynamicCapabilities.delete(g.id);return null}),this.onRequest("workspace/applyEdit",()=>({applied:!1,failureReason:"workspace/applyEdit is not supported"})),this.onRequest("window/showMessageRequest",d=>{if(d!=null&&d.message){let p=String(d.message).replace(/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]/g,"").slice(0,gb-17);console.info(`${yb}${p}`)}return null}),this.onRequest("window/workDoneProgress/create",()=>null),this.initializePromise=this.initialize(),this.initializePromise.catch(d=>{console.error("Language server initialization failed",d)})}getInitializationOptions(){let e={textDocument:{hover:{dynamicRegistration:!0,contentFormat:["markdown","plaintext"]},moniker:{},synchronization:{dynamicRegistration:!1,willSave:!0,didSave:!0,willSaveWaitUntil:!0},codeAction:{dynamicRegistration:!0,codeActionLiteralSupport:{codeActionKind:{valueSet:["","quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}},resolveSupport:{properties:["edit"]}},completion:{dynamicRegistration:!1,completionItem:{snippetSupport:!0,commitCharactersSupport:!0,documentationFormat:["markdown","plaintext"],deprecatedSupport:!0,preselectSupport:!1,insertReplaceSupport:!0,tagSupport:{valueSet:[1]},resolveSupport:{properties:["documentation","detail","additionalTextEdits"]}},completionList:{itemDefaults:["commitCharacters","editRange","insertTextFormat","insertTextMode","data"]},contextSupport:!1},signatureHelp:{dynamicRegistration:!1,signatureInformation:{documentationFormat:["markdown","plaintext"]}},declaration:{dynamicRegistration:!1,linkSupport:!0},definition:{dynamicRegistration:!0,linkSupport:!0},typeDefinition:{dynamicRegistration:!1,linkSupport:!0},implementation:{dynamicRegistration:!1,linkSupport:!0},rename:{dynamicRegistration:!0,prepareSupport:!0},publishDiagnostics:{relatedInformation:!0,tagSupport:{valueSet:[1,2]},versionSupport:!0,codeDescriptionSupport:!0,dataSupport:!0}},workspace:{didChangeConfiguration:{dynamicRegistration:!1}}};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 e=this.getInitializationOptions();this.advertisedCapabilities=e==null?void 0:e.capabilities;let t=await this.request("initialize",e,this.timeout*3);if(!t||typeof t!="object"||!("capabilities"in t)||typeof t.capabilities!="object"||t.capabilities===null)throw Error("Invalid initialize response: missing server capabilities");this.isClosed||(this.capabilities=t.capabilities,this.notify("initialized",{}),this.ready=!0)}close(){if(!this.isClosed){if(this.isClosed=!0,this.ready=!1,this.notificationListeners.clear(),this.serverRequestHandlers.clear(),this.dynamicCapabilities.clear(),this.documentOpenCounts.clear(),this.capabilities){this.client.request("shutdown",null,this.timeout).catch(()=>{}).then(()=>{this.client.notify("exit",void 0).catch(()=>{}),this.client.close()});return}this.client.close()}}onRequest(e,t){return this.serverRequestHandlers.set(e,t),()=>{this.serverRequestHandlers.get(e)===t&&this.serverRequestHandlers.delete(e)}}mayRegisterDynamically(e){var i,o,l;let[t,n]=e.split("/");return t!=="textDocument"||!n?!1:((l=(o=(i=this.advertisedCapabilities)==null?void 0:i.textDocument)==null?void 0:o[n])==null?void 0:l.dynamicRegistration)===!0}hasCapability(e){var n;for(let i of this.dynamicCapabilities.values())if(i.method===e)return!0;let t=Cp[e];return t?!!((n=this.capabilities)!=null&&n[t]):!1}async handleServerRequest(e){let t=this.serverRequestHandlers.get(e.method),n;if(!t)n={jsonrpc:"2.0",id:e.id,error:{code:pa.MethodNotFound,message:`Method not found: ${e.method}`}};else try{let i=await t(e.params);n={jsonrpc:"2.0",id:e.id,result:i===void 0?null:i}}catch(i){n={jsonrpc:"2.0",id:e.id,error:{code:pa.InternalError,message:i instanceof Error?i.message:String(i)}}}this.isClosed||this.client.respond(n).catch(()=>{})}textDocumentDidOpen(e){let t=e.textDocument.uri,n=this.documentOpenCounts.get(t)??0;return this.documentOpenCounts.set(t,n+1),n>0?Promise.resolve(!1):this.notify("textDocument/didOpen",e).then(()=>!0)}textDocumentDidChange(e){return this.notify("textDocument/didChange",e)}textDocumentDidClose(e){let t=e.textDocument.uri,n=this.documentOpenCounts.get(t)??0;return n>1?(this.documentOpenCounts.set(t,n-1),Promise.resolve(void 0)):(this.documentOpenCounts.delete(t),this.notify("textDocument/didClose",e))}textDocumentWillSave(e){return this.notify("textDocument/willSave",e)}async textDocumentWillSaveWaitUntil(e){return await this.request("textDocument/willSaveWaitUntil",e,this.timeout)}textDocumentDidSave(e){return this.notify("textDocument/didSave",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 codeActionResolve(e){return await this.request("codeAction/resolve",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,n){if(e==="initialize")return this.client.request(e,t,n);let i=this.hasCapability(e),o=!(this.ready||this.capabilities)&&this.mayRegisterDynamically(e);return this.initializePromise.then(()=>{if(this.isClosed)throw Error("Language server client is closed");if(Cp[e]&&!o&&!(i||this.hasCapability(e)))throw Error(`Language server does not support method ${e}`);return this.client.request(e,t,n)})}notify(e,t){return this.client.notify(e,t)}processNotification(e){for(let t of this.notificationListeners)try{Promise.resolve(t(e)).catch(n=>{console.error("Notification listener failed",n)})}catch(n){console.error("Notification listener failed",n)}}},vb=(uo=class{constructor(t,n){pe(this,"url");pe(this,"protocols");pe(this,"socket");pe(this,"opened",!1);pe(this,"closed",!1);pe(this,"rejectConnect");pe(this,"handlers",new Set);pe(this,"closeHandlers",new Set);pe(this,"outbox",[]);this.url=t,this.protocols=n}connect(){var t,n;return/^wss?:\/\//i.test(this.url)?(this.url.toLowerCase().startsWith("ws://")&&typeof location<"u"&&location.protocol==="https:"&&console.warn(`Insecure WebSocket ${this.url} may be blocked from an HTTPS page`),(t=this.rejectConnect)==null||t.call(this,Error(`WebSocket connection to ${this.url} was replaced`)),this.rejectConnect=void 0,(n=this.socket)==null||n.close(),this.opened=!1,this.closed=!1,new Promise((i,o)=>{let l=new WebSocket(this.url,this.protocols);this.socket=l,this.rejectConnect=o,l.addEventListener("open",()=>{if(this.socket===l){this.opened=!0,this.rejectConnect=void 0;for(let u of this.outbox)l.send(u);this.outbox=[],i()}}),l.addEventListener("message",u=>{this.socket===l&&this.receiveFrame(u.data,l)}),l.addEventListener("error",()=>{if(this.socket!==l)return;let u=Error(`WebSocket connection to ${this.url} failed`);this.opened?this.emitClose(u):o(u)}),l.addEventListener("close",()=>{this.socket===l&&(this.opened?this.closed||this.emitClose(Error(`WebSocket connection to ${this.url} closed`)):o(Error(`WebSocket to ${this.url} closed before opening`)))})})):Promise.reject(Error(`Invalid WebSocket URL: ${this.url||"(empty)"}`))}send(t){if(this.closed)return;let n=JSON.stringify(t);this.socket&&this.socket.readyState===WebSocket.OPEN?this.socket.send(n):this.outbox.length<uo.OUTBOX_LIMIT&&this.outbox.push(n)}onMessage(t){return this.handlers.add(t),()=>{this.handlers.delete(t)}}onClose(t){return this.closeHandlers.add(t),()=>{this.closeHandlers.delete(t)}}close(){var t,n;(t=this.rejectConnect)==null||t.call(this,Error(`WebSocket to ${this.url} closed`)),this.rejectConnect=void 0,this.closed=!0,this.opened=!1,this.handlers.clear(),this.closeHandlers.clear(),this.outbox=[],(n=this.socket)==null||n.close(),this.socket=void 0}receiveFrame(t,n){if(t instanceof ArrayBuffer||Object.prototype.toString.call(t)==="[object ArrayBuffer]"){this.dispatchFrame(new TextDecoder().decode(t));return}if(typeof Blob<"u"&&t instanceof Blob){t.text().then(i=>{this.socket===n&&this.dispatchFrame(i)});return}this.dispatchFrame(String(t))}dispatchFrame(t){if(this.closed)return;let n;try{n=JSON.parse(t)}catch{return}if(typeof n!="object"||!n||Array.isArray(n))return;let i=n;for(let o of this.handlers)try{o(i)}catch(l){console.error("WebSocket message handler failed",l)}}emitClose(t){this.opened=!1,this.closed=!0;for(let n of this.closeHandlers)try{n(t)}catch(i){console.error("WebSocket close handler failed",i)}}},pe(uo,"OUTBOX_LIMIT",1e3),uo),nn=bf(),hl=console.log,bb=2**31-1;function tD(){return String(Date.now()+Math.random())}function gl(e){return e!=null&&typeof e.command=="string"}function ma(e,t){return e.line===t.line?e.character-t.character:e.line-t.line}function nD(e,t){let n=ma(e.start,e.end)===0,i=ma(t.start,t.end)===0;return n||i?ma(e.start,t.end)<=0&&ma(t.start,e.end)<=0:ma(e.start,t.end)<0&&ma(t.start,e.end)<0}function rD(e,t){if(gl(e))return!0;let n=e.diagnostics;return!n||n.length===0?!0:n.some(i=>nD(i.range,t.range))}function iD(e){let t;try{t=new URL(e)}catch{return!1}return t.protocol==="http:"||t.protocol==="https:"||t.protocol==="mailto:"}var Sp=sr.define();let ou,Ep;ou=li.define({create:()=>new Map,update(e,t){let n=e;for(let i of t.effects)if(i.is(Sp)){n===e&&(n=new Map(e));for(let o of[...n.keys()])o.startsWith(`${i.value.pluginId}:`)&&n.delete(o);for(let[o,l]of i.value.anchors)n.set(o,l)}if(t.docChanged&&n.size>0){n===e&&(n=new Map(e));for(let[i,o]of n)n.set(i,{from:t.changes.mapPos(o.from,1),to:t.changes.mapPos(o.to,o.from===o.to?1:-1)})}return n}}),Ic=sr.define(),Vc=li.define({create:()=>null,update(e,t){for(let n of t.effects)if(n.is(Ic))return n.value;if(e&&t.docChanged){let n=t.changes.mapPos(e.pos),i=e.end==null?void 0:t.changes.mapPos(e.end);return{...e,pos:n,end:i}}return e},provide:e=>QC.from(e)}),Ep=GC.define();var aD=20,su=new WeakMap;function oD(e,t){let n=su.get(e);n?n.push(t):su.set(e,[t])}function sD(e,t){let n=su.get(e);if(!n)return;let i=n.indexOf(t);i!==-1&&n.splice(i,1),n.length===0&&su.delete(e)}var lD=class{constructor(e){pe(this,"documentVersion");pe(this,"pluginId");pe(this,"pendingDocumentChanges",new Set);pe(this,"client");pe(this,"documentUri");pe(this,"languageId");pe(this,"view");pe(this,"allowHTMLContent");pe(this,"useSnippetOnCompletion");pe(this,"clientSideFiltering");pe(this,"sendIncrementalChanges");pe(this,"featureOptions");pe(this,"onGoToDefinition");pe(this,"onShowLocation");pe(this,"markdownRenderer");pe(this,"codeActionsConfig");pe(this,"disposeListener");pe(this,"destroyed",!1);pe(this,"documentOpened",!1);pe(this,"documentTextSnapshotted",!1);pe(this,"documentOpenCarriedText",!0);pe(this,"documentReady");pe(this,"signatureHelpRequestId",0);pe(this,"closeCodeActionMenu");pe(this,"closeRenamePopup");pe(this,"lastSeenDiagnosticsVersion",null);let{client:t,documentUri:n,languageId:i,view:o,featureOptions:l,sendIncrementalChanges:u=!0,allowHTMLContent:d=!1,useSnippetOnCompletion:p=!1,clientSideFiltering:g=!1,onGoToDefinition:w,onShowLocation:x,markdownRenderer:S=X1,codeActionsConfig:E}=e;this.documentVersion=0,this.pluginId=tD(),this.client=t,this.documentUri=n,this.languageId=i,this.view=o,this.allowHTMLContent=d,this.useSnippetOnCompletion=p,this.clientSideFiltering=g,this.sendIncrementalChanges=u,this.featureOptions=l,this.onGoToDefinition=w,this.onShowLocation=x,this.markdownRenderer=S,this.codeActionsConfig=E,oD(o,this),this.disposeListener=t.onNotification(this.processNotification.bind(this)),this.documentReady=this.initialize().catch(T=>{console.error("Language server initialization failed",T)})}update({state:e,docChanged:t,startState:{doc:n},changes:i}){if(!t)return;let o=this.resolveTextDocumentSyncKind();o!==nn.TextDocumentSyncKind.None&&(this.sendIncrementalChanges&&o===nn.TextDocumentSyncKind.Incremental?this.trackDocumentChanges(I3(n,i)):this.trackDocumentChanges([{text:e.doc.toString()}]))}trackDocumentChanges(e){let t=this.sendChanges(e);this.pendingDocumentChanges.add(t),t.finally(()=>this.pendingDocumentChanges.delete(t))}destroy(){var e,t,n;this.destroyed=!0,(e=this.disposeListener)==null||e.call(this),this.disposeListener=void 0,(t=this.closeCodeActionMenu)==null||t.call(this),(n=this.closeRenamePopup)==null||n.call(this),this.view.state.field(ou,!1)&&this.view.dispatch({effects:Sp.of({pluginId:this.pluginId,anchors:new Map})}),sD(this.view,this),this.closeDocument()}closeDocument(){this.documentOpened&&this.client.ready&&(this.documentOpened=!1,Promise.resolve(this.client.textDocumentDidClose({textDocument:{uri:this.documentUri}})).catch(e=>{console.error("Failed to send didClose",e)}))}async initialize({documentText:e}={}){if(this.client.initializePromise&&await this.client.initializePromise,this.destroyed)return;let t=e??this.view.state.doc.toString();this.documentTextSnapshotted=!0,this.documentOpenCarriedText=await this.client.textDocumentDidOpen({textDocument:{uri:this.documentUri,languageId:this.languageId,text:t,version:this.documentVersion}})!==!1,this.documentOpened=!0,this.destroyed&&this.closeDocument()}resolveTextDocumentSyncKind(){var t;let e=(t=this.client.capabilities)==null?void 0:t.textDocumentSync;return e==null?this.sendIncrementalChanges?nn.TextDocumentSyncKind.Incremental:nn.TextDocumentSyncKind.Full:typeof e=="number"?e:e.change??nn.TextDocumentSyncKind.None}async sendChanges(e){let t=this.documentTextSnapshotted;if(!(!this.documentOpened&&(await this.documentReady,!t&&this.documentOpenCarriedText))&&this.client.ready)try{await this.client.textDocumentDidChange({textDocument:{uri:this.documentUri,version:++this.documentVersion},contentChanges:e})}catch(n){console.error(n)}}async documentDidSave(e=nn.TextDocumentSaveReason.Manual){var l;if(!this.client.ready||(await Promise.all(this.pendingDocumentChanges),this.destroyed||!this.client.ready))return;let t=(l=this.client.capabilities)==null?void 0:l.textDocumentSync,n=typeof t=="object"&&t?t:void 0;if(n!=null&&n.willSave){try{await this.client.textDocumentWillSave({textDocument:{uri:this.documentUri},reason:e})}catch(u){console.error("Failed to send willSave",u)}if(this.destroyed||!this.client.ready)return}if(n!=null&&n.willSaveWaitUntil){try{let u=await this.client.textDocumentWillSaveWaitUntil({textDocument:{uri:this.documentUri},reason:e});u&&u.length>0&&!this.destroyed&&(this.applyEdits(this.view,u),await Promise.all(this.pendingDocumentChanges))}catch(u){console.error("Failed during willSaveWaitUntil",u)}if(this.destroyed||!this.client.ready)return}let i=n==null?void 0:n.save;if(i==null||i===!1)return;let o=typeof i=="object"&&i.includeText;try{await this.client.textDocumentDidSave({textDocument:{uri:this.documentUri},text:o?this.view.state.doc.toString():void 0})}catch(u){console.error("Failed to send didSave",u)}}requestDiagnostics(e){this.sendChanges([{text:e.state.doc.toString()}])}async requestHoverTooltip(e,{line:t,character:n}){if(!this.featureOptions.hoverEnabled||!(this.client.ready&&this.client.hasCapability("textDocument/hover")))return null;let i;try{i=await this.client.textDocumentHover({textDocument:{uri:this.documentUri},position:{line:t,character:n}})}catch{return null}if(!i)return null;let{contents:o,range:l}=i,u=Kt(e.state.doc,{line:t,character:n}),d;if(l&&(u=Kt(e.state.doc,l.start),d=Kt(e.state.doc,l.end)),u==null||xp(o))return null;let p=document.createElement("div");return p.classList.add("documentation","cm-lsp-hover-tooltip"),ml(p,o,{allowHTMLContent:this.allowHTMLContent,markdownRenderer:this.markdownRenderer}),{pos:u,end:d,create:g=>({dom:p}),above:!0}}async requestCompletion(e,{line:t,character:n},{triggerKind:i,triggerCharacter:o}){if(!this.featureOptions.completionEnabled||(await Promise.all(this.pendingDocumentChanges),!(this.client.ready&&this.client.hasCapability("textDocument/completion"))))return null;let l;try{l=await this.client.textDocumentCompletion({textDocument:{uri:this.documentUri},position:{line:t,character:n},context:{triggerKind:i,triggerCharacter:o}})}catch{return null}if(!l)return null;let u=D3(l)?l:{isIncomplete:!1,items:l};if(!Array.isArray(u.items))return null;let d=u.items.map(T=>M3(T,u.itemDefaults)),p=this.clientSideFiltering&&!u.isIncomplete,g=E3(d),w=g?e.matchBefore(g)??e.matchBefore(/[a-zA-Z0-9_]+/):e.matchBefore(/[a-zA-Z0-9_]+/),{pos:x}=e,S=Q3(d,w==null?void 0:w.text,this.languageId,!p);w&&(x=w.from);let E=S.map(T=>{var O,j;return K3(T,{allowHTMLContent:this.allowHTMLContent,useSnippetOnCompletion:this.useSnippetOnCompletion,hasResolveProvider:((j=(O=this.client.capabilities)==null?void 0:O.completionProvider)==null?void 0:j.resolveProvider)??!1,resolveItem:this.client.completionItemResolve.bind(this.client)})});return p?{from:x,options:E,validFor:/^\w*$/}:{from:x,options:E,filter:!1}}async requestDefinition(e,{line:t,character:n}){if(!this.featureOptions.definitionEnabled||!(this.client.ready&&this.client.hasCapability("textDocument/definition")))return;let i;try{i=await this.client.textDocumentDefinition({textDocument:{uri:this.documentUri},position:{line:t,character:n}})}catch{return}if(!i||this.destroyed)return;let o=Array.isArray(i)?i:[i];if(o.length===0)return;let l=o[0];if(!l||typeof l!="object")return;let u="uri"in l&&typeof l.uri=="string"?l.uri:"targetUri"in l&&typeof l.targetUri=="string"?l.targetUri:void 0,d="range"in l?l.range:"targetRange"in l?l.targetRange:void 0;if(!(u&&(d!=null&&d.start)&&d.end))return;let p=u!==this.documentUri,g={uri:u,range:d,isExternalDocument:p};if(!p){let w=Kt(e.state.doc,d.start),x=Kt(e.state.doc,d.end);if(w==null||x==null||w>x)return;e.dispatch(e.state.update({selection:{anchor:w,head:x}}))}return this.onGoToDefinition&&this.onGoToDefinition(g),g}processNotification(e){try{e.method==="textDocument/publishDiagnostics"&&e.params&&this.processDiagnostics(e.params).catch(t=>hl(t))}catch(t){hl(t)}}async processDiagnostics(e){if(!e||e.uri!==this.documentUri||!Array.isArray(e.diagnostics))return;if(e.version!=null){if(typeof e.version!="number"||!Number.isInteger(e.version)||e.version<0||e.version>bb||this.lastSeenDiagnosticsVersion!=null&&e.version<this.lastSeenDiagnosticsVersion)return;this.lastSeenDiagnosticsVersion=e.version}else if(this.lastSeenDiagnosticsVersion!=null)return;if(!this.featureOptions.diagnosticsEnabled){this.clearDiagnostics();return}let t={[nn.DiagnosticSeverity.Error]:"error",[nn.DiagnosticSeverity.Warning]:"warning",[nn.DiagnosticSeverity.Information]:"info",[nn.DiagnosticSeverity.Hint]:"hint"},n=this.view.state.doc,i=e.diagnostics.filter(d=>{if(!d||typeof d!="object"||!d.range||typeof d.message!="string"&&(typeof d.message!="object"||d.message===null||typeof d.message.value!="string"))return!1;let p=Kt(n,d.range.start),g=Kt(n,d.range.end);return p!=null&&g!=null&&p<=g});if(e.diagnostics.length>0&&i.length===0)return;let o=[];try{o=await this.requestCodeActionsForDiagnostics(i)??[]}catch(d){console.error("Failed to fetch code actions",d)}if(this.destroyed||e.version!=null&&this.lastSeenDiagnosticsVersion!=null&&e.version<this.lastSeenDiagnosticsVersion||this.view.state.doc!==n)return;let l=new Map,u=i.map((d,p)=>{var me;let{range:g,message:w,severity:x,code:S,source:E,tags:T}=d,O=Kt(n,g.start),j=Kt(n,g.end);if(O==null||j==null||O>j)return null;(me=d.relatedInformation)==null||me.forEach(($,W)=>{if($.location.uri!==this.documentUri)return;let ae=Kt(n,$.location.range.start),xe=Kt(n,$.location.range.end);ae==null||xe==null||l.set(`${this.pluginId}:${p}:${W}`,{from:ae,to:xe})});let z=o.filter($=>rD($,d)).map($=>{var W;return{name:"command"in $&&typeof $.command=="object"&&((W=$.command)==null?void 0:W.title)||$.title,apply:()=>{this.applyCodeAction($)}}}),V=E||this.languageId,P=S!=null&&S!==""?`${V}(${S})`:V,U=[this.pluginId];return T!=null&&T.includes(nn.DiagnosticTag.Unnecessary)&&U.push("cm-lsp-unnecessary"),T!=null&&T.includes(nn.DiagnosticTag.Deprecated)&&U.push("cm-lsp-deprecated"),{from:O,to:j,severity:t[x??nn.DiagnosticSeverity.Error]??"error",message:tb(w),renderMessage:$=>this.renderDiagnosticMessage($,d,p),source:P,markClass:U.join(" "),actions:z.length>0?z:void 0,lspDiagnostic:d}});this.setOwnDiagnostics(u.filter(d=>d!=null),l)}setOwnDiagnostics(e,t=new Map){let n=this.view.state,i=[];aS(n,(d,p,g)=>{this.ownsDiagnostic(d)||i.push({...d,from:p,to:g})});let o=X5(n,[...i,...e]),l=o.effects,u=Array.isArray(l)?[...l]:l?[l]:[];u.push(Sp.of({pluginId:this.pluginId,anchors:t})),this.view.dispatch({...o,effects:u})}ownsDiagnostic(e){var t;return((t=e.markClass)==null?void 0:t.split(" ").includes(this.pluginId))??!1}renderDiagnosticMessage(e,t,n){let{message:i,code:o,source:l,codeDescription:u,relatedInformation:d}=t,p=document.createElement("div");p.classList.add("cm-lsp-diagnostic-message");let g=document.createElement("div");if(ml(g,{kind:"markdown",value:tb(i)},{allowHTMLContent:this.allowHTMLContent,markdownRenderer:this.markdownRenderer}),p.appendChild(g),(u==null?void 0:u.href)&&iD(u.href)){let w=l||this.languageId,x=o!=null&&o!==""?`${w}(${o})`:w,S=document.createElement("a");S.className="cm-diagnostic-code-link",S.href=u.href,S.target="_blank",S.rel="noopener noreferrer",S.textContent=x,p.appendChild(S)}if(d&&d.length>0){let w=document.createElement("div");w.className="cm-diagnostic-related",d.forEach((x,S)=>{w.appendChild(this.renderRelatedInformation(e,x,`${this.pluginId}:${n}:${S}`))}),p.appendChild(w)}return p}renderRelatedInformation(e,t,n){let{location:i,message:o}=t,{uri:l,range:u}=i,d=l!==this.documentUri,p=()=>{var j;if(d)return null;let T=(j=e.state.field(ou,!1))==null?void 0:j.get(n);if(T)return T;let O=Kt(e.state.doc,u.start);return O==null?null:{from:O,to:Kt(e.state.doc,u.end)??O}},g=document.createElement("div");g.className="cm-diagnostic-related-item";let w=document.createElement("span");w.className="cm-diagnostic-related-message",w.textContent=o,g.appendChild(w);let x=p(),S=x&&!d?ur(e.state.doc,x.from):u.start,E=document.createElement("span");if(E.className="cm-diagnostic-related-location",E.textContent=` ${l}:${S.line+1}:${S.character+1}`,g.appendChild(E),!d||this.onShowLocation){g.classList.add("cm-diagnostic-related-clickable"),g.setAttribute("role","button"),g.tabIndex=0;let T=()=>{var j;if(d){(j=this.onShowLocation)==null||j.call(this,{uri:l,range:u,isExternalDocument:d});return}let O=p();O!=null&&e.dispatch({selection:{anchor:O.from,head:O.to},scrollIntoView:!0})};g.addEventListener("click",T),g.addEventListener("keydown",O=>{(O.key==="Enter"||O.key===" ")&&(O.preventDefault(),T())})}return g}clearDiagnostics(){this.setOwnDiagnostics([])}async requestCodeActionsForDiagnostics(e){let t=e[0];if(!t||!this.featureOptions.codeActionsEnabled||!(this.client.ready&&this.client.hasCapability("textDocument/codeAction")))return null;let n=t.range.start,i=t.range.end;for(let o of e)ma(o.range.start,n)<0&&(n=o.range.start),ma(o.range.end,i)>0&&(i=o.range.end);return await this.client.textDocumentCodeAction({textDocument:{uri:this.documentUri},range:{start:n,end:i},context:{diagnostics:e}})}async requestCodeActions(e,t,n){return!this.featureOptions.codeActionsEnabled||!(this.client.ready&&this.client.hasCapability("textDocument/codeAction"))?null:await this.client.textDocumentCodeAction({textDocument:{uri:this.documentUri},range:t,context:{diagnostics:this.diagnosticsInRange(e,t),...n?{only:n}:{}}})}async requestCodeActionsAtSelection(e){let{from:t,to:n}=e.state.selection.main;return await this.requestCodeActions(e,{start:ur(e.state.doc,t),end:ur(e.state.doc,n)})}diagnosticsInRange(e,t){let n=e.state.doc,i=Kt(n,t.start),o=Kt(n,t.end);if(i==null||o==null)return[];let l={error:nn.DiagnosticSeverity.Error,warning:nn.DiagnosticSeverity.Warning,info:nn.DiagnosticSeverity.Information,hint:nn.DiagnosticSeverity.Hint},u=[];return aS(e.state,(d,p,g)=>{if(p>o||g<i)return;let w={start:ur(n,p),end:ur(n,g)},x=d.lspDiagnostic;x?u.push({...x,range:w}):u.push({range:w,message:d.message,severity:l[d.severity],source:d.source})}),u}async applyCodeAction(e){let t=await this.resolveCodeAction(e);if(!this.destroyed){if(gl(t)){hl("Executing command:",t);return}t.edit&&await this.applyWorkspaceEdit(this.view,t.edit),t.command?hl("Executing command:",t.command):t.edit||Jt(this.view,`Code action "${e.title}" has nothing to apply`)}}async resolveCodeAction(e){if(gl(e)||e.edit||e.command||!this.serverSupportsCodeActionResolve())return e;try{return await this.client.codeActionResolve(e)??e}catch(t){return console.error("Failed to resolve code action",t),e}}serverSupportsCodeActionResolve(){var t,n;let e=(t=this.client.capabilities)==null?void 0:t.codeActionProvider;if(typeof e=="object"&&e.resolveProvider)return!0;for(let i of this.client.dynamicCapabilities.values())if(i.method==="textDocument/codeAction"&&((n=i.registerOptions)!=null&&n.resolveProvider))return!0;return!1}async showCodeActionsMenu(e){var o;let t=e.state,n=await this.requestCodeActionsAtSelection(e);if(this.destroyed||e.state.doc!==t.doc||!e.state.selection.main.eq(t.selection.main))return!1;if(!n||n.length===0)return Jt(e,"No code actions available"),!1;let i=async l=>{await this.applyCodeAction(l)};return(o=this.codeActionsConfig)!=null&&o.renderMenu?(this.codeActionsConfig.renderMenu(n,i),!0):(this.showDefaultCodeActionsMenu(e,n,i),!0)}showDefaultCodeActionsMenu(e,t,n){var x;(x=this.closeCodeActionMenu)==null||x.call(this);let i=document.createElement("div");i.className="cm-code-action-menu",i.setAttribute("role","listbox"),i.style.cssText="position: absolute; display: flex; flex-direction: column; padding: 2px; background: white; border: 1px solid #ddd; box-shadow: 0 2px 8px rgba(0,0,0,.15); z-index: 99;";let o=S=>{i.contains(S.target)||l()},l=()=>{this.closeCodeActionMenu===l&&(this.closeCodeActionMenu=void 0),i.remove(),document.removeEventListener("mousedown",o)};this.closeCodeActionMenu=l;let u=t.map(S=>{let E=document.createElement("button");E.type="button",E.className="cm-code-action-item",E.style.cssText="display: flex; gap: 8px; align-items: baseline; padding: 4px 8px; border: none; background: none; text-align: left; cursor: pointer; font: inherit;";let T=document.createElement("span");if(T.textContent=S.title,E.appendChild(T),!gl(S)&&S.kind){let O=document.createElement("span");O.className="cm-code-action-kind",O.style.cssText="color: #888; font-size: 85%; margin-left: auto;",O.textContent=S.kind,E.appendChild(O)}return!gl(S)&&S.disabled&&(E.disabled=!0,E.title=S.disabled.reason,E.style.opacity="0.5",E.style.cursor="default"),E.addEventListener("click",()=>{l(),e.focus(),n(S)}),i.appendChild(E),E}),d=u.findIndex(S=>!S.disabled),p=S=>{var E;d=S,(E=u[S])==null||E.focus()},g=S=>{var E;for(let T=d+S;T>=0&&T<u.length;T+=S)if(!((E=u[T])!=null&&E.disabled)){p(T);return}};i.tabIndex=-1,i.addEventListener("keydown",S=>{if(S.key==="Escape")l(),e.focus();else if(S.key==="ArrowDown")g(1);else if(S.key==="ArrowUp")g(-1);else if(S.key==="Enter"){let E=u[d];E&&!E.disabled&&E.click()}else return;S.preventDefault(),S.stopPropagation()});let w=e.coordsAtPos(e.state.selection.main.from);w&&(i.style.left=`${w.left+window.scrollX}px`,i.style.top=`${w.bottom+window.scrollY+5}px`),document.addEventListener("mousedown",o),document.body.appendChild(i),d===-1?i.focus():p(d)}async requestRename(e,{line:t,character:n}){var i;if(this.featureOptions.renameEnabled){if(!this.client.ready){Jt(e,"Language server not ready");return}if(!this.client.hasCapability("textDocument/rename")){Jt(e,"Rename not supported by language server");return}try{let o=await this.client.textDocumentPrepareRename({textDocument:{uri:this.documentUri},position:{line:t,character:n}}).catch(()=>this.prepareRenameFallback(e,{line:t,character:n}));if(!o){Jt(e,"Cannot rename this symbol");return}let l;if("defaultBehavior"in o){if(!o.defaultBehavior){Jt(e,"Cannot rename this symbol");return}let j=this.prepareRenameFallback(e,{line:t,character:n});if(!j){Jt(e,"Cannot rename this symbol");return}l=j}else l=o;let u=document.createElement("div");u.className="cm-rename-popup",u.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 d=document.createElement("input");d.type="text",d.style.cssText="width: 200px; padding: 4px; border: 1px solid #ddd;";let p="range"in l?l.range:l,g=Kt(e.state.doc,p.start);if(g==null)return;let w=Kt(e.state.doc,p.end);d.value="placeholder"in l?l.placeholder:w==null?"":e.state.doc.sliceString(g,w);let x=d.value;u.appendChild(d);let S=e.coordsAtPos(g);if(!S)return;u.style.left=`${S.left}px`,u.style.top=`${S.bottom+5}px`;let E=j=>{u.contains(j.target)||T()},T=()=>{u.remove(),document.removeEventListener("mousedown",E),this.closeRenamePopup===T&&(this.closeRenamePopup=void 0)},O=async()=>{let j=d.value.trim();if(!j){Jt(e,"New name cannot be empty"),T();return}if(/[\r\n]/.test(j)){Jt(e,"New name must be a single line"),T();return}if(j===x){T();return}try{let z=e.state.doc,V=await this.client.textDocumentRename({textDocument:{uri:this.documentUri},position:{line:t,character:n},newName:j});if(this.destroyed||e.state.doc!==z)return;await this.applyRenameEdit(e,V)}catch(z){Jt(e,`Rename failed: ${z instanceof Error?z.message:"Unknown error"}`)}finally{T()}};d.addEventListener("keydown",j=>{j.key==="Enter"?O():j.key==="Escape"&&T(),j.stopPropagation()}),(i=this.closeRenamePopup)==null||i.call(this),this.closeRenamePopup=T,document.addEventListener("mousedown",E),document.body.appendChild(u),d.focus(),d.select()}catch(o){Jt(e,`Rename failed: ${o instanceof Error?o.message:"Unknown error"}`)}}}async requestSignatureHelp(e,{line:t,character:n},i=void 0){var o,l;if(!(this.featureOptions.signatureHelpEnabled&&this.client.ready&&this.client.hasCapability("textDocument/signatureHelp")))return null;try{let u=await this.client.textDocumentSignatureHelp({textDocument:{uri:this.documentUri},position:{line:t,character:n},context:{isRetrigger:!1,triggerKind:1,triggerCharacter:i}});if(!(u!=null&&u.signatures)||u.signatures.length===0)return null;let d=this.createTooltipContainer(),p=u.activeSignature??0,g=u.signatures[p]||u.signatures[0];if(!g)return null;let w=u.activeParameter??g.activeParameter??0,x=this.createSignatureElement(g,w);d.appendChild(x),g.documentation&&d.appendChild(this.createDocumentationElement(g.documentation));let S=(o=g.parameters)==null?void 0:o[w];S!=null&&S.documentation&&d.appendChild(this.createParameterDocElement(S.documentation));let E=Kt(e.state.doc,{line:t,character:n});return E==null?null:{pos:E,end:E,create:T=>({dom:d}),above:((l=this.featureOptions.signatureHelpOptions)==null?void 0:l.position)==="above"}}catch(u){return console.error("Signature help error:",u),null}}async showSignatureHelpTooltip(e,t,n){let i=++this.signatureHelpRequestId,o=await this.requestSignatureHelp(e,ur(e.state.doc,t),n);this.destroyed||i!==this.signatureHelpRequestId||e.dispatch({effects:Ic.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){var u;let n=document.createElement("div");if(n.classList.add("cm-signature"),n.style.cssText="font-family: monospace; margin-bottom: 4px;",!e.label||typeof e.label!="string")return n.textContent="Signature information unavailable",n;let i=e.label,o=e.parameters||[];if(o.length===0||!o[t])return n.textContent=i,n;let l=o[t].label;if(typeof l=="string"){let d=i.indexOf("(")+1;for(let g=0;g<t;g++){let w=(u=o[g])==null?void 0:u.label;if(typeof w=="string"){let x=i.indexOf(w,d);x!==-1&&(d=x+w.length)}}let p=i.indexOf(l,d);p===-1?n.textContent=i:this.applyRangeHighlighting(n,i,p,p+l.length)}else Array.isArray(l)&&l.length===2?this.applyRangeHighlighting(n,i,l[0],l[1]):n.textContent=i;return n}applyRangeHighlighting(e,t,n,i){if(!(Number.isInteger(n)&&Number.isInteger(i))||n<0||i<0||n>t.length||i>t.length){e.textContent=t;return}let o=Math.min(n,i),l=Math.max(n,i);if(o===l){e.textContent=t;return}e.textContent="";let u=t.substring(0,o),d=t.substring(o,l),p=t.substring(l);e.appendChild(document.createTextNode(u));let g=document.createElement("span");g.classList.add("cm-signature-active-param"),g.style.cssText="font-weight: bold; text-decoration: underline;",g.textContent=d,e.appendChild(g),e.appendChild(document.createTextNode(p))}createDocumentationElement(e){let t=document.createElement("div");return t.classList.add("cm-signature-docs"),t.style.cssText="margin-top: 4px; color: #666;",ml(t,e,{allowHTMLContent:this.allowHTMLContent,markdownRenderer:this.markdownRenderer}),t}createParameterDocElement(e){let t=document.createElement("div");return t.classList.add("cm-parameter-docs"),t.style.cssText="margin-top: 4px; font-style: italic; border-top: 1px solid #eee; padding-top: 4px;",ml(t,e,{allowHTMLContent:this.allowHTMLContent,markdownRenderer:this.markdownRenderer}),t}prepareRenameFallback(e,{line:t,character:n}){let i=e.state.doc.line(t+1).text,o=/\w+/g,l,u=n,d=n;for(;(l=o.exec(i))!==null;){let p=l.index,g=l.index+l[0].length;if(n>=p&&n<=g){u=p,d=g;break}}return u===n&&d===n?null:{range:{start:{line:t,character:u},end:{line:t,character:d}},placeholder:i.slice(u,d)}}applyEdits(e,t){let n=e.state.doc,i=[];for(let l of t){if(!l||typeof l!="object"||!l.range||typeof l.newText!="string")return!1;let u=Kt(n,l.range.start),d=Kt(n,l.range.end);if(u==null||d==null||u>d)return!1;i.push({from:u,to:d,insert:l.newText})}if(i.length===0)return!1;let o=[...i].sort((l,u)=>l.from-u.from||l.to-u.to);for(let l=1;l<o.length;l++){let u=o[l-1],d=o[l];if(u&&d&&(d.from<u.to||d.from===d.to&&u.from===u.to&&d.from===u.from))return Jt(e,"Workspace edit ranges overlap"),!1}return e.dispatch(e.state.update({changes:i})),!0}async applyWorkspaceEdit(e,t){var u;if(!t)return Jt(e,"No edit returned from language server"),!1;let n=t.changes&&typeof t.changes=="object"?t.changes:{},i=Array.isArray(t.documentChanges)?t.documentChanges:[];if(Object.keys(n).length===0&&i.length===0)return Jt(e,"No changes to apply"),!1;if(i.length>0){let d=[];for(let p of i){if(typeof p!="object"||!p||!("textDocument"in p))return Jt(e,"File creation, deletion, or renaming operations not supported yet"),!1;if(typeof p.textDocument!="object"||p.textDocument===null)return Jt(e,"Malformed workspace edit"),!1;if(p.textDocument.uri!==this.documentUri)return Jt(e,"Multi-file edits not supported yet"),!1;if(p.textDocument.version!=null&&p.textDocument.version!==this.documentVersion)return Jt(e,"Workspace edit is stale because the document changed"),!1;if(!Array.isArray(p.edits))return!1;for(let g of p.edits){if(typeof g!="object"||!g||!("newText"in g))return Jt(e,"Snippet edits not supported yet"),!1;d.push(g)}}return d.length===0?!1:this.applyEdits(e,d)}let o=Object.entries(n);if(o.some(([d])=>d!==this.documentUri))return Jt(e,"Multi-file edits not supported yet"),!1;let l=(u=o[0])==null?void 0:u[1];return Array.isArray(l)?this.applyEdits(e,l):!1}async applyRenameEdit(e,t){return this.applyWorkspaceEdit(e,t)}};r0=function(e){var d,p;let t={rename:"F2",goToDefinition:"F12",signatureHelp:"Mod-Shift-Space",codeActions:"Mod-.",...e.keyboardShortcuts},n=e.client,i={diagnosticsEnabled:!0,hoverEnabled:!0,completionEnabled:!0,definitionEnabled:!0,renameEnabled:!0,codeActionsEnabled:!0,signatureHelpEnabled:!0,signatureActivateOnTyping:!1,signatureHelpOptions:{position:"below"},...e},o=Cr.define(g=>new lD({client:n,documentUri:e.documentUri??g.state.facet(fb),languageId:e.languageId??g.state.facet(Z3),view:g,featureOptions:i,sendIncrementalChanges:e.sendIncrementalChanges,allowHTMLContent:e.allowHTMLContent,useSnippetOnCompletion:e.useSnippetOnCompletion,clientSideFiltering:e.clientSideFiltering,onGoToDefinition:e.onGoToDefinition,onShowLocation:e.onShowLocation,markdownRenderer:e.markdownRenderer,codeActionsConfig:e.codeActionsConfig})),l=g=>g.plugin(o),u=[o];if(i.diagnosticsEnabled&&u.push(ou,At.baseTheme({".cm-lsp-unnecessary":{opacity:"0.6"},".cm-lsp-deprecated":{textDecoration:"line-through"},".cm-diagnostic-related":{marginTop:"4px",display:"flex",flexDirection:"column",gap:"2px"},".cm-diagnostic-related-clickable":{cursor:"pointer"},".cm-diagnostic-related-location":{opacity:"0.7"},".cm-diagnostic-code-link":{display:"inline-block",marginTop:"4px"}})),u.push(Si.of([{key:t.signatureHelp,run:g=>{let w=l(g);if(!(w&&i.signatureHelpEnabled))return!1;let x=g.state.selection.main.head;return w.showSignatureHelpTooltip(g,x),!0}},{key:t.rename,run:g=>{let w=l(g);if(!(w&&i.renameEnabled))return!1;let x=g.state.selection.main.head;return w.requestRename(g,ur(g.state.doc,x)),!0}},{key:t.codeActions,run:g=>{let w=l(g);return w&&i.codeActionsEnabled?(w.showCodeActionsMenu(g).catch(x=>Jt(g,`Code actions failed: ${x instanceof Error?x.message:"Unknown error"}`)),!0):!1}},{key:t.goToDefinition,run:g=>{let w=l(g);if(!(w&&i.definitionEnabled))return!1;let x=g.state.selection.main.head;return w.requestDefinition(g,ur(g.state.doc,x)).catch(S=>Jt(g,`Go to definition failed: ${S instanceof Error?S.message:"Unknown error"}`)),!0}}])),i.hoverEnabled&&u.push(Ig((g,w)=>{let x=l(g);return x==null?null:x.requestHoverTooltip(g,ur(g.state.doc,w))},e.hoverConfig)),i.signatureHelpEnabled){u.push(Vc);let g=w=>w.state.field(Vc)?(w.dispatch({effects:Ic.of(null)}),!0):!1;u.push(At.domEventHandlers({mousedown:(w,x)=>(g(x),!1)})),u.push(Si.of([{key:")",run:w=>(g(w),!1)},{key:"Escape",run:w=>g(w)}])),u.push(At.updateListener.of(w=>{if(!(l(w.view)&&i.signatureActivateOnTyping)||!w.state.field(Vc)||!(w.selectionSet||w.docChanged))return;let x=w.state.selection.main.head;fD(w.state.doc,x)||queueMicrotask(()=>{g(w.view)})})),u.push(At.updateListener.of(async w=>{var j,z;let x=l(w.view);if(!(x&&w.docChanged)||w.transactions.some(V=>V.annotation(Ep))||!x.client.hasCapability("textDocument/signatureHelp")||!i.signatureActivateOnTyping)return;let S=((z=(j=x.client.capabilities)==null?void 0:j.signatureHelpProvider)==null?void 0:z.triggerCharacters)||["(",","],E=w.changes,T=-1,O;E.iterChanges((V,P,U,me,$)=>{if(T>=0)return;let W=uD($.toString(),U,S);W&&(T=W.triggerPos,O=W.triggerCharacter)}),T>=0&&x.showSignatureHelpTooltip(w.view,T,O)}))}if(i.completionEnabled){let g=(d=e.completionConfig)==null?void 0:d.optionClass;u.push(At.baseTheme({".cm-tooltip-autocomplete li.cm-deprecated .cm-completionLabel":{textDecoration:"line-through"}}),tf({...e.completionConfig,optionClass:w=>[P3(w),(g==null?void 0:g(w))??""].filter(Boolean).join(" "),override:[async w=>{var O,j;let x=w.view?l(w.view):null;if(x==null)return null;let{state:S,pos:E}=w,T=cD(w,((j=(O=x.client.capabilities)==null?void 0:O.completionProvider)==null?void 0:j.triggerCharacters)??[],e.completionMatchBefore);return T==null?null:await x.requestCompletion(w,ur(S.doc,E),T)},...((p=e.completionConfig)==null?void 0:p.override)||[]]}))}return u.push(At.domEventHandlers({click:(g,w)=>{if(i.definitionEnabled&&t.goToDefinition==="ctrlcmd"&&(g.ctrlKey||g.metaKey)){let x=w.posAtCoords({x:g.clientX,y:g.clientY}),S=l(w);x&&S&&(S.requestDefinition(w,ur(w.state.doc,x)).catch(E=>Jt(w,`Go to definition failed: ${E instanceof Error?E.message:"Unknown error"}`)),g.preventDefault())}}})),u};function cD(e,t,n){let{state:i,pos:o,explicit:l}=e,u=i.doc.lineAt(o),d=nn.CompletionTriggerKind.Invoked,p,g=u.text[o-u.from-1]||"",w=t==null?void 0:t.includes(g);return!l&&w&&(d=nn.CompletionTriggerKind.TriggerCharacter,p=g),!l&&d===nn.CompletionTriggerKind.Invoked&&!e.matchBefore(n||/(\w+|\w+\.|\/|,)$/)?null:{triggerKind:d,triggerCharacter:p}}function uD(e,t,n){if(!e)return null;for(let i of n){let o=e.indexOf(i);if(o!==-1)return{triggerPos:t+o+1,triggerCharacter:i}}return null}function dD(e){let t=0;for(let n of e)n==="("?t++:n===")"&&t--;return t}function fD(e,t,n=aD){let i=e.lineAt(t),o=Math.max(1,i.number-n),l=e.line(o).from;return dD(e.sliceString(l,t))>0}uf=function(e,t,n={}){let{preserveCursor:i=!0,effects:o,userEvent:l}=n,u=e.state.doc;if(u.toString()!==t)if(i&&e.hasFocus){let d=e.state.selection.main.head,p=u.lineAt(d),g=p.number,w=d-p.from,x=e.state.update({changes:{from:0,to:u.length,insert:t}}).state.doc,S;if(g<=x.lines){let E=x.line(g),T=E.length;S=E.from+Math.min(w,T)}else S=x.line(x.lines).to;e.dispatch({changes:{from:0,to:u.length,insert:t},annotations:Ep.of(!0),selection:{anchor:S},effects:o,userEvent:l})}else e.dispatch({changes:{from:0,to:u.length,insert:t},effects:o,userEvent:l})},$o=function(){return Gs.define({combine:e=>e.find(t=>t!==void 0)})};const wb=$o(),xb=$o(),Tp=$o(),lu=$o(),_b=$o();US=function({cellId:e,completionConfig:t,hotkeys:n,placeholderType:i,lspConfig:o,diagnosticsConfig:l}){return[lu.of(e),wb.of(t),xb.of(n),Tp.of(i),_b.of({...o,diagnostics:l})]},mf=new Yd,$0=function(e){return e==="application/vnd.marimo+error"},a0=function(e){return e==="application/vnd.marimo+traceback"},Sc=function(e){return $0(e)||a0(e)};function pD(e){return Object.values(e.cellRuntime).some(t=>t.status==="running")}function mD(e){return Object.values(e.cellRuntime).filter(t=>t.status==="running"||t.status==="queued").length}function hD(e){return B0(e).length>0}DS=function(e){return e.cellIds.inOrderIds.map(t=>e.cellData[t])},p0=function({cellHandles:e}){var n;let t={};for(let[i,o]of ki.entries(e))(n=o.current)!=null&&n.editorView&&(t[i]=o.current.editorView);return t},uy=function(e){let{cellIds:t,cellData:n}=e,i=[];for(let o of t.inOrderIds)n[o].config.disabled&&i.push(o);return i},f0=function(e){let{cellIds:t,cellData:n}=e,i=[];for(let o of t.inOrderIds)n[o].config.disabled||i.push(o);return i};function gD(e){return e.history.length>0}function yD(e){let t=e.history[e.history.length-1];return t&&t.type==="move"?"Undo move":"Undo cell deletion"}kS=function(e,t){let n=e.cellIds.findWithId(t).getDescendants(t);return{stale:n.some(i=>{var o,l;return((o=e.cellRuntime[i])==null?void 0:o.staleInputs)||((l=e.cellData[i])==null?void 0:l.edited)}),errored:n.some(i=>{var o;return(o=e.cellRuntime[i])==null?void 0:o.errored}),runningOrQueued:n.some(i=>{var o,l;return((o=e.cellRuntime[i])==null?void 0:o.status)==="running"||((l=e.cellRuntime[i])==null?void 0:l.status)==="queued"})}},B0=function(e){let{cellIds:t,cellData:n,cellRuntime:i}=e;return t.inOrderIds.filter(o=>ly({executionTime:i[o].runElapsedTimeMs??n[o].lastExecutionTime,status:i[o].status,errored:i[o].errored,interrupted:i[o].interrupted,stopped:i[o].stopped})||n[o].edited||i[o].interrupted||i[o].staleInputs&&!(i[o].status==="disabled-transitively"||n[o].config.disabled))},ly=function({executionTime:e,status:t,errored:n,interrupted:i,stopped:o}){return e===null&&t!=="queued"&&t!=="running"&&!(n||i||o)},kT=function({edited:e,interrupted:t,staleInputs:n,disabled:i,status:o}){return e||t||n&&!(i||o==="disabled-transitively")},bE=function({needsRun:e,errored:t,stopped:n,disabled:i,status:o}){return{"needs-run":e,"has-error":t,stopped:n,disabled:i??!1,stale:o==="disabled-transitively"}},SS=function({errored:e,stopped:t}){return{published:!0,"has-error":e,stopped:t}},VS=function({errored:e,interrupted:t,stopped:n,output:i,showErrorTracebacks:o}){let l=Sc(i==null?void 0:i.mimetype),u=o&&l&&Array.isArray(i==null?void 0:i.data)&&i.data.some(d=>d.type==="exception"&&"traceback"in d&&d.traceback);return(e||t||n||l)&&!u},Lt=Gs.define({combine:e=>e[0]}),oa=Gs.define({combine:e=>e[0]});var vD={...Og,caseInsensitiveIdentifiers:!0,identifierQuotes:"`"};const kb=rf.define(vD),bD=rf.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"}),Cb=rf.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 wD=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 cu(e){return wD.has(e)}function Sb(e){let t=e.dialect;if(!cu(t))return Se.debug("Unknown dialect",{dialect:t}),yl;switch(t){case"postgresql":case"postgres":return Og;case"mysql":return v6;case"sqlite":return g6;case"mssql":case"sqlserver":case"microsoft sql server":return w6;case"duckdb":return Cb;case"mariadb":return x6;case"cassandra":return _6;case"oracledb":case"oracle":return h6;case"bigquery":return kb;case"dremio":return bD;case"timescaledb":return Og;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 Se.debug("Unsupported dialect",{dialect:t}),yl;default:return Zs(t),yl}}var xD={...b6,caseInsensitiveIdentifiers:!0,identifierQuotes:"'"};let yl;yl=rf.define(xD),aa="__marimo_duckdb",ia=new Set([aa]),BE=function(e,t){var i;if(!e)return t;let n=((i=e.schemaPath)!=null&&i.length?e.schemaPath:[e.schema]).filter(Boolean);return[e.database,...n,t].join(".")},qc=function(e){return e===""},ry=function(e){return e.schemas_resolved!==!1},A0=function(e){return e.tables_resolved!==!1},J0=function(e){return e.child_schemas_resolved!==!1},Sf=function(e,t){let n=t==null?void 0:t.trim().toLowerCase();return n?A0(e)&&e.tables.some(i=>i.name.toLowerCase().includes(n))?!0:J0(e)?(e.child_schemas??[]).some(i=>Sf(i,n)):!1:!1},AE=function(e,t){return!(t!=null&&t.trim())||!ry(e)?!1:e.schemas.some(n=>Sf(n,t))};var vl={formatTablePath:e=>e.join("."),formatSelectClause:(e,t)=>`SELECT ${e} FROM ${t} LIMIT 100`};function _D(e){if(e=e.toLowerCase(),!cu(e))return vl;switch(e){case"bigquery":{let t=kb.spec.identifierQuotes;return{formatTablePath:n=>`${t}${n.join(".")}${t}`,formatSelectClause:vl.formatSelectClause}}case"mssql":case"sqlserver":case"microsoft sql server":return{formatTablePath:vl.formatTablePath,formatSelectClause:(t,n)=>`SELECT TOP 100 ${t} FROM ${n}`};case"timescaledb":case"postgres":case"postgresql":case"duckdb":case"dremio":return{formatTablePath:t=>t.map(n=>`"${n}"`).join("."),formatSelectClause:(t,n)=>`SELECT ${t==="*"?"*":`"${t}"`} FROM ${n} 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 vl;default:return Zs(e),vl}}YE=function({table:e,columnName:t,sqlTableContext:n}){if(n){let{engine:i,schema:o,defaultSchema:l,defaultDatabase:u,database:d,dialect:p}=n,g=[e.name];qc(o)||o!==l&&g.unshift(o),d!==u&&g.unshift(d);let w=_D(p),x=w.formatTablePath(g),S=w.formatSelectClause(t,x);return i==="__marimo_duckdb"?`_df = mo.sql(f"""
|
|
65
65
|
${S}
|
|
66
66
|
""")`:`_df = mo.sql(f"""
|
|
67
67
|
${S}
|
|
68
|
-
""", engine=${i})`}return`_df = mo.sql(f'SELECT "${t}" FROM ${e.name} LIMIT 100')`},kE=function(e,t){if(t==="date"||t==="datetime"||t==="time"){if(e==="min")return"Earliest";if(e==="max")return"Latest"}return e};function kD(){return{tables:[],expandedTables:new Set,expandedColumns:new Set,columnsPreviews:new Map}}var{reducer:F6,createActions:$6,valueAtom:Eb,useActions:CD}=Ys(kD,{addDatasets:(e,t)=>{let{previewDatasetColumn:n}=Sr();for(let d of t.tables)for(let p of d.columns){let g=`${d.name}:${p.name}`;e.expandedColumns.has(g)&&n({tableName:d.name,columnName:p.name,source:d.source,sourceType:d.source_type})}let i=e.tables;t.clear_channel&&(i=i.filter(d=>d.source!==t.clear_channel));let o=[...t.tables,...i],l=new Set,u=o.filter(d=>{let p=`${d.name}:${d.source}`;return l.has(p)?!1:(l.add(p),!0)}).toSorted((d,p)=>d.name.localeCompare(p.name));return{...e,tables:u}},filterDatasetsFromVariables:(e,t)=>{let n=new Set(t),i=e.tables.filter(o=>o.variable_name?n.has(o.variable_name):!0);return{...e,tables:i}},toggleTable:(e,t)=>{let n=new Set(e.expandedTables);return n.has(t)?n.delete(t):n.add(t),{...e,expandedTables:n}},toggleColumn:(e,t)=>{let n=`${t.table}:${t.column}`,i=new Set(e.expandedColumns);return i.has(n)?i.delete(n):i.add(n),{...e,expandedColumns:i}},closeAllColumns:e=>({...e,expandedColumns:new Set}),addColumnPreview:(e,t)=>{let n=`${t.table_name}:${t.column_name}`,i=new Map(e.columnsPreviews);return i.set(n,t),{...e,columnsPreviews:i}}});rT=()=>$n(Eb),Nf=je(e=>e(Eb).tables),UE=je(new Set),RE=je(!1),qE=function(){return CD()};var SD=new Map([[ia,{name:ia,dialect:"duckdb",source:"duckdb",display_name:"DuckDB (In-Memory)",databases:[]}]]);function cu(e,t,n){if(t.length===0)return e;let[i,...o]=t;return e.map(l=>l.name===i?o.length===0?n(l):{...l,child_schemas:cu(l.child_schemas??[],o,n)}:l)}function Tb(e){let{schemaPath:t,schema:n}=e;return t&&t.length>0?t:[n]}function ED(){return{latestEngineSelected:ia,connectionsMap:SD}}let TD,DD;({reducer:TD,createActions:DD,valueAtom:Vo,useActions:gS}=Ys(ED,{addDataSourceConnection:(e,t)=>{if(t.connections.length===0)return e;let{latestEngineSelected:n,connectionsMap:i}=e,o=new Map(i);for(let l of t.connections)o.set(l.name,l);return{latestEngineSelected:n,connectionsMap:o}},filterDataSourcesFromVariables:(e,t)=>{let{latestEngineSelected:n,connectionsMap:i}=e,o=new Set(t),l=new Map([...i].filter(([u])=>Ho.has(u)?!0:o.has(u)));return{latestEngineSelected:l.has(n)?n:ia,connectionsMap:l}},clearDataSourceConnections:()=>({latestEngineSelected:ia,connectionsMap:new Map}),removeDataSourceConnection:(e,t)=>{let{latestEngineSelected:n,connectionsMap:i}=e,o=new Map(i);return o.delete(t),{latestEngineSelected:o.has(n)?n:ia,connectionsMap:o}},addSchemaList:(e,t)=>{let{schemas:n,sqlSchemaContext:i}=t,{connectionsMap:o,latestEngineSelected:l}=e,u=i.engine,d=o.get(u);if(!d)return e;let p=i.schemaPath??[],g=new Map(o),w={...d,databases:d.databases.map(x=>x.name===i.database?p.length===0?{...x,schemas:n,schemas_resolved:!0}:{...x,schemas:cu(x.schemas,p,S=>({...S,child_schemas:n,child_schemas_resolved:!0}))}:x)};return g.set(u,w),{latestEngineSelected:l,connectionsMap:g}},addTableList:(e,t)=>{let{tables:n,sqlTableContext:i}=t,{connectionsMap:o,latestEngineSelected:l}=e,u=i.engine,d=o.get(u);if(!d)return e;let p=Tb(i),g=new Map(o),w={...d,databases:d.databases.map(x=>x.name===i.database?{...x,schemas:cu(x.schemas,p,S=>({...S,tables:n,tables_resolved:!0}))}:x)};return g.set(u,w),{latestEngineSelected:l,connectionsMap:g}},addTable:(e,t)=>{let{table:n,sqlTableContext:i}=t,{connectionsMap:o,latestEngineSelected:l}=e,u=i.engine,d=n.name,p=o.get(u);if(!p)return e;let g=Tb(i),w=new Map(o),x={...p,databases:p.databases.map(S=>S.name===i.database?{...S,schemas:cu(S.schemas,g,E=>{let T=E.tables.length===0?[n]:E.tables.map(O=>O.name===d?n:O);return{...E,tables:T}})}:S)};return w.set(u,x),{latestEngineSelected:l,connectionsMap:w}}})),bf=je(e=>e(Vo).connectionsMap);function Db(e){let t=Me.get(Vo);t.connectionsMap.has(e)&&Me.set(Vo,{...t,latestEngineSelected:e})}cE=je(e=>{let t=Me.get(Nf),n=e(Vo).connectionsMap,i=new Map;for(let o of t)i.set(o.name,o);for(let o of n.values())for(let l of o.databases){let u=l.name===o.default_database||o.databases.length===1,d=(p,g)=>{let w=g.length===0,x=g.length===1&&g[0]===o.default_schema,S=g.join(".");for(let E of p.tables){let T;if(T=E.name,w){T=u?E.name:`${l.name}.${E.name}`,i.has(T)?Se.warn(`Table name collision for ${T}. Skipping.`):i.set(T,E);continue}if(u&&x&&!i.has(T)){i.set(T,E);continue}if(T=`${S}.${E.name}`,u&&!i.has(T)){i.set(T,E);continue}T=`${l.name}.${S}.${E.name}`,i.has(T)?Se.warn(`Table name collision for ${T}. Skipping.`):i.set(T,E)}for(let E of p.child_schemas??[])d(E,[...g,E.name])};for(let p of l.schemas)d(p,Mc(p.name)?[]:[p.name])}return i}),QS=function(e){return e.variable_name?"dataframe":"table"};let uu,Dp,Rb,Ib,Ab,Rp,Lb;uu=class{constructor(e,t={}){pe(this,"cache",new Map);this.maxSize=e,this.options=t}getOrCreate(e){Vn(this.options.create,"create function is required");let t=this.cache.get(e);if(t!==void 0)return t;let n=this.options.create(e);return this.cache.set(e,n),n}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 n=this.cache.keys().next().value;n!==void 0&&this.cache.delete(n)}}keys(){return this.cache.keys()}values(){return this.cache.values()}entries(){return this.cache.entries()}delete(e){this.cache.delete(e)}},t0=kt("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"}]]),ty=kt("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"}]]),n0=kt("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"}]]),Gg=kt("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"}]]),k0=kt("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"}]]),Dp=kt("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"}]]),y0=kt("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"}]]),Jg=kt("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"}]]),w0=kt("clock",[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]),Rb=kt("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"}]]),Hg=kt("columns-2",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]]),sl=kt("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"}]]),hf=kt("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"}]]),i0=kt("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"}]]),Ib=kt("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"}]]),uf=kt("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]),Ab=kt("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"}]]),$o=kt("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"}]]),u0=kt("map-pin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]),l0=kt("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]),o0=kt("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"}]]),V0=kt("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"}]]),Vg=kt("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"}]]),W0=kt("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"}]]),Rp=kt("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"}]]),Lb=kt("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"}]]),c0=kt("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"}]]),zo=kt("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"}]]),Wg=kt("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"}]]),m0=kt("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"}]]),zc=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 Pb(e){let[t,n]=e.split(" ");return n?`${zc(t)} ${n}`:zc(e)}Fc={boolean:k6,date:C6,time:w0,datetime:Dp,temporal:Dp,number:Mg,string:S6,integer:Mg,geometry:u0,unknown:k0},rf=function(e){return Object.hasOwn(Fc,e)?e:"unknown"},YS=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"geometry":return"bg-(--cyan-4) dark:bg-(--cyan-5)";case"unknown":return"bg-(--slate-4) dark:bg-(--slate-6)";default:return Zs(e),"bg-(--slate-4) dark:bg-(--slate-6)"}};let bl,Ob,Ip,Mb;Ja=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`}},bE=class IT{constructor(t){this.words=t}static of(...t){return new IT(t.map(n=>typeof n=="string"?new Ja(n):n))}join(t,n){return this.words.map(i=>i.pluralize(n)).join(t)}},bl=kr(),Ob=5,Ip={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)",geometry:"bg-(--cyan-4) text-(--cyan-11)",unknown:"bg-(--slate-4) text-(--slate-11)"},Mb={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)"},Ko="p-3 min-w-[250px] flex flex-col divide-y";var RD=new Ja("column","columns"),ID=new Ja("row","rows"),AD=new Ja("schema","schemas"),LD=new Ja("table","tables"),PD=new Ja("database","databases");Wo=e=>{let t=(0,bl.c)(6),{icon:n,title:i,badge:o}=e,l;t[0]===i?l=t[1]:(l=(0,M.jsx)("h3",{className:"font-semibold text-sm",children:i}),t[0]=i,t[1]=l);let u;return t[2]!==o||t[3]!==n||t[4]!==l?(u=(0,M.jsxs)("div",{className:"flex items-center gap-2 pb-2",children:[n,l,o]}),t[2]=o,t[3]=n,t[4]=l,t[5]=u):u=t[5],u},ui=e=>{let t=(0,bl.c)(5),{label:n,value:i}=e,o;t[0]===n?o=t[1]:(o=(0,M.jsxs)("span",{className:"text-(--slate-11)",children:[n,":"]}),t[0]=n,t[1]=o);let l;return t[2]!==o||t[3]!==i?(l=(0,M.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[o,i]}),t[2]=o,t[3]=i,t[4]=l):l=t[4],l};var ts=e=>{let t=(0,bl.c)(5),{icon:n,text:i}=e,o;t[0]===i?o=t[1]:(o=(0,M.jsx)("span",{className:"text-xs text-(--slate-11)",children:i}),t[0]=i,t[1]=o);let l;return t[2]!==n||t[3]!==o?(l=(0,M.jsxs)("div",{className:"flex items-center gap-1",children:[n,o]}),t[2]=n,t[3]=o,t[4]=l):l=t[4],l},ma=e=>{let t=(0,bl.c)(15),{title:n,items:i,totalCount:o,limit:l}=e,u=n===void 0?"":n,d=l===void 0?Ob:l;if(i.length===0)return null;let p;t[0]!==i||t[1]!==d?(p=i.slice(0,d),t[0]=i,t[1]=d,t[2]=p):p=t[2];let g=p,w=o>d,x;t[3]===u?x=t[4]:(x=u&&(0,M.jsxs)("h4",{className:"text-xs font-medium text-(--slate-11) mb-2",children:[u,":"]}),t[3]=u,t[4]=x);let S;t[5]!==w||t[6]!==d||t[7]!==o?(S=w&&(0,M.jsxs)("div",{className:"text-xs text-(--slate-10) text-center py-1",children:["... and ",o-d," more"]}),t[5]=w,t[6]=d,t[7]=o,t[8]=S):S=t[8];let E;t[9]!==S||t[10]!==g?(E=(0,M.jsxs)("div",{className:"flex flex-col gap-1 overflow-y-auto",children:[g,S]}),t[9]=S,t[10]=g,t[11]=E):E=t[11];let T;return t[12]!==x||t[13]!==E?(T=(0,M.jsxs)("div",{className:"py-2",children:[x,E]}),t[12]=x,t[13]=E,t[14]=T):T=t[14],T},Nb=e=>Ip[e]||Ip.unknown;let jb,qb,zb;sy=e=>{var u,d;let t=e.type==="view"?(0,M.jsx)(hf,{className:"w-4 h-4 text-(--blue-9)"}):(0,M.jsx)(zo,{className:"w-4 h-4 text-(--green-9)"}),n=(0,M.jsx)(Er,{variant:"secondary",className:`text-xs ${e.type==="view"?"bg-(--blue-4) text-(--blue-11)":"bg-(--green-4) text-(--green-11)"}`,children:e.type}),i=e.columns.map(p=>{let g=Fc[rf(p.type)];return(0,M.jsxs)("div",{className:"flex items-center justify-between text-xs rounded",children:[(0,M.jsxs)("div",{className:"flex items-center gap-2",children:[(0,M.jsx)(g,{className:"w-3 h-3 text-(--slate-9)"}),(0,M.jsx)("span",{className:"font-mono",children:p.name})]}),(0,M.jsx)(Er,{variant:"outline",className:`text-xs ${Nb(p.type)}`,children:p.type})]},p.name)}),o=e.primary_keys&&e.primary_keys.length>0,l=e.indexes&&e.indexes.length>0;return(0,M.jsxs)("div",{className:`${Ko} min-w-[300px]`,children:[(0,M.jsx)(Wo,{icon:t,title:e.name,badge:n}),(0,M.jsxs)("div",{className:"flex flex-col gap-2 py-2",children:[(0,M.jsx)(ui,{label:"Source",value:(0,M.jsx)(Er,{variant:"outline",className:`text-xs ${Mb[e.source_type]}`,children:e.source})}),e.variable_name&&(0,M.jsx)(ui,{label:"Variable",value:(0,M.jsx)("code",{className:"text-xs bg-(--slate-4) px-1 rounded",children:e.variable_name})}),e.engine&&(0,M.jsx)(ui,{label:"Engine",value:(0,M.jsx)("code",{className:"text-xs bg-(--slate-4) px-1 rounded",children:e.engine})})]}),(e.num_columns!=null||e.num_rows!=null)&&(0,M.jsxs)("div",{className:"grid grid-cols-2 gap-2 py-2",children:[e.num_columns!=null&&(0,M.jsx)(ts,{icon:(0,M.jsx)(Hg,{className:"w-3 h-3 text-(--slate-9)"}),text:`${e.num_columns} ${RD.pluralize(e.num_columns)}`}),e.num_rows!=null&&(0,M.jsx)(ts,{icon:(0,M.jsx)(Mg,{className:"w-3 h-3 text-(--slate-9)"}),text:`${e.num_rows} ${ID.pluralize(e.num_rows)}`})]}),e.columns.length===0&&Lc("column"),(o||l)&&(0,M.jsxs)("div",{className:"flex flex-col gap-2 py-2",children:[o&&(0,M.jsxs)("div",{className:"flex flex-row gap-1",children:[(0,M.jsxs)("div",{className:"flex items-center gap-1",children:[(0,M.jsx)(A6,{className:"w-3 h-3 text-(--amber-9)"}),(0,M.jsx)("span",{className:"text-xs font-medium text-(--slate-11)",children:"Primary Keys:"})]}),(u=e.primary_keys)==null?void 0:u.map(p=>(0,M.jsx)(Er,{variant:"outline",className:"text-xs text-(--slate-11)",children:p},p))]}),l&&(0,M.jsxs)("div",{className:"flex flex-row gap-1",children:[(0,M.jsxs)("div",{className:"flex items-center gap-1 mb-1",children:[(0,M.jsx)(ty,{className:"w-3 h-3 text-(--purple-9)"}),(0,M.jsx)("span",{className:"text-xs font-medium text-(--slate-11)",children:"Indexes:"})]}),(d=e.indexes)==null?void 0:d.map(p=>(0,M.jsx)(Er,{variant:"outline",className:"text-xs text-(--slate-11)",children:p},p))]})]}),e.columns.length>0&&(0,M.jsx)(ma,{items:i,totalCount:e.columns.length})]})},jb=e=>{var o;let t=Fc[rf(e.type)],n=(0,M.jsx)(Er,{variant:"outline",className:`text-xs ${Nb(e.type)}`,children:e.type}),i=((o=e.sample_values)==null?void 0:o.map((l,u)=>(0,M.jsx)("div",{className:"text-xs bg-(--slate-3) rounded font-mono",children:l==null?"null":String(l)},u)))||[];return(0,M.jsxs)("div",{className:Ko,children:[(0,M.jsx)(Wo,{icon:(0,M.jsx)(t,{className:"w-4 h-4 text-(--slate-9)"}),title:e.name,badge:n}),(0,M.jsxs)("div",{className:"flex flex-col gap-2 mt-2",children:[(0,M.jsx)(ui,{label:"Type",value:(0,M.jsx)("span",{className:"font-medium",children:e.type})}),(0,M.jsx)(ui,{label:"External Type",value:(0,M.jsx)("code",{className:"text-xs bg-(--slate-4) px-1 rounded",children:e.external_type})})]}),e.sample_values&&e.sample_values.length>0&&(0,M.jsx)(ma,{title:"Sample Values",items:i,totalCount:e.sample_values.length})]})},qb=e=>{let t=(0,M.jsx)(Er,{variant:"outline",className:"text-xs bg-(--blue-4) text-(--blue-11)",children:e.dialect}),n=e.schemas.map(i=>(0,M.jsxs)("div",{className:"flex items-center justify-between text-xs rounded hover:bg-(--slate-3)",children:[(0,M.jsxs)("div",{className:"flex items-center gap-2",children:[(0,M.jsx)($o,{className:"w-3 h-3 text-(--slate-9)"}),(0,M.jsx)("span",{children:i.name})]}),(0,M.jsxs)(Er,{variant:"outline",className:"text-xs",children:[i.tables.length," ",LD.pluralize(i.tables.length)]})]},i.name));return(0,M.jsxs)("div",{className:Ko,children:[(0,M.jsx)(Wo,{icon:(0,M.jsx)(sl,{className:"w-4 h-4 text-(--blue-9)"}),title:e.name,badge:t}),(0,M.jsxs)("div",{className:"flex flex-col gap-2 py-2",children:[(0,M.jsx)(ui,{label:"Dialect",value:(0,M.jsx)("span",{className:"font-medium",children:e.dialect})}),e.engine&&(0,M.jsx)(ui,{label:"Engine",value:(0,M.jsx)("code",{className:"text-xs bg-(--slate-4) px-1 rounded",children:e.engine})})]}),(0,M.jsx)("div",{className:"py-2",children:(0,M.jsx)(ts,{icon:(0,M.jsx)($o,{className:"w-3 h-3 text-(--slate-9)"}),text:`${e.schemas.length} schema${e.schemas.length===1?"":"s"}`})}),e.schemas.length===0&&Lc("schema"),e.schemas.length>0&&(0,M.jsx)(ma,{title:"Schemas",items:n,totalCount:e.schemas.length})]})},zb=e=>{let t=(0,M.jsx)(Er,{variant:"outline",className:"text-xs bg-(--green-4) text-(--green-11)",children:"Schema"}),n=e.tables.map(i=>(0,M.jsxs)("div",{className:"flex items-center justify-between text-xs rounded hover:bg-(--slate-3)",children:[(0,M.jsxs)("div",{className:"flex items-center gap-2",children:[i.type==="view"?(0,M.jsx)(hf,{className:"w-3 h-3 text-(--blue-9)"}):(0,M.jsx)(zo,{className:"w-3 h-3 text-(--green-9)"}),(0,M.jsx)("span",{children:i.name})]}),(0,M.jsx)(Er,{variant:"outline",className:`text-xs ${i.type==="view"?"bg-(--blue-4) text-(--blue-11)":"bg-(--green-4) text-(--green-11)"}`,children:i.type})]},i.name));return(0,M.jsxs)("div",{className:Ko,children:[(0,M.jsx)(Wo,{icon:(0,M.jsx)($o,{className:"w-4 h-4 text-(--green-9)"}),title:e.name,badge:t}),(0,M.jsx)("div",{className:"py-2",children:(0,M.jsx)(ts,{icon:(0,M.jsx)(zo,{className:"w-3 h-3 text-(--slate-9)"}),text:`${e.tables.length} table${e.tables.length===1?"":"s"}`})}),e.tables.length===0&&Lc("table"),e.tables.length>0&&(0,M.jsx)(ma,{title:"Tables",items:n,totalCount:e.tables.length})]})};var Fb=(0,M.jsx)(Er,{variant:"outline",children:"default"}),OD=8,$b=3;ME=(e,t)=>{let n=e.databases.length,i=e.databases.reduce((p,g)=>p+g.schemas.length,0),o=(p,g)=>{if(p.tables.length===0)return null;let w=p.name===e.default_schema&&g,x=[];return i<OD&&(x=p.tables.slice(0,$b+1).map(S=>(0,M.jsxs)("div",{className:"flex items-center gap-2 ml-4",children:[(0,M.jsx)(zo,{className:"w-3 h-3 text-(--green-9)"}),(0,M.jsx)("span",{className:"text-xs",children:S.name})]},S.name))),(0,M.jsxs)("div",{children:[(0,M.jsxs)("div",{className:"flex items-center gap-2 text-xs rounded hover:bg-(--slate-3) ml-2",children:[(0,M.jsx)($o,{className:"w-3 h-3 text-(--slate-9)"}),(0,M.jsx)("span",{children:p.name}),w&&Fb,(0,M.jsxs)(Er,{variant:"outline",className:"text-xs ml-auto",children:[p.tables.length," tables"]})]}),(0,M.jsx)(ma,{items:x,totalCount:p.tables.length,limit:$b})]},p.name)},l=e.databases.map(p=>{let g=p.name===e.default_database||e.databases.length===1,w=p.schemas.map(x=>o(x,g));return(0,M.jsxs)("div",{children:[(0,M.jsxs)("div",{className:"flex items-center gap-2",children:[(0,M.jsx)(sl,{className:"w-3 h-3 text-(--blue-9)"}),(0,M.jsx)("span",{className:"text-xs",children:p.name}),g&&Fb]}),w&&(0,M.jsx)(ma,{items:w,totalCount:p.schemas.length})]},p.name)}),u=e.name;Ho.has(e.name)&&(u="In-Memory");let d=t==null?void 0:t.map(p=>(0,M.jsxs)("div",{className:"flex items-center gap-2",children:[(0,M.jsx)(zo,{className:"w-3 h-3 text-(--blue-9)"}),(0,M.jsx)("span",{className:"text-xs",children:p.name})]},p.name));return(0,M.jsxs)("div",{className:`${Ko} px-1`,children:[(0,M.jsx)(Wo,{icon:(0,M.jsx)(Rb,{className:"w-4 h-4 text-(--purple-9)"}),title:u}),(0,M.jsxs)("div",{className:"flex flex-col gap-2 py-2",children:[(0,M.jsx)(ui,{label:"Dialect",value:(0,M.jsx)("span",{className:"font-medium",children:zc(e.dialect)})}),(0,M.jsx)(ui,{label:"Source",value:(0,M.jsx)(Er,{variant:"outline",className:"text-xs bg-(--green-4) text-(--green-11)",children:e.source})})]}),(0,M.jsxs)("div",{className:"flex flex-row justify-between py-2",children:[(0,M.jsx)(ts,{icon:(0,M.jsx)(sl,{className:"w-3 h-3 text-(--slate-9)"}),text:`${n} ${PD.pluralize(n)}`}),(0,M.jsx)(ts,{icon:(0,M.jsx)($o,{className:"w-3 h-3 text-(--slate-9)"}),text:`${i} ${AD.pluralize(i)}`})]}),n>0&&(0,M.jsx)(ma,{items:l,totalCount:n}),d&&d.length>0&&(0,M.jsx)(ma,{title:"Dataframes",items:d,totalCount:d.length})]})},Lc=e=>(0,M.jsxs)("div",{className:"flex items-start gap-2 mt-3",children:[(0,M.jsx)(uf,{size:10,className:"mt-1 text-(--slate-10) shrink-0"}),(0,M.jsxs)("span",{className:"text-xs text-(--slate-11)",children:["No ",e," information available.",`
|
|
69
|
-
`,(0,M.jsx)("span",{className:"text-(--blue-10)",children:"Introspect to see more details."})]})]});var du=gf(),Vb=class{constructor(){pe(this,"schema",{})}addTable(e,t){let n={self:ND({table:t}),children:t.columns.map(i=>MD({column:i}))};return this.setAt([...e,t.name],n),this}addSchema(e,t){let n={self:jD({namespace:t,path:e}),children:{}};return this.setAt(e,n),this}addDatabase(e,t){let n={self:qD({namespace:t,path:e}),children:{}};return this.setAt(e,n),this}setAt(e,t){let n=this.schema;for(let i of e.slice(0,-1))n[i]||(n[i]={children:{}}),n=n[i].children;n[e[e.length-1]]=t}build(){return this.schema}reset(){return this.schema={},this}};function MD(e){return{label:e.column.name,type:"column",info:()=>{let t=document.createElement("div");return(0,du.createRoot)(t).render(jb(e.column)),{dom:t}}}}function ND(e){return{label:e.table.name,type:"table",info:()=>{let t=document.createElement("div");return(0,du.createRoot)(t).render(sy(e.table)),{dom:t}}}}function jD(e){return{label:e.namespace.name,detail:e.path.join("."),type:"schema",info:()=>{let t=document.createElement("div");return(0,du.createRoot)(t).render(zb(e.namespace)),{dom:t}}}}function qD(e){return{label:e.namespace.name,detail:e.path.join("."),type:"database",info:()=>{let t=document.createElement("div");return(0,du.createRoot)(t).render(qb(e.namespace)),{dom:t}}}}var zD=je(e=>{let t=e(Nf),n=new Vb;for(let i of t)n.addTable([],i);return n.build()}),FD=class{constructor(){this.cache=new uu(10,{create:e=>this.getConnectionSchema(e)})}getConnection(e){return Me.get(bf).get(e)}getConnectionSchema(e){var u,d;let{default_database:t,databases:n,default_schema:i}=e,o=new Vb,l=n.find(p=>p.name===t||n.length===1);if(((u=l??n[0])==null?void 0:u.schemas.some(p=>Mc(p.name)))??!1){for(let p of n){let g=p.name===(l==null?void 0:l.name),w=p.schemas.flatMap(x=>x.tables);o.addDatabase([p.name],p);for(let x of w)g?o.addTable([],x):o.addTable([p.name],x)}return{shouldAddLocalTables:!1,schema:o.build(),defaultSchema:l==null?void 0:l.name}}if(l)for(let p of l.schemas){o.addSchema([p.name],p);for(let g of p.tables)o.addTable([p.name],g)}for(let p of n){o.addDatabase([p.name],p);for(let g of p.schemas){o.addSchema([p.name,g.name],g);for(let w of g.tables)o.addTable([p.name,g.name],w)}}return{shouldAddLocalTables:!0,schema:o.build(),defaultSchema:i??((l==null?void 0:l.schemas.length)===1?(d=l.schemas[0])==null?void 0:d.name:void 0)}}getInternalDialect(e){let t=this.getConnection(e);return t?t.dialect.toLowerCase():null}getDialect(e){let t=this.getConnection(e);return t?Sb(t):yl}getCompletionSource(e){let t=this.getConnection(e);if(!t)return null;let n=()=>Me.get(zD),i=this.cache.getOrCreate(t);return{dialect:Sb(t),schema:i.shouldAddLocalTables?{...i.schema,...n()}:i.schema,defaultSchema:i.defaultSchema,defaultTable:$D(t)}}};function $D(e){if(e.databases.length!==1)return;let t=e.databases[0];if(t.schemas.length!==1)return;let n=t.schemas[0];if(n.tables.length===1)return n.tables[0].name}const no=new FD,wl=sr.define();Ef=async function(e){let{sendFormat:t}=Sr(),n=ki.mapValues(e,o=>ci(o)),i=await t({codes:n,lineLength:qC().formatting.line_length});for(let[o,l]of ki.entries(i.codes)){let u=o,d=n[u],p=e[u];p&&l!==d&&(p.state.facet(Lt).updateCellCode({cellId:u,code:l,formattingChange:!0}),Bo(p,l))}},EE=function(){return Ef(p0(Af()))};async function VD(e,t){let{formatDialect:n}=await de(async()=>{let{formatDialect:x}=await import("./esm-DbAcs2Px.js").then(async S=>(await S.__tla,S));return{formatDialect:x}},__vite__mapDeps([0,1]),import.meta.url),i=await HD(no.getInternalDialect(t)),o=e.state.field(Ir),l=D5(e.state);if(o.type!=="sql"){Se.error("Language adapter is not SQL");return}let u=e.state.doc.toString(),d;try{d=n(u,{dialect:i,tabWidth:l,useTabs:!1})}catch(x){Se.error("Error formatting SQL",{error:x});return}let p=o.transformIn(d)[0],g=e.state.facet(Lt),w=e.state.facet(su);g.updateCellCode({cellId:w,code:p,formattingChange:!0}),cf(e,d,{effects:[wl.of(!0)]})}async function HD(e){let{bigquery:t,db2:n,db2i:i,duckdb:o,hive:l,mariadb:u,mysql:d,tidb:p,n1ql:g,plsql:w,postgresql:x,redshift:S,spark:E,sqlite:T,sql:O,trino:j,transactsql:z,singlestoredb:V,snowflake:P}=await de(async()=>{let{bigquery:me,db2:$,db2i:W,duckdb:ae,hive:xe,mariadb:_e,mysql:Te,tidb:Z,n1ql:Q,plsql:Y,postgresql:ce,redshift:te,spark:he,sqlite:G,sql:Ne,trino:qe,transactsql:Qe,singlestoredb:He,snowflake:Fe}=await import("./esm-DbAcs2Px.js").then(async Oe=>(await Oe.__tla,Oe));return{bigquery:me,db2:$,db2i:W,duckdb:ae,hive:xe,mariadb:_e,mysql:Te,tidb:Z,n1ql:Q,plsql:Y,postgresql:ce,redshift:te,spark:he,sqlite:G,sql:Ne,trino:qe,transactsql:Qe,singlestoredb:He,snowflake:Fe}},__vite__mapDeps([0,1]),import.meta.url),U=O;if(!e||!lu(e))return U;switch(e){case"mysql":return d;case"mariadb":return u;case"postgres":case"postgresql":return x;case"sqlite":return T;case"db2":return n;case"db2i":return i;case"hive":return l;case"redshift":return S;case"snowflake":return P;case"trino":return j;case"tidb":return p;case"oracle":case"oracledb":return w;case"spark":return E;case"singlestoredb":return V;case"couchbase":return g;case"bigquery":return t;case"duckdb":return o;case"mssql":case"sqlserver":case"microsoft sql server":return z;case"athena":case"awsathena":case"cassandra":case"noql":case"flink":case"mongodb":case"timescaledb":case"datafusion":case"dremio":return O;case"databricks":return E;default:return Zs(e),U}}var BD=gf();function WD(e,t){let n=document.createElement("div"),i;return{dom:n,mount(){i=(0,BD.createRoot)(n),i.render((0,M.jsx)(AC,{store:Me,children:(0,M.jsx)(t,{view:e})}))},update(){i==null||i.render((0,M.jsx)(AC,{store:Me,children:(0,M.jsx)(t,{view:e})}))},destroy(){i==null||i.unmount()}}}function be(e){return new rS(eS.define(e))}function ha(e){return de(()=>import("./dist-oo7CUTL2.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 UD=[ue.of({name:"C",extensions:["c","h","ino"],load(){return de(()=>import("./dist-BbNJKBqf.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([6,7,5]),import.meta.url).then(e=>e.cpp())}}),ue.of({name:"C++",alias:["cpp"],extensions:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],load(){return de(()=>import("./dist-BbNJKBqf.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([6,7,5]),import.meta.url).then(e=>e.cpp())}}),ue.of({name:"CQL",alias:["cassandra"],extensions:["cql"],load(){return ha("Cassandra")}}),ue.of({name:"CSS",extensions:["css"],load(){return de(()=>import("./dist-DAd7fvc1.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([8,9,5]),import.meta.url).then(e=>e.css())}}),ue.of({name:"Go",extensions:["go"],load(){return de(()=>import("./dist-5AUFDACg.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([10,11,4,5]),import.meta.url).then(e=>e.go())}}),ue.of({name:"HTML",alias:["xhtml"],extensions:["html","htm","handlebars","hbs"],load(){return de(()=>import("./dist-BC6HNlDy.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([12,9,5,13,14,4]),import.meta.url).then(e=>e.html())}}),ue.of({name:"Java",extensions:["java"],load(){return de(()=>import("./dist-ClAayqDs.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([15,16,5]),import.meta.url).then(e=>e.java())}}),ue.of({name:"JavaScript",alias:["ecmascript","js","node"],extensions:["js","mjs","cjs"],load(){return de(()=>import("./dist-Bwzs3Vpo.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([17,14,4,5]),import.meta.url).then(e=>e.javascript())}}),ue.of({name:"Jinja",extensions:["j2","jinja","jinja2"],load(){return de(()=>import("./dist-CAHB5I2V.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([18,9,5,13,14,4,19]),import.meta.url).then(e=>e.jinja())}}),ue.of({name:"JSON",alias:["json5"],extensions:["json","map"],load(){return de(()=>import("./dist-D5yi7Y8o.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([20,21,5]),import.meta.url).then(e=>e.json())}}),ue.of({name:"JSX",extensions:["jsx"],load(){return de(()=>import("./dist-Bwzs3Vpo.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([17,14,4,5]),import.meta.url).then(e=>e.javascript({jsx:!0}))}}),ue.of({name:"LESS",extensions:["less"],load(){return de(()=>import("./dist-CF4ci481.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([22,9,5,23]),import.meta.url).then(e=>e.less())}}),ue.of({name:"Liquid",extensions:["liquid"],load(){return de(()=>import("./dist-etjVl5BO.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([24,9,5,13,14,4,25]),import.meta.url).then(e=>e.liquid())}}),ue.of({name:"MariaDB SQL",load(){return ha("MariaSQL")}}),ue.of({name:"Markdown",extensions:["md","markdown","mkd"],load(){return de(()=>import("./dist-qxqSCe2K.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([26,9,5,13,14,4,27]),import.meta.url).then(e=>e.markdown())}}),ue.of({name:"MS SQL",load(){return ha("MSSQL")}}),ue.of({name:"MySQL",load(){return ha("MySQL")}}),ue.of({name:"PHP",extensions:["php","php3","php4","php5","php7","phtml"],load(){return de(()=>import("./dist-0tTkix79.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([28,9,5,13,14,4,29]),import.meta.url).then(e=>e.php())}}),ue.of({name:"PLSQL",extensions:["pls"],load(){return ha("PLSQL")}}),ue.of({name:"PostgreSQL",load(){return ha("PostgreSQL")}}),ue.of({name:"Python",extensions:["BUILD","bzl","py","pyw"],filename:/^(BUCK|BUILD)$/,load(){return de(()=>import("./dist-D1BB6_s_.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([30,31,4,5]),import.meta.url).then(e=>e.python())}}),ue.of({name:"Rust",extensions:["rs"],load(){return de(()=>import("./dist-Dk7PW1P8.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([32,33,5]),import.meta.url).then(e=>e.rust())}}),ue.of({name:"Sass",extensions:["sass"],load(){return de(()=>import("./dist-UMYZc9Uw.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([34,9,5,35]),import.meta.url).then(e=>e.sass({indented:!0}))}}),ue.of({name:"SCSS",extensions:["scss"],load(){return de(()=>import("./dist-UMYZc9Uw.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([34,9,5,35]),import.meta.url).then(e=>e.sass())}}),ue.of({name:"SQL",extensions:["sql"],load(){return ha("StandardSQL")}}),ue.of({name:"SQLite",load(){return ha("SQLite")}}),ue.of({name:"TSX",extensions:["tsx"],load(){return de(()=>import("./dist-Bwzs3Vpo.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}))}}),ue.of({name:"TypeScript",alias:["ts"],extensions:["ts","mts","cts"],load(){return de(()=>import("./dist-Bwzs3Vpo.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([17,14,4,5]),import.meta.url).then(e=>e.javascript({typescript:!0}))}}),ue.of({name:"WebAssembly",extensions:["wat","wast"],load(){return de(()=>import("./dist-CJU3fYUR.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([36,37,5]),import.meta.url).then(e=>e.wast())}}),ue.of({name:"XML",alias:["rss","wsdl","xsd"],extensions:["xml","xsl","xsd","svg"],load(){return de(()=>import("./dist-CG7o1Txo.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([38,39,5]),import.meta.url).then(e=>e.xml())}}),ue.of({name:"YAML",alias:["yml"],extensions:["yaml","yml"],load(){return de(()=>import("./dist-x-uwJAB2.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([40,41,5]),import.meta.url).then(e=>e.yaml())}}),ue.of({name:"APL",extensions:["dyalog","apl"],load(){return de(()=>import("./apl-B-7blH-b.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([42,43]),import.meta.url).then(e=>be(e.apl))}}),ue.of({name:"PGP",alias:["asciiarmor"],extensions:["asc","pgp","sig"],load(){return de(()=>import("./asciiarmor-D3K8amZ9.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([44,45]),import.meta.url).then(e=>be(e.asciiArmor))}}),ue.of({name:"ASN.1",extensions:["asn","asn1"],load(){return de(()=>import("./asn1-UGGn98tp.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([46,47]),import.meta.url).then(e=>be(e.asn1({})))}}),ue.of({name:"Asterisk",filename:/^extensions\.conf$/i,load(){return de(()=>import("./asterisk-1BK_fEUT.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>be(e.asterisk))}}),ue.of({name:"Brainfuck",extensions:["b","bf"],load(){return de(()=>import("./brainfuck-B4y4U3tg.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([48,49]),import.meta.url).then(e=>be(e.brainfuck))}}),ue.of({name:"Cobol",extensions:["cob","cpy"],load(){return de(()=>import("./cobol-XqY9jaWP.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([50,51]),import.meta.url).then(e=>be(e.cobol))}}),ue.of({name:"C#",alias:["csharp","cs"],extensions:["cs"],load(){return de(()=>import("./clike-BAN6KopO.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([52,53]),import.meta.url).then(e=>be(e.csharp))}}),ue.of({name:"Clojure",extensions:["clj","cljc","cljx"],load(){return de(()=>import("./clojure-BAZ-ejkG.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([54,55]),import.meta.url).then(e=>be(e.clojure))}}),ue.of({name:"ClojureScript",extensions:["cljs"],load(){return de(()=>import("./clojure-BAZ-ejkG.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([54,55]),import.meta.url).then(e=>be(e.clojure))}}),ue.of({name:"Closure Stylesheets (GSS)",extensions:["gss"],load(){return de(()=>import("./css-DWLxGm3Z.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([56,57]),import.meta.url).then(e=>be(e.gss))}}),ue.of({name:"CMake",extensions:["cmake","cmake.in"],filename:/^CMakeLists\.txt$/,load(){return de(()=>import("./cmake-jWn0xN9y.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([58,59]),import.meta.url).then(e=>be(e.cmake))}}),ue.of({name:"CoffeeScript",alias:["coffee","coffee-script"],extensions:["coffee"],load(){return de(()=>import("./coffeescript-DI1jfZHX.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([60,61]),import.meta.url).then(e=>be(e.coffeeScript))}}),ue.of({name:"Common Lisp",alias:["lisp"],extensions:["cl","lisp","el"],load(){return de(()=>import("./commonlisp-UKb01OlU.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([62,63]),import.meta.url).then(e=>be(e.commonLisp))}}),ue.of({name:"Cypher",extensions:["cyp","cypher"],load(){return de(()=>import("./cypher-CLDhu2ae.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([64,65]),import.meta.url).then(e=>be(e.cypher))}}),ue.of({name:"Cython",extensions:["pyx","pxd","pxi"],load(){return de(()=>import("./python-BMLOKYmk.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([66,67]),import.meta.url).then(e=>be(e.cython))}}),ue.of({name:"Crystal",extensions:["cr"],load(){return de(()=>import("./crystal-DOvjTBWA.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([68,69]),import.meta.url).then(e=>be(e.crystal))}}),ue.of({name:"D",extensions:["d"],load(){return de(()=>import("./d-C0ecUZk9.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([70,71]),import.meta.url).then(e=>be(e.d))}}),ue.of({name:"Dart",extensions:["dart"],load(){return de(()=>import("./clike-BAN6KopO.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([52,53]),import.meta.url).then(e=>be(e.dart))}}),ue.of({name:"diff",extensions:["diff","patch"],load(){return de(()=>import("./diff-657cCCVc.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([72,73]),import.meta.url).then(e=>be(e.diff))}}),ue.of({name:"Dockerfile",filename:/^Dockerfile$/,load(){return de(()=>import("./dockerfile-vQlfzaHL.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([74,75]),import.meta.url).then(e=>be(e.dockerFile))}}),ue.of({name:"DTD",extensions:["dtd"],load(){return de(()=>import("./dtd-DSiK7Qgi.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([76,77]),import.meta.url).then(e=>be(e.dtd))}}),ue.of({name:"Dylan",extensions:["dylan","dyl","intr"],load(){return de(()=>import("./dylan-07d5-7Q9.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([78,79]),import.meta.url).then(e=>be(e.dylan))}}),ue.of({name:"EBNF",load(){return de(()=>import("./ebnf-CviyCkP7.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>be(e.ebnf))}}),ue.of({name:"ECL",extensions:["ecl"],load(){return de(()=>import("./ecl-CSTUHiwq.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([80,81]),import.meta.url).then(e=>be(e.ecl))}}),ue.of({name:"edn",extensions:["edn"],load(){return de(()=>import("./clojure-BAZ-ejkG.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([54,55]),import.meta.url).then(e=>be(e.clojure))}}),ue.of({name:"Eiffel",extensions:["e"],load(){return de(()=>import("./eiffel-DR99GcsM.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([82,83]),import.meta.url).then(e=>be(e.eiffel))}}),ue.of({name:"Elm",extensions:["elm"],load(){return de(()=>import("./elm-Cmh0iW6J.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([84,85]),import.meta.url).then(e=>be(e.elm))}}),ue.of({name:"Erlang",extensions:["erl"],load(){return de(()=>import("./erlang-CS9Yc6UC.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([86,87]),import.meta.url).then(e=>be(e.erlang))}}),ue.of({name:"Esper",load(){return de(()=>import("./sql-F2Gt8FSJ.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>be(e.esper))}}),ue.of({name:"Factor",extensions:["factor"],load(){return de(()=>import("./factor-DjB27Lcf.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([88,89,75]),import.meta.url).then(e=>be(e.factor))}}),ue.of({name:"FCL",load(){return de(()=>import("./fcl-DjfeL5F6.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>be(e.fcl))}}),ue.of({name:"Forth",extensions:["forth","fth","4th"],load(){return de(()=>import("./forth-UwTUu7NY.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([90,91]),import.meta.url).then(e=>be(e.forth))}}),ue.of({name:"Fortran",extensions:["f","for","f77","f90","f95"],load(){return de(()=>import("./fortran-cptiB4gJ.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([92,93]),import.meta.url).then(e=>be(e.fortran))}}),ue.of({name:"F#",alias:["fsharp"],extensions:["fs"],load(){return de(()=>import("./mllike-DmouQ5Dp.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([94,95]),import.meta.url).then(e=>be(e.fSharp))}}),ue.of({name:"Gas",extensions:["s"],load(){return de(()=>import("./gas-ajMbd9Us.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([96,97]),import.meta.url).then(e=>be(e.gas))}}),ue.of({name:"Gherkin",extensions:["feature"],load(){return de(()=>import("./gherkin-ClYkalzE.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([98,99]),import.meta.url).then(e=>be(e.gherkin))}}),ue.of({name:"Groovy",extensions:["groovy","gradle"],filename:/^Jenkinsfile$/,load(){return de(()=>import("./groovy-BY-gt7AW.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([100,101]),import.meta.url).then(e=>be(e.groovy))}}),ue.of({name:"Haskell",extensions:["hs"],load(){return de(()=>import("./haskell-D1BeJ7SR.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([102,103]),import.meta.url).then(e=>be(e.haskell))}}),ue.of({name:"Haxe",extensions:["hx"],load(){return de(()=>import("./haxe-QOq5WFXx.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([104,105]),import.meta.url).then(e=>be(e.haxe))}}),ue.of({name:"HXML",extensions:["hxml"],load(){return de(()=>import("./haxe-QOq5WFXx.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([104,105]),import.meta.url).then(e=>be(e.hxml))}}),ue.of({name:"HTTP",load(){return de(()=>import("./http-VleqgIZJ.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>be(e.http))}}),ue.of({name:"IDL",extensions:["pro"],load(){return de(()=>import("./idl-3-UcEGx7.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([106,107]),import.meta.url).then(e=>be(e.idl))}}),ue.of({name:"JSON-LD",alias:["jsonld"],extensions:["jsonld"],load(){return de(()=>import("./javascript-CorD44JN.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([108,109]),import.meta.url).then(e=>be(e.jsonld))}}),ue.of({name:"Julia",extensions:["jl"],load(){return de(()=>import("./julia-BYqTtTAl.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([110,111]),import.meta.url).then(e=>be(e.julia))}}),ue.of({name:"Kotlin",extensions:["kt","kts"],load(){return de(()=>import("./clike-BAN6KopO.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([52,53]),import.meta.url).then(e=>be(e.kotlin))}}),ue.of({name:"LiveScript",alias:["ls"],extensions:["ls"],load(){return de(()=>import("./livescript-qYgfNnNE.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([112,113]),import.meta.url).then(e=>be(e.liveScript))}}),ue.of({name:"Lua",extensions:["lua"],load(){return de(()=>import("./lua-BCqCjdfz.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([114,115]),import.meta.url).then(e=>be(e.lua))}}),ue.of({name:"mIRC",extensions:["mrc"],load(){return de(()=>import("./mirc-ipoElhai.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([116,117]),import.meta.url).then(e=>be(e.mirc))}}),ue.of({name:"Mathematica",extensions:["m","nb","wl","wls"],load(){return de(()=>import("./mathematica-XKwMfn0d.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([118,119]),import.meta.url).then(e=>be(e.mathematica))}}),ue.of({name:"Modelica",extensions:["mo"],load(){return de(()=>import("./modelica-BtmmVsUf.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([120,121]),import.meta.url).then(e=>be(e.modelica))}}),ue.of({name:"MUMPS",extensions:["mps"],load(){return de(()=>import("./mumps-oKfoFTl_.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([122,123]),import.meta.url).then(e=>be(e.mumps))}}),ue.of({name:"Mbox",extensions:["mbox"],load(){return de(()=>import("./mbox-BnkeOnif.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([124,125]),import.meta.url).then(e=>be(e.mbox))}}),ue.of({name:"Nginx",filename:/nginx.*\.conf$/i,load(){return de(()=>import("./nginx-D7OKXoUe.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>be(e.nginx))}}),ue.of({name:"NSIS",extensions:["nsh","nsi"],load(){return de(()=>import("./nsis-DDOPnuAW.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([126,127,75]),import.meta.url).then(e=>be(e.nsis))}}),ue.of({name:"NTriples",extensions:["nt","nq"],load(){return de(()=>import("./ntriples-Dsyl_sOF.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([128,129]),import.meta.url).then(e=>be(e.ntriples))}}),ue.of({name:"Objective-C",alias:["objective-c","objc"],extensions:["m"],load(){return de(()=>import("./clike-BAN6KopO.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([52,53]),import.meta.url).then(e=>be(e.objectiveC))}}),ue.of({name:"Objective-C++",alias:["objective-c++","objc++"],extensions:["mm"],load(){return de(()=>import("./clike-BAN6KopO.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([52,53]),import.meta.url).then(e=>be(e.objectiveCpp))}}),ue.of({name:"OCaml",extensions:["ml","mli","mll","mly"],load(){return de(()=>import("./mllike-DmouQ5Dp.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([94,95]),import.meta.url).then(e=>be(e.oCaml))}}),ue.of({name:"Octave",extensions:["m"],load(){return de(()=>import("./octave-CI5RGMPa.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([130,131]),import.meta.url).then(e=>be(e.octave))}}),ue.of({name:"Oz",extensions:["oz"],load(){return de(()=>import("./oz-D01pKAWx.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([132,133]),import.meta.url).then(e=>be(e.oz))}}),ue.of({name:"Pascal",extensions:["p","pas"],load(){return de(()=>import("./pascal-DGXfnIFD.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([134,135]),import.meta.url).then(e=>be(e.pascal))}}),ue.of({name:"Perl",extensions:["pl","pm"],load(){return de(()=>import("./perl-gZ7qIkF-.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([136,137]),import.meta.url).then(e=>be(e.perl))}}),ue.of({name:"Pig",extensions:["pig"],load(){return de(()=>import("./pig-Cb90ayl-.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([138,139]),import.meta.url).then(e=>be(e.pig))}}),ue.of({name:"PowerShell",extensions:["ps1","psd1","psm1"],load(){return de(()=>import("./powershell-_YxddSL3.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([140,141]),import.meta.url).then(e=>be(e.powerShell))}}),ue.of({name:"Properties files",alias:["ini","properties"],extensions:["properties","ini","in"],load(){return de(()=>import("./properties-sU50dmvt.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([142,143]),import.meta.url).then(e=>be(e.properties))}}),ue.of({name:"ProtoBuf",extensions:["proto"],load(){return de(()=>import("./protobuf-DFdF-yfo.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([144,145]),import.meta.url).then(e=>be(e.protobuf))}}),ue.of({name:"Pug",alias:["jade"],extensions:["pug","jade"],load(){return de(()=>import("./pug-DwUB-C24.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([146,147,109]),import.meta.url).then(e=>be(e.pug))}}),ue.of({name:"Puppet",extensions:["pp"],load(){return de(()=>import("./puppet-DtKzwiZ6.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([148,149]),import.meta.url).then(e=>be(e.puppet))}}),ue.of({name:"Q",extensions:["q"],load(){return de(()=>import("./q-BF1zXMdP.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([150,151]),import.meta.url).then(e=>be(e.q))}}),ue.of({name:"R",alias:["rscript"],extensions:["r","R"],load(){return de(()=>import("./r-BQiKhVSI.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([152,153]),import.meta.url).then(e=>be(e.r))}}),ue.of({name:"RPM Changes",load(){return de(()=>import("./rpm-v7UTuaHo.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([154,155]),import.meta.url).then(e=>be(e.rpmChanges))}}),ue.of({name:"RPM Spec",extensions:["spec"],load(){return de(()=>import("./rpm-v7UTuaHo.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([154,155]),import.meta.url).then(e=>be(e.rpmSpec))}}),ue.of({name:"Ruby",alias:["jruby","macruby","rake","rb","rbx"],extensions:["rb"],filename:/^(Gemfile|Rakefile)$/,load(){return de(()=>import("./ruby-Cw43FpG3.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([156,157]),import.meta.url).then(e=>be(e.ruby))}}),ue.of({name:"SAS",extensions:["sas"],load(){return de(()=>import("./sas-BIKscqlp.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([158,159]),import.meta.url).then(e=>be(e.sas))}}),ue.of({name:"Scala",extensions:["scala"],load(){return de(()=>import("./clike-BAN6KopO.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([52,53]),import.meta.url).then(e=>be(e.scala))}}),ue.of({name:"Scheme",extensions:["scm","ss"],load(){return de(()=>import("./scheme-CGic3hSV.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([160,161]),import.meta.url).then(e=>be(e.scheme))}}),ue.of({name:"Shell",alias:["bash","sh","zsh"],extensions:["sh","ksh","bash"],filename:/^PKGBUILD$/,load(){return de(()=>import("./shell-DAh545tm.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([162,163]),import.meta.url).then(e=>be(e.shell))}}),ue.of({name:"Sieve",extensions:["siv","sieve"],load(){return de(()=>import("./sieve-bGkng63-.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([164,165]),import.meta.url).then(e=>be(e.sieve))}}),ue.of({name:"Smalltalk",extensions:["st"],load(){return de(()=>import("./smalltalk-fIw53lm8.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([166,167]),import.meta.url).then(e=>be(e.smalltalk))}}),ue.of({name:"Solr",load(){return de(()=>import("./solr-CDPrSrj5.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>be(e.solr))}}),ue.of({name:"SML",extensions:["sml","sig","fun","smackspec"],load(){return de(()=>import("./mllike-DmouQ5Dp.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([94,95]),import.meta.url).then(e=>be(e.sml))}}),ue.of({name:"SPARQL",alias:["sparul"],extensions:["rq","sparql"],load(){return de(()=>import("./sparql-CHbJrAY_.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([168,169]),import.meta.url).then(e=>be(e.sparql))}}),ue.of({name:"Spreadsheet",alias:["excel","formula"],load(){return de(()=>import("./spreadsheet-BsJYzkOI.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>be(e.spreadsheet))}}),ue.of({name:"Squirrel",extensions:["nut"],load(){return de(()=>import("./clike-BAN6KopO.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([52,53]),import.meta.url).then(e=>be(e.squirrel))}}),ue.of({name:"Stylus",extensions:["styl"],load(){return de(()=>import("./stylus-3Q5WfXqT.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([170,171]),import.meta.url).then(e=>be(e.stylus))}}),ue.of({name:"Swift",extensions:["swift"],load(){return de(()=>import("./swift-MKxc2knl.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([172,173]),import.meta.url).then(e=>be(e.swift))}}),ue.of({name:"sTeX",load(){return de(()=>import("./stex-Ccczot4V.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([174,175]),import.meta.url).then(e=>be(e.stex))}}),ue.of({name:"LaTeX",alias:["tex"],extensions:["text","ltx","tex"],load(){return de(()=>import("./stex-Ccczot4V.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([174,175]),import.meta.url).then(e=>be(e.stex))}}),ue.of({name:"SystemVerilog",extensions:["v","sv","svh"],load(){return de(()=>import("./verilog-B4LUPYXy.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([176,177]),import.meta.url).then(e=>be(e.verilog))}}),ue.of({name:"Tcl",extensions:["tcl"],load(){return de(()=>import("./tcl-D3fKhQc_.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([178,179]),import.meta.url).then(e=>be(e.tcl))}}),ue.of({name:"Textile",extensions:["textile"],load(){return de(()=>import("./textile-Bi_LEJQ3.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([180,181]),import.meta.url).then(e=>be(e.textile))}}),ue.of({name:"TiddlyWiki",load(){return de(()=>import("./tiddlywiki-BiVbsin5.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>be(e.tiddlyWiki))}}),ue.of({name:"Tiki wiki",load(){return de(()=>import("./tiki-BjQr6gnj.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>be(e.tiki))}}),ue.of({name:"TOML",extensions:["toml"],load(){return de(()=>import("./toml-Dt-PBqwt.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([182,183]),import.meta.url).then(e=>be(e.toml))}}),ue.of({name:"Troff",extensions:["1","2","3","4","5","6","7","8","9"],load(){return de(()=>import("./troff-BSU-rxoD.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([184,185]),import.meta.url).then(e=>be(e.troff))}}),ue.of({name:"TTCN",extensions:["ttcn","ttcn3","ttcnpp"],load(){return de(()=>import("./ttcn-BmLjonVM.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([186,187]),import.meta.url).then(e=>be(e.ttcn))}}),ue.of({name:"TTCN_CFG",extensions:["cfg"],load(){return de(()=>import("./ttcn-cfg-TPTcP0Eh.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([188,189]),import.meta.url).then(e=>be(e.ttcnCfg))}}),ue.of({name:"Turtle",extensions:["ttl"],load(){return de(()=>import("./turtle-HafmShQq.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([190,191]),import.meta.url).then(e=>be(e.turtle))}}),ue.of({name:"Web IDL",extensions:["webidl"],load(){return de(()=>import("./webidl-DOay1zbU.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([192,193]),import.meta.url).then(e=>be(e.webIDL))}}),ue.of({name:"VB.NET",extensions:["vb"],load(){return de(()=>import("./vb-CUif5uGR.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([194,195]),import.meta.url).then(e=>be(e.vb))}}),ue.of({name:"VBScript",extensions:["vbs"],load(){return de(()=>import("./vbscript-DWVPFl59.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([196,197]),import.meta.url).then(e=>be(e.vbScript))}}),ue.of({name:"Velocity",extensions:["vtl"],load(){return de(()=>import("./velocity-BJl8UzB4.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([198,199]),import.meta.url).then(e=>be(e.velocity))}}),ue.of({name:"Verilog",extensions:["v"],load(){return de(()=>import("./verilog-B4LUPYXy.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([176,177]),import.meta.url).then(e=>be(e.verilog))}}),ue.of({name:"VHDL",extensions:["vhd","vhdl"],load(){return de(()=>import("./vhdl-C91h3ipk.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([200,201]),import.meta.url).then(e=>be(e.vhdl))}}),ue.of({name:"XQuery",extensions:["xy","xquery","xq","xqm","xqy"],load(){return de(()=>import("./xquery-Cez7jD_4.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([202,203]),import.meta.url).then(e=>be(e.xQuery))}}),ue.of({name:"Yacas",extensions:["ys"],load(){return de(()=>import("./yacas-CSQEXB_S.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([204,205]),import.meta.url).then(e=>be(e.yacas))}}),ue.of({name:"Z80",extensions:["z80"],load(){return de(()=>import("./z80-CJbYj7Wr.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([206,207]),import.meta.url).then(e=>be(e.z80))}}),ue.of({name:"MscGen",extensions:["mscgen","mscin","msc"],load(){return de(()=>import("./mscgen-BHZmHZgz.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([208,209]),import.meta.url).then(e=>be(e.mscgen))}}),ue.of({name:"X\xF9",extensions:["xu"],load(){return de(()=>import("./mscgen-BHZmHZgz.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([208,209]),import.meta.url).then(e=>be(e.xu))}}),ue.of({name:"MsGenny",extensions:["msgenny"],load(){return de(()=>import("./mscgen-BHZmHZgz.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([208,209]),import.meta.url).then(e=>be(e.msgenny))}}),ue.of({name:"Vue",extensions:["vue"],load(){return de(()=>import("./dist-BhAom09b.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([210,9,5,13,14,4,211]),import.meta.url).then(e=>e.vue())}}),ue.of({name:"Angular Template",load(){return de(()=>import("./dist-Bp45OWJJ.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([212,9,5,13,14,4]),import.meta.url).then(e=>e.angular())}})],Hb=new WeakMap,KD=/(\n|\r\n?|\u2028|\u2029)/g,QD=/^\s*/,GD=/\S/,XD=Array.prototype.slice,Ap=48,Bb=57,Wb=97,JD=102,Ub=65,YD=70;qc=function(e){if(typeof e=="string")return Gb([e])[0];if(typeof e=="function")return function(){let i=XD.call(arguments);return i[0]=Qb(i[0]),e.apply(this,i)};let t=Qb(e),n=Kb(t,0);for(let i=1;i<t.length;i++)n+=arguments[i]+Kb(t,i);return n};function Kb(e,t){let n=e[t];if(n===void 0)throw TypeError(`invalid cooked string at index ${t}`);return n}function Qb(e){let t=Hb.get(e);if(t)return t;let n=Gb(e.raw),i=n.map(eR);return Object.defineProperty(i,"raw",{value:Object.freeze(n)}),Object.freeze(i),Hb.set(e,i),i}function Gb(e){let t=e.map(o=>o.split(KD)),n;for(let o=0;o<t.length;o++){let l=t[o],u=o===0,d=o+1===t.length;if(u){if(l.length===1||l[0].length>0)throw Error("invalid content on opening line");l[1]=""}if(d){if(l.length===1||GD.test(l[l.length-1]))throw Error("invalid content on closing line");l[l.length-2]="",l[l.length-1]=""}for(let p=2;p<l.length;p+=2){let g=l[p],w=p+1===l.length&&!d,x=QD.exec(g)[0];if(!w&&x.length===g.length){l[p]="";continue}n=ZD(x,n)}}let i=n?n.length:0;return t.map(o=>{let l=o[0];for(let u=1;u<o.length;u+=2){let d=o[u],p=o[u+1];l+=d+p.slice(i)}return l})}function ZD(e,t){if(t===void 0||e===t)return e;let n=0;for(let i=Math.min(e.length,t.length);n<i&&e[n]===t[n];n++);return e.slice(0,n)}function eR(e){let t="",n=0,i=0;for(;(i=e.indexOf("\\",i))>-1;){if(t+=e.slice(n,i),++i===e.length)return;let o=e[i++];switch(o){case"b":t+="\b";break;case"t":t+=" ";break;case"n":t+=`
|
|
68
|
+
""", engine=${i})`}return`_df = mo.sql(f'SELECT "${t}" FROM ${e.name} LIMIT 100')`},HE=function(e,t){if(t==="date"||t==="datetime"||t==="time"){if(e==="min")return"Earliest";if(e==="max")return"Latest"}return e};function kD(){return{tables:[],expandedTables:new Set,expandedColumns:new Set,columnsPreviews:new Map}}var{reducer:$6,createActions:V6,valueAtom:Eb,useActions:CD}=Ys(kD,{addDatasets:(e,t)=>{let{previewDatasetColumn:n}=Sr();for(let d of t.tables)for(let p of d.columns){let g=`${d.name}:${p.name}`;e.expandedColumns.has(g)&&n({tableName:d.name,columnName:p.name,source:d.source,sourceType:d.source_type})}let i=e.tables;t.clear_channel&&(i=i.filter(d=>d.source!==t.clear_channel));let o=[...t.tables,...i],l=new Set,u=o.filter(d=>{let p=`${d.name}:${d.source}`;return l.has(p)?!1:(l.add(p),!0)}).toSorted((d,p)=>d.name.localeCompare(p.name));return{...e,tables:u}},filterDatasetsFromVariables:(e,t)=>{let n=new Set(t),i=e.tables.filter(o=>o.variable_name?n.has(o.variable_name):!0);return{...e,tables:i}},toggleTable:(e,t)=>{let n=new Set(e.expandedTables);return n.has(t)?n.delete(t):n.add(t),{...e,expandedTables:n}},toggleColumn:(e,t)=>{let n=`${t.table}:${t.column}`,i=new Set(e.expandedColumns);return i.has(n)?i.delete(n):i.add(n),{...e,expandedColumns:i}},closeAllColumns:e=>({...e,expandedColumns:new Set}),addColumnPreview:(e,t)=>{let n=`${t.table_name}:${t.column_name}`,i=new Map(e.columnsPreviews);return i.set(n,t),{...e,columnsPreviews:i}}});jE=()=>$n(Eb),Of=Ne(e=>e(Eb).tables),nT=Ne(new Set),cT=Ne(!1),hE=function(){return CD()};var SD=new Map([[aa,{name:aa,dialect:"duckdb",source:"duckdb",display_name:"DuckDB (In-Memory)",databases:[]}]]);function uu(e,t,n){if(t.length===0)return e;let[i,...o]=t;return e.map(l=>l.name===i?o.length===0?n(l):{...l,child_schemas:uu(l.child_schemas??[],o,n)}:l)}function Tb(e){let{schemaPath:t,schema:n}=e;return t&&t.length>0?t:[n]}function ED(){return{latestEngineSelected:aa,connectionsMap:SD}}let TD,DD;({reducer:TD,createActions:DD,valueAtom:Ho,useActions:DE}=Ys(ED,{addDataSourceConnection:(e,t)=>{if(t.connections.length===0)return e;let{latestEngineSelected:n,connectionsMap:i}=e,o=new Map(i);for(let l of t.connections)o.set(l.name,l);return{latestEngineSelected:n,connectionsMap:o}},filterDataSourcesFromVariables:(e,t)=>{let{latestEngineSelected:n,connectionsMap:i}=e,o=new Set(t),l=new Map([...i].filter(([u])=>ia.has(u)?!0:o.has(u)));return{latestEngineSelected:l.has(n)?n:aa,connectionsMap:l}},clearDataSourceConnections:()=>({latestEngineSelected:aa,connectionsMap:new Map}),removeDataSourceConnection:(e,t)=>{let{latestEngineSelected:n,connectionsMap:i}=e,o=new Map(i);return o.delete(t),{latestEngineSelected:o.has(n)?n:aa,connectionsMap:o}},addSchemaList:(e,t)=>{let{schemas:n,sqlSchemaContext:i}=t,{connectionsMap:o,latestEngineSelected:l}=e,u=i.engine,d=o.get(u);if(!d)return e;let p=i.schemaPath??[],g=new Map(o),w={...d,databases:d.databases.map(x=>x.name===i.database?p.length===0?{...x,schemas:n,schemas_resolved:!0}:{...x,schemas:uu(x.schemas,p,S=>({...S,child_schemas:n,child_schemas_resolved:!0}))}:x)};return g.set(u,w),{latestEngineSelected:l,connectionsMap:g}},addTableList:(e,t)=>{let{tables:n,sqlTableContext:i}=t,{connectionsMap:o,latestEngineSelected:l}=e,u=i.engine,d=o.get(u);if(!d)return e;let p=Tb(i),g=new Map(o),w={...d,databases:d.databases.map(x=>x.name===i.database?{...x,schemas:uu(x.schemas,p,S=>({...S,tables:n,tables_resolved:!0}))}:x)};return g.set(u,w),{latestEngineSelected:l,connectionsMap:g}},addTable:(e,t)=>{let{table:n,sqlTableContext:i}=t,{connectionsMap:o,latestEngineSelected:l}=e,u=i.engine,d=n.name,p=o.get(u);if(!p)return e;let g=Tb(i),w=new Map(o),x={...p,databases:p.databases.map(S=>S.name===i.database?{...S,schemas:uu(S.schemas,g,E=>{let T=E.tables.length===0?[n]:E.tables.map(O=>O.name===d?n:O);return{...E,tables:T}})}:S)};return w.set(u,x),{latestEngineSelected:l,connectionsMap:w}}})),Lc=Ne(e=>e(Ho).connectionsMap),lE=Ne(e=>{let t=new Map(e(Lc));for(let n of ia){let i=t.get(n);i&&(i.databases.length===0&&t.delete(n),i.databases.length===1&&i.databases[0].name==="memory"&&i.databases[0].schemas.length===0&&t.delete(n))}return a6([...t.values()],n=>ia.has(n.name)?1:0)});function Db(e){let t=Me.get(Ho);t.connectionsMap.has(e)&&Me.set(Ho,{...t,latestEngineSelected:e})}cE=Ne(e=>{let t=Me.get(Of),n=e(Ho).connectionsMap,i=new Map;for(let o of t)i.set(o.name,o);for(let o of n.values())for(let l of o.databases){let u=l.name===o.default_database||o.databases.length===1,d=(p,g)=>{let w=g.length===0,x=g.length===1&&g[0]===o.default_schema,S=g.join(".");for(let E of p.tables){let T;if(T=E.name,w){T=u?E.name:`${l.name}.${E.name}`,i.has(T)?Se.warn(`Table name collision for ${T}. Skipping.`):i.set(T,E);continue}if(u&&x&&!i.has(T)){i.set(T,E);continue}if(T=`${S}.${E.name}`,u&&!i.has(T)){i.set(T,E);continue}T=`${l.name}.${S}.${E.name}`,i.has(T)?Se.warn(`Table name collision for ${T}. Skipping.`):i.set(T,E)}for(let E of p.child_schemas??[])d(E,[...g,E.name])};for(let p of l.schemas)d(p,qc(p.name)?[]:[p.name])}return i}),gS=function(e){return e.variable_name?"dataframe":"table"};let du,Dp,Rb,Ib,Ab,Rp,Lb;du=class{constructor(e,t={}){pe(this,"cache",new Map);this.maxSize=e,this.options=t}getOrCreate(e){Vn(this.options.create,"create function is required");let t=this.cache.get(e);if(t!==void 0)return t;let n=this.options.create(e);return this.cache.set(e,n),n}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 n=this.cache.keys().next().value;n!==void 0&&this.cache.delete(n)}}keys(){return this.cache.keys()}values(){return this.cache.values()}entries(){return this.cache.entries()}delete(e){this.cache.delete(e)}},t0=kt("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"}]]),ty=kt("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"}]]),n0=kt("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"}]]),Gg=kt("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"}]]),k0=kt("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"}]]),Dp=kt("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"}]]),y0=kt("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"}]]),Jg=kt("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"}]]),w0=kt("clock",[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]),Rb=kt("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"}]]),Hg=kt("columns-2",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]]),sl=kt("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"}]]),gf=kt("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"}]]),i0=kt("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"}]]),Ib=kt("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"}]]),df=kt("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]),Ab=kt("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"}]]),Vo=kt("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"}]]),u0=kt("map-pin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]),l0=kt("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]),o0=kt("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"}]]),V0=kt("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"}]]),Vg=kt("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"}]]),W0=kt("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"}]]),Rp=kt("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"}]]),Lb=kt("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"}]]),c0=kt("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"}]]),Fo=kt("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"}]]),Wg=kt("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"}]]),m0=kt("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"}]]),Fc=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 Pb(e){let[t,n]=e.split(" ");return n?`${Fc(t)} ${n}`:Fc(e)}$c={boolean:C6,date:S6,time:w0,datetime:Dp,temporal:Dp,number:Mg,string:E6,integer:Mg,geometry:u0,unknown:k0},af=function(e){return Object.hasOwn($c,e)?e:"unknown"},JS=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"geometry":return"bg-(--cyan-4) dark:bg-(--cyan-5)";case"unknown":return"bg-(--slate-4) dark:bg-(--slate-6)";default:return Zs(e),"bg-(--slate-4) dark:bg-(--slate-6)"}};let bl,Ob,Ip,Mb;Ya=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`}},wE=class IT{constructor(t){this.words=t}static of(...t){return new IT(t.map(n=>typeof n=="string"?new Ya(n):n))}join(t,n){return this.words.map(i=>i.pluralize(n)).join(t)}},bl=kr(),Ob=5,Ip={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)",geometry:"bg-(--cyan-4) text-(--cyan-11)",unknown:"bg-(--slate-4) text-(--slate-11)"},Mb={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)"},Ko="p-3 min-w-[250px] flex flex-col divide-y";var RD=new Ya("column","columns"),ID=new Ya("row","rows"),AD=new Ya("schema","schemas"),LD=new Ya("table","tables"),PD=new Ya("database","databases");Wo=e=>{let t=(0,bl.c)(6),{icon:n,title:i,badge:o}=e,l;t[0]===i?l=t[1]:(l=(0,M.jsx)("h3",{className:"font-semibold text-sm",children:i}),t[0]=i,t[1]=l);let u;return t[2]!==o||t[3]!==n||t[4]!==l?(u=(0,M.jsxs)("div",{className:"flex items-center gap-2 pb-2",children:[n,l,o]}),t[2]=o,t[3]=n,t[4]=l,t[5]=u):u=t[5],u},ui=e=>{let t=(0,bl.c)(5),{label:n,value:i}=e,o;t[0]===n?o=t[1]:(o=(0,M.jsxs)("span",{className:"text-(--slate-11)",children:[n,":"]}),t[0]=n,t[1]=o);let l;return t[2]!==o||t[3]!==i?(l=(0,M.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[o,i]}),t[2]=o,t[3]=i,t[4]=l):l=t[4],l};var ts=e=>{let t=(0,bl.c)(5),{icon:n,text:i}=e,o;t[0]===i?o=t[1]:(o=(0,M.jsx)("span",{className:"text-xs text-(--slate-11)",children:i}),t[0]=i,t[1]=o);let l;return t[2]!==n||t[3]!==o?(l=(0,M.jsxs)("div",{className:"flex items-center gap-1",children:[n,o]}),t[2]=n,t[3]=o,t[4]=l):l=t[4],l},ha=e=>{let t=(0,bl.c)(15),{title:n,items:i,totalCount:o,limit:l}=e,u=n===void 0?"":n,d=l===void 0?Ob:l;if(i.length===0)return null;let p;t[0]!==i||t[1]!==d?(p=i.slice(0,d),t[0]=i,t[1]=d,t[2]=p):p=t[2];let g=p,w=o>d,x;t[3]===u?x=t[4]:(x=u&&(0,M.jsxs)("h4",{className:"text-xs font-medium text-(--slate-11) mb-2",children:[u,":"]}),t[3]=u,t[4]=x);let S;t[5]!==w||t[6]!==d||t[7]!==o?(S=w&&(0,M.jsxs)("div",{className:"text-xs text-(--slate-10) text-center py-1",children:["... and ",o-d," more"]}),t[5]=w,t[6]=d,t[7]=o,t[8]=S):S=t[8];let E;t[9]!==S||t[10]!==g?(E=(0,M.jsxs)("div",{className:"flex flex-col gap-1 overflow-y-auto",children:[g,S]}),t[9]=S,t[10]=g,t[11]=E):E=t[11];let T;return t[12]!==x||t[13]!==E?(T=(0,M.jsxs)("div",{className:"py-2",children:[x,E]}),t[12]=x,t[13]=E,t[14]=T):T=t[14],T},Nb=e=>Ip[e]||Ip.unknown;let jb,qb,zb;sy=e=>{var u,d;let t=e.type==="view"?(0,M.jsx)(gf,{className:"w-4 h-4 text-(--blue-9)"}):(0,M.jsx)(Fo,{className:"w-4 h-4 text-(--green-9)"}),n=(0,M.jsx)(Er,{variant:"secondary",className:`text-xs ${e.type==="view"?"bg-(--blue-4) text-(--blue-11)":"bg-(--green-4) text-(--green-11)"}`,children:e.type}),i=e.columns.map(p=>{let g=$c[af(p.type)];return(0,M.jsxs)("div",{className:"flex items-center justify-between text-xs rounded",children:[(0,M.jsxs)("div",{className:"flex items-center gap-2",children:[(0,M.jsx)(g,{className:"w-3 h-3 text-(--slate-9)"}),(0,M.jsx)("span",{className:"font-mono",children:p.name})]}),(0,M.jsx)(Er,{variant:"outline",className:`text-xs ${Nb(p.type)}`,children:p.type})]},p.name)}),o=e.primary_keys&&e.primary_keys.length>0,l=e.indexes&&e.indexes.length>0;return(0,M.jsxs)("div",{className:`${Ko} min-w-[300px]`,children:[(0,M.jsx)(Wo,{icon:t,title:e.name,badge:n}),(0,M.jsxs)("div",{className:"flex flex-col gap-2 py-2",children:[(0,M.jsx)(ui,{label:"Source",value:(0,M.jsx)(Er,{variant:"outline",className:`text-xs ${Mb[e.source_type]}`,children:e.source})}),e.variable_name&&(0,M.jsx)(ui,{label:"Variable",value:(0,M.jsx)("code",{className:"text-xs bg-(--slate-4) px-1 rounded",children:e.variable_name})}),e.engine&&(0,M.jsx)(ui,{label:"Engine",value:(0,M.jsx)("code",{className:"text-xs bg-(--slate-4) px-1 rounded",children:e.engine})})]}),(e.num_columns!=null||e.num_rows!=null)&&(0,M.jsxs)("div",{className:"grid grid-cols-2 gap-2 py-2",children:[e.num_columns!=null&&(0,M.jsx)(ts,{icon:(0,M.jsx)(Hg,{className:"w-3 h-3 text-(--slate-9)"}),text:`${e.num_columns} ${RD.pluralize(e.num_columns)}`}),e.num_rows!=null&&(0,M.jsx)(ts,{icon:(0,M.jsx)(Mg,{className:"w-3 h-3 text-(--slate-9)"}),text:`${e.num_rows} ${ID.pluralize(e.num_rows)}`})]}),e.columns.length===0&&Pc("column"),(o||l)&&(0,M.jsxs)("div",{className:"flex flex-col gap-2 py-2",children:[o&&(0,M.jsxs)("div",{className:"flex flex-row gap-1",children:[(0,M.jsxs)("div",{className:"flex items-center gap-1",children:[(0,M.jsx)(L6,{className:"w-3 h-3 text-(--amber-9)"}),(0,M.jsx)("span",{className:"text-xs font-medium text-(--slate-11)",children:"Primary Keys:"})]}),(u=e.primary_keys)==null?void 0:u.map(p=>(0,M.jsx)(Er,{variant:"outline",className:"text-xs text-(--slate-11)",children:p},p))]}),l&&(0,M.jsxs)("div",{className:"flex flex-row gap-1",children:[(0,M.jsxs)("div",{className:"flex items-center gap-1 mb-1",children:[(0,M.jsx)(ty,{className:"w-3 h-3 text-(--purple-9)"}),(0,M.jsx)("span",{className:"text-xs font-medium text-(--slate-11)",children:"Indexes:"})]}),(d=e.indexes)==null?void 0:d.map(p=>(0,M.jsx)(Er,{variant:"outline",className:"text-xs text-(--slate-11)",children:p},p))]})]}),e.columns.length>0&&(0,M.jsx)(ha,{items:i,totalCount:e.columns.length})]})},jb=e=>{var o;let t=$c[af(e.type)],n=(0,M.jsx)(Er,{variant:"outline",className:`text-xs ${Nb(e.type)}`,children:e.type}),i=((o=e.sample_values)==null?void 0:o.map((l,u)=>(0,M.jsx)("div",{className:"text-xs bg-(--slate-3) rounded font-mono",children:l==null?"null":String(l)},u)))||[];return(0,M.jsxs)("div",{className:Ko,children:[(0,M.jsx)(Wo,{icon:(0,M.jsx)(t,{className:"w-4 h-4 text-(--slate-9)"}),title:e.name,badge:n}),(0,M.jsxs)("div",{className:"flex flex-col gap-2 mt-2",children:[(0,M.jsx)(ui,{label:"Type",value:(0,M.jsx)("span",{className:"font-medium",children:e.type})}),(0,M.jsx)(ui,{label:"External Type",value:(0,M.jsx)("code",{className:"text-xs bg-(--slate-4) px-1 rounded",children:e.external_type})})]}),e.sample_values&&e.sample_values.length>0&&(0,M.jsx)(ha,{title:"Sample Values",items:i,totalCount:e.sample_values.length})]})},qb=e=>{let t=(0,M.jsx)(Er,{variant:"outline",className:"text-xs bg-(--blue-4) text-(--blue-11)",children:e.dialect}),n=e.schemas.map(i=>(0,M.jsxs)("div",{className:"flex items-center justify-between text-xs rounded hover:bg-(--slate-3)",children:[(0,M.jsxs)("div",{className:"flex items-center gap-2",children:[(0,M.jsx)(Vo,{className:"w-3 h-3 text-(--slate-9)"}),(0,M.jsx)("span",{children:i.name})]}),(0,M.jsxs)(Er,{variant:"outline",className:"text-xs",children:[i.tables.length," ",LD.pluralize(i.tables.length)]})]},i.name));return(0,M.jsxs)("div",{className:Ko,children:[(0,M.jsx)(Wo,{icon:(0,M.jsx)(sl,{className:"w-4 h-4 text-(--blue-9)"}),title:e.name,badge:t}),(0,M.jsxs)("div",{className:"flex flex-col gap-2 py-2",children:[(0,M.jsx)(ui,{label:"Dialect",value:(0,M.jsx)("span",{className:"font-medium",children:e.dialect})}),e.engine&&(0,M.jsx)(ui,{label:"Engine",value:(0,M.jsx)("code",{className:"text-xs bg-(--slate-4) px-1 rounded",children:e.engine})})]}),(0,M.jsx)("div",{className:"py-2",children:(0,M.jsx)(ts,{icon:(0,M.jsx)(Vo,{className:"w-3 h-3 text-(--slate-9)"}),text:`${e.schemas.length} schema${e.schemas.length===1?"":"s"}`})}),e.schemas.length===0&&Pc("schema"),e.schemas.length>0&&(0,M.jsx)(ha,{title:"Schemas",items:n,totalCount:e.schemas.length})]})},zb=e=>{let t=(0,M.jsx)(Er,{variant:"outline",className:"text-xs bg-(--green-4) text-(--green-11)",children:"Schema"}),n=e.tables.map(i=>(0,M.jsxs)("div",{className:"flex items-center justify-between text-xs rounded hover:bg-(--slate-3)",children:[(0,M.jsxs)("div",{className:"flex items-center gap-2",children:[i.type==="view"?(0,M.jsx)(gf,{className:"w-3 h-3 text-(--blue-9)"}):(0,M.jsx)(Fo,{className:"w-3 h-3 text-(--green-9)"}),(0,M.jsx)("span",{children:i.name})]}),(0,M.jsx)(Er,{variant:"outline",className:`text-xs ${i.type==="view"?"bg-(--blue-4) text-(--blue-11)":"bg-(--green-4) text-(--green-11)"}`,children:i.type})]},i.name));return(0,M.jsxs)("div",{className:Ko,children:[(0,M.jsx)(Wo,{icon:(0,M.jsx)(Vo,{className:"w-4 h-4 text-(--green-9)"}),title:e.name,badge:t}),(0,M.jsx)("div",{className:"py-2",children:(0,M.jsx)(ts,{icon:(0,M.jsx)(Fo,{className:"w-3 h-3 text-(--slate-9)"}),text:`${e.tables.length} table${e.tables.length===1?"":"s"}`})}),e.tables.length===0&&Pc("table"),e.tables.length>0&&(0,M.jsx)(ha,{title:"Tables",items:n,totalCount:e.tables.length})]})};var Fb=(0,M.jsx)(Er,{variant:"outline",children:"default"}),OD=8,$b=3;OE=(e,t)=>{let n=e.databases.length,i=e.databases.reduce((p,g)=>p+g.schemas.length,0),o=(p,g)=>{if(p.tables.length===0)return null;let w=p.name===e.default_schema&&g,x=[];return i<OD&&(x=p.tables.slice(0,$b+1).map(S=>(0,M.jsxs)("div",{className:"flex items-center gap-2 ml-4",children:[(0,M.jsx)(Fo,{className:"w-3 h-3 text-(--green-9)"}),(0,M.jsx)("span",{className:"text-xs",children:S.name})]},S.name))),(0,M.jsxs)("div",{children:[(0,M.jsxs)("div",{className:"flex items-center gap-2 text-xs rounded hover:bg-(--slate-3) ml-2",children:[(0,M.jsx)(Vo,{className:"w-3 h-3 text-(--slate-9)"}),(0,M.jsx)("span",{children:p.name}),w&&Fb,(0,M.jsxs)(Er,{variant:"outline",className:"text-xs ml-auto",children:[p.tables.length," tables"]})]}),(0,M.jsx)(ha,{items:x,totalCount:p.tables.length,limit:$b})]},p.name)},l=e.databases.map(p=>{let g=p.name===e.default_database||e.databases.length===1,w=p.schemas.map(x=>o(x,g));return(0,M.jsxs)("div",{children:[(0,M.jsxs)("div",{className:"flex items-center gap-2",children:[(0,M.jsx)(sl,{className:"w-3 h-3 text-(--blue-9)"}),(0,M.jsx)("span",{className:"text-xs",children:p.name}),g&&Fb]}),w&&(0,M.jsx)(ha,{items:w,totalCount:p.schemas.length})]},p.name)}),u=e.name;ia.has(e.name)&&(u="In-Memory");let d=t==null?void 0:t.map(p=>(0,M.jsxs)("div",{className:"flex items-center gap-2",children:[(0,M.jsx)(Fo,{className:"w-3 h-3 text-(--blue-9)"}),(0,M.jsx)("span",{className:"text-xs",children:p.name})]},p.name));return(0,M.jsxs)("div",{className:`${Ko} px-1`,children:[(0,M.jsx)(Wo,{icon:(0,M.jsx)(Rb,{className:"w-4 h-4 text-(--purple-9)"}),title:u}),(0,M.jsxs)("div",{className:"flex flex-col gap-2 py-2",children:[(0,M.jsx)(ui,{label:"Dialect",value:(0,M.jsx)("span",{className:"font-medium",children:Fc(e.dialect)})}),(0,M.jsx)(ui,{label:"Source",value:(0,M.jsx)(Er,{variant:"outline",className:"text-xs bg-(--green-4) text-(--green-11)",children:e.source})})]}),(0,M.jsxs)("div",{className:"flex flex-row justify-between py-2",children:[(0,M.jsx)(ts,{icon:(0,M.jsx)(sl,{className:"w-3 h-3 text-(--slate-9)"}),text:`${n} ${PD.pluralize(n)}`}),(0,M.jsx)(ts,{icon:(0,M.jsx)(Vo,{className:"w-3 h-3 text-(--slate-9)"}),text:`${i} ${AD.pluralize(i)}`})]}),n>0&&(0,M.jsx)(ha,{items:l,totalCount:n}),d&&d.length>0&&(0,M.jsx)(ha,{title:"Dataframes",items:d,totalCount:d.length})]})},Pc=e=>(0,M.jsxs)("div",{className:"flex items-start gap-2 mt-3",children:[(0,M.jsx)(df,{size:10,className:"mt-1 text-(--slate-10) shrink-0"}),(0,M.jsxs)("span",{className:"text-xs text-(--slate-11)",children:["No ",e," information available.",`
|
|
69
|
+
`,(0,M.jsx)("span",{className:"text-(--blue-10)",children:"Introspect to see more details."})]})]});var fu=yf(),Vb=class{constructor(){pe(this,"schema",{})}addTable(e,t){let n={self:ND({table:t}),children:t.columns.map(i=>MD({column:i}))};return this.setAt([...e,t.name],n),this}addSchema(e,t){let n={self:jD({namespace:t,path:e}),children:{}};return this.setAt(e,n),this}addDatabase(e,t){let n={self:qD({namespace:t,path:e}),children:{}};return this.setAt(e,n),this}setAt(e,t){let n=this.schema;for(let i of e.slice(0,-1))n[i]||(n[i]={children:{}}),n=n[i].children;n[e[e.length-1]]=t}build(){return this.schema}reset(){return this.schema={},this}};function MD(e){return{label:e.column.name,type:"column",info:()=>{let t=document.createElement("div");return(0,fu.createRoot)(t).render(jb(e.column)),{dom:t}}}}function ND(e){return{label:e.table.name,type:"table",info:()=>{let t=document.createElement("div");return(0,fu.createRoot)(t).render(sy(e.table)),{dom:t}}}}function jD(e){return{label:e.namespace.name,detail:e.path.join("."),type:"schema",info:()=>{let t=document.createElement("div");return(0,fu.createRoot)(t).render(zb(e.namespace)),{dom:t}}}}function qD(e){return{label:e.namespace.name,detail:e.path.join("."),type:"database",info:()=>{let t=document.createElement("div");return(0,fu.createRoot)(t).render(qb(e.namespace)),{dom:t}}}}var zD=Ne(e=>{let t=e(Of),n=new Vb;for(let i of t)n.addTable([],i);return n.build()}),FD=class{constructor(){this.cache=new du(10,{create:e=>this.getConnectionSchema(e)})}getConnection(e){return Me.get(Lc).get(e)}getConnectionSchema(e){var u,d;let{default_database:t,databases:n,default_schema:i}=e,o=new Vb,l=n.find(p=>p.name===t||n.length===1);if(((u=l??n[0])==null?void 0:u.schemas.some(p=>qc(p.name)))??!1){for(let p of n){let g=p.name===(l==null?void 0:l.name),w=p.schemas.flatMap(x=>x.tables);o.addDatabase([p.name],p);for(let x of w)g?o.addTable([],x):o.addTable([p.name],x)}return{shouldAddLocalTables:!1,schema:o.build(),defaultSchema:l==null?void 0:l.name}}if(l)for(let p of l.schemas){o.addSchema([p.name],p);for(let g of p.tables)o.addTable([p.name],g)}for(let p of n){o.addDatabase([p.name],p);for(let g of p.schemas){o.addSchema([p.name,g.name],g);for(let w of g.tables)o.addTable([p.name,g.name],w)}}return{shouldAddLocalTables:!0,schema:o.build(),defaultSchema:i??((l==null?void 0:l.schemas.length)===1?(d=l.schemas[0])==null?void 0:d.name:void 0)}}getInternalDialect(e){let t=this.getConnection(e);return t?t.dialect.toLowerCase():null}getDialect(e){let t=this.getConnection(e);return t?Sb(t):yl}getCompletionSource(e){let t=this.getConnection(e);if(!t)return null;let n=()=>Me.get(zD),i=this.cache.getOrCreate(t);return{dialect:Sb(t),schema:i.shouldAddLocalTables?{...i.schema,...n()}:i.schema,defaultSchema:i.defaultSchema,defaultTable:$D(t)}}};function $D(e){if(e.databases.length!==1)return;let t=e.databases[0];if(t.schemas.length!==1)return;let n=t.schemas[0];if(n.tables.length===1)return n.tables[0].name}const ro=new FD,wl=sr.define();Tf=async function(e){let{sendFormat:t}=Sr(),n=ki.mapValues(e,o=>ci(o)),i=await t({codes:n,lineLength:qC().formatting.line_length});for(let[o,l]of ki.entries(i.codes)){let u=o,d=n[u],p=e[u];p&&l!==d&&(p.state.facet(Lt).updateCellCode({cellId:u,code:l,formattingChange:!0}),Bo(p,l))}},SE=function(){return Tf(p0(Lf()))};async function VD(e,t){let{formatDialect:n}=await de(async()=>{let{formatDialect:x}=await import("./esm-BKF5e2-i.js").then(async S=>(await S.__tla,S));return{formatDialect:x}},__vite__mapDeps([0,1]),import.meta.url),i=await HD(ro.getInternalDialect(t)),o=e.state.field(Ir),l=D5(e.state);if(o.type!=="sql"){Se.error("Language adapter is not SQL");return}let u=e.state.doc.toString(),d;try{d=n(u,{dialect:i,tabWidth:l,useTabs:!1})}catch(x){Se.error("Error formatting SQL",{error:x});return}let p=o.transformIn(d)[0],g=e.state.facet(Lt),w=e.state.facet(lu);g.updateCellCode({cellId:w,code:p,formattingChange:!0}),uf(e,d,{effects:[wl.of(!0)]})}async function HD(e){let{bigquery:t,db2:n,db2i:i,duckdb:o,hive:l,mariadb:u,mysql:d,tidb:p,n1ql:g,plsql:w,postgresql:x,redshift:S,spark:E,sqlite:T,sql:O,trino:j,transactsql:z,singlestoredb:V,snowflake:P}=await de(async()=>{let{bigquery:me,db2:$,db2i:W,duckdb:ae,hive:xe,mariadb:_e,mysql:Te,tidb:Z,n1ql:Q,plsql:Y,postgresql:ce,redshift:te,spark:he,sqlite:G,sql:je,trino:qe,transactsql:Qe,singlestoredb:He,snowflake:Fe}=await import("./esm-BKF5e2-i.js").then(async Oe=>(await Oe.__tla,Oe));return{bigquery:me,db2:$,db2i:W,duckdb:ae,hive:xe,mariadb:_e,mysql:Te,tidb:Z,n1ql:Q,plsql:Y,postgresql:ce,redshift:te,spark:he,sqlite:G,sql:je,trino:qe,transactsql:Qe,singlestoredb:He,snowflake:Fe}},__vite__mapDeps([0,1]),import.meta.url),U=O;if(!e||!cu(e))return U;switch(e){case"mysql":return d;case"mariadb":return u;case"postgres":case"postgresql":return x;case"sqlite":return T;case"db2":return n;case"db2i":return i;case"hive":return l;case"redshift":return S;case"snowflake":return P;case"trino":return j;case"tidb":return p;case"oracle":case"oracledb":return w;case"spark":return E;case"singlestoredb":return V;case"couchbase":return g;case"bigquery":return t;case"duckdb":return o;case"mssql":case"sqlserver":case"microsoft sql server":return z;case"athena":case"awsathena":case"cassandra":case"noql":case"flink":case"mongodb":case"timescaledb":case"datafusion":case"dremio":return O;case"databricks":return E;default:return Zs(e),U}}var BD=yf();function WD(e,t){let n=document.createElement("div"),i;return{dom:n,mount(){i=(0,BD.createRoot)(n),i.render((0,M.jsx)(AC,{store:Me,children:(0,M.jsx)(t,{view:e})}))},update(){i==null||i.render((0,M.jsx)(AC,{store:Me,children:(0,M.jsx)(t,{view:e})}))},destroy(){i==null||i.unmount()}}}function be(e){return new rS(eS.define(e))}function ga(e){return de(()=>import("./dist-oo7CUTL2.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 UD=[ue.of({name:"C",extensions:["c","h","ino"],load(){return de(()=>import("./dist-CULUasdr.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([6,7,5]),import.meta.url).then(e=>e.cpp())}}),ue.of({name:"C++",alias:["cpp"],extensions:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],load(){return de(()=>import("./dist-CULUasdr.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([6,7,5]),import.meta.url).then(e=>e.cpp())}}),ue.of({name:"CQL",alias:["cassandra"],extensions:["cql"],load(){return ga("Cassandra")}}),ue.of({name:"CSS",extensions:["css"],load(){return de(()=>import("./dist-DAd7fvc1.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([8,9,5]),import.meta.url).then(e=>e.css())}}),ue.of({name:"Go",extensions:["go"],load(){return de(()=>import("./dist-ziD6OB9m.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([10,11,4,5]),import.meta.url).then(e=>e.go())}}),ue.of({name:"HTML",alias:["xhtml"],extensions:["html","htm","handlebars","hbs"],load(){return de(()=>import("./dist-BC6HNlDy.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([12,9,5,13,14,4]),import.meta.url).then(e=>e.html())}}),ue.of({name:"Java",extensions:["java"],load(){return de(()=>import("./dist-e3TiiDdA.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([15,16,5]),import.meta.url).then(e=>e.java())}}),ue.of({name:"JavaScript",alias:["ecmascript","js","node"],extensions:["js","mjs","cjs"],load(){return de(()=>import("./dist-Bwzs3Vpo.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([17,14,4,5]),import.meta.url).then(e=>e.javascript())}}),ue.of({name:"Jinja",extensions:["j2","jinja","jinja2"],load(){return de(()=>import("./dist-BIoV7ItK.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([18,9,5,13,14,4,19]),import.meta.url).then(e=>e.jinja())}}),ue.of({name:"JSON",alias:["json5"],extensions:["json","map"],load(){return de(()=>import("./dist-BKZjRJh7.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([20,21,5]),import.meta.url).then(e=>e.json())}}),ue.of({name:"JSX",extensions:["jsx"],load(){return de(()=>import("./dist-Bwzs3Vpo.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([17,14,4,5]),import.meta.url).then(e=>e.javascript({jsx:!0}))}}),ue.of({name:"LESS",extensions:["less"],load(){return de(()=>import("./dist-BrBdlR-1.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([22,9,5,23]),import.meta.url).then(e=>e.less())}}),ue.of({name:"Liquid",extensions:["liquid"],load(){return de(()=>import("./dist-BB2m_pT9.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([24,9,5,13,14,4,25]),import.meta.url).then(e=>e.liquid())}}),ue.of({name:"MariaDB SQL",load(){return ga("MariaSQL")}}),ue.of({name:"Markdown",extensions:["md","markdown","mkd"],load(){return de(()=>import("./dist-qxqSCe2K.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([26,9,5,13,14,4,27]),import.meta.url).then(e=>e.markdown())}}),ue.of({name:"MS SQL",load(){return ga("MSSQL")}}),ue.of({name:"MySQL",load(){return ga("MySQL")}}),ue.of({name:"PHP",extensions:["php","php3","php4","php5","php7","phtml"],load(){return de(()=>import("./dist-gKSpDGw2.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([28,9,5,13,14,4,29]),import.meta.url).then(e=>e.php())}}),ue.of({name:"PLSQL",extensions:["pls"],load(){return ga("PLSQL")}}),ue.of({name:"PostgreSQL",load(){return ga("PostgreSQL")}}),ue.of({name:"Python",extensions:["BUILD","bzl","py","pyw"],filename:/^(BUCK|BUILD)$/,load(){return de(()=>import("./dist-D1BB6_s_.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([30,31,4,5]),import.meta.url).then(e=>e.python())}}),ue.of({name:"Rust",extensions:["rs"],load(){return de(()=>import("./dist-2VJQDijP.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([32,33,5]),import.meta.url).then(e=>e.rust())}}),ue.of({name:"Sass",extensions:["sass"],load(){return de(()=>import("./dist-URSEPeIQ.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([34,9,5,35]),import.meta.url).then(e=>e.sass({indented:!0}))}}),ue.of({name:"SCSS",extensions:["scss"],load(){return de(()=>import("./dist-URSEPeIQ.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([34,9,5,35]),import.meta.url).then(e=>e.sass())}}),ue.of({name:"SQL",extensions:["sql"],load(){return ga("StandardSQL")}}),ue.of({name:"SQLite",load(){return ga("SQLite")}}),ue.of({name:"TSX",extensions:["tsx"],load(){return de(()=>import("./dist-Bwzs3Vpo.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}))}}),ue.of({name:"TypeScript",alias:["ts"],extensions:["ts","mts","cts"],load(){return de(()=>import("./dist-Bwzs3Vpo.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([17,14,4,5]),import.meta.url).then(e=>e.javascript({typescript:!0}))}}),ue.of({name:"WebAssembly",extensions:["wat","wast"],load(){return de(()=>import("./dist-BSndAsl2.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([36,37,5]),import.meta.url).then(e=>e.wast())}}),ue.of({name:"XML",alias:["rss","wsdl","xsd"],extensions:["xml","xsl","xsd","svg"],load(){return de(()=>import("./dist-CgdeWOxv.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([38,39,5]),import.meta.url).then(e=>e.xml())}}),ue.of({name:"YAML",alias:["yml"],extensions:["yaml","yml"],load(){return de(()=>import("./dist-D7Pn6TvC.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([40,41,5]),import.meta.url).then(e=>e.yaml())}}),ue.of({name:"APL",extensions:["dyalog","apl"],load(){return de(()=>import("./apl-sEsRK68R.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([42,43]),import.meta.url).then(e=>be(e.apl))}}),ue.of({name:"PGP",alias:["asciiarmor"],extensions:["asc","pgp","sig"],load(){return de(()=>import("./asciiarmor-CwCv7Lne.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([44,45]),import.meta.url).then(e=>be(e.asciiArmor))}}),ue.of({name:"ASN.1",extensions:["asn","asn1"],load(){return de(()=>import("./asn1-CuzWg-fh.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([46,47]),import.meta.url).then(e=>be(e.asn1({})))}}),ue.of({name:"Asterisk",filename:/^extensions\.conf$/i,load(){return de(()=>import("./asterisk-GbGHf9GU.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>be(e.asterisk))}}),ue.of({name:"Brainfuck",extensions:["b","bf"],load(){return de(()=>import("./brainfuck-CnnfS_cI.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([48,49]),import.meta.url).then(e=>be(e.brainfuck))}}),ue.of({name:"Cobol",extensions:["cob","cpy"],load(){return de(()=>import("./cobol-GPJ0dHQG.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([50,51]),import.meta.url).then(e=>be(e.cobol))}}),ue.of({name:"C#",alias:["csharp","cs"],extensions:["cs"],load(){return de(()=>import("./clike-tfWZyYoN.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([52,53]),import.meta.url).then(e=>be(e.csharp))}}),ue.of({name:"Clojure",extensions:["clj","cljc","cljx"],load(){return de(()=>import("./clojure-Bninbb7T.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([54,55]),import.meta.url).then(e=>be(e.clojure))}}),ue.of({name:"ClojureScript",extensions:["cljs"],load(){return de(()=>import("./clojure-Bninbb7T.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([54,55]),import.meta.url).then(e=>be(e.clojure))}}),ue.of({name:"Closure Stylesheets (GSS)",extensions:["gss"],load(){return de(()=>import("./css-COZ77Eal.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([56,57]),import.meta.url).then(e=>be(e.gss))}}),ue.of({name:"CMake",extensions:["cmake","cmake.in"],filename:/^CMakeLists\.txt$/,load(){return de(()=>import("./cmake-BpuaQxBS.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([58,59]),import.meta.url).then(e=>be(e.cmake))}}),ue.of({name:"CoffeeScript",alias:["coffee","coffee-script"],extensions:["coffee"],load(){return de(()=>import("./coffeescript-D7gQHdB-.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([60,61]),import.meta.url).then(e=>be(e.coffeeScript))}}),ue.of({name:"Common Lisp",alias:["lisp"],extensions:["cl","lisp","el"],load(){return de(()=>import("./commonlisp-Cr4KGe18.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([62,63]),import.meta.url).then(e=>be(e.commonLisp))}}),ue.of({name:"Cypher",extensions:["cyp","cypher"],load(){return de(()=>import("./cypher-CY21sZiF.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([64,65]),import.meta.url).then(e=>be(e.cypher))}}),ue.of({name:"Cython",extensions:["pyx","pxd","pxi"],load(){return de(()=>import("./python-DwXz2aVG.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([66,67]),import.meta.url).then(e=>be(e.cython))}}),ue.of({name:"Crystal",extensions:["cr"],load(){return de(()=>import("./crystal-CsTMAwME.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([68,69]),import.meta.url).then(e=>be(e.crystal))}}),ue.of({name:"D",extensions:["d"],load(){return de(()=>import("./d-CURHSrpr.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([70,71]),import.meta.url).then(e=>be(e.d))}}),ue.of({name:"Dart",extensions:["dart"],load(){return de(()=>import("./clike-tfWZyYoN.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([52,53]),import.meta.url).then(e=>be(e.dart))}}),ue.of({name:"diff",extensions:["diff","patch"],load(){return de(()=>import("./diff-oDNdZgsT.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([72,73]),import.meta.url).then(e=>be(e.diff))}}),ue.of({name:"Dockerfile",filename:/^Dockerfile$/,load(){return de(()=>import("./dockerfile-L84t-MVG.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([74,75]),import.meta.url).then(e=>be(e.dockerFile))}}),ue.of({name:"DTD",extensions:["dtd"],load(){return de(()=>import("./dtd-Cy2_BeYL.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([76,77]),import.meta.url).then(e=>be(e.dtd))}}),ue.of({name:"Dylan",extensions:["dylan","dyl","intr"],load(){return de(()=>import("./dylan-Crd9Fb_0.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([78,79]),import.meta.url).then(e=>be(e.dylan))}}),ue.of({name:"EBNF",load(){return de(()=>import("./ebnf-DuKzoTsP.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>be(e.ebnf))}}),ue.of({name:"ECL",extensions:["ecl"],load(){return de(()=>import("./ecl-CfCmFoo0.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([80,81]),import.meta.url).then(e=>be(e.ecl))}}),ue.of({name:"edn",extensions:["edn"],load(){return de(()=>import("./clojure-Bninbb7T.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([54,55]),import.meta.url).then(e=>be(e.clojure))}}),ue.of({name:"Eiffel",extensions:["e"],load(){return de(()=>import("./eiffel-gIaoJqnl.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([82,83]),import.meta.url).then(e=>be(e.eiffel))}}),ue.of({name:"Elm",extensions:["elm"],load(){return de(()=>import("./elm-BFWuf0zw.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([84,85]),import.meta.url).then(e=>be(e.elm))}}),ue.of({name:"Erlang",extensions:["erl"],load(){return de(()=>import("./erlang-o_h5GHv6.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([86,87]),import.meta.url).then(e=>be(e.erlang))}}),ue.of({name:"Esper",load(){return de(()=>import("./sql-CE9Btgz4.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>be(e.esper))}}),ue.of({name:"Factor",extensions:["factor"],load(){return de(()=>import("./factor-DhP48x0i.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([88,89,75]),import.meta.url).then(e=>be(e.factor))}}),ue.of({name:"FCL",load(){return de(()=>import("./fcl-DopXl_Cb.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>be(e.fcl))}}),ue.of({name:"Forth",extensions:["forth","fth","4th"],load(){return de(()=>import("./forth-B9culvwH.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([90,91]),import.meta.url).then(e=>be(e.forth))}}),ue.of({name:"Fortran",extensions:["f","for","f77","f90","f95"],load(){return de(()=>import("./fortran-P9CMHntW.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([92,93]),import.meta.url).then(e=>be(e.fortran))}}),ue.of({name:"F#",alias:["fsharp"],extensions:["fs"],load(){return de(()=>import("./mllike-LThTvO6F.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([94,95]),import.meta.url).then(e=>be(e.fSharp))}}),ue.of({name:"Gas",extensions:["s"],load(){return de(()=>import("./gas-aBeBIUA2.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([96,97]),import.meta.url).then(e=>be(e.gas))}}),ue.of({name:"Gherkin",extensions:["feature"],load(){return de(()=>import("./gherkin-BKojMN6Q.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([98,99]),import.meta.url).then(e=>be(e.gherkin))}}),ue.of({name:"Groovy",extensions:["groovy","gradle"],filename:/^Jenkinsfile$/,load(){return de(()=>import("./groovy-CePAd7wh.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([100,101]),import.meta.url).then(e=>be(e.groovy))}}),ue.of({name:"Haskell",extensions:["hs"],load(){return de(()=>import("./haskell-QHmsrbZx.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([102,103]),import.meta.url).then(e=>be(e.haskell))}}),ue.of({name:"Haxe",extensions:["hx"],load(){return de(()=>import("./haxe-CQV_8vKL.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([104,105]),import.meta.url).then(e=>be(e.haxe))}}),ue.of({name:"HXML",extensions:["hxml"],load(){return de(()=>import("./haxe-CQV_8vKL.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([104,105]),import.meta.url).then(e=>be(e.hxml))}}),ue.of({name:"HTTP",load(){return de(()=>import("./http-BxcKXOao.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>be(e.http))}}),ue.of({name:"IDL",extensions:["pro"],load(){return de(()=>import("./idl-Dd8N44Cm.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([106,107]),import.meta.url).then(e=>be(e.idl))}}),ue.of({name:"JSON-LD",alias:["jsonld"],extensions:["jsonld"],load(){return de(()=>import("./javascript-DSNeo7JU.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([108,109]),import.meta.url).then(e=>be(e.jsonld))}}),ue.of({name:"Julia",extensions:["jl"],load(){return de(()=>import("./julia-noK_uk9P.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([110,111]),import.meta.url).then(e=>be(e.julia))}}),ue.of({name:"Kotlin",extensions:["kt","kts"],load(){return de(()=>import("./clike-tfWZyYoN.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([52,53]),import.meta.url).then(e=>be(e.kotlin))}}),ue.of({name:"LiveScript",alias:["ls"],extensions:["ls"],load(){return de(()=>import("./livescript-YKkeujLh.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([112,113]),import.meta.url).then(e=>be(e.liveScript))}}),ue.of({name:"Lua",extensions:["lua"],load(){return de(()=>import("./lua-fLqC1mOj.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([114,115]),import.meta.url).then(e=>be(e.lua))}}),ue.of({name:"mIRC",extensions:["mrc"],load(){return de(()=>import("./mirc-BTX_WxCv.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([116,117]),import.meta.url).then(e=>be(e.mirc))}}),ue.of({name:"Mathematica",extensions:["m","nb","wl","wls"],load(){return de(()=>import("./mathematica-BEqGrvB0.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([118,119]),import.meta.url).then(e=>be(e.mathematica))}}),ue.of({name:"Modelica",extensions:["mo"],load(){return de(()=>import("./modelica-ClexNQK-.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([120,121]),import.meta.url).then(e=>be(e.modelica))}}),ue.of({name:"MUMPS",extensions:["mps"],load(){return de(()=>import("./mumps-G_BfPdvs.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([122,123]),import.meta.url).then(e=>be(e.mumps))}}),ue.of({name:"Mbox",extensions:["mbox"],load(){return de(()=>import("./mbox-9uehSvC8.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([124,125]),import.meta.url).then(e=>be(e.mbox))}}),ue.of({name:"Nginx",filename:/nginx.*\.conf$/i,load(){return de(()=>import("./nginx-BFZZWp0k.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>be(e.nginx))}}),ue.of({name:"NSIS",extensions:["nsh","nsi"],load(){return de(()=>import("./nsis-CBRC0JIr.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([126,127,75]),import.meta.url).then(e=>be(e.nsis))}}),ue.of({name:"NTriples",extensions:["nt","nq"],load(){return de(()=>import("./ntriples-DrvRq09t.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([128,129]),import.meta.url).then(e=>be(e.ntriples))}}),ue.of({name:"Objective-C",alias:["objective-c","objc"],extensions:["m"],load(){return de(()=>import("./clike-tfWZyYoN.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([52,53]),import.meta.url).then(e=>be(e.objectiveC))}}),ue.of({name:"Objective-C++",alias:["objective-c++","objc++"],extensions:["mm"],load(){return de(()=>import("./clike-tfWZyYoN.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([52,53]),import.meta.url).then(e=>be(e.objectiveCpp))}}),ue.of({name:"OCaml",extensions:["ml","mli","mll","mly"],load(){return de(()=>import("./mllike-LThTvO6F.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([94,95]),import.meta.url).then(e=>be(e.oCaml))}}),ue.of({name:"Octave",extensions:["m"],load(){return de(()=>import("./octave-BiPC57kS.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([130,131]),import.meta.url).then(e=>be(e.octave))}}),ue.of({name:"Oz",extensions:["oz"],load(){return de(()=>import("./oz-DacpSh-q.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([132,133]),import.meta.url).then(e=>be(e.oz))}}),ue.of({name:"Pascal",extensions:["p","pas"],load(){return de(()=>import("./pascal-BQpBPSms.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([134,135]),import.meta.url).then(e=>be(e.pascal))}}),ue.of({name:"Perl",extensions:["pl","pm"],load(){return de(()=>import("./perl-BhMGfluR.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([136,137]),import.meta.url).then(e=>be(e.perl))}}),ue.of({name:"Pig",extensions:["pig"],load(){return de(()=>import("./pig-lTm9qLoi.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([138,139]),import.meta.url).then(e=>be(e.pig))}}),ue.of({name:"PowerShell",extensions:["ps1","psd1","psm1"],load(){return de(()=>import("./powershell-3wPcC3I5.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([140,141]),import.meta.url).then(e=>be(e.powerShell))}}),ue.of({name:"Properties files",alias:["ini","properties"],extensions:["properties","ini","in"],load(){return de(()=>import("./properties-CfDlOPua.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([142,143]),import.meta.url).then(e=>be(e.properties))}}),ue.of({name:"ProtoBuf",extensions:["proto"],load(){return de(()=>import("./protobuf-DqtB_3Ds.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([144,145]),import.meta.url).then(e=>be(e.protobuf))}}),ue.of({name:"Pug",alias:["jade"],extensions:["pug","jade"],load(){return de(()=>import("./pug-BendPilS.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([146,147,109]),import.meta.url).then(e=>be(e.pug))}}),ue.of({name:"Puppet",extensions:["pp"],load(){return de(()=>import("./puppet-CS4oS8k4.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([148,149]),import.meta.url).then(e=>be(e.puppet))}}),ue.of({name:"Q",extensions:["q"],load(){return de(()=>import("./q-CAmiN8ZZ.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([150,151]),import.meta.url).then(e=>be(e.q))}}),ue.of({name:"R",alias:["rscript"],extensions:["r","R"],load(){return de(()=>import("./r-BVrS7OVn.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([152,153]),import.meta.url).then(e=>be(e.r))}}),ue.of({name:"RPM Changes",load(){return de(()=>import("./rpm-CdnUar42.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([154,155]),import.meta.url).then(e=>be(e.rpmChanges))}}),ue.of({name:"RPM Spec",extensions:["spec"],load(){return de(()=>import("./rpm-CdnUar42.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([154,155]),import.meta.url).then(e=>be(e.rpmSpec))}}),ue.of({name:"Ruby",alias:["jruby","macruby","rake","rb","rbx"],extensions:["rb"],filename:/^(Gemfile|Rakefile)$/,load(){return de(()=>import("./ruby-BCel59B2.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([156,157]),import.meta.url).then(e=>be(e.ruby))}}),ue.of({name:"SAS",extensions:["sas"],load(){return de(()=>import("./sas-BmzKenFt.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([158,159]),import.meta.url).then(e=>be(e.sas))}}),ue.of({name:"Scala",extensions:["scala"],load(){return de(()=>import("./clike-tfWZyYoN.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([52,53]),import.meta.url).then(e=>be(e.scala))}}),ue.of({name:"Scheme",extensions:["scm","ss"],load(){return de(()=>import("./scheme-DkHD_m5P.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([160,161]),import.meta.url).then(e=>be(e.scheme))}}),ue.of({name:"Shell",alias:["bash","sh","zsh"],extensions:["sh","ksh","bash"],filename:/^PKGBUILD$/,load(){return de(()=>import("./shell-BoNNN3zm.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([162,163]),import.meta.url).then(e=>be(e.shell))}}),ue.of({name:"Sieve",extensions:["siv","sieve"],load(){return de(()=>import("./sieve-BXXK8f92.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([164,165]),import.meta.url).then(e=>be(e.sieve))}}),ue.of({name:"Smalltalk",extensions:["st"],load(){return de(()=>import("./smalltalk-BOqQhpHI.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([166,167]),import.meta.url).then(e=>be(e.smalltalk))}}),ue.of({name:"Solr",load(){return de(()=>import("./solr-BCnpA4mK.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>be(e.solr))}}),ue.of({name:"SML",extensions:["sml","sig","fun","smackspec"],load(){return de(()=>import("./mllike-LThTvO6F.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([94,95]),import.meta.url).then(e=>be(e.sml))}}),ue.of({name:"SPARQL",alias:["sparul"],extensions:["rq","sparql"],load(){return de(()=>import("./sparql-edyZVkfL.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([168,169]),import.meta.url).then(e=>be(e.sparql))}}),ue.of({name:"Spreadsheet",alias:["excel","formula"],load(){return de(()=>import("./spreadsheet-C39QEIvH.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>be(e.spreadsheet))}}),ue.of({name:"Squirrel",extensions:["nut"],load(){return de(()=>import("./clike-tfWZyYoN.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([52,53]),import.meta.url).then(e=>be(e.squirrel))}}),ue.of({name:"Stylus",extensions:["styl"],load(){return de(()=>import("./stylus-D7JxHbZj.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([170,171]),import.meta.url).then(e=>be(e.stylus))}}),ue.of({name:"Swift",extensions:["swift"],load(){return de(()=>import("./swift-BVf4glc7.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([172,173]),import.meta.url).then(e=>be(e.swift))}}),ue.of({name:"sTeX",load(){return de(()=>import("./stex-Ccczot4V.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([174,175]),import.meta.url).then(e=>be(e.stex))}}),ue.of({name:"LaTeX",alias:["tex"],extensions:["text","ltx","tex"],load(){return de(()=>import("./stex-Ccczot4V.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([174,175]),import.meta.url).then(e=>be(e.stex))}}),ue.of({name:"SystemVerilog",extensions:["v","sv","svh"],load(){return de(()=>import("./verilog-Bw8NaRo-.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([176,177]),import.meta.url).then(e=>be(e.verilog))}}),ue.of({name:"Tcl",extensions:["tcl"],load(){return de(()=>import("./tcl-Dj0fCfAi.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([178,179]),import.meta.url).then(e=>be(e.tcl))}}),ue.of({name:"Textile",extensions:["textile"],load(){return de(()=>import("./textile-C2t_E40o.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([180,181]),import.meta.url).then(e=>be(e.textile))}}),ue.of({name:"TiddlyWiki",load(){return de(()=>import("./tiddlywiki-CIp8hgce.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>be(e.tiddlyWiki))}}),ue.of({name:"Tiki wiki",load(){return de(()=>import("./tiki-C22wqq7_.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>be(e.tiki))}}),ue.of({name:"TOML",extensions:["toml"],load(){return de(()=>import("./toml-DaFUQW6l.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([182,183]),import.meta.url).then(e=>be(e.toml))}}),ue.of({name:"Troff",extensions:["1","2","3","4","5","6","7","8","9"],load(){return de(()=>import("./troff-CYzkeKir.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([184,185]),import.meta.url).then(e=>be(e.troff))}}),ue.of({name:"TTCN",extensions:["ttcn","ttcn3","ttcnpp"],load(){return de(()=>import("./ttcn-CXYORWfg.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([186,187]),import.meta.url).then(e=>be(e.ttcn))}}),ue.of({name:"TTCN_CFG",extensions:["cfg"],load(){return de(()=>import("./ttcn-cfg-CaYX34bx.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([188,189]),import.meta.url).then(e=>be(e.ttcnCfg))}}),ue.of({name:"Turtle",extensions:["ttl"],load(){return de(()=>import("./turtle-5bfs3D9s.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([190,191]),import.meta.url).then(e=>be(e.turtle))}}),ue.of({name:"Web IDL",extensions:["webidl"],load(){return de(()=>import("./webidl-C8MAcuKq.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([192,193]),import.meta.url).then(e=>be(e.webIDL))}}),ue.of({name:"VB.NET",extensions:["vb"],load(){return de(()=>import("./vb-CXQ5pSkV.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([194,195]),import.meta.url).then(e=>be(e.vb))}}),ue.of({name:"VBScript",extensions:["vbs"],load(){return de(()=>import("./vbscript-BZP_4BaN.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([196,197]),import.meta.url).then(e=>be(e.vbScript))}}),ue.of({name:"Velocity",extensions:["vtl"],load(){return de(()=>import("./velocity-BbHSi60j.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([198,199]),import.meta.url).then(e=>be(e.velocity))}}),ue.of({name:"Verilog",extensions:["v"],load(){return de(()=>import("./verilog-Bw8NaRo-.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([176,177]),import.meta.url).then(e=>be(e.verilog))}}),ue.of({name:"VHDL",extensions:["vhd","vhdl"],load(){return de(()=>import("./vhdl-CkM1aKBX.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([200,201]),import.meta.url).then(e=>be(e.vhdl))}}),ue.of({name:"XQuery",extensions:["xy","xquery","xq","xqm","xqy"],load(){return de(()=>import("./xquery-a81J2h4S.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([202,203]),import.meta.url).then(e=>be(e.xQuery))}}),ue.of({name:"Yacas",extensions:["ys"],load(){return de(()=>import("./yacas-CjV2u_g7.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([204,205]),import.meta.url).then(e=>be(e.yacas))}}),ue.of({name:"Z80",extensions:["z80"],load(){return de(()=>import("./z80-C0uVpBhe.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([206,207]),import.meta.url).then(e=>be(e.z80))}}),ue.of({name:"MscGen",extensions:["mscgen","mscin","msc"],load(){return de(()=>import("./mscgen-Cr-Z_Sdd.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([208,209]),import.meta.url).then(e=>be(e.mscgen))}}),ue.of({name:"X\xF9",extensions:["xu"],load(){return de(()=>import("./mscgen-Cr-Z_Sdd.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([208,209]),import.meta.url).then(e=>be(e.xu))}}),ue.of({name:"MsGenny",extensions:["msgenny"],load(){return de(()=>import("./mscgen-Cr-Z_Sdd.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([208,209]),import.meta.url).then(e=>be(e.msgenny))}}),ue.of({name:"Vue",extensions:["vue"],load(){return de(()=>import("./dist-Q_HuxBl8.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([210,9,5,13,14,4,211]),import.meta.url).then(e=>e.vue())}}),ue.of({name:"Angular Template",load(){return de(()=>import("./dist-BvDn6jZn.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([212,9,5,13,14,4]),import.meta.url).then(e=>e.angular())}})],Hb=new WeakMap,KD=/(\n|\r\n?|\u2028|\u2029)/g,QD=/^\s*/,GD=/\S/,XD=Array.prototype.slice,Ap=48,Bb=57,Wb=97,JD=102,Ub=65,YD=70;zc=function(e){if(typeof e=="string")return Gb([e])[0];if(typeof e=="function")return function(){let i=XD.call(arguments);return i[0]=Qb(i[0]),e.apply(this,i)};let t=Qb(e),n=Kb(t,0);for(let i=1;i<t.length;i++)n+=arguments[i]+Kb(t,i);return n};function Kb(e,t){let n=e[t];if(n===void 0)throw TypeError(`invalid cooked string at index ${t}`);return n}function Qb(e){let t=Hb.get(e);if(t)return t;let n=Gb(e.raw),i=n.map(eR);return Object.defineProperty(i,"raw",{value:Object.freeze(n)}),Object.freeze(i),Hb.set(e,i),i}function Gb(e){let t=e.map(o=>o.split(KD)),n;for(let o=0;o<t.length;o++){let l=t[o],u=o===0,d=o+1===t.length;if(u){if(l.length===1||l[0].length>0)throw Error("invalid content on opening line");l[1]=""}if(d){if(l.length===1||GD.test(l[l.length-1]))throw Error("invalid content on closing line");l[l.length-2]="",l[l.length-1]=""}for(let p=2;p<l.length;p+=2){let g=l[p],w=p+1===l.length&&!d,x=QD.exec(g)[0];if(!w&&x.length===g.length){l[p]="";continue}n=ZD(x,n)}}let i=n?n.length:0;return t.map(o=>{let l=o[0];for(let u=1;u<o.length;u+=2){let d=o[u],p=o[u+1];l+=d+p.slice(i)}return l})}function ZD(e,t){if(t===void 0||e===t)return e;let n=0;for(let i=Math.min(e.length,t.length);n<i&&e[n]===t[n];n++);return e.slice(0,n)}function eR(e){let t="",n=0,i=0;for(;(i=e.indexOf("\\",i))>-1;){if(t+=e.slice(n,i),++i===e.length)return;let o=e[i++];switch(o){case"b":t+="\b";break;case"t":t+=" ";break;case"n":t+=`
|
|
70
70
|
`;break;case"v":t+="\v";break;case"f":t+="\f";break;case"r":t+="\r";break;case"\r":i<e.length&&e[i]===`
|
|
71
71
|
`&&++i;case`
|
|
72
|
-
`:case"\u2028":case"\u2029":break;case"0":if(Xb(e,i))return;t+="\0";break;case"x":{let l=Lp(e,i,i+2);if(l===-1)return;i+=2,t+=String.fromCharCode(l);break}case"u":{let l;if(i<e.length&&e[i]==="{"){let u=e.indexOf("}",++i);if(u===-1)return;l=Lp(e,i,u),i=u+1}else l=Lp(e,i,i+4),i+=4;if(l===-1||l>1114111)return;t+=String.fromCodePoint(l);break}default:if(Xb(o,0))return;t+=o}n=i}return t+e.slice(n)}function Xb(e,t){let n=e.charCodeAt(t);return n>=Ap&&n<=Bb}function Lp(e,t,n){if(n>=e.length)return-1;let i=0;for(;t<n;t++){let o=tR(e.charCodeAt(t));if(o===-1)return-1;i=i*16+o}return i}function tR(e){return e>=Ap&&e<=Bb?e-Ap:e>=Wb&&e<=JD?e-Wb+10:e>=Ub&&e<=YD?e-Ub+10:-1}const Jb=["","f","r","fr","rf"];function nR(e){try{return
|
|
72
|
+
`:case"\u2028":case"\u2029":break;case"0":if(Xb(e,i))return;t+="\0";break;case"x":{let l=Lp(e,i,i+2);if(l===-1)return;i+=2,t+=String.fromCharCode(l);break}case"u":{let l;if(i<e.length&&e[i]==="{"){let u=e.indexOf("}",++i);if(u===-1)return;l=Lp(e,i,u),i=u+1}else l=Lp(e,i,i+4),i+=4;if(l===-1||l>1114111)return;t+=String.fromCodePoint(l);break}default:if(Xb(o,0))return;t+=o}n=i}return t+e.slice(n)}function Xb(e,t){let n=e.charCodeAt(t);return n>=Ap&&n<=Bb}function Lp(e,t,n){if(n>=e.length)return-1;let i=0;for(;t<n;t++){let o=tR(e.charCodeAt(t));if(o===-1)return-1;i=i*16+o}return i}function tR(e){return e>=Ap&&e<=Bb?e-Ap:e>=Wb&&e<=JD?e-Wb+10:e>=Ub&&e<=YD?e-Ub+10:-1}const Jb=["","f","r","fr","rf"];function nR(e){try{return zc(`
|
|
73
73
|
${e}
|
|
74
|
-
`).trim()}catch{return e}}function rR(e){return fS.parse(e)}var iR=new Set(["(","[","{",",",")","]","}"]);function aR(e,t){return e.name==="ArgList"?{args:oR(e),kwargs:sR(e,t)}:(console.warn(`Not an ArgList, name: ${e.name}`),{args:[],kwargs:[]})}function oR(e){var i;e.firstChild();let t=[],n=e.name;do if(n=e.name,!iR.has(n)){if(n==="VariableName"&&((i=e.node.nextSibling)==null?void 0:i.name)==="AssignOp"){e.prev();break}t.push(e.node)}while(e.nextSibling());return t}function sR(e,t){let n=[],i=e.name;do if(i=e.name,i==="VariableName"){let o=t.slice(e.from,e.to),l=e.node.nextSibling;if(!l||l.name!=="AssignOp")continue;let u=l.nextSibling;if(!u)continue;let d=t.slice(u.from,u.to).trim();n.push({key:o,value:d})}while(e.nextSibling());return n}function lR(e,t){if(e.name==="String"){let n=t.slice(e.from,e.to);return n.startsWith('r"""')||n.startsWith("r'''")?n.slice(4,-3):n.startsWith('"""')||n.startsWith("'''")?n.slice(3,-3):n.startsWith('r"')||n.startsWith("r'")?n.slice(2,-1):n.slice(1,-1)}if(e.name==="FormatString"){let n=t.slice(e.from,e.to);return n.startsWith('f"""')||n.startsWith("f'''")?n.slice(4,-3):n.startsWith('rf"""')||n.startsWith("rf'''")||n.startsWith('fr"""')||n.startsWith("fr'''")?n.slice(5,-3):n.startsWith('r"""')||n.startsWith("r'''")?n.slice(4,-3):n.startsWith('f"')||n.startsWith("f'")?n.slice(2,-1):n.startsWith('rf"')||n.startsWith("rf'")||n.startsWith('fr"')||n.startsWith("fr'")?n.slice(3,-1):(n.startsWith('r"')||n.startsWith("r'"),n.slice(2,-1))}return null}function cR(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 uR(e){let t=[...Jb].sort((n,i)=>i.length-n.length);for(let n of t)if(e.startsWith(n))return[n,e.slice(n.length)];return["",e]}function dR(e,t){return e.replaceAll(`\\${t}`,t)}var fR=[['"""','"""'],["'''","'''"],['"','"'],["'","'"]],pR=Jb.flatMap(e=>fR.map(([t,n])=>[e+t,n])).map(([e,t])=>[e,RegExp(`^mo\\.md\\(\\s*${Yb(e)}(.*)${Yb(t)}\\s*\\)$`,"s")]);function Yb(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}let Zb,
|
|
74
|
+
`).trim()}catch{return e}}function rR(e){return fS.parse(e)}var iR=new Set(["(","[","{",",",")","]","}"]);function aR(e,t){return e.name==="ArgList"?{args:oR(e),kwargs:sR(e,t)}:(console.warn(`Not an ArgList, name: ${e.name}`),{args:[],kwargs:[]})}function oR(e){var i;e.firstChild();let t=[],n=e.name;do if(n=e.name,!iR.has(n)){if(n==="VariableName"&&((i=e.node.nextSibling)==null?void 0:i.name)==="AssignOp"){e.prev();break}t.push(e.node)}while(e.nextSibling());return t}function sR(e,t){let n=[],i=e.name;do if(i=e.name,i==="VariableName"){let o=t.slice(e.from,e.to),l=e.node.nextSibling;if(!l||l.name!=="AssignOp")continue;let u=l.nextSibling;if(!u)continue;let d=t.slice(u.from,u.to).trim();n.push({key:o,value:d})}while(e.nextSibling());return n}function lR(e,t){if(e.name==="String"){let n=t.slice(e.from,e.to);return n.startsWith('r"""')||n.startsWith("r'''")?n.slice(4,-3):n.startsWith('"""')||n.startsWith("'''")?n.slice(3,-3):n.startsWith('r"')||n.startsWith("r'")?n.slice(2,-1):n.slice(1,-1)}if(e.name==="FormatString"){let n=t.slice(e.from,e.to);return n.startsWith('f"""')||n.startsWith("f'''")?n.slice(4,-3):n.startsWith('rf"""')||n.startsWith("rf'''")||n.startsWith('fr"""')||n.startsWith("fr'''")?n.slice(5,-3):n.startsWith('r"""')||n.startsWith("r'''")?n.slice(4,-3):n.startsWith('f"')||n.startsWith("f'")?n.slice(2,-1):n.startsWith('rf"')||n.startsWith("rf'")||n.startsWith('fr"')||n.startsWith("fr'")?n.slice(3,-1):(n.startsWith('r"')||n.startsWith("r'"),n.slice(2,-1))}return null}function cR(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 uR(e){let t=[...Jb].sort((n,i)=>i.length-n.length);for(let n of t)if(e.startsWith(n))return[n,e.slice(n.length)];return["",e]}function dR(e,t){return e.replaceAll(`\\${t}`,t)}var fR=[['"""','"""'],["'''","'''"],['"','"'],["'","'"]],pR=Jb.flatMap(e=>fR.map(([t,n])=>[e+t,n])).map(([e,t])=>[e,RegExp(`^mo\\.md\\(\\s*${Yb(e)}(.*)${Yb(t)}\\s*\\)$`,"s")]);function Yb(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}let Zb,pu;Af=class{constructor(){pe(this,"type","markdown");pe(this,"defaultCode",`mo.md(r"""
|
|
75
75
|
""")`);pe(this,"defaultMetadata",{quotePrefix:"r"})}static fromMarkdown(e){return`mo.md(r"""
|
|
76
76
|
${e}
|
|
77
|
-
""")`}transformIn(e){e=e.trim();let t={...this.defaultMetadata};if(e==="")return{code:"",offset:0,metadata:t};for(let[n,i]of pR){let o=e.match(i);if(o){let l=o[1],[u,d]=uR(n);t.quotePrefix=u;let p=dR(l,d),g=e.indexOf(l);return{code:
|
|
77
|
+
""")`}transformIn(e){e=e.trim();let t={...this.defaultMetadata};if(e==="")return{code:"",offset:0,metadata:t};for(let[n,i]of pR){let o=e.match(i);if(o){let l=o[1],[u,d]=uR(n);t.quotePrefix=u;let p=dR(l,d),g=e.indexOf(l);return{code:zc(`
|
|
78
78
|
${p}
|
|
79
79
|
`).trim(),offset:g,metadata:t}}}return{code:e,offset:0,metadata:t}}transformOut(e,t){e===""&&(e=" ");let{quotePrefix:n}=t,i=e.replaceAll('""',String.raw`"\"`),o=`mo.md(${n}"""
|
|
80
80
|
`;return{code:o+i+`
|
|
81
|
-
""")`,offset:o.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=jg.parser.parse(e),n=[{match:"Script"},{match:"ExpressionStatement"},{match:"CallExpression"},{match:"MemberExpression"},{match:"VariableName"},{match:"."},{match:"PropertyName"},{match:"ArgList"},{match:"("},{match:/String|FormatString/,stop:!0},{match:")"}],i=!0;return t.iterate({enter:o=>{let l=n.shift();if(l===void 0)return i=!1,!1;let u=l.match;return typeof u=="string"?(i&&(i=u===o.name),i&&!l.stop):(u.test(o.name)||(i=!1),i&&!l.stop)}}),i}},Zb=class{constructor(){pe(this,"type","python");pe(this,"defaultCode","");pe(this,"defaultMetadata",{})}transformIn(e){return{code:e,offset:0,metadata:{}}}transformOut(e,t){return{code:e,offset:0}}isSupported(e){return!0}},
|
|
81
|
+
""")`,offset:o.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=jg.parser.parse(e),n=[{match:"Script"},{match:"ExpressionStatement"},{match:"CallExpression"},{match:"MemberExpression"},{match:"VariableName"},{match:"."},{match:"PropertyName"},{match:"ArgList"},{match:"("},{match:/String|FormatString/,stop:!0},{match:")"}],i=!0;return t.iterate({enter:o=>{let l=n.shift();if(l===void 0)return i=!1,!1;let u=l.match;return typeof u=="string"?(i&&(i=u===o.name),i&&!l.stop):(u.test(o.name)||(i=!1),i&&!l.stop)}}),i}},Zb=class{constructor(){pe(this,"type","python");pe(this,"defaultCode","");pe(this,"defaultMetadata",{})}transformIn(e){return{code:e,offset:0,metadata:{}}}transformOut(e,t){return{code:e,offset:0}}isSupported(e){return!0}},pu="__marimo_duckdb",kf=class{constructor(){pe(this,"type","sql");pe(this,"defaultMetadata",{dataframeName:"_df",quotePrefix:"f",commentLines:[],showOutput:!0,engine:pu})}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 n=ew(e);return n?(t.dataframeName=n.dfName,t.showOutput=n.output??!0,t.engine=n.engine??pu,{code:zc(`
|
|
82
82
|
${n.sqlString}
|
|
83
83
|
`).trim(),offset:n.startPosition,metadata:t}):{code:e,offset:0,metadata:t}}transformOut(e,t){let{quotePrefix:n,commentLines:i,showOutput:o,engine:l,dataframeName:u}=t,d=`${u} = mo.sql(
|
|
84
84
|
${n}"""
|
|
85
85
|
`,p=e.replaceAll('"""',String.raw`\"""`),g=`
|
|
86
86
|
"""${o?"":`,
|
|
87
|
-
output=False`}${l===
|
|
87
|
+
output=False`}${l===pu?"":`,
|
|
88
88
|
engine=${l}`}
|
|
89
89
|
)`;return{code:[...i,d].join(`
|
|
90
90
|
`)+hR(p)+g,offset:d.length+1}}isSupported(e){return e.trim()===""?!0:!e.includes("mo.sql")||e.split("mo.sql").length>2?!1:ew(e)!==null}extractCommentLines(e){let t=e.split(`
|
|
91
91
|
`),n=[];for(let i of t)if(i!=null&&i.startsWith("#"))n.push(i);else break;return n}};function mR(e){do{if(e.name==="AssignStatement")return e.node;if(e.name!=="Comment")return null}while(e.next());return null}function ew(e){try{let t=rR(e).cursor();t.name==="Script"&&t.next();let n=mR(t);if(!n||e.slice(n.to).trim().length>0)return null;let i=null,o=null,l,u,d=0,p=n.cursor();if(p.firstChild(),p.name==="VariableName"&&(i=e.slice(p.from,p.to)),!i)return null;let g=!1,w=null;for(;p.nextSibling();)if(p.name==="AssignOp")g=!0;else if(g&&!w){w=p.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:O,kwargs:j}=aR(E.node.cursor(),e);O.length===1&&(o=lR(O[0],e),d=O[0].from+cR(e.slice(O[0].from,O[0].to)));for(let{key:z,value:V}of j)switch(z){case"engine":l=V;break;case"output":u=V==="True";break}if(o==="")return{dfName:i,sqlString:"",engine:l,output:u,startPosition:d};break}}}return!i||!o?null:{dfName:i,sqlString:nR(o),engine:l,output:u,startPosition:d}}catch(t){return console.warn("Failed to parse SQL statement",t),null}}function hR(e){return e.split(`
|
|
92
92
|
`).map(t=>t!=null&&t.trim()?` ${t}`:t).join(`
|
|
93
|
-
`)}var gR=kr(),Pp=()=>({cellIds:new Set}),{valueAtom:Op,useActions:yR}=Ys(Pp,{markForCut:(e,t)=>({cellIds:new Set(t.cellIds)}),clear:()=>Pp()});
|
|
94
|
-
`);n!==i&&this.getTextFromDoc(this.doc).delete(n+t,i-n),d.length>0&&this.getTextFromDoc(this.doc).insert(n+t,d),t+=d.length-(i-n)}),this.doc.commit()}destroy(){var e;(e=this.sub)==null||e.call(this),this.sub=void 0}};O0=function(e,t){if(typeof window>"u")return;let n=`__marimo__${t}`;window[n]&&Se.warn(`Overwriting existing debug object ${n}`),window[n]=e};var bR={markdown:!0,wasm_layouts:!1,rtc_v2:!1,cache_panel:!1,external_agents:!1,debugger:!1,line_timing:!1};tl=function(e){var t,n;return((n=(t=qC())==null?void 0:t.experimental)==null?void 0:n[e])??bR[e]};function wR(e,t){Sr().saveUserConfig({config:{experimental:{[e]:t}}})}O0(wR,"setFeatureFlag");function pu(e,t){return{get:()=>t.get(e),sub:n=>t.sub(e,()=>n(t.get(e)))}}function xR(e,{offset:t,body:n=window,behavior:i="smooth"}){let o=(t==null?void 0:t.top)??0,l=(t==null?void 0:t.bottom)??0,u=e.getBoundingClientRect();if(u.top<o){n.scrollBy({top:u.top-o,behavior:i});return}if(u.bottom>window.innerHeight-l){n.scrollBy({top:u.bottom-window.innerHeight+l,behavior:i});return}}Ac=function(e){return e?e.state.field(Ir).type:"python"};function _R(e,t){return!e||Ac(e)===t?!1:e.state.doc.toString().trim()===""?!0:Tr[t].isSupported(ci(e))}mf=function(e,t,n={}){return!n.force&&!_R(e,t)?!1:(yf(e,{language:t}),t)};function kR(e){return Si.of([{key:e.getHotkey("cell.format").key,preventDefault:!0,run:t=>(Ef({[t.state.facet(aa)]:t}),!0)},{key:e.getHotkey("cell.viewAsMarkdown").key,preventDefault:!0,run:t=>{let n=mf(t,Ac(t)==="markdown"?"python":"markdown",{force:!0});return n==="markdown"&&t.state.facet(Lt).afterToggleMarkdown(),n!==!1}},{key:e.getHotkey("cell.viewAsSQL").key,preventDefault:!0,run:t=>{let n=mf(t,Ac(t)==="sql"?"python":"sql",{force:!0});return n==="sql"&&t.state.facet(Lt).afterToggleSQL(),n!==!1}}])}lE=function(){return At.updateListener.of(e=>{if(e.view.hasFocus&&e.heightChanged&&e.docChanged){if(e.transactions.some(t=>t.effects.some(n=>n.is(wl))))return;tw(e.view,{behavior:"smooth"})}})};function tw(e,t){let n=e.dom.getElementsByClassName("cm-activeLine cm-line");if(n.length===1){let i=n[0],o=document.getElementById("App");Vn(o,"App not found"),xR(i,{offset:{top:30,bottom:150},body:o,behavior:t.behavior})}}function CR(){return{}}let SR,ER,nw;({reducer:SR,createActions:ER,valueAtom:Qa,useActions:nw}=Ys(CR,{setVariables:(e,t)=>{let n={...e},i={};for(let o of t)i[o.name]={...n[o.name],...o};return i},addVariables:(e,t)=>{let n={...e};for(let i of t)n[i.name]={...n[i.name],...i};return n},setMetadata:(e,t)=>{let n={...e};for(let{name:i,value:o,dataType:l}of t)n[i]&&(n[i]={...n[i],value:o,dataType:l});return n}})),eT=()=>$n(Qa),NS=function(){return nw()},Qg=function(e){let t=e.storage||il;return{getItem(n,i){try{let o=t.getItem(n);if(!o)return i;let l=JSON.parse(o);return e.fromSerializable(l)}catch(o){return Se.warn(`Error getting ${n} from storage`,o),i}},setItem:(n,i)=>{t.setItem(n,JSON.stringify(e.toSerializable(i)))},removeItem:n=>{t.removeItem(n)}}},ff=Qy(()=>il),Tc=[{type:"files",Icon:Ib,label:"Files",tooltip:"View files",defaultSection:"sidebar",additionalKeywords:["explorer","browser","directory"]},{type:"variables",Icon:m0,label:"Variables",tooltip:"Explore variables and data sources",defaultSection:"sidebar",additionalKeywords:["state","scope","inspector"]},{type:"packages",Icon:Gg,label:"Packages",tooltip:"Manage packages",defaultSection:"sidebar",additionalKeywords:["dependencies","pip","install"]},{type:"ai",Icon:n0,label:"AI",tooltip:"Chat & Agents",defaultSection:"sidebar",additionalKeywords:["chat","copilot","assistant"]},{type:"outline",Icon:W0,label:"Outline",tooltip:"View outline",defaultSection:"sidebar",additionalKeywords:["toc","structure","headings"]},{type:"documentation",Icon:Wg,label:"Docs",tooltip:"View live docs",defaultSection:"sidebar",additionalKeywords:["reference","api"]},{type:"dependencies",Icon:o0,label:"Dependencies",tooltip:"Explore dependencies",defaultSection:"sidebar",additionalKeywords:["graph","imports"]},{type:"errors",Icon:Jg,label:"Errors",tooltip:"View errors",defaultSection:"developer-panel",additionalKeywords:["exceptions","problems","diagnostics"]},{type:"scratchpad",Icon:V0,label:"Scratchpad",tooltip:"Scratchpad",defaultSection:"developer-panel",additionalKeywords:["scratch","draft","playground"]},{type:"tracing",Icon:t0,label:"Tracing",tooltip:"View tracing",defaultSection:"developer-panel",additionalKeywords:["profiling","performance"]},{type:"secrets",Icon:Ab,label:"Secrets",tooltip:"Manage secrets",defaultSection:"developer-panel",hidden:Gd(),additionalKeywords:["env","environment","keys","credentials"]},{type:"logs",Icon:i0,label:"Logs",tooltip:"View logs",defaultSection:"developer-panel",additionalKeywords:["console","stdout"]},{type:"terminal",Icon:c0,label:"Terminal",tooltip:"Terminal",hidden:Gd(),defaultSection:"developer-panel",requiredCapability:"terminal",additionalKeywords:["shell","console","bash","command"]},{type:"snippets",Icon:Lb,label:"Snippets",tooltip:"Snippets",defaultSection:"developer-panel",additionalKeywords:["templates","examples"]},{type:"cache",Icon:Ng,label:"Cache",tooltip:"View cache",defaultSection:"developer-panel",hidden:!tl("cache_panel"),additionalKeywords:["memory","memoize"]}],nE=new Map(Tc.map(e=>[e.type,e])),aE=function({panel:e,capabilities:t,aiEnabled:n}){return!!(e.hidden||e.type==="ai"&&!n||e.requiredCapability&&!t[e.requiredCapability])};var TR=kr(),Mp={sidebar:Tc.filter(e=>!e.hidden&&e.defaultSection==="sidebar").map(e=>e.type),developerPanel:Tc.filter(e=>!e.hidden&&e.defaultSection==="developer-panel").map(e=>e.type)};function DR(e){let t=new Set([...e.sidebar,...e.developerPanel]);return{sidebar:[...e.sidebar,...Mp.sidebar.filter(n=>!t.has(n))],developerPanel:[...e.developerPanel,...Mp.developerPanel.filter(n=>!t.has(n))]}}fy=Pc("marimo:panel-layout",Mp,Qg({toSerializable:e=>e,fromSerializable:e=>DR(e)}),{getOnInit:!0});function rw(e){let t=Me.get(fy);return t.sidebar.includes(e)?"sidebar":t.developerPanel.includes(e)?"developer-panel":null}var iw="marimo:sidebar",aw=new xf(MC({selectedPanel:OC().optional().transform(e=>e),isSidebarOpen:NC(),isDeveloperPanelOpen:NC().optional().default(!1),selectedDeveloperPanelTab:OC().optional().default("errors").transform(e=>e)}),RR);function RR(){return{selectedPanel:"variables",isSidebarOpen:!1,isDeveloperPanelOpen:!1,selectedDeveloperPanelTab:"errors"}}let ow,IR,sw;({reducer:ow,createActions:IR,valueAtom:Dc,useActions:sw}=Ys(()=>aw.get(iw),{openApplication:(e,t)=>{let n=rw(t);return n==="sidebar"?{...e,selectedPanel:t,isSidebarOpen:!0}:n==="developer-panel"?{...e,selectedDeveloperPanelTab:t,isDeveloperPanelOpen:!0}:e},toggleApplication:(e,t)=>{let n=rw(t);return n==="sidebar"?{...e,selectedPanel:t,isSidebarOpen:e.isSidebarOpen?e.selectedPanel!==t:!0}:n==="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)=>aw.set(iw,t)])),rE=()=>{let e=(0,TR.c)(2),t=$n(Dc);if(t.isSidebarOpen)return t;let n;return e[0]===t?n=e[1]:(n={...t,selectedPanel:void 0},e[0]=t,e[1]=n),n},wS=function(){return sw()},GS=function(e){Me.set(Dc,t=>ow(t,{type:"openApplication",payload:e}))},Zg=je({terminal:!1,pylsp:!1,basedpyright:!1,ty:!1,pyrefly:!1});function ga(e){var t;return((t=Me.get(Zg))==null?void 0:t[e])??!1}sf=je({documentation:null}),Ee={VariableName:"VariableName",FunctionDefinition:"FunctionDefinition",ClassDefinition:"ClassDefinition",LambdaExpression:"LambdaExpression",ParamList:"ParamList",Decorator:"Decorator",AssignStatement:"AssignStatement",ForStatement:"ForStatement",ImportStatement:"ImportStatement",TryStatement:"TryStatement",WithStatement:"WithStatement",TupleExpression:"TupleExpression",ArrayExpression:"ArrayExpression",ParenthesizedExpression:"ParenthesizedExpression",CallExpression:"CallExpression",ArgList:"ArgList",AssignOp:"AssignOp",ArrayComprehensionExpression:"ArrayComprehensionExpression",SetComprehensionExpression:"SetComprehensionExpression",DictionaryComprehensionExpression:"DictionaryComprehensionExpression",ComprehensionExpression:"ComprehensionExpression",Comment:"Comment",String:"String",FormatString:"FormatString"},Xn={For:"for",In:"in",As:"as",Import:"import"},rl=new Set([Ee.FunctionDefinition,Ee.LambdaExpression,Ee.ArrayComprehensionExpression,Ee.SetComprehensionExpression,Ee.DictionaryComprehensionExpression,Ee.ComprehensionExpression,Ee.ClassDefinition]),FE=new Set([Ee.Comment,Ee.String,Ee.FormatString]);function AR(e){let t=Dg(e.state);if(!t||$g(t))return[];let n=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(n.size===0)return[];let i=[],o=new Map,l=new Map,u=new Map;function d(E,T){var U,me,$,W,ae,xe,_e,Te,Z;let O=E.cursor(),j=O.name,z=O.from,V=rl.has(j),P=T;switch(V&&(P=[...T,z],o.set(z,new Set),l.set(z,j)),j){case Ee.FunctionDefinition:{let Q=E.cursor();Q.firstChild();do if(Q.name===Ee.VariableName){let ce=e.state.doc.sliceString(Q.from,Q.to),te=T[T.length-1]??-1;o.has(te)||o.set(te,new Set),(U=o.get(te))==null||U.add(ce);break}while(Q.nextSibling());let Y=E.cursor();Y.firstChild();do if(Y.name===Ee.ParamList){let ce=Y.node.cursor();ce.firstChild();do if(ce.name===Ee.VariableName){let te=e.state.doc.sliceString(ce.from,ce.to);(me=o.get(z))==null||me.add(te)}while(ce.nextSibling())}while(Y.nextSibling());break}case Ee.LambdaExpression:{let Q=E.cursor();Q.firstChild();do if(Q.name===Ee.ParamList){let Y=Q.node.cursor();Y.firstChild();do if(Y.name===Ee.VariableName){let ce=e.state.doc.sliceString(Y.from,Y.to);($=o.get(z))==null||$.add(ce)}while(Y.nextSibling())}while(Q.nextSibling());break}case Ee.ArrayComprehensionExpression:case Ee.DictionaryComprehensionExpression:case Ee.SetComprehensionExpression:case Ee.ComprehensionExpression:{let Q=E.cursor();Q.firstChild();let Y=!1;do if(Q.name===Xn.For)Y=!0;else if(Y&&Q.name===Ee.VariableName){let ce=e.state.doc.sliceString(Q.from,Q.to);(W=o.get(z))==null||W.add(ce)}else if(Y&&Q.name===Ee.TupleExpression){let ce=Q.node.cursor();ce.firstChild();do if(ce.name===Ee.VariableName){let te=e.state.doc.sliceString(ce.from,ce.to);(ae=o.get(z))==null||ae.add(te)}while(ce.nextSibling())}else Y&&Q.name===Xn.In&&(Y=!1);while(Q.nextSibling());break}case Ee.ClassDefinition:{let Q=E.cursor();Q.firstChild();do if(Q.name===Ee.VariableName){let Y=e.state.doc.sliceString(Q.from,Q.to),ce=T[T.length-1]??-1;o.has(ce)||o.set(ce,new Set),(xe=o.get(ce))==null||xe.add(Y);break}while(Q.nextSibling());u.set(z,[]);break}case Ee.AssignStatement:{let Q=E.cursor(),Y=[];Q.firstChild();do Q.name===Ee.AssignOp&&Y.push(Q.from);while(Q.nextSibling());let ce=Y[Y.length-1],te=E.cursor();te.firstChild();let he=P[P.length-1]??-1;do te.from<ce&&Np(te,{currentScope:he,state:e.state,allDeclarations:o,scopeTypes:l,classLevelDeclarations:u,assignmentPosition:O.to});while(te.nextSibling());break}case Ee.ForStatement:{let Q=E.cursor();Q.firstChild();let Y=!1;do if(Q.name===Xn.For)Y=!0;else if(Y&&Q.name===Ee.VariableName){let ce=e.state.doc.sliceString(Q.from,Q.to),te=P[P.length-1]??-1;o.has(te)||o.set(te,new Set),(_e=o.get(te))==null||_e.add(ce)}else Y&&Q.name===Xn.In&&(Y=!1);while(Q.nextSibling());break}case Ee.ImportStatement:{let Q=E.cursor();Q.firstChild();let Y=P[P.length-1]??-1;o.has(Y)||o.set(Y,new Set);let ce=o.get(Y),te=!1,he=null,G=()=>{he!==null&&(ce==null||ce.add(he)),he=null};do{if(Q.name===Xn.Import){te=!0;continue}if(te){if(Q.name===Xn.As){he=null;continue}Q.name===Ee.VariableName?(G(),he=e.state.doc.sliceString(Q.from,Q.to)):Q.name===","&&G()}}while(Q.nextSibling());G();break}case Ee.TryStatement:{let Q=E.cursor();Q.firstChild();let Y=!1;do if(Q.name===Xn.As)Y=!0;else if(Y&&Q.name===Ee.VariableName){let ce=e.state.doc.sliceString(Q.from,Q.to),te=P[P.length-1]??-1;o.has(te)||o.set(te,new Set),(Te=o.get(te))==null||Te.add(ce),Y=!1}while(Q.nextSibling());break}case Ee.WithStatement:{let Q=E.cursor();Q.firstChild();let Y=!1;do if(Q.name===Xn.As)Y=!0;else if(Y&&Q.name===Ee.VariableName){let ce=e.state.doc.sliceString(Q.from,Q.to),te=P[P.length-1]??-1;o.has(te)||o.set(te,new Set),(Z=o.get(te))==null||Z.add(ce),Y=!1}while(Q.nextSibling());break}}S(O,Q=>{d(Q,P)})}function p(E,T,O){let j=u.get(T);return j?j.some(([z,V])=>z===E&&V<O):!1}function g(E,T,O){var j,z;for(let V of T)if(l.get(V)===Ee.ClassDefinition){if(p(E,V,O))return!0}else if((j=o.get(V))!=null&&j.has(E))return!0;return((z=o.get(-1))==null?void 0:z.has(E))??!1}function w(E,T){let O=E.cursor(),j=O.name,z=O.from;if(j===Ee.ImportStatement)return;let V=rl.has(j),P=T;if(V&&(P=[...T,z]),j===Ee.VariableName){let U=e.state.doc.sliceString(O.from,O.to);x(U,O)&&(g(U,P,O.from)||i.push({from:O.from,to:O.to,variableName:U}))}S(O,U=>{w(U,P)})}function x(E,T){return n.has(E)&&!OR(T)&&!LR(T)&&!PR(T)}function S(E,T){if(E.firstChild())do T(E.node);while(E.nextSibling())}return d(t,[]),w(t,[]),i}function LR(e){let t=e.node.cursor();if(t.moveTo(e.from),t.parent()&&t.name===Ee.CallExpression&&t.firstChild())do if(t.name===Ee.ArgList&&t.firstChild()){do if(t.from===e.from&&t.to===e.to)return t.nextSibling()&&t.name===Ee.AssignOp;while(t.nextSibling());break}while(t.nextSibling());return!1}function PR(e){let t=e.node.cursor();if(t.parent()&&t.name===Ee.AssignStatement){let n=t.node.cursor();n.firstChild();let i=-1;do if(n.name===Ee.AssignOp){i=n.from;break}while(n.nextSibling());return i!==-1&&e.from<i}return!1}function OR(e){let t=e.node.cursor();return!!(t.prevSibling()&&t.name===".")}$g=function(e){let t=e.cursor();do if(t.name==="\u26A0"||t.type.isError)return!0;while(t.next());return!1};function Np(e,t){var n;switch(e.name){case Ee.VariableName:{let i=t.state.doc.sliceString(e.from,e.to);if(t.currentScope!==-1&&t.scopeTypes.get(t.currentScope)===Ee.ClassDefinition){let o=t.classLevelDeclarations.get(t.currentScope);o&&o.push([i,t.assignmentPosition])}else t.allDeclarations.has(t.currentScope)||t.allDeclarations.set(t.currentScope,new Set),(n=t.allDeclarations.get(t.currentScope))==null||n.add(i);break}case Ee.TupleExpression:{let i=e.node.cursor();i.firstChild();do Np(i,t);while(i.nextSibling());break}case Ee.ArrayExpression:{let i=e.node.cursor();i.firstChild();do Np(i,t);while(i.nextSibling());break}}}var MR=Xt.mark({class:"mo-cm-reactive-reference"});ES=Xt.mark({class:"mo-cm-reactive-reference-hover"});var lw=sr.define(),NR=class{constructor(e,t){pe(this,"highlightDebounceMs",300);this.view=e,this.cellId=t,this.scheduleHighlighting=Sg(()=>{this.runHighlighting()},this.highlightDebounceMs),this.variablesUnsubscribe=Me.sub(Qa,()=>{this.scheduleHighlighting()}),this.scheduleHighlighting()}update(e){(e.docChanged||e.focusChanged)&&this.scheduleHighlighting()}destroy(){this.scheduleHighlighting.cancel(),this.variablesUnsubscribe()}runHighlighting(){let e=AR({state:this.view.state,cellId:this.cellId,variables:Me.get(Qa)});e.length>0&&Se.debug(`Found ${e.length} reactive variables in cell ${this.cellId}`),queueMicrotask(()=>{this.view.dispatch({effects:lw.of(e)})})}};Rf=li.define({create(){return{decorations:Xt.none,ranges:[]}},update(e,t){let n={decorations:e.decorations.map(t.changes),ranges:e.ranges};for(let i of t.effects)i.is(lw)&&(n={decorations:Xt.set(i.value.map(o=>MR.range(o.from,o.to))),ranges:i.value});return n},provide:e=>At.decorations.from(e,t=>t.decorations)});function jR(e){return[Rf,Cr.define(t=>new NR(t,e))]}HS=function(e,t){return t?jR(e):[]};function cw(e,t=!1){if(!e)return null;let n=document.createElement("span");if(n.classList.add("mo-cm-tooltip"),n.classList.add("docs-documentation"),t&&n.classList.add("cm-tooltip-section"),n.style.display="flex",n.style.flexDirection="column",n.style.gap=".8rem",n.innerHTML=e,t){let i=document.createElement("div");i.classList.add("text-xs","text-muted-foreground","font-medium","pt-1","-mt-2","border-t","border-border");let o=document.createElement("kbd");o.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",o.textContent=n5()?"\u2318":"Ctrl",i.append(document.createTextNode("Jump to defining cell ")),i.append(o),i.append(document.createTextNode(" + Click")),n.append(i)}return n}of=new el("autocomplete-result",async(e,t)=>{let{sendCodeCompletionRequest:n}=Sr();await n({id:e,...t})});var qR={param:3,property:2};const jp={asCompletionResult(e,t){return{from:e-t.prefix_length,options:t.options.map(n=>({label:n.name,type:n.type,boost:qR[n.type]??1,info:()=>cw(n.completion_info)})),validFor:/^\w*$/}},asHoverTooltip({position:e,message:t,limitToType:n,excludeTypes:i,exactName:o,showGoToDefinitionHint:l=!1}){let u=zR(t.options,o);if(!u)return;let d=e-t.prefix_length,p=cw(u.completion_info,l);if(p&&!(n&&u.type!==n)&&!(i!=null&&i.includes(u.type)))return{pos:d,html:u.completion_info,end:d+u.name.length,above:!0,create:()=>({dom:p,resize:!1})}}};function zR(e,t){if(e.length!==0){if(e.length===1)return e[0];if(t)return e.find(n=>n.name===t)}}eE=function(e){var t,n,i,o;return[(t=e==null?void 0:e.pylsp)!=null&&t.enabled&&ga("pylsp")||(n=e==null?void 0:e.ty)!=null&&n.enabled&&ga("ty")||(i=e==null?void 0:e.pyrefly)!=null&&i.enabled&&ga("pyrefly")||(o=e==null?void 0:e.basedpyright)!=null&&o.enabled&&ga("basedpyright")?[]:Ig(async(l,u)=>{let d=await uw({view:l,pos:u,excludeTypes:["tooltip"]});return d===null||d==="cancelled"?null:d},{hideOnChange:!0}),VR]};async function uw({view:e,pos:t,excludeTypes:n}){var w;let i=lr.findElement(e.dom);if(!i)return Se.error("Failed to find active cell."),null;let o=lr.parse(i.id),{startToken:l,endToken:u}=qp(e.state.doc,t),d=((w=e.state.field(Rf,!1))==null?void 0:w.ranges.some(x=>t>=x.from&&t<=x.to))??!1,p=await of.request({document:e.state.doc.slice(0,u).toString(),cellId:o});if(!p)return"cancelled";let g=e.state.doc.slice(l,u).toString();return jp.asHoverTooltip({position:u,message:p,exactName:g,excludeTypes:n,showGoToDefinitionHint:d})??null}function qp(e,t){let n=t,i=n>0?e.sliceString(n-1,n):"",o=n<e.length?e.sliceString(n,n+1):"";i==="("&&o===")"&&--n;let l=n,u=n;for(;l>0;){let d=e.sliceString(l-1,l);if(!/\w/.test(d))break;l--}for(;u<e.length;){let d=e.sliceString(u,u+1);if(!/\w/.test(d))break;u++}return{startToken:l,endToken:u}}function FR(e){let{head:t}=e.selection.main,n=e.doc.sliceString(t-1,t);return/\w/.test(n)}var $R=Sg(async(e,t)=>{if(Me.get(Dc).selectedPanel!=="documentation")return;let n=await uw({view:e,pos:t});n!=="cancelled"&&Me.set(sf,{documentation:(n==null?void 0:n.html)??null})},300),VR=At.updateListener.of(e=>{if(e.selectionSet&&FR(e.state)){let t=e.state.selection.main.head;$R(e.view,t)}});function HR(e){var t=e.Pos;function n(f,h,v){if(h.line===v.line&&h.ch>=v.ch-1){var b=f.getLine(h.line).charCodeAt(h.ch);55296<=b&&b<=55551&&(v.ch+=1)}return{start:h,end:v}}var i=[{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"}],o=Object.create(null),l=i.length,u=[{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=kn("");function p(f){f.setOption("disableInput",!0),f.setOption("showCursorWhenSelecting",!1),e.signal(f,"vim-mode-change",{mode:"normal"}),f.on("cursorActivity",vs),he(f),e.on(f.getInputField(),"paste",w(f))}function g(f){f.setOption("disableInput",!1),f.off("cursorActivity",vs),e.off(f.getInputField(),"paste",w(f)),f.state.vim=null,Ea&&clearTimeout(Ea)}function w(f){var h=f.state.vim;return h.onPasteFn||(h.onPasteFn=function(){h.insertMode||(f.setCursor(St(f.getCursor(),0,1)),vn.enterInsertMode(f,{},h))}),h.onPasteFn}var x=/[\d]/,S=[e.isWordChar,function(f){return f&&!e.isWordChar(f)&&!/\s/.test(f)}],E=[function(f){return/\S/.test(f)}],T=["<",">"],O=["-",'"',".",":","_","/","+"],j=/^\w$/,z=/^[A-Z]$/;try{z=RegExp("^[\\p{Lu}]$","u")}catch{}function V(f,h){return h>=f.firstLine()&&h<=f.lastLine()}function P(f){return/^[a-z]$/.test(f)}function U(f){return"()[]{}".indexOf(f)!=-1}function me(f){return x.test(f)}function $(f){return z.test(f)}function W(f){return/^\s*$/.test(f)}function ae(f){return".?!".indexOf(f)!=-1}function xe(f,h){for(var v=0;v<h.length;v++)if(h[v]==f)return!0;return!1}var _e={};function Te(f,h,v,b,_){if(h===void 0&&!_)throw Error("defaultValue is required unless callback is provided");if(v||(v="string"),_e[f]={type:v,defaultValue:h,callback:_},b)for(var k=0;k<b.length;k++)_e[b[k]]=_e[f];h&&Z(f,h)}function Z(f,h,v,b){var _=_e[f];b||(b={});var k=b.scope;if(!_)return Error("Unknown option: "+f);if(_.type=="boolean"){if(h&&h!==!0)return Error("Invalid argument: "+f+"="+h);h!==!1&&(h=!0)}_.callback?(k!=="local"&&_.callback(h,void 0),k!=="global"&&v&&_.callback(h,v)):(k!=="local"&&(_.value=_.type=="boolean"?!!h:h),k!=="global"&&v&&(v.state.vim.options[f]={value:h}))}function Q(f,h,v){var b=_e[f];v||(v={});var _=v.scope;if(!b)return Error("Unknown option: "+f);if(b.callback){let k=h&&b.callback(void 0,h);return _!=="global"&&k!==void 0?k:_==="local"?void 0:b.callback()}else return(_!=="global"&&h&&h.state.vim.options[f]||_!=="local"&&b||{}).value}Te("filetype",void 0,"string",["ft"],function(f,h){if(h!==void 0)if(f===void 0){let v=h.getOption("mode");return v=="null"?"":v}else{let v=f==""?"null":f;h.setOption("mode",v)}}),Te("textwidth",80,"number",["tw"],function(f,h){if(h!==void 0){if(f===void 0)return h.getOption("textwidth");var v=Math.round(f);v>1&&h.setOption("textwidth",v)}});var Y=function(){var f=100,h=-1,v=0,b=0,_=Array(f);function k(L,F,N){var le=_[h%f];function oe(J){var Ce=++h%f,ke=_[Ce];ke&&ke.clear(),_[Ce]=L.setBookmark(J)}if(le){var X=le.find();X&&!wt(X,F)&&oe(F)}else oe(F);oe(N),v=h,b=h-f+1,b<0&&(b=0)}function D(L,F){h+=F,h>v?h=v:h<b&&(h=b);var N=_[(f+h)%f];if(N&&!N.find()){var le=F>0?1:-1,oe,X=L.getCursor();do if(h+=le,N=_[(f+h)%f],N&&(oe=N.find())&&!wt(X,oe))break;while(h<v&&h>b)}return N}function I(L,F){var N=h,le=D(L,F);return h=N,le&&le.find()}return{cachedCursor:void 0,add:k,find:I,move:D}},ce=function(f){return f?{changes:f.changes,expectCursorActivityForChange:f.expectCursorActivityForChange}:{changes:[],expectCursorActivityForChange:!1}};class te{constructor(){this.latestRegister=void 0,this.isPlaying=!1,this.isRecording=!1,this.replaySearchQueries=[],this.onRecordingDone=void 0,this.lastInsertModeChanges=ce()}exitMacroRecordMode(){var h=G.macroModeState;h.onRecordingDone&&h.onRecordingDone(),h.onRecordingDone=void 0,h.isRecording=!1}enterMacroRecordMode(h,v){var b=G.registerController.getRegister(v);if(b){if(b.clear(),this.latestRegister=v,h.openDialog){var _=Fn("span",{class:"cm-vim-message"},"recording @"+v);this.onRecordingDone=h.openDialog(_,function(){},{bottom:!0})}this.isRecording=!0}}}function he(f){return f.state.vim||(f.state.vim={inputState:new Lr,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:""}),f.state.vim}var G;function Ne(){for(var f in G={searchQuery:null,searchIsReversed:!1,lastSubstituteReplacePart:void 0,jumpList:Y(),macroModeState:new te,lastCharacterSearch:{increment:0,forward:!0,selectedCharacter:""},registerController:new Nn({}),searchHistoryController:new Pr,exCommandHistoryController:new Pr},_e){var h=_e[f];h.value=h.defaultValue}}class qe{constructor(h,v){this.keyName=h,this.key=v.key,this.ctrlKey=v.ctrlKey,this.altKey=v.altKey,this.metaKey=v.metaKey,this.shiftKey=v.shiftKey}}var Qe,He={enterVimMode:p,leaveVimMode:g,buildKeyMap:function(){},getRegisterController:function(){return G.registerController},resetVimGlobalState_:Ne,getVimGlobalState_:function(){return G},maybeInitVimState_:he,suppressErrorLogging:!1,InsertModeKey:qe,map:function(f,h,v){En.map(f,h,v)},unmap:function(f,h){return En.unmap(f,h)},noremap:function(f,h,v){En.map(f,h,v,!0)},mapclear:function(f){var h=i.length,v=l,b=i.slice(0,h-v);if(i=i.slice(h-v),f)for(var _=b.length-1;_>=0;_--){var k=b[_];if(f!==k.context)if(k.context)this._mapCommand(k);else{var D=["normal","insert","visual"];for(var I in D)if(D[I]!==f){var L=Object.assign({},k);L.context=D[I],this._mapCommand(L)}}}},langmap:Ct,vimKeyFromEvent:cn,setOption:Z,getOption:Q,defineOption:Te,defineEx:function(f,h,v){if(!h)h=f;else if(f.indexOf(h)!==0)throw Error('(Vim.defineEx) "'+h+'" is not a prefix of "'+f+'", command not registered');Nr[f]=v,En.commandMap_[h]={name:f,shortName:h,type:"api"}},handleKey:function(f,h,v){var b=this.findKey(f,h,v);if(typeof b=="function")return b()},multiSelectHandleKey:qi,findKey:function(f,h,v){var b=he(f),_=f;function k(){var N=G.macroModeState;if(N.isRecording){if(h=="q")return N.exitMacroRecordMode(),yt(_),!0;v!="mapping"&&ni(N,h)}}function D(){if(h=="<Esc>"){if(b.visualMode)rt(_);else if(b.insertMode)Qn(_);else return;return yt(_),!0}}function I(){if(D())return!0;b.inputState.keyBuffer.push(h);var N=b.inputState.keyBuffer.join(""),le=h.length==1,oe=jn.matchCommand(N,i,b.inputState,"insert"),X=b.inputState.changeQueue;if(oe.type=="none")return yt(_),!1;if(oe.type=="partial"){if(oe.expectLiteralNext&&(b.expectLiteralNext=!0),Qe&&window.clearTimeout(Qe),Qe=le&&window.setTimeout(function(){b.insertMode&&b.inputState.keyBuffer.length&&yt(_)},Q("insertModeEscKeysTimeout")),le){var J=_.listSelections();(!X||X.removed.length!=J.length)&&(X=b.inputState.changeQueue=new Yr),X.inserted+=h;for(var Ce=0;Ce<J.length;Ce++){var ke=Tt(J[Ce].anchor,J[Ce].head),We=Bn(J[Ce].anchor,J[Ce].head),Ie=_.getRange(ke,_.state.overwrite?St(We,0,1):We);X.removed[Ce]=(X.removed[Ce]||"")+Ie}}return!le}else oe.type=="full"&&(b.inputState.keyBuffer.length=0);if(b.expectLiteralNext=!1,Qe&&window.clearTimeout(Qe),oe.command&&X){for(var J=_.listSelections(),Ce=0;Ce<J.length;Ce++){var $e=J[Ce].head;_.replaceRange(X.removed[Ce]||"",St($e,0,-X.inserted.length),$e,"+input")}G.macroModeState.lastInsertModeChanges.changes.pop()}return oe.command||yt(_),oe.command}function L(){if(k()||D())return!0;b.inputState.keyBuffer.push(h);var N=b.inputState.keyBuffer.join("");if(/^[1-9]\d*$/.test(N))return!0;var le=/^(\d*)(.*)$/.exec(N);if(!le)return yt(_),!1;var oe=b.visualMode?"visual":"normal",X=le[2]||le[1];b.inputState.operatorShortcut&&b.inputState.operatorShortcut.slice(-1)==X&&(X=b.inputState.operatorShortcut);var J=jn.matchCommand(X,i,b.inputState,oe);return J.type=="none"?(yt(_),!1):J.type=="partial"?(J.expectLiteralNext&&(b.expectLiteralNext=!0),!0):J.type=="clear"?(yt(_),!0):(b.expectLiteralNext=!1,b.inputState.keyBuffer.length=0,le=/^(\d*)(.*)$/.exec(N),le&&le[1]&&le[1]!="0"&&b.inputState.pushRepeatDigit(le[1]),J.command)}var F=b.insertMode?I():L();if(F===!1)return!b.insertMode&&(h.length===1||e.isMac&&/<A-.>/.test(h))?function(){return!0}:void 0;if(F===!0)return function(){return!0};if(F)return function(){return _.operation(function(){_.curOp.isVimOp=!0;try{if(typeof F!="object")return;F.type=="keyToKey"?bt(_,F.toKeys,F):jn.processCommand(_,b,F)}catch(N){throw _.state.vim=void 0,he(_),He.suppressErrorLogging||console.log(N),N}return!0})}},handleEx:function(f,h){En.processCommand(f,h)},defineMotion:wa,defineAction:hi,defineOperator:Ai,mapCommand:$u,_mapCommand:bi,defineRegister:Ri,exitVisualMode:rt,exitInsertMode:Qn},Fe=[],Oe=!1,Be;function gt(f){if(!Be)throw Error("No prompt to send key to");if(f[0]=="<"){var h=f.toLowerCase().slice(1,-1);if(h=h.split("-").pop()||"",h=="lt")f="<";else if(h=="space")f=" ";else if(h=="cr")f=`
|
|
93
|
+
`)}var gR=kr(),Pp=()=>({cellIds:new Set}),{valueAtom:Op,useActions:yR}=Ys(Pp,{markForCut:(e,t)=>({cellIds:new Set(t.cellIds)}),clear:()=>Pp()});Rf=Ne(e=>e(Op).cellIds),ny=Ne(null,(e,t)=>{t(Op,Pp())}),XE=function(){return yR()},gE=function(e){let t=(0,gR.c)(3),n=$n(Rf),i;return t[0]!==e||t[1]!==n?(i=n.has(e),t[0]=e,t[1]=n,t[2]=i):i=t[2],i},oT=function(){return $n(Op)},UE=(e,t,n)=>Cr.define(i=>new vR(i,e,t,n)),Ja=GC.define();var vR=class{constructor(e,t,n,i){pe(this,"isInitDispatch",!1);pe(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:[Ja.of(this)]});return}if(e.by==="import"){let t=[],n=0;for(let{diff:i,path:o}of e.events){if(o.join("/")!==this.docPath.join("/")||i.type!=="text")continue;let l=i.diff;for(let u of l)u.insert?t.push({from:n,to:n,insert:u.insert}):u.delete?(t.push({from:n,to:n+u.delete}),n+=u.delete):u.retain!=null&&(n+=u.retain);t.length>0&&this.view.dispatch({changes:t,annotations:[Ja.of(this)]})}}}});this.view=e,this.doc=t,this.docPath=n,this.getTextFromDoc=i,this.sub=t.subscribe(this.onRemoteUpdate),Promise.resolve().then(()=>{this.isInitDispatch=!0;let o=this.view.state.doc.toString(),l=this.getTextFromDoc(this.doc);o!==l.toString()&&e.dispatch({changes:[{from:0,to:this.view.state.doc.length,insert:l.toString()}],annotations:[Ja.of(this)]})})}update(e){if(this.isInitDispatch){this.isInitDispatch=!1;return}if(!e.docChanged||e.transactions.length>0&&(e.transactions[0].annotation(Ja)===this||e.transactions[0].annotation(Ja)==="undo"))return;let t=0;e.changes.iterChanges((n,i,o,l,u)=>{let d=u.sliceString(0,u.length,`
|
|
94
|
+
`);n!==i&&this.getTextFromDoc(this.doc).delete(n+t,i-n),d.length>0&&this.getTextFromDoc(this.doc).insert(n+t,d),t+=d.length-(i-n)}),this.doc.commit()}destroy(){var e;(e=this.sub)==null||e.call(this),this.sub=void 0}};O0=function(e,t){if(typeof window>"u")return;let n=`__marimo__${t}`;window[n]&&Se.warn(`Overwriting existing debug object ${n}`),window[n]=e};var bR={markdown:!0,wasm_layouts:!1,rtc_v2:!1,cache_panel:!1,external_agents:!1,debugger:!1,line_timing:!1};tl=function(e){var t,n;return((n=(t=qC())==null?void 0:t.experimental)==null?void 0:n[e])??bR[e]};function wR(e,t){Sr().saveUserConfig({config:{experimental:{[e]:t}}})}O0(wR,"setFeatureFlag");function mu(e,t){return{get:()=>t.get(e),sub:n=>t.sub(e,()=>n(t.get(e)))}}function xR(e,{offset:t,body:n=window,behavior:i="smooth"}){let o=(t==null?void 0:t.top)??0,l=(t==null?void 0:t.bottom)??0,u=e.getBoundingClientRect();if(u.top<o){n.scrollBy({top:u.top-o,behavior:i});return}if(u.bottom>window.innerHeight-l){n.scrollBy({top:u.bottom-window.innerHeight+l,behavior:i});return}}Ac=function(e){return e?e.state.field(Ir).type:"python"};function _R(e,t){return!e||Ac(e)===t?!1:e.state.doc.toString().trim()===""?!0:Tr[t].isSupported(ci(e))}hf=function(e,t,n={}){return!n.force&&!_R(e,t)?!1:(vf(e,{language:t}),t)};function kR(e){return Si.of([{key:e.getHotkey("cell.format").key,preventDefault:!0,run:t=>(Tf({[t.state.facet(oa)]:t}),!0)},{key:e.getHotkey("cell.viewAsMarkdown").key,preventDefault:!0,run:t=>{let n=hf(t,Ac(t)==="markdown"?"python":"markdown",{force:!0});return n==="markdown"&&t.state.facet(Lt).afterToggleMarkdown(),n!==!1}},{key:e.getHotkey("cell.viewAsSQL").key,preventDefault:!0,run:t=>{let n=hf(t,Ac(t)==="sql"?"python":"sql",{force:!0});return n==="sql"&&t.state.facet(Lt).afterToggleSQL(),n!==!1}}])}sE=function(){return At.updateListener.of(e=>{if(e.view.hasFocus&&e.heightChanged&&e.docChanged){if(e.transactions.some(t=>t.effects.some(n=>n.is(wl))))return;tw(e.view,{behavior:"smooth"})}})};function tw(e,t){let n=e.dom.getElementsByClassName("cm-activeLine cm-line");if(n.length===1){let i=n[0],o=document.getElementById("App");Vn(o,"App not found"),xR(i,{offset:{top:30,bottom:150},body:o,behavior:t.behavior})}}function CR(){return{}}let SR,ER,nw;({reducer:SR,createActions:ER,valueAtom:Ga,useActions:nw}=Ys(CR,{setVariables:(e,t)=>{let n={...e},i={};for(let o of t)i[o.name]={...n[o.name],...o};return i},addVariables:(e,t)=>{let n={...e};for(let i of t)n[i.name]={...n[i.name],...i};return n},setMetadata:(e,t)=>{let n={...e};for(let{name:i,value:o,dataType:l}of t)n[i]&&(n[i]={...n[i],value:o,dataType:l});return n}})),ZE=()=>$n(Ga),NS=function(){return nw()},Qg=function(e){let t=e.storage||il;return{getItem(n,i){try{let o=t.getItem(n);if(!o)return i;let l=JSON.parse(o);return e.fromSerializable(l)}catch(o){return Se.warn(`Error getting ${n} from storage`,o),i}},setItem:(n,i)=>{t.setItem(n,JSON.stringify(e.toSerializable(i)))},removeItem:n=>{t.removeItem(n)}}},pf=Qy(()=>il),Tc=[{type:"files",Icon:Ib,label:"Files",tooltip:"View files",defaultSection:"sidebar",additionalKeywords:["explorer","browser","directory"]},{type:"variables",Icon:m0,label:"Variables",tooltip:"Explore variables and data sources",defaultSection:"sidebar",additionalKeywords:["state","scope","inspector"]},{type:"packages",Icon:Gg,label:"Packages",tooltip:"Manage packages",defaultSection:"sidebar",additionalKeywords:["dependencies","pip","install"]},{type:"ai",Icon:n0,label:"AI",tooltip:"Chat & Agents",defaultSection:"sidebar",additionalKeywords:["chat","copilot","assistant"]},{type:"outline",Icon:W0,label:"Outline",tooltip:"View outline",defaultSection:"sidebar",additionalKeywords:["toc","structure","headings"]},{type:"documentation",Icon:Wg,label:"Docs",tooltip:"View live docs",defaultSection:"sidebar",additionalKeywords:["reference","api"]},{type:"dependencies",Icon:o0,label:"Dependencies",tooltip:"Explore dependencies",defaultSection:"sidebar",additionalKeywords:["graph","imports"]},{type:"errors",Icon:Jg,label:"Errors",tooltip:"View errors",defaultSection:"developer-panel",additionalKeywords:["exceptions","problems","diagnostics"]},{type:"scratchpad",Icon:V0,label:"Scratchpad",tooltip:"Scratchpad",defaultSection:"developer-panel",additionalKeywords:["scratch","draft","playground"]},{type:"tracing",Icon:t0,label:"Tracing",tooltip:"View tracing",defaultSection:"developer-panel",additionalKeywords:["profiling","performance"]},{type:"secrets",Icon:Ab,label:"Secrets",tooltip:"Manage secrets",defaultSection:"developer-panel",hidden:Xd(),additionalKeywords:["env","environment","keys","credentials"]},{type:"logs",Icon:i0,label:"Logs",tooltip:"View logs",defaultSection:"developer-panel",additionalKeywords:["console","stdout"]},{type:"terminal",Icon:c0,label:"Terminal",tooltip:"Terminal",hidden:Xd(),defaultSection:"developer-panel",requiredCapability:"terminal",additionalKeywords:["shell","console","bash","command"]},{type:"snippets",Icon:Lb,label:"Snippets",tooltip:"Snippets",defaultSection:"developer-panel",additionalKeywords:["templates","examples"]},{type:"cache",Icon:Ng,label:"Cache",tooltip:"View cache",defaultSection:"developer-panel",hidden:!tl("cache_panel"),additionalKeywords:["memory","memoize"]}],tE=new Map(Tc.map(e=>[e.type,e])),iE=function({panel:e,capabilities:t,aiEnabled:n}){return!!(e.hidden||e.type==="ai"&&!n||e.requiredCapability&&!t[e.requiredCapability])};var TR=kr(),Mp={sidebar:Tc.filter(e=>!e.hidden&&e.defaultSection==="sidebar").map(e=>e.type),developerPanel:Tc.filter(e=>!e.hidden&&e.defaultSection==="developer-panel").map(e=>e.type)};function DR(e){let t=new Set([...e.sidebar,...e.developerPanel]);return{sidebar:[...e.sidebar,...Mp.sidebar.filter(n=>!t.has(n))],developerPanel:[...e.developerPanel,...Mp.developerPanel.filter(n=>!t.has(n))]}}fy=Oc("marimo:panel-layout",Mp,Qg({toSerializable:e=>e,fromSerializable:e=>DR(e)}),{getOnInit:!0});function rw(e){let t=Me.get(fy);return t.sidebar.includes(e)?"sidebar":t.developerPanel.includes(e)?"developer-panel":null}var iw="marimo:sidebar",aw=new xf(MC({selectedPanel:OC().optional().transform(e=>e),isSidebarOpen:NC(),isDeveloperPanelOpen:NC().optional().default(!1),selectedDeveloperPanelTab:OC().optional().default("errors").transform(e=>e)}),RR);function RR(){return{selectedPanel:"variables",isSidebarOpen:!1,isDeveloperPanelOpen:!1,selectedDeveloperPanelTab:"errors"}}let ow,IR,sw;({reducer:ow,createActions:IR,valueAtom:Dc,useActions:sw}=Ys(()=>aw.get(iw),{openApplication:(e,t)=>{let n=rw(t);return n==="sidebar"?{...e,selectedPanel:t,isSidebarOpen:!0}:n==="developer-panel"?{...e,selectedDeveloperPanelTab:t,isDeveloperPanelOpen:!0}:e},toggleApplication:(e,t)=>{let n=rw(t);return n==="sidebar"?{...e,selectedPanel:t,isSidebarOpen:e.isSidebarOpen?e.selectedPanel!==t:!0}:n==="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)=>aw.set(iw,t)])),nE=()=>{let e=(0,TR.c)(2),t=$n(Dc);if(t.isSidebarOpen)return t;let n;return e[0]===t?n=e[1]:(n={...t,selectedPanel:void 0},e[0]=t,e[1]=n),n},wS=function(){return sw()},QS=function(e){Me.set(Dc,t=>ow(t,{type:"openApplication",payload:e}))},Zg=Ne({terminal:!1,pylsp:!1,basedpyright:!1,ty:!1,pyrefly:!1});function ya(e){var t;return((t=Me.get(Zg))==null?void 0:t[e])??!1}lf=Ne({documentation:null}),Ee={VariableName:"VariableName",FunctionDefinition:"FunctionDefinition",ClassDefinition:"ClassDefinition",LambdaExpression:"LambdaExpression",ParamList:"ParamList",Decorator:"Decorator",AssignStatement:"AssignStatement",ForStatement:"ForStatement",ImportStatement:"ImportStatement",TryStatement:"TryStatement",WithStatement:"WithStatement",TupleExpression:"TupleExpression",ArrayExpression:"ArrayExpression",ParenthesizedExpression:"ParenthesizedExpression",CallExpression:"CallExpression",ArgList:"ArgList",AssignOp:"AssignOp",ArrayComprehensionExpression:"ArrayComprehensionExpression",SetComprehensionExpression:"SetComprehensionExpression",DictionaryComprehensionExpression:"DictionaryComprehensionExpression",ComprehensionExpression:"ComprehensionExpression",Comment:"Comment",String:"String",FormatString:"FormatString"},Xn={For:"for",In:"in",As:"as",Import:"import"},rl=new Set([Ee.FunctionDefinition,Ee.LambdaExpression,Ee.ArrayComprehensionExpression,Ee.SetComprehensionExpression,Ee.DictionaryComprehensionExpression,Ee.ComprehensionExpression,Ee.ClassDefinition]),zE=new Set([Ee.Comment,Ee.String,Ee.FormatString]);function AR(e){let t=Dg(e.state);if(!t||$g(t))return[];let n=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(n.size===0)return[];let i=[],o=new Map,l=new Map,u=new Map;function d(E,T){var U,me,$,W,ae,xe,_e,Te,Z;let O=E.cursor(),j=O.name,z=O.from,V=rl.has(j),P=T;switch(V&&(P=[...T,z],o.set(z,new Set),l.set(z,j)),j){case Ee.FunctionDefinition:{let Q=E.cursor();Q.firstChild();do if(Q.name===Ee.VariableName){let ce=e.state.doc.sliceString(Q.from,Q.to),te=T[T.length-1]??-1;o.has(te)||o.set(te,new Set),(U=o.get(te))==null||U.add(ce);break}while(Q.nextSibling());let Y=E.cursor();Y.firstChild();do if(Y.name===Ee.ParamList){let ce=Y.node.cursor();ce.firstChild();do if(ce.name===Ee.VariableName){let te=e.state.doc.sliceString(ce.from,ce.to);(me=o.get(z))==null||me.add(te)}while(ce.nextSibling())}while(Y.nextSibling());break}case Ee.LambdaExpression:{let Q=E.cursor();Q.firstChild();do if(Q.name===Ee.ParamList){let Y=Q.node.cursor();Y.firstChild();do if(Y.name===Ee.VariableName){let ce=e.state.doc.sliceString(Y.from,Y.to);($=o.get(z))==null||$.add(ce)}while(Y.nextSibling())}while(Q.nextSibling());break}case Ee.ArrayComprehensionExpression:case Ee.DictionaryComprehensionExpression:case Ee.SetComprehensionExpression:case Ee.ComprehensionExpression:{let Q=E.cursor();Q.firstChild();let Y=!1;do if(Q.name===Xn.For)Y=!0;else if(Y&&Q.name===Ee.VariableName){let ce=e.state.doc.sliceString(Q.from,Q.to);(W=o.get(z))==null||W.add(ce)}else if(Y&&Q.name===Ee.TupleExpression){let ce=Q.node.cursor();ce.firstChild();do if(ce.name===Ee.VariableName){let te=e.state.doc.sliceString(ce.from,ce.to);(ae=o.get(z))==null||ae.add(te)}while(ce.nextSibling())}else Y&&Q.name===Xn.In&&(Y=!1);while(Q.nextSibling());break}case Ee.ClassDefinition:{let Q=E.cursor();Q.firstChild();do if(Q.name===Ee.VariableName){let Y=e.state.doc.sliceString(Q.from,Q.to),ce=T[T.length-1]??-1;o.has(ce)||o.set(ce,new Set),(xe=o.get(ce))==null||xe.add(Y);break}while(Q.nextSibling());u.set(z,[]);break}case Ee.AssignStatement:{let Q=E.cursor(),Y=[];Q.firstChild();do Q.name===Ee.AssignOp&&Y.push(Q.from);while(Q.nextSibling());let ce=Y[Y.length-1],te=E.cursor();te.firstChild();let he=P[P.length-1]??-1;do te.from<ce&&Np(te,{currentScope:he,state:e.state,allDeclarations:o,scopeTypes:l,classLevelDeclarations:u,assignmentPosition:O.to});while(te.nextSibling());break}case Ee.ForStatement:{let Q=E.cursor();Q.firstChild();let Y=!1;do if(Q.name===Xn.For)Y=!0;else if(Y&&Q.name===Ee.VariableName){let ce=e.state.doc.sliceString(Q.from,Q.to),te=P[P.length-1]??-1;o.has(te)||o.set(te,new Set),(_e=o.get(te))==null||_e.add(ce)}else Y&&Q.name===Xn.In&&(Y=!1);while(Q.nextSibling());break}case Ee.ImportStatement:{let Q=E.cursor();Q.firstChild();let Y=P[P.length-1]??-1;o.has(Y)||o.set(Y,new Set);let ce=o.get(Y),te=!1,he=null,G=()=>{he!==null&&(ce==null||ce.add(he)),he=null};do{if(Q.name===Xn.Import){te=!0;continue}if(te){if(Q.name===Xn.As){he=null;continue}Q.name===Ee.VariableName?(G(),he=e.state.doc.sliceString(Q.from,Q.to)):Q.name===","&&G()}}while(Q.nextSibling());G();break}case Ee.TryStatement:{let Q=E.cursor();Q.firstChild();let Y=!1;do if(Q.name===Xn.As)Y=!0;else if(Y&&Q.name===Ee.VariableName){let ce=e.state.doc.sliceString(Q.from,Q.to),te=P[P.length-1]??-1;o.has(te)||o.set(te,new Set),(Te=o.get(te))==null||Te.add(ce),Y=!1}while(Q.nextSibling());break}case Ee.WithStatement:{let Q=E.cursor();Q.firstChild();let Y=!1;do if(Q.name===Xn.As)Y=!0;else if(Y&&Q.name===Ee.VariableName){let ce=e.state.doc.sliceString(Q.from,Q.to),te=P[P.length-1]??-1;o.has(te)||o.set(te,new Set),(Z=o.get(te))==null||Z.add(ce),Y=!1}while(Q.nextSibling());break}}S(O,Q=>{d(Q,P)})}function p(E,T,O){let j=u.get(T);return j?j.some(([z,V])=>z===E&&V<O):!1}function g(E,T,O){var j,z;for(let V of T)if(l.get(V)===Ee.ClassDefinition){if(p(E,V,O))return!0}else if((j=o.get(V))!=null&&j.has(E))return!0;return((z=o.get(-1))==null?void 0:z.has(E))??!1}function w(E,T){let O=E.cursor(),j=O.name,z=O.from;if(j===Ee.ImportStatement)return;let V=rl.has(j),P=T;if(V&&(P=[...T,z]),j===Ee.VariableName){let U=e.state.doc.sliceString(O.from,O.to);x(U,O)&&(g(U,P,O.from)||i.push({from:O.from,to:O.to,variableName:U}))}S(O,U=>{w(U,P)})}function x(E,T){return n.has(E)&&!OR(T)&&!LR(T)&&!PR(T)}function S(E,T){if(E.firstChild())do T(E.node);while(E.nextSibling())}return d(t,[]),w(t,[]),i}function LR(e){let t=e.node.cursor();if(t.moveTo(e.from),t.parent()&&t.name===Ee.CallExpression&&t.firstChild())do if(t.name===Ee.ArgList&&t.firstChild()){do if(t.from===e.from&&t.to===e.to)return t.nextSibling()&&t.name===Ee.AssignOp;while(t.nextSibling());break}while(t.nextSibling());return!1}function PR(e){let t=e.node.cursor();if(t.parent()&&t.name===Ee.AssignStatement){let n=t.node.cursor();n.firstChild();let i=-1;do if(n.name===Ee.AssignOp){i=n.from;break}while(n.nextSibling());return i!==-1&&e.from<i}return!1}function OR(e){let t=e.node.cursor();return!!(t.prevSibling()&&t.name===".")}$g=function(e){let t=e.cursor();do if(t.name==="\u26A0"||t.type.isError)return!0;while(t.next());return!1};function Np(e,t){var n;switch(e.name){case Ee.VariableName:{let i=t.state.doc.sliceString(e.from,e.to);if(t.currentScope!==-1&&t.scopeTypes.get(t.currentScope)===Ee.ClassDefinition){let o=t.classLevelDeclarations.get(t.currentScope);o&&o.push([i,t.assignmentPosition])}else t.allDeclarations.has(t.currentScope)||t.allDeclarations.set(t.currentScope,new Set),(n=t.allDeclarations.get(t.currentScope))==null||n.add(i);break}case Ee.TupleExpression:{let i=e.node.cursor();i.firstChild();do Np(i,t);while(i.nextSibling());break}case Ee.ArrayExpression:{let i=e.node.cursor();i.firstChild();do Np(i,t);while(i.nextSibling());break}}}var MR=Xt.mark({class:"mo-cm-reactive-reference"});ES=Xt.mark({class:"mo-cm-reactive-reference-hover"});var lw=sr.define(),NR=class{constructor(e,t){pe(this,"highlightDebounceMs",300);this.view=e,this.cellId=t,this.scheduleHighlighting=Sg(()=>{this.runHighlighting()},this.highlightDebounceMs),this.variablesUnsubscribe=Me.sub(Ga,()=>{this.scheduleHighlighting()}),this.scheduleHighlighting()}update(e){(e.docChanged||e.focusChanged)&&this.scheduleHighlighting()}destroy(){this.scheduleHighlighting.cancel(),this.variablesUnsubscribe()}runHighlighting(){let e=AR({state:this.view.state,cellId:this.cellId,variables:Me.get(Ga)});e.length>0&&Se.debug(`Found ${e.length} reactive variables in cell ${this.cellId}`),queueMicrotask(()=>{this.view.dispatch({effects:lw.of(e)})})}};If=li.define({create(){return{decorations:Xt.none,ranges:[]}},update(e,t){let n={decorations:e.decorations.map(t.changes),ranges:e.ranges};for(let i of t.effects)i.is(lw)&&(n={decorations:Xt.set(i.value.map(o=>MR.range(o.from,o.to))),ranges:i.value});return n},provide:e=>At.decorations.from(e,t=>t.decorations)});function jR(e){return[If,Cr.define(t=>new NR(t,e))]}HS=function(e,t){return t?jR(e):[]};function cw(e,t=!1){if(!e)return null;let n=document.createElement("span");if(n.classList.add("mo-cm-tooltip"),n.classList.add("docs-documentation"),t&&n.classList.add("cm-tooltip-section"),n.style.display="flex",n.style.flexDirection="column",n.style.gap=".8rem",n.innerHTML=e,t){let i=document.createElement("div");i.classList.add("text-xs","text-muted-foreground","font-medium","pt-1","-mt-2","border-t","border-border");let o=document.createElement("kbd");o.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",o.textContent=n5()?"\u2318":"Ctrl",i.append(document.createTextNode("Jump to defining cell ")),i.append(o),i.append(document.createTextNode(" + Click")),n.append(i)}return n}sf=new el("autocomplete-result",async(e,t)=>{let{sendCodeCompletionRequest:n}=Sr();await n({id:e,...t})});var qR={param:3,property:2};const jp={asCompletionResult(e,t){return{from:e-t.prefix_length,options:t.options.map(n=>({label:n.name,type:n.type,boost:qR[n.type]??1,info:()=>cw(n.completion_info)})),validFor:/^\w*$/}},asHoverTooltip({position:e,message:t,limitToType:n,excludeTypes:i,exactName:o,showGoToDefinitionHint:l=!1}){let u=zR(t.options,o);if(!u)return;let d=e-t.prefix_length,p=cw(u.completion_info,l);if(p&&!(n&&u.type!==n)&&!(i!=null&&i.includes(u.type)))return{pos:d,html:u.completion_info,end:d+u.name.length,above:!0,create:()=>({dom:p,resize:!1})}}};function zR(e,t){if(e.length!==0){if(e.length===1)return e[0];if(t)return e.find(n=>n.name===t)}}ZS=function(e){var t,n,i,o;return[(t=e==null?void 0:e.pylsp)!=null&&t.enabled&&ya("pylsp")||(n=e==null?void 0:e.ty)!=null&&n.enabled&&ya("ty")||(i=e==null?void 0:e.pyrefly)!=null&&i.enabled&&ya("pyrefly")||(o=e==null?void 0:e.basedpyright)!=null&&o.enabled&&ya("basedpyright")?[]:Ig(async(l,u)=>{let d=await uw({view:l,pos:u,excludeTypes:["tooltip"]});return d===null||d==="cancelled"?null:d},{hideOnChange:!0}),VR]};async function uw({view:e,pos:t,excludeTypes:n}){var w;let i=lr.findElement(e.dom);if(!i)return Se.error("Failed to find active cell."),null;let o=lr.parse(i.id),{startToken:l,endToken:u}=qp(e.state.doc,t),d=((w=e.state.field(If,!1))==null?void 0:w.ranges.some(x=>t>=x.from&&t<=x.to))??!1,p=await sf.request({document:e.state.doc.slice(0,u).toString(),cellId:o});if(!p)return"cancelled";let g=e.state.doc.slice(l,u).toString();return jp.asHoverTooltip({position:u,message:p,exactName:g,excludeTypes:n,showGoToDefinitionHint:d})??null}function qp(e,t){let n=t,i=n>0?e.sliceString(n-1,n):"",o=n<e.length?e.sliceString(n,n+1):"";i==="("&&o===")"&&--n;let l=n,u=n;for(;l>0;){let d=e.sliceString(l-1,l);if(!/\w/.test(d))break;l--}for(;u<e.length;){let d=e.sliceString(u,u+1);if(!/\w/.test(d))break;u++}return{startToken:l,endToken:u}}function FR(e){let{head:t}=e.selection.main,n=e.doc.sliceString(t-1,t);return/\w/.test(n)}var $R=Sg(async(e,t)=>{if(Me.get(Dc).selectedPanel!=="documentation")return;let n=await uw({view:e,pos:t});n!=="cancelled"&&Me.set(lf,{documentation:(n==null?void 0:n.html)??null})},300),VR=At.updateListener.of(e=>{if(e.selectionSet&&FR(e.state)){let t=e.state.selection.main.head;$R(e.view,t)}});function HR(e){var t=e.Pos;function n(f,h,v){if(h.line===v.line&&h.ch>=v.ch-1){var b=f.getLine(h.line).charCodeAt(h.ch);55296<=b&&b<=55551&&(v.ch+=1)}return{start:h,end:v}}var i=[{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"}],o=Object.create(null),l=i.length,u=[{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=kn("");function p(f){f.setOption("disableInput",!0),f.setOption("showCursorWhenSelecting",!1),e.signal(f,"vim-mode-change",{mode:"normal"}),f.on("cursorActivity",vs),he(f),e.on(f.getInputField(),"paste",w(f))}function g(f){f.setOption("disableInput",!1),f.off("cursorActivity",vs),e.off(f.getInputField(),"paste",w(f)),f.state.vim=null,Ta&&clearTimeout(Ta)}function w(f){var h=f.state.vim;return h.onPasteFn||(h.onPasteFn=function(){h.insertMode||(f.setCursor(St(f.getCursor(),0,1)),vn.enterInsertMode(f,{},h))}),h.onPasteFn}var x=/[\d]/,S=[e.isWordChar,function(f){return f&&!e.isWordChar(f)&&!/\s/.test(f)}],E=[function(f){return/\S/.test(f)}],T=["<",">"],O=["-",'"',".",":","_","/","+"],j=/^\w$/,z=/^[A-Z]$/;try{z=RegExp("^[\\p{Lu}]$","u")}catch{}function V(f,h){return h>=f.firstLine()&&h<=f.lastLine()}function P(f){return/^[a-z]$/.test(f)}function U(f){return"()[]{}".indexOf(f)!=-1}function me(f){return x.test(f)}function $(f){return z.test(f)}function W(f){return/^\s*$/.test(f)}function ae(f){return".?!".indexOf(f)!=-1}function xe(f,h){for(var v=0;v<h.length;v++)if(h[v]==f)return!0;return!1}var _e={};function Te(f,h,v,b,_){if(h===void 0&&!_)throw Error("defaultValue is required unless callback is provided");if(v||(v="string"),_e[f]={type:v,defaultValue:h,callback:_},b)for(var k=0;k<b.length;k++)_e[b[k]]=_e[f];h&&Z(f,h)}function Z(f,h,v,b){var _=_e[f];b||(b={});var k=b.scope;if(!_)return Error("Unknown option: "+f);if(_.type=="boolean"){if(h&&h!==!0)return Error("Invalid argument: "+f+"="+h);h!==!1&&(h=!0)}_.callback?(k!=="local"&&_.callback(h,void 0),k!=="global"&&v&&_.callback(h,v)):(k!=="local"&&(_.value=_.type=="boolean"?!!h:h),k!=="global"&&v&&(v.state.vim.options[f]={value:h}))}function Q(f,h,v){var b=_e[f];v||(v={});var _=v.scope;if(!b)return Error("Unknown option: "+f);if(b.callback){let k=h&&b.callback(void 0,h);return _!=="global"&&k!==void 0?k:_==="local"?void 0:b.callback()}else return(_!=="global"&&h&&h.state.vim.options[f]||_!=="local"&&b||{}).value}Te("filetype",void 0,"string",["ft"],function(f,h){if(h!==void 0)if(f===void 0){let v=h.getOption("mode");return v=="null"?"":v}else{let v=f==""?"null":f;h.setOption("mode",v)}}),Te("textwidth",80,"number",["tw"],function(f,h){if(h!==void 0){if(f===void 0)return h.getOption("textwidth");var v=Math.round(f);v>1&&h.setOption("textwidth",v)}});var Y=function(){var f=100,h=-1,v=0,b=0,_=Array(f);function k(L,F,N){var le=_[h%f];function oe(J){var Ce=++h%f,ke=_[Ce];ke&&ke.clear(),_[Ce]=L.setBookmark(J)}if(le){var X=le.find();X&&!wt(X,F)&&oe(F)}else oe(F);oe(N),v=h,b=h-f+1,b<0&&(b=0)}function D(L,F){h+=F,h>v?h=v:h<b&&(h=b);var N=_[(f+h)%f];if(N&&!N.find()){var le=F>0?1:-1,oe,X=L.getCursor();do if(h+=le,N=_[(f+h)%f],N&&(oe=N.find())&&!wt(X,oe))break;while(h<v&&h>b)}return N}function I(L,F){var N=h,le=D(L,F);return h=N,le&&le.find()}return{cachedCursor:void 0,add:k,find:I,move:D}},ce=function(f){return f?{changes:f.changes,expectCursorActivityForChange:f.expectCursorActivityForChange}:{changes:[],expectCursorActivityForChange:!1}};class te{constructor(){this.latestRegister=void 0,this.isPlaying=!1,this.isRecording=!1,this.replaySearchQueries=[],this.onRecordingDone=void 0,this.lastInsertModeChanges=ce()}exitMacroRecordMode(){var h=G.macroModeState;h.onRecordingDone&&h.onRecordingDone(),h.onRecordingDone=void 0,h.isRecording=!1}enterMacroRecordMode(h,v){var b=G.registerController.getRegister(v);if(b){if(b.clear(),this.latestRegister=v,h.openDialog){var _=Fn("span",{class:"cm-vim-message"},"recording @"+v);this.onRecordingDone=h.openDialog(_,function(){},{bottom:!0})}this.isRecording=!0}}}function he(f){return f.state.vim||(f.state.vim={inputState:new Lr,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:""}),f.state.vim}var G;function je(){for(var f in G={searchQuery:null,searchIsReversed:!1,lastSubstituteReplacePart:void 0,jumpList:Y(),macroModeState:new te,lastCharacterSearch:{increment:0,forward:!0,selectedCharacter:""},registerController:new Nn({}),searchHistoryController:new Pr,exCommandHistoryController:new Pr},_e){var h=_e[f];h.value=h.defaultValue}}class qe{constructor(h,v){this.keyName=h,this.key=v.key,this.ctrlKey=v.ctrlKey,this.altKey=v.altKey,this.metaKey=v.metaKey,this.shiftKey=v.shiftKey}}var Qe,He={enterVimMode:p,leaveVimMode:g,buildKeyMap:function(){},getRegisterController:function(){return G.registerController},resetVimGlobalState_:je,getVimGlobalState_:function(){return G},maybeInitVimState_:he,suppressErrorLogging:!1,InsertModeKey:qe,map:function(f,h,v){En.map(f,h,v)},unmap:function(f,h){return En.unmap(f,h)},noremap:function(f,h,v){En.map(f,h,v,!0)},mapclear:function(f){var h=i.length,v=l,b=i.slice(0,h-v);if(i=i.slice(h-v),f)for(var _=b.length-1;_>=0;_--){var k=b[_];if(f!==k.context)if(k.context)this._mapCommand(k);else{var D=["normal","insert","visual"];for(var I in D)if(D[I]!==f){var L=Object.assign({},k);L.context=D[I],this._mapCommand(L)}}}},langmap:Ct,vimKeyFromEvent:cn,setOption:Z,getOption:Q,defineOption:Te,defineEx:function(f,h,v){if(!h)h=f;else if(f.indexOf(h)!==0)throw Error('(Vim.defineEx) "'+h+'" is not a prefix of "'+f+'", command not registered');Nr[f]=v,En.commandMap_[h]={name:f,shortName:h,type:"api"}},handleKey:function(f,h,v){var b=this.findKey(f,h,v);if(typeof b=="function")return b()},multiSelectHandleKey:qi,findKey:function(f,h,v){var b=he(f),_=f;function k(){var N=G.macroModeState;if(N.isRecording){if(h=="q")return N.exitMacroRecordMode(),yt(_),!0;v!="mapping"&&ni(N,h)}}function D(){if(h=="<Esc>"){if(b.visualMode)rt(_);else if(b.insertMode)Qn(_);else return;return yt(_),!0}}function I(){if(D())return!0;b.inputState.keyBuffer.push(h);var N=b.inputState.keyBuffer.join(""),le=h.length==1,oe=jn.matchCommand(N,i,b.inputState,"insert"),X=b.inputState.changeQueue;if(oe.type=="none")return yt(_),!1;if(oe.type=="partial"){if(oe.expectLiteralNext&&(b.expectLiteralNext=!0),Qe&&window.clearTimeout(Qe),Qe=le&&window.setTimeout(function(){b.insertMode&&b.inputState.keyBuffer.length&&yt(_)},Q("insertModeEscKeysTimeout")),le){var J=_.listSelections();(!X||X.removed.length!=J.length)&&(X=b.inputState.changeQueue=new Yr),X.inserted+=h;for(var Ce=0;Ce<J.length;Ce++){var ke=Tt(J[Ce].anchor,J[Ce].head),We=Bn(J[Ce].anchor,J[Ce].head),Ie=_.getRange(ke,_.state.overwrite?St(We,0,1):We);X.removed[Ce]=(X.removed[Ce]||"")+Ie}}return!le}else oe.type=="full"&&(b.inputState.keyBuffer.length=0);if(b.expectLiteralNext=!1,Qe&&window.clearTimeout(Qe),oe.command&&X){for(var J=_.listSelections(),Ce=0;Ce<J.length;Ce++){var $e=J[Ce].head;_.replaceRange(X.removed[Ce]||"",St($e,0,-X.inserted.length),$e,"+input")}G.macroModeState.lastInsertModeChanges.changes.pop()}return oe.command||yt(_),oe.command}function L(){if(k()||D())return!0;b.inputState.keyBuffer.push(h);var N=b.inputState.keyBuffer.join("");if(/^[1-9]\d*$/.test(N))return!0;var le=/^(\d*)(.*)$/.exec(N);if(!le)return yt(_),!1;var oe=b.visualMode?"visual":"normal",X=le[2]||le[1];b.inputState.operatorShortcut&&b.inputState.operatorShortcut.slice(-1)==X&&(X=b.inputState.operatorShortcut);var J=jn.matchCommand(X,i,b.inputState,oe);return J.type=="none"?(yt(_),!1):J.type=="partial"?(J.expectLiteralNext&&(b.expectLiteralNext=!0),!0):J.type=="clear"?(yt(_),!0):(b.expectLiteralNext=!1,b.inputState.keyBuffer.length=0,le=/^(\d*)(.*)$/.exec(N),le&&le[1]&&le[1]!="0"&&b.inputState.pushRepeatDigit(le[1]),J.command)}var F=b.insertMode?I():L();if(F===!1)return!b.insertMode&&(h.length===1||e.isMac&&/<A-.>/.test(h))?function(){return!0}:void 0;if(F===!0)return function(){return!0};if(F)return function(){return _.operation(function(){_.curOp.isVimOp=!0;try{if(typeof F!="object")return;F.type=="keyToKey"?bt(_,F.toKeys,F):jn.processCommand(_,b,F)}catch(N){throw _.state.vim=void 0,he(_),He.suppressErrorLogging||console.log(N),N}return!0})}},handleEx:function(f,h){En.processCommand(f,h)},defineMotion:xa,defineAction:hi,defineOperator:Ai,mapCommand:Vu,_mapCommand:bi,defineRegister:Ri,exitVisualMode:rt,exitInsertMode:Qn},Fe=[],Oe=!1,Be;function gt(f){if(!Be)throw Error("No prompt to send key to");if(f[0]=="<"){var h=f.toLowerCase().slice(1,-1);if(h=h.split("-").pop()||"",h=="lt")f="<";else if(h=="space")f=" ";else if(h=="cr")f=`
|
|
95
95
|
`;else if(Xe[h]){var v=Be.value||"",b={key:Xe[h],target:{value:v,selectionEnd:v.length,selectionStart:v.length}};Be.onKeyDown&&Be.onKeyDown(b,Be.value,k),Be&&Be.onKeyUp&&Be.onKeyUp(b,Be.value,k);return}}if(f==`
|
|
96
96
|
`){var _=Be;Be=null,_.onClose&&_.onClose(_.value)}else Be.value=(Be.value||"")+f;function k(D){Be&&(typeof D=="string"?Be.value=D:Be=null)}}function bt(f,h,v){var b=Oe;if(v){if(Fe.indexOf(v)!=-1)return;Fe.push(v),Oe=v.noremap!=0}try{for(var _=he(f),k=/<(?:[CSMA]-)*\w+>|./gi,D;D=k.exec(h);){var I=D[0],L=_.insertMode;if(Be){gt(I);continue}if(!He.handleKey(f,I,"mapping")&&L&&_.insertMode){if(I[0]=="<"){var F=I.toLowerCase().slice(1,-1);if(F=F.split("-").pop()||"",F=="lt")I="<";else if(F=="space")I=" ";else if(F=="cr")I=`
|
|
97
|
-
`;else if(Xe.hasOwnProperty(F)){I=Xe[F],
|
|
97
|
+
`;else if(Xe.hasOwnProperty(F)){I=Xe[F],wo(f,I);continue}else I=I[0],k.lastIndex=D.index+1}f.replaceSelection(I)}}}finally{if(Fe.pop(),Oe=Fe.length?b:!1,!Fe.length&&Be){var N=Be;Be=null,Sa(f,N)}}}var Mn={Return:"CR",Backspace:"BS",Delete:"Del",Escape:"Esc",Insert:"Ins",ArrowLeft:"Left",ArrowRight:"Right",ArrowUp:"Up",ArrowDown:"Down",Enter:"CR"," ":"Space"},gn={Shift:1,Alt:1,Command:1,Control:1,CapsLock:1,AltGraph:1,Dead:1,Unidentified:1},Xe={};"Left|Right|Up|Down|End|Home".split("|").concat(Object.keys(Mn)).forEach(function(f){Xe[(Mn[f]||"").toLowerCase()]=Xe[f.toLowerCase()]=f});function cn(f,h){var k;var v=f.key;if(!gn[v]){v.length>1&&v[0]=="n"&&(v=v.replace("Numpad","")),v=Mn[v]||v;var b="";if(f.ctrlKey&&(b+="C-"),f.altKey&&(b+="A-"),f.metaKey&&(b+="M-"),e.isMac&&b=="A-"&&v.length==1&&(b=b.slice(2)),(b||v.length>1)&&f.shiftKey&&(b+="S-"),h&&!h.expectLiteralNext&&v.length==1){if(d.keymap&&v in d.keymap)(d.remapCtrl!=0||!b)&&(v=d.keymap[v]);else if(v.charCodeAt(0)>128&&!o[v]){var _=((k=f.code)==null?void 0:k.slice(-1))||"";f.shiftKey||(_=_.toLowerCase()),_&&(v=_,!b&&f.altKey&&(b="A-"))}}return b+=v,b.length>1&&(b="<"+b+">"),b}}function Ct(f,h){d.string!==f&&(d=kn(f)),d.remapCtrl=h}function kn(f){let h={};if(!f)return{keymap:h,string:""};function v(b){return b.split(/\\?(.)/).filter(Boolean)}return f.split(/((?:[^\\,]|\\.)+),/).map(b=>{if(!b)return;let _=b.split(/((?:[^\\;]|\\.)+);/);if(_.length==3){let k=v(_[1]),D=v(_[2]);if(k.length!==D.length)return;for(let I=0;I<k.length;++I)h[k[I]]=D[I]}else if(_.length==1){let k=v(b);if(k.length%2!=0)return;for(let D=0;D<k.length;D+=2)h[k[D]]=k[D+1]}}),{keymap:h,string:f}}Te("langmap",void 0,"string",["lmap"],function(f,h){if(f===void 0)return d.string;Ct(f)});class Lr{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 yt(f,h){f.state.vim.inputState=new Lr,f.state.vim.expectLiteralNext=!1,e.signal(f,"vim-command-done",h)}function Yr(){this.removed=[],this.inserted=""}class un{constructor(h,v,b){this.clear(),this.keyBuffer=[h||""],this.insertModeChanges=[],this.searchQueries=[],this.linewise=!!v,this.blockwise=!!b}setText(h,v,b){this.keyBuffer=[h||""],this.linewise=!!v,this.blockwise=!!b}pushText(h,v){v&&(this.linewise||this.keyBuffer.push(`
|
|
98
98
|
`),this.linewise=!0),this.keyBuffer.push(h)}pushInsertModeChanges(h){this.insertModeChanges.push(ce(h))}pushSearchQuery(h){this.searchQueries.push(h)}clear(){this.keyBuffer=[],this.insertModeChanges=[],this.searchQueries=[],this.linewise=!1}toString(){return this.keyBuffer.join("")}}function Ri(f,h){var v=G.registerController.registers;if(!f||f.length!=1)throw Error("Register name must be 1 character");if(v[f])throw Error("Register already defined "+f);v[f]=h,O.push(f)}class Nn{constructor(h){this.registers=h,this.unnamedRegister=h['"']=new un,h["."]=new un,h[":"]=new un,h["/"]=new un,h["+"]=new un}pushText(h,v,b,_,k){if(h!=="_"){_&&b.charAt(b.length-1)!==`
|
|
99
99
|
`&&(b+=`
|
|
100
100
|
`);var D=this.isValidRegister(h)?this.getRegister(h):null;if(!D||!h){switch(v){case"yank":this.registers[0]=new un(b,_,k);break;case"delete":case"change":b.indexOf(`
|
|
101
|
-
`)==-1?this.registers["-"]=new un(b,_):(this.shiftNumericRegisters_(),this.registers[1]=new un(b,_));break}this.unnamedRegister.setText(b,_,k);return}$(h)?D.pushText(b,_):D.setText(b,_,k),h==="+"&&navigator.clipboard.writeText(b),this.unnamedRegister.setText(D.toString(),_)}}getRegister(h){return this.isValidRegister(h)?(h=h.toLowerCase(),this.registers[h]||(this.registers[h]=new un),this.registers[h]):this.unnamedRegister}isValidRegister(h){return h&&(xe(h,O)||j.test(h))}shiftNumericRegisters_(){for(var h=9;h>=2;h--)this.registers[h]=this.getRegister(""+(h-1))}}class Pr{constructor(){this.historyBuffer=[],this.iterator=0,this.initialPrefix=null}nextMatch(h,v){var b=this.historyBuffer,_=v?-1:1;this.initialPrefix===null&&(this.initialPrefix=h);for(var k=this.iterator+_;v?k>=0:k<b.length;k+=_)for(var D=b[k],I=0;I<=D.length;I++)if(this.initialPrefix==D.substring(0,I))return this.iterator=k,D;if(k>=b.length)return this.iterator=b.length,this.initialPrefix;if(k<0)return h}pushInput(h){var v=this.historyBuffer.indexOf(h);v>-1&&this.historyBuffer.splice(v,1),h.length&&this.historyBuffer.push(h)}reset(){this.initialPrefix=null,this.iterator=this.historyBuffer.length}}var jn={matchCommand:function(f,h,v,b){var _=Li(f,h,b,v),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 D=Or(f);if(!D||D.length>1)return{type:"clear"};v.selectedCharacter=D}return{type:"full",command:k}},processCommand:function(f,h,v){switch(h.inputState.repeatOverride=v.repeatOverride,v.type){case"motion":this.processMotion(f,h,v);break;case"operator":this.processOperator(f,h,v);break;case"operatorMotion":this.processOperatorMotion(f,h,v);break;case"action":this.processAction(f,h,v);break;case"search":this.processSearch(f,h,v);break;case"ex":case"keyToEx":this.processEx(f,h,v);break}},processMotion:function(f,h,v){h.inputState.motion=v.motion,h.inputState.motionArgs=Zr(v.motionArgs),this.evalInput(f,h)},processOperator:function(f,h,v){var b=h.inputState;if(b.operator)if(b.operator==v.operator){b.motion="expandToLine",b.motionArgs={linewise:!0,repeat:1},this.evalInput(f,h);return}else yt(f);b.operator=v.operator,b.operatorArgs=Zr(v.operatorArgs),v.keys.length>1&&(b.operatorShortcut=v.keys),v.exitVisualBlock&&(h.visualBlock=!1,Wn(f)),h.visualMode&&this.evalInput(f,h)},processOperatorMotion:function(f,h,v){var b=h.visualMode,_=Zr(v.operatorMotionArgs);_&&b&&_.visualLine&&(h.visualLine=!0),this.processOperator(f,h,v),b||this.processMotion(f,h,v)},processAction:function(f,h,v){var b=h.inputState,_=b.getRepeat(),k=!!_,D=Zr(v.actionArgs)||{repeat:1};b.selectedCharacter&&(D.selectedCharacter=b.selectedCharacter),v.operator&&this.processOperator(f,h,v),v.motion&&this.processMotion(f,h,v),(v.motion||v.operator)&&this.evalInput(f,h),D.repeat=_||1,D.repeatIsExplicit=k,D.registerName=b.registerName,yt(f),h.lastMotion=null,v.isEdit&&this.recordLastEdit(h,b,v),vn[v.action](f,D,h)},processSearch:function(f,h,v){if(!f.getSearchCursor)return;var b=v.searchArgs.forward,_=v.searchArgs.wholeWordOnly;tr(f).setReversed(!b);var k=b?"/":"?",D=tr(f).getQuery(),I=f.getScrollInfo(),L="";function F(Ie,$e,ht){G.searchHistoryController.pushInput(Ie),G.searchHistoryController.reset();try{Mi(f,Ie,$e,ht)}catch{pt(f,"Invalid regex: "+Ie),yt(f);return}jn.processMotion(f,h,{keys:"",type:"motion",motion:"findNext",motionArgs:{forward:!0,toJumplist:v.searchArgs.toJumplist}})}function N(Ie){f.scrollTo(I.left,I.top),F(Ie,!0,!0);var $e=G.macroModeState;$e.isRecording&&go($e,Ie)}function le(){return Q("pcre")?"(JavaScript regexp: set pcre)":"(Vim regexp: set nopcre)"}function oe(Ie,$e,ht){var tt=cn(Ie),qt,Ht;tt=="<Up>"||tt=="<Down>"?(qt=tt=="<Up>",Ht=Ie.target?Ie.target.selectionEnd:0,$e=G.searchHistoryController.nextMatch($e,qt)||"",ht($e),Ht&&Ie.target&&(Ie.target.selectionEnd=Ie.target.selectionStart=Math.min(Ht,Ie.target.value.length))):tt&&tt!="<Left>"&&tt!="<Right>"&&G.searchHistoryController.reset(),L=$e,X()}function X(){var Ie;try{Ie=Mi(f,L,!0,!0)}catch{}Ie?f.scrollIntoView(Ni(f,!b,Ie),30):(ji(f),f.scrollTo(I.left,I.top))}function J(Ie,$e,ht){var tt=cn(Ie);tt=="<Esc>"||tt=="<C-c>"||tt=="<C-[>"||tt=="<BS>"&&$e==""?(G.searchHistoryController.pushInput($e),G.searchHistoryController.reset(),Mi(f,(D==null?void 0:D.source)||""),ji(f),f.scrollTo(I.left,I.top),e.e_stop(Ie),yt(f),ht(),f.focus()):tt=="<Up>"||tt=="<Down>"?e.e_stop(Ie):tt=="<C-u>"&&(e.e_stop(Ie),ht(""))}switch(v.searchArgs.querySrc){case"prompt":var Ce=G.macroModeState;Ce.isPlaying?F(Ce.replaySearchQueries.shift()||"",!0,!1):Ca(f,{onClose:N,prefix:k,desc:Fn("span",{$cursor:"pointer",onmousedown:function($e){$e.preventDefault(),Z("pcre",!Q("pcre")),this.textContent=le(),X()}},le()),onKeyUp:oe,onKeyDown:J});break;case"wordUnderCursor":var ke=De(f,{noSymbol:!0}),We=!0;if(ke||(ke=De(f,{noSymbol:!1}),We=!1),!ke){pt(f,"No word under cursor"),yt(f);return}let Ie=f.getLine(ke.start.line).substring(ke.start.ch,ke.end.ch);Ie=We&&_?"\\b"+Ie+"\\b":qn(Ie),G.jumpList.cachedCursor=f.getCursor(),f.setCursor(ke.start),F(Ie,!0,!1);break}},processEx:function(f,h,v){function b(I){G.exCommandHistoryController.pushInput(I),G.exCommandHistoryController.reset(),En.processCommand(f,I),f.state.vim&&yt(f),ji(f)}function _(I,L,F){var N=cn(I),le,oe;(N=="<Esc>"||N=="<C-c>"||N=="<C-[>"||N=="<BS>"&&L=="")&&(G.exCommandHistoryController.pushInput(L),G.exCommandHistoryController.reset(),e.e_stop(I),yt(f),ji(f),F(),f.focus()),N=="<Up>"||N=="<Down>"?(e.e_stop(I),le=N=="<Up>",oe=I.target?I.target.selectionEnd:0,L=G.exCommandHistoryController.nextMatch(L,le)||"",F(L),oe&&I.target&&(I.target.selectionEnd=I.target.selectionStart=Math.min(oe,I.target.value.length))):N=="<C-u>"?(e.e_stop(I),F("")):N&&N!="<Left>"&&N!="<Right>"&&G.exCommandHistoryController.reset()}function k(I,L){var F=new e.StringStream(L),N={};try{if(En.parseInput_(f,F,N),N.commandName!="s"){ji(f);return}var le=En.matchCommand_(N.commandName);if(!le||(En.parseCommandArgs_(F,N,le),!N.argString))return;var oe=Ol(N.argString.slice(1),!0,!0);oe&&hs(f,oe)}catch{}}if(v.type=="keyToEx")En.processCommand(f,v.exArgs.input);else{var D={onClose:b,onKeyDown:_,onKeyUp:k,prefix:":"};h.visualMode&&(D.value="'<,'>",D.selectValueOnOpen=!1),Ca(f,D)}},evalInput:function(f,h){var v=h.inputState,b=v.motion,_=v.motionArgs||{repeat:1},k=v.operator,D=v.operatorArgs||{},I=v.registerName,L=h.sel,F=et(h.visualMode?Vt(f,L.head):f.getCursor("head")),N=et(h.visualMode?Vt(f,L.anchor):f.getCursor("anchor")),le=et(F),oe=et(N),X,J,Ce;if(k&&this.recordLastEdit(h,v),Ce=v.repeatOverride===void 0?v.getRepeat():v.repeatOverride,Ce>0&&_.explicitRepeat?_.repeatIsExplicit=!0:(_.noRepeat||!_.explicitRepeat&&Ce===0)&&(Ce=1,_.repeatIsExplicit=!1),v.selectedCharacter&&(_.selectedCharacter=D.selectedCharacter=v.selectedCharacter),_.repeat=Ce,yt(f),b){var ke=yn[b](f,F,_,h,v);if(h.lastMotion=yn[b],!ke)return;if(_.toJumplist){var We=G.jumpList,Ie=We.cachedCursor;Ie?(Ke(f,Ie,ke),delete We.cachedCursor):Ke(f,F,ke)}ke instanceof Array?(J=ke[0],X=ke[1]):X=ke,X||(X=et(F)),h.visualMode?(h.visualBlock&&X.ch===1/0||(X=Vt(f,X,le)),J&&(J=Vt(f,J)),J||(J=oe),L.anchor=J,L.head=X,Wn(f),Un(f,h,"<",Et(J,X)?J:X),Un(f,h,">",Et(J,X)?X:J)):k||(X=Vt(f,X,le),f.setCursor(X.line,X.ch))}if(k){if(D.lastSel){J=oe;var $e=D.lastSel,ht=Math.abs($e.head.line-$e.anchor.line),tt=Math.abs($e.head.ch-$e.anchor.ch);X=$e.visualLine?new t(oe.line+ht,oe.ch):$e.visualBlock?new t(oe.line+ht,oe.ch+tt):$e.head.line==$e.anchor.line?new t(oe.line,oe.ch+tt):new t(oe.line+ht,oe.ch),h.visualMode=!0,h.visualLine=$e.visualLine,h.visualBlock=$e.visualBlock,L=h.sel={anchor:J,head:X},Wn(f)}else h.visualMode&&(D.lastSel={anchor:et(L.anchor),head:et(L.head),visualBlock:h.visualBlock,visualLine:h.visualLine});var qt,Ht,Je,Ge,Qt;if(h.visualMode){qt=Tt(L.head,L.anchor),Ht=Bn(L.head,L.anchor),Je=h.visualLine||D.linewise,Ge=h.visualBlock?"block":Je?"line":"char";var dn=n(f,qt,Ht);if(Qt=mr(f,{anchor:dn.start,head:dn.end},Ge),Je){var bn=Qt.ranges;if(Ge=="block")for(var wo=0;wo<bn.length;wo++)bn[wo].head.ch=Dt(f,bn[wo].head.line);else Ge=="line"&&(bn[0].head=new t(bn[0].head.line+1,0))}}else{if(qt=et(J||oe),Ht=et(X||le),Et(Ht,qt)){var Vu=qt;qt=Ht,Ht=Vu}Je=_.linewise||D.linewise,Je?re(f,qt,Ht):_.forward&&q(f,qt,Ht),Ge="char";var Hu=!_.inclusive||Je,dn=n(f,qt,Ht);Qt=mr(f,{anchor:dn.start,head:dn.end},Ge,Hu)}f.setSelections(Qt.ranges,Qt.primary),h.lastMotion=null,D.repeat=Ce,D.registerName=I,D.linewise=Je;var bs=Yt[k](f,D,Qt.ranges,oe,X);h.visualMode&&rt(f,bs!=null),bs&&f.setCursor(bs)}},recordLastEdit:function(f,h,v){var b=G.macroModeState;b.isPlaying||(f.lastEditInputState=h,f.lastEditActionCommand=v,b.lastInsertModeChanges.changes=[],b.lastInsertModeChanges.expectCursorActivityForChange=!1,b.lastInsertModeChanges.visualBlock=f.visualBlock?f.sel.head.line-f.sel.anchor.line:0)}},yn={moveToTopLine:function(f,h,v){var b=mo(f).top+v.repeat-1;return new t(b,we(f.getLine(b)))},moveToMiddleLine:function(f){var h=mo(f),v=Math.floor((h.top+h.bottom)*.5);return new t(v,we(f.getLine(v)))},moveToBottomLine:function(f,h,v){var b=mo(f).bottom-v.repeat+1;return new t(b,we(f.getLine(b)))},expandToLine:function(f,h,v){return new t(h.line+v.repeat-1,1/0)},findNext:function(f,h,v){var b=tr(f),_=b.getQuery();if(_){var k=!v.forward;k=b.isReversed()?!k:k,hs(f,_);var D=Ni(f,k,_,v.repeat);return D||pt(f,"No match found "+_+(Q("pcre")?" (set nopcre to use Vim regexps)":"")),D}},findAndSelectNextInclusive:function(f,h,v,b,_){var k=tr(f),D=k.getQuery();if(D){var I=!v.forward;I=k.isReversed()?!I:I;var L=Im(f,I,D,v.repeat,b);if(L){if(_.operator)return L;var F=L[0],N=new t(L[1].line,L[1].ch-1);if(b.visualMode){(b.visualLine||b.visualBlock)&&(b.visualLine=!1,b.visualBlock=!1,e.signal(f,"vim-mode-change",{mode:"visual",subMode:""}));var le=b.sel.anchor;if(le)return k.isReversed()?v.forward?[le,F]:[le,N]:v.forward?[le,N]:[le,F]}else b.visualMode=!0,b.visualLine=!1,b.visualBlock=!1,e.signal(f,"vim-mode-change",{mode:"visual",subMode:""});return I?[N,F]:[F,N]}}},goToMark:function(f,h,v,b){var _=gs(f,b,v.selectedCharacter||"");return _?v.linewise?{line:_.line,ch:we(f.getLine(_.line))}:_:null},moveToOtherHighlightedEnd:function(f,h,v,b){var _=b.sel;return b.visualBlock&&v.sameLine?[Vt(f,new t(_.anchor.line,_.head.ch)),Vt(f,new t(_.head.line,_.anchor.ch))]:[_.head,_.anchor]},jumpToMark:function(f,h,v,b){for(var _=h,k=0;k<v.repeat;k++){var D=_;for(var I in b.marks)if(P(I)){var L=b.marks[I].find();if(!(v.forward?Et(L,D):Et(D,L))&&!(v.linewise&&L.line==D.line)){var F=wt(D,_),N=v.forward?Mr(D,L,_):Mr(_,L,D);(F||N)&&(_=L)}}}return v.linewise&&(_=new t(_.line,we(f.getLine(_.line)))),_},moveByCharacters:function(f,h,v){var b=h,_=v.repeat,k=v.forward?b.ch+_:b.ch-_;return new t(b.line,k)},moveByLines:function(f,h,v,b){var _=h,k=_.ch;switch(b.lastMotion){case this.moveByLines:case this.moveByDisplayLines:case this.moveByScroll:case this.moveToColumn:case this.moveToEol:k=b.lastHPos;break;default:b.lastHPos=k}var D=v.repeat+(v.repeatOffset||0),I=v.forward?_.line+D:_.line-D,L=f.firstLine(),F=f.lastLine(),N=f.findPosV(_,v.forward?D:-D,"line",b.lastHSPos);return(v.forward?N.line>I:N.line<I)&&(I=N.line,k=N.ch),I<L&&_.line==L?this.moveToStartOfLine(f,h,v,b):I>F&&_.line==F?Sn(f,h,v,b,!0):(v.toFirstChar&&(k=we(f.getLine(I)),b.lastHPos=k),b.lastHSPos=f.charCoords(new t(I,k),"div").left,new t(I,k))},moveByDisplayLines:function(f,h,v,b){var _=h;switch(b.lastMotion){case this.moveByDisplayLines:case this.moveByScroll:case this.moveByLines:case this.moveToColumn:case this.moveToEol:break;default:b.lastHSPos=f.charCoords(_,"div").left}var k=v.repeat,D=f.findPosV(_,v.forward?k:-k,"line",b.lastHSPos);if(D.hitSide)if(v.forward){var I={top:f.charCoords(D,"div").top+8,left:b.lastHSPos};D=f.coordsChar(I,"div")}else{var L=f.charCoords(new t(f.firstLine(),0),"div");L.left=b.lastHSPos,D=f.coordsChar(L,"div")}return b.lastHPos=D.ch,D},moveByPage:function(f,h,v){var b=h,_=v.repeat;return f.findPosV(b,v.forward?_:-_,"page")},moveByParagraph:function(f,h,v){var b=v.forward?1:-1;return an(f,h,v.repeat,b).start},moveBySentence:function(f,h,v){var b=v.forward?1:-1;return Pu(f,h,v.repeat,b)},moveByScroll:function(f,h,v,b){var _=f.getScrollInfo(),k=null,D=v.repeat;D||(D=_.clientHeight/(2*f.defaultTextHeight()));var I=f.charCoords(h,"local");if(v.repeat=D,k=yn.moveByDisplayLines(f,h,v,b),!k)return null;var L=f.charCoords(k,"local");return f.scrollTo(null,_.top+L.top-I.top),k},moveByWords:function(f,h,v){return mt(f,h,v.repeat,!!v.forward,!!v.wordEnd,!!v.bigWord)},moveTillCharacter:function(f,h,v){var b=v.repeat,_=hr(f,b,v.forward,v.selectedCharacter,h),k=v.forward?-1:1;return ut(k,v),_?(_.ch+=k,_):null},moveToCharacter:function(f,h,v){var b=v.repeat;return ut(0,v),hr(f,b,v.forward,v.selectedCharacter,h)||h},moveToSymbol:function(f,h,v){var b=v.repeat;return v.selectedCharacter&&jt(f,b,v.forward,v.selectedCharacter)||h},moveToColumn:function(f,h,v,b){var _=v.repeat;return b.lastHPos=_-1,b.lastHSPos=f.charCoords(h,"div").left,yi(f,_)},moveToEol:function(f,h,v,b){return Sn(f,h,v,b,!1)},moveToFirstNonWhiteSpaceCharacter:function(f,h){var v=h;return new t(v.line,we(f.getLine(v.line)))},moveToMatchedSymbol:function(f,h){for(var v=h,b=v.line,_=v.ch,k=f.getLine(b),D;_<k.length;_++)if(D=k.charAt(_),D&&U(D)){var I=f.getTokenTypeAt(new t(b,_+1));if(I!=="string"&&I!=="comment")break}if(_<k.length){var L=D==="<"||D===">"?/[(){}[\]<>]/:/[(){}[\]]/;return f.findMatchingBracket(new t(b,_),{bracketRegex:L}).to}else return v},moveToStartOfLine:function(f,h){return new t(h.line,0)},moveToLineOrEdgeOfDocument:function(f,h,v){var b=v.forward?f.lastLine():f.firstLine();return v.repeatIsExplicit&&(b=v.repeat-f.getOption("firstLineNumber")),new t(b,we(f.getLine(b)))},moveToStartOfDisplayLine:function(f){return f.execCommand("goLineLeft"),f.getCursor()},moveToEndOfDisplayLine:function(f){f.execCommand("goLineRight");var h=f.getCursor();return h.sticky=="before"&&h.ch--,h},textObjectManipulation:function(f,h,v,b){var _={"(":")",")":"(","{":"}","}":"{","[":"]","]":"[","<":">",">":"<"},k={"'":!0,'"':!0,"`":!0},D=v.selectedCharacter||"";D=="b"?D="(":D=="B"&&(D="{");var I=!v.textObjectInner,L,F;if(_[D]){if(F=!0,L=vi(f,h,D,I),!L){var N=f.getSearchCursor(RegExp("\\"+D,"g"),h);N.find()&&(L=vi(f,N.from(),D,I))}}else if(k[D])F=!0,L=ka(f,h,D,I);else if(D==="W"||D==="w")for(var le=v.repeat||1;le-- >0;){var oe=De(f,{inclusive:I,innerWord:!I,bigWord:D==="W",noSymbol:D==="W",multiline:!0},L&&L.end);oe&&(L||(L=oe),L.end=oe.end)}else if(D==="p")if(L=an(f,h,v.repeat,0,I),v.linewise=!0,b.visualMode)b.visualLine||(b.visualLine=!0);else{var X=b.inputState.operatorArgs;X&&(X.linewise=!0),L.end.line--}else if(D==="t")L=Ue(f,h,I);else if(D==="s"){var J=f.getLine(h.line);h.ch>0&&ae(J[h.ch])&&--h.ch;var Ce=Ll(f,h,v.repeat,1,I),ke=Ll(f,h,v.repeat,-1,I);W(f.getLine(ke.line)[ke.ch])&&W(f.getLine(Ce.line)[Ce.ch-1])&&(ke={line:ke.line,ch:ke.ch+1}),L={start:ke,end:Ce}}return L?f.state.vim.visualMode?Oi(f,L.start,L.end,F):[L.start,L.end]:null},repeatLastCharacterSearch:function(f,h,v){var b=G.lastCharacterSearch,_=v.repeat,k=v.forward===b.forward,D=(b.increment?1:0)*(k?-1:1);f.moveH(-D,"char"),v.inclusive=!!k;var I=hr(f,_,k,b.selectedCharacter);return I?(I.ch+=D,I):(f.moveH(D,"char"),h)}};function wa(f,h){yn[f]=h}function Ii(f,h){for(var v=[],b=0;b<h;b++)v.push(f);return v}var Yt={change:function(f,h,v){var b,_,k=f.state.vim,D=v[0].anchor,I=v[0].head;if(k.visualMode)if(h.fullLine)I.ch=Number.MAX_VALUE,I.line--,f.setSelection(D,I),_=f.getSelection(),f.replaceSelection(""),b=D;else{_=f.getSelection();var L=Ii("",v.length);f.replaceSelections(L),b=Tt(v[0].head,v[0].anchor)}else{_=f.getRange(D,I);var F=k.lastEditInputState;if((F==null?void 0:F.motion)=="moveByWords"&&!W(_)){var N=/\s+$/.exec(_);N&&F.motionArgs&&F.motionArgs.forward&&(I=St(I,0,-N[0].length),_=_.slice(0,-N[0].length))}h.linewise&&(D=new t(D.line,we(f.getLine(D.line))),I.line>D.line&&(I=new t(I.line-1,Number.MAX_VALUE))),f.replaceRange("",D,I),b=D}G.registerController.pushText(h.registerName,"change",_,h.linewise,v.length>1),vn.enterInsertMode(f,{head:b},f.state.vim)},delete:function(f,h,v){var b,_,k=f.state.vim;if(k.visualBlock){_=f.getSelection();var D=Ii("",v.length);f.replaceSelections(D),b=Tt(v[0].head,v[0].anchor)}else{var I=v[0].anchor,L=v[0].head;h.linewise&&L.line!=f.firstLine()&&I.line==f.lastLine()&&I.line==L.line-1&&(I.line==f.firstLine()?I.ch=0:I=new t(I.line-1,Dt(f,I.line-1))),_=f.getRange(I,L),f.replaceRange("",I,L),b=I,h.linewise&&(b=yn.moveToFirstNonWhiteSpaceCharacter(f,I))}return G.registerController.pushText(h.registerName,"delete",_,h.linewise,k.visualBlock),Vt(f,b)},indent:function(f,h,v){var b=f.state.vim,_=b.visualMode&&h.repeat||1;if(b.visualBlock){for(var k=f.getOption("tabSize"),D=f.getOption("indentWithTabs")?" ":" ".repeat(k),I,L=v.length-1;L>=0;L--)if(I=Tt(v[L].anchor,v[L].head),h.indentRight)f.replaceRange(D.repeat(_),I,I);else{for(var F=f.getLine(I.line),N=0,le=0;le<_;le++){var oe=F[I.ch+N];if(oe==" ")N++;else if(oe==" "){N++;for(var X=1;X<D.length&&(oe=F[I.ch+N],oe===" ");X++)N++}else break}f.replaceRange("",I,St(I,0,N))}return I}else if(f.indentMore)for(var le=0;le<_;le++)h.indentRight?f.indentMore():f.indentLess();else{var J=v[0].anchor.line,Ce=b.visualBlock?v[v.length-1].anchor.line:v[0].head.line;h.linewise&&Ce--;for(var L=J;L<=Ce;L++)for(var le=0;le<_;le++)f.indentLine(L,h.indentRight)}return yn.moveToFirstNonWhiteSpaceCharacter(f,v[0].anchor)},indentAuto:function(f,h,v){return f.execCommand("indentAuto"),yn.moveToFirstNonWhiteSpaceCharacter(f,v[0].anchor)},hardWrap:function(f,h,v,b){if(f.hardWrap){var _=v[0].anchor.line,k=v[0].head.line;h.linewise&&k--;var D=f.hardWrap({from:_,to:k});return D>_&&h.linewise&&D--,h.keepCursor?b:new t(D,0)}},changeCase:function(f,h,v,b,_){for(var k=f.getSelections(),D=[],I=h.toLower,L=0;L<k.length;L++){var F=k[L],N="";if(I===!0)N=F.toLowerCase();else if(I===!1)N=F.toUpperCase();else for(var le=0;le<F.length;le++){var oe=F.charAt(le);N+=$(oe)?oe.toLowerCase():oe.toUpperCase()}D.push(N)}return f.replaceSelections(D),h.shouldMoveCursor?_:!f.state.vim.visualMode&&h.linewise&&v[0].anchor.line+1==v[0].head.line?yn.moveToFirstNonWhiteSpaceCharacter(f,b):h.linewise?b:Tt(v[0].anchor,v[0].head)},yank:function(f,h,v,b){var _=f.state.vim,k=f.getSelection(),D=_.visualMode?Tt(_.sel.anchor,_.sel.head,v[0].head,v[0].anchor):b;return G.registerController.pushText(h.registerName,"yank",k,h.linewise,_.visualBlock),D},rot13:function(f,h,v,b,_){for(var k=f.getSelections(),D=[],I=0;I<k.length;I++){let L=k[I].split("").map(F=>{let N=F.charCodeAt(0);return N>=65&&N<=90?String.fromCharCode(65+(N-65+13)%26):N>=97&&N<=122?String.fromCharCode(97+(N-97+13)%26):F}).join("");D.push(L)}return f.replaceSelections(D),h.shouldMoveCursor?_:!f.state.vim.visualMode&&h.linewise&&v[0].anchor.line+1==v[0].head.line?yn.moveToFirstNonWhiteSpaceCharacter(f,b):h.linewise?b:Tt(v[0].anchor,v[0].head)}};function Ai(f,h){Yt[f]=h}var vn={jumpListWalk:function(f,h,v){if(!v.visualMode){var b=h.repeat||1,_=h.forward,k=G.jumpList.move(f,_?b:-b),D=k?k.find():void 0;D||(D=f.getCursor()),f.setCursor(D)}},scroll:function(f,h,v){if(!v.visualMode){var b=h.repeat||1,_=f.defaultTextHeight(),k=f.getScrollInfo().top,D=_*b,I=h.forward?k+D:k-D,L=et(f.getCursor()),F=f.charCoords(L,"local");if(h.forward)I>F.top?(L.line+=(I-F.top)/_,L.line=Math.ceil(L.line),f.setCursor(L),F=f.charCoords(L,"local"),f.scrollTo(null,F.top)):f.scrollTo(null,I);else{var N=I+f.getScrollInfo().clientHeight;N<F.bottom?(L.line-=(F.bottom-N)/_,L.line=Math.floor(L.line),f.setCursor(L),F=f.charCoords(L,"local"),f.scrollTo(null,F.bottom-f.getScrollInfo().clientHeight)):f.scrollTo(null,I)}}},scrollToCursor:function(f,h){var v=f.getCursor().line,b=f.charCoords(new t(v,0),"local"),_=f.getScrollInfo().clientHeight,k=b.top;switch(h.position){case"center":k=b.bottom-_/2;break;case"bottom":var D=new t(v,f.getLine(v).length-1),I=f.charCoords(D,"local").bottom-k;k=k-_+I;break}f.scrollTo(null,k)},replayMacro:function(f,h,v){var b=h.selectedCharacter||"",_=h.repeat||1,k=G.macroModeState;for(b=="@"?b=k.latestRegister||"":k.latestRegister=b;_--;)ho(f,v,k,b)},enterMacroRecordMode:function(f,h){var v=G.macroModeState,b=h.selectedCharacter;G.registerController.isValidRegister(b)&&v.enterMacroRecordMode(f,b)},toggleOverwrite:function(f){f.state.overwrite?(f.toggleOverwrite(!1),f.setOption("keyMap","vim-insert"),e.signal(f,"vim-mode-change",{mode:"insert"})):(f.toggleOverwrite(!0),f.setOption("keyMap","vim-replace"),e.signal(f,"vim-mode-change",{mode:"replace"}))},enterInsertMode:function(f,h,v){if(!f.getOption("readOnly")){v.insertMode=!0,v.insertModeRepeat=h&&h.repeat||1;var b=h?h.insertAt:null,_=v.sel,k=h.head||f.getCursor("head"),D=f.listSelections().length;if(b=="eol")k=new t(k.line,Dt(f,k.line));else if(b=="bol")k=new t(k.line,0);else if(b=="charAfter"){var I=n(f,k,St(k,0,1));k=I.end}else if(b=="firstNonBlank"){var I=n(f,k,yn.moveToFirstNonWhiteSpaceCharacter(f,k));k=I.end}else if(b=="startOfSelectedArea"){if(!v.visualMode)return;v.visualBlock?(k=new t(Math.min(_.head.line,_.anchor.line),Math.min(_.head.ch,_.anchor.ch)),D=Math.abs(_.head.line-_.anchor.line)+1):k=_.head.line<_.anchor.line?_.head:new t(_.anchor.line,0)}else if(b=="endOfSelectedArea"){if(!v.visualMode)return;v.visualBlock?(k=new t(Math.min(_.head.line,_.anchor.line),Math.max(_.head.ch,_.anchor.ch)+1),D=Math.abs(_.head.line-_.anchor.line)+1):k=_.head.line>=_.anchor.line?St(_.head,0,1):new t(_.anchor.line,0)}else if(b=="inplace"){if(v.visualMode)return}else b=="lastEdit"&&(k=zu(f)||k);f.setOption("disableInput",!1),h&&h.replace?(f.toggleOverwrite(!0),f.setOption("keyMap","vim-replace"),e.signal(f,"vim-mode-change",{mode:"replace"})):(f.toggleOverwrite(!1),f.setOption("keyMap","vim-insert"),e.signal(f,"vim-mode-change",{mode:"insert"})),G.macroModeState.isPlaying||(f.on("change",ri),v.insertEnd&&v.insertEnd.clear(),v.insertEnd=f.setBookmark(k,{insertLeft:!0}),e.on(f.getInputField(),"keydown",ql)),v.visualMode&&rt(f),pr(f,k,D)}},toggleVisualMode:function(f,h,v){var b=h.repeat,_=f.getCursor(),k;if(v.visualMode)v.visualLine!=!!h.linewise||v.visualBlock!=!!h.blockwise?(v.visualLine=!!h.linewise,v.visualBlock=!!h.blockwise,e.signal(f,"vim-mode-change",{mode:"visual",subMode:v.visualLine?"linewise":v.visualBlock?"blockwise":""}),Wn(f)):rt(f);else{v.visualMode=!0,v.visualLine=!!h.linewise,v.visualBlock=!!h.blockwise,k=Vt(f,new t(_.line,_.ch+b-1));var D=n(f,_,k);v.sel={anchor:D.start,head:D.end},e.signal(f,"vim-mode-change",{mode:"visual",subMode:v.visualLine?"linewise":v.visualBlock?"blockwise":""}),Wn(f),Un(f,v,"<",Tt(_,k)),Un(f,v,">",Bn(_,k))}},reselectLastSelection:function(f,h,v){var b=v.lastSelection;if(v.visualMode&&zn(f,v),b){var _=b.anchorMark.find(),k=b.headMark.find();if(!_||!k)return;v.sel={anchor:_,head:k},v.visualMode=!0,v.visualLine=b.visualLine,v.visualBlock=b.visualBlock,Wn(f),Un(f,v,"<",Tt(_,k)),Un(f,v,">",Bn(_,k)),e.signal(f,"vim-mode-change",{mode:"visual",subMode:v.visualLine?"linewise":v.visualBlock?"blockwise":""})}},joinLines:function(f,h,v){var b,_;if(v.visualMode){if(b=f.getCursor("anchor"),_=f.getCursor("head"),Et(_,b)){var k=_;_=b,b=k}_.ch=Dt(f,_.line)-1}else{var D=Math.max(h.repeat,2);b=f.getCursor(),_=Vt(f,new t(b.line+D-1,1/0))}for(var I=0,L=b.line;L<_.line;L++){I=Dt(f,b.line);var F="",N=0;if(!h.keepSpaces){var le=f.getLine(b.line+1);N=le.search(/\S/),N==-1?N=le.length:F=" "}f.replaceRange(F,new t(b.line,I),new t(b.line+1,N))}var oe=Vt(f,new t(b.line,I));v.visualMode&&rt(f,!1),f.setCursor(oe)},newLineAndEnterInsertMode:function(f,h,v){v.insertMode=!0;var b=et(f.getCursor());b.line===f.firstLine()&&!h.after?(f.replaceRange(`
|
|
101
|
+
`)==-1?this.registers["-"]=new un(b,_):(this.shiftNumericRegisters_(),this.registers[1]=new un(b,_));break}this.unnamedRegister.setText(b,_,k);return}$(h)?D.pushText(b,_):D.setText(b,_,k),h==="+"&&navigator.clipboard.writeText(b),this.unnamedRegister.setText(D.toString(),_)}}getRegister(h){return this.isValidRegister(h)?(h=h.toLowerCase(),this.registers[h]||(this.registers[h]=new un),this.registers[h]):this.unnamedRegister}isValidRegister(h){return h&&(xe(h,O)||j.test(h))}shiftNumericRegisters_(){for(var h=9;h>=2;h--)this.registers[h]=this.getRegister(""+(h-1))}}class Pr{constructor(){this.historyBuffer=[],this.iterator=0,this.initialPrefix=null}nextMatch(h,v){var b=this.historyBuffer,_=v?-1:1;this.initialPrefix===null&&(this.initialPrefix=h);for(var k=this.iterator+_;v?k>=0:k<b.length;k+=_)for(var D=b[k],I=0;I<=D.length;I++)if(this.initialPrefix==D.substring(0,I))return this.iterator=k,D;if(k>=b.length)return this.iterator=b.length,this.initialPrefix;if(k<0)return h}pushInput(h){var v=this.historyBuffer.indexOf(h);v>-1&&this.historyBuffer.splice(v,1),h.length&&this.historyBuffer.push(h)}reset(){this.initialPrefix=null,this.iterator=this.historyBuffer.length}}var jn={matchCommand:function(f,h,v,b){var _=Li(f,h,b,v),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 D=Or(f);if(!D||D.length>1)return{type:"clear"};v.selectedCharacter=D}return{type:"full",command:k}},processCommand:function(f,h,v){switch(h.inputState.repeatOverride=v.repeatOverride,v.type){case"motion":this.processMotion(f,h,v);break;case"operator":this.processOperator(f,h,v);break;case"operatorMotion":this.processOperatorMotion(f,h,v);break;case"action":this.processAction(f,h,v);break;case"search":this.processSearch(f,h,v);break;case"ex":case"keyToEx":this.processEx(f,h,v);break}},processMotion:function(f,h,v){h.inputState.motion=v.motion,h.inputState.motionArgs=Zr(v.motionArgs),this.evalInput(f,h)},processOperator:function(f,h,v){var b=h.inputState;if(b.operator)if(b.operator==v.operator){b.motion="expandToLine",b.motionArgs={linewise:!0,repeat:1},this.evalInput(f,h);return}else yt(f);b.operator=v.operator,b.operatorArgs=Zr(v.operatorArgs),v.keys.length>1&&(b.operatorShortcut=v.keys),v.exitVisualBlock&&(h.visualBlock=!1,Wn(f)),h.visualMode&&this.evalInput(f,h)},processOperatorMotion:function(f,h,v){var b=h.visualMode,_=Zr(v.operatorMotionArgs);_&&b&&_.visualLine&&(h.visualLine=!0),this.processOperator(f,h,v),b||this.processMotion(f,h,v)},processAction:function(f,h,v){var b=h.inputState,_=b.getRepeat(),k=!!_,D=Zr(v.actionArgs)||{repeat:1};b.selectedCharacter&&(D.selectedCharacter=b.selectedCharacter),v.operator&&this.processOperator(f,h,v),v.motion&&this.processMotion(f,h,v),(v.motion||v.operator)&&this.evalInput(f,h),D.repeat=_||1,D.repeatIsExplicit=k,D.registerName=b.registerName,yt(f),h.lastMotion=null,v.isEdit&&this.recordLastEdit(h,b,v),vn[v.action](f,D,h)},processSearch:function(f,h,v){if(!f.getSearchCursor)return;var b=v.searchArgs.forward,_=v.searchArgs.wholeWordOnly;tr(f).setReversed(!b);var k=b?"/":"?",D=tr(f).getQuery(),I=f.getScrollInfo(),L="";function F(Ie,$e,ht){G.searchHistoryController.pushInput(Ie),G.searchHistoryController.reset();try{Mi(f,Ie,$e,ht)}catch{pt(f,"Invalid regex: "+Ie),yt(f);return}jn.processMotion(f,h,{keys:"",type:"motion",motion:"findNext",motionArgs:{forward:!0,toJumplist:v.searchArgs.toJumplist}})}function N(Ie){f.scrollTo(I.left,I.top),F(Ie,!0,!0);var $e=G.macroModeState;$e.isRecording&&yo($e,Ie)}function le(){return Q("pcre")?"(JavaScript regexp: set pcre)":"(Vim regexp: set nopcre)"}function oe(Ie,$e,ht){var tt=cn(Ie),qt,Ht;tt=="<Up>"||tt=="<Down>"?(qt=tt=="<Up>",Ht=Ie.target?Ie.target.selectionEnd:0,$e=G.searchHistoryController.nextMatch($e,qt)||"",ht($e),Ht&&Ie.target&&(Ie.target.selectionEnd=Ie.target.selectionStart=Math.min(Ht,Ie.target.value.length))):tt&&tt!="<Left>"&&tt!="<Right>"&&G.searchHistoryController.reset(),L=$e,X()}function X(){var Ie;try{Ie=Mi(f,L,!0,!0)}catch{}Ie?f.scrollIntoView(Ni(f,!b,Ie),30):(ji(f),f.scrollTo(I.left,I.top))}function J(Ie,$e,ht){var tt=cn(Ie);tt=="<Esc>"||tt=="<C-c>"||tt=="<C-[>"||tt=="<BS>"&&$e==""?(G.searchHistoryController.pushInput($e),G.searchHistoryController.reset(),Mi(f,(D==null?void 0:D.source)||""),ji(f),f.scrollTo(I.left,I.top),e.e_stop(Ie),yt(f),ht(),f.focus()):tt=="<Up>"||tt=="<Down>"?e.e_stop(Ie):tt=="<C-u>"&&(e.e_stop(Ie),ht(""))}switch(v.searchArgs.querySrc){case"prompt":var Ce=G.macroModeState;Ce.isPlaying?F(Ce.replaySearchQueries.shift()||"",!0,!1):Sa(f,{onClose:N,prefix:k,desc:Fn("span",{$cursor:"pointer",onmousedown:function($e){$e.preventDefault(),Z("pcre",!Q("pcre")),this.textContent=le(),X()}},le()),onKeyUp:oe,onKeyDown:J});break;case"wordUnderCursor":var ke=De(f,{noSymbol:!0}),We=!0;if(ke||(ke=De(f,{noSymbol:!1}),We=!1),!ke){pt(f,"No word under cursor"),yt(f);return}let Ie=f.getLine(ke.start.line).substring(ke.start.ch,ke.end.ch);Ie=We&&_?"\\b"+Ie+"\\b":qn(Ie),G.jumpList.cachedCursor=f.getCursor(),f.setCursor(ke.start),F(Ie,!0,!1);break}},processEx:function(f,h,v){function b(I){G.exCommandHistoryController.pushInput(I),G.exCommandHistoryController.reset(),En.processCommand(f,I),f.state.vim&&yt(f),ji(f)}function _(I,L,F){var N=cn(I),le,oe;(N=="<Esc>"||N=="<C-c>"||N=="<C-[>"||N=="<BS>"&&L=="")&&(G.exCommandHistoryController.pushInput(L),G.exCommandHistoryController.reset(),e.e_stop(I),yt(f),ji(f),F(),f.focus()),N=="<Up>"||N=="<Down>"?(e.e_stop(I),le=N=="<Up>",oe=I.target?I.target.selectionEnd:0,L=G.exCommandHistoryController.nextMatch(L,le)||"",F(L),oe&&I.target&&(I.target.selectionEnd=I.target.selectionStart=Math.min(oe,I.target.value.length))):N=="<C-u>"?(e.e_stop(I),F("")):N&&N!="<Left>"&&N!="<Right>"&&G.exCommandHistoryController.reset()}function k(I,L){var F=new e.StringStream(L),N={};try{if(En.parseInput_(f,F,N),N.commandName!="s"){ji(f);return}var le=En.matchCommand_(N.commandName);if(!le||(En.parseCommandArgs_(F,N,le),!N.argString))return;var oe=Ol(N.argString.slice(1),!0,!0);oe&&hs(f,oe)}catch{}}if(v.type=="keyToEx")En.processCommand(f,v.exArgs.input);else{var D={onClose:b,onKeyDown:_,onKeyUp:k,prefix:":"};h.visualMode&&(D.value="'<,'>",D.selectValueOnOpen=!1),Sa(f,D)}},evalInput:function(f,h){var v=h.inputState,b=v.motion,_=v.motionArgs||{repeat:1},k=v.operator,D=v.operatorArgs||{},I=v.registerName,L=h.sel,F=et(h.visualMode?Vt(f,L.head):f.getCursor("head")),N=et(h.visualMode?Vt(f,L.anchor):f.getCursor("anchor")),le=et(F),oe=et(N),X,J,Ce;if(k&&this.recordLastEdit(h,v),Ce=v.repeatOverride===void 0?v.getRepeat():v.repeatOverride,Ce>0&&_.explicitRepeat?_.repeatIsExplicit=!0:(_.noRepeat||!_.explicitRepeat&&Ce===0)&&(Ce=1,_.repeatIsExplicit=!1),v.selectedCharacter&&(_.selectedCharacter=D.selectedCharacter=v.selectedCharacter),_.repeat=Ce,yt(f),b){var ke=yn[b](f,F,_,h,v);if(h.lastMotion=yn[b],!ke)return;if(_.toJumplist){var We=G.jumpList,Ie=We.cachedCursor;Ie?(Ke(f,Ie,ke),delete We.cachedCursor):Ke(f,F,ke)}ke instanceof Array?(J=ke[0],X=ke[1]):X=ke,X||(X=et(F)),h.visualMode?(h.visualBlock&&X.ch===1/0||(X=Vt(f,X,le)),J&&(J=Vt(f,J)),J||(J=oe),L.anchor=J,L.head=X,Wn(f),Un(f,h,"<",Et(J,X)?J:X),Un(f,h,">",Et(J,X)?X:J)):k||(X=Vt(f,X,le),f.setCursor(X.line,X.ch))}if(k){if(D.lastSel){J=oe;var $e=D.lastSel,ht=Math.abs($e.head.line-$e.anchor.line),tt=Math.abs($e.head.ch-$e.anchor.ch);X=$e.visualLine?new t(oe.line+ht,oe.ch):$e.visualBlock?new t(oe.line+ht,oe.ch+tt):$e.head.line==$e.anchor.line?new t(oe.line,oe.ch+tt):new t(oe.line+ht,oe.ch),h.visualMode=!0,h.visualLine=$e.visualLine,h.visualBlock=$e.visualBlock,L=h.sel={anchor:J,head:X},Wn(f)}else h.visualMode&&(D.lastSel={anchor:et(L.anchor),head:et(L.head),visualBlock:h.visualBlock,visualLine:h.visualLine});var qt,Ht,Je,Ge,Qt;if(h.visualMode){qt=Tt(L.head,L.anchor),Ht=Bn(L.head,L.anchor),Je=h.visualLine||D.linewise,Ge=h.visualBlock?"block":Je?"line":"char";var dn=n(f,qt,Ht);if(Qt=mr(f,{anchor:dn.start,head:dn.end},Ge),Je){var bn=Qt.ranges;if(Ge=="block")for(var xo=0;xo<bn.length;xo++)bn[xo].head.ch=Dt(f,bn[xo].head.line);else Ge=="line"&&(bn[0].head=new t(bn[0].head.line+1,0))}}else{if(qt=et(J||oe),Ht=et(X||le),Et(Ht,qt)){var Hu=qt;qt=Ht,Ht=Hu}Je=_.linewise||D.linewise,Je?re(f,qt,Ht):_.forward&&q(f,qt,Ht),Ge="char";var Bu=!_.inclusive||Je,dn=n(f,qt,Ht);Qt=mr(f,{anchor:dn.start,head:dn.end},Ge,Bu)}f.setSelections(Qt.ranges,Qt.primary),h.lastMotion=null,D.repeat=Ce,D.registerName=I,D.linewise=Je;var bs=Yt[k](f,D,Qt.ranges,oe,X);h.visualMode&&rt(f,bs!=null),bs&&f.setCursor(bs)}},recordLastEdit:function(f,h,v){var b=G.macroModeState;b.isPlaying||(f.lastEditInputState=h,f.lastEditActionCommand=v,b.lastInsertModeChanges.changes=[],b.lastInsertModeChanges.expectCursorActivityForChange=!1,b.lastInsertModeChanges.visualBlock=f.visualBlock?f.sel.head.line-f.sel.anchor.line:0)}},yn={moveToTopLine:function(f,h,v){var b=ho(f).top+v.repeat-1;return new t(b,we(f.getLine(b)))},moveToMiddleLine:function(f){var h=ho(f),v=Math.floor((h.top+h.bottom)*.5);return new t(v,we(f.getLine(v)))},moveToBottomLine:function(f,h,v){var b=ho(f).bottom-v.repeat+1;return new t(b,we(f.getLine(b)))},expandToLine:function(f,h,v){return new t(h.line+v.repeat-1,1/0)},findNext:function(f,h,v){var b=tr(f),_=b.getQuery();if(_){var k=!v.forward;k=b.isReversed()?!k:k,hs(f,_);var D=Ni(f,k,_,v.repeat);return D||pt(f,"No match found "+_+(Q("pcre")?" (set nopcre to use Vim regexps)":"")),D}},findAndSelectNextInclusive:function(f,h,v,b,_){var k=tr(f),D=k.getQuery();if(D){var I=!v.forward;I=k.isReversed()?!I:I;var L=Im(f,I,D,v.repeat,b);if(L){if(_.operator)return L;var F=L[0],N=new t(L[1].line,L[1].ch-1);if(b.visualMode){(b.visualLine||b.visualBlock)&&(b.visualLine=!1,b.visualBlock=!1,e.signal(f,"vim-mode-change",{mode:"visual",subMode:""}));var le=b.sel.anchor;if(le)return k.isReversed()?v.forward?[le,F]:[le,N]:v.forward?[le,N]:[le,F]}else b.visualMode=!0,b.visualLine=!1,b.visualBlock=!1,e.signal(f,"vim-mode-change",{mode:"visual",subMode:""});return I?[N,F]:[F,N]}}},goToMark:function(f,h,v,b){var _=gs(f,b,v.selectedCharacter||"");return _?v.linewise?{line:_.line,ch:we(f.getLine(_.line))}:_:null},moveToOtherHighlightedEnd:function(f,h,v,b){var _=b.sel;return b.visualBlock&&v.sameLine?[Vt(f,new t(_.anchor.line,_.head.ch)),Vt(f,new t(_.head.line,_.anchor.ch))]:[_.head,_.anchor]},jumpToMark:function(f,h,v,b){for(var _=h,k=0;k<v.repeat;k++){var D=_;for(var I in b.marks)if(P(I)){var L=b.marks[I].find();if(!(v.forward?Et(L,D):Et(D,L))&&!(v.linewise&&L.line==D.line)){var F=wt(D,_),N=v.forward?Mr(D,L,_):Mr(_,L,D);(F||N)&&(_=L)}}}return v.linewise&&(_=new t(_.line,we(f.getLine(_.line)))),_},moveByCharacters:function(f,h,v){var b=h,_=v.repeat,k=v.forward?b.ch+_:b.ch-_;return new t(b.line,k)},moveByLines:function(f,h,v,b){var _=h,k=_.ch;switch(b.lastMotion){case this.moveByLines:case this.moveByDisplayLines:case this.moveByScroll:case this.moveToColumn:case this.moveToEol:k=b.lastHPos;break;default:b.lastHPos=k}var D=v.repeat+(v.repeatOffset||0),I=v.forward?_.line+D:_.line-D,L=f.firstLine(),F=f.lastLine(),N=f.findPosV(_,v.forward?D:-D,"line",b.lastHSPos);return(v.forward?N.line>I:N.line<I)&&(I=N.line,k=N.ch),I<L&&_.line==L?this.moveToStartOfLine(f,h,v,b):I>F&&_.line==F?Sn(f,h,v,b,!0):(v.toFirstChar&&(k=we(f.getLine(I)),b.lastHPos=k),b.lastHSPos=f.charCoords(new t(I,k),"div").left,new t(I,k))},moveByDisplayLines:function(f,h,v,b){var _=h;switch(b.lastMotion){case this.moveByDisplayLines:case this.moveByScroll:case this.moveByLines:case this.moveToColumn:case this.moveToEol:break;default:b.lastHSPos=f.charCoords(_,"div").left}var k=v.repeat,D=f.findPosV(_,v.forward?k:-k,"line",b.lastHSPos);if(D.hitSide)if(v.forward){var I={top:f.charCoords(D,"div").top+8,left:b.lastHSPos};D=f.coordsChar(I,"div")}else{var L=f.charCoords(new t(f.firstLine(),0),"div");L.left=b.lastHSPos,D=f.coordsChar(L,"div")}return b.lastHPos=D.ch,D},moveByPage:function(f,h,v){var b=h,_=v.repeat;return f.findPosV(b,v.forward?_:-_,"page")},moveByParagraph:function(f,h,v){var b=v.forward?1:-1;return an(f,h,v.repeat,b).start},moveBySentence:function(f,h,v){var b=v.forward?1:-1;return Ou(f,h,v.repeat,b)},moveByScroll:function(f,h,v,b){var _=f.getScrollInfo(),k=null,D=v.repeat;D||(D=_.clientHeight/(2*f.defaultTextHeight()));var I=f.charCoords(h,"local");if(v.repeat=D,k=yn.moveByDisplayLines(f,h,v,b),!k)return null;var L=f.charCoords(k,"local");return f.scrollTo(null,_.top+L.top-I.top),k},moveByWords:function(f,h,v){return mt(f,h,v.repeat,!!v.forward,!!v.wordEnd,!!v.bigWord)},moveTillCharacter:function(f,h,v){var b=v.repeat,_=hr(f,b,v.forward,v.selectedCharacter,h),k=v.forward?-1:1;return ut(k,v),_?(_.ch+=k,_):null},moveToCharacter:function(f,h,v){var b=v.repeat;return ut(0,v),hr(f,b,v.forward,v.selectedCharacter,h)||h},moveToSymbol:function(f,h,v){var b=v.repeat;return v.selectedCharacter&&jt(f,b,v.forward,v.selectedCharacter)||h},moveToColumn:function(f,h,v,b){var _=v.repeat;return b.lastHPos=_-1,b.lastHSPos=f.charCoords(h,"div").left,yi(f,_)},moveToEol:function(f,h,v,b){return Sn(f,h,v,b,!1)},moveToFirstNonWhiteSpaceCharacter:function(f,h){var v=h;return new t(v.line,we(f.getLine(v.line)))},moveToMatchedSymbol:function(f,h){for(var v=h,b=v.line,_=v.ch,k=f.getLine(b),D;_<k.length;_++)if(D=k.charAt(_),D&&U(D)){var I=f.getTokenTypeAt(new t(b,_+1));if(I!=="string"&&I!=="comment")break}if(_<k.length){var L=D==="<"||D===">"?/[(){}[\]<>]/:/[(){}[\]]/;return f.findMatchingBracket(new t(b,_),{bracketRegex:L}).to}else return v},moveToStartOfLine:function(f,h){return new t(h.line,0)},moveToLineOrEdgeOfDocument:function(f,h,v){var b=v.forward?f.lastLine():f.firstLine();return v.repeatIsExplicit&&(b=v.repeat-f.getOption("firstLineNumber")),new t(b,we(f.getLine(b)))},moveToStartOfDisplayLine:function(f){return f.execCommand("goLineLeft"),f.getCursor()},moveToEndOfDisplayLine:function(f){f.execCommand("goLineRight");var h=f.getCursor();return h.sticky=="before"&&h.ch--,h},textObjectManipulation:function(f,h,v,b){var _={"(":")",")":"(","{":"}","}":"{","[":"]","]":"[","<":">",">":"<"},k={"'":!0,'"':!0,"`":!0},D=v.selectedCharacter||"";D=="b"?D="(":D=="B"&&(D="{");var I=!v.textObjectInner,L,F;if(_[D]){if(F=!0,L=vi(f,h,D,I),!L){var N=f.getSearchCursor(RegExp("\\"+D,"g"),h);N.find()&&(L=vi(f,N.from(),D,I))}}else if(k[D])F=!0,L=Ca(f,h,D,I);else if(D==="W"||D==="w")for(var le=v.repeat||1;le-- >0;){var oe=De(f,{inclusive:I,innerWord:!I,bigWord:D==="W",noSymbol:D==="W",multiline:!0},L&&L.end);oe&&(L||(L=oe),L.end=oe.end)}else if(D==="p")if(L=an(f,h,v.repeat,0,I),v.linewise=!0,b.visualMode)b.visualLine||(b.visualLine=!0);else{var X=b.inputState.operatorArgs;X&&(X.linewise=!0),L.end.line--}else if(D==="t")L=Ue(f,h,I);else if(D==="s"){var J=f.getLine(h.line);h.ch>0&&ae(J[h.ch])&&--h.ch;var Ce=Ll(f,h,v.repeat,1,I),ke=Ll(f,h,v.repeat,-1,I);W(f.getLine(ke.line)[ke.ch])&&W(f.getLine(Ce.line)[Ce.ch-1])&&(ke={line:ke.line,ch:ke.ch+1}),L={start:ke,end:Ce}}return L?f.state.vim.visualMode?Oi(f,L.start,L.end,F):[L.start,L.end]:null},repeatLastCharacterSearch:function(f,h,v){var b=G.lastCharacterSearch,_=v.repeat,k=v.forward===b.forward,D=(b.increment?1:0)*(k?-1:1);f.moveH(-D,"char"),v.inclusive=!!k;var I=hr(f,_,k,b.selectedCharacter);return I?(I.ch+=D,I):(f.moveH(D,"char"),h)}};function xa(f,h){yn[f]=h}function Ii(f,h){for(var v=[],b=0;b<h;b++)v.push(f);return v}var Yt={change:function(f,h,v){var b,_,k=f.state.vim,D=v[0].anchor,I=v[0].head;if(k.visualMode)if(h.fullLine)I.ch=Number.MAX_VALUE,I.line--,f.setSelection(D,I),_=f.getSelection(),f.replaceSelection(""),b=D;else{_=f.getSelection();var L=Ii("",v.length);f.replaceSelections(L),b=Tt(v[0].head,v[0].anchor)}else{_=f.getRange(D,I);var F=k.lastEditInputState;if((F==null?void 0:F.motion)=="moveByWords"&&!W(_)){var N=/\s+$/.exec(_);N&&F.motionArgs&&F.motionArgs.forward&&(I=St(I,0,-N[0].length),_=_.slice(0,-N[0].length))}h.linewise&&(D=new t(D.line,we(f.getLine(D.line))),I.line>D.line&&(I=new t(I.line-1,Number.MAX_VALUE))),f.replaceRange("",D,I),b=D}G.registerController.pushText(h.registerName,"change",_,h.linewise,v.length>1),vn.enterInsertMode(f,{head:b},f.state.vim)},delete:function(f,h,v){var b,_,k=f.state.vim;if(k.visualBlock){_=f.getSelection();var D=Ii("",v.length);f.replaceSelections(D),b=Tt(v[0].head,v[0].anchor)}else{var I=v[0].anchor,L=v[0].head;h.linewise&&L.line!=f.firstLine()&&I.line==f.lastLine()&&I.line==L.line-1&&(I.line==f.firstLine()?I.ch=0:I=new t(I.line-1,Dt(f,I.line-1))),_=f.getRange(I,L),f.replaceRange("",I,L),b=I,h.linewise&&(b=yn.moveToFirstNonWhiteSpaceCharacter(f,I))}return G.registerController.pushText(h.registerName,"delete",_,h.linewise,k.visualBlock),Vt(f,b)},indent:function(f,h,v){var b=f.state.vim,_=b.visualMode&&h.repeat||1;if(b.visualBlock){for(var k=f.getOption("tabSize"),D=f.getOption("indentWithTabs")?" ":" ".repeat(k),I,L=v.length-1;L>=0;L--)if(I=Tt(v[L].anchor,v[L].head),h.indentRight)f.replaceRange(D.repeat(_),I,I);else{for(var F=f.getLine(I.line),N=0,le=0;le<_;le++){var oe=F[I.ch+N];if(oe==" ")N++;else if(oe==" "){N++;for(var X=1;X<D.length&&(oe=F[I.ch+N],oe===" ");X++)N++}else break}f.replaceRange("",I,St(I,0,N))}return I}else if(f.indentMore)for(var le=0;le<_;le++)h.indentRight?f.indentMore():f.indentLess();else{var J=v[0].anchor.line,Ce=b.visualBlock?v[v.length-1].anchor.line:v[0].head.line;h.linewise&&Ce--;for(var L=J;L<=Ce;L++)for(var le=0;le<_;le++)f.indentLine(L,h.indentRight)}return yn.moveToFirstNonWhiteSpaceCharacter(f,v[0].anchor)},indentAuto:function(f,h,v){return f.execCommand("indentAuto"),yn.moveToFirstNonWhiteSpaceCharacter(f,v[0].anchor)},hardWrap:function(f,h,v,b){if(f.hardWrap){var _=v[0].anchor.line,k=v[0].head.line;h.linewise&&k--;var D=f.hardWrap({from:_,to:k});return D>_&&h.linewise&&D--,h.keepCursor?b:new t(D,0)}},changeCase:function(f,h,v,b,_){for(var k=f.getSelections(),D=[],I=h.toLower,L=0;L<k.length;L++){var F=k[L],N="";if(I===!0)N=F.toLowerCase();else if(I===!1)N=F.toUpperCase();else for(var le=0;le<F.length;le++){var oe=F.charAt(le);N+=$(oe)?oe.toLowerCase():oe.toUpperCase()}D.push(N)}return f.replaceSelections(D),h.shouldMoveCursor?_:!f.state.vim.visualMode&&h.linewise&&v[0].anchor.line+1==v[0].head.line?yn.moveToFirstNonWhiteSpaceCharacter(f,b):h.linewise?b:Tt(v[0].anchor,v[0].head)},yank:function(f,h,v,b){var _=f.state.vim,k=f.getSelection(),D=_.visualMode?Tt(_.sel.anchor,_.sel.head,v[0].head,v[0].anchor):b;return G.registerController.pushText(h.registerName,"yank",k,h.linewise,_.visualBlock),D},rot13:function(f,h,v,b,_){for(var k=f.getSelections(),D=[],I=0;I<k.length;I++){let L=k[I].split("").map(F=>{let N=F.charCodeAt(0);return N>=65&&N<=90?String.fromCharCode(65+(N-65+13)%26):N>=97&&N<=122?String.fromCharCode(97+(N-97+13)%26):F}).join("");D.push(L)}return f.replaceSelections(D),h.shouldMoveCursor?_:!f.state.vim.visualMode&&h.linewise&&v[0].anchor.line+1==v[0].head.line?yn.moveToFirstNonWhiteSpaceCharacter(f,b):h.linewise?b:Tt(v[0].anchor,v[0].head)}};function Ai(f,h){Yt[f]=h}var vn={jumpListWalk:function(f,h,v){if(!v.visualMode){var b=h.repeat||1,_=h.forward,k=G.jumpList.move(f,_?b:-b),D=k?k.find():void 0;D||(D=f.getCursor()),f.setCursor(D)}},scroll:function(f,h,v){if(!v.visualMode){var b=h.repeat||1,_=f.defaultTextHeight(),k=f.getScrollInfo().top,D=_*b,I=h.forward?k+D:k-D,L=et(f.getCursor()),F=f.charCoords(L,"local");if(h.forward)I>F.top?(L.line+=(I-F.top)/_,L.line=Math.ceil(L.line),f.setCursor(L),F=f.charCoords(L,"local"),f.scrollTo(null,F.top)):f.scrollTo(null,I);else{var N=I+f.getScrollInfo().clientHeight;N<F.bottom?(L.line-=(F.bottom-N)/_,L.line=Math.floor(L.line),f.setCursor(L),F=f.charCoords(L,"local"),f.scrollTo(null,F.bottom-f.getScrollInfo().clientHeight)):f.scrollTo(null,I)}}},scrollToCursor:function(f,h){var v=f.getCursor().line,b=f.charCoords(new t(v,0),"local"),_=f.getScrollInfo().clientHeight,k=b.top;switch(h.position){case"center":k=b.bottom-_/2;break;case"bottom":var D=new t(v,f.getLine(v).length-1),I=f.charCoords(D,"local").bottom-k;k=k-_+I;break}f.scrollTo(null,k)},replayMacro:function(f,h,v){var b=h.selectedCharacter||"",_=h.repeat||1,k=G.macroModeState;for(b=="@"?b=k.latestRegister||"":k.latestRegister=b;_--;)go(f,v,k,b)},enterMacroRecordMode:function(f,h){var v=G.macroModeState,b=h.selectedCharacter;G.registerController.isValidRegister(b)&&v.enterMacroRecordMode(f,b)},toggleOverwrite:function(f){f.state.overwrite?(f.toggleOverwrite(!1),f.setOption("keyMap","vim-insert"),e.signal(f,"vim-mode-change",{mode:"insert"})):(f.toggleOverwrite(!0),f.setOption("keyMap","vim-replace"),e.signal(f,"vim-mode-change",{mode:"replace"}))},enterInsertMode:function(f,h,v){if(!f.getOption("readOnly")){v.insertMode=!0,v.insertModeRepeat=h&&h.repeat||1;var b=h?h.insertAt:null,_=v.sel,k=h.head||f.getCursor("head"),D=f.listSelections().length;if(b=="eol")k=new t(k.line,Dt(f,k.line));else if(b=="bol")k=new t(k.line,0);else if(b=="charAfter"){var I=n(f,k,St(k,0,1));k=I.end}else if(b=="firstNonBlank"){var I=n(f,k,yn.moveToFirstNonWhiteSpaceCharacter(f,k));k=I.end}else if(b=="startOfSelectedArea"){if(!v.visualMode)return;v.visualBlock?(k=new t(Math.min(_.head.line,_.anchor.line),Math.min(_.head.ch,_.anchor.ch)),D=Math.abs(_.head.line-_.anchor.line)+1):k=_.head.line<_.anchor.line?_.head:new t(_.anchor.line,0)}else if(b=="endOfSelectedArea"){if(!v.visualMode)return;v.visualBlock?(k=new t(Math.min(_.head.line,_.anchor.line),Math.max(_.head.ch,_.anchor.ch)+1),D=Math.abs(_.head.line-_.anchor.line)+1):k=_.head.line>=_.anchor.line?St(_.head,0,1):new t(_.anchor.line,0)}else if(b=="inplace"){if(v.visualMode)return}else b=="lastEdit"&&(k=Fu(f)||k);f.setOption("disableInput",!1),h&&h.replace?(f.toggleOverwrite(!0),f.setOption("keyMap","vim-replace"),e.signal(f,"vim-mode-change",{mode:"replace"})):(f.toggleOverwrite(!1),f.setOption("keyMap","vim-insert"),e.signal(f,"vim-mode-change",{mode:"insert"})),G.macroModeState.isPlaying||(f.on("change",ri),v.insertEnd&&v.insertEnd.clear(),v.insertEnd=f.setBookmark(k,{insertLeft:!0}),e.on(f.getInputField(),"keydown",ql)),v.visualMode&&rt(f),pr(f,k,D)}},toggleVisualMode:function(f,h,v){var b=h.repeat,_=f.getCursor(),k;if(v.visualMode)v.visualLine!=!!h.linewise||v.visualBlock!=!!h.blockwise?(v.visualLine=!!h.linewise,v.visualBlock=!!h.blockwise,e.signal(f,"vim-mode-change",{mode:"visual",subMode:v.visualLine?"linewise":v.visualBlock?"blockwise":""}),Wn(f)):rt(f);else{v.visualMode=!0,v.visualLine=!!h.linewise,v.visualBlock=!!h.blockwise,k=Vt(f,new t(_.line,_.ch+b-1));var D=n(f,_,k);v.sel={anchor:D.start,head:D.end},e.signal(f,"vim-mode-change",{mode:"visual",subMode:v.visualLine?"linewise":v.visualBlock?"blockwise":""}),Wn(f),Un(f,v,"<",Tt(_,k)),Un(f,v,">",Bn(_,k))}},reselectLastSelection:function(f,h,v){var b=v.lastSelection;if(v.visualMode&&zn(f,v),b){var _=b.anchorMark.find(),k=b.headMark.find();if(!_||!k)return;v.sel={anchor:_,head:k},v.visualMode=!0,v.visualLine=b.visualLine,v.visualBlock=b.visualBlock,Wn(f),Un(f,v,"<",Tt(_,k)),Un(f,v,">",Bn(_,k)),e.signal(f,"vim-mode-change",{mode:"visual",subMode:v.visualLine?"linewise":v.visualBlock?"blockwise":""})}},joinLines:function(f,h,v){var b,_;if(v.visualMode){if(b=f.getCursor("anchor"),_=f.getCursor("head"),Et(_,b)){var k=_;_=b,b=k}_.ch=Dt(f,_.line)-1}else{var D=Math.max(h.repeat,2);b=f.getCursor(),_=Vt(f,new t(b.line+D-1,1/0))}for(var I=0,L=b.line;L<_.line;L++){I=Dt(f,b.line);var F="",N=0;if(!h.keepSpaces){var le=f.getLine(b.line+1);N=le.search(/\S/),N==-1?N=le.length:F=" "}f.replaceRange(F,new t(b.line,I),new t(b.line+1,N))}var oe=Vt(f,new t(b.line,I));v.visualMode&&rt(f,!1),f.setCursor(oe)},newLineAndEnterInsertMode:function(f,h,v){v.insertMode=!0;var b=et(f.getCursor());b.line===f.firstLine()&&!h.after?(f.replaceRange(`
|
|
102
102
|
`,new t(f.firstLine(),0)),f.setCursor(f.firstLine(),0)):(b.line=h.after?b.line:b.line-1,b.ch=Dt(f,b.line),f.setCursor(b),(e.commands.newlineAndIndentContinueComment||e.commands.newlineAndIndent)(f)),this.enterInsertMode(f,{repeat:h.repeat},v)},paste:function(f,h,v){var b=G.registerController.getRegister(h.registerName);if(h.registerName==="+")navigator.clipboard.readText().then(k=>{this.continuePaste(f,h,v,k,b)});else{var _=b.toString();this.continuePaste(f,h,v,_,b)}},continuePaste:function(f,h,v,b,_){var k=et(f.getCursor());if(b){if(h.matchIndent){var D=f.getOption("tabSize"),I=function(Qt){var dn=Qt.split(" ").length-1,bn=Qt.split(" ").length-1;return dn*D+bn*1},L=I(f.getLine(f.getCursor().line).match(/^\s*/)[0]),F=b.replace(/\n$/,""),N=b!==F,le=I(b.match(/^\s*/)[0]),b=F.replace(/^\s*/gm,function(Qt){var dn=L+(I(Qt)-le);if(dn<0)return"";if(f.getOption("indentWithTabs")){var bn=Math.floor(dn/D);return Array(bn+1).join(" ")}else return Array(dn+1).join(" ")});b+=N?`
|
|
103
103
|
`:""}h.repeat>1&&(b=Array(h.repeat+1).join(b));var oe=_.linewise,X=_.blockwise,J=X?b.split(`
|
|
104
104
|
`):void 0;if(J){oe&&J.pop();for(var Ce=0;Ce<J.length;Ce++)J[Ce]=J[Ce]==""?" ":J[Ce];k.ch+=h.after?1:0,k.ch=Math.min(Dt(f,k.line),k.ch)}else oe?v.visualMode?b=v.visualLine?b.slice(0,-1):`
|
|
@@ -107,11 +107,11 @@ ${n.sqlString}
|
|
|
107
107
|
`+b.slice(0,b.length-1),k.ch=Dt(f,k.line)):k.ch=0:k.ch+=h.after?1:0;var ke;if(v.visualMode){v.lastPastedText=b;var We,Ie=gi(f),$e=Ie[0],ht=Ie[1],tt=f.getSelection(),qt=f.listSelections(),Ht=Array(qt.length).join("1").split("1");v.lastSelection&&(We=v.lastSelection.headMark.find()),G.registerController.unnamedRegister.setText(tt),X?(f.replaceSelections(Ht),ht=new t($e.line+b.length-1,$e.ch),f.setCursor($e),Cn(f,ht),f.replaceSelections(b),ke=$e):v.visualBlock?(f.replaceSelections(Ht),f.setCursor($e),f.replaceRange(b,$e,$e),ke=$e):(f.replaceRange(b,$e,ht),ke=f.posFromIndex(f.indexFromPos($e)+b.length-1)),We&&(v.lastSelection.headMark=f.setBookmark(We)),oe&&(ke.ch=0)}else if(X&&J){f.setCursor(k);for(var Ce=0;Ce<J.length;Ce++){var Je=k.line+Ce;Je>f.lastLine()&&f.replaceRange(`
|
|
108
108
|
`,new t(Je,0)),Dt(f,Je)<k.ch&&ei(f,Je,k.ch)}f.setCursor(k),Cn(f,new t(k.line+J.length-1,k.ch)),f.replaceSelections(J),ke=k}else if(f.replaceRange(b,k),oe){var Je=h.after?k.line+1:k.line;ke=new t(Je,we(f.getLine(Je)))}else ke=et(k),/\n/.test(b)||(ke.ch+=b.length-(h.after?1:0));v.visualMode&&rt(f,!1),f.setCursor(ke)}},undo:function(f,h){f.operation(function(){rn(f,e.commands.undo,h.repeat)(),f.setCursor(Vt(f,f.getCursor("start")))})},redo:function(f,h){rn(f,e.commands.redo,h.repeat)()},setRegister:function(f,h,v){v.inputState.registerName=h.selectedCharacter},insertRegister:function(f,h,v){var b=h.selectedCharacter,_=G.registerController.getRegister(b),k=_&&_.toString();k&&f.replaceSelection(k)},oneNormalCommand:function(f,h,v){Qn(f,!0),v.insertModeReturn=!0,e.on(f,"vim-command-done",function b(){v.visualMode||(v.insertModeReturn&&(v.insertModeReturn=!1,v.insertMode||vn.enterInsertMode(f,{},v)),e.off(f,"vim-command-done",b))})},setMark:function(f,h,v){var b=h.selectedCharacter;b&&Un(f,v,b,f.getCursor())},replace:function(f,h,v){var b=h.selectedCharacter||"",_=f.getCursor(),k,D,I=f.listSelections();if(v.visualMode)_=f.getCursor("start"),D=f.getCursor("end");else{var L=f.getLine(_.line);k=_.ch+h.repeat,k>L.length&&(k=L.length),D=new t(_.line,k)}var F=n(f,_,D);if(_=F.start,D=F.end,b==`
|
|
109
109
|
`)v.visualMode||f.replaceRange("",_,D),(e.commands.newlineAndIndentContinueComment||e.commands.newlineAndIndent)(f);else{var N=f.getRange(_,D);if(N=N.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,b),N=N.replace(/[^\n]/g,b),v.visualBlock){var le=Array(f.getOption("tabSize")+1).join(" ");N=f.getSelection(),N=N.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,b);var oe=N.replace(/\t/g,le).replace(/[^\n]/g,b).split(`
|
|
110
|
-
`);f.replaceSelections(oe)}else f.replaceRange(N,_,D);v.visualMode?(_=Et(I[0].anchor,I[0].head)?I[0].anchor:I[0].head,f.setCursor(_),rt(f,!1)):f.setCursor(St(D,0,-1))}},incrementNumberToken:function(f,h){for(var v=f.getCursor(),b=f.getLine(v.line),_=/(-?)(?:(0x)([\da-f]+)|(0b|0|)(\d+))/gi,k,D,I,L;(k=_.exec(b))!==null&&(D=k.index,I=D+k[0].length,!(v.ch<I)););if(!(!h.backtrack&&I<=v.ch)){if(k){var F=k[2]||k[4],N=k[3]||k[5],le=h.increase?1:-1,oe={"0b":2,0:8,"":10,"0x":16}[F.toLowerCase()];L=(parseInt(k[1]+N,oe)+le*h.repeat).toString(oe);var X=F?Array(N.length-L.length+1+k[1].length).join("0"):"";L=L.charAt(0)==="-"?"-"+F+X+L.substr(1):F+X+L;var J=new t(v.line,D),Ce=new t(v.line,I);f.replaceRange(L,J,Ce)}else return;f.setCursor(new t(v.line,D+L.length-1))}},repeatLastEdit:function(f,h,v){var b=v.lastEditInputState;if(b){var _=h.repeat;_&&h.repeatIsExplicit?b.repeatOverride=_:_=b.repeatOverride||_,
|
|
110
|
+
`);f.replaceSelections(oe)}else f.replaceRange(N,_,D);v.visualMode?(_=Et(I[0].anchor,I[0].head)?I[0].anchor:I[0].head,f.setCursor(_),rt(f,!1)):f.setCursor(St(D,0,-1))}},incrementNumberToken:function(f,h){for(var v=f.getCursor(),b=f.getLine(v.line),_=/(-?)(?:(0x)([\da-f]+)|(0b|0|)(\d+))/gi,k,D,I,L;(k=_.exec(b))!==null&&(D=k.index,I=D+k[0].length,!(v.ch<I)););if(!(!h.backtrack&&I<=v.ch)){if(k){var F=k[2]||k[4],N=k[3]||k[5],le=h.increase?1:-1,oe={"0b":2,0:8,"":10,"0x":16}[F.toLowerCase()];L=(parseInt(k[1]+N,oe)+le*h.repeat).toString(oe);var X=F?Array(N.length-L.length+1+k[1].length).join("0"):"";L=L.charAt(0)==="-"?"-"+F+X+L.substr(1):F+X+L;var J=new t(v.line,D),Ce=new t(v.line,I);f.replaceRange(L,J,Ce)}else return;f.setCursor(new t(v.line,D+L.length-1))}},repeatLastEdit:function(f,h,v){var b=v.lastEditInputState;if(b){var _=h.repeat;_&&h.repeatIsExplicit?b.repeatOverride=_:_=b.repeatOverride||_,bo(f,v,_,!1)}},indent:function(f,h){f.indentLine(f.getCursor().line,h.indentRight)},exitInsertMode:function(f,h){Qn(f)}};function hi(f,h){vn[f]=h}function Vt(f,h,v){var b=f.state.vim,_=b.insertMode||b.visualMode,k=Math.min(Math.max(f.firstLine(),h.line),f.lastLine()),D=f.getLine(k),I=D.length-1+ +!!_,L=Math.min(Math.max(0,h.ch),I),F=D.charCodeAt(L);if(56320<=F&&F<=57343){var N=1;v&&v.line==k&&v.ch>L&&(N=-1),L+=N,L>I&&(L-=2)}return new t(k,L)}function Zr(f){var h={};for(var v in f)Object.prototype.hasOwnProperty.call(f,v)&&(h[v]=f[v]);return h}function St(f,h,v){return typeof h=="object"&&(v=h.ch,h=h.line),new t(f.line+h,f.ch+v)}function Li(f,h,v,b){b.operator&&(v="operatorPending");for(var _,k=[],D=[],I=Oe?h.length-l:0;I<h.length;I++){var L=h[I];v=="insert"&&L.context!="insert"||L.context&&L.context!=v||b.operator&&L.type=="action"||!(_=_a(f,L.keys))||(_=="partial"&&k.push(L),_=="full"&&D.push(L))}return{partial:k,full:D}}function _a(f,h){let v=h.slice(-11)=="<character>",b=h.slice(-10)=="<register>";if(v||b){var _=h.length-(v?11:10),k=f.slice(0,_),D=h.slice(0,_);return k==D&&f.length>_?"full":D.indexOf(k)==0?"partial":!1}else return f==h?"full":h.indexOf(f)==0?"partial":!1}function Or(f){var h=/^.*(<[^>]+>)$/.exec(f),v=h?h[1]:f.slice(-1);if(v.length>1)switch(v){case"<CR>":case"<S-CR>":v=`
|
|
111
111
|
`;break;case"<Space>":case"<S-Space>":v=" ";break;default:v="";break}return v}function rn(f,h,v){return function(){for(var b=0;b<v;b++)h(f)}}function et(f){return new t(f.line,f.ch)}function wt(f,h){return f.ch==h.ch&&f.line==h.line}function Et(f,h){return f.line<h.line||f.line==h.line&&f.ch<h.ch}function Tt(f,h){return arguments.length>2&&(h=Tt.apply(void 0,Array.prototype.slice.call(arguments,1))),Et(f,h)?f:h}function Bn(f,h){return arguments.length>2&&(h=Bn.apply(void 0,Array.prototype.slice.call(arguments,1))),Et(f,h)?h:f}function Mr(f,h,v){var b=Et(f,h),_=Et(h,v);return b&&_}function Dt(f,h){return f.getLine(h).length}function fr(f){return f.trim?f.trim():f.replace(/^\s+|\s+$/g,"")}function qn(f){return f.replace(/([.?*+$\[\]\/\\(){}|\-])/g,"\\$1")}function ei(f,h,v){var b=Dt(f,h),_=Array(v-b+1).join(" ");f.setCursor(new t(h,b)),f.replaceRange(_,f.getCursor())}function Cn(f,h){var v=[],b=f.listSelections(),_=et(f.clipPos(h)),k=!wt(h,_),D=Pi(b,f.getCursor("head")),I=wt(b[D].head,b[D].anchor),L=b.length-1,F=L-D>D?L:0,N=b[F].anchor,le=Math.min(N.line,_.line),oe=Math.max(N.line,_.line),X=N.ch,J=_.ch,Ce=b[F].head.ch-X,ke=J-X;Ce>0&&ke<=0?(X++,k||J--):Ce<0&&ke>=0?(X--,I||J++):Ce<0&&ke==-1&&(X--,J++);for(var We=le;We<=oe;We++){var Ie={anchor:new t(We,X),head:new t(We,J)};v.push(Ie)}return f.setSelections(v),h.ch=J,N.ch=X,N}function pr(f,h,v){for(var b=[],_=0;_<v;_++){var k=St(h,_,0);b.push({anchor:k,head:k})}f.setSelections(b,0)}function Pi(f,h,v){for(var b=0;b<f.length;b++){var _=wt(f[b].anchor,h),k=wt(f[b].head,h);if(_||k)return b}return-1}function gi(f,h){var v=f.listSelections(),b=v[0],_=v[v.length-1];return[Et(b.anchor,b.head)?b.anchor:b.head,Et(_.anchor,_.head)?_.head:_.anchor]}function zn(f,h){var v=h.sel.anchor,b=h.sel.head;h.lastPastedText&&(h.lastPastedText=(b=f.posFromIndex(f.indexFromPos(v)+h.lastPastedText.length),void 0)),h.lastSelection={anchorMark:f.setBookmark(v),headMark:f.setBookmark(b),anchor:et(v),head:et(b),visualMode:h.visualMode,visualLine:h.visualLine,visualBlock:h.visualBlock}}function Oi(f,h,v,b){var _=f.state.vim.sel,k=b?h:_.head,D=b?h:_.anchor,I;return Et(v,h)&&(I=v,v=h,h=I),Et(k,D)?(k=Tt(h,k),D=Bn(D,v)):(D=Tt(h,D),k=Bn(k,v),k=St(k,0,-1),k.ch==-1&&k.line!=f.firstLine()&&(k=new t(k.line-1,Dt(f,k.line-1)))),[D,k]}function Wn(f,h,v){var b=f.state.vim;h||(h=b.sel),v||(v=b.visualLine?"line":b.visualBlock?"block":"char");var _=mr(f,h,v);f.setSelections(_.ranges,_.primary)}function mr(f,h,v,b){var _=et(h.head),k=et(h.anchor);if(v=="char"){var D=!b&&!Et(h.head,h.anchor)?1:0,I=Et(h.head,h.anchor)?1:0;return _=St(h.head,0,D),k=St(h.anchor,0,I),{ranges:[{anchor:k,head:_}],primary:0}}else if(v=="line"){if(Et(h.head,h.anchor))_.ch=0,k.ch=Dt(f,k.line);else{k.ch=0;var L=f.lastLine();_.line>L&&(_.line=L),_.ch=Dt(f,_.line)}return{ranges:[{anchor:k,head:_}],primary:0}}else if(v=="block"){var F=Math.min(k.line,_.line),N=k.ch,le=Math.max(k.line,_.line),oe=_.ch;N<oe?oe+=1:N+=1;for(var X=le-F+1,J=_.line==F?0:X-1,Ce=[],ke=0;ke<X;ke++)Ce.push({anchor:new t(F+ke,N),head:new t(F+ke,oe)});return{ranges:Ce,primary:J}}throw"never happens"}function A(f){var h=f.getCursor("head");return f.getSelection().length==1&&(h=Tt(h,f.getCursor("anchor"))),h}function rt(f,h){var v=f.state.vim;h!==!1&&f.setCursor(Vt(f,v.sel.head)),zn(f,v),v.visualMode=!1,v.visualLine=!1,v.visualBlock=!1,v.insertMode||e.signal(f,"vim-mode-change",{mode:"normal"})}function q(f,h,v){var b=f.getRange(h,v);if(/\n\s*$/.test(b)){var _=b.split(`
|
|
112
|
-
`);_.pop();for(var k=_.pop();_.length>0&&k&&W(k);k=_.pop())v.line--,v.ch=0;k?(v.line--,v.ch=Dt(f,v.line)):v.ch=0}}function re(f,h,v){h.ch=0,v.ch=0,v.line++}function we(f){if(!f)return 0;var h=f.search(/\S/);return h==-1?f.length:h}function De(f,{inclusive:h,innerWord:v,bigWord:b,noSymbol:_,multiline:k},D){var I=D||A(f),L=f.getLine(I.line),F=L,N=I.line,le=N,oe=I.ch,X,J=_?S[0]:E[0];if(v&&/\s/.test(L.charAt(oe)))J=function(ht){return/\s/.test(ht)};else{for(;!J(L.charAt(oe));)if(oe++,oe>=L.length){if(!k)return null;oe--,X=st(f,I,!0,b,!0);break}b?J=E[0]:(J=S[0],J(L.charAt(oe))||(J=S[1]))}for(var Ce=oe,ke=oe;J(L.charAt(ke))&&ke>=0;)ke--;if(ke++,X)Ce=X.to,le=X.line,F=f.getLine(le),!F&&Ce==0&&Ce++;else for(;J(L.charAt(Ce))&&Ce<L.length;)Ce++;if(h){var We=Ce,Ie=I.ch<=ke&&/\s/.test(L.charAt(I.ch));if(!Ie)for(;/\s/.test(F.charAt(Ce))&&Ce<F.length;)Ce++;if(We==Ce||Ie){for(var $e=ke;/\s/.test(L.charAt(ke-1))&&ke>0;)ke--;!ke&&!Ie&&(ke=$e)}}return{start:new t(N,ke),end:new t(le,Ce)}}function Ue(f,h,v){var b=h;if(!e.findMatchingTag||!e.findEnclosingTag)return{start:b,end:b};var _=e.findMatchingTag(f,h)||e.findEnclosingTag(f,h);return!_||!_.open||!_.close?{start:b,end:b}:v?{start:_.open.from,end:_.close.to}:{start:_.open.to,end:_.close.from}}function Ke(f,h,v){wt(h,v)||G.jumpList.add(f,h,v)}function ut(f,h){G.lastCharacterSearch.increment=f,G.lastCharacterSearch.forward=h.forward,G.lastCharacterSearch.selectedCharacter=h.selectedCharacter}var Nt={"(":"bracket",")":"bracket","{":"bracket","}":"bracket","[":"section","]":"section","*":"comment","/":"comment",m:"method",M:"method","#":"preprocess"},it={bracket:{isComplete:function(f){if(f.nextCh===f.symb){if(f.depth++,f.depth>=1)return!0}else f.nextCh===f.reverseSymb&&f.depth--;return!1}},section:{init:function(f){f.curMoveThrough=!0,f.symb=(f.forward?"]":"[")===f.symb?"{":"}"},isComplete:function(f){return f.index===0&&f.nextCh===f.symb}},comment:{isComplete:function(f){var h=f.lastCh==="*"&&f.nextCh==="/";return f.lastCh=f.nextCh,h}},method:{init:function(f){f.symb=f.symb==="m"?"{":"}",f.reverseSymb=f.symb==="{"?"}":"{"},isComplete:function(f){return f.nextCh===f.symb}},preprocess:{init:function(f){f.index=0},isComplete:function(f){var v;if(f.nextCh==="#"){var h=(v=f.lineText.match(/^#(\w+)/))==null?void 0:v[1];if(h==="endif"){if(f.forward&&f.depth===0)return!0;f.depth++}else if(h==="if"){if(!f.forward&&f.depth===0)return!0;f.depth--}if(h==="else"&&f.depth===0)return!0}return!1}}};function jt(f,h,v,b){var _=et(f.getCursor()),k=v?1:-1,D=v?f.lineCount():-1,I=_.ch,L=_.line,F=f.getLine(L),N={lineText:F,nextCh:F.charAt(I),lastCh:null,index:I,symb:b,reverseSymb:(v?{")":"(","}":"{"}:{"(":")","{":"}"})[b],forward:v,depth:0,curMoveThrough:!1},le=Nt[b];if(!le)return _;var oe=it[le].init,X=it[le].isComplete;for(oe&&oe(N);L!==D&&h;){if(N.index+=k,N.nextCh=N.lineText.charAt(N.index),!N.nextCh){if(L+=k,N.lineText=f.getLine(L)||"",k>0)N.index=0;else{var J=N.lineText.length;N.index=J>0?J-1:0}N.nextCh=N.lineText.charAt(N.index)}X(N)&&(_.line=L,_.ch=N.index,h--)}return N.nextCh||N.curMoveThrough?new t(L,N.index):_}function st(f,h,v,b,_){var k=h.line,D=h.ch,I=f.getLine(k),L=v?1:-1,F=b?E:S;if(_&&I==""){if(k+=L,I=f.getLine(k),!V(f,k))return null;D=v?0:I.length}for(;;){if(_&&I=="")return{from:0,to:0,line:k};for(var N=L>0?I.length:-1,le=N,oe=N;D!=N;){for(var X=!1,J=0;J<F.length&&!X;++J)if(F[J](I.charAt(D))){for(le=D;D!=N&&F[J](I.charAt(D));)D+=L;if(oe=D,X=le!=oe,le==h.ch&&k==h.line&&oe==le+L)continue;return{from:Math.min(le,oe+1),to:Math.max(le,oe),line:k}}X||(D+=L)}if(k+=L,!V(f,k))return null;I=f.getLine(k),D=L>0?0:I.length}}function mt(f,h,v,b,_,k){var D=et(h),I=[];(b&&!_||!b&&_)&&v++;for(var L=!(b&&_),F=0;F<v;F++){var N=st(f,h,b,k,L);if(!N){var le=Dt(f,f.lastLine());I.push(b?{line:f.lastLine(),from:le,to:le}:{line:0,from:0,to:0});break}I.push(N),h=new t(N.line,b?N.to-1:N.from)}var oe=I.length!=v,X=I[0],J=I.pop();return b&&!_?(!oe&&(X.from!=D.ch||X.line!=D.line)&&(J=I.pop()),J&&new t(J.line,J.from)):b&&_?J&&new t(J.line,J.to-1):!b&&_?(!oe&&(X.to!=D.ch||X.line!=D.line)&&(J=I.pop()),J&&new t(J.line,J.to)):J&&new t(J.line,J.from)}function Sn(f,h,v,b,_){var k=new t(h.line+v.repeat-1,1/0),D=f.clipPos(k);return D.ch--,_||(b.lastHPos=1/0,b.lastHSPos=f.charCoords(D,"div").left),k}function hr(f,h,v,b,_){if(b){for(var k=_||f.getCursor(),D=k.ch,I,L=0;L<h;L++){var F=f.getLine(k.line);if(I=
|
|
113
|
-
`,"\\r":"\r","\\t":" "};function
|
|
114
|
-
`,"\\r":"\r","\\t":" ","\\&":"&"};function Pl(f){for(var h=new e.StringStream(f),v=[];!h.eol();){for(;h.peek()&&h.peek()!="\\";)v.push(h.next());var b=!1;for(var _ in
|
|
112
|
+
`);_.pop();for(var k=_.pop();_.length>0&&k&&W(k);k=_.pop())v.line--,v.ch=0;k?(v.line--,v.ch=Dt(f,v.line)):v.ch=0}}function re(f,h,v){h.ch=0,v.ch=0,v.line++}function we(f){if(!f)return 0;var h=f.search(/\S/);return h==-1?f.length:h}function De(f,{inclusive:h,innerWord:v,bigWord:b,noSymbol:_,multiline:k},D){var I=D||A(f),L=f.getLine(I.line),F=L,N=I.line,le=N,oe=I.ch,X,J=_?S[0]:E[0];if(v&&/\s/.test(L.charAt(oe)))J=function(ht){return/\s/.test(ht)};else{for(;!J(L.charAt(oe));)if(oe++,oe>=L.length){if(!k)return null;oe--,X=st(f,I,!0,b,!0);break}b?J=E[0]:(J=S[0],J(L.charAt(oe))||(J=S[1]))}for(var Ce=oe,ke=oe;J(L.charAt(ke))&&ke>=0;)ke--;if(ke++,X)Ce=X.to,le=X.line,F=f.getLine(le),!F&&Ce==0&&Ce++;else for(;J(L.charAt(Ce))&&Ce<L.length;)Ce++;if(h){var We=Ce,Ie=I.ch<=ke&&/\s/.test(L.charAt(I.ch));if(!Ie)for(;/\s/.test(F.charAt(Ce))&&Ce<F.length;)Ce++;if(We==Ce||Ie){for(var $e=ke;/\s/.test(L.charAt(ke-1))&&ke>0;)ke--;!ke&&!Ie&&(ke=$e)}}return{start:new t(N,ke),end:new t(le,Ce)}}function Ue(f,h,v){var b=h;if(!e.findMatchingTag||!e.findEnclosingTag)return{start:b,end:b};var _=e.findMatchingTag(f,h)||e.findEnclosingTag(f,h);return!_||!_.open||!_.close?{start:b,end:b}:v?{start:_.open.from,end:_.close.to}:{start:_.open.to,end:_.close.from}}function Ke(f,h,v){wt(h,v)||G.jumpList.add(f,h,v)}function ut(f,h){G.lastCharacterSearch.increment=f,G.lastCharacterSearch.forward=h.forward,G.lastCharacterSearch.selectedCharacter=h.selectedCharacter}var Nt={"(":"bracket",")":"bracket","{":"bracket","}":"bracket","[":"section","]":"section","*":"comment","/":"comment",m:"method",M:"method","#":"preprocess"},it={bracket:{isComplete:function(f){if(f.nextCh===f.symb){if(f.depth++,f.depth>=1)return!0}else f.nextCh===f.reverseSymb&&f.depth--;return!1}},section:{init:function(f){f.curMoveThrough=!0,f.symb=(f.forward?"]":"[")===f.symb?"{":"}"},isComplete:function(f){return f.index===0&&f.nextCh===f.symb}},comment:{isComplete:function(f){var h=f.lastCh==="*"&&f.nextCh==="/";return f.lastCh=f.nextCh,h}},method:{init:function(f){f.symb=f.symb==="m"?"{":"}",f.reverseSymb=f.symb==="{"?"}":"{"},isComplete:function(f){return f.nextCh===f.symb}},preprocess:{init:function(f){f.index=0},isComplete:function(f){var v;if(f.nextCh==="#"){var h=(v=f.lineText.match(/^#(\w+)/))==null?void 0:v[1];if(h==="endif"){if(f.forward&&f.depth===0)return!0;f.depth++}else if(h==="if"){if(!f.forward&&f.depth===0)return!0;f.depth--}if(h==="else"&&f.depth===0)return!0}return!1}}};function jt(f,h,v,b){var _=et(f.getCursor()),k=v?1:-1,D=v?f.lineCount():-1,I=_.ch,L=_.line,F=f.getLine(L),N={lineText:F,nextCh:F.charAt(I),lastCh:null,index:I,symb:b,reverseSymb:(v?{")":"(","}":"{"}:{"(":")","{":"}"})[b],forward:v,depth:0,curMoveThrough:!1},le=Nt[b];if(!le)return _;var oe=it[le].init,X=it[le].isComplete;for(oe&&oe(N);L!==D&&h;){if(N.index+=k,N.nextCh=N.lineText.charAt(N.index),!N.nextCh){if(L+=k,N.lineText=f.getLine(L)||"",k>0)N.index=0;else{var J=N.lineText.length;N.index=J>0?J-1:0}N.nextCh=N.lineText.charAt(N.index)}X(N)&&(_.line=L,_.ch=N.index,h--)}return N.nextCh||N.curMoveThrough?new t(L,N.index):_}function st(f,h,v,b,_){var k=h.line,D=h.ch,I=f.getLine(k),L=v?1:-1,F=b?E:S;if(_&&I==""){if(k+=L,I=f.getLine(k),!V(f,k))return null;D=v?0:I.length}for(;;){if(_&&I=="")return{from:0,to:0,line:k};for(var N=L>0?I.length:-1,le=N,oe=N;D!=N;){for(var X=!1,J=0;J<F.length&&!X;++J)if(F[J](I.charAt(D))){for(le=D;D!=N&&F[J](I.charAt(D));)D+=L;if(oe=D,X=le!=oe,le==h.ch&&k==h.line&&oe==le+L)continue;return{from:Math.min(le,oe+1),to:Math.max(le,oe),line:k}}X||(D+=L)}if(k+=L,!V(f,k))return null;I=f.getLine(k),D=L>0?0:I.length}}function mt(f,h,v,b,_,k){var D=et(h),I=[];(b&&!_||!b&&_)&&v++;for(var L=!(b&&_),F=0;F<v;F++){var N=st(f,h,b,k,L);if(!N){var le=Dt(f,f.lastLine());I.push(b?{line:f.lastLine(),from:le,to:le}:{line:0,from:0,to:0});break}I.push(N),h=new t(N.line,b?N.to-1:N.from)}var oe=I.length!=v,X=I[0],J=I.pop();return b&&!_?(!oe&&(X.from!=D.ch||X.line!=D.line)&&(J=I.pop()),J&&new t(J.line,J.from)):b&&_?J&&new t(J.line,J.to-1):!b&&_?(!oe&&(X.to!=D.ch||X.line!=D.line)&&(J=I.pop()),J&&new t(J.line,J.to)):J&&new t(J.line,J.from)}function Sn(f,h,v,b,_){var k=new t(h.line+v.repeat-1,1/0),D=f.clipPos(k);return D.ch--,_||(b.lastHPos=1/0,b.lastHSPos=f.charCoords(D,"div").left),k}function hr(f,h,v,b,_){if(b){for(var k=_||f.getCursor(),D=k.ch,I,L=0;L<h;L++){var F=f.getLine(k.line);if(I=ka(D,F,b,v),I==-1)return;D=I}if(I!=null)return new t(f.getCursor().line,I)}}function yi(f,h){var v=f.getCursor().line;return Vt(f,new t(v,h-1))}function Un(f,h,v,b){!xe(v,T)&&!j.test(v)||(h.marks[v]&&h.marks[v].clear(),h.marks[v]=f.setBookmark(b))}function ka(f,h,v,b,_){return b?h.indexOf(v,f+1):h.lastIndexOf(v,f-1)}function an(f,h,v,b,_){var k=h.line,D=f.firstLine(),I=f.lastLine(),L,F,N=k;function le(ke){return!f.getLine(ke)}function oe(ke,We,Ie){return Ie?le(ke)!=le(ke+We):!le(ke)&&le(ke+We)}if(b){for(;D<=N&&N<=I&&v>0;)oe(N,b)&&v--,N+=b;return{start:new t(N,0),end:h}}var X=f.state.vim;if(X.visualLine&&oe(k,1,!0)){var J=X.sel.anchor;oe(J.line,-1,!0)&&(!_||J.line!=k)&&(k+=1)}var Ce=le(k);for(N=k;N<=I&&v;N++)oe(N,1,!0)&&(!_||le(N)!=Ce)&&v--;for(F=new t(N,0),N>I&&!Ce?Ce=!0:_=!1,N=k;N>D&&!((!_||le(N)==Ce||N==k)&&oe(N,-1,!0));N--);return L=new t(N,0),{start:L,end:F}}function Ll(f,h,v,b,_){function k(F){F.line!==null&&(F.pos+F.dir<0||F.pos+F.dir>=F.line.length?F.line=null:F.pos+=F.dir)}function D(F,N,le,oe){var X={line:F.getLine(N),ln:N,pos:le,dir:oe};if(X.line==="")return{ln:X.ln,pos:X.pos};var J=X.pos;for(k(X);X.line!==null;){if(J=X.pos,ae(X.line[X.pos]))if(_){for(k(X);X.line!==null&&W(X.line[X.pos]);)J=X.pos,k(X);return{ln:X.ln,pos:J+1}}else return{ln:X.ln,pos:X.pos+1};k(X)}return{ln:X.ln,pos:J+1}}function I(F,N,le,oe){var X=F.getLine(N),J={line:X,ln:N,pos:le,dir:oe};if(J.line==="")return{ln:J.ln,pos:J.pos};var Ce=J.pos;for(k(J);J.line!==null;){if(!W(J.line[J.pos])&&!ae(J.line[J.pos]))Ce=J.pos;else if(ae(J.line[J.pos]))return _&&W(J.line[J.pos+1])?{ln:J.ln,pos:J.pos+1}:{ln:J.ln,pos:Ce};k(J)}return J.line=X,_&&W(J.line[J.pos])?{ln:J.ln,pos:J.pos}:{ln:J.ln,pos:Ce}}for(var L={ln:h.line,pos:h.ch};v>0;)L=b<0?I(f,L.ln,L.pos,b):D(f,L.ln,L.pos,b),v--;return new t(L.ln,L.pos)}function Ou(f,h,v,b){function _(L,F){if(F.line!==null)if(F.pos+F.dir<0||F.pos+F.dir>=F.line.length){if(F.ln+=F.dir,!V(L,F.ln)){F.line=null;return}F.line=L.getLine(F.ln),F.pos=F.dir>0?0:F.line.length-1}else F.pos+=F.dir}function k(L,F,N,le){var ke=L.getLine(F),oe=ke==="",X={line:ke,ln:F,pos:N,dir:le},J={ln:X.ln,pos:X.pos},Ce=X.line==="";for(_(L,X);X.line!==null;){if(J.ln=X.ln,J.pos=X.pos,X.line===""&&!Ce||oe&&X.line!==""&&!W(X.line[X.pos]))return{ln:X.ln,pos:X.pos};ae(X.line[X.pos])&&!oe&&(X.pos===X.line.length-1||W(X.line[X.pos+1]))&&(oe=!0),_(L,X)}var ke=L.getLine(J.ln);J.pos=0;for(var We=ke.length-1;We>=0;--We)if(!W(ke[We])){J.pos=We;break}return J}function D(L,F,N,le){var ke=L.getLine(F),oe={line:ke,ln:F,pos:N,dir:le},X=oe.ln,J=null,Ce=oe.line==="";for(_(L,oe);oe.line!==null;){if(oe.line===""&&!Ce)return J===null?{ln:oe.ln,pos:oe.pos}:{ln:X,pos:J};if(ae(oe.line[oe.pos])&&J!==null&&!(oe.ln===X&&oe.pos+1===J))return{ln:X,pos:J};oe.line!==""&&!W(oe.line[oe.pos])&&(Ce=!1,X=oe.ln,J=oe.pos),_(L,oe)}var ke=L.getLine(X);J=0;for(var We=0;We<ke.length;++We)if(!W(ke[We])){J=We;break}return{ln:X,pos:J}}for(var I={ln:h.line,pos:h.ch};v>0;)I=b<0?D(f,I.ln,I.pos,b):k(f,I.ln,I.pos,b),v--;return new t(I.ln,I.pos)}function vi(f,h,v,b){var _=h,k={"(":/[()]/,")":/[()]/,"[":/[[\]]/,"]":/[[\]]/,"{":/[{}]/,"}":/[{}]/,"<":/[<>]/,">":/[<>]/}[v],D={"(":"(",")":"(","[":"[","]":"[","{":"{","}":"{","<":"<",">":"<"}[v],I=f.getLine(_.line).charAt(_.ch)===D?1:0,L=f.scanForBracket(new t(_.line,_.ch+I),-1,void 0,{bracketRegex:k}),F=f.scanForBracket(new t(_.line,_.ch+I),1,void 0,{bracketRegex:k});if(!L||!F)return null;var N=L.pos,le=F.pos;if(N.line==le.line&&N.ch>le.ch||N.line>le.line){var oe=N;N=le,le=oe}return b?le.ch+=1:N.ch+=1,{start:N,end:le}}function Ca(f,h,v,b){var _=et(h),k=f.getLine(_.line).split(""),D,I,L,F,N=k.indexOf(v);if(_.ch<N)_.ch=N;else if(N<_.ch&&k[_.ch]==v){var le=/string/.test(f.getTokenTypeAt(St(h,0,1))),oe=/string/.test(f.getTokenTypeAt(h));le&&!oe||(I=_.ch,--_.ch)}if(k[_.ch]==v&&!I)D=_.ch+1;else for(L=_.ch;L>-1&&!D;L--)k[L]==v&&(D=L+1);if(D&&!I)for(L=D,F=k.length;L<F&&!I;L++)k[L]==v&&(I=L);return!D||!I?{start:_,end:_}:(b&&(--D,++I),{start:new t(_.line,D),end:new t(_.line,I)})}Te("pcre",!0,"boolean");class Dm{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 tr(f){var h=f.state.vim;return h.searchState_||(h.searchState_=new Dm)}function Mu(f){return po(f,"/")}function Rm(f){return mo(f,"/")}function po(f,h){var v=mo(f,h)||[];if(!v.length)return[];var b=[];if(v[0]===0){for(var _=0;_<v.length;_++)typeof v[_]=="number"&&b.push(f.substring(v[_]+1,v[_+1]));return b}}function mo(f,h){h||(h="/");for(var v=!1,b=[],_=0;_<f.length;_++){var k=f.charAt(_);!v&&k==h&&b.push(_),v=!v&&k=="\\"}return b}function ti(f){var h={V:"|(){+?*.[$^",M:"|(){+?*.[",m:"|(){+?",v:"<>"},v={">":"(?<=[\\w])(?=[^\\w]|$)","<":"(?<=[^\\w]|^)(?=[\\w])"},b=h.m,_=f.replace(/\\.|[\[|(){+*?.$^<>]/g,function(D){if(D[0]==="\\"){var I=D[1];return I==="}"||b.indexOf(I)!=-1?I:I in h?(b=h[I],""):I in v?v[I]:D}else return b.indexOf(D)==-1?D:v[D]||"\\"+D}),k=_.indexOf("\\zs");return k!=-1&&(_="(?<="+_.slice(0,k)+")"+_.slice(k+3)),k=_.indexOf("\\ze"),k!=-1&&(_=_.slice(0,k)+"(?="+_.slice(k+3)+")"),_}var Kn={"\\n":`
|
|
113
|
+
`,"\\r":"\r","\\t":" "};function Nu(f){for(var h=!1,v=[],b=-1;b<f.length;b++){var _=f.charAt(b)||"",k=f.charAt(b+1)||"";Kn[_+k]?(v.push(Kn[_+k]),b++):h?(v.push(_),h=!1):_==="\\"?(h=!0,me(k)||k==="$"?v.push("$"):k!=="/"&&k!=="\\"&&v.push("\\")):(_==="$"&&v.push("$"),v.push(_),k==="/"&&v.push("\\"))}return v.join("")}var ju={"\\/":"/","\\\\":"\\","\\n":`
|
|
114
|
+
`,"\\r":"\r","\\t":" ","\\&":"&"};function Pl(f){for(var h=new e.StringStream(f),v=[];!h.eol();){for(;h.peek()&&h.peek()!="\\";)v.push(h.next());var b=!1;for(var _ in ju)if(h.match(_,!0)){b=!0,v.push(ju[_]);break}b||v.push(h.next())}return v.join("")}function Ol(f,h,v){G.registerController.getRegister("/").setText(f);var b=Rm(f),_,k;return b.length?(_=f.substring(0,b[0]),k=f.substring(b[0]).indexOf("i")!=-1):_=f,_?(Q("pcre")||(_=ti(_)),v&&(h=/^[^A-Z]*$/.test(_)),new RegExp(_,h||k?"im":"m")):null}function Fn(f){typeof f=="string"&&(f=document.createElement(f));for(var h=1;h<arguments.length;h++){var v=arguments[h];if(v)if(typeof v!="object"&&(v=document.createTextNode(v)),v.nodeType)f.appendChild(v);else for(var b in v)Object.prototype.hasOwnProperty.call(v,b)&&(b[0]==="$"?f.style[b.slice(1)]=v[b]:typeof v[b]=="function"?f[b]=v[b]:f.setAttribute(b,v[b]))}return f}function pt(f,h,v){var b=Fn("div",{$color:"red",$whiteSpace:"pre",class:"cm-vim-message"},h);f.openNotification?v?(b=Fn("div",{},b,Fn("div",{},"Press ENTER or type command to continue")),f.state.closeVimNotification&&f.state.closeVimNotification(),f.state.closeVimNotification=f.openNotification(b,{bottom:!0,duration:0})):f.openNotification(b,{bottom:!0,duration:15e3}):alert(b.innerText)}function gr(f,h){return Fn("div",{$display:"flex",$flex:1},Fn("span",{$fontFamily:"monospace",$whiteSpace:"pre",$flex:1,$display:"flex"},f,Fn("input",{type:"text",autocorrect:"off",autocapitalize:"off",spellcheck:"false",$flex:1})),h&&Fn("span",{$color:"#888"},h))}function Sa(f,h){var _;if(Fe.length){h.value||(h.value=""),Be=h;return}var v=gr(h.prefix,h.desc);if(f.openDialog)f.openDialog(v,h.onClose,{onKeyDown:h.onKeyDown,onKeyUp:h.onKeyUp,bottom:!0,selectValueOnOpen:!1,value:h.value});else{var b="";typeof h.prefix!="string"&&h.prefix&&(b+=h.prefix.textContent),h.desc&&(b+=" "+h.desc),(_=h.onClose)==null||_.call(h,prompt(b,""))}}function qu(f,h){return f instanceof RegExp&&h instanceof RegExp?f.flags==h.flags&&f.source==h.source:!1}function Mi(f,h,v,b){if(h){var _=tr(f),k=Ol(h,!!v,!!b);if(k)return hs(f,k),qu(k,_.getQuery())||_.setQuery(k),k}}function Ea(f){if(f.source.charAt(0)=="^")var h=!0;return{token:function(v){if(h&&!v.sol()){v.skipToEnd();return}var b=v.match(f,!1);if(b)return b[0].length==0?(v.next(),"searching"):!v.sol()&&(v.backUp(1),!f.exec(v.next()+b[0]))?(v.next(),null):(v.match(f),"searching");for(;!v.eol()&&(v.next(),!v.match(f,!1)););},query:f}}var Ta=0;function hs(f,h){clearTimeout(Ta);var v=tr(f);v.highlightTimeout=Ta,Ta=setTimeout(function(){if(f.state.vim){var b=tr(f);b.highlightTimeout=void 0;var _=b.getOverlay();(!_||h!=_.query)&&(_&&f.removeOverlay(_),_=Ea(h),f.addOverlay(_),f.showMatchesOnScrollbar&&(b.getScrollbarAnnotate()&&b.getScrollbarAnnotate().clear(),b.setScrollbarAnnotate(f.showMatchesOnScrollbar(h))),b.setOverlay(_))}},50)}function Ni(f,h,v,b){return f.operation(function(){b===void 0&&(b=1);for(var _=f.getCursor(),k=f.getSearchCursor(v,_),D=0;D<b;D++){var I=k.find(h);if(D==0&&I&&wt(k.from(),_)){var L=h?k.from():k.to();I=k.find(h),I&&!I[0]&&wt(k.from(),L)&&f.getLine(L.line).length==L.ch&&(I=k.find(h))}if(!I&&(k=f.getSearchCursor(v,h?new t(f.lastLine()):new t(f.firstLine(),0)),!k.find(h)))return}return k.from()})}function Im(f,h,v,b,_){return f.operation(function(){b===void 0&&(b=1);var k=f.getCursor(),D=f.getSearchCursor(v,k),I=D.find(!h);!_.visualMode&&I&&wt(D.from(),k)&&D.find(!h);for(var L=0;L<b;L++)if(I=D.find(h),!I&&(D=f.getSearchCursor(v,h?new t(f.lastLine()):new t(f.firstLine(),0)),!D.find(h)))return;var F=D.from(),N=D.to();return F&&N&&[F,N]})}function ji(f){var h=tr(f);h.highlightTimeout&&(h.highlightTimeout=(clearTimeout(h.highlightTimeout),void 0)),f.removeOverlay(tr(f).getOverlay()),h.setOverlay(null),h.getScrollbarAnnotate()&&(h.getScrollbarAnnotate().clear(),h.setScrollbarAnnotate(null))}function zu(f,h,v){return typeof f!="number"&&(f=f.line),h instanceof Array?xe(f,h):typeof v=="number"?f>=h&&f<=v:f==h}function ho(f){var h=f.getScrollInfo(),v=6,b=10,_=f.coordsChar({left:0,top:v+h.top},"local"),k=h.clientHeight-b+h.top,D=f.coordsChar({left:0,top:k},"local");return{top:_.line,bottom:D.line}}function gs(f,h,v){if(v=="'"||v=="`")return G.jumpList.find(f,-1)||new t(0,0);if(v==".")return Fu(f);var b=h.marks[v];return b&&b.find()}function Fu(f){if(f.getLastEditEnd)return f.getLastEditEnd();for(var h=f.doc.history.done,v=h.length;v--;)if(h[v].changes)return et(h[v].changes[0].to)}class ys{constructor(){this.commandMap_,this.buildCommandMap_()}processCommand(h,v,b){var _=this;h.operation(function(){h.curOp&&(h.curOp.isVimOp=!0),_._processCommand(h,v,b)})}_processCommand(h,v,b){var _=h.state.vim,k=G.registerController.getRegister(":"),D=k.toString(),I=new e.StringStream(v);k.setText(v);var L=b||{};L.input=v;try{this.parseInput_(h,I,L)}catch(le){throw pt(h,le+""),le}_.visualMode&&rt(h);var F,N;if(!L.commandName)L.line!==void 0&&(N="move");else if(F=this.matchCommand_(L.commandName),F){if(N=F.name,F.excludeFromCommandHistory&&k.setText(D),this.parseCommandArgs_(I,L,F),F.type=="exToKey"){bt(h,F.toKeys||"",F);return}else if(F.type=="exToEx"){this.processCommand(h,F.toInput||"");return}}if(!N){pt(h,'Not an editor command ":'+v+'"');return}try{Nr[N](h,L),(!F||!F.possiblyAsync)&&L.callback&&L.callback()}catch(le){throw pt(h,le+""),le}}parseInput_(h,v,b){var k,D;v.eatWhile(":"),v.eat("%")?(b.line=h.firstLine(),b.lineEnd=h.lastLine()):(b.line=this.parseLineSpec_(h,v),b.line!==void 0&&v.eat(",")&&(b.lineEnd=this.parseLineSpec_(h,v))),b.line==null?h.state.vim.visualMode?(b.selectionLine=(k=gs(h,h.state.vim,"<"))==null?void 0:k.line,b.selectionLineEnd=(D=gs(h,h.state.vim,">"))==null?void 0:D.line):b.selectionLine=h.getCursor().line:(b.selectionLine=b.line,b.selectionLineEnd=b.lineEnd);var _=v.match(/^(\w+|!!|@@|[!#&*<=>@~])/);return _?b.commandName=_[1]:b.commandName=(v.match(/.*/)||[""])[0],b}parseLineSpec_(h,v){var b=v.match(/^(\d+)/);if(b)return parseInt(b[1],10)-1;switch(v.next()){case".":return this.parseLineSpecOffset_(v,h.getCursor().line);case"$":return this.parseLineSpecOffset_(v,h.lastLine());case"'":var _=v.next()||"",k=gs(h,h.state.vim,_);if(!k)throw Error("Mark not set");return this.parseLineSpecOffset_(v,k.line);case"-":case"+":return v.backUp(1),this.parseLineSpecOffset_(v,h.getCursor().line);default:v.backUp(1);return}}parseLineSpecOffset_(h,v){var b=h.match(/^([+-])?(\d+)/);if(b){var _=parseInt(b[2],10);b[1]=="-"?v-=_:v+=_}return v}parseCommandArgs_(h,v,b){var D;if(!h.eol()){v.argString=(D=h.match(/.*/))==null?void 0:D[0];var _=b.argDelimiter||/\s+/,k=fr(v.argString||"").split(_);k.length&&k[0]&&(v.args=k)}}matchCommand_(h){for(var v=h.length;v>0;v--){var b=h.substring(0,v);if(this.commandMap_[b]){var _=this.commandMap_[b];if(_.name.indexOf(h)===0)return _}}}buildCommandMap_(){this.commandMap_={};for(var h=0;h<u.length;h++){var v=u[h],b=v.shortName||v.name;this.commandMap_[b]=v}}map(h,v,b,_){if(h!=":"&&h.charAt(0)==":"){if(b)throw Error("Mode not supported for ex mappings");var k=h.substring(1);v!=":"&&v.charAt(0)==":"?this.commandMap_[k]={name:k,type:"exToEx",toInput:v.substring(1),user:!0}:this.commandMap_[k]={name:k,type:"exToKey",toKeys:v,user:!0}}else{var D={keys:h,type:"keyToKey",toKeys:v,noremap:!!_};b&&(D.context=b),bi(D)}}unmap(h,v){if(h!=":"&&h.charAt(0)==":"){if(v)throw Error("Mode not supported for ex mappings");var b=h.substring(1);if(this.commandMap_[b]&&this.commandMap_[b].user)return delete this.commandMap_[b],!0}else for(var _=h,k=0;k<i.length;k++)if(_==i[k].keys&&i[k].context===v)return i.splice(k,1),Nl(_),!0}}var Nr={colorscheme:function(f,h){if(!h.args||h.args.length<1){pt(f,f.getOption("theme"));return}f.setOption("theme",h.args[0])},map:function(f,h,v,b){var _=h.args;if(!_||_.length<2){f&&pt(f,"Invalid mapping: "+h.input);return}En.map(_[0],_[1],v,b)},imap:function(f,h){this.map(f,h,"insert")},nmap:function(f,h){this.map(f,h,"normal")},vmap:function(f,h){this.map(f,h,"visual")},omap:function(f,h){this.map(f,h,"operatorPending")},noremap:function(f,h){this.map(f,h,void 0,!0)},inoremap:function(f,h){this.map(f,h,"insert",!0)},nnoremap:function(f,h){this.map(f,h,"normal",!0)},vnoremap:function(f,h){this.map(f,h,"visual",!0)},onoremap:function(f,h){this.map(f,h,"operatorPending",!0)},unmap:function(f,h,v){var b=h.args;(!b||b.length<1||!En.unmap(b[0],v))&&f&&pt(f,"No such mapping: "+h.input)},mapclear:function(f,h){He.mapclear()},imapclear:function(f,h){He.mapclear("insert")},nmapclear:function(f,h){He.mapclear("normal")},vmapclear:function(f,h){He.mapclear("visual")},omapclear:function(f,h){He.mapclear("operatorPending")},move:function(f,h){jn.processCommand(f,f.state.vim,{keys:"",type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!1,explicitRepeat:!0,linewise:!0},repeatOverride:h.line+1})},set:function(f,h){var v=h.args,b=h.setCfg||{};if(!v||v.length<1){f&&pt(f,"Invalid mapping: "+h.input);return}var _=v[0].split("="),k=_.shift()||"",D=_.length>0?_.join("="):void 0,I=!1,L=!1;if(k.charAt(k.length-1)=="?"){if(D)throw Error("Trailing characters: "+h.argString);k=k.substring(0,k.length-1),I=!0}else k.charAt(k.length-1)=="!"&&(k=k.substring(0,k.length-1),L=!0);D===void 0&&k.substring(0,2)=="no"&&(k=k.substring(2),D=!1);var F=_e[k]&&_e[k].type=="boolean";if(F&&(L?D=!Q(k,f,b):D??(D=!0)),!F&&D===void 0||I){var N=Q(k,f,b);N instanceof Error?pt(f,N.message):N===!0||N===!1?pt(f," "+(N?"":"no")+k):pt(f," "+k+"="+N)}else{var le=Z(k,D,f,b);le instanceof Error&&pt(f,le.message)}},setlocal:function(f,h){h.setCfg={scope:"local"},this.set(f,h)},setglobal:function(f,h){h.setCfg={scope:"global"},this.set(f,h)},registers:function(f,h){var v=h.args,b=G.registerController.registers,_=`----------Registers----------
|
|
115
115
|
|
|
116
116
|
`;if(v)for(var k=v.join(""),D=0;D<k.length;D++){var I=k.charAt(D);if(G.registerController.isValidRegister(I)){var L=b[I]||new un;_+='"'+I+" "+L.toString()+`
|
|
117
117
|
`}}else for(var I in b){var F=b[I].toString();F.length&&(_+='"'+I+" "+F+`
|
|
@@ -122,52 +122,52 @@ mark line col
|
|
|
122
122
|
`)}else for(var I in b){var L=b[I]&&b[I].find();L&&(_+=I+" "+L.line+" "+L.ch+`
|
|
123
123
|
`)}pt(f,_,!0)},sort:function(f,h){var v,b,_,k,D;function I(){if(h.argString){var Je=new e.StringStream(h.argString);if(Je.eat("!")&&(v=!0),Je.eol())return;if(!Je.eatSpace())return"Invalid arguments";var Ge=Je.match(/([dinuox]+)?\s*(\/.+\/)?\s*/);if(!Ge||!Je.eol())return"Invalid arguments";if(Ge[1]){b=Ge[1].indexOf("i")!=-1,_=Ge[1].indexOf("u")!=-1;var Qt=Ge[1].indexOf("d")!=-1||Ge[1].indexOf("n")!=-1,dn=Ge[1].indexOf("x")!=-1,bn=Ge[1].indexOf("o")!=-1;if(Number(Qt)+Number(dn)+Number(bn)>1)return"Invalid arguments";k=Qt&&"decimal"||dn&&"hex"||bn&&"octal"}Ge[2]&&(D=new RegExp(Ge[2].substr(1,Ge[2].length-2),b?"i":""))}}var L=I();if(L){pt(f,L+": "+h.argString);return}var F=h.line||f.firstLine(),N=h.lineEnd||h.line||f.lastLine();if(F==N)return;var le=new t(F,0),oe=new t(N,Dt(f,N)),X=f.getRange(le,oe).split(`
|
|
124
124
|
`),J=k=="decimal"?/(-?)([\d]+)/:k=="hex"?/(-?)(?:0x)?([0-9a-f]+)/i:k=="octal"?/([0-7]+)/:null,Ce=k=="decimal"?10:k=="hex"?16:k=="octal"?8:void 0,ke=[],We=[];if(k||D)for(var Ie=0;Ie<X.length;Ie++){var $e=D?X[Ie].match(D):null;$e&&$e[0]!=""?ke.push($e):J&&J.exec(X[Ie])?ke.push(X[Ie]):We.push(X[Ie])}else We=X;function ht(Je,Ge){if(v){var Qt=Je;Je=Ge,Ge=Qt}b&&(Je=Je.toLowerCase(),Ge=Ge.toLowerCase());var dn=J&&J.exec(Je),bn=J&&J.exec(Ge);return!dn||!bn?Je<Ge?-1:1:parseInt((dn[1]+dn[2]).toLowerCase(),Ce)-parseInt((bn[1]+bn[2]).toLowerCase(),Ce)}function tt(Je,Ge){if(v){var Qt=Je;Je=Ge,Ge=Qt}return b&&(Je[0]=Je[0].toLowerCase(),Ge[0]=Ge[0].toLowerCase()),Je[0]<Ge[0]?-1:1}if(ke.sort(D?tt:ht),D)for(var Ie=0;Ie<ke.length;Ie++)ke[Ie]=ke[Ie].input;else k||We.sort(ht);if(X=v?ke.concat(We):We.concat(ke),_){var qt=X,Ht;X=[];for(var Ie=0;Ie<qt.length;Ie++)qt[Ie]!=Ht&&X.push(qt[Ie]),Ht=qt[Ie]}f.replaceRange(X.join(`
|
|
125
|
-
`),le,oe)},vglobal:function(f,h){this.global(f,h)},normal:function(f,h){var v=!1,b=h.argString;if(b&&b[0]=="!"&&(b=b.slice(1),v=!0),b=b.trimStart(),!b){pt(f,"Argument is required.");return}var _=h.line;if(typeof _=="number")for(var k=isNaN(h.lineEnd)?_:h.lineEnd,D=_;D<=k;D++)f.setCursor(D,0),bt(f,h.argString.trimStart(),{noremap:v}),f.state.vim.insertMode&&Qn(f,!0);else bt(f,h.argString.trimStart(),{noremap:v}),f.state.vim.insertMode&&Qn(f,!0)},global:function(f,h){var v=h.argString;if(!v){pt(f,"Regular Expression missing from global");return}var b=h.commandName[0]==="v";v[0]==="!"&&h.commandName[0]==="g"&&(b=!0,v=v.slice(1));var _=h.line===void 0?f.firstLine():h.line,k=h.lineEnd||h.line||f.lastLine(),D=
|
|
126
|
-
`));return}var X=0,J=function(){if(X<N.length){var Ce=N[X++],ke=f.getLineNumber(Ce);if(ke==null){J();return}var We=ke+1+L;En.processCommand(f,We,{callback:J})}else f.releaseLineHandles&&f.releaseLineHandles()};J()},substitute:function(f,h){if(!f.getSearchCursor)throw Error("Search feature not available. Requires searchcursor.js or any other getSearchCursor implementation.");var v=h.argString,b=v?
|
|
127
|
-
`);if(b.maybeReset&&(b.maybeReset=(b.changes=[],!1)),D)if(f.state.overwrite&&!/\n/.test(D))b.changes.push([D]);else{if(D.length>1){var I=_&&_.insertEnd&&_.insertEnd.find(),L=f.getCursor();if(I&&I.line==L.line){var F=I.ch-L.ch;F>0&&F<D.length&&(b.changes.push([D,F]),D="")}}D&&b.changes.push(D)}}h=h.next}}function vs(f){var _;var h=f.state.vim;if(h.insertMode){var v=G.macroModeState;if(v.isPlaying)return;var b=v.lastInsertModeChanges;b.expectCursorActivityForChange?b.expectCursorActivityForChange=!1:(b.maybeReset=!0,h.insertEnd&&h.insertEnd.clear(),h.insertEnd=f.setBookmark(f.getCursor(),{insertLeft:!0}))}else(_=f.curOp)!=null&&_.isVimOp||
|
|
125
|
+
`),le,oe)},vglobal:function(f,h){this.global(f,h)},normal:function(f,h){var v=!1,b=h.argString;if(b&&b[0]=="!"&&(b=b.slice(1),v=!0),b=b.trimStart(),!b){pt(f,"Argument is required.");return}var _=h.line;if(typeof _=="number")for(var k=isNaN(h.lineEnd)?_:h.lineEnd,D=_;D<=k;D++)f.setCursor(D,0),bt(f,h.argString.trimStart(),{noremap:v}),f.state.vim.insertMode&&Qn(f,!0);else bt(f,h.argString.trimStart(),{noremap:v}),f.state.vim.insertMode&&Qn(f,!0)},global:function(f,h){var v=h.argString;if(!v){pt(f,"Regular Expression missing from global");return}var b=h.commandName[0]==="v";v[0]==="!"&&h.commandName[0]==="g"&&(b=!0,v=v.slice(1));var _=h.line===void 0?f.firstLine():h.line,k=h.lineEnd||h.line||f.lastLine(),D=Mu(v),I=v,L="";if(D&&D.length&&(I=D[0],L=D.slice(1,D.length).join("/")),I)try{Mi(f,I,!0,!0)}catch{pt(f,"Invalid regex: "+I);return}for(var F=tr(f).getQuery(),N=[],le=_;le<=k;le++){var oe=f.getLine(le);F.test(oe)!==b&&N.push(L?f.getLineHandle(le):oe)}if(!L){pt(f,N.join(`
|
|
126
|
+
`));return}var X=0,J=function(){if(X<N.length){var Ce=N[X++],ke=f.getLineNumber(Ce);if(ke==null){J();return}var We=ke+1+L;En.processCommand(f,We,{callback:J})}else f.releaseLineHandles&&f.releaseLineHandles()};J()},substitute:function(f,h){if(!f.getSearchCursor)throw Error("Search feature not available. Requires searchcursor.js or any other getSearchCursor implementation.");var v=h.argString,b=v?po(v,v[0]):[],_="",k="",D,I,L,F=!1,N=!1;if(b&&b.length)_=b[0],Q("pcre")&&_!==""&&(_=new RegExp(_).source),k=b[1],k!==void 0&&(k=Q("pcre")?Pl(k.replace(/([^\\])&/g,"$1$$&")):Nu(k),G.lastSubstituteReplacePart=k),D=b[2]?b[2].split(" "):[];else if(v&&v.length){pt(f,"Substitutions should be of the form :s/pattern/replace/");return}if(D&&(I=D[0],L=parseInt(D[1]),I&&(I.indexOf("c")!=-1&&(F=!0),I.indexOf("g")!=-1&&(N=!0),_=Q("pcre")?_+"/"+I:_.replace(/\//g,"\\/")+"/"+I)),_)try{Mi(f,_,!0,!0)}catch{pt(f,"Invalid regex: "+_);return}if(k||(k=G.lastSubstituteReplacePart),k===void 0){pt(f,"No previous substitute regular expression");return}var le=tr(f).getQuery(),oe=h.line===void 0?f.getCursor().line:h.line,X=h.lineEnd||oe;oe==f.firstLine()&&X==f.lastLine()&&(X=1/0),L&&(oe=X,X=oe+L-1);var J=Vt(f,new t(oe,0)),Ce=f.getSearchCursor(le,J);Ml(f,F,N,oe,X,Ce,le,k,h.callback)},startinsert:function(f,h){bt(f,h.argString=="!"?"A":"i",{})},redo:e.commands.redo,undo:e.commands.undo,write:function(f){e.commands.save?e.commands.save(f):f.save&&f.save()},nohlsearch:function(f){ji(f)},yank:function(f){var h=et(f.getCursor()).line,v=f.getLine(h);G.registerController.pushText("0","yank",v,!0,!0)},delete:function(f,h){var v=h.selectionLine,b=isNaN(h.selectionLineEnd)?v:h.selectionLineEnd;Yt.delete(f,{linewise:!0},[{anchor:new t(v,0),head:new t(b+1,0)}])},join:function(f,h){var v=h.selectionLine,b=isNaN(h.selectionLineEnd)?v:h.selectionLineEnd;f.setCursor(new t(v,0)),vn.joinLines(f,{repeat:b-v},f.state.vim)},delmarks:function(f,h){if(!h.argString||!fr(h.argString)){pt(f,"Argument required");return}for(var v=f.state.vim,b=new e.StringStream(fr(h.argString));!b.eol();){b.eatSpace();var _=b.pos;if(!b.match(/[a-zA-Z]/,!1)){pt(f,"Invalid argument: "+h.argString.substring(_));return}var k=b.next();if(b.match("-",!0)){if(!b.match(/[a-zA-Z]/,!1)){pt(f,"Invalid argument: "+h.argString.substring(_));return}var D=k,I=b.next();if(D&&I&&P(D)==P(I)){var L=D.charCodeAt(0),F=I.charCodeAt(0);if(L>=F){pt(f,"Invalid argument: "+h.argString.substring(_));return}for(var N=0;N<=F-L;N++){var le=String.fromCharCode(L+N);delete v.marks[le]}}else{pt(f,"Invalid argument: "+D+"-");return}}else k&&delete v.marks[k]}}},En=new ys;He.defineEx("version","ve",f=>{pt(f,"Codemirror-vim version: 6.3.0")});function Ml(f,h,v,b,_,k,D,I,L){f.state.vim.exMode=!0;var F=!1,N=0,le,oe,X;function J(){f.operation(function(){for(;!F;)Ce(),We();Ie()})}function Ce(){var ht="",tt=k.match||k.pos&&k.pos.match;ht=tt?I.replace(/\$(\d{1,3}|[$&])/g,function(Ht,Je){if(Je=="$")return"$";if(Je=="&")return tt[0];for(var Ge=Je;parseInt(Ge)>=tt.length&&Ge.length>0;)Ge=Ge.slice(0,Ge.length-1);return Ge?tt[Ge]+Je.slice(Ge.length,Je.length):Ht}):f.getRange(k.from(),k.to()).replace(D,I);var qt=k.to().line;k.replace(ht),oe=k.to().line,_+=oe-qt,X=oe<qt}function ke(){var ht=le&&et(k.to()),tt=k.findNext();return tt&&!tt[0]&&ht&&wt(k.from(),ht)&&(tt=k.findNext()),tt&&N++,tt}function We(){for(;ke()&&zu(k.from(),b,_);)if(!(!v&&k.from().line==oe&&!X)){f.scrollIntoView(k.from(),30),f.setSelection(k.from(),k.to()),le=k.from(),F=!1;return}F=!0}function Ie(ht){if(ht&&ht(),f.focus(),le){f.setCursor(le);var tt=f.state.vim;tt.exMode=!1,tt.lastHPos=tt.lastHSPos=le.ch}L?L():F&&pt(f,(N?"Found "+N+" matches":"No matches found")+" for pattern: "+D+(Q("pcre")?" (set nopcre to use Vim regexps)":""))}function $e(ht,tt,qt){switch(e.e_stop(ht),cn(ht)){case"y":Ce(),We();break;case"n":We();break;case"a":var Ht=L;L=void 0,f.operation(J),L=Ht;break;case"l":Ce();case"q":case"<Esc>":case"<C-c>":case"<C-[>":Ie(qt);break}return F&&Ie(qt),!0}if(We(),F){pt(f,"No matches for "+D+(Q("pcre")?" (set nopcre to use vim regexps)":""));return}if(!h){J(),L&&L();return}Sa(f,{prefix:Fn("span","replace with ",Fn("strong",I)," (y/n/a/q/l)"),onKeyDown:$e})}function Qn(f,h){var v=f.state.vim,b=G.macroModeState,_=G.registerController.getRegister("."),k=b.isPlaying,D=b.lastInsertModeChanges;k||(f.off("change",ri),v.insertEnd&&v.insertEnd.clear(),v.insertEnd=void 0,e.off(f.getInputField(),"keydown",ql)),!k&&v.insertModeRepeat&&v.insertModeRepeat>1&&(bo(f,v,v.insertModeRepeat-1,!0),v.lastEditInputState.repeatOverride=v.insertModeRepeat),delete v.insertModeRepeat,v.insertMode=!1,h||f.setCursor(f.getCursor().line,f.getCursor().ch-1),f.setOption("keyMap","vim"),f.setOption("disableInput",!0),f.toggleOverwrite(!1),_.setText(D.changes.join("")),e.signal(f,"vim-mode-change",{mode:"normal"}),b.isRecording&&jl(b)}function bi(f){i.unshift(f),f.keys&&$u(f.keys)}function $u(f){f.split(/(<(?:[CSMA]-)*\w+>|.)/i).forEach(function(h){h&&(o[h]||(o[h]=0),o[h]++)})}function Nl(f){f.split(/(<(?:[CSMA]-)*\w+>|.)/i).forEach(function(h){o[h]&&o[h]--})}function Vu(f,h,v,b,_){var k={keys:f,type:h};for(var D in k[h]=v,k[h+"Args"]=b,_)k[D]=_[D];bi(k)}Te("insertModeEscKeysTimeout",200,"number");function go(f,h,v,b){var _=G.registerController.getRegister(b);if(b==":"){_.keyBuffer[0]&&En.processCommand(f,_.keyBuffer[0]),v.isPlaying=!1;return}var k=_.keyBuffer,D=0;v.isPlaying=!0,v.replaySearchQueries=_.searchQueries.slice(0);for(var I=0;I<k.length;I++)for(var L=k[I],F,N,le=/<(?:[CSMA]-)*\w+>|./gi;F=le.exec(L);)if(N=F[0],He.handleKey(f,N,"macro"),h.insertMode){var oe=_.insertModeChanges[D++].changes;G.macroModeState.lastInsertModeChanges.changes=oe,zl(f,oe,1),Qn(f)}v.isPlaying=!1}function ni(f,h){if(!f.isPlaying){var v=f.latestRegister,b=G.registerController.getRegister(v);b&&b.pushText(h)}}function jl(f){if(!f.isPlaying){var h=f.latestRegister,v=G.registerController.getRegister(h);v&&v.pushInsertModeChanges&&v.pushInsertModeChanges(f.lastInsertModeChanges)}}function yo(f,h){if(!f.isPlaying){var v=f.latestRegister,b=G.registerController.getRegister(v);b&&b.pushSearchQuery&&b.pushSearchQuery(h)}}function ri(f,h){var v=G.macroModeState,b=v.lastInsertModeChanges;if(!v.isPlaying)for(var _=f.state.vim;h;){if(b.expectCursorActivityForChange=!0,b.ignoreCount>1)b.ignoreCount--;else if(h.origin=="+input"||h.origin=="paste"||h.origin===void 0){var k=f.listSelections().length;k>1&&(b.ignoreCount=k);var D=h.text.join(`
|
|
127
|
+
`);if(b.maybeReset&&(b.maybeReset=(b.changes=[],!1)),D)if(f.state.overwrite&&!/\n/.test(D))b.changes.push([D]);else{if(D.length>1){var I=_&&_.insertEnd&&_.insertEnd.find(),L=f.getCursor();if(I&&I.line==L.line){var F=I.ch-L.ch;F>0&&F<D.length&&(b.changes.push([D,F]),D="")}}D&&b.changes.push(D)}}h=h.next}}function vs(f){var _;var h=f.state.vim;if(h.insertMode){var v=G.macroModeState;if(v.isPlaying)return;var b=v.lastInsertModeChanges;b.expectCursorActivityForChange?b.expectCursorActivityForChange=!1:(b.maybeReset=!0,h.insertEnd&&h.insertEnd.clear(),h.insertEnd=f.setBookmark(f.getCursor(),{insertLeft:!0}))}else(_=f.curOp)!=null&&_.isVimOp||vo(f,h)}function vo(f,h){var v=f.getCursor("anchor"),b=f.getCursor("head");if(h.visualMode&&!f.somethingSelected()?rt(f,!1):!h.visualMode&&!h.insertMode&&f.somethingSelected()&&(h.visualMode=!0,h.visualLine=!1,e.signal(f,"vim-mode-change",{mode:"visual"})),h.visualMode){var _=Et(b,v)?0:-1,k=Et(b,v)?-1:0;b=St(b,0,_),v=St(v,0,k),h.sel={anchor:v,head:b},Un(f,h,"<",Tt(b,v)),Un(f,h,">",Bn(b,v))}else h.insertMode||(h.lastHPos=f.getCursor().ch)}function ql(f){var h=G.macroModeState.lastInsertModeChanges,v=e.keyName?e.keyName(f):f.key;v&&(v.indexOf("Delete")!=-1||v.indexOf("Backspace")!=-1)&&(h.maybeReset&&(h.maybeReset=(h.changes=[],!1)),h.changes.push(new qe(v,f)))}function bo(f,h,v,b){var _=G.macroModeState;_.isPlaying=!0;var k=h.lastEditActionCommand,D=h.inputState;function I(){k?jn.processAction(f,h,k):jn.evalInput(f,h)}function L(N){if(_.lastInsertModeChanges.changes.length>0){N=h.lastEditActionCommand?N:1;var le=_.lastInsertModeChanges;zl(f,le.changes,N)}}if(h.inputState=h.lastEditInputState,k&&k.interlaceInsertRepeat)for(var F=0;F<v;F++)I(),L(1);else b||I(),L(v);h.inputState=D,h.insertMode&&!b&&Qn(f),_.isPlaying=!1}function wo(f,h){e.lookupKey(h,"vim-insert",function(v){return typeof v=="string"?e.commands[v](f):v(f),!0})}function zl(f,h,v){var b=f.getCursor("head"),_=G.macroModeState.lastInsertModeChanges.visualBlock;_&&(pr(f,b,_+1),v=f.listSelections().length,f.setCursor(b));for(var k=0;k<v;k++){_&&f.setCursor(St(b,k,0));for(var D=0;D<h.length;D++){var I=h[D];if(I instanceof qe)wo(f,I.keyName);else if(typeof I=="string")f.replaceSelection(I);else{var L=f.getCursor(),F=St(L,0,I[0].length-(I[1]||0));f.replaceRange(I[0],L,I[1]?L:F),f.setCursor(F)}}}_&&f.setCursor(St(b,0,1))}function Tn(f){var h=new f.constructor;return Object.keys(f).forEach(function(v){if(v!="insertEnd"){var b=f[v];Array.isArray(b)?b=b.slice():b&&typeof b=="object"&&b.constructor!=Object&&(b=Tn(b)),h[v]=b}}),f.sel&&(h.sel={head:f.sel.head&&et(f.sel.head),anchor:f.sel.anchor&&et(f.sel.anchor)}),h}function qi(f,h,v){var k=he(f),b=f,_=!1,k=He.maybeInitVimState_(b),D=k.visualBlock||k.wasInVisualBlock;if(b.state.closeVimNotification){var I=b.state.closeVimNotification;if(b.state.closeVimNotification=null,I(),h=="<CR>")return yt(b),!0}var L=b.isInMultiSelectMode();if(k.wasInVisualBlock&&!L?k.wasInVisualBlock=!1:L&&k.visualBlock&&(k.wasInVisualBlock=!0),h=="<Esc>"&&!k.insertMode&&!k.visualMode&&L&&k.status=="<Esc>")yt(b);else if(D||!L||b.inVirtualSelectionMode)_=He.handleKey(b,h,v);else{var F=Tn(k),N=k.inputState.changeQueueList||[];b.operation(function(){var oe;b.curOp&&(b.curOp.isVimOp=!0);var le=0;b.forEachSelection(function(){b.state.vim.inputState.changeQueue=N[le];var X=b.getCursor("head"),J=b.getCursor("anchor"),Ce=Et(X,J)?0:-1,ke=Et(X,J)?-1:0;X=St(X,0,Ce),J=St(J,0,ke),b.state.vim.sel.head=X,b.state.vim.sel.anchor=J,_=He.handleKey(b,h,v),b.virtualSelection&&(N[le]=b.state.vim.inputState.changeQueue,b.state.vim=Tn(F)),le++}),(oe=b.curOp)!=null&&oe.cursorActivity&&!_&&(b.curOp.cursorActivity=!1),b.state.vim=k,k.inputState.changeQueueList=N,k.inputState.changeQueue=null},!0)}return _&&!k.visualMode&&!k.insertMode&&k.visualMode!=b.somethingSelected()&&vo(b,k),_}return je(),He}function dr(e,t){var n=t.ch,i=t.line+1;i<1&&(i=1,n=0),i>e.lines&&(i=e.lines,n=Number.MAX_VALUE);var o=e.line(i);return Math.min(o.from+Math.max(0,n),o.to)}function Xr(e,t){let n=e.lineAt(t);return{line:n.number-1,ch:t-n.from}}var fi=class{constructor(e,t){this.line=e,this.ch=t}};function dw(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else{var i=e._handlers||(e._handlers={});i[t]=(i[t]||[]).concat(n)}}function fw(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else{var i=e._handlers,o=i&&i[t];if(o){var l=o.indexOf(n);l>-1&&(i[t]=o.slice(0,l).concat(o.slice(l+1)))}}}function pw(e,t,...n){var l;var i=(l=e._handlers)==null?void 0:l[t];if(i)for(var o=0;o<i.length;++o)i[o](...n)}function mw(e,...t){if(e)for(var n=0;n<e.length;++n)e[n](...t)}var zp;try{zp=RegExp("[\\w\\p{Alphabetic}\\p{Number}_]","u")}catch{zp=/[\w]/}function xl(e,t){var n=e.cm6;if(!n.state.readOnly){var i="input.type.compose";if(e.curOp&&(e.curOp.lastChange||(i="input.type.compose.start")),t.annotations)try{t.annotations.some(function(o){o.value=="input"&&(o.value=i)})}catch(o){console.error(o)}else t.userEvent=i;return n.dispatch(t)}}function hw(e,t){var i;e.curOp&&(e.curOp.$changeStart=void 0),(t?i6:Y5)(e.cm6);let n=(i=e.curOp)==null?void 0:i.$changeStart;n!=null&&e.cm6.dispatch({selection:{anchor:n}})}var BR={Left:e=>Js(e.cm6,{key:"Left"},"editor"),Right:e=>Js(e.cm6,{key:"Right"},"editor"),Up:e=>Js(e.cm6,{key:"Up"},"editor"),Down:e=>Js(e.cm6,{key:"Down"},"editor"),Backspace:e=>Js(e.cm6,{key:"Backspace"},"editor"),Delete:e=>Js(e.cm6,{key:"Delete"},"editor")},nt=class AT{openDialog(t,n,i){return UR(this,t,n,i)}openNotification(t,n){return WR(this,t,n)}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,n){dw(this,t,n)}off(t,n){fw(this,t,n)}signal(t,n,i){pw(this,t,n,i)}indexFromPos(t){return dr(this.cm6.state.doc,t)}posFromIndex(t){return Xr(this.cm6.state.doc,t)}foldCode(t){let n=this.cm6,i=n.state.selection.ranges,o=this.cm6.state.doc,l=dr(o,t),u=xn.create([xn.range(l,l)],0).ranges;n.state.selection.ranges=u,R5(n),n.state.selection.ranges=i}firstLine(){return 0}lastLine(){return this.cm6.state.doc.lines-1}lineCount(){return this.cm6.state.doc.lines}setCursor(t,n){typeof t=="object"&&(n=t.ch,t=t.line);var i=dr(this.cm6.state.doc,{line:t,ch:n||0});this.cm6.dispatch({selection:{anchor:i}},{scrollIntoView:!this.curOp}),this.curOp&&!this.curOp.isVimOp&&this.onBeforeEndOperation()}getCursor(t){var n=this.cm6.state.selection.main,i=t=="head"||!t?n.head:t=="anchor"?n.anchor:t=="start"?n.from:t=="end"?n.to:null;if(i==null)throw Error("Invalid cursor type");return this.posFromIndex(i)}listSelections(){var t=this.cm6.state.doc;return this.cm6.state.selection.ranges.map(n=>({anchor:Xr(t,n.anchor),head:Xr(t,n.head)}))}setSelections(t,n){var i=this.cm6.state.doc,o=t.map(l=>{var u=dr(i,l.head),d=dr(i,l.anchor);return u==d?xn.cursor(u,1):xn.range(d,u)});this.cm6.dispatch({selection:xn.create(o,n)})}setSelection(t,n,i){this.setSelections([{anchor:t,head:n}],0),i&&i.origin=="*mouse"&&this.onBeforeEndOperation()}getLine(t){var n=this.cm6.state.doc;return t<0||t>=n.lines?"":this.cm6.state.doc.line(t+1).text}getLineHandle(t){return this.$lineHandleChanges||(this.$lineHandleChanges=[]),{row:t,index:this.indexFromPos(new fi(t,0))}}getLineNumber(t){var n=this.$lineHandleChanges;if(!n)return null;for(var i=t.index,o=0;o<n.length;o++)if(i=n[o].changes.mapPos(i,1,KC.TrackAfter),i==null)return null;var l=this.posFromIndex(i);return l.ch==0?l.line:null}releaseLineHandles(){this.$lineHandleChanges=void 0}getRange(t,n){var i=this.cm6.state.doc;return this.cm6.state.sliceDoc(dr(i,t),dr(i,n))}replaceRange(t,n,i,o){i||(i=n);var l=this.cm6.state.doc,u=dr(l,n),d=dr(l,i);xl(this,{changes:{from:u,to:d,insert:t}})}replaceSelection(t){xl(this,this.cm6.state.replaceSelection(t))}replaceSelections(t){var n=this.cm6.state.selection.ranges.map((i,o)=>({from:i.from,to:i.to,insert:t[o]||""}));xl(this,{changes:n})}getSelection(){return this.getSelections().join(`
|
|
128
128
|
`)}getSelections(){var t=this.cm6;return t.state.selection.ranges.map(n=>t.state.sliceDoc(n.from,n.to))}somethingSelected(){return this.cm6.state.selection.ranges.some(t=>!t.empty)}getInputField(){return this.cm6.contentDOM}clipPos(t){var n=this.cm6.state.doc,i=t.ch,o=t.line+1;o<1&&(o=1,i=0),o>n.lines&&(o=n.lines,i=Number.MAX_VALUE);var l=n.line(o);return i=Math.min(Math.max(0,i),l.to-l.from),new fi(o-1,i)}getValue(){return this.cm6.state.doc.toString()}setValue(t){var n=this.cm6;return n.dispatch({changes:{from:0,to:n.state.doc.length,insert:t},selection:xn.range(0,0)})}focus(){return this.cm6.focus()}blur(){return this.cm6.contentDOM.blur()}defaultTextHeight(){return this.cm6.defaultLineHeight}findMatchingBracket(t,n){var i=this.cm6.state,o=dr(i.doc,t),l=iS(i,o+1,-1);return l&&l.end||(l=iS(i,o,1),l&&l.end)?{to:Xr(i.doc,l.end.from)}:{to:void 0}}scanForBracket(t,n,i,o){return GR(this,t,n,i,o)}indentLine(t,n){n?this.indentMore():this.indentLess()}indentMore(){U5(this.cm6)}indentLess(){Q5(this.cm6)}execCommand(t){if(t=="indentAuto")AT.commands.indentAuto(this);else if(t=="goLineLeft")G5(this.cm6);else if(t=="goLineRight"){r6(this.cm6);let n=this.cm6.state,i=n.selection.main.head;i<n.doc.length&&n.sliceDoc(i,i+1)!==`
|
|
129
129
|
`&&e6(this.cm6)}else console.log(t+" is not implemented")}setBookmark(t,n){var i=n!=null&&n.insertLeft?1:-1,o=this.indexFromPos(t);return new YR(this,o,i)}addOverlay({query:t}){let n=new t6({regexp:!0,search:t.source,caseSensitive:!/i/.test(t.flags)});if(n.valid){n.forVim=!0,this.cm6Query=n;let i=Ag.of(n);return this.cm6.dispatch({effects:i}),n}}removeOverlay(t){if(!this.cm6Query)return;this.cm6Query.forVim=!1;let n=Ag.of(this.cm6Query);this.cm6.dispatch({effects:n})}getSearchCursor(t,n){var i=this,o=null,l=null,u=!1;n.ch??(n.ch=Number.MAX_VALUE);var d=dr(i.cm6.state.doc,n),p=t.source.replace(/(\\.|{(?:\d+(?:,\d*)?|,\d+)})|[{}]/g,function(E,T){return T||"\\"+E});function g(E,T=0,O=E.length){return new n6(E,p,{ignoreCase:t.ignoreCase},T,O)}function w(E){var T=i.cm6.state.doc;if(E>T.length)return null;let O=g(T,E).next();return O.done?null:O.value}var x=1e4;function S(E,T){var O=i.cm6.state.doc;for(let j=1;;j++){let z=Math.max(E,T-j*x),V=g(O,z,T),P=null;for(;!V.next().done;)P=V.value;if(P&&(z==E||P.from>z+10))return P;if(z==E)return null}}return{findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(E){var T=i.cm6.state.doc;return o=E?S(0,o?u?o.to-1:o.from:d):w(o?u?o.to+1:o.to:d),l=o&&{from:Xr(T,o.from),to:Xr(T,o.to),match:o.match},u=o?o.from==o.to:!1,o&&o.match},from:function(){return l==null?void 0:l.from},to:function(){return l==null?void 0:l.to},replace:function(E){o&&(xl(i,{changes:{from:o.from,to:o.to,insert:E}}),o.to=o.from+E.length,l&&(l.to=Xr(i.cm6.state.doc,o.to)))},get match(){return l&&l.match}}}findPosV(t,n,i,o){let{cm6:l}=this,u=l.state.doc,d=i=="page"?l.dom.clientHeight:0,p=dr(u,t),g=xn.cursor(p,1,void 0,o),w=Math.round(Math.abs(n));for(let S=0;S<w;S++)i=="page"?g=l.moveVertically(g,n>0,d):i=="line"&&(g=l.moveVertically(g,n>0));let x=Xr(u,g.head);return(n<0&&g.head==0&&o!=0&&t.line==0&&t.ch!=0||n>0&&g.head==u.length&&x.ch!=o&&t.line==x.line)&&(x.hitSide=!0),x}charCoords(t,n){var i=this.cm6.contentDOM.getBoundingClientRect(),o=dr(this.cm6.state.doc,t),l=this.cm6.coordsAtPos(o),u=-i.top;return{left:((l==null?void 0:l.left)||0)-i.left,top:((l==null?void 0:l.top)||0)+u,bottom:((l==null?void 0:l.bottom)||0)+u}}coordsChar(t,n){var i=this.cm6.contentDOM.getBoundingClientRect(),o=this.cm6.posAtCoords({x:t.left+i.left,y:t.top+i.top})||0;return Xr(this.cm6.state.doc,o)}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,n){t!=null&&(this.cm6.scrollDOM.scrollLeft=t),n!=null&&(this.cm6.scrollDOM.scrollTop=n)}scrollIntoView(t,n){if(t){var i=this.indexFromPos(t);this.cm6.dispatch({effects:At.scrollIntoView(i)})}else this.cm6.dispatch({scrollIntoView:!0,userEvent:"scroll"})}getWrapperElement(){return this.cm6.dom}getMode(){return{name:this.getOption("mode")}}setSize(t,n){this.cm6.dom.style.width=t+4+"px",this.cm6.dom.style.height=n+"px",this.refresh()}refresh(){this.cm6.measure()}destroy(){this.removeOverlay()}getLastEditEnd(){return this.posFromIndex(this.$lastChangeEndOffset)}onChange(t){for(let i in this.$lineHandleChanges&&this.$lineHandleChanges.push(t),this.marks)this.marks[i].update(t.changes);this.virtualSelection&&(this.virtualSelection.ranges=this.virtualSelection.ranges.map(i=>i.map(t.changes)));var n=this.curOp=this.curOp||{};t.changes.iterChanges((i,o,l,u,d)=>{(n.$changeStart==null||n.$changeStart>l)&&(n.$changeStart=l),this.$lastChangeEndOffset=u;var p={text:d.toJSON()};n.lastChange?n.lastChange.next=n.lastChange=p:n.lastChange=n.change=p},!0),n.changeHandlers||(n.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,n){this.curOp||(this.curOp={$d:0}),this.curOp.$d++;try{var i=t()}finally{this.curOp&&(this.curOp.$d--,this.curOp.$d||this.onBeforeEndOperation())}return i}onBeforeEndOperation(){var t=this.curOp,n=!1;t&&(t.change&&mw(t.changeHandlers,this,t.change),t&&t.cursorActivity&&(mw(t.cursorActivityHandlers,this,null),t.isVimOp&&(n=!0)),this.curOp=null),n&&this.scrollIntoView()}moveH(t,n){if(n=="char"){var i=this.getCursor();this.setCursor(i.line,i.ch+t)}}setOption(t,n){switch(t){case"keyMap":this.state.keyMap=n;break;case"textwidth":this.state.textwidth=n;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(WC)==" ";case"indentUnit":return this.cm6.state.facet(WC).length||2;case"textwidth":return this.state.textwidth;case"keyMap":return this.state.keyMap||"vim"}}toggleOverwrite(t){this.state.overwrite=t}getTokenTypeAt(t){var o,l,u;var n=this.indexFromPos(t),i=((u=(l=(o=JC(this.cm6.state,n))==null?void 0:o.resolve(n))==null?void 0:l.type)==null?void 0:u.name)||"";return/comment/i.test(i)?"comment":/string/i.test(i)?"string":""}overWriteSelection(t){var n=this.cm6.state.doc,i=this.cm6.state.selection,o=i.ranges.map(l=>{if(l.empty){var u=l.to<n.length?n.sliceString(l.from,l.to+1):"";if(u&&!/\n/.test(u))return xn.range(l.from,l.to+1)}return l});this.cm6.dispatch({selection:xn.create(o,i.mainIndex)}),this.replaceSelection(t)}isInMultiSelectMode(){return this.cm6.state.selection.ranges.length>1}virtualSelectionMode(){return!!this.virtualSelection}forEachSelection(t){var n=this.cm6.state.selection;this.virtualSelection=xn.create(n.ranges,n.mainIndex);for(var i=0;i<this.virtualSelection.ranges.length;i++){var o=this.virtualSelection.ranges[i];o&&(this.cm6.dispatch({selection:xn.create([o])}),t(),this.virtualSelection.ranges[i]=this.cm6.state.selection.ranges[0])}this.cm6.dispatch({selection:this.virtualSelection}),this.virtualSelection=null}hardWrap(t){return ZR(this,t)}};nt.isMac=typeof navigator<"u"&&/Mac/.test(navigator.platform),nt.Pos=fi,nt.StringStream=F5,nt.commands={cursorCharLeft:function(e){J5(e.cm6)},redo:function(e){hw(e,!1)},undo:function(e){hw(e,!0)},newlineAndIndent:function(e){Z5({state:e.cm6.state,dispatch:t=>xl(e,t)})},indentAuto:function(e){W5(e.cm6)},newlineAndIndentContinueComment:void 0,save:void 0},nt.isWordChar=function(e){return zp.test(e)},nt.keys=BR,nt.addClass=function(e,t){},nt.rmClass=function(e,t){},nt.e_preventDefault=function(e){e.preventDefault()},nt.e_stop=function(e){var t,n;(t=e==null?void 0:e.stopPropagation)==null||t.call(e),(n=e==null?void 0:e.preventDefault)==null||n.call(e)},nt.lookupKey=function(e,t,n){var i=nt.keys[e];!i&&/^Arrow/.test(e)&&(i=nt.keys[e.slice(5)]),i&&n(i)},nt.on=dw,nt.off=fw,nt.signal=pw,nt.findMatchingTag=XR,nt.findEnclosingTag=JR,nt.keyName=void 0;function gw(e,t,n){var i=document.createElement("div");return i.appendChild(t),i}function yw(e,t){e.state.currentNotificationClose&&e.state.currentNotificationClose(),e.state.currentNotificationClose=t}function WR(e,t,n){yw(e,d);var i=gw(e,t,n&&n.bottom),o=!1,l,u=n&&n.duration!==void 0?n.duration:5e3;function d(){o||(o=!0,clearTimeout(l),i.remove(),bw(e,i))}return i.onclick=function(p){p.preventDefault(),d()},vw(e,i),u&&(l=setTimeout(d,u)),d}function vw(e,t){var n=e.state.dialog;e.state.dialog=t,t.style.flex="1",t&&n!==t&&(n&&n.contains(document.activeElement)&&e.focus(),n&&n.parentElement?n.parentElement.replaceChild(t,n):n&&n.remove(),nt.signal(e,"dialog"))}function bw(e,t){e.state.dialog==t&&(e.state.dialog=null,nt.signal(e,"dialog"))}function UR(e,t,n,i){i||(i={}),yw(e,void 0);var o=gw(e,t,i.bottom),l=!1;vw(e,o);function u(p){if(typeof p=="string")d.value=p;else{if(l)return;l=!0,bw(e,o),e.state.dialog||e.focus(),i.onClose&&i.onClose(o)}}var d=o.getElementsByTagName("input")[0];return d&&(i.value&&(d.value=i.value,i.selectValueOnOpen!==!1&&d.select()),i.onInput&&nt.on(d,"input",function(p){i.onInput(p,d.value,u)}),i.onKeyUp&&nt.on(d,"keyup",function(p){i.onKeyUp(p,d.value,u)}),nt.on(d,"keydown",function(p){i&&i.onKeyDown&&i.onKeyDown(p,d.value,u)||(p.keyCode==13&&n&&n(d.value),(p.keyCode==27||i.closeOnEnter!==!1&&p.keyCode==13)&&(d.blur(),nt.e_stop(p),u()))}),i.closeOnBlur!==!1&&nt.on(d,"blur",function(){setTimeout(function(){document.activeElement!==d&&u()})}),d.focus()),u}var KR={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<","<":">>",">":"<<"};function QR(e){return e&&e.bracketRegex||/[(){}[\]]/}function GR(e,t,n,i,o){for(var l=o&&o.maxScanLineLength||1e4,u=o&&o.maxScanLines||1e3,d=[],p=QR(o),g=n>0?Math.min(t.line+u,e.lastLine()+1):Math.max(e.firstLine()-1,t.line-u),w=t.line;w!=g;w+=n){var x=e.getLine(w);if(x){var S=n>0?0:x.length-1,E=n>0?x.length:-1;if(!(x.length>l))for(w==t.line&&(S=t.ch-(n<0?1:0));S!=E;S+=n){var T=x.charAt(S);if(p.test(T)){var O=KR[T];if(O&&O.charAt(1)==">"==n>0)d.push(T);else if(d.length)d.pop();else return{pos:new fi(w,S),ch:T}}}}}return w-n==(n>0?e.lastLine():e.firstLine())?!1:null}function XR(e,t){return null}function JR(e,t){var l,u,d;var n=e.cm6.state,i=e.indexFromPos(t);i<n.doc.length&&n.sliceDoc(i,i+1)=="<"&&i++;for(var o=((l=JC(n,i))==null?void 0:l.resolve(i))||null;o;){if(((u=o.firstChild)==null?void 0:u.type.name)=="OpenTag"&&((d=o.lastChild)==null?void 0:d.type.name)=="CloseTag")return{open:ww(n.doc,o.firstChild),close:ww(n.doc,o.lastChild)};o=o.parent}}function ww(e,t){return{from:Xr(e,t.from),to:Xr(e,t.to)}}var YR=class{constructor(e,t,n){this.cm=e,this.id=e.$mid++,this.offset=t,this.assoc=n,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,KC.TrackDel))}};function ZR(e,t){var T;for(var n=t.column||e.getOption("textwidth")||80,i=t.allowMerge!=0,o=Math.min(t.from,t.to),l=Math.max(t.from,t.to);o<=l;){var u=e.getLine(o);if(u.length>n){var d=E(u,n,5);if(d){var p=(T=/^\s*/.exec(u))==null?void 0:T[0];e.replaceRange(`
|
|
130
|
-
`+p,new fi(o,d.start),new fi(o,d.end))}l++}else if(i&&/\S/.test(u)&&o!=l){var g=e.getLine(o+1);if(g&&/\S/.test(g)){var w=u.replace(/\s+$/,""),x=g.replace(/^\s+/,""),S=w+" "+x,d=E(S,n,5);d&&d.start>w.length||S.length<n?(e.replaceRange(" ",new fi(o,w.length),new fi(o+1,g.length-x.length)),o--,l--):w.length<u.length&&e.replaceRange("",new fi(o,w.length),new fi(o,u.length))}}o++}return o;function E(O,j,z){if(!(O.length<j)){var V=O.slice(0,j),P=O.slice(j),U=/^(?:(\s+)|(\S+)(\s+))/.exec(P),me=/(?:(\s+)|(\s+)(\S+))$/.exec(V),$=0,W=0;if(me&&!me[2]&&($=j-me[1].length,W=j),U&&!U[2]&&($||($=j),W=j+U[1].length),$)return{start:$,end:W};if(me&&me[2]&&me.index>z)return{start:me.index,end:me.index+me[2].length};if(U&&U[2])return $=j+U[2].length,{start:$,end:$+U[3].length}}}}var Fp=N5||(function(){let e={cursorBlinkRate:1200};return function(){return e}})(),e4=class{constructor(e,t,n,i,o,l,u,d,p,g){this.left=e,this.top=t,this.height=n,this.fontFamily=i,this.fontSize=o,this.fontWeight=l,this.color=u,this.className=d,this.letter=p,this.partial=g}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}},t4=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=Fp(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"),n4(e)&&this.setBlinkRate()}scheduleRedraw(){this.view.requestMeasure(this.measureReq)}readPos(){let{state:e}=this.view,t=[];for(let n of e.selection.ranges){let i=n==e.selection.main,o=a4(this.cm,this.view,n,i);o&&t.push(o)}return{cursors:t}}drawSel({cursors:e}){if(e.length!=this.cursors.length||e.some((t,n)=>!t.eq(this.cursors[n]))){let t=this.cursorLayer.children;if(t.length!==e.length){this.cursorLayer.textContent="";for(let n of e)this.cursorLayer.appendChild(n.draw())}else e.forEach((n,i)=>n.adjust(t[i]));this.cursors=e}}destroy(){this.cursorLayer.remove()}};function n4(e){return Fp(e.startState)!=Fp(e.state)}var r4=
|
|
130
|
+
`+p,new fi(o,d.start),new fi(o,d.end))}l++}else if(i&&/\S/.test(u)&&o!=l){var g=e.getLine(o+1);if(g&&/\S/.test(g)){var w=u.replace(/\s+$/,""),x=g.replace(/^\s+/,""),S=w+" "+x,d=E(S,n,5);d&&d.start>w.length||S.length<n?(e.replaceRange(" ",new fi(o,w.length),new fi(o+1,g.length-x.length)),o--,l--):w.length<u.length&&e.replaceRange("",new fi(o,w.length),new fi(o,u.length))}}o++}return o;function E(O,j,z){if(!(O.length<j)){var V=O.slice(0,j),P=O.slice(j),U=/^(?:(\s+)|(\S+)(\s+))/.exec(P),me=/(?:(\s+)|(\s+)(\S+))$/.exec(V),$=0,W=0;if(me&&!me[2]&&($=j-me[1].length,W=j),U&&!U[2]&&($||($=j),W=j+U[1].length),$)return{start:$,end:W};if(me&&me[2]&&me.index>z)return{start:me.index,end:me.index+me[2].length};if(U&&U[2])return $=j+U[2].length,{start:$,end:$+U[3].length}}}}var Fp=N5||(function(){let e={cursorBlinkRate:1200};return function(){return e}})(),e4=class{constructor(e,t,n,i,o,l,u,d,p,g){this.left=e,this.top=t,this.height=n,this.fontFamily=i,this.fontSize=o,this.fontWeight=l,this.color=u,this.className=d,this.letter=p,this.partial=g}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}},t4=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=Fp(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"),n4(e)&&this.setBlinkRate()}scheduleRedraw(){this.view.requestMeasure(this.measureReq)}readPos(){let{state:e}=this.view,t=[];for(let n of e.selection.ranges){let i=n==e.selection.main,o=a4(this.cm,this.view,n,i);o&&t.push(o)}return{cursors:t}}drawSel({cursors:e}){if(e.length!=this.cursors.length||e.some((t,n)=>!t.eq(this.cursors[n]))){let t=this.cursorLayer.children;if(t.length!==e.length){this.cursorLayer.textContent="";for(let n of e)this.cursorLayer.appendChild(n.draw())}else e.forEach((n,i)=>n.adjust(t[i]));this.cursors=e}}destroy(){this.cursorLayer.remove()}};function n4(e){return Fp(e.startState)!=Fp(e.state)}var r4=ef.highest(At.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 i4(e){let t=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==z5.LTR?t.left:t.right-e.scrollDOM.clientWidth)-e.scrollDOM.scrollLeft*e.scaleX,top:t.top-e.scrollDOM.scrollTop*e.scaleY}}function a4(e,t,n,i){var w,x,S;var o;let l=n.head,u=!1,d=1,p=e.state.vim;if(p&&(!p.insertMode||e.state.overwrite)){if(u=!0,p.visualBlock&&!i)return null;n.anchor<n.head&&(l<t.state.doc.length&&t.state.sliceDoc(l,l+1))!=`
|
|
131
131
|
`&&l--,e.state.overwrite?d=.2:p.status&&(d=.5)}if(u){let E=l<t.state.doc.length&&t.state.sliceDoc(l,l+1);E&&/[\uDC00-\uDFFF]/.test(E)&&l>1&&(l--,E=t.state.sliceDoc(l,l+1));let T=t.coordsAtPos(l,1);if(!T)return null;let O=i4(t),j=t.domAtPos(l),z=j?j.node:t.contentDOM;for(z instanceof Text&&j.offset>=z.data.length&&((w=z.parentElement)==null?void 0:w.nextSibling)&&(z=(x=z.parentElement)==null?void 0:x.nextSibling,j={node:z,offset:0});j&&j.node instanceof HTMLElement;)z=j.node,j={node:j.node.childNodes[j.offset],offset:0};if(!(z instanceof HTMLElement)){if(!z.parentNode)return null;z=z.parentNode}let V=getComputedStyle(z),P=T.left,U=(S=(o=t).coordsForChar)==null?void 0:S.call(o,l);if(U&&(P=U.left),!E||E==`
|
|
132
|
-
`||E=="\r")E="\xA0";else if(E==" "){E="\xA0";var g=t.coordsAtPos(l+1,-1);g&&(P=g.left-(g.left-T.left)/parseInt(V.tabSize))}else/[\uD800-\uDBFF]/.test(E)&&l<t.state.doc.length-1&&(E+=t.state.sliceDoc(l+1,l+2));let me=T.bottom-T.top;return new e4((P-O.left)/t.scaleX,(T.top-O.top+me*(1-d))/t.scaleY,me*d/t.scaleY,V.fontFamily,V.fontSize,V.fontWeight,V.color,i?"cm-fat-cursor cm-cursor-primary":"cm-fat-cursor cm-cursor-secondary",E,d!=1)}else return null}let xw,_w,kw,Cw;xw=typeof navigator<"u"&&/linux/i.test(navigator.platform)&&/ Gecko\/\d+/.exec(navigator.userAgent),ra=HR(nt),_w=250,kw=At.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"}}),Cw=Cr.fromClass(class{constructor(e){this.status="",this.query=null,this.decorations=Xt.none,this.waitForCopy=!1,this.lastKeydown="",this.useNextTextInput=!1,this.compositionText="",this.view=e;let t=this.cm=new nt(e);ra.enterVimMode(this.cm),this.view.cm=this.cm,this.cm.state.vimPlugin=this,this.blockCursor=new t4(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",n=>{t.state.vim&&(t.state.vim.mode=n.mode,n.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:Sw.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=n=>{ra.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 n of e.transactions)for(let i of n.effects)if(i.is(Ag))if(!((t=i.value)!=null&&t.forVim))this.highlight(null);else{let o=i.value.create();this.highlight(o)}}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 n=this.cm.state.dialog;if(n)n.parentElement!=e&&(e.textContent="",e.appendChild(n));else{e.textContent="";var i=(t.mode||"normal").toUpperCase();t.insertModeReturn&&(i+="(C-O)"),this.statusButton.textContent=`--${i}--`,e.appendChild(this.statusButton),e.appendChild(this.spacer)}this.dom.textContent=t.status,e.appendChild(this.dom)}destroy(){ra.leaveVimMode(this.cm),this.updateClass(),this.blockCursor.destroy(),delete this.view.cm}highlight(e){if(this.query=e,!e)return this.decorations=Xt.none;let{view:t}=this,n=new _c;for(let i=0,o=t.visibleRanges,l=o.length;i<l;i++){let{from:u,to:d}=o[i];for(;i<l-1&&d>o[i+1].from-2*_w;)d=o[++i].to;e.highlight(t.state,u,d,(p,g)=>{n.add(p,g,s4)})}return this.decorations=n.finish()}handleKey(e,t){let n=this.cm,i=n.state.vim;if(!i)return;let o=ra.vimKeyFromEvent(e,i);if(nt.signal(this.cm,"inputEvent",{type:"handleKey",key:o}),!o)return;if(o=="<Esc>"&&!i.insertMode&&!i.visualMode&&this.query){let u=i.searchState_;u&&(n.removeOverlay(u.getOverlay()),u.setOverlay(null))}if(o==="<C-c>"&&!nt.isMac&&n.somethingSelected())return this.waitForCopy=!0,!0;i.status=(i.status||"")+o;let l=ra.multiSelectHandleKey(n,o,"user");return i=ra.maybeInitVimState_(n),!l&&i.insertMode&&n.state.overwrite&&(e.key&&e.key.length==1&&!/\n/.test(e.key)?(l=!0,n.overWriteSelection(e.key)):e.key=="Backspace"&&(l=!0,nt.commands.cursorCharLeft(n))),l&&(nt.signal(this.cm,"vim-keypress",o),e.preventDefault(),e.stopPropagation(),this.blockCursor.scheduleRedraw()),this.updateStatus(),!!l}},{eventHandlers:{copy:function(e,t){this.waitForCopy&&(this.waitForCopy=!1,Promise.resolve().then(()=>{var n=this.cm,i=n.state.vim;i&&(i.insertMode?n.setSelection(n.getCursor(),n.getCursor()):n.operation(()=>{n.curOp&&(n.curOp.isVimOp=!0),ra.handleKey(n,"<Esc>","user")}))}))},compositionstart:function(e,t){this.useNextTextInput=!0,nt.signal(this.cm,"inputEvent",e)},compositionupdate:function(e,t){nt.signal(this.cm,"inputEvent",e)},compositionend:function(e,t){nt.signal(this.cm,"inputEvent",e)},keypress:function(e,t){nt.signal(this.cm,"inputEvent",e),this.lastKeydown=="Dead"&&this.handleKey(e,t)},keydown:function(e,t){nt.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:()=>[At.inputHandler.of((e,t,n,i)=>{var w,x;var o=Ec(e);if(!o)return!1;var l=(w=o.state)==null?void 0:w.vim,u=o.state.vimPlugin;if(l&&!l.insertMode&&!((x=o.curOp)!=null&&x.isVimOp)){if(i==="\0\0")return!0;if(nt.signal(o,"inputEvent",{type:"text",text:i,from:t,to:n}),i.length==1&&u.useNextTextInput){if(l.expectLiteralNext&&e.composing)return u.compositionText=i,!1;if(u.compositionText){var d=u.compositionText;u.compositionText="";var p=e.state.selection.main.head;if(d===e.state.sliceDoc(p-d.length,p)){var g=o.getCursor();o.replaceRange("",o.posFromIndex(p-d.length),g)}}return u.handleKey({key:i,preventDefault:()=>{},stopPropagation:()=>{}}),o4(e),!0}}return!1})],decorations:e=>e.decorations});function o4(e){var t=e.scrollDOM.parentElement;if(t){if(xw){e.contentDOM.textContent="\0\0",e.contentDOM.dispatchEvent(new CustomEvent("compositionend"));return}var n=e.scrollDOM.nextSibling,i=window.getSelection(),o=i&&{anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset};e.scrollDOM.remove(),t.insertBefore(e.scrollDOM,n);try{o&&i&&(i.setPosition(o.anchorNode,o.anchorOffset),o.focusNode&&i.extend(o.focusNode,o.focusOffset))}catch(l){console.error(l)}e.focus(),e.contentDOM.dispatchEvent(new CustomEvent("compositionend"))}}var s4=Xt.mark({class:"cm-searchMatch"}),Sw=sr.define(),l4=li.define({create:()=>!1,update(e,t){for(let n of t.effects)n.is(Sw)&&(e=n.value);return e},provide:e=>Rg.from(e,t=>t?c4:null)});function c4(e){let t=document.createElement("div");t.className="cm-vim-panel";let n=e.cm;return n.state.dialog&&t.appendChild(n.state.dialog),{top:!1,dom:t}}function u4(e){let t=document.createElement("div");t.className="cm-vim-panel";let n=e.cm;return n.state.statusbar=t,n.state.vimPlugin.updateStatus(),{dom:t}}vT=function(e={}){return[kw,Cw,r4,e.status?Rg.of(u4):l4]},Ec=function(e){return e.cm||null},j0=function(e){let t=e.state.selection.main;return t.from===0&&t.to===0},q0=function(e,t=!1){let n=e.state.selection.main,i=e.state.doc.length;return t&&n.from===i-1&&n.to===i-1?!0:n.from===i&&n.to===i},dy=function(e){e&&e.dispatch({selection:{anchor:e.state.doc.length,head:e.state.doc.length}})},WE=function(e){requestAnimationFrame(()=>{var n;let t=(n=e.current)==null?void 0:n.view;t&&(t.focus(),dy(t))})},A0=function(e){let t=e.dom.closest(".marimo-cell");t&&requestAnimationFrame(()=>{t.scrollIntoView({behavior:"instant",block:"nearest",inline:"nearest"})})},fE=function(e){var t;return((t=Ec(e))==null?void 0:t.state.vim)!=null},hT=function(e){var n;let t=(n=Ec(e))==null?void 0:n.state.vim;return t?!t.mode&&!t.insertMode&&!t.visualMode?!0:t.mode==="normal":!1},xT=function(e){e&&e.dispatch({selection:{anchor:0,head:e.state.doc.length}})};var d4=new Set([Ee.ClassDefinition]);function Ew(e,t){requestAnimationFrame(()=>{e.focus(),e.dispatch({selection:{anchor:t,head:t},effects:At.scrollIntoView(t,{y:"center"})})}),A0(e)}function f4(e,t){let n=Dg(e),i=null;return n.iterate({enter:o=>{if(i!==null)return!1;if(o.name===Ee.VariableName&&e.doc.sliceString(o.from,o.to)===t)return i=o.from,!1;if(o.name===Ee.Comment||o.name===Ee.String)return!1}}),i}function p4(e,t){let n=[],i=e.resolveInner(t,0);for(;i;)rl.has(i.name)&&(n.some(o=>o.type===Ee.FunctionDefinition||o.type===Ee.LambdaExpression)&&i.name===Ee.ClassDefinition||n.push({id:i.from,type:i.name})),i=i.parent;return n.push({id:-1,type:"global"}),n}function _l(e,t,n){e.push({scopeId:t,from:n})}function m4(e,t){if(e.firstChild())do t(e.node);while(e.nextSibling())}function $p(e,t){let{state:n,variableName:i,scopeId:o,declarations:l}=t;switch(e.name){case Ee.VariableName:n.doc.sliceString(e.from,e.to)===i&&_l(l,o,e.from);break;case Ee.TupleExpression:case Ee.ArrayExpression:{let u=e.node.cursor();u.firstChild();do $p(u,t);while(u.nextSibling());break}default:break}}function Tw(e,t){let{state:n,variableName:i,scopeId:o,declarations:l}=t,u=e.cursor();u.firstChild();do{if(u.name!==Ee.ParamList)continue;let d=u.node.cursor();d.firstChild();do d.name===Ee.VariableName&&n.doc.sliceString(d.from,d.to)===i&&_l(l,o,d.from);while(d.nextSibling())}while(u.nextSibling())}function h4(e,t){let n=e.cursor();n.firstChild();let i=!1;do if(n.name===Xn.For)i=!0;else{if(i&&n.name===Xn.In)break;i&&$p(n,t)}while(n.nextSibling())}function Dw(e,t){let{state:n,variableName:i,scopeStack:o,declarations:l}=t,u=e.cursor(),d=u.name,p=u.from,g=rl.has(d)?[...o,p]:o,w=g[g.length-1]??-1;switch(d){case Ee.FunctionDefinition:case Ee.ClassDefinition:{let x=e.cursor();x.firstChild();do if(x.name===Ee.VariableName&&n.doc.sliceString(x.from,x.to)===i){_l(l,o[o.length-1]??-1,x.from);break}while(x.nextSibling());d===Ee.FunctionDefinition&&Tw(e,{state:n,variableName:i,scopeId:p,declarations:l});break}case Ee.LambdaExpression:Tw(e,{state:n,variableName:i,scopeId:p,declarations:l});break;case Ee.ArrayComprehensionExpression:case Ee.DictionaryComprehensionExpression:case Ee.SetComprehensionExpression:case Ee.ComprehensionExpression:case Ee.ForStatement:h4(e,{state:n,variableName:i,scopeId:w,declarations:l});break;case Ee.AssignStatement:{let x=[],S=e.cursor();S.firstChild();do S.name===Ee.AssignOp&&x.push(S.from);while(S.nextSibling());let E=x[x.length-1];if(E===void 0)break;let T=e.cursor();T.firstChild();do T.from<E&&$p(T,{state:n,variableName:i,scopeId:w,declarations:l});while(T.nextSibling());break}case Ee.ImportStatement:{let x=e.cursor();x.firstChild();let S=!1,E=null,T=()=>{E!=null&&E.matches&&_l(l,w,E.from),E=null};do{if(x.name===Xn.Import){S=!0;continue}if(S){if(x.name===Xn.As){E=null;continue}x.name===Ee.VariableName?(T(),E={from:x.from,matches:n.doc.sliceString(x.from,x.to)===i}):x.name===","&&T()}}while(x.nextSibling());T();break}case Ee.TryStatement:case Ee.WithStatement:{let x=e.cursor();x.firstChild();let S=!1;do x.name===Xn.As?S=!0:S&&x.name===Ee.VariableName&&n.doc.sliceString(x.from,x.to)===i&&(_l(l,w,x.from),S=!1);while(x.nextSibling());break}default:break}m4(u,x=>{Dw(x,{state:n,variableName:i,scopeStack:g,declarations:l})})}function g4(e,t,n){let i=Dg(e),o=[];Dw(i,{state:e,variableName:t,scopeStack:[],declarations:o});let l=Math.max(0,Math.min(n,e.doc.length));for(let u of p4(i,l)){let d=o.filter(p=>p.scopeId===u.id).filter(p=>d4.has(u.type)?p.from<=l:!0).toSorted((p,g)=>p.from-g.from)[0];if(d)return d.from}return null}jc=function(e,t,n){let{state:i}=e,o=n===void 0?f4(i,t):g4(i,t,n);return o===null?!1:(Ew(e,o),!0)};function y4(e,t){return Ew(e,e.state.doc.line(t).from),!0}function v4(e,t){let n=Me.get(r5);return(n==="mac"?e.mac??e.key:n==="windows"?e.win??e.key:e.linux??e.key)===t}function b4(e){let{from:t,to:n}=e.selection.main;if(t===n){let{startToken:i,endToken:o}=qp(e.doc,t);return{position:i,word:e.doc.sliceString(i,o)}}return{position:t,word:e.doc.sliceString(t,n)}}function w4(e,t){if(!t)return null;let n=e[t];return!n||n.declaredBy.length===0?null:n.declaredBy[0]}function x4(e){return e.startsWith("_")}Sf=function(e){let{state:t}=e,{position:n,word:i}=b4(t);return i?(cS(e),e.dispatch({effects:$5}),k4(e,i,n)):!1};function _4(e,t=Me.get(i5).getHotkey("cell.goToDefinition").key){var n;for(let i of e.state.facet(Si).flat())if(v4(i,t)&&((n=i.run)!=null&&n.call(i,e)))return!0;return!1}PE=function(e){return Sf(e)?!0:_4(e)};function k4(e,t,n){if(n!==void 0&&jc(e,t,n))return!0;let i=C4(e,t);return i?jc(i,t):!1}fT=function(e,t){let n=Rw(e);return n?y4(n,t):!1};function C4(e,t){if(x4(t))return e;let n=w4(Me.get(Qa),t);return n?Rw(n):null}function Rw(e){var t;return((t=Me.get(ft).cellHandles[e].current)==null?void 0:t.editorView)??null}const kl=je(null);CE=function(e){let t=Me.get(kl);if(e===null){Me.set(kl,null);return}(t==null?void 0:t.cellId)===e.cellId&&t.line===e.line||Me.set(kl,{...e,startedAtMs:Date.now()})};const ns=je(new Map);var S4=new Set;function E4(e){return je(t=>{let n=t(kl);return(n==null?void 0:n.cellId)===e?n.line:null})}function T4(e){return je(t=>{let n=t(kl);return(n==null?void 0:n.cellId)===e?{line:n.line,startedAtMs:n.startedAtMs}:null})}function D4(e){return je(t=>t(ns).get(e)??S4)}function Vp(e){let t={};for(let[n,i]of e)i.size>0&&(t[n]=[...i].toSorted((o,l)=>o-l));Sr().sendSetBreakpoints({breakpoints:t}).catch(n=>{Se.debug("Failed to sync breakpoints to kernel",{error:n})})}XE=function(e){let t=Me.get(ns);if(!t.has(e))return;let n=new Map(t);n.delete(e),Me.set(ns,n),Vp(n)},oT=function(){let e=Me.get(ns);e.size>0&&Vp(e)},K0=function(e,t){let n=Me.get(ns),i=new Map(n),o=new Set(i.get(e)??[]);o.has(t)?o.delete(t):o.add(t),o.size>0?i.set(e,o):i.delete(e),Me.set(ns,i),Vp(i)};function Iw(e,t){if(t==null||t<1||t>e.doc.lines)return Xt.none;let n=new _c;try{let i=e.doc.line(t);n.add(i.from,i.from,Xt.line({class:"cm-debugger-current-line"}))}catch(i){Se.debug("Invalid debugger line",{error:i})}return n.finish()}var R4=class{constructor(e,t){this.decorations=Iw(e.state,t.get()),this.unsubscribe=t.sub(n=>{this.decorations=Iw(e.state,n),e.dispatch({userEvent:"marimo.debugger-line-update"})})}update(e){this.decorations=this.decorations.map(e.changes)}destroy(){this.unsubscribe()}};function I4(e){return[Cr.define(t=>new R4(t,e),{decorations:t=>t.decorations}),At.theme({".cm-debugger-current-line":{backgroundColor:"color-mix(in srgb, var(--amber-4) 50%, transparent)"}})]}var Aw=new class extends ZC{toDOM(){let e=document.createElement("div");return e.className="cm-breakpoint-marker",e}},Lw=sr.define(),Pw=li.define({create:()=>new Set,update(e,t){for(let n of t.effects)if(n.is(Lw))return n.value;return e}});function A4(e){let t=e.field(Pw);if(t.size===0)return UC.empty;let n=new _c;for(let i of[...t].toSorted((o,l)=>o-l))if(i>=1&&i<=e.doc.lines){let o=e.doc.line(i);n.add(o.from,o.from,Aw)}return n.finish()}var L4=class{constructor(e,t){let n=i=>{e.dispatch({effects:Lw.of(i)})};t.get().size>0&&queueMicrotask(()=>n(t.get())),this.unsubscribe=t.sub(n)}destroy(){this.unsubscribe()}};function P4(e,t){return[Pw,Cr.define(n=>new L4(n,t)),YC({class:"cm-breakpoint-gutter",markers:n=>A4(n.state),initialSpacer:()=>Aw,domEventHandlers:{mousedown:(n,i)=>{let o=n.state.doc.lineAt(i.from).number;return K0(e,o),!0}}}),At.theme({".cm-breakpoint-gutter":{width:"14px",cursor:"pointer"},".cm-breakpoint-marker":{width:"8px",height:"8px",borderRadius:"50%",backgroundColor:"var(--red-9)",margin:"4px auto"}})]}z0=class Ff{static fromMilliseconds(t){return t==null?null:new Ff(t)}static fromSeconds(t){return t==null?null:new Ff(t*1e3)}static now(){return new Ff(Date.now())}constructor(t){this.ms=t}toMilliseconds(){return this.ms}toSeconds(){return this.ms/1e3}},R0=function(e){if(e===null)return"";let t=e,n=t/1e3;return n>=60?`${Math.floor(n/60)}m${Math.floor(n%60)}s`:n>=1?`${n.toFixed(2).toString()}s`:`${t.toFixed(0).toString()}ms`};var O4=500,M4=250,N4=(Di=class extends j5{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 n=()=>{let i=Date.now()-this.startedAtMs;t.textContent=i>=O4?R0(i):""};return n(),Di.intervals.set(t,window.setInterval(n,M4)),t}destroy(t){let n=Di.intervals.get(t);n!==void 0&&(window.clearInterval(n),Di.intervals.delete(t))}ignoreEvent(){return!0}},pe(Di,"intervals",new WeakMap),Di);function Ow(e,t){if(t===null||t.line<1||t.line>e.doc.lines)return Xt.none;let n=new _c;try{let i=e.doc.line(t.line);n.add(i.from,i.from,Xt.line({class:"cm-timing-current-line"})),n.add(i.to,i.to,Xt.widget({widget:new N4(t.startedAtMs),side:1}))}catch(i){Se.debug("Invalid timing line",{error:i})}return n.finish()}var j4=class{constructor(e,t){this.decorations=Ow(e.state,t.get()),this.unsubscribe=t.sub(n=>{this.decorations=Ow(e.state,n),e.dispatch({userEvent:"marimo.timing-line-update"})})}update(e){this.decorations=this.decorations.map(e.changes)}destroy(){this.unsubscribe()}};function q4(e){return[Cr.define(t=>new j4(t,e),{decorations:t=>t.decorations}),At.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 Mw(e,t){if(!(t!=null&&t.length))return Xt.none;let n=new _c,i=e.facet(aa),o=t.filter(l=>l.kind==="cell"&&l.cellId===i).toSorted((l,u)=>l.lineNumber-u.lineNumber);for(let l of o)try{let u=e.doc.line(l.lineNumber),d=Xt.line({class:"cm-error-line"});n.add(u.from,u.from,d)}catch(u){Se.debug("Invalid line number in error decoration",{error:u})}return n.finish()}function Nw(e,t){if(!(t!=null&&t.length))return;let n=e.state.facet(aa),i=t.filter(u=>u.kind==="cell"&&u.cellId===n);if(i.length===0)return;let o=q5(e.state),l=[];for(let u of i)try{let d=e.state.doc.line(u.lineNumber);o.between(d.from,d.to,(p,g)=>{l.push(O5.of({from:p,to:g}))})}catch(d){Se.debug("Invalid line numbers",{error:d})}l.length>0&&e.dispatch({effects:l})}var z4=class{constructor(e,t){let n=t.get();this.decorations=Mw(e.state,n),Nw(e,n),this.unsubscribe=t.sub(i=>{let o=this.decorations.size;this.decorations=Mw(e.state,i),Nw(e,i),o!==this.decorations.size&&e.dispatch({userEvent:"marimo.error-decoration-update"})})}update(e){this.decorations=this.decorations.map(e.changes)}destroy(){this.unsubscribe()}};function F4(e){return Cr.define(t=>new z4(t,e),{decorations:t=>t.decorations})}function $4(e){return[F4(e),At.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 V4({cellId:e,hotkeys:t}){let n=[];return n.push(...jC({key:t.getHotkey("cell.run").key,preventDefault:!0,stopPropagation:!0,run:i=>(i.state.facet(Lt).onRun(),!0)}),{key:t.getHotkey("cell.runAndNewBelow").key,preventDefault:!0,stopPropagation:!0,run:i=>{let o=i.state.facet(Lt);return o.onRun(),e==="__scratch__"||(i.contentDOM.blur(),o.moveToNextCell({cellId:e,before:!1})),!0}},...jC({key:t.getHotkey("cell.runAndNewAbove").key,preventDefault:!0,stopPropagation:!0,run:i=>{let o=i.state.facet(Lt);return o.onRun(),e==="__scratch__"||(i.contentDOM.blur(),o.moveToNextCell({cellId:e,before:!0})),!0}}),{key:t.getHotkey("cell.aiCompletion").key,preventDefault:!0,stopPropagation:!0,run:i=>(i.state.facet(Lt).aiCellCompletion()&&i.contentDOM.focus(),!0)}),e!=="__scratch__"&&n.push({key:t.getHotkey("cell.goToDefinition").key,run:i=>Sf(i)},{key:t.getHotkey("cell.delete").key,preventDefault:!0,stopPropagation:!0,run:i=>(i.state.doc.length===0&&i.state.facet(Lt).deleteCell(),!0)},{key:t.getHotkey("cell.moveUp").key,preventDefault:!0,stopPropagation:!0,run:i=>(i.state.facet(Lt).moveCell({cellId:e,before:!0}),!0)},{key:t.getHotkey("cell.moveDown").key,preventDefault:!0,stopPropagation:!0,run:i=>(i.state.facet(Lt).moveCell({cellId:e,before:!1}),!0)},{key:t.getHotkey("cell.moveLeft").key,preventDefault:!0,stopPropagation:!0,run:i=>(i.state.facet(Lt).moveCell({cellId:e,before:!0,direction:"left"}),!0)},{key:t.getHotkey("cell.moveRight").key,preventDefault:!0,stopPropagation:!0,run:i=>(i.state.facet(Lt).moveCell({cellId:e,before:!1,direction:"right"}),!0)},{key:"ArrowUp",run:i=>lS(i.state)?!1:j0(i)?(i.state.facet(Lt).moveToNextCell({cellId:e,before:!0,noCreate:!0}),!0):!1},{key:"ArrowDown",run:i=>lS(i.state)?!1:q0(i)?(i.state.facet(Lt).moveToNextCell({cellId:e,before:!1,noCreate:!0}),!0):!1},{key:t.getHotkey("cell.focusDown").key,preventDefault:!0,stopPropagation:!0,run:i=>(i.state.facet(Lt).moveToNextCell({cellId:e,before:!1,noCreate:!0}),!0)},{key:t.getHotkey("cell.focusUp").key,preventDefault:!0,stopPropagation:!0,run:i=>(i.state.facet(Lt).moveToNextCell({cellId:e,before:!0,noCreate:!0}),!0)},{key:t.getHotkey("cell.sendToBottom").key,preventDefault:!0,stopPropagation:!0,run:i=>(i.state.facet(Lt).sendToBottom({cellId:e}),!0)},{key:t.getHotkey("cell.sendToTop").key,preventDefault:!0,stopPropagation:!0,run:i=>(i.state.facet(Lt).sendToTop({cellId:e}),!0)},{key:t.getHotkey("cell.createAbove").key,preventDefault:!0,stopPropagation:!0,run:i=>(i.contentDOM.blur(),i.state.facet(Lt).createNewCell({cellId:e,before:!0}),!0)},{key:t.getHotkey("cell.createBelow").key,preventDefault:!0,stopPropagation:!0,run:i=>(i.contentDOM.blur(),i.state.facet(Lt).createNewCell({cellId:e,before:!1}),!0)},{key:t.getHotkey("cell.hideCode").key,preventDefault:!0,stopPropagation:!0,run:i=>{var l;let o=i.state.facet(Lt).toggleHideCode();return cS(i),o?(i.contentDOM.blur(),(l=document.getElementById(lr.create(e)))==null||l.focus()):i.contentDOM.focus(),!0}},{key:t.getHotkey("cell.splitCell").key,preventDefault:!0,stopPropagation:!0,run:i=>{let o=i.state.facet(Lt);return o.splitCell({cellId:e}),o.moveToNextCell&&requestAnimationFrame(()=>{i.contentDOM.blur(),o.moveToNextCell({cellId:e,before:!1})}),!0}}),[Zd.high(Si.of(n))]}function H4(e){return[At.updateListener.of(t=>{if(t.docChanged){let n=t.transactions.some(u=>u.effects.some(d=>d.is(wl))),i=ci(t.view),o=t.view.state.facet(Lt),l=t.view.state.facet(aa);o.updateCellCode({cellId:l,code:i,formattingChange:n}),Me.get(Df).has(l)&&Me.set(ny)}}),kR(e)]}var B4=["input","delete","undo","redo"];function W4({docChanged:e,transactions:t,predicate:n=()=>!0,hasFocus:i=!1}){return!e||!n()||t.some(o=>o.effects.some(l=>l.is(wl)))?!1:t.some(o=>o.annotation(Xa)===void 0?B4.some(l=>o.isUserEvent(l))||i:!1)}function U4({predicate:e}){return At.updateListener.of(t=>{W4({docChanged:t.docChanged,transactions:t.transactions,predicate:e,hasFocus:t.view.hasFocus})&&t.view.state.facet(Lt).onRun()})}iT=function({cellId:e,hotkeys:t,cellActions:n}){let i=tl("debugger"),o=tl("line_timing");return[Lt.of(n),aa.of(e),V4({cellId:e,hotkeys:t}),H4(t),$4(pu(uO(e),Me)),i?P4(e,pu(D4(e),Me)):[],o?q4(pu(T4(e),Me)):i?I4(pu(E4(e),Me)):[]]};const mu=sr.define();var K4=20;function Q4(e){let{state:t,anchor:n,head:i}=e;if(i<n)return!1;let o=t.doc.lineAt(i).number,l=t.doc.lineAt(n).number,u=Math.max(l,o-K4+1),d=Math.max(n,t.doc.line(u).from),p=d>n,g=p?1:0,w=t.doc.iterRange(d,i);for(;;){let{value:x,done:S}=w.next();if(S)break;for(let E of x)if(E==="(")g++;else if(E===")"&&(g--,p?g<=0:g<0))return!1}return!0}function G4(e){return{...e,create:t=>{let{dom:n,...i}=e.create(t),o=document.createElement("div");return o.classList.add("mo-cm-tooltip"),o.append(n),{...i,dom:o}}}}Pf=li.define({create:()=>null,update(e,t){for(let n of t.effects)if(n.is(mu))return n.value;if(!e||t.selection&&!t.docChanged)return null;if(t.docChanged){let n=t.changes.mapPos(e.pos);return Q4({state:t.state,anchor:n,head:t.state.selection.main.head})?{...e,pos:n}:null}return e},provide:e=>QC.from(e)}),uT=function(e){return e.state.field(Pf,!1)?(e.dispatch({effects:mu.of(null)}),!0):!1};const jw=async e=>{var u,d;let t=e.state.doc.sliceString(0,e.pos),n=document.activeElement,i=null;if(n!==null){let p=lr.findElement(n);p!==null&&(i=lr.parse(p.id))}if(i===null)return Se.error("Failed to find active cell."),null;let o=await of.request({document:t,cellId:i});if(!o)return(u=e.view)==null||u.dispatch({effects:mu.of(null)}),null;let l=jp.asHoverTooltip({position:e.pos,message:o,limitToType:"tooltip"});return l&&Me.set(sf,{documentation:l.html??null}),(d=e.view)==null||d.dispatch({effects:mu.of(l?G4(l):null)}),l?null:jp.asCompletionResult(e.pos,o)};function X4(e){return t=>e.predicate(t.state)?e.completion(t):null}var J4=async e=>{let t=e.matchBefore(/:\w*$/);if(!e.explicit&&!t)return null;let n=await Y4();return{from:(t==null?void 0:t.from)??e.pos,options:n,validFor:/^[\w:]*$/}},Y4=Ur(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,n])=>({shortcode:n[0],label:n.map(i=>`:${i}`).join(" "),emoji:t,displayLabel:`${t} ${n[0].replaceAll("_"," ")}`,apply:t,type:"emoji"}))}),Z4=async e=>{let t=e.matchBefore(/::[\w-:]*$/);if(!e.explicit&&!t)return null;let n=await eI();return{from:(t==null?void 0:t.from)??e.pos,options:n,validFor:/^[\w-:]*$/}},eI=Ur(async()=>{let e=await fetch("https://unpkg.com/lucide-static@0.452.0/tags.json").then(n=>{if(!n.ok)throw Error("Failed to fetch Lucide icon list");return n.json()}).catch(()=>({})),t=n=>`https://cdn.jsdelivr.net/npm/lucide-static@0.452.0/icons/${n}.svg`;return Object.entries(e).map(([n,i])=>({label:`::${n}`,displayLabel:n,type:"lucide-icon",boost:10,apply:`::lucide:${n}::`,detail:i.join(", "),info:()=>{let o=document.createElement("img");return o.src=t(n),o.style.width="24px",o.style.height="24px",o}}))}),tI=e=>{let t=e.matchBefore(/\\\w*$/);return!e.explicit&&!t?null:{from:(t==null?void 0:t.from)??e.pos,options:nI(),validFor:/^[\w\\]*$/}},nI=Ur(()=>[["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,n])=>({label:`\\${e} ${n}`,displayLabel:e,type:"latex-symbol",boost:10,apply:`\\${e}`,info:()=>{let i=document.createElement("div");return i.textContent=`${t} ${n}`,i},detail:t})));const rI=[J4,Z4,tI];var iI=100;function rs(e){return!e.state.selection.main.empty}function Hp({view:e,selection:t,markup:n}){let i=[],o=!0;for(let l=t.from;l<=t.to;l++)if(!e.state.doc.lineAt(l).text.startsWith(n)){o=!1;break}for(let l=t.from;l<=t.to;){let u=e.state.doc.lineAt(l),d=u.text.startsWith(n);o?i.push({from:u.from,to:u.from+n.length,insert:qo.of([""])}):(d&&i.push({from:u.from,to:u.from+n.length,insert:qo.of([""])}),i.push({from:u.from,insert:qo.of([n])})),l=u.to+1}return i}function Bp({view:e,range:t,markupAfter:n,markupBefore:i}){if(t.empty){let g=e.state.wordAt(t.head);g&&(t=g)}let o=e.state.sliceDoc(t.from-i.length,t.from)===i,l=e.state.sliceDoc(t.to,t.to+n.length)===n,u=[];u.push(o?{from:t.from-i.length,to:t.from,insert:qo.of([""])}:{from:t.from,insert:qo.of(i.split(`
|
|
133
|
-
`))},l?{from:t.to,to:t.to+n.length,insert:
|
|
134
|
-
`))});let d=o?-i.length:i.length,p=l?-n.length:n.length;return{changes:u,range:xn.range(t.from+d,t.to+p)}}function aI(e){if(!rs(e))return!1;let t=Hp({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 oI(e){if(!rs(e))return!1;let t=e.state.changeByRange(n=>{if(n.empty){let i=e.state.wordAt(n.head);i&&(n=i)}return Bp({view:e,range:n,markupBefore:"**",markupAfter:"**"})});return e.dispatch(e.state.update(t,{scrollIntoView:!0,annotations:Xs.userEvent.of("input")})),e.focus(),!0}function qw(e){if(!rs(e))return!1;let t=e.state.changeByRange(n=>{if(n.empty){let o=e.state.wordAt(n.head);o&&(n=o)}let i=e.state.doc.lineAt(n.from).number!==e.state.doc.lineAt(n.to).number;return Bp({view:e,range:n,markupBefore:i?"```\n":"`",markupAfter:i?"\n```":"`"})});return e.dispatch(e.state.update(t,{scrollIntoView:!0,annotations:Xs.userEvent.of("input")})),e.focus(),!0}function sI(e){let t=e.state.changeByRange(n=>{if(n.empty){let i=e.state.wordAt(n.head);i&&(n=i)}return Bp({view:e,range:n,markupBefore:"_",markupAfter:"_"})});return e.dispatch(e.state.update(t,{scrollIntoView:!0,annotations:Xs.userEvent.of("input")})),e.focus(),!0}function zw(e,t="http://"){if(!rs(e))return!1;let n=e.state.changeByRange(o=>{let l=e.state.sliceDoc(o.from,o.to);return{changes:[{from:o.from,to:o.to,insert:`[${l}](${t})`}],range:o}});e.dispatch(e.state.update(n,{scrollIntoView:!0,annotations:Xs.userEvent.of("input")}));let{to:i}=n.selection.main;try{e.dispatch({selection:xn.create([xn.range(i+3,i+3+t.length),xn.cursor(i+3+t.length)])})}catch{}return e.focus(),!0}Fg=async function(e,t){var d;let n=new FileReader,i=await new Promise(p=>{n.onload=()=>p(n.result),n.readAsDataURL(t)}),o;try{if(i.startsWith("data:")){let p=prompt("We can save your image as a file. Enter a filename.",t.name),g=t.type.split("/")[1];if(p===null){let w=Math.round(i.length/1024);if(w>iI){Cc({title:"Content too large",description:`The content size is ${w} KB, which is too large to paste directly into the document.`});return}}else{p.trim()===""?p=t.name:p.endsWith(`.${g}`)||(p=`${p}.${g}`);let w=Me.get(ol),x=w?mS.dirname(w):null,S=x?`${x}/public`:"public",E=await Sr().sendCreateFileOrFolder({path:S,type:"file",name:p,file:t});E.success?(o=(d=E.info)==null?void 0:d.path,o&&x&&o.startsWith(x)&&(o=mS.rest(o,x).replaceAll("\\","/")),Cc({title:"Image uploaded successfully",description:`We've uploaded your image at ${o}`})):Cc({title:"Failed to upload image. Using raw base64 string."})}}}catch{Cc({title:"Failed to upload image. Using raw base64 string."})}let l=e.state.changeByRange(p=>{let g=e.state.sliceDoc(p.from,p.to);return g.trim()===""&&(g="alt"),{changes:[{from:p.from,to:p.to,insert:``}],range:p}});e.dispatch(e.state.update(l,{scrollIntoView:!0,annotations:Xs.userEvent.of("input")}));let{to:u}=l.selection.main;try{e.dispatch({selection:xn.create([xn.range(u+4,u+4+i.length),xn.cursor(u+4+i.length)])})}catch{}return e.focus(),!0},P0=async function(e,t){let n=await t.text(),i=e.state.changeByRange(o=>({changes:[{from:o.from,to:o.from,insert:n}],range:o}));return e.dispatch(e.state.update(i,{scrollIntoView:!0,annotations:Xs.userEvent.of("input")})),e.focus(),!0};function lI(e){if(!rs(e))return!1;let{changes:t}=e.state.changeByRange(n=>({range:n,changes:Hp({view:e,selection:n,markup:e.state.sliceDoc(n.from,n.to+2).startsWith("* ")?"* ":"- "})}));return t.length>0&&e.dispatch(e.state.update({changes:t,scrollIntoView:!0,userEvent:"input"})),e.focus(),!0}function cI(e){if(!rs(e))return!1;let{changes:t}=e.state.changeByRange(n=>({range:n,changes:Hp({view:e,selection:n,markup:"1. "})}));return t.length>0&&e.dispatch(e.state.update({changes:t,scrollIntoView:!0,userEvent:"input"})),e.focus(),!0}function uI(e){return[Zd.highest(Si.of([{key:e.getHotkey("markdown.bold").key,stopPropagation:!0,run:oI},{key:e.getHotkey("markdown.italic").key,stopPropagation:!0,run:sI},{key:e.getHotkey("markdown.link").key,stopPropagation:!0,run:t=>zw(t)},{key:e.getHotkey("markdown.orderedList").key,run:cI},{key:e.getHotkey("markdown.unorderedList").key,run:lI},{key:e.getHotkey("markdown.blockquote").key,run:aI},{key:e.getHotkey("markdown.code").key,run:qw},{key:"`",run:qw}])),At.domEventHandlers({paste:(t,n)=>{var o;if(n.state.selection.main.empty)return!1;let i=(o=t.clipboardData)==null?void 0:o.getData("text/plain");i!=null&&i.startsWith("http")&&(t.preventDefault(),zw(n,i))}}),At.domEventHandlers({paste:(t,n)=>{var o;let i=(o=t.clipboardData)==null?void 0:o.files[0];if(!i)return!1;if(i.type.startsWith("image/"))return t.preventDefault(),Fg(n,i),!0;if(i.type.startsWith("text/"))return t.preventDefault(),P0(n,i),!0}})]}function dI(e,t,n=3,i=""){return Object.values(e).flatMap(o=>t.has(o.name)?[]:{label:`${i}${o.name}`,displayLabel:o.name,detail:o.dataType??"",boost:n,type:"variable",apply:`${i}${o.name}`,section:"Variable",info:()=>d0(o)})}d0=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 n=document.createElement("div");n.classList.add("flex","items-center","gap-2");let i=document.createElement("span");if(i.classList.add("font-bold","text-base"),i.textContent=e.name,n.append(i),e.dataType){let o=document.createElement("span");o.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"),o.textContent=e.dataType,n.append(o)}if(t.append(n),e.value){let o=document.createElement("div");o.classList.add("flex","flex-col","gap-1");let l=document.createElement("div");l.classList.add("text-xs","text-muted-foreground"),l.textContent="Value:",o.append(l);let u=document.createElement("div");u.classList.add("text-xs","font-mono","bg-muted","p-2","rounded","overflow-auto","max-h-40"),u.textContent=e.value,o.append(u),t.append(o)}return t};var is="Python",Wp=123,Fw=125,Up=1,fI={mark:`${is}Mark`,resolve:is};function pI(e,t){return{defineNodes:[{name:is,style:Yd.emphasis},{name:`${is}Mark`,style:Yd.processingInstruction}],parseInline:[{name:is,parse(n,i,o){return!t()||i!==Wp&&i!==Fw||i===Wp&&n.slice(o-1,o)==="{"?-1:n.addDelimiter(fI,o,o+Up,i===Wp,i===Fw)}}],wrap:tS(n=>{if(!t()||n.type.name!==is)return null;let i=n.from+Up,o=n.to-Up;return i>=o||i<0||o<0?null:{parser:e,overlay:[{from:i,to:o}],extensions:[pS().support]}})}}const mI=e=>{let t=e.state.doc.sliceString(0,e.pos),n=t.lastIndexOf("{");if(t.at(n-1)==="{"||n===-1||t.indexOf("}",n)>n)return null;let i=e.matchBefore(/\w*$/);if(!i)return null;let o=dI(Me.get(Qa),new Set,99);return{from:i.from,options:o,validFor:/^\w*$/}};var hu="InlineMathDollar",as="InlineMathBracket",gu="BlockMathDollar",os="BlockMathBracket",ro={[hu]:1,[as]:3,[gu]:2,[os]:3},Ft={DOLLAR:36,BACKSLASH:92,OPEN_PAREN:40,CLOSE_PAREN:41,OPEN_BRACKET:91,CLOSE_BRACKET:93},ss=Object.keys(ro).reduce((e,t)=>(e[t]={mark:`${t}Mark`,resolve:t},e),{});function hI(e){let t=[];return Object.keys(ro).forEach(n=>{t.push({name:n,style:Yd.emphasis},{name:`${n}Mark`,style:Yd.processingInstruction})}),{defineNodes:t,parseInline:[{name:gu,parse(n,i,o){return i!==Ft.DOLLAR||n.char(o+1)!==Ft.DOLLAR?-1:n.addDelimiter(ss[gu],o,o+ro[gu],!0,!0)}},{name:hu,parse(n,i,o){return i!==Ft.DOLLAR||n.char(o+1)===Ft.DOLLAR?-1:n.addDelimiter(ss[hu],o,o+ro[hu],!0,!0)}},{name:as,before:"Escape",parse(n,i,o){return i!==Ft.BACKSLASH||n.char(o+1)!==Ft.BACKSLASH||![Ft.OPEN_PAREN,Ft.CLOSE_PAREN].includes(n.char(o+2))?-1:n.addDelimiter(ss[as],o,o+ro[as],n.char(o+2)===Ft.OPEN_PAREN,n.char(o+2)===Ft.CLOSE_PAREN)}},{name:os,before:"Escape",parse(n,i,o){return i!==Ft.BACKSLASH||n.char(o+1)!==Ft.BACKSLASH||![Ft.OPEN_BRACKET,Ft.CLOSE_BRACKET].includes(n.char(o+2))?-1:n.addDelimiter(ss[os],o,o+ro[os],n.char(o+2)===Ft.OPEN_BRACKET,n.char(o+2)===Ft.CLOSE_BRACKET)}},{name:as,before:"Escape",parse(n,i,o){return i!==Ft.BACKSLASH||![Ft.OPEN_PAREN,Ft.CLOSE_PAREN].includes(n.char(o+1))?-1:n.addDelimiter(ss[as],o,o+2,n.char(o+1)===Ft.OPEN_PAREN,n.char(o+1)===Ft.CLOSE_PAREN)}},{name:os,before:"Escape",parse(n,i,o){return i!==Ft.BACKSLASH||![Ft.OPEN_BRACKET,Ft.CLOSE_BRACKET].includes(n.char(o+1))?-1:n.addDelimiter(ss[os],o,o+2,n.char(o+1)===Ft.OPEN_BRACKET,n.char(o+1)===Ft.CLOSE_BRACKET)}}],wrap:tS(n=>{let i=ro[n.type.name];if(i){let o=n.from+i,l=n.to-i;return o>=l||o<0||l<0?null:{parser:e,overlay:[{from:o,to:l}]}}return null})}}wf=sr.define(),_f=sr.define(),Ei=li.define({create:()=>({}),update:(e,t)=>{for(let n of t.effects){if(n.is(wf))return n.value;if(n.is(_f))return{...e,...n.value}}return e}}),tT=!0,df=class{constructor(){pe(this,"parser",new If);pe(this,"type","markdown");pe(this,"defaultCode",this.parser.defaultCode);pe(this,"defaultMetadata",this.parser.defaultMetadata)}static fromMarkdown(e){return If.fromMarkdown(e)}transformIn(e){let t=this.parser.transformIn(e);return[t.code,t.offset,t.metadata]}transformOut(e,t){let n=this.parser.transformOut(e,t);return[n.code,n.offset]}isSupported(e){return this.parser.isSupported(e)}getExtension(e,t,n,i){let o=dS().language.data,l,u=()=>{var p;if(!l)return!0;let d=l==null?void 0:l.state.field(Ei);return d===void 0?!1:((p=d.quotePrefix)==null?void 0:p.includes("f"))??!1};return[Cr.define(d=>(l=d,{})),dS({base:L6,codeLanguages:UD,extensions:[hI(eS.define(M6).parser),pI(jg.parser,u)]}),uI(n),rI.map(d=>o.of({autocomplete:d})),pS().language.data.of({autocomplete:X4({completion:jw,predicate:u})}),ef({defaultKeymap:!1,activateOnTyping:!0}),U4({predicate:()=>!u()})]}};const _n={PREFIX:"file:///",of(e){return`${this.PREFIX}${e}`},is(e){return e.startsWith(this.PREFIX)},parse(e){return Vn(this.is(e),`Invalid cell document URI: ${e}`),e.slice(this.PREFIX.length)}};function $w(e){return"notify"in e&&typeof e.notify=="function"}function gI(e){return"processNotification"in e&&typeof e.processNotification=="function"}function yI(e){return _n.is(e)?Me.get(Oc).inOrderIds.includes(_n.parse(e)):!1}function yu(){var e;return((e=Me.get(Nc))==null?void 0:e.rootUri)??"file:///"}function vu(){var t;let e=(t=Me.get(Nc))==null?void 0:t.rootUri;return e?[{uri:e,name:"marimo"}]:[]}function Vw(){var e;return((e=Me.get(Nc))==null?void 0:e.documentUri)??"file:///__marimo_notebook__.py"}function vI(e){return ki.filter(e,t=>t!==!1&&t!==null)}function Hw(e){let t=e.map(vI);return Object.assign({},...t)}var bI=class{constructor(e){pe(this,"clients",[]);this.clients=e,this.documentUri=Vw()}onNotification(e){let t=[];for(let n of this.clients)t.push(n.onNotification(e));return()=>{for(let n of t)n();return!0}}get clientCapabilities(){return Hw(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 Hw(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})}firstWithMethod(e){return this.clients.find(t=>t.hasCapability(e))}clientsWithMethod(e){return this.clients.filter(t=>t.hasCapability(e))}hasCapability(e){return this.clients.some(t=>t.hasCapability(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){await Promise.all(this.clients.map(t=>t.textDocumentDidChange(e)))}async completionItemResolve(e){let t=this.firstWithMethod("textDocument/completion");return t?t.completionItemResolve(e):e}async textDocumentCodeAction(e){let t=this.firstWithMethod("textDocument/codeAction");return t?t.textDocumentCodeAction(e):null}async codeActionResolve(e){let t=this.firstWithMethod("textDocument/codeAction");return t?t.codeActionResolve(e):e}async textDocumentRename(e){let t=this.firstWithMethod("textDocument/rename");return t?t.textDocumentRename(e):null}async textDocumentPrepareRename(e){let t=this.firstWithMethod("textDocument/prepareRename");return t?t.textDocumentPrepareRename(e):null}async textDocumentSignatureHelp(e){let t=this.firstWithMethod("textDocument/signatureHelp");return t?t.textDocumentSignatureHelp(e):null}async textDocumentCompletion(e){let t=this.clientsWithMethod("textDocument/completion");return wI(await Promise.allSettled(t.map(n=>n.textDocumentCompletion(e))))}async textDocumentDefinition(e){let t=this.firstWithMethod("textDocument/definition");return t?t.textDocumentDefinition(e):null}async textDocumentDidOpen(e){return(await Promise.all(this.clients.map(t=>t.textDocumentDidOpen(e)))).some(t=>t!==!1)}async textDocumentDidClose(e){await Promise.all(this.clients.map(t=>t.textDocumentDidClose(e)))}async textDocumentWillSave(e){await Promise.all(this.clients.map(t=>t.textDocumentWillSave(e)))}async textDocumentWillSaveWaitUntil(e){var n;let t=await Promise.allSettled(this.clients.map(i=>i.textDocumentWillSaveWaitUntil(e)));for(let i of t)if(i.status==="fulfilled"&&((n=i.value)!=null&&n.length))return i.value;return null}async textDocumentDidSave(e){await Promise.all(this.clients.map(t=>t.textDocumentDidSave(e)))}async textDocumentHover(e){for(let t of this.clients){if(!t.hasCapability("textDocument/hover"))continue;let n=await t.textDocumentHover(e);if(n)return n}return{contents:[]}}};function wI(e){let t=[],n=!1;for(let i of e)if(i.status==="fulfilled"){let o=i.value;if(o==null)continue;Array.isArray(o)&&t.push(...o),"items"in o&&(t.push(...o.items),n||(n=o.isIncomplete))}return{items:t,isIncomplete:n}}function xI(e){let t=fS.parse(e),n="";return V5(e,t,A5,(i,o)=>{let l=i.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");n+=o?`<span class="${o}">${l}</span>`:l},()=>{n+=`
|
|
135
|
-
`}),n}function _I(){let e=new
|
|
136
|
-
`:t(n):""},n=>
|
|
137
|
-
`)};function kI(e){return U0().map(t=>{let n=ci(t);return n===e?null:n}).filter(Boolean).toSorted((t,n)=>t.startsWith("import")&&!n.startsWith("import")?-1:!t.startsWith("import")&&n.startsWith("import")?1:0)}var CI=
|
|
132
|
+
`||E=="\r")E="\xA0";else if(E==" "){E="\xA0";var g=t.coordsAtPos(l+1,-1);g&&(P=g.left-(g.left-T.left)/parseInt(V.tabSize))}else/[\uD800-\uDBFF]/.test(E)&&l<t.state.doc.length-1&&(E+=t.state.sliceDoc(l+1,l+2));let me=T.bottom-T.top;return new e4((P-O.left)/t.scaleX,(T.top-O.top+me*(1-d))/t.scaleY,me*d/t.scaleY,V.fontFamily,V.fontSize,V.fontWeight,V.color,i?"cm-fat-cursor cm-cursor-primary":"cm-fat-cursor cm-cursor-secondary",E,d!=1)}else return null}let xw,_w,kw,Cw;xw=typeof navigator<"u"&&/linux/i.test(navigator.platform)&&/ Gecko\/\d+/.exec(navigator.userAgent),ra=HR(nt),_w=250,kw=At.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"}}),Cw=Cr.fromClass(class{constructor(e){this.status="",this.query=null,this.decorations=Xt.none,this.waitForCopy=!1,this.lastKeydown="",this.useNextTextInput=!1,this.compositionText="",this.view=e;let t=this.cm=new nt(e);ra.enterVimMode(this.cm),this.view.cm=this.cm,this.cm.state.vimPlugin=this,this.blockCursor=new t4(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",n=>{t.state.vim&&(t.state.vim.mode=n.mode,n.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:Sw.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=n=>{ra.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 n of e.transactions)for(let i of n.effects)if(i.is(Ag))if(!((t=i.value)!=null&&t.forVim))this.highlight(null);else{let o=i.value.create();this.highlight(o)}}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 n=this.cm.state.dialog;if(n)n.parentElement!=e&&(e.textContent="",e.appendChild(n));else{e.textContent="";var i=(t.mode||"normal").toUpperCase();t.insertModeReturn&&(i+="(C-O)"),this.statusButton.textContent=`--${i}--`,e.appendChild(this.statusButton),e.appendChild(this.spacer)}this.dom.textContent=t.status,e.appendChild(this.dom)}destroy(){ra.leaveVimMode(this.cm),this.updateClass(),this.blockCursor.destroy(),delete this.view.cm}highlight(e){if(this.query=e,!e)return this.decorations=Xt.none;let{view:t}=this,n=new _c;for(let i=0,o=t.visibleRanges,l=o.length;i<l;i++){let{from:u,to:d}=o[i];for(;i<l-1&&d>o[i+1].from-2*_w;)d=o[++i].to;e.highlight(t.state,u,d,(p,g)=>{n.add(p,g,s4)})}return this.decorations=n.finish()}handleKey(e,t){let n=this.cm,i=n.state.vim;if(!i)return;let o=ra.vimKeyFromEvent(e,i);if(nt.signal(this.cm,"inputEvent",{type:"handleKey",key:o}),!o)return;if(o=="<Esc>"&&!i.insertMode&&!i.visualMode&&this.query){let u=i.searchState_;u&&(n.removeOverlay(u.getOverlay()),u.setOverlay(null))}if(o==="<C-c>"&&!nt.isMac&&n.somethingSelected())return this.waitForCopy=!0,!0;i.status=(i.status||"")+o;let l=ra.multiSelectHandleKey(n,o,"user");return i=ra.maybeInitVimState_(n),!l&&i.insertMode&&n.state.overwrite&&(e.key&&e.key.length==1&&!/\n/.test(e.key)?(l=!0,n.overWriteSelection(e.key)):e.key=="Backspace"&&(l=!0,nt.commands.cursorCharLeft(n))),l&&(nt.signal(this.cm,"vim-keypress",o),e.preventDefault(),e.stopPropagation(),this.blockCursor.scheduleRedraw()),this.updateStatus(),!!l}},{eventHandlers:{copy:function(e,t){this.waitForCopy&&(this.waitForCopy=!1,Promise.resolve().then(()=>{var n=this.cm,i=n.state.vim;i&&(i.insertMode?n.setSelection(n.getCursor(),n.getCursor()):n.operation(()=>{n.curOp&&(n.curOp.isVimOp=!0),ra.handleKey(n,"<Esc>","user")}))}))},compositionstart:function(e,t){this.useNextTextInput=!0,nt.signal(this.cm,"inputEvent",e)},compositionupdate:function(e,t){nt.signal(this.cm,"inputEvent",e)},compositionend:function(e,t){nt.signal(this.cm,"inputEvent",e)},keypress:function(e,t){nt.signal(this.cm,"inputEvent",e),this.lastKeydown=="Dead"&&this.handleKey(e,t)},keydown:function(e,t){nt.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:()=>[At.inputHandler.of((e,t,n,i)=>{var w,x;var o=Ec(e);if(!o)return!1;var l=(w=o.state)==null?void 0:w.vim,u=o.state.vimPlugin;if(l&&!l.insertMode&&!((x=o.curOp)!=null&&x.isVimOp)){if(i==="\0\0")return!0;if(nt.signal(o,"inputEvent",{type:"text",text:i,from:t,to:n}),i.length==1&&u.useNextTextInput){if(l.expectLiteralNext&&e.composing)return u.compositionText=i,!1;if(u.compositionText){var d=u.compositionText;u.compositionText="";var p=e.state.selection.main.head;if(d===e.state.sliceDoc(p-d.length,p)){var g=o.getCursor();o.replaceRange("",o.posFromIndex(p-d.length),g)}}return u.handleKey({key:i,preventDefault:()=>{},stopPropagation:()=>{}}),o4(e),!0}}return!1})],decorations:e=>e.decorations});function o4(e){var t=e.scrollDOM.parentElement;if(t){if(xw){e.contentDOM.textContent="\0\0",e.contentDOM.dispatchEvent(new CustomEvent("compositionend"));return}var n=e.scrollDOM.nextSibling,i=window.getSelection(),o=i&&{anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset};e.scrollDOM.remove(),t.insertBefore(e.scrollDOM,n);try{o&&i&&(i.setPosition(o.anchorNode,o.anchorOffset),o.focusNode&&i.extend(o.focusNode,o.focusOffset))}catch(l){console.error(l)}e.focus(),e.contentDOM.dispatchEvent(new CustomEvent("compositionend"))}}var s4=Xt.mark({class:"cm-searchMatch"}),Sw=sr.define(),l4=li.define({create:()=>!1,update(e,t){for(let n of t.effects)n.is(Sw)&&(e=n.value);return e},provide:e=>Rg.from(e,t=>t?c4:null)});function c4(e){let t=document.createElement("div");t.className="cm-vim-panel";let n=e.cm;return n.state.dialog&&t.appendChild(n.state.dialog),{top:!1,dom:t}}function u4(e){let t=document.createElement("div");t.className="cm-vim-panel";let n=e.cm;return n.state.statusbar=t,n.state.vimPlugin.updateStatus(),{dom:t}}vT=function(e={}){return[kw,Cw,r4,e.status?Rg.of(u4):l4]},Ec=function(e){return e.cm||null},j0=function(e){let t=e.state.selection.main;return t.from===0&&t.to===0},q0=function(e,t=!1){let n=e.state.selection.main,i=e.state.doc.length;return t&&n.from===i-1&&n.to===i-1?!0:n.from===i&&n.to===i},dy=function(e){e&&e.dispatch({selection:{anchor:e.state.doc.length,head:e.state.doc.length}})},WE=function(e){requestAnimationFrame(()=>{var n;let t=(n=e.current)==null?void 0:n.view;t&&(t.focus(),dy(t))})},I0=function(e){let t=e.dom.closest(".marimo-cell");t&&requestAnimationFrame(()=>{t.scrollIntoView({behavior:"instant",block:"nearest",inline:"nearest"})})},fE=function(e){var t;return((t=Ec(e))==null?void 0:t.state.vim)!=null},hT=function(e){var n;let t=(n=Ec(e))==null?void 0:n.state.vim;return t?!t.mode&&!t.insertMode&&!t.visualMode?!0:t.mode==="normal":!1},xT=function(e){e&&e.dispatch({selection:{anchor:0,head:e.state.doc.length}})};var d4=new Set([Ee.ClassDefinition]);function Ew(e,t){requestAnimationFrame(()=>{e.focus(),e.dispatch({selection:{anchor:t,head:t},effects:At.scrollIntoView(t,{y:"center"})})}),I0(e)}function f4(e,t){let n=Dg(e),i=null;return n.iterate({enter:o=>{if(i!==null)return!1;if(o.name===Ee.VariableName&&e.doc.sliceString(o.from,o.to)===t)return i=o.from,!1;if(o.name===Ee.Comment||o.name===Ee.String)return!1}}),i}function p4(e,t){let n=[],i=e.resolveInner(t,0);for(;i;)rl.has(i.name)&&(n.some(o=>o.type===Ee.FunctionDefinition||o.type===Ee.LambdaExpression)&&i.name===Ee.ClassDefinition||n.push({id:i.from,type:i.name})),i=i.parent;return n.push({id:-1,type:"global"}),n}function _l(e,t,n){e.push({scopeId:t,from:n})}function m4(e,t){if(e.firstChild())do t(e.node);while(e.nextSibling())}function $p(e,t){let{state:n,variableName:i,scopeId:o,declarations:l}=t;switch(e.name){case Ee.VariableName:n.doc.sliceString(e.from,e.to)===i&&_l(l,o,e.from);break;case Ee.TupleExpression:case Ee.ArrayExpression:{let u=e.node.cursor();u.firstChild();do $p(u,t);while(u.nextSibling());break}default:break}}function Tw(e,t){let{state:n,variableName:i,scopeId:o,declarations:l}=t,u=e.cursor();u.firstChild();do{if(u.name!==Ee.ParamList)continue;let d=u.node.cursor();d.firstChild();do d.name===Ee.VariableName&&n.doc.sliceString(d.from,d.to)===i&&_l(l,o,d.from);while(d.nextSibling())}while(u.nextSibling())}function h4(e,t){let n=e.cursor();n.firstChild();let i=!1;do if(n.name===Xn.For)i=!0;else{if(i&&n.name===Xn.In)break;i&&$p(n,t)}while(n.nextSibling())}function Dw(e,t){let{state:n,variableName:i,scopeStack:o,declarations:l}=t,u=e.cursor(),d=u.name,p=u.from,g=rl.has(d)?[...o,p]:o,w=g[g.length-1]??-1;switch(d){case Ee.FunctionDefinition:case Ee.ClassDefinition:{let x=e.cursor();x.firstChild();do if(x.name===Ee.VariableName&&n.doc.sliceString(x.from,x.to)===i){_l(l,o[o.length-1]??-1,x.from);break}while(x.nextSibling());d===Ee.FunctionDefinition&&Tw(e,{state:n,variableName:i,scopeId:p,declarations:l});break}case Ee.LambdaExpression:Tw(e,{state:n,variableName:i,scopeId:p,declarations:l});break;case Ee.ArrayComprehensionExpression:case Ee.DictionaryComprehensionExpression:case Ee.SetComprehensionExpression:case Ee.ComprehensionExpression:case Ee.ForStatement:h4(e,{state:n,variableName:i,scopeId:w,declarations:l});break;case Ee.AssignStatement:{let x=[],S=e.cursor();S.firstChild();do S.name===Ee.AssignOp&&x.push(S.from);while(S.nextSibling());let E=x[x.length-1];if(E===void 0)break;let T=e.cursor();T.firstChild();do T.from<E&&$p(T,{state:n,variableName:i,scopeId:w,declarations:l});while(T.nextSibling());break}case Ee.ImportStatement:{let x=e.cursor();x.firstChild();let S=!1,E=null,T=()=>{E!=null&&E.matches&&_l(l,w,E.from),E=null};do{if(x.name===Xn.Import){S=!0;continue}if(S){if(x.name===Xn.As){E=null;continue}x.name===Ee.VariableName?(T(),E={from:x.from,matches:n.doc.sliceString(x.from,x.to)===i}):x.name===","&&T()}}while(x.nextSibling());T();break}case Ee.TryStatement:case Ee.WithStatement:{let x=e.cursor();x.firstChild();let S=!1;do x.name===Xn.As?S=!0:S&&x.name===Ee.VariableName&&n.doc.sliceString(x.from,x.to)===i&&(_l(l,w,x.from),S=!1);while(x.nextSibling());break}default:break}m4(u,x=>{Dw(x,{state:n,variableName:i,scopeStack:g,declarations:l})})}function g4(e,t,n){let i=Dg(e),o=[];Dw(i,{state:e,variableName:t,scopeStack:[],declarations:o});let l=Math.max(0,Math.min(n,e.doc.length));for(let u of p4(i,l)){let d=o.filter(p=>p.scopeId===u.id).filter(p=>d4.has(u.type)?p.from<=l:!0).toSorted((p,g)=>p.from-g.from)[0];if(d)return d.from}return null}jc=function(e,t,n){let{state:i}=e,o=n===void 0?f4(i,t):g4(i,t,n);return o===null?!1:(Ew(e,o),!0)};function y4(e,t){return Ew(e,e.state.doc.line(t).from),!0}function v4(e,t){let n=Me.get(r5);return(n==="mac"?e.mac??e.key:n==="windows"?e.win??e.key:e.linux??e.key)===t}function b4(e){let{from:t,to:n}=e.selection.main;if(t===n){let{startToken:i,endToken:o}=qp(e.doc,t);return{position:i,word:e.doc.sliceString(i,o)}}return{position:t,word:e.doc.sliceString(t,n)}}function w4(e,t){if(!t)return null;let n=e[t];return!n||n.declaredBy.length===0?null:n.declaredBy[0]}function x4(e){return e.startsWith("_")}Ef=function(e){let{state:t}=e,{position:n,word:i}=b4(t);return i?(cS(e),e.dispatch({effects:$5}),k4(e,i,n)):!1};function _4(e,t=Me.get(i5).getHotkey("cell.goToDefinition").key){var n;for(let i of e.state.facet(Si).flat())if(v4(i,t)&&((n=i.run)!=null&&n.call(i,e)))return!0;return!1}LE=function(e){return Ef(e)?!0:_4(e)};function k4(e,t,n){if(n!==void 0&&jc(e,t,n))return!0;let i=C4(e,t);return i?jc(i,t):!1}fT=function(e,t){let n=Rw(e);return n?y4(n,t):!1};function C4(e,t){if(x4(t))return e;let n=w4(Me.get(Ga),t);return n?Rw(n):null}function Rw(e){var t;return((t=Me.get(ft).cellHandles[e].current)==null?void 0:t.editorView)??null}const kl=Ne(null);CE=function(e){let t=Me.get(kl);if(e===null){Me.set(kl,null);return}(t==null?void 0:t.cellId)===e.cellId&&t.line===e.line||Me.set(kl,{...e,startedAtMs:Date.now()})};const ns=Ne(new Map);var S4=new Set;function E4(e){return Ne(t=>{let n=t(kl);return(n==null?void 0:n.cellId)===e?n.line:null})}function T4(e){return Ne(t=>{let n=t(kl);return(n==null?void 0:n.cellId)===e?{line:n.line,startedAtMs:n.startedAtMs}:null})}function D4(e){return Ne(t=>t(ns).get(e)??S4)}function Vp(e){let t={};for(let[n,i]of e)i.size>0&&(t[n]=[...i].toSorted((o,l)=>o-l));Sr().sendSetBreakpoints({breakpoints:t}).catch(n=>{Se.debug("Failed to sync breakpoints to kernel",{error:n})})}GE=function(e){let t=Me.get(ns);if(!t.has(e))return;let n=new Map(t);n.delete(e),Me.set(ns,n),Vp(n)},aT=function(){let e=Me.get(ns);e.size>0&&Vp(e)},K0=function(e,t){let n=Me.get(ns),i=new Map(n),o=new Set(i.get(e)??[]);o.has(t)?o.delete(t):o.add(t),o.size>0?i.set(e,o):i.delete(e),Me.set(ns,i),Vp(i)};function Iw(e,t){if(t==null||t<1||t>e.doc.lines)return Xt.none;let n=new _c;try{let i=e.doc.line(t);n.add(i.from,i.from,Xt.line({class:"cm-debugger-current-line"}))}catch(i){Se.debug("Invalid debugger line",{error:i})}return n.finish()}var R4=class{constructor(e,t){this.decorations=Iw(e.state,t.get()),this.unsubscribe=t.sub(n=>{this.decorations=Iw(e.state,n),e.dispatch({userEvent:"marimo.debugger-line-update"})})}update(e){this.decorations=this.decorations.map(e.changes)}destroy(){this.unsubscribe()}};function I4(e){return[Cr.define(t=>new R4(t,e),{decorations:t=>t.decorations}),At.theme({".cm-debugger-current-line":{backgroundColor:"color-mix(in srgb, var(--amber-4) 50%, transparent)"}})]}var Aw=new class extends ZC{toDOM(){let e=document.createElement("div");return e.className="cm-breakpoint-marker",e}},Lw=sr.define(),Pw=li.define({create:()=>new Set,update(e,t){for(let n of t.effects)if(n.is(Lw))return n.value;return e}});function A4(e){let t=e.field(Pw);if(t.size===0)return UC.empty;let n=new _c;for(let i of[...t].toSorted((o,l)=>o-l))if(i>=1&&i<=e.doc.lines){let o=e.doc.line(i);n.add(o.from,o.from,Aw)}return n.finish()}var L4=class{constructor(e,t){let n=i=>{e.dispatch({effects:Lw.of(i)})};t.get().size>0&&queueMicrotask(()=>n(t.get())),this.unsubscribe=t.sub(n)}destroy(){this.unsubscribe()}};function P4(e,t){return[Pw,Cr.define(n=>new L4(n,t)),YC({class:"cm-breakpoint-gutter",markers:n=>A4(n.state),initialSpacer:()=>Aw,domEventHandlers:{mousedown:(n,i)=>{let o=n.state.doc.lineAt(i.from).number;return K0(e,o),!0}}}),At.theme({".cm-breakpoint-gutter":{width:"14px",cursor:"pointer"},".cm-breakpoint-marker":{width:"8px",height:"8px",borderRadius:"50%",backgroundColor:"var(--red-9)",margin:"4px auto"}})]}z0=class Ff{static fromMilliseconds(t){return t==null?null:new Ff(t)}static fromSeconds(t){return t==null?null:new Ff(t*1e3)}static now(){return new Ff(Date.now())}constructor(t){this.ms=t}toMilliseconds(){return this.ms}toSeconds(){return this.ms/1e3}},D0=function(e){if(e===null)return"";let t=e,n=t/1e3;return n>=60?`${Math.floor(n/60)}m${Math.floor(n%60)}s`:n>=1?`${n.toFixed(2).toString()}s`:`${t.toFixed(0).toString()}ms`};var O4=500,M4=250,N4=(Di=class extends j5{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 n=()=>{let i=Date.now()-this.startedAtMs;t.textContent=i>=O4?D0(i):""};return n(),Di.intervals.set(t,window.setInterval(n,M4)),t}destroy(t){let n=Di.intervals.get(t);n!==void 0&&(window.clearInterval(n),Di.intervals.delete(t))}ignoreEvent(){return!0}},pe(Di,"intervals",new WeakMap),Di);function Ow(e,t){if(t===null||t.line<1||t.line>e.doc.lines)return Xt.none;let n=new _c;try{let i=e.doc.line(t.line);n.add(i.from,i.from,Xt.line({class:"cm-timing-current-line"})),n.add(i.to,i.to,Xt.widget({widget:new N4(t.startedAtMs),side:1}))}catch(i){Se.debug("Invalid timing line",{error:i})}return n.finish()}var j4=class{constructor(e,t){this.decorations=Ow(e.state,t.get()),this.unsubscribe=t.sub(n=>{this.decorations=Ow(e.state,n),e.dispatch({userEvent:"marimo.timing-line-update"})})}update(e){this.decorations=this.decorations.map(e.changes)}destroy(){this.unsubscribe()}};function q4(e){return[Cr.define(t=>new j4(t,e),{decorations:t=>t.decorations}),At.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 Mw(e,t){if(!(t!=null&&t.length))return Xt.none;let n=new _c,i=e.facet(oa),o=t.filter(l=>l.kind==="cell"&&l.cellId===i).toSorted((l,u)=>l.lineNumber-u.lineNumber);for(let l of o)try{let u=e.doc.line(l.lineNumber),d=Xt.line({class:"cm-error-line"});n.add(u.from,u.from,d)}catch(u){Se.debug("Invalid line number in error decoration",{error:u})}return n.finish()}function Nw(e,t){if(!(t!=null&&t.length))return;let n=e.state.facet(oa),i=t.filter(u=>u.kind==="cell"&&u.cellId===n);if(i.length===0)return;let o=q5(e.state),l=[];for(let u of i)try{let d=e.state.doc.line(u.lineNumber);o.between(d.from,d.to,(p,g)=>{l.push(O5.of({from:p,to:g}))})}catch(d){Se.debug("Invalid line numbers",{error:d})}l.length>0&&e.dispatch({effects:l})}var z4=class{constructor(e,t){let n=t.get();this.decorations=Mw(e.state,n),Nw(e,n),this.unsubscribe=t.sub(i=>{let o=this.decorations.size;this.decorations=Mw(e.state,i),Nw(e,i),o!==this.decorations.size&&e.dispatch({userEvent:"marimo.error-decoration-update"})})}update(e){this.decorations=this.decorations.map(e.changes)}destroy(){this.unsubscribe()}};function F4(e){return Cr.define(t=>new z4(t,e),{decorations:t=>t.decorations})}function $4(e){return[F4(e),At.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 V4({cellId:e,hotkeys:t}){let n=[];return n.push(...jC({key:t.getHotkey("cell.run").key,preventDefault:!0,stopPropagation:!0,run:i=>(i.state.facet(Lt).onRun(),!0)}),{key:t.getHotkey("cell.runAndNewBelow").key,preventDefault:!0,stopPropagation:!0,run:i=>{let o=i.state.facet(Lt);return o.onRun(),e==="__scratch__"||(i.contentDOM.blur(),o.moveToNextCell({cellId:e,before:!1})),!0}},...jC({key:t.getHotkey("cell.runAndNewAbove").key,preventDefault:!0,stopPropagation:!0,run:i=>{let o=i.state.facet(Lt);return o.onRun(),e==="__scratch__"||(i.contentDOM.blur(),o.moveToNextCell({cellId:e,before:!0})),!0}}),{key:t.getHotkey("cell.aiCompletion").key,preventDefault:!0,stopPropagation:!0,run:i=>(i.state.facet(Lt).aiCellCompletion()&&i.contentDOM.focus(),!0)}),e!=="__scratch__"&&n.push({key:t.getHotkey("cell.goToDefinition").key,run:i=>Ef(i)},{key:t.getHotkey("cell.delete").key,preventDefault:!0,stopPropagation:!0,run:i=>(i.state.doc.length===0&&i.state.facet(Lt).deleteCell(),!0)},{key:t.getHotkey("cell.moveUp").key,preventDefault:!0,stopPropagation:!0,run:i=>(i.state.facet(Lt).moveCell({cellId:e,before:!0}),!0)},{key:t.getHotkey("cell.moveDown").key,preventDefault:!0,stopPropagation:!0,run:i=>(i.state.facet(Lt).moveCell({cellId:e,before:!1}),!0)},{key:t.getHotkey("cell.moveLeft").key,preventDefault:!0,stopPropagation:!0,run:i=>(i.state.facet(Lt).moveCell({cellId:e,before:!0,direction:"left"}),!0)},{key:t.getHotkey("cell.moveRight").key,preventDefault:!0,stopPropagation:!0,run:i=>(i.state.facet(Lt).moveCell({cellId:e,before:!1,direction:"right"}),!0)},{key:"ArrowUp",run:i=>lS(i.state)?!1:j0(i)?(i.state.facet(Lt).moveToNextCell({cellId:e,before:!0,noCreate:!0}),!0):!1},{key:"ArrowDown",run:i=>lS(i.state)?!1:q0(i)?(i.state.facet(Lt).moveToNextCell({cellId:e,before:!1,noCreate:!0}),!0):!1},{key:t.getHotkey("cell.focusDown").key,preventDefault:!0,stopPropagation:!0,run:i=>(i.state.facet(Lt).moveToNextCell({cellId:e,before:!1,noCreate:!0}),!0)},{key:t.getHotkey("cell.focusUp").key,preventDefault:!0,stopPropagation:!0,run:i=>(i.state.facet(Lt).moveToNextCell({cellId:e,before:!0,noCreate:!0}),!0)},{key:t.getHotkey("cell.sendToBottom").key,preventDefault:!0,stopPropagation:!0,run:i=>(i.state.facet(Lt).sendToBottom({cellId:e}),!0)},{key:t.getHotkey("cell.sendToTop").key,preventDefault:!0,stopPropagation:!0,run:i=>(i.state.facet(Lt).sendToTop({cellId:e}),!0)},{key:t.getHotkey("cell.createAbove").key,preventDefault:!0,stopPropagation:!0,run:i=>(i.contentDOM.blur(),i.state.facet(Lt).createNewCell({cellId:e,before:!0}),!0)},{key:t.getHotkey("cell.createBelow").key,preventDefault:!0,stopPropagation:!0,run:i=>(i.contentDOM.blur(),i.state.facet(Lt).createNewCell({cellId:e,before:!1}),!0)},{key:t.getHotkey("cell.hideCode").key,preventDefault:!0,stopPropagation:!0,run:i=>{var l;let o=i.state.facet(Lt).toggleHideCode();return cS(i),o?(i.contentDOM.blur(),(l=document.getElementById(lr.create(e)))==null||l.focus()):i.contentDOM.focus(),!0}},{key:t.getHotkey("cell.splitCell").key,preventDefault:!0,stopPropagation:!0,run:i=>{let o=i.state.facet(Lt);return o.splitCell({cellId:e}),o.moveToNextCell&&requestAnimationFrame(()=>{i.contentDOM.blur(),o.moveToNextCell({cellId:e,before:!1})}),!0}}),[ef.high(Si.of(n))]}function H4(e){return[At.updateListener.of(t=>{if(t.docChanged){let n=t.transactions.some(u=>u.effects.some(d=>d.is(wl))),i=ci(t.view),o=t.view.state.facet(Lt),l=t.view.state.facet(oa);o.updateCellCode({cellId:l,code:i,formattingChange:n}),Me.get(Rf).has(l)&&Me.set(ny)}}),kR(e)]}var B4=["input","delete","undo","redo"];function W4({docChanged:e,transactions:t,predicate:n=()=>!0,hasFocus:i=!1}){return!e||!n()||t.some(o=>o.effects.some(l=>l.is(wl)))?!1:t.some(o=>o.annotation(Ja)===void 0?B4.some(l=>o.isUserEvent(l))||i:!1)}function U4({predicate:e}){return At.updateListener.of(t=>{W4({docChanged:t.docChanged,transactions:t.transactions,predicate:e,hasFocus:t.view.hasFocus})&&t.view.state.facet(Lt).onRun()})}rT=function({cellId:e,hotkeys:t,cellActions:n}){let i=tl("debugger"),o=tl("line_timing");return[Lt.of(n),oa.of(e),V4({cellId:e,hotkeys:t}),H4(t),$4(mu(uO(e),Me)),i?P4(e,mu(D4(e),Me)):[],o?q4(mu(T4(e),Me)):i?I4(mu(E4(e),Me)):[]]};const hu=sr.define();var K4=20;function Q4(e){let{state:t,anchor:n,head:i}=e;if(i<n)return!1;let o=t.doc.lineAt(i).number,l=t.doc.lineAt(n).number,u=Math.max(l,o-K4+1),d=Math.max(n,t.doc.line(u).from),p=d>n,g=p?1:0,w=t.doc.iterRange(d,i);for(;;){let{value:x,done:S}=w.next();if(S)break;for(let E of x)if(E==="(")g++;else if(E===")"&&(g--,p?g<=0:g<0))return!1}return!0}function G4(e){return{...e,create:t=>{let{dom:n,...i}=e.create(t),o=document.createElement("div");return o.classList.add("mo-cm-tooltip"),o.append(n),{...i,dom:o}}}}Mf=li.define({create:()=>null,update(e,t){for(let n of t.effects)if(n.is(hu))return n.value;if(!e||t.selection&&!t.docChanged)return null;if(t.docChanged){let n=t.changes.mapPos(e.pos);return Q4({state:t.state,anchor:n,head:t.state.selection.main.head})?{...e,pos:n}:null}return e},provide:e=>QC.from(e)}),uT=function(e){return e.state.field(Mf,!1)?(e.dispatch({effects:hu.of(null)}),!0):!1};const jw=async e=>{var u,d;let t=e.state.doc.sliceString(0,e.pos),n=document.activeElement,i=null;if(n!==null){let p=lr.findElement(n);p!==null&&(i=lr.parse(p.id))}if(i===null)return Se.error("Failed to find active cell."),null;let o=await sf.request({document:t,cellId:i});if(!o)return(u=e.view)==null||u.dispatch({effects:hu.of(null)}),null;let l=jp.asHoverTooltip({position:e.pos,message:o,limitToType:"tooltip"});return l&&Me.set(lf,{documentation:l.html??null}),(d=e.view)==null||d.dispatch({effects:hu.of(l?G4(l):null)}),l?null:jp.asCompletionResult(e.pos,o)};function X4(e){return t=>e.predicate(t.state)?e.completion(t):null}var J4=async e=>{let t=e.matchBefore(/:\w*$/);if(!e.explicit&&!t)return null;let n=await Y4();return{from:(t==null?void 0:t.from)??e.pos,options:n,validFor:/^[\w:]*$/}},Y4=Ur(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,n])=>({shortcode:n[0],label:n.map(i=>`:${i}`).join(" "),emoji:t,displayLabel:`${t} ${n[0].replaceAll("_"," ")}`,apply:t,type:"emoji"}))}),Z4=async e=>{let t=e.matchBefore(/::[\w-:]*$/);if(!e.explicit&&!t)return null;let n=await eI();return{from:(t==null?void 0:t.from)??e.pos,options:n,validFor:/^[\w-:]*$/}},eI=Ur(async()=>{let e=await fetch("https://unpkg.com/lucide-static@0.452.0/tags.json").then(n=>{if(!n.ok)throw Error("Failed to fetch Lucide icon list");return n.json()}).catch(()=>({})),t=n=>`https://cdn.jsdelivr.net/npm/lucide-static@0.452.0/icons/${n}.svg`;return Object.entries(e).map(([n,i])=>({label:`::${n}`,displayLabel:n,type:"lucide-icon",boost:10,apply:`::lucide:${n}::`,detail:i.join(", "),info:()=>{let o=document.createElement("img");return o.src=t(n),o.style.width="24px",o.style.height="24px",o}}))}),tI=e=>{let t=e.matchBefore(/\\\w*$/);return!e.explicit&&!t?null:{from:(t==null?void 0:t.from)??e.pos,options:nI(),validFor:/^[\w\\]*$/}},nI=Ur(()=>[["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,n])=>({label:`\\${e} ${n}`,displayLabel:e,type:"latex-symbol",boost:10,apply:`\\${e}`,info:()=>{let i=document.createElement("div");return i.textContent=`${t} ${n}`,i},detail:t})));const rI=[J4,Z4,tI];var iI=100;function rs(e){return!e.state.selection.main.empty}function Hp({view:e,selection:t,markup:n}){let i=[],o=!0;for(let l=t.from;l<=t.to;l++)if(!e.state.doc.lineAt(l).text.startsWith(n)){o=!1;break}for(let l=t.from;l<=t.to;){let u=e.state.doc.lineAt(l),d=u.text.startsWith(n);o?i.push({from:u.from,to:u.from+n.length,insert:zo.of([""])}):(d&&i.push({from:u.from,to:u.from+n.length,insert:zo.of([""])}),i.push({from:u.from,insert:zo.of([n])})),l=u.to+1}return i}function Bp({view:e,range:t,markupAfter:n,markupBefore:i}){if(t.empty){let g=e.state.wordAt(t.head);g&&(t=g)}let o=e.state.sliceDoc(t.from-i.length,t.from)===i,l=e.state.sliceDoc(t.to,t.to+n.length)===n,u=[];u.push(o?{from:t.from-i.length,to:t.from,insert:zo.of([""])}:{from:t.from,insert:zo.of(i.split(`
|
|
133
|
+
`))},l?{from:t.to,to:t.to+n.length,insert:zo.of([""])}:{from:t.to,insert:zo.of(n.split(`
|
|
134
|
+
`))});let d=o?-i.length:i.length,p=l?-n.length:n.length;return{changes:u,range:xn.range(t.from+d,t.to+p)}}function aI(e){if(!rs(e))return!1;let t=Hp({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 oI(e){if(!rs(e))return!1;let t=e.state.changeByRange(n=>{if(n.empty){let i=e.state.wordAt(n.head);i&&(n=i)}return Bp({view:e,range:n,markupBefore:"**",markupAfter:"**"})});return e.dispatch(e.state.update(t,{scrollIntoView:!0,annotations:Xs.userEvent.of("input")})),e.focus(),!0}function qw(e){if(!rs(e))return!1;let t=e.state.changeByRange(n=>{if(n.empty){let o=e.state.wordAt(n.head);o&&(n=o)}let i=e.state.doc.lineAt(n.from).number!==e.state.doc.lineAt(n.to).number;return Bp({view:e,range:n,markupBefore:i?"```\n":"`",markupAfter:i?"\n```":"`"})});return e.dispatch(e.state.update(t,{scrollIntoView:!0,annotations:Xs.userEvent.of("input")})),e.focus(),!0}function sI(e){let t=e.state.changeByRange(n=>{if(n.empty){let i=e.state.wordAt(n.head);i&&(n=i)}return Bp({view:e,range:n,markupBefore:"_",markupAfter:"_"})});return e.dispatch(e.state.update(t,{scrollIntoView:!0,annotations:Xs.userEvent.of("input")})),e.focus(),!0}function zw(e,t="http://"){if(!rs(e))return!1;let n=e.state.changeByRange(o=>{let l=e.state.sliceDoc(o.from,o.to);return{changes:[{from:o.from,to:o.to,insert:`[${l}](${t})`}],range:o}});e.dispatch(e.state.update(n,{scrollIntoView:!0,annotations:Xs.userEvent.of("input")}));let{to:i}=n.selection.main;try{e.dispatch({selection:xn.create([xn.range(i+3,i+3+t.length),xn.cursor(i+3+t.length)])})}catch{}return e.focus(),!0}Fg=async function(e,t){var d;let n=new FileReader,i=await new Promise(p=>{n.onload=()=>p(n.result),n.readAsDataURL(t)}),o;try{if(i.startsWith("data:")){let p=prompt("We can save your image as a file. Enter a filename.",t.name),g=t.type.split("/")[1];if(p===null){let w=Math.round(i.length/1024);if(w>iI){Cc({title:"Content too large",description:`The content size is ${w} KB, which is too large to paste directly into the document.`});return}}else{p.trim()===""?p=t.name:p.endsWith(`.${g}`)||(p=`${p}.${g}`);let w=Me.get(ol),x=w?mS.dirname(w):null,S=x?`${x}/public`:"public",E=await Sr().sendCreateFileOrFolder({path:S,type:"file",name:p,file:t});E.success?(o=(d=E.info)==null?void 0:d.path,o&&x&&o.startsWith(x)&&(o=mS.rest(o,x).replaceAll("\\","/")),Cc({title:"Image uploaded successfully",description:`We've uploaded your image at ${o}`})):Cc({title:"Failed to upload image. Using raw base64 string."})}}}catch{Cc({title:"Failed to upload image. Using raw base64 string."})}let l=e.state.changeByRange(p=>{let g=e.state.sliceDoc(p.from,p.to);return g.trim()===""&&(g="alt"),{changes:[{from:p.from,to:p.to,insert:``}],range:p}});e.dispatch(e.state.update(l,{scrollIntoView:!0,annotations:Xs.userEvent.of("input")}));let{to:u}=l.selection.main;try{e.dispatch({selection:xn.create([xn.range(u+4,u+4+i.length),xn.cursor(u+4+i.length)])})}catch{}return e.focus(),!0},P0=async function(e,t){let n=await t.text(),i=e.state.changeByRange(o=>({changes:[{from:o.from,to:o.from,insert:n}],range:o}));return e.dispatch(e.state.update(i,{scrollIntoView:!0,annotations:Xs.userEvent.of("input")})),e.focus(),!0};function lI(e){if(!rs(e))return!1;let{changes:t}=e.state.changeByRange(n=>({range:n,changes:Hp({view:e,selection:n,markup:e.state.sliceDoc(n.from,n.to+2).startsWith("* ")?"* ":"- "})}));return t.length>0&&e.dispatch(e.state.update({changes:t,scrollIntoView:!0,userEvent:"input"})),e.focus(),!0}function cI(e){if(!rs(e))return!1;let{changes:t}=e.state.changeByRange(n=>({range:n,changes:Hp({view:e,selection:n,markup:"1. "})}));return t.length>0&&e.dispatch(e.state.update({changes:t,scrollIntoView:!0,userEvent:"input"})),e.focus(),!0}function uI(e){return[ef.highest(Si.of([{key:e.getHotkey("markdown.bold").key,stopPropagation:!0,run:oI},{key:e.getHotkey("markdown.italic").key,stopPropagation:!0,run:sI},{key:e.getHotkey("markdown.link").key,stopPropagation:!0,run:t=>zw(t)},{key:e.getHotkey("markdown.orderedList").key,run:cI},{key:e.getHotkey("markdown.unorderedList").key,run:lI},{key:e.getHotkey("markdown.blockquote").key,run:aI},{key:e.getHotkey("markdown.code").key,run:qw},{key:"`",run:qw}])),At.domEventHandlers({paste:(t,n)=>{var o;if(n.state.selection.main.empty)return!1;let i=(o=t.clipboardData)==null?void 0:o.getData("text/plain");i!=null&&i.startsWith("http")&&(t.preventDefault(),zw(n,i))}}),At.domEventHandlers({paste:(t,n)=>{var o;let i=(o=t.clipboardData)==null?void 0:o.files[0];if(!i)return!1;if(i.type.startsWith("image/"))return t.preventDefault(),Fg(n,i),!0;if(i.type.startsWith("text/"))return t.preventDefault(),P0(n,i),!0}})]}function dI(e,t,n=3,i=""){return Object.values(e).flatMap(o=>t.has(o.name)?[]:{label:`${i}${o.name}`,displayLabel:o.name,detail:o.dataType??"",boost:n,type:"variable",apply:`${i}${o.name}`,section:"Variable",info:()=>d0(o)})}d0=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 n=document.createElement("div");n.classList.add("flex","items-center","gap-2");let i=document.createElement("span");if(i.classList.add("font-bold","text-base"),i.textContent=e.name,n.append(i),e.dataType){let o=document.createElement("span");o.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"),o.textContent=e.dataType,n.append(o)}if(t.append(n),e.value){let o=document.createElement("div");o.classList.add("flex","flex-col","gap-1");let l=document.createElement("div");l.classList.add("text-xs","text-muted-foreground"),l.textContent="Value:",o.append(l);let u=document.createElement("div");u.classList.add("text-xs","font-mono","bg-muted","p-2","rounded","overflow-auto","max-h-40"),u.textContent=e.value,o.append(u),t.append(o)}return t};var is="Python",Wp=123,Fw=125,Up=1,fI={mark:`${is}Mark`,resolve:is};function pI(e,t){return{defineNodes:[{name:is,style:Zd.emphasis},{name:`${is}Mark`,style:Zd.processingInstruction}],parseInline:[{name:is,parse(n,i,o){return!t()||i!==Wp&&i!==Fw||i===Wp&&n.slice(o-1,o)==="{"?-1:n.addDelimiter(fI,o,o+Up,i===Wp,i===Fw)}}],wrap:tS(n=>{if(!t()||n.type.name!==is)return null;let i=n.from+Up,o=n.to-Up;return i>=o||i<0||o<0?null:{parser:e,overlay:[{from:i,to:o}],extensions:[pS().support]}})}}const mI=e=>{let t=e.state.doc.sliceString(0,e.pos),n=t.lastIndexOf("{");if(t.at(n-1)==="{"||n===-1||t.indexOf("}",n)>n)return null;let i=e.matchBefore(/\w*$/);if(!i)return null;let o=dI(Me.get(Ga),new Set,99);return{from:i.from,options:o,validFor:/^\w*$/}};var gu="InlineMathDollar",as="InlineMathBracket",yu="BlockMathDollar",os="BlockMathBracket",io={[gu]:1,[as]:3,[yu]:2,[os]:3},Ft={DOLLAR:36,BACKSLASH:92,OPEN_PAREN:40,CLOSE_PAREN:41,OPEN_BRACKET:91,CLOSE_BRACKET:93},ss=Object.keys(io).reduce((e,t)=>(e[t]={mark:`${t}Mark`,resolve:t},e),{});function hI(e){let t=[];return Object.keys(io).forEach(n=>{t.push({name:n,style:Zd.emphasis},{name:`${n}Mark`,style:Zd.processingInstruction})}),{defineNodes:t,parseInline:[{name:yu,parse(n,i,o){return i!==Ft.DOLLAR||n.char(o+1)!==Ft.DOLLAR?-1:n.addDelimiter(ss[yu],o,o+io[yu],!0,!0)}},{name:gu,parse(n,i,o){return i!==Ft.DOLLAR||n.char(o+1)===Ft.DOLLAR?-1:n.addDelimiter(ss[gu],o,o+io[gu],!0,!0)}},{name:as,before:"Escape",parse(n,i,o){return i!==Ft.BACKSLASH||n.char(o+1)!==Ft.BACKSLASH||![Ft.OPEN_PAREN,Ft.CLOSE_PAREN].includes(n.char(o+2))?-1:n.addDelimiter(ss[as],o,o+io[as],n.char(o+2)===Ft.OPEN_PAREN,n.char(o+2)===Ft.CLOSE_PAREN)}},{name:os,before:"Escape",parse(n,i,o){return i!==Ft.BACKSLASH||n.char(o+1)!==Ft.BACKSLASH||![Ft.OPEN_BRACKET,Ft.CLOSE_BRACKET].includes(n.char(o+2))?-1:n.addDelimiter(ss[os],o,o+io[os],n.char(o+2)===Ft.OPEN_BRACKET,n.char(o+2)===Ft.CLOSE_BRACKET)}},{name:as,before:"Escape",parse(n,i,o){return i!==Ft.BACKSLASH||![Ft.OPEN_PAREN,Ft.CLOSE_PAREN].includes(n.char(o+1))?-1:n.addDelimiter(ss[as],o,o+2,n.char(o+1)===Ft.OPEN_PAREN,n.char(o+1)===Ft.CLOSE_PAREN)}},{name:os,before:"Escape",parse(n,i,o){return i!==Ft.BACKSLASH||![Ft.OPEN_BRACKET,Ft.CLOSE_BRACKET].includes(n.char(o+1))?-1:n.addDelimiter(ss[os],o,o+2,n.char(o+1)===Ft.OPEN_BRACKET,n.char(o+1)===Ft.CLOSE_BRACKET)}}],wrap:tS(n=>{let i=io[n.type.name];if(i){let o=n.from+i,l=n.to-i;return o>=l||o<0||l<0?null:{parser:e,overlay:[{from:o,to:l}]}}return null})}}wf=sr.define(),_f=sr.define(),Ei=li.define({create:()=>({}),update:(e,t)=>{for(let n of t.effects){if(n.is(wf))return n.value;if(n.is(_f))return{...e,...n.value}}return e}}),eT=!0,ff=class{constructor(){pe(this,"parser",new Af);pe(this,"type","markdown");pe(this,"defaultCode",this.parser.defaultCode);pe(this,"defaultMetadata",this.parser.defaultMetadata)}static fromMarkdown(e){return Af.fromMarkdown(e)}transformIn(e){let t=this.parser.transformIn(e);return[t.code,t.offset,t.metadata]}transformOut(e,t){let n=this.parser.transformOut(e,t);return[n.code,n.offset]}isSupported(e){return this.parser.isSupported(e)}getExtension(e,t,n,i){let o=dS().language.data,l,u=()=>{var p;if(!l)return!0;let d=l==null?void 0:l.state.field(Ei);return d===void 0?!1:((p=d.quotePrefix)==null?void 0:p.includes("f"))??!1};return[Cr.define(d=>(l=d,{})),dS({base:P6,codeLanguages:UD,extensions:[hI(eS.define(N6).parser),pI(jg.parser,u)]}),uI(n),rI.map(d=>o.of({autocomplete:d})),pS().language.data.of({autocomplete:X4({completion:jw,predicate:u})}),tf({defaultKeymap:!1,activateOnTyping:!0}),U4({predicate:()=>!u()})]}};const _n={PREFIX:"file:///",of(e){return`${this.PREFIX}${e}`},is(e){return e.startsWith(this.PREFIX)},parse(e){return Vn(this.is(e),`Invalid cell document URI: ${e}`),e.slice(this.PREFIX.length)}};function $w(e){return"notify"in e&&typeof e.notify=="function"}function gI(e){return"processNotification"in e&&typeof e.processNotification=="function"}function yI(e){return _n.is(e)?Me.get(Mc).inOrderIds.includes(_n.parse(e)):!1}function vu(){var e;return((e=Me.get(Nc))==null?void 0:e.rootUri)??"file:///"}function bu(){var t;let e=(t=Me.get(Nc))==null?void 0:t.rootUri;return e?[{uri:e,name:"marimo"}]:[]}function Vw(){var e;return((e=Me.get(Nc))==null?void 0:e.documentUri)??"file:///__marimo_notebook__.py"}function vI(e){return ki.filter(e,t=>t!==!1&&t!==null)}function Hw(e){let t=e.map(vI);return Object.assign({},...t)}var bI=class{constructor(e){pe(this,"clients",[]);this.clients=e,this.documentUri=Vw()}onNotification(e){let t=[];for(let n of this.clients)t.push(n.onNotification(e));return()=>{for(let n of t)n();return!0}}get clientCapabilities(){return Hw(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 Hw(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})}firstWithMethod(e){return this.clients.find(t=>t.hasCapability(e))}clientsWithMethod(e){return this.clients.filter(t=>t.hasCapability(e))}hasCapability(e){return this.clients.some(t=>t.hasCapability(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){await Promise.all(this.clients.map(t=>t.textDocumentDidChange(e)))}async completionItemResolve(e){let t=this.firstWithMethod("textDocument/completion");return t?t.completionItemResolve(e):e}async textDocumentCodeAction(e){let t=this.firstWithMethod("textDocument/codeAction");return t?t.textDocumentCodeAction(e):null}async codeActionResolve(e){let t=this.firstWithMethod("textDocument/codeAction");return t?t.codeActionResolve(e):e}async textDocumentRename(e){let t=this.firstWithMethod("textDocument/rename");return t?t.textDocumentRename(e):null}async textDocumentPrepareRename(e){let t=this.firstWithMethod("textDocument/prepareRename");return t?t.textDocumentPrepareRename(e):null}async textDocumentSignatureHelp(e){let t=this.firstWithMethod("textDocument/signatureHelp");return t?t.textDocumentSignatureHelp(e):null}async textDocumentCompletion(e){let t=this.clientsWithMethod("textDocument/completion");return wI(await Promise.allSettled(t.map(n=>n.textDocumentCompletion(e))))}async textDocumentDefinition(e){let t=this.firstWithMethod("textDocument/definition");return t?t.textDocumentDefinition(e):null}async textDocumentDidOpen(e){return(await Promise.all(this.clients.map(t=>t.textDocumentDidOpen(e)))).some(t=>t!==!1)}async textDocumentDidClose(e){await Promise.all(this.clients.map(t=>t.textDocumentDidClose(e)))}async textDocumentWillSave(e){await Promise.all(this.clients.map(t=>t.textDocumentWillSave(e)))}async textDocumentWillSaveWaitUntil(e){var n;let t=await Promise.allSettled(this.clients.map(i=>i.textDocumentWillSaveWaitUntil(e)));for(let i of t)if(i.status==="fulfilled"&&((n=i.value)!=null&&n.length))return i.value;return null}async textDocumentDidSave(e){await Promise.all(this.clients.map(t=>t.textDocumentDidSave(e)))}async textDocumentHover(e){for(let t of this.clients){if(!t.hasCapability("textDocument/hover"))continue;let n=await t.textDocumentHover(e);if(n)return n}return{contents:[]}}};function wI(e){let t=[],n=!1;for(let i of e)if(i.status==="fulfilled"){let o=i.value;if(o==null)continue;Array.isArray(o)&&t.push(...o),"items"in o&&(t.push(...o.items),n||(n=o.isIncomplete))}return{items:t,isIncomplete:n}}function xI(e){let t=fS.parse(e),n="";return V5(e,t,A5,(i,o)=>{let l=i.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");n+=o?`<span class="${o}">${l}</span>`:l},()=>{n+=`
|
|
135
|
+
`}),n}function _I(){let e=new nf.Renderer,t=e.code.bind(e);return e.code=n=>{let{text:i,lang:o}=n;return i.trim()?o==="python"||o==="py"?`<pre><code class="language-python">${xI(i)}</code></pre>
|
|
136
|
+
`:t(n):""},n=>nf(n,{async:!1,gfm:!0,breaks:!0,renderer:e})}na=function(e){return typeof e=="object"&&!!e&&!Array.isArray(e)},AS=function(e,t){return typeof e[t]=="function"},aE=function(e){return[...kI(e),e].join(`
|
|
137
|
+
`)};function kI(e){return U0().map(t=>{let n=ci(t);return n===e?null:n}).filter(Boolean).toSorted((t,n)=>t.startsWith("import")&&!n.startsWith("import")?-1:!t.startsWith("import")&&n.startsWith("import")?1:0)}var CI=Ne(e=>{let t=e(ft);return ki.fromEntries(t.cellIds.inOrderIds.map(n=>{var o;let i=t.cellHandles[n];return[n,(o=i==null?void 0:i.current)!=null&&o.editorView?ci(i.current.editorView):""]}))}),SI=Ne(e=>e(ft).cellIds.inOrderIds),EI=Ne(e=>DI(e(SI),e(Ga)));const TI=Ne(e=>({cellIds:e(EI),codes:e(CI)}));function DI(e,t){var p,g;let n=new Map;e.forEach(w=>n.set(w,[]));let i=new Set(e),o=new Set(e);for(let{declaredBy:w,usedBy:x}of Object.values(t))for(let S of w){i.delete(S);for(let E of x)o.delete(E),E!==S&&((p=n.get(S))==null||p.push(E))}let l=new Map;e.forEach(w=>l.set(w,0)),n.forEach(w=>{w.forEach(x=>{l.set(x,(l.get(x)||0)+1)})});let u=[];l.forEach((w,x)=>{w===0&&u.push(x)});let d=[];for(;u.length>0;){let w=u.shift();if(!w)break;d.push(w),(g=n.get(w))==null||g.forEach(x=>{l.set(x,(l.get(x)||0)-1),l.get(x)===0&&u.push(x)})}return[...d.filter(w=>!i.has(w)),...i]}function RI(e,t){let n=new Map,i=0;e.forEach(u=>{n.set(u,i),i+=t[u].split(`
|
|
138
138
|
`).length});function o(u){return n.has(u)||Se.warn("[lsp] no cell line offsets for",u),n.get(u)??0}let l=e.map(u=>t[u]).join(`
|
|
139
139
|
`);return{cellIds:e,mergedText:l,transformRange:(u,d)=>Bw(u,o(d)),reverseRange:(u,d)=>Bw(u,-o(d)),isInRange:(u,d)=>{let p=t[d].split(`
|
|
140
140
|
`).length,g=n.get(d)||0,w=u.start.line-g,x=u.end.line-g,S=w>=0&&w<p,E=x>=0&&x<p;return S&&!E&&Se.warn("[lsp] Cross-cell diagnostic detected: range starts in cell but ends outside",{cellId:d,range:u,cellLines:p,offset:g}),S&&E},getEditsForNewText:u=>{let d=u.split(`
|
|
141
141
|
`),p=l.split(`
|
|
142
142
|
`);if(d.length!==p.length)throw Se.warn("[lsp] cannot apply rename with new lines",d,p),Error("Cannot apply rename when there are new lines");let g=[];for(let[w,x]of ki.entries(t)){if(!n.has(w))continue;let S=n.get(w)??0,E=x.split(`
|
|
143
143
|
`).length,T=d.slice(S,S+E);g.push({cellId:w,text:T.join(`
|
|
144
|
-
`)})}return g},transformPosition:(u,d)=>
|
|
144
|
+
`)})}return g},transformPosition:(u,d)=>wu(u,o(d)),reversePosition:(u,d)=>wu(u,-o(d))}}function Bw(e,t){return{start:wu(e.start,t),end:wu(e.end,t)}}function wu(e,t){return{line:e.line+t,character:e.character}}var II=new RegExp("(?<!`):math:`([^\\n`]+)`","g"),AI=/:math:\s*<code>(.+?)<\/code>/gs,LI=new RegExp("(?<!\\S)\\\\\\[(.+?)\\\\]","gs"),PI=/\\\((.+?)\\\)/gs,OI=new RegExp("(?<!\\\\)\\$\\$(.+?)(?<!\\\\)\\$\\$","gs"),MI=new RegExp("(?<![$\\\\])\\$(?!\\$)([^\\n$]+?)(?<!\\\\)\\$(?!\\$)","g");function Cl(e){return Kw(e)?jI(e).map(t=>t.isFenced?t.text:qI(t.text.replaceAll(II,(n,i)=>xu(i)).replaceAll(AI,(n,i)=>xu(i))).map(n=>n.isInlineCode?n.text:zI(n.text)).join("")).join(`
|
|
145
145
|
`):e}function Ww(e){return e==null?e:Array.isArray(e)?e.map(t=>Uw(t)):typeof e=="string"?Cl(e):NI(e)?e.kind==="markdown"?{...e,value:Cl(e.value)}:Kw(e.value)?{kind:"markdown",value:Cl(e.value)}:e:Uw(e)}function Uw(e){return typeof e=="string"?Cl(e):e.language!=="markdown"&&e.language!=="md"?e:{...e,value:Cl(e.value)}}function NI(e){return typeof e=="object"&&"kind"in e&&"value"in e}function Kw(e){return e.includes(".. math::")||e.includes(":math:`")||new RegExp("(?<!\\S)\\\\\\[[\\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 jI(e){let t=e.split(`
|
|
146
146
|
`),n=[],i=[],o=!1,l="",u=0,d=p=>{i.length!==0&&(n.push({text:i.join(`
|
|
147
|
-
`),isFenced:p}),i=[])};for(let p of t){let g=p.match(/^[\t ]*(`{3,}|~{3,})/);if(g){let w=g[1],x=w[0],S=w.length;if(!o){d(!1),o=!0,l=x,u=S,i.push(p);continue}if(x===l&&S>=u){i.push(p),d(!0),o=!1,l="",u=0;continue}}i.push(p)}return d(o),n}function qI(e){let t=[],n="",i=!1,o="",l=0;for(;l<e.length;){if(e[l]==="`"){let u=l;for(;u<e.length&&e[u]==="`";)u+=1;let d=e.slice(l,u);if(i&&d===o){n+=d,t.push({text:n,isInlineCode:!0}),n="",i=!1,o="",l=u;continue}if(!i){n&&(n=(t.push({text:n,isInlineCode:!1}),"")),i=!0,o=d,n+=d,l=u;continue}}n+=e[l],l+=1}return n&&t.push({text:n,isInlineCode:i}),t}function zI(e){let t=FI(e);return t=t.replaceAll(LI,(n,i)=>Kp(i)),t=t.replaceAll(PI,(n,i)=>
|
|
147
|
+
`),isFenced:p}),i=[])};for(let p of t){let g=p.match(/^[\t ]*(`{3,}|~{3,})/);if(g){let w=g[1],x=w[0],S=w.length;if(!o){d(!1),o=!0,l=x,u=S,i.push(p);continue}if(x===l&&S>=u){i.push(p),d(!0),o=!1,l="",u=0;continue}}i.push(p)}return d(o),n}function qI(e){let t=[],n="",i=!1,o="",l=0;for(;l<e.length;){if(e[l]==="`"){let u=l;for(;u<e.length&&e[u]==="`";)u+=1;let d=e.slice(l,u);if(i&&d===o){n+=d,t.push({text:n,isInlineCode:!0}),n="",i=!1,o="",l=u;continue}if(!i){n&&(n=(t.push({text:n,isInlineCode:!1}),"")),i=!0,o=d,n+=d,l=u;continue}}n+=e[l],l+=1}return n&&t.push({text:n,isInlineCode:i}),t}function zI(e){let t=FI(e);return t=t.replaceAll(LI,(n,i)=>Kp(i)),t=t.replaceAll(PI,(n,i)=>xu(i)),t=t.replaceAll(OI,(n,i)=>Kp(i)),t=t.replaceAll(MI,(n,i)=>xu(i)),t}function ls(e){var t;return((t=e.match(/^[\t ]*/))==null?void 0:t[0].replaceAll(" "," ").length)??0}function FI(e){var o;let t=e.split(`
|
|
148
148
|
`);if(t.length===0)return e;let n=[],i=0;for(;i<t.length;){let l=t[i],u=l.match(/^[\t ]*\.\.\s+math::(.*)$/);if(!u){n.push(l),i+=1;continue}let d=((o=u[1])==null?void 0:o.trim())??"",p=ls(l);i+=1;let g=[],w=d.includes("\\begin");if(d)g.push(d);else{for(;i<t.length;){let T=t[i];if(!T.trim()){i+=1;continue}if(!(ls(T)>p&&T.trim().startsWith(":")))break;i+=1}if(i<t.length){let T=t[i];w=!!T.trim()&&ls(T)<=p&&T.trimStart().startsWith("\\")}}if(w)for(;i<t.length&&t[i].trim();)g.push(t[i]),i+=1;else for(;i<t.length;){let T=t[i];if(!T.trim()){g.push(""),i+=1;continue}if(ls(T)<=p)break;g.push(T),i+=1}let x=g.filter(T=>!!T.trim());if(x.length===0){n.push(l);continue}let S=Math.min(...x.map(T=>ls(T))),E=g.map(T=>{if(!T)return"";let O=Math.min(S,ls(T));return T.slice(O)}).join(`
|
|
149
149
|
`).trim();n.push(Kp(E))}return n.join(`
|
|
150
|
-
`)}function wu(e){return`<marimo-tex class="arithmatex">||(${e.trim()}||)</marimo-tex>`}function Kp(e){return`<marimo-tex class="arithmatex">||[${e.trim()}||]</marimo-tex>`}function $I(e){return e.startsWith("_")&&!e.startsWith("__")}var VI=class{constructor(e){pe(this,"documentVersion",0);pe(this,"lastSnapshot",null);this.getNotebookCode=e}snapshot(){var n;let e=this.getLens(),t=((n=this.lastSnapshot)==null?void 0:n.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 RI(e,t)}},HI=()=>{let e=Af().cellHandles;return ki.mapValues(e,t=>{var n;return(n=t.current)==null?void 0:n.editorViewOrNull})};function Qp(e){let t=Ww(e);return Array.isArray(t)?e:t}function Gp(e){return{...e,documentation:Qp(e.documentation)}}function BI(e){return e==null?null:Array.isArray(e)?e.map(t=>Gp(t)):{...e,items:e.items.map(t=>Gp(t))}}function WI(e){return{...e,signatures:e.signatures.map(t=>{var n;return{...t,documentation:Qp(t.documentation),parameters:(n=t.parameters)==null?void 0:n.map(i=>({...i,documentation:Qp(i.documentation)}))}})}}function Qw(e){return na(e)&&typeof e.line=="number"&&typeof e.character=="number"}function Gw(e){return na(e)&&Qw(e.start)&&Qw(e.end)}function UI(e){return na(e)&&typeof e.message=="string"&&Gw(e.range)}function KI(e){if(e.method!=="textDocument/publishDiagnostics"||!na(e.params))return!1;let{uri:t,version:n,diagnostics:i}=e.params;return typeof t=="string"&&(n===void 0||typeof n=="number")&&Array.isArray(i)&&i.every(UI)}let Sl,xu,Xw,Jw,Yw;Sl=class{constructor(e,t,n=HI){pe(this,"seenCellDocumentUris",new Set);pe(this,"completionItemCache",new uu(10));pe(this,"openCellDocumentCounts",new Map);pe(this,"latestDiagnosticsVersion",null);pe(this,"forwardedDiagnosticsVersion",0);this.documentUri=Vw(),this.getNotebookEditors=n,this.initialSettings=t,this.client=e,this.patchProcessNotification(),this.initializePromise.then(()=>{Vn($w(this.client),"notify is not a method on the client"),this.client.notify("workspace/didChangeConfiguration",{settings:t})}),this.snapshotter=new VI(this.getNotebookCode.bind(this))}pruneSeenCellUris(e){for(let t of this.seenCellDocumentUris){let n=_n.parse(t);e.has(n)||this.seenCellDocumentUris.delete(t)}}onNotification(e){return this.client.onNotification(e)}get ready(){return this.client.ready}set ready(e){this.client.ready=e}get capabilities(){return this.client.capabilities}set capabilities(e){this.client.capabilities=e}get initializePromise(){return this.client.initializePromise}set initializePromise(e){this.client.initializePromise=e}get clientCapabilities(){return this.client.clientCapabilities}async initialize(){await this.client.initialize()}close(){this.openCellDocumentCounts.clear(),this.client.close()}hasCapability(e){return this.client.hasCapability(e)}async resyncAllDocuments(){Vn($w(this.client),"notify is not a method on the client"),await this.client.initialize(),await this.client.notify("workspace/didChangeConfiguration",{settings:this.initialSettings});let{lens:e,version:t}=this.snapshotter.snapshot();this.latestDiagnosticsVersion=null,this.forwardedDiagnosticsVersion=0,this.openCellDocumentCounts.size>0&&await this.client.notify("textDocument/didOpen",{textDocument:{languageId:"python",text:e.mergedText,uri:this.documentUri,version:t}}),Se.log("[lsp] Document re-synchronization complete")}getNotebookCode(){return Me.get(TI)}assertCellDocumentUri(e){Vn(_n.is(e),"Execpted URI to be CellDocumentUri")}async textDocumentDidOpen(e){Se.debug("[lsp] textDocumentDidOpen",e);let t=e.textDocument.uri;this.assertCellDocumentUri(t);let{lens:n,version:i}=this.snapshotter.snapshot(),o=this.openCellDocumentCounts.get(t)??0;this.openCellDocumentCounts.set(t,o+1);try{let l=await this.client.textDocumentDidOpen({textDocument:{languageId:e.textDocument.languageId,text:n.mergedText,uri:this.documentUri,version:i}});return this.seenCellDocumentUris.add(t),l!==!1}catch(l){let u=this.openCellDocumentCounts.get(t)??0;throw u<=1?this.openCellDocumentCounts.delete(t):this.openCellDocumentCounts.set(t,u-1),l}}async textDocumentDidClose(e){let t=e.textDocument.uri;this.assertCellDocumentUri(t);let n=this.openCellDocumentCounts.get(t)??0;if(n===0){Se.warn("[lsp] textDocumentDidClose with no tracked open",t);return}n<=1?this.openCellDocumentCounts.delete(t):this.openCellDocumentCounts.set(t,n-1),await this.client.textDocumentDidClose({textDocument:{uri:this.documentUri}})}async sync(){let{lens:e,version:t,didChange:n}=this.snapshotter.snapshot(),i={textDocument:{uri:this.documentUri,version:t},contentChanges:[{text:e.mergedText}]};return n&&await this.client.textDocumentDidChange(i),{params:i,lens:e}}async textDocumentDidChange(e){if(Se.debug("[lsp] textDocumentDidChange",e),e.contentChanges.length===1){await this.sync();return}Se.warn("[lsp] Unhandled textDocumentDidChange",e),await this.client.textDocumentDidChange(e)}async textDocumentWillSave(e){this.assertCellDocumentUri(e.textDocument.uri),await this.client.textDocumentWillSave({...e,textDocument:{uri:this.documentUri}})}async textDocumentWillSaveWaitUntil(e){return this.assertCellDocumentUri(e.textDocument.uri),Se.debug("[lsp] willSaveWaitUntil edits are disabled for notebook documents"),null}async textDocumentDidSave(e){this.assertCellDocumentUri(e.textDocument.uri);let{lens:t}=this.snapshotter.snapshot();await this.client.textDocumentDidSave({textDocument:{uri:this.documentUri},text:e.text===void 0?void 0:t.mergedText})}async textDocumentDefinition(e){let t=e.textDocument.uri;if(!_n.is(t))return Se.warn("Invalid cell document URI",t),null;let{lens:n}=await this.sync(),i=_n.parse(t);return this.client.textDocumentDefinition({...e,textDocument:{uri:this.documentUri},position:n.transformPosition(e.position,i)})}async textDocumentSignatureHelp(e){let t=e.textDocument.uri;if(!_n.is(t))return Se.warn("Invalid cell document URI",t),null;let{lens:n}=await this.sync(),i=_n.parse(t),o=await this.client.textDocumentSignatureHelp({...e,textDocument:{uri:this.documentUri},position:n.transformPosition(e.position,i)});return o?WI(o):null}textDocumentCodeAction(e){return Promise.resolve(null)}codeActionResolve(e){return Promise.resolve(e)}reverseRelatedInformation(e,t){if(e)return e.map(n=>{if(!na(n)||!na(n.location)||n.location.uri!==this.documentUri||!Gw(n.location.range))return n;let i=t.cellIds.find(o=>t.isInRange(n.location.range,o));return i===void 0?n:{...n,location:{uri:_n.of(i),range:t.reverseRange(n.location.range,i)}}})}async textDocumentRename(e){var O;let t=e.textDocument.uri;if(!_n.is(t))return Se.warn("Invalid cell document URI",t),null;let n=_n.parse(t),{lens:i}=await this.sync(),o=i.transformPosition(e.position,n),l=await this.client.textDocumentRename({...e,textDocument:{uri:this.documentUri},position:o});if(!l)return null;let u=(O=l.documentChanges)==null?void 0:O.flatMap(j=>"edits"in j?j.edits:[]);if(!u||u.length!==1)return Se.warn("Expected exactly one edit",u),l;let d=u[0];if(!("newText"in d))return Se.warn("Expected newText in edit",d),l;let p=i.getEditsForNewText(d.newText),g=new Map(p.map(j=>[j.cellId,j.text])),w=this.getNotebookEditors(),x=w[n],S=!1;if(x){let j=x.state.doc.line(e.position.line+1).from+e.position.character,{startToken:z,endToken:V}=qp(x.state.doc,j),P=x.state.doc.sliceString(z,V);S=$I(P),S&&Se.debug("[lsp] Private variable rename detected, limiting to current cell",P)}let E=[],T=0;for(let[j,z]of ki.entries(w)){if(S&&j!==n)continue;let V=g.get(j);if(V==null){Se.warn("[lsp] No new code for cell during rename",j),E.push(j);continue}if(!z){Se.warn("[lsp] No editor view for cell during rename",j),E.push(j);continue}ci(z)!==V&&(Bo(z,V),T++)}return E.length>0&&Se.error(`[lsp] Rename partially failed: could not update ${E.length} cell(s)`,E),Se.debug(`[lsp] Rename completed: updated ${T} cell(s)`),{...l,documentChanges:[{edits:[],textDocument:{uri:t,version:0}}]}}async completionItemResolve(e){let t=JSON.stringify(e),n=this.completionItemCache.get(t);if(n)return n;let i=this.client.completionItemResolve(e).then(o=>Gp(o));return this.completionItemCache.set(t,i),i}async textDocumentPrepareRename(e){let t=e.textDocument.uri;if(!_n.is(t))return Se.warn("Invalid cell document URI",t),null;let{lens:n}=await this.sync(),i=_n.parse(t);return this.client.textDocumentPrepareRename({...e,textDocument:{uri:this.documentUri},position:n.transformPosition(e.position,i)})}async textDocumentHover(e){Se.debug("[lsp] textDocumentHover",e);let{lens:t}=await this.sync(),n=_n.parse(e.textDocument.uri),i=await this.client.textDocumentHover({...e,textDocument:{uri:this.documentUri},position:t.transformPosition(e.position,n)});return i?(typeof i.contents=="object"&&"kind"in i.contents&&(i.contents={kind:"markdown",value:i.contents.value}),i.contents=Ww(i.contents)??i.contents,i.contents===""?null:(i.range&&(i.range=t.reverseRange(i.range,n)),i)):(Se.debug("[lsp] no hover result"),i)}async textDocumentCompletion(e){let{lens:t}=this.snapshotter.getLatestSnapshot();if(!_n.is(e.textDocument.uri))return Se.error("[lsp] Invalid cell document URI in completion request",e.textDocument.uri),null;let n=_n.parse(e.textDocument.uri);if(!n||n==="undefined")return Se.error("[lsp] Invalid cellId 'undefined' in completion request",{cellId:n,uri:e.textDocument.uri,availableCellIds:t.cellIds}),null;t.cellIds.includes(n)||Se.warn("[lsp] CellId in completion request not found in current lens",{cellId:n,uri:e.textDocument.uri,availableCellIds:t.cellIds});let i=t.transformPosition(e.position,n);return BI(await this.client.textDocumentCompletion({...e,textDocument:{uri:this.documentUri},position:i}))}patchProcessNotification(){Vn(gI(this.client),"processNotification is not a method on the client");let e=this.client.processNotification.bind(this.client),t=n=>{var i;if(KI(n)){let o=n.params.version;if(o!=null){let S=this.latestDiagnosticsVersion;if(S!==null&&Number.isFinite(o)&&o<S){Se.debug("[lsp] dropping stale diagnostics notification",n);return}this.latestDiagnosticsVersion=o}Se.debug("[lsp] handling diagnostics",n);let l=this.snapshotter.getLatestSnapshot(),u=n.params.diagnostics,{lens:d}=l,p=++this.forwardedDiagnosticsVersion,g=new Map;for(let S of u)for(let E of d.cellIds)if(d.isInRange(S.range,E)){g.has(E)||g.set(E,[]);let T=this.reverseRelatedInformation(S.relatedInformation,d),O={...S,range:d.reverseRange(S.range,E),...T?{relatedInformation:T}:{}};(i=g.get(E))==null||i.push(O);break}let w=new Set(d.cellIds);this.pruneSeenCellUris(w);let x=new Set(this.seenCellDocumentUris);for(let[S,E]of g.entries()){Se.debug("[lsp] diagnostics for cell",S,E);let T=_n.of(S);x.delete(T),e({...n,params:{...n.params,uri:T,version:p,diagnostics:E}})}if(x.size>0){Se.debug("[lsp] clearing diagnostics",x);for(let S of x)e({method:"textDocument/publishDiagnostics",params:{uri:S,version:p,diagnostics:[]}})}return}return e(n)};this.client.processNotification=t}},xu=1e3,Xw=new Set(["textDocument/didOpen","textDocument/didChange","textDocument/didClose"]),Jw=new Set(["initialize","initialized","workspace/didChangeConfiguration","textDocument/didOpen"]),v0=class{constructor(e){pe(this,"isDelegateConnected",!1);pe(this,"connectionGeneration",0);pe(this,"isClosed",!1);pe(this,"hasConnectedBefore",!1);pe(this,"messageHandlers",new Set);pe(this,"pendingMessages",[]);pe(this,"hasLoggedQueueOverflow",!1);this.options={...e,retries:e.retries??1,retryDelayMs:e.retryDelayMs??1e3},this.onReconnect=e.onReconnect}async connect(){if(this.isClosed)throw Error("Transport is closed");if(this.isDelegateConnected)return;if(this.connectionPromise)return this.connectionPromise;let e=++this.connectionGeneration,t=this.connectWithRetries(e).finally(()=>{this.connectionPromise===t&&(this.connectionPromise=void 0)});return this.connectionPromise=t,t}isStale(e){return this.isClosed||e!==this.connectionGeneration}send(e){if(!this.isClosed){if(this.delegate&&this.isDelegateConnected&&(this.restoringGeneration===void 0||this.canSendWhileRestoring(e))){this.delegate.send(e);return}this.pendingMessages.length<xu?this.pendingMessages.push(e):this.hasLoggedQueueOverflow||(this.hasLoggedQueueOverflow=!0,Se.error(`LSP reconnect queue is full (${xu}); dropping messages until it drains`)),this.reconnect()}}onMessage(e){return this.messageHandlers.add(e),()=>{this.messageHandlers.delete(e)}}close(){var e;this.isClosed||(this.isClosed=!0,this.isDelegateConnected=!1,this.restoringGeneration=void 0,this.connectionGeneration++,this.connectionPromise=void 0,this.pendingMessages=[],this.inFlightBacklog=void 0,this.messageHandlers.clear(),this.disposeDelegate(),(e=this.delegate)==null||e.close(),this.delegate=void 0)}async connectWithRetries(e){var i,o;let t;for(let l=1;l<=this.options.retries;l++)try{await this.connectDelegate(e);return}catch(u){if(t=u instanceof Error?u:Error(String(u)),this.isStale(e))throw t;this.invalidateDelegate(),Se.warn(`WebSocket connection attempt ${l}/${this.options.retries} failed`,t),l<this.options.retries&&await new Promise(d=>setTimeout(d,this.options.retryDelayMs))}let n=t??Error("WebSocket connection failed");throw(o=(i=this.options).onConnectionFailure)==null||o.call(i,n),n}async connectDelegate(e){var l,u,d;if(await((u=(l=this.options).waitForConnection)==null?void 0:u.call(l)),this.isStale(e))throw Error("Connection attempt abandoned");let t=this.createDelegate();if(await t.connect(),this.isStale(e)||this.delegate!==t)throw t.close(),Error("Transport closed while connecting");this.isDelegateConnected=!0;let n=this.hasConnectedBefore;this.hasConnectedBefore=!0;let i=this.detachPendingMessages();this.inFlightBacklog=i;try{if(n){this.restoringGeneration=e;try{await((d=this.onReconnect)==null?void 0:d.call(this))}finally{this.restoringGeneration===e&&(this.restoringGeneration=void 0)}}if(this.isStale(e)||this.delegate!==t||!this.isDelegateConnected)throw Error("WebSocket closed while restoring LSP state")}catch(p){throw this.isStale(e)||this.reclaimInFlightBacklog(),p}let o=n&&this.onReconnect?i.filter(p=>!("method"in p&&Xw.has(p.method))):i;this.inFlightBacklog=void 0;for(let p of[...o,...this.detachPendingMessages()])t.send(p);Se.log("WebSocket transport connected successfully")}detachPendingMessages(){let e=this.pendingMessages;return this.pendingMessages=[],this.hasLoggedQueueOverflow=!1,e}reclaimInFlightBacklog(){this.inFlightBacklog&&(this.inFlightBacklog=(this.pendingMessages=[...this.inFlightBacklog,...this.pendingMessages].slice(0,xu),void 0))}canSendWhileRestoring(e){return!("method"in e)||Jw.has(e.method)}createDelegate(){this.invalidateDelegate();let e=new vb(this.options.getWsUrl());return this.delegate=e,this.disposeDelegateMessage=e.onMessage(t=>{for(let n of this.messageHandlers)try{n(t)}catch(i){Se.error("LSP message handler failed",i)}}),this.disposeDelegateClose=e.onClose(t=>{this.delegate!==e||this.isClosed||(Se.warn("WebSocket transport connection closed",t),this.isDelegateConnected=!1,this.disposeDelegate(),this.delegate=void 0,this.restoringGeneration=void 0,this.reclaimInFlightBacklog(),this.connectionPromise=void 0,queueMicrotask(()=>this.reconnect()))}),e}reconnect(){this.connect().catch(e=>{Se.error("WebSocket transport reconnection failed",e)})}invalidateDelegate(){var e;this.isDelegateConnected=!1,this.restoringGeneration=void 0,this.disposeDelegate(),(e=this.delegate)==null||e.close(),this.delegate=void 0}disposeDelegate(){var e,t;(e=this.disposeDelegateMessage)==null||e.call(this),this.disposeDelegateMessage=void 0,(t=this.disposeDelegateClose)==null||t.call(this),this.disposeDelegateClose=void 0}},Yw=new Set([1,2]);function QI(e,t){if(!("method"in t)||t.method!=="window/logMessage")return;let n=t.params;!na(n)||typeof n.message!="string"||px({logs:[{timestamp:Date.now()/1e3,level:Yw.has(n.type)?"stderr":"stdout",message:n.message,source:{type:"lsp",name:e}}]})}function _u(e,t){let n=u5(),i=new v0({getWsUrl:()=>n.getLSPURL(e).toString(),waitForConnection:async()=>{await c5()},onReconnect:t});return i.onMessage(o=>QI(e,o)),i}sr.define(),new Jd;function GI(e){return e.facet(M5.readOnly)}function XI(e){return[nS(e),Si.of([{key:"ArrowRight",preventDefault:!0,run:t=>Zw(t,e)},{key:"Tab",preventDefault:!0,run:t=>Zw(t,e)}])]}function Zw(e,t){if(GI(e.state))return!1;let n=e.state.doc.length;return n===0?(e.dispatch({changes:{from:0,to:n,insert:t},selection:{head:t.length,anchor:t.length}}),!0):!1}function JI(e){let{beforeText:t,linkText:n,afterText:i,onClick:o}=e;return[nS(l=>{let u=document.createElement("span");u.append(document.createTextNode(t));let d=document.createElement("span");return d.textContent=n,d.classList.add("cm-clickable-placeholder"),d.onclick=p=>{p.stopPropagation(),o(l)},u.append(d),u.append(document.createTextNode(i)),u}),At.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 YI=Ur(e=>{let t,n={transport:_u("pylsp",async()=>{await(t==null?void 0:t())}),rootUri:yu(),workspaceFolders:vu()},i=e==null?void 0:e.pylsp,o=["D100","D103"],l=["W292","E402","E302","E305"],u=["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:i==null?void 0:i.enable_flake8,extendIgnore:l},pydocstyle:{enabled:i==null?void 0:i.enable_pydocstyle,ignore:o},pylint:{enabled:i==null?void 0:i.enable_pylint},pyflakes:{enabled:i==null?void 0:i.enable_pyflakes},pylsp_mypy:{enabled:i==null?void 0:i.enable_mypy,live_mode:!0},ruff:{enabled:i==null?void 0:i.enable_ruff,extendIgnore:[...l,...o,...u]},signature:{formatter:i!=null&&i.enable_ruff?"ruff":"black",line_length:88}}}},p=new Sl(new nl({...n}),d);return t=()=>p.resyncAllDocuments(),p}),ZI=Ur(e=>{let t,n=new Sl(new nl({transport:_u("ty",async()=>{await(t==null?void 0:t())}),rootUri:yu(),workspaceFolders:vu(),getWorkspaceConfiguration:i=>[{disableLanguageServices:!0}]}),{});return t=()=>n.resyncAllDocuments(),n}),eA=Ur(e=>{var i;let t,n=new Sl(new nl({transport:_u("pyrefly",async()=>{await(t==null?void 0:t())}),rootUri:yu(),workspaceFolders:vu(),initializationOptions:{pyrefly:{displayTypeErrors:((i=e.diagnostics)==null?void 0:i.enabled)??!1?"force-on":"force-off"}}}),{});return t=()=>n.resyncAllDocuments(),n}),tA=Ur(e=>{let t,n=new Sl(new nl({transport:_u("basedpyright",async()=>{await(t==null?void 0:t())}),rootUri:yu(),workspaceFolders:vu()}),{});return t=()=>n.resyncAllDocuments(),n}),nA=class{constructor(){pe(this,"parser",new Zb);pe(this,"type","python");pe(this,"defaultCode",this.parser.defaultCode);pe(this,"defaultMetadata",this.parser.defaultMetadata)}transformIn(e){let t=this.parser.transformIn(e);return[t.code,t.offset,t.metadata]}transformOut(e,t){let n=this.parser.transformOut(e,t);return[n.code,n.offset]}isSupported(e){return this.parser.isSupported(e)}getExtension(e,t,n,i,o){return[(()=>{var w,x,S,E,T;let l={defaultKeymap:!1,activateOnTyping:t.activate_on_typing,closeOnBlur:!1},u={hideOnChange:!0},d=[];(w=o==null?void 0:o.pylsp)!=null&&w.enabled&&ga("pylsp")&&d.push(YI(o)),(x=o==null?void 0:o.ty)!=null&&x.enabled&&ga("ty")&&d.push(ZI(o)),(S=o==null?void 0:o.pyrefly)!=null&&S.enabled&&ga("pyrefly")&&d.push(eA(o)),(E=o==null?void 0:o.basedpyright)!=null&&E.enabled&&ga("basedpyright")&&d.push(tA(o));let p=t.signature_hint_on_typing,g=p?/(\w+|\w+\.|\/)$/:/(\w+|\w+\.|\(|\/|,)$/;if(d.length>0){let O=d.length===1?d[0]:new bI(d),j=z=>{Se.debug("openExternalLocation",z),!(O.documentUri===z.uri||yI(z.uri))&&Sr().openFile({path:z.uri.replace("file://","")})};return[r0({client:O,languageId:"python",allowHTMLContent:!0,markdownRenderer:_I(),useSnippetOnCompletion:!0,clientSideFiltering:!0,hoverConfig:u,completionConfig:l,diagnosticsEnabled:((T=o.diagnostics)==null?void 0:T.enabled)??!1,sendIncrementalChanges:!1,signatureHelpEnabled:!0,signatureActivateOnTyping:p,signatureHelpOptions:{position:"above"},keyboardShortcuts:{signatureHelp:n.getHotkey("cell.signatureHelp").key,goToDefinition:n.getHotkey("cell.goToDefinition").key,rename:n.getHotkey("cell.renameSymbol").key},completionMatchBefore:g,onGoToDefinition:j,onShowLocation:j}),fb.of(_n.of(e))]}return[ef({...l,override:[jw]}),Pf]})(),Yg(),rA(i)]}};function rA(e){return e==="marimo-import"?Zd.highest(XI("import marimo as mo")):e==="ai"?JI({beforeText:"Start coding or ",linkText:"generate",afterText:" with AI.",onClick:t=>{t.state.facet(Lt).aiCellCompletion()}}):[]}var Xp=jg.configure({props:[I5.add({ParenthesizedExpression:XC,ArgList:XC})]});Yg=function(){return new rS(Xp,[Xp.data.of({autocomplete:P6}),Xp.data.of({autocomplete:O6})])};function ya(e){return typeof e=="object"&&!Array.isArray(e)&&!Ar(e)}function Ar(e){if(typeof e!="object"||Array.isArray(e)||!("self"in e)||!("children"in e))return!1;let t=e.self;return typeof t=="object"&&!!t&&!Array.isArray(t)&&typeof t.label=="string"}function Zn(e){return Array.isArray(e)}function Hn(e,t,n,i){let o=e.length;if(t==="string"||t==="completion"&&i&&Zn(i))return"column";if(t==="namespace"&&n){if(Zn(n))return"table";if(ya(n))return Object.values(n).some(l=>Zn(l)||Ar(l)&&Zn(l.children))?o<=1?"database":"schema":o===0?"database":"namespace"}if(t==="completion"&&n)return Zn(n)?"table":(ya(n)&&Object.values(n).some(l=>Zn(l)||Ar(l)&&Zn(l.children)),o<=1?"database":"schema");switch(o){case 0:return"database";case 1:return"schema";default:return"namespace"}}function ku(e,t,n={}){let{maxDepth:i=10}=n;if((typeof t=="string"?t==="":t.length===0)&&Ar(e)){let l=Hn([],"completion",e.children);return{completion:e.self,path:[],type:"completion",semanticType:l,namespace:e.children}}let o=(typeof t=="string"?t.split("."):t).filter(l=>l.length>0);return o.length===0||o.length>i?null:Jp(e,o,[],n)}function Jp(e,t,n,i,o){if(t.length===0){if(Ar(e)){let p=Hn(n,"completion",e.children,o);return{completion:e.self,path:n,type:"completion",semanticType:p,namespace:e.children}}return{path:n,type:"namespace",semanticType:Hn(n,"namespace",e,o),namespace:e}}let[l,...u]=t,{caseSensitive:d=!1}=i;if(!l)return null;if(ya(e)){let p=d?Object.keys(e).find(g=>g===l):Object.keys(e).find(g=>g.toLowerCase()===l.toLowerCase());if(p){let g=e[p];if(g)return Jp(g,u,[...n,p],i,e)}}else{if(Ar(e))return Jp(e.children,t,n,i,e);if(Zn(e)){for(let p of e)if(typeof p=="string"){if((d?p===l:p.toLowerCase()===l.toLowerCase())&&u.length===0){let g=Hn([...n,p],"string",void 0,e);return{value:p,path:[...n,p],type:"string",semanticType:g}}}else if((d?p.label===l:p.label.toLowerCase()===l.toLowerCase())&&u.length===0){let g=Hn([...n,p.label],"completion",void 0,e);return{completion:p,path:[...n,p.label],type:"completion",semanticType:g}}}}return null}function iA(e,t,n={}){let i=[];if(t.includes(".")){let o=t.lastIndexOf("."),l=t.substring(0,o),u=t.substring(o+1),d=ku(e,l,n);if(d!=null&&d.namespace)return Yp(d.namespace,u,d.path,n)}else return Yp(e,t,[],n);return i}function Yp(e,t,n,i){let o=[],{caseSensitive:l=!1,allowPartialMatch:u=!0}=i;if(ya(e)){for(let[d,p]of Object.entries(e))if(u?l?d.startsWith(t):d.toLowerCase().startsWith(t.toLowerCase()):l?d===t:d.toLowerCase()===t.toLowerCase())if(Ar(p)){let g=Hn([...n,d],"completion",p.children,e);o.push({completion:p.self,path:[...n,d],type:"completion",semanticType:g,namespace:p.children})}else{let g=Hn([...n,d],"namespace",p,e);o.push({path:[...n,d],type:"namespace",semanticType:g,namespace:p})}}else if(Ar(e)){if(u?l?e.self.label.startsWith(t):e.self.label.toLowerCase().startsWith(t.toLowerCase()):l?e.self.label===t:e.self.label.toLowerCase()===t.toLowerCase()){let d=Hn([...n,e.self.label],"completion",e.children);o.push({completion:e.self,path:[...n,e.self.label],type:"completion",semanticType:d,namespace:e.children})}o.push(...Yp(e.children,t,n,i))}else if(Zn(e)){for(let d of e)if(typeof d=="string"){if(u?l?d.startsWith(t):d.toLowerCase().startsWith(t.toLowerCase()):l?d===t:d.toLowerCase()===t.toLowerCase()){let p=Hn([...n,d],"string",void 0,e);o.push({value:d,path:[...n,d],type:"string",semanticType:p})}}else if(u?l?d.label.startsWith(t):d.label.toLowerCase().startsWith(t.toLowerCase()):l?d.label===t:d.label.toLowerCase()===t.toLowerCase()){let p=Hn([...n,d.label],"completion",void 0,e);o.push({completion:d,path:[...n,d.label],type:"completion",semanticType:p})}}return o}function Zp(e,t,n={}){let i=[],{maxDepth:o=10}=n;Cu(e,[],i,o);let{caseSensitive:l=!1}=n;return i.filter(u=>u.path.some(d=>l?d===t:d.toLowerCase()===t.toLowerCase())).sort((u,d)=>{var w,x;let p=l?u.path[u.path.length-1]===t:((w=u.path[u.path.length-1])==null?void 0:w.toLowerCase())===t.toLowerCase(),g=l?d.path[d.path.length-1]===t:((x=d.path[d.path.length-1])==null?void 0:x.toLowerCase())===t.toLowerCase();return p&&!g?-1:!p&&g?1:u.path.length-d.path.length})}function Cu(e,t,n,i){if(!(t.length>=i)){if(ya(e))for(let[o,l]of Object.entries(e)){let u=[...t,o];if(Ar(l)){let d=Hn(u,"completion",l.children,e);n.push({completion:l.self,path:u,type:"completion",semanticType:d,namespace:l.children}),Cu(l.children,u,n,i)}else{let d=Hn(u,"namespace",l,e);n.push({path:u,type:"namespace",semanticType:d,namespace:l}),Cu(l,u,n,i)}}else if(Ar(e)){let o=Hn(t,"completion",e.children);n.push({completion:e.self,path:t,type:"completion",semanticType:o,namespace:e.children}),Cu(e.children,t,n,i)}else if(Zn(e))for(let o of e)if(typeof o=="string"){let l=Hn([...t,o],"string",void 0,e);n.push({value:o,path:[...t,o],type:"string",semanticType:l})}else{let l=Hn([...t,o.label],"completion",void 0,e);n.push({completion:o,path:[...t,o.label],type:"completion",semanticType:l})}}}function e2(e,t,n={}){let{enableFuzzySearch:i=!1}=n,o=ku(e,t,n);if(o)return o;let l=iA(e,t,n);if(l.length>0)return l[0]||null;if(i){let u=Zp(e,t,n);if(u.length>0)return u[0]||null}return null}const em=Gs.define({combine:e=>e[0]??null});function t2(e,t){let n=e??t.state.facet(em);return n==null?null:typeof n=="function"?n(t):n}function n2(e,t){let n=e??t.state.facet(em);return n==null?null:typeof n=="function"?t.view?n(t.view):null:n}function tm(e){if(e==null)return null;let t=Ar(e)?e.children:e;return Zn(t)?t:null}function r2(e,t){var u,d;let n=tm((u=ku(e,t,{caseSensitive:!1}))==null?void 0:u.namespace);if(n)return n;let i=(typeof t=="string"?t.split("."):t).map(p=>p.toLowerCase()),o=i[i.length-1];if(!o)return null;let l=Zp(e,o).filter(p=>{if(tm(p.namespace)===null||p.path.length<i.length)return!1;let g=p.path.slice(-i.length).map(w=>w.toLowerCase());return i.every((w,x)=>g[x]===w)});return l.length===1?tm((d=l[0])==null?void 0:d.namespace):null}function i2(e,t,n){if(typeof e=="string")return n===void 0?{label:e,type:"property",detail:t}:{label:e,type:"property",detail:t,boost:n};let i={...e,type:"property",detail:e.detail??t};return n!==void 0&&i.boost===void 0&&(i.boost=n),i}const aA=e=>{let t;return async()=>(t||(t=e()),await t)};var Jr=class{constructor(e={}){pe(this,"opts");pe(this,"parser",null);pe(this,"offsetRecord",{});pe(this,"getParser",aA(async()=>{if(this.parser)return this.parser;let e=await de(()=>import("./node-sql-parser-DE2GpgS7.js").then(async n=>(await n.__tla,n)).then(KM(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 o,l;this.offsetRecord={};let n=(l=(o=this.opts).getParserOptions)==null?void 0:l.call(o,t.state),i=await this.sanitizeSql(e,n);try{let u=await this.getParser();return(n==null?void 0:n.database)==="DuckDB"?this.parseWithDuckDBSupport(i,n):{success:!0,errors:[],ast:u.astify(i,n)}}catch(u){return{success:!1,errors:[this.extractErrorInfo(u,i)]}}}async sanitizeSql(e,t){if(t!=null&&t.ignoreBrackets){let{sql:n,offsetRecord:i}=lA(e);return this.offsetRecord=i,n}return e}async parseWithDuckDBSupport(e,t){let n=await this.getParser(),i=oA(e).trimStart().toLowerCase();if(i.startsWith("from")||i.includes("macro"))return{success:!0,errors:[]};let o=e;i.includes("create or replace table")&&(this.offsetRecord[e.indexOf("create or replace table")]=-11,o=e.replace(/create or replace table/i,"create table"));try{let l={...t,database:"PostgreSQL"};return{success:!0,errors:[],ast:n.astify(o,l)}}catch(l){return{success:!1,errors:[this.extractErrorInfo(l,e)]}}}extractErrorInfo(e,t){var p,g,w,x;let n=1,i=1,o=(e==null?void 0:e.message)||"SQL parsing error",l=e;if(l!=null&&l.location)n=((p=l.location.start)==null?void 0:p.line)||1,i=((g=l.location.start)==null?void 0:g.column)||1;else if(l!=null&&l.hash)n=l.hash.line||1,i=((w=l.hash.loc)==null?void 0:w.first_column)||1;else{let S=o.match(/line (\d+)/i),E=o.match(/column (\d+)/i);S!=null&&S[1]&&(n=parseInt(S[1],10)),E!=null&&E[1]&&(i=parseInt(E[1],10))}let u=Object.entries(this.offsetRecord).map(([S,E])=>({position:parseInt(S,10),offset:E})).sort((S,E)=>S.position-E.position),d=0;for(let{position:S,offset:E}of u){let T=S+d;d+=E;let O=t.slice(0,T),j=(((x=O.match(/\n/g))==null?void 0:x.length)??0)+1,z=T-O.lastIndexOf(`
|
|
151
|
-
`);n===j&&i>z&&(i-=E)}return i>t.length&&(i=t.length),{message:this.cleanErrorMessage(o),line:Math.max(1,n),column:Math.max(1,i),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 i,o;let n=t?(o=(i=this.opts).getParserOptions)==null?void 0:o.call(i,t.state):void 0;try{return(await this.getParser()).tableList(e,n).map(l=>{let u=l.split("::");return u[u.length-1]||l})}catch{return[]}}async extractColumnReferences(e,t){var i,o;let n=t!=null&&t.state?(o=(i=this.opts).getParserOptions)==null?void 0:o.call(i,t.state):void 0;try{return(await this.getParser()).columnList(e,n).map(l=>{let u=l.split("::");return u[u.length-1]||l})}catch{return[]}}};function oA(e,t=["/*","--"]){let n=[];if(t.includes("/*")&&n.push("/\\*[\\s\\S]*?\\*/"),t.includes("--")&&n.push("--[^\\n]*"),n.length===0)return e;let i=RegExp(`^\\s*(${n.join("|")})\\s*`,""),o=e,l="";for(;o!==l;)l=o,o=o.replace(i,"");return o}var sA=2;function lA(e){let t={};return{sql:e.replace(/("[^"\\]*(?:\\.[^"\\]*)*")|('[^'\\]*(?:\\.[^'\\]*)*')|(\{[^}]*\})/g,(n,i,o,l,u)=>i||o?n:l?(t[u]=sA,`'${l}'`):n),offsetRecord:t}}function cA(){return{tables:[],ctes:[],aliases:new Map,selectAliases:[]}}function
|
|
152
|
-
`;)t[n]=" ",n++;continue}if(i==="/"&&o==="*"){for(t[n]=" ",t[n+1]=" ",n+=2;n<e.length&&!(e[n]==="*"&&e[n+1]==="/");)t[n]=" ",n++;n<e.length&&(t[n]=" ",t[n+1]=" ",n+=2);continue}if(i==='"'||i==="`"||i==="["){let l=i==="["?"]":i;for(n++;n<e.length&&e[n]!==l;)n++;n++;continue}if(i==="'"){for(t[n]=" ",n++;n<e.length;){if(e[n]==="'"){if(t[n]=" ",e[n+1]==="'"){t[n+1]=" ",n+=2;continue}n++;break}t[n]=" ",n++}continue}n++}return t.join("")}function s2(e){let t={tables:[],ctes:[],selectAliases:[],seenTables:new Set,seenCtes:new Set},n=
|
|
150
|
+
`)}function xu(e){return`<marimo-tex class="arithmatex">||(${e.trim()}||)</marimo-tex>`}function Kp(e){return`<marimo-tex class="arithmatex">||[${e.trim()}||]</marimo-tex>`}function $I(e){return e.startsWith("_")&&!e.startsWith("__")}var VI=class{constructor(e){pe(this,"documentVersion",0);pe(this,"lastSnapshot",null);this.getNotebookCode=e}snapshot(){var n;let e=this.getLens(),t=((n=this.lastSnapshot)==null?void 0:n.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 RI(e,t)}},HI=()=>{let e=Lf().cellHandles;return ki.mapValues(e,t=>{var n;return(n=t.current)==null?void 0:n.editorViewOrNull})};function Qp(e){let t=Ww(e);return Array.isArray(t)?e:t}function Gp(e){return{...e,documentation:Qp(e.documentation)}}function BI(e){return e==null?null:Array.isArray(e)?e.map(t=>Gp(t)):{...e,items:e.items.map(t=>Gp(t))}}function WI(e){return{...e,signatures:e.signatures.map(t=>{var n;return{...t,documentation:Qp(t.documentation),parameters:(n=t.parameters)==null?void 0:n.map(i=>({...i,documentation:Qp(i.documentation)}))}})}}function Qw(e){return na(e)&&typeof e.line=="number"&&typeof e.character=="number"}function Gw(e){return na(e)&&Qw(e.start)&&Qw(e.end)}function UI(e){return na(e)&&typeof e.message=="string"&&Gw(e.range)}function KI(e){if(e.method!=="textDocument/publishDiagnostics"||!na(e.params))return!1;let{uri:t,version:n,diagnostics:i}=e.params;return typeof t=="string"&&(n===void 0||typeof n=="number")&&Array.isArray(i)&&i.every(UI)}let Sl,_u,Xw,Jw,Yw;Sl=class{constructor(e,t,n=HI){pe(this,"seenCellDocumentUris",new Set);pe(this,"completionItemCache",new du(10));pe(this,"openCellDocumentCounts",new Map);pe(this,"latestDiagnosticsVersion",null);pe(this,"forwardedDiagnosticsVersion",0);this.documentUri=Vw(),this.getNotebookEditors=n,this.initialSettings=t,this.client=e,this.patchProcessNotification(),this.initializePromise.then(()=>{Vn($w(this.client),"notify is not a method on the client"),this.client.notify("workspace/didChangeConfiguration",{settings:t})}),this.snapshotter=new VI(this.getNotebookCode.bind(this))}pruneSeenCellUris(e){for(let t of this.seenCellDocumentUris){let n=_n.parse(t);e.has(n)||this.seenCellDocumentUris.delete(t)}}onNotification(e){return this.client.onNotification(e)}get ready(){return this.client.ready}set ready(e){this.client.ready=e}get capabilities(){return this.client.capabilities}set capabilities(e){this.client.capabilities=e}get initializePromise(){return this.client.initializePromise}set initializePromise(e){this.client.initializePromise=e}get clientCapabilities(){return this.client.clientCapabilities}async initialize(){await this.client.initialize()}close(){this.openCellDocumentCounts.clear(),this.client.close()}hasCapability(e){return this.client.hasCapability(e)}async resyncAllDocuments(){Vn($w(this.client),"notify is not a method on the client"),await this.client.initialize(),await this.client.notify("workspace/didChangeConfiguration",{settings:this.initialSettings});let{lens:e,version:t}=this.snapshotter.snapshot();this.latestDiagnosticsVersion=null,this.forwardedDiagnosticsVersion=0,this.openCellDocumentCounts.size>0&&await this.client.notify("textDocument/didOpen",{textDocument:{languageId:"python",text:e.mergedText,uri:this.documentUri,version:t}}),Se.log("[lsp] Document re-synchronization complete")}getNotebookCode(){return Me.get(TI)}assertCellDocumentUri(e){Vn(_n.is(e),"Execpted URI to be CellDocumentUri")}async textDocumentDidOpen(e){Se.debug("[lsp] textDocumentDidOpen",e);let t=e.textDocument.uri;this.assertCellDocumentUri(t);let{lens:n,version:i}=this.snapshotter.snapshot(),o=this.openCellDocumentCounts.get(t)??0;this.openCellDocumentCounts.set(t,o+1);try{let l=await this.client.textDocumentDidOpen({textDocument:{languageId:e.textDocument.languageId,text:n.mergedText,uri:this.documentUri,version:i}});return this.seenCellDocumentUris.add(t),l!==!1}catch(l){let u=this.openCellDocumentCounts.get(t)??0;throw u<=1?this.openCellDocumentCounts.delete(t):this.openCellDocumentCounts.set(t,u-1),l}}async textDocumentDidClose(e){let t=e.textDocument.uri;this.assertCellDocumentUri(t);let n=this.openCellDocumentCounts.get(t)??0;if(n===0){Se.warn("[lsp] textDocumentDidClose with no tracked open",t);return}n<=1?this.openCellDocumentCounts.delete(t):this.openCellDocumentCounts.set(t,n-1),await this.client.textDocumentDidClose({textDocument:{uri:this.documentUri}})}async sync(){let{lens:e,version:t,didChange:n}=this.snapshotter.snapshot(),i={textDocument:{uri:this.documentUri,version:t},contentChanges:[{text:e.mergedText}]};return n&&await this.client.textDocumentDidChange(i),{params:i,lens:e}}async textDocumentDidChange(e){if(Se.debug("[lsp] textDocumentDidChange",e),e.contentChanges.length===1){await this.sync();return}Se.warn("[lsp] Unhandled textDocumentDidChange",e),await this.client.textDocumentDidChange(e)}async textDocumentWillSave(e){this.assertCellDocumentUri(e.textDocument.uri),await this.client.textDocumentWillSave({...e,textDocument:{uri:this.documentUri}})}async textDocumentWillSaveWaitUntil(e){return this.assertCellDocumentUri(e.textDocument.uri),Se.debug("[lsp] willSaveWaitUntil edits are disabled for notebook documents"),null}async textDocumentDidSave(e){this.assertCellDocumentUri(e.textDocument.uri);let{lens:t}=this.snapshotter.snapshot();await this.client.textDocumentDidSave({textDocument:{uri:this.documentUri},text:e.text===void 0?void 0:t.mergedText})}async textDocumentDefinition(e){let t=e.textDocument.uri;if(!_n.is(t))return Se.warn("Invalid cell document URI",t),null;let{lens:n}=await this.sync(),i=_n.parse(t);return this.client.textDocumentDefinition({...e,textDocument:{uri:this.documentUri},position:n.transformPosition(e.position,i)})}async textDocumentSignatureHelp(e){let t=e.textDocument.uri;if(!_n.is(t))return Se.warn("Invalid cell document URI",t),null;let{lens:n}=await this.sync(),i=_n.parse(t),o=await this.client.textDocumentSignatureHelp({...e,textDocument:{uri:this.documentUri},position:n.transformPosition(e.position,i)});return o?WI(o):null}textDocumentCodeAction(e){return Promise.resolve(null)}codeActionResolve(e){return Promise.resolve(e)}reverseRelatedInformation(e,t){if(e)return e.map(n=>{if(!na(n)||!na(n.location)||n.location.uri!==this.documentUri||!Gw(n.location.range))return n;let i=t.cellIds.find(o=>t.isInRange(n.location.range,o));return i===void 0?n:{...n,location:{uri:_n.of(i),range:t.reverseRange(n.location.range,i)}}})}async textDocumentRename(e){var O;let t=e.textDocument.uri;if(!_n.is(t))return Se.warn("Invalid cell document URI",t),null;let n=_n.parse(t),{lens:i}=await this.sync(),o=i.transformPosition(e.position,n),l=await this.client.textDocumentRename({...e,textDocument:{uri:this.documentUri},position:o});if(!l)return null;let u=(O=l.documentChanges)==null?void 0:O.flatMap(j=>"edits"in j?j.edits:[]);if(!u||u.length!==1)return Se.warn("Expected exactly one edit",u),l;let d=u[0];if(!("newText"in d))return Se.warn("Expected newText in edit",d),l;let p=i.getEditsForNewText(d.newText),g=new Map(p.map(j=>[j.cellId,j.text])),w=this.getNotebookEditors(),x=w[n],S=!1;if(x){let j=x.state.doc.line(e.position.line+1).from+e.position.character,{startToken:z,endToken:V}=qp(x.state.doc,j),P=x.state.doc.sliceString(z,V);S=$I(P),S&&Se.debug("[lsp] Private variable rename detected, limiting to current cell",P)}let E=[],T=0;for(let[j,z]of ki.entries(w)){if(S&&j!==n)continue;let V=g.get(j);if(V==null){Se.warn("[lsp] No new code for cell during rename",j),E.push(j);continue}if(!z){Se.warn("[lsp] No editor view for cell during rename",j),E.push(j);continue}ci(z)!==V&&(Bo(z,V),T++)}return E.length>0&&Se.error(`[lsp] Rename partially failed: could not update ${E.length} cell(s)`,E),Se.debug(`[lsp] Rename completed: updated ${T} cell(s)`),{...l,documentChanges:[{edits:[],textDocument:{uri:t,version:0}}]}}async completionItemResolve(e){let t=JSON.stringify(e),n=this.completionItemCache.get(t);if(n)return n;let i=this.client.completionItemResolve(e).then(o=>Gp(o));return this.completionItemCache.set(t,i),i}async textDocumentPrepareRename(e){let t=e.textDocument.uri;if(!_n.is(t))return Se.warn("Invalid cell document URI",t),null;let{lens:n}=await this.sync(),i=_n.parse(t);return this.client.textDocumentPrepareRename({...e,textDocument:{uri:this.documentUri},position:n.transformPosition(e.position,i)})}async textDocumentHover(e){Se.debug("[lsp] textDocumentHover",e);let{lens:t}=await this.sync(),n=_n.parse(e.textDocument.uri),i=await this.client.textDocumentHover({...e,textDocument:{uri:this.documentUri},position:t.transformPosition(e.position,n)});return i?(typeof i.contents=="object"&&"kind"in i.contents&&(i.contents={kind:"markdown",value:i.contents.value}),i.contents=Ww(i.contents)??i.contents,i.contents===""?null:(i.range&&(i.range=t.reverseRange(i.range,n)),i)):(Se.debug("[lsp] no hover result"),i)}async textDocumentCompletion(e){let{lens:t}=this.snapshotter.getLatestSnapshot();if(!_n.is(e.textDocument.uri))return Se.error("[lsp] Invalid cell document URI in completion request",e.textDocument.uri),null;let n=_n.parse(e.textDocument.uri);if(!n||n==="undefined")return Se.error("[lsp] Invalid cellId 'undefined' in completion request",{cellId:n,uri:e.textDocument.uri,availableCellIds:t.cellIds}),null;t.cellIds.includes(n)||Se.warn("[lsp] CellId in completion request not found in current lens",{cellId:n,uri:e.textDocument.uri,availableCellIds:t.cellIds});let i=t.transformPosition(e.position,n);return BI(await this.client.textDocumentCompletion({...e,textDocument:{uri:this.documentUri},position:i}))}patchProcessNotification(){Vn(gI(this.client),"processNotification is not a method on the client");let e=this.client.processNotification.bind(this.client),t=n=>{var i;if(KI(n)){let o=n.params.version;if(o!=null){let S=this.latestDiagnosticsVersion;if(S!==null&&Number.isFinite(o)&&o<S){Se.debug("[lsp] dropping stale diagnostics notification",n);return}this.latestDiagnosticsVersion=o}Se.debug("[lsp] handling diagnostics",n);let l=this.snapshotter.getLatestSnapshot(),u=n.params.diagnostics,{lens:d}=l,p=++this.forwardedDiagnosticsVersion,g=new Map;for(let S of u)for(let E of d.cellIds)if(d.isInRange(S.range,E)){g.has(E)||g.set(E,[]);let T=this.reverseRelatedInformation(S.relatedInformation,d),O={...S,range:d.reverseRange(S.range,E),...T?{relatedInformation:T}:{}};(i=g.get(E))==null||i.push(O);break}let w=new Set(d.cellIds);this.pruneSeenCellUris(w);let x=new Set(this.seenCellDocumentUris);for(let[S,E]of g.entries()){Se.debug("[lsp] diagnostics for cell",S,E);let T=_n.of(S);x.delete(T),e({...n,params:{...n.params,uri:T,version:p,diagnostics:E}})}if(x.size>0){Se.debug("[lsp] clearing diagnostics",x);for(let S of x)e({method:"textDocument/publishDiagnostics",params:{uri:S,version:p,diagnostics:[]}})}return}return e(n)};this.client.processNotification=t}},_u=1e3,Xw=new Set(["textDocument/didOpen","textDocument/didChange","textDocument/didClose"]),Jw=new Set(["initialize","initialized","workspace/didChangeConfiguration","textDocument/didOpen"]),v0=class{constructor(e){pe(this,"isDelegateConnected",!1);pe(this,"connectionGeneration",0);pe(this,"isClosed",!1);pe(this,"hasConnectedBefore",!1);pe(this,"messageHandlers",new Set);pe(this,"pendingMessages",[]);pe(this,"hasLoggedQueueOverflow",!1);this.options={...e,retries:e.retries??1,retryDelayMs:e.retryDelayMs??1e3},this.onReconnect=e.onReconnect}async connect(){if(this.isClosed)throw Error("Transport is closed");if(this.isDelegateConnected)return;if(this.connectionPromise)return this.connectionPromise;let e=++this.connectionGeneration,t=this.connectWithRetries(e).finally(()=>{this.connectionPromise===t&&(this.connectionPromise=void 0)});return this.connectionPromise=t,t}isStale(e){return this.isClosed||e!==this.connectionGeneration}send(e){if(!this.isClosed){if(this.delegate&&this.isDelegateConnected&&(this.restoringGeneration===void 0||this.canSendWhileRestoring(e))){this.delegate.send(e);return}this.pendingMessages.length<_u?this.pendingMessages.push(e):this.hasLoggedQueueOverflow||(this.hasLoggedQueueOverflow=!0,Se.error(`LSP reconnect queue is full (${_u}); dropping messages until it drains`)),this.reconnect()}}onMessage(e){return this.messageHandlers.add(e),()=>{this.messageHandlers.delete(e)}}close(){var e;this.isClosed||(this.isClosed=!0,this.isDelegateConnected=!1,this.restoringGeneration=void 0,this.connectionGeneration++,this.connectionPromise=void 0,this.pendingMessages=[],this.inFlightBacklog=void 0,this.messageHandlers.clear(),this.disposeDelegate(),(e=this.delegate)==null||e.close(),this.delegate=void 0)}async connectWithRetries(e){var i,o;let t;for(let l=1;l<=this.options.retries;l++)try{await this.connectDelegate(e);return}catch(u){if(t=u instanceof Error?u:Error(String(u)),this.isStale(e))throw t;this.invalidateDelegate(),Se.warn(`WebSocket connection attempt ${l}/${this.options.retries} failed`,t),l<this.options.retries&&await new Promise(d=>setTimeout(d,this.options.retryDelayMs))}let n=t??Error("WebSocket connection failed");throw(o=(i=this.options).onConnectionFailure)==null||o.call(i,n),n}async connectDelegate(e){var l,u,d;if(await((u=(l=this.options).waitForConnection)==null?void 0:u.call(l)),this.isStale(e))throw Error("Connection attempt abandoned");let t=this.createDelegate();if(await t.connect(),this.isStale(e)||this.delegate!==t)throw t.close(),Error("Transport closed while connecting");this.isDelegateConnected=!0;let n=this.hasConnectedBefore;this.hasConnectedBefore=!0;let i=this.detachPendingMessages();this.inFlightBacklog=i;try{if(n){this.restoringGeneration=e;try{await((d=this.onReconnect)==null?void 0:d.call(this))}finally{this.restoringGeneration===e&&(this.restoringGeneration=void 0)}}if(this.isStale(e)||this.delegate!==t||!this.isDelegateConnected)throw Error("WebSocket closed while restoring LSP state")}catch(p){throw this.isStale(e)||this.reclaimInFlightBacklog(),p}let o=n&&this.onReconnect?i.filter(p=>!("method"in p&&Xw.has(p.method))):i;this.inFlightBacklog=void 0;for(let p of[...o,...this.detachPendingMessages()])t.send(p);Se.log("WebSocket transport connected successfully")}detachPendingMessages(){let e=this.pendingMessages;return this.pendingMessages=[],this.hasLoggedQueueOverflow=!1,e}reclaimInFlightBacklog(){this.inFlightBacklog&&(this.inFlightBacklog=(this.pendingMessages=[...this.inFlightBacklog,...this.pendingMessages].slice(0,_u),void 0))}canSendWhileRestoring(e){return!("method"in e)||Jw.has(e.method)}createDelegate(){this.invalidateDelegate();let e=new vb(this.options.getWsUrl());return this.delegate=e,this.disposeDelegateMessage=e.onMessage(t=>{for(let n of this.messageHandlers)try{n(t)}catch(i){Se.error("LSP message handler failed",i)}}),this.disposeDelegateClose=e.onClose(t=>{this.delegate!==e||this.isClosed||(Se.warn("WebSocket transport connection closed",t),this.isDelegateConnected=!1,this.disposeDelegate(),this.delegate=void 0,this.restoringGeneration=void 0,this.reclaimInFlightBacklog(),this.connectionPromise=void 0,queueMicrotask(()=>this.reconnect()))}),e}reconnect(){this.connect().catch(e=>{Se.error("WebSocket transport reconnection failed",e)})}invalidateDelegate(){var e;this.isDelegateConnected=!1,this.restoringGeneration=void 0,this.disposeDelegate(),(e=this.delegate)==null||e.close(),this.delegate=void 0}disposeDelegate(){var e,t;(e=this.disposeDelegateMessage)==null||e.call(this),this.disposeDelegateMessage=void 0,(t=this.disposeDelegateClose)==null||t.call(this),this.disposeDelegateClose=void 0}},Yw=new Set([1,2]);function QI(e,t){if(!("method"in t)||t.method!=="window/logMessage")return;let n=t.params;!na(n)||typeof n.message!="string"||px({logs:[{timestamp:Date.now()/1e3,level:Yw.has(n.type)?"stderr":"stdout",message:n.message,source:{type:"lsp",name:e}}]})}function ku(e,t){let n=u5(),i=new v0({getWsUrl:()=>n.getLSPURL(e).toString(),waitForConnection:async()=>{await c5()},onReconnect:t});return i.onMessage(o=>QI(e,o)),i}sr.define(),new Yd;function GI(e){return e.facet(M5.readOnly)}function XI(e){return[nS(e),Si.of([{key:"ArrowRight",preventDefault:!0,run:t=>Zw(t,e)},{key:"Tab",preventDefault:!0,run:t=>Zw(t,e)}])]}function Zw(e,t){if(GI(e.state))return!1;let n=e.state.doc.length;return n===0?(e.dispatch({changes:{from:0,to:n,insert:t},selection:{head:t.length,anchor:t.length}}),!0):!1}function JI(e){let{beforeText:t,linkText:n,afterText:i,onClick:o}=e;return[nS(l=>{let u=document.createElement("span");u.append(document.createTextNode(t));let d=document.createElement("span");return d.textContent=n,d.classList.add("cm-clickable-placeholder"),d.onclick=p=>{p.stopPropagation(),o(l)},u.append(d),u.append(document.createTextNode(i)),u}),At.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 YI=Ur(e=>{let t,n={transport:ku("pylsp",async()=>{await(t==null?void 0:t())}),rootUri:vu(),workspaceFolders:bu()},i=e==null?void 0:e.pylsp,o=["D100","D103"],l=["W292","E402","E302","E305"],u=["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:i==null?void 0:i.enable_flake8,extendIgnore:l},pydocstyle:{enabled:i==null?void 0:i.enable_pydocstyle,ignore:o},pylint:{enabled:i==null?void 0:i.enable_pylint},pyflakes:{enabled:i==null?void 0:i.enable_pyflakes},pylsp_mypy:{enabled:i==null?void 0:i.enable_mypy,live_mode:!0},ruff:{enabled:i==null?void 0:i.enable_ruff,extendIgnore:[...l,...o,...u]},signature:{formatter:i!=null&&i.enable_ruff?"ruff":"black",line_length:88}}}},p=new Sl(new nl({...n}),d);return t=()=>p.resyncAllDocuments(),p}),ZI=Ur(e=>{let t,n=new Sl(new nl({transport:ku("ty",async()=>{await(t==null?void 0:t())}),rootUri:vu(),workspaceFolders:bu(),getWorkspaceConfiguration:i=>[{disableLanguageServices:!0}]}),{});return t=()=>n.resyncAllDocuments(),n}),eA=Ur(e=>{var i;let t,n=new Sl(new nl({transport:ku("pyrefly",async()=>{await(t==null?void 0:t())}),rootUri:vu(),workspaceFolders:bu(),initializationOptions:{pyrefly:{displayTypeErrors:((i=e.diagnostics)==null?void 0:i.enabled)??!1?"force-on":"force-off"}}}),{});return t=()=>n.resyncAllDocuments(),n}),tA=Ur(e=>{let t,n=new Sl(new nl({transport:ku("basedpyright",async()=>{await(t==null?void 0:t())}),rootUri:vu(),workspaceFolders:bu()}),{});return t=()=>n.resyncAllDocuments(),n}),nA=class{constructor(){pe(this,"parser",new Zb);pe(this,"type","python");pe(this,"defaultCode",this.parser.defaultCode);pe(this,"defaultMetadata",this.parser.defaultMetadata)}transformIn(e){let t=this.parser.transformIn(e);return[t.code,t.offset,t.metadata]}transformOut(e,t){let n=this.parser.transformOut(e,t);return[n.code,n.offset]}isSupported(e){return this.parser.isSupported(e)}getExtension(e,t,n,i,o){return[(()=>{var w,x,S,E,T;let l={defaultKeymap:!1,activateOnTyping:t.activate_on_typing,closeOnBlur:!1},u={hideOnChange:!0},d=[];(w=o==null?void 0:o.pylsp)!=null&&w.enabled&&ya("pylsp")&&d.push(YI(o)),(x=o==null?void 0:o.ty)!=null&&x.enabled&&ya("ty")&&d.push(ZI(o)),(S=o==null?void 0:o.pyrefly)!=null&&S.enabled&&ya("pyrefly")&&d.push(eA(o)),(E=o==null?void 0:o.basedpyright)!=null&&E.enabled&&ya("basedpyright")&&d.push(tA(o));let p=t.signature_hint_on_typing,g=p?/(\w+|\w+\.|\/)$/:/(\w+|\w+\.|\(|\/|,)$/;if(d.length>0){let O=d.length===1?d[0]:new bI(d),j=z=>{Se.debug("openExternalLocation",z),!(O.documentUri===z.uri||yI(z.uri))&&Sr().openFile({path:z.uri.replace("file://","")})};return[r0({client:O,languageId:"python",allowHTMLContent:!0,markdownRenderer:_I(),useSnippetOnCompletion:!0,clientSideFiltering:!0,hoverConfig:u,completionConfig:l,diagnosticsEnabled:((T=o.diagnostics)==null?void 0:T.enabled)??!1,sendIncrementalChanges:!1,signatureHelpEnabled:!0,signatureActivateOnTyping:p,signatureHelpOptions:{position:"above"},keyboardShortcuts:{signatureHelp:n.getHotkey("cell.signatureHelp").key,goToDefinition:n.getHotkey("cell.goToDefinition").key,rename:n.getHotkey("cell.renameSymbol").key},completionMatchBefore:g,onGoToDefinition:j,onShowLocation:j}),fb.of(_n.of(e))]}return[tf({...l,override:[jw]}),Mf]})(),Yg(),rA(i)]}};function rA(e){return e==="marimo-import"?ef.highest(XI("import marimo as mo")):e==="ai"?JI({beforeText:"Start coding or ",linkText:"generate",afterText:" with AI.",onClick:t=>{t.state.facet(Lt).aiCellCompletion()}}):[]}var Xp=jg.configure({props:[I5.add({ParenthesizedExpression:XC,ArgList:XC})]});Yg=function(){return new rS(Xp,[Xp.data.of({autocomplete:O6}),Xp.data.of({autocomplete:M6})])};function va(e){return typeof e=="object"&&!Array.isArray(e)&&!Ar(e)}function Ar(e){if(typeof e!="object"||Array.isArray(e)||!("self"in e)||!("children"in e))return!1;let t=e.self;return typeof t=="object"&&!!t&&!Array.isArray(t)&&typeof t.label=="string"}function Zn(e){return Array.isArray(e)}function Hn(e,t,n,i){let o=e.length;if(t==="string"||t==="completion"&&i&&Zn(i))return"column";if(t==="namespace"&&n){if(Zn(n))return"table";if(va(n))return Object.values(n).some(l=>Zn(l)||Ar(l)&&Zn(l.children))?o<=1?"database":"schema":o===0?"database":"namespace"}if(t==="completion"&&n)return Zn(n)?"table":(va(n)&&Object.values(n).some(l=>Zn(l)||Ar(l)&&Zn(l.children)),o<=1?"database":"schema");switch(o){case 0:return"database";case 1:return"schema";default:return"namespace"}}function Cu(e,t,n={}){let{maxDepth:i=10}=n;if((typeof t=="string"?t==="":t.length===0)&&Ar(e)){let l=Hn([],"completion",e.children);return{completion:e.self,path:[],type:"completion",semanticType:l,namespace:e.children}}let o=(typeof t=="string"?t.split("."):t).filter(l=>l.length>0);return o.length===0||o.length>i?null:Jp(e,o,[],n)}function Jp(e,t,n,i,o){if(t.length===0){if(Ar(e)){let p=Hn(n,"completion",e.children,o);return{completion:e.self,path:n,type:"completion",semanticType:p,namespace:e.children}}return{path:n,type:"namespace",semanticType:Hn(n,"namespace",e,o),namespace:e}}let[l,...u]=t,{caseSensitive:d=!1}=i;if(!l)return null;if(va(e)){let p=d?Object.keys(e).find(g=>g===l):Object.keys(e).find(g=>g.toLowerCase()===l.toLowerCase());if(p){let g=e[p];if(g)return Jp(g,u,[...n,p],i,e)}}else{if(Ar(e))return Jp(e.children,t,n,i,e);if(Zn(e)){for(let p of e)if(typeof p=="string"){if((d?p===l:p.toLowerCase()===l.toLowerCase())&&u.length===0){let g=Hn([...n,p],"string",void 0,e);return{value:p,path:[...n,p],type:"string",semanticType:g}}}else if((d?p.label===l:p.label.toLowerCase()===l.toLowerCase())&&u.length===0){let g=Hn([...n,p.label],"completion",void 0,e);return{completion:p,path:[...n,p.label],type:"completion",semanticType:g}}}}return null}function iA(e,t,n={}){let i=[];if(t.includes(".")){let o=t.lastIndexOf("."),l=t.substring(0,o),u=t.substring(o+1),d=Cu(e,l,n);if(d!=null&&d.namespace)return Yp(d.namespace,u,d.path,n)}else return Yp(e,t,[],n);return i}function Yp(e,t,n,i){let o=[],{caseSensitive:l=!1,allowPartialMatch:u=!0}=i;if(va(e)){for(let[d,p]of Object.entries(e))if(u?l?d.startsWith(t):d.toLowerCase().startsWith(t.toLowerCase()):l?d===t:d.toLowerCase()===t.toLowerCase())if(Ar(p)){let g=Hn([...n,d],"completion",p.children,e);o.push({completion:p.self,path:[...n,d],type:"completion",semanticType:g,namespace:p.children})}else{let g=Hn([...n,d],"namespace",p,e);o.push({path:[...n,d],type:"namespace",semanticType:g,namespace:p})}}else if(Ar(e)){if(u?l?e.self.label.startsWith(t):e.self.label.toLowerCase().startsWith(t.toLowerCase()):l?e.self.label===t:e.self.label.toLowerCase()===t.toLowerCase()){let d=Hn([...n,e.self.label],"completion",e.children);o.push({completion:e.self,path:[...n,e.self.label],type:"completion",semanticType:d,namespace:e.children})}o.push(...Yp(e.children,t,n,i))}else if(Zn(e)){for(let d of e)if(typeof d=="string"){if(u?l?d.startsWith(t):d.toLowerCase().startsWith(t.toLowerCase()):l?d===t:d.toLowerCase()===t.toLowerCase()){let p=Hn([...n,d],"string",void 0,e);o.push({value:d,path:[...n,d],type:"string",semanticType:p})}}else if(u?l?d.label.startsWith(t):d.label.toLowerCase().startsWith(t.toLowerCase()):l?d.label===t:d.label.toLowerCase()===t.toLowerCase()){let p=Hn([...n,d.label],"completion",void 0,e);o.push({completion:d,path:[...n,d.label],type:"completion",semanticType:p})}}return o}function Zp(e,t,n={}){let i=[],{maxDepth:o=10}=n;Su(e,[],i,o);let{caseSensitive:l=!1}=n;return i.filter(u=>u.path.some(d=>l?d===t:d.toLowerCase()===t.toLowerCase())).sort((u,d)=>{var w,x;let p=l?u.path[u.path.length-1]===t:((w=u.path[u.path.length-1])==null?void 0:w.toLowerCase())===t.toLowerCase(),g=l?d.path[d.path.length-1]===t:((x=d.path[d.path.length-1])==null?void 0:x.toLowerCase())===t.toLowerCase();return p&&!g?-1:!p&&g?1:u.path.length-d.path.length})}function Su(e,t,n,i){if(!(t.length>=i)){if(va(e))for(let[o,l]of Object.entries(e)){let u=[...t,o];if(Ar(l)){let d=Hn(u,"completion",l.children,e);n.push({completion:l.self,path:u,type:"completion",semanticType:d,namespace:l.children}),Su(l.children,u,n,i)}else{let d=Hn(u,"namespace",l,e);n.push({path:u,type:"namespace",semanticType:d,namespace:l}),Su(l,u,n,i)}}else if(Ar(e)){let o=Hn(t,"completion",e.children);n.push({completion:e.self,path:t,type:"completion",semanticType:o,namespace:e.children}),Su(e.children,t,n,i)}else if(Zn(e))for(let o of e)if(typeof o=="string"){let l=Hn([...t,o],"string",void 0,e);n.push({value:o,path:[...t,o],type:"string",semanticType:l})}else{let l=Hn([...t,o.label],"completion",void 0,e);n.push({completion:o,path:[...t,o.label],type:"completion",semanticType:l})}}}function e2(e,t,n={}){let{enableFuzzySearch:i=!1}=n,o=Cu(e,t,n);if(o)return o;let l=iA(e,t,n);if(l.length>0)return l[0]||null;if(i){let u=Zp(e,t,n);if(u.length>0)return u[0]||null}return null}const em=Gs.define({combine:e=>e[0]??null});function t2(e,t){let n=e??t.state.facet(em);return n==null?null:typeof n=="function"?n(t):n}function n2(e,t){let n=e??t.state.facet(em);return n==null?null:typeof n=="function"?t.view?n(t.view):null:n}function tm(e){if(e==null)return null;let t=Ar(e)?e.children:e;return Zn(t)?t:null}function r2(e,t){var u,d;let n=tm((u=Cu(e,t,{caseSensitive:!1}))==null?void 0:u.namespace);if(n)return n;let i=(typeof t=="string"?t.split("."):t).map(p=>p.toLowerCase()),o=i[i.length-1];if(!o)return null;let l=Zp(e,o).filter(p=>{if(tm(p.namespace)===null||p.path.length<i.length)return!1;let g=p.path.slice(-i.length).map(w=>w.toLowerCase());return i.every((w,x)=>g[x]===w)});return l.length===1?tm((d=l[0])==null?void 0:d.namespace):null}function i2(e,t,n){if(typeof e=="string")return n===void 0?{label:e,type:"property",detail:t}:{label:e,type:"property",detail:t,boost:n};let i={...e,type:"property",detail:e.detail??t};return n!==void 0&&i.boost===void 0&&(i.boost=n),i}const aA=e=>{let t;return async()=>(t||(t=e()),await t)};var Jr=class{constructor(e={}){pe(this,"opts");pe(this,"parser",null);pe(this,"offsetRecord",{});pe(this,"getParser",aA(async()=>{if(this.parser)return this.parser;let e=await de(()=>import("./node-sql-parser-BAQ3SN57.js").then(async n=>(await n.__tla,n)).then(KM(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 o,l;this.offsetRecord={};let n=(l=(o=this.opts).getParserOptions)==null?void 0:l.call(o,t.state),i=await this.sanitizeSql(e,n);try{let u=await this.getParser();return(n==null?void 0:n.database)==="DuckDB"?this.parseWithDuckDBSupport(i,n):{success:!0,errors:[],ast:u.astify(i,n)}}catch(u){return{success:!1,errors:[this.extractErrorInfo(u,i)]}}}async sanitizeSql(e,t){if(t!=null&&t.ignoreBrackets){let{sql:n,offsetRecord:i}=lA(e);return this.offsetRecord=i,n}return e}async parseWithDuckDBSupport(e,t){let n=await this.getParser(),i=oA(e).trimStart().toLowerCase();if(i.startsWith("from")||i.includes("macro"))return{success:!0,errors:[]};let o=e;i.includes("create or replace table")&&(this.offsetRecord[e.indexOf("create or replace table")]=-11,o=e.replace(/create or replace table/i,"create table"));try{let l={...t,database:"PostgreSQL"};return{success:!0,errors:[],ast:n.astify(o,l)}}catch(l){return{success:!1,errors:[this.extractErrorInfo(l,e)]}}}extractErrorInfo(e,t){var p,g,w,x;let n=1,i=1,o=(e==null?void 0:e.message)||"SQL parsing error",l=e;if(l!=null&&l.location)n=((p=l.location.start)==null?void 0:p.line)||1,i=((g=l.location.start)==null?void 0:g.column)||1;else if(l!=null&&l.hash)n=l.hash.line||1,i=((w=l.hash.loc)==null?void 0:w.first_column)||1;else{let S=o.match(/line (\d+)/i),E=o.match(/column (\d+)/i);S!=null&&S[1]&&(n=parseInt(S[1],10)),E!=null&&E[1]&&(i=parseInt(E[1],10))}let u=Object.entries(this.offsetRecord).map(([S,E])=>({position:parseInt(S,10),offset:E})).sort((S,E)=>S.position-E.position),d=0;for(let{position:S,offset:E}of u){let T=S+d;d+=E;let O=t.slice(0,T),j=(((x=O.match(/\n/g))==null?void 0:x.length)??0)+1,z=T-O.lastIndexOf(`
|
|
151
|
+
`);n===j&&i>z&&(i-=E)}return i>t.length&&(i=t.length),{message:this.cleanErrorMessage(o),line:Math.max(1,n),column:Math.max(1,i),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 i,o;let n=t?(o=(i=this.opts).getParserOptions)==null?void 0:o.call(i,t.state):void 0;try{return(await this.getParser()).tableList(e,n).map(l=>{let u=l.split("::");return u[u.length-1]||l})}catch{return[]}}async extractColumnReferences(e,t){var i,o;let n=t!=null&&t.state?(o=(i=this.opts).getParserOptions)==null?void 0:o.call(i,t.state):void 0;try{return(await this.getParser()).columnList(e,n).map(l=>{let u=l.split("::");return u[u.length-1]||l})}catch{return[]}}};function oA(e,t=["/*","--"]){let n=[];if(t.includes("/*")&&n.push("/\\*[\\s\\S]*?\\*/"),t.includes("--")&&n.push("--[^\\n]*"),n.length===0)return e;let i=RegExp(`^\\s*(${n.join("|")})\\s*`,""),o=e,l="";for(;o!==l;)l=o,o=o.replace(i,"");return o}var sA=2;function lA(e){let t={};return{sql:e.replace(/("[^"\\]*(?:\\.[^"\\]*)*")|('[^'\\]*(?:\\.[^'\\]*)*')|(\{[^}]*\})/g,(n,i,o,l,u)=>i||o?n:l?(t[u]=sA,`'${l}'`):n),offsetRecord:t}}function cA(){return{tables:[],ctes:[],aliases:new Map,selectAliases:[]}}function ba(e){return typeof e=="object"&&!!e&&!Array.isArray(e)}function El(e){return Array.isArray(e)?e:[]}function er(e){let t=e[0],n=e[e.length-1];return e.length>=2&&(t==='"'&&n==='"'||t==="'"&&n==="'"||t==="`"&&n==="`"||t==="["&&n==="]")?e.slice(1,-1):e}function nm(e){return typeof e=="string"?e:ba(e)&&typeof e.value=="string"?e.value:null}function a2(e){if(!ba(e)||e.type!=="column_ref")return null;let t=e.column;if(typeof t=="string")return t;if(ba(t)){let n=t.expr,i=ba(n)?n.value:t.value;if(typeof i=="string")return i}return null}function uA(e){let t=El(e.columns).map(l=>nm(l)??a2(l)??nm(l.column)).filter(l=>typeof l=="string");if(t.length>0)return t;let n=e.stmt,i=ba(n)?n.ast??n:null;if(!ba(i)||i.type!=="select")return[];let o=[];for(let l of El(i.columns))if(typeof l.as=="string")o.push(l.as);else{let u=a2(l.expr);u&&u!=="*"&&o.push(u)}return o}function dA(e,t){if(typeof e.table!="string"||e.table.length===0)return;let n=[e.db??e.catalog,e.schema,e.table].filter(l=>typeof l=="string"&&l.length>0).map(er),i=typeof e.as=="string"?er(e.as):void 0,o=`${n.join(".").toLowerCase()}::${(i==null?void 0:i.toLowerCase())??""}`;t.seenTables.has(o)||(t.seenTables.add(o),t.tables.push({name:er(e.table),path:n,...i?{alias:i}:{}}))}function rm(e,t,n){if(Array.isArray(e)){for(let i of e)rm(i,t,n);return}if(!(!ba(e)||n.has(e))){n.add(e);for(let i of El(e.with)){let o=nm(i.name);o&&!t.seenCtes.has(o.toLowerCase())&&(t.seenCtes.add(o.toLowerCase()),t.ctes.push({name:er(o),columns:uA(i).map(er),from:-1,to:-1}))}for(let i of["from","table"])for(let o of El(e[i]))dA(o,t);for(let[i,o]of Object.entries(e))i==="loc"||i==="tableList"||i==="columnList"||rm(o,t,n)}}function fA(e,t){if(e.type==="select")for(let n of El(e.columns))typeof n.as=="string"&&t.selectAliases.push(er(n.as))}function pA(e,t){let n=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),i=`(?:"${n}"|\`${n}\`|\\[${n}\\]|\\b${n})`,o=RegExp(`(${i})\\s*(?:\\([^)]*\\)\\s*)?AS\\s*\\(`,"i").exec(e);return!o||o.index<0||!o[1]?{from:-1,to:-1}:{from:o.index,to:o.index+o[1].length}}var o2=new Set("as.on.using.where.join.inner.left.right.full.cross.outer.natural.lateral.group.order.limit.offset.having.union.intersect.except.select.set.values.when.then.and.or.not.in.is.asc.desc.fetch.window.qualify.returning.with".split(".")),Tl=String.raw`(?:[\w$]+|"[^"]+"|\`[^\`]+\`|\[[^\]]+\])`,mA=`(?!(?:${[...o2].join("|")})\\b)`,im=new RegExp(String.raw`\b(?:from|join)\s+(${Tl}(?:\.${Tl})*)(?:\s+(?:as\s+)?${mA}(${Tl}))?`,"gi");function Eu(e){let t=e.split(""),n=0;for(;n<e.length;){let i=e[n],o=e[n+1];if(i==="-"&&o==="-"){for(;n<e.length&&e[n]!==`
|
|
152
|
+
`;)t[n]=" ",n++;continue}if(i==="/"&&o==="*"){for(t[n]=" ",t[n+1]=" ",n+=2;n<e.length&&!(e[n]==="*"&&e[n+1]==="/");)t[n]=" ",n++;n<e.length&&(t[n]=" ",t[n+1]=" ",n+=2);continue}if(i==='"'||i==="`"||i==="["){let l=i==="["?"]":i;for(n++;n<e.length&&e[n]!==l;)n++;n++;continue}if(i==="'"){for(t[n]=" ",n++;n<e.length;){if(e[n]==="'"){if(t[n]=" ",e[n+1]==="'"){t[n+1]=" ",n+=2;continue}n++;break}t[n]=" ",n++}continue}n++}return t.join("")}function s2(e){let t={tables:[],ctes:[],selectAliases:[],seenTables:new Set,seenCtes:new Set},n=Eu(e);hA(n,t),im.lastIndex=0;let i=im.exec(n);for(;i!==null;){let o=i[1],l=i[2];if(o){let u=o.split(".").map(er),d=u[u.length-1]??"",p=l&&!o2.has(l.toLowerCase())?er(l):void 0,g=`${u.join(".").toLowerCase()}::${(p==null?void 0:p.toLowerCase())??""}`;d&&!t.seenTables.has(g)&&(t.seenTables.add(g),t.tables.push({name:d,path:u,...p?{alias:p}:{}}))}i=im.exec(n)}return l2(t)}function hA(e,t){let n=/\bWITH\s+(?:RECURSIVE\s+)?/gi,i=new RegExp(String.raw`^(${Tl})\s*(?:\(([^)]*)\)\s*)?AS\s*\(`,"i"),o=n.exec(e);for(;o!==null;){let l=o.index+o[0].length;for(;;){let u=i.exec(e.slice(l)),d=u==null?void 0:u[1],p=d?er(d):void 0;if(!u||!d||!p)break;let g=l+u[0].length,w=g,x=1;for(;w<e.length&&x>0;)e[w]==="("?x++:e[w]===")"&&x--,w++;if(!t.seenCtes.has(p.toLowerCase())){t.seenCtes.add(p.toLowerCase());let E=(u[2]??"").split(",").map(T=>er(T.trim())).filter(T=>T.length>0);t.ctes.push({name:p,columns:E.length>0?E:yA(e.slice(g,Math.max(g,w-1))),from:l,to:l+d.length})}let S=/^\s*,\s*/.exec(e.slice(w));if(!S)break;l=w+S[0].length}o=n.exec(e)}}function gA(e){let t=[],n=0,i="";for(let o of e)o==="("?n++:o===")"&&(n=Math.max(0,n-1)),o===","&&n===0?(t.push(i),i=""):i+=o;return t.push(i),t}function yA(e){let t=/^\s*SELECT\s+(?:DISTINCT\s+)?([\s\S]*?)\s+FROM\s/i.exec(e);if(!t||!t[1])return[];let n=[];for(let i of gA(t[1])){let o=i.trim(),l=new RegExp(String.raw`\s+AS\s+(${Tl})$`,"i").exec(o);if(l!=null&&l[1]){n.push(er(l[1]));continue}if(/^(?:[\w$]+\.)*[\w$]+$/.test(o)){let u=o.split("."),d=u[u.length-1];d&&d!=="*"&&n.push(d)}}return n}function l2(e){let t=new Map;for(let n of e.tables)if(n.alias){let i=n.alias.toLowerCase();t.has(i)||t.set(i,n.path.join("."))}return{tables:e.tables,ctes:e.ctes,aliases:t,selectAliases:e.selectAliases}}async function vA(e,t,n){if(!e.trim())return cA();let i=null;try{let o=await t.parse(e,n);o.success&&o.ast!=null&&(i=o.ast)}catch{}if(i==null)return s2(e);try{let o={tables:[],ctes:[],selectAliases:[],seenTables:new Set,seenCtes:new Set},l=Array.isArray(i)?i:[i];for(let d of l)ba(d)&&fA(d,o);rm(i,o,new Set);let u=Eu(e);for(let d of o.ctes){let p=pA(u,d.name);d.from=p.from,d.to=p.to}return l2(o)}catch{return s2(e)}}var ao=class{constructor(e=new Jr){pe(this,"parser");pe(this,"cache",new Map);pe(this,"MAX_CACHE_SIZE",20);this.parser=e}async getContext(e,t){let n=this.cache.get(e);if(n)return n;let i=await vA(e,this.parser,t);if(this.cache.set(e,i),this.cache.size>this.MAX_CACHE_SIZE){let o=this.cache.keys().next().value;o!==void 0&&this.cache.delete(o)}return i}clearCache(){this.cache.clear()}},pi=class{constructor(e){pe(this,"parser");pe(this,"cache",new Map);pe(this,"MAX_CACHE_SIZE",10);this.parser=e}async analyzeDocument(e){let t=e.doc.toString(),n=this.cache.get(t);if(n)return n;let i=await this.extractStatements(t,e);if(this.cache.set(t,i),this.cache.size>this.MAX_CACHE_SIZE){let o=this.cache.keys().next().value;o!==void 0&&this.cache.delete(o)}return i}async getStatementAtPosition(e,t){return(await this.analyzeDocument(e)).find(n=>t>=n.from&&t<=n.to)||null}async getStatementsInRange(e,t,n){return(await this.analyzeDocument(e)).filter(i=>i.from<=n&&i.to>=t)}async extractStatements(e,t){let n=[],i=this.splitByStatementSeparators(e),o=0;for(let l of i){let u=l.trim();if(u.length===0){o+=l.length;continue}let d=o+l.indexOf(u),p=d+u.length,g=t.doc.lineAt(d),w=t.doc.lineAt(p),x=this.stripComments(u);if(x.trim().length===0||x.trim()===";"){o+=l.length;continue}let S=await this.parser.parse(u,{state:t}),E=this.determineStatementType(x),T=x.endsWith(";")?x.slice(0,-1).trim():x.trim();n.push({from:d,to:p,lineFrom:g.number,lineTo:w.number,content:T,type:E,isValid:S.success,errors:S.errors??[]}),o+=l.length}return n}splitByStatementSeparators(e){let t=[],n="",i=!1,o="",l=!1,u=!1,d=0;for(;d<e.length;){let p=e[d],g=e[d+1];if(!i&&!u&&p==="-"&&g==="-"){l=!0,n+=p+g,d+=2;continue}if(!i&&!l&&p==="/"&&g==="*"){u=!0,n+=p+g,d+=2;continue}if(u&&p==="*"&&g==="/"){u=!1,n+=p+g,d+=2;continue}if(l&&(p===`
|
|
153
153
|
`||p==="\r")){l=!1,n+=p,d++;continue}if(l||u){n+=p,d++;continue}if(!i&&(p==="'"||p==='"'||p==="`"))i=!0,o=p,n+=p;else if(i&&p===o){if(g===o){n+=p+g,d+=2;continue}i=!1,o="",n+=p}else!i&&p===";"?(n+=p,t.push(n),n=""):n+=p;d++}return n.trim()&&t.push(n),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="",n=!1,i="",o=!1,l=!1,u=0;for(;u<e.length;){let d=e[u],p=e[u+1];if(!n&&!l&&d==="-"&&p==="-"){o=!0,u+=2;continue}if(!n&&!o&&d==="/"&&p==="*"){l=!0,u+=2;continue}if(l&&d==="*"&&p==="/"){l=!1,u+=2;continue}if(o&&(d===`
|
|
154
|
-
`||d==="\r")){o=!1,t+=d,u++;continue}if(o||l){u++;continue}if(!n&&(d==="'"||d==='"'||d==="`"))n=!0,i=d,t+=d;else if(n&&d===i){if(p===i){t+=d+p,u+=2;continue}n=!1,i="",t+=d}else t+=d;u++}return t}clearCache(){this.cache.clear()}};function bA(e={}){let t=e.parser??new Jr,n=e.contextAnalyzer??new io(t),i=new pi(t);return async o=>{let l=o.matchBefore(/(?:[\w$]+|"[^"]+"|`[^`]+`|\[[^\]]+\])\.[\w$]*/);if(!l||o.state.sliceDoc(Math.max(0,l.from-1),l.from)===".")return null;let u=l.text.lastIndexOf("."),d=er(l.text.slice(0,u)),p=await i.getStatementAtPosition(o.state,o.pos),g=p?o.state.sliceDoc(p.from,p.to):o.state.doc.toString(),w=await n.getContext(g,{state:o.state}),x=w.aliases.get(d.toLowerCase());if(!x)return null;let S=null,E=w.ctes.find(O=>O.name.toLowerCase()===x.toLowerCase());if(E&&E.columns.length>0)S=E.columns;else if(!E){let O=n2(e.schema,o);O!=null&&(S=r2(O,x))}if(!S||S.length===0)return null;let T=`column of ${x}`;return{from:l.from+u+1,options:S.map(O=>i2(O,T)),validFor:/^[\w$]*$/}}}var wA=1,xA=/\b(?:from|join|into|update|table)\s+$/i,_A=/\bfrom\s+[\w$."`[\]]+(?:\s+(?:as\s+)?[\w$"`[\]]+)?(?:\s*,\s*[\w$."`[\]]+(?:\s+(?:as\s+)?[\w$"`[\]]+)?)*\s*,\s*$/i;function kA(e={}){let t=e.parser??new Jr,n=e.contextAnalyzer??new io(t),i=new pi(t);return async o=>{let l=o.matchBefore(/[\w$]*/);if(!l||l.from===l.to&&!o.explicit||o.state.sliceDoc(Math.max(0,l.from-1),l.from)===".")return null;let u=o.state.sliceDoc(Math.max(0,l.from-256),l.from);if(xA.test(u)||_A.test(u))return null;let d=await i.getStatementAtPosition(o.state,o.pos),p=(d==null?void 0:d.from)??0,g=d?o.state.sliceDoc(d.from,d.to):o.state.doc.toString(),w=Su(g),x=Math.max(p,l.from-1)-p,S=l.to-p;if(w.slice(x,S)!==g.slice(x,S))return null;let E=await n.getContext(g,{state:o.state});if(E.tables.length===0)return null;let T=n2(e.schema,o),O=[],j=new Set,z=new Set;for(let V of E.tables){let P=V.path.join(".").toLowerCase();if(z.has(P))continue;z.add(P);let U=E.ctes.find(W=>W.name.toLowerCase()===V.name.toLowerCase()),me=null;if(U?me=U.columns.length>0?U.columns:null:T!=null&&(me=r2(T,V.path)),!me)continue;let $=`column of ${V.name}`;for(let W of me){let ae=(typeof W=="string"?W:W.label).toLowerCase();j.has(ae)||(j.add(ae),O.push(i2(W,$,wA)))}}return O.length===0?null:{from:l.from,options:O,validFor:/^[\w$]*$/}}}var am=/[\w$]/,om=/"[^"]*"|`[^`]*`|\[[^\]]*\]/g;function c2(e,t){let n=e.doc.lineAt(t),i=n.text,o=t-n.from;om.lastIndex=0;let l=om.exec(i);for(;l!==null&&l.index<=o;){let p=l.index+l[0].length;if(o<=p)return{from:n.from+l.index,to:n.from+p,text:er(l[0])};l=om.exec(i)}let u=o,d=o;for(;u>0&&am.test(i[u-1]??"");)u--;for(;d<i.length&&am.test(i[d]??"");)d++;return u===d?null:{from:n.from+u,to:n.from+d,text:i.slice(u,d)}}async function u2(e,t,n){let i=await e.analyzeDocument(t),o=null;for(let l of i){if(n>=l.from&&n<=l.to)return l;l.from<=n&&(o=l)}return o}function CA(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Eu(e,t={}){let n=CA(e);return`(?:"${n}"|\`${n}\`|\\[${n}\\]|${t.allowLeadingDot?"(?<![\\w$])":"(?<![\\w$.])"}${n}(?![\\w$]))`}function sm(e,t,n={}){let i=new RegExp(Eu(t),"gi"),o=[],l=i.exec(e);for(;l!==null;){let u=l.index+l[0].length;(!n.followedByDot||e[u]===".")&&o.push({from:l.index,to:u}),l=i.exec(e)}return o}function SA(e){let t=[],n=0;for(let i=0;i<e.length;i++)e[i]===")"&&(n=Math.max(0,n-1)),t[i]=n,e[i]==="("&&n++;return t}var lm=/\b(select|from|where|having|qualify|on|set|values|by|join|limit|offset|union|intersect|except|window)\b/gi;function EA(e){lm.lastIndex=0;let t=null,n=lm.exec(e);for(;n!==null;)t=(n[1]??"").toLowerCase(),n=lm.exec(e);return t}function d2(e,t){var o,l;let n=t-1;for(;;){for(;n>=0&&/\s/.test(e[n]??"");)n--;if(n>=0&&e[n]==="."){for(n--;n>=0&&/\s/.test(e[n]??"");)n--;let u=e[n];if(u==='"'||u==="`"||u==="]"){let d=u==="]"?"[":u;for(n--;n>=0&&e[n]!==d;)n--;n--}else for(;n>=0&&am.test(e[n]??"");)n--;continue}break}if(n<0)return!1;if(e[n]===",")return EA(e.slice(0,n))==="from";let i=(l=(o=/([A-Za-z_]+)$/.exec(e.slice(0,n+1)))==null?void 0:o[1])==null?void 0:l.toLowerCase();return i==="from"||i==="join"}function cm(e){let t=new Map;for(let n of e)t.has(n.from)||t.set(n.from,n);return[...t.values()].sort((n,i)=>n.from-i.from)}function um(e,t){return e.some(n=>n.from<=t.from&&t.to<=n.to)}function TA(e,t,n){var p;let i=Su(e),o=n.text.toLowerCase(),l=t.selectAliases.some(g=>g.toLowerCase()===o),u=t.ctes.find(g=>g.name.toLowerCase()===o);if(u){let g=t.aliases.get(o);if(g&&g.toLowerCase()!==o||l||u.from<0)return null;let w={from:u.from,to:u.to},x=cm([w,...sm(i,u.name).filter(S=>i[S.to]==="."||d2(i,S.from))]);return um(x,n)?{kind:"cte",name:u.name,definition:w,references:x}:null}if(t.aliases.has(o)){if(l)return null;let g=t.tables.filter(z=>{var V;return((V=z.alias)==null?void 0:V.toLowerCase())===o});if(g.length!==1||!g[0])return null;let w=g[0],x=w.alias??n.text,S=Eu(w.name,{allowLeadingDot:!0}),E=RegExp(`${S}\\s+(?:AS\\s+)?(${Eu(x)})`,"gi"),T=E.exec(i);for(;T!==null&&!d2(i,T.index);)T=E.exec(i);if(!T||T[1]==null)return null;let O={from:T.index+T[0].length-T[1].length,to:T.index+T[0].length},j=cm([O,...sm(i,x,{followedByDot:!0})]);return um(j,n)?{kind:"table-alias",name:x,definition:O,references:j}:null}let d=t.selectAliases.find(g=>g.toLowerCase()===o);if(d){let g=SA(i),w=P=>g[P]===0,x=DA(i,/\bFROM\b/gi,w),S=x?x.index:i.length,E=RegExp(`\\bAS\\s+(${Eu(d)})`,"gi"),T=null,O=E.exec(i);for(;O!==null;){let P=O.index+O[0].length-(((p=O[1])==null?void 0:p.length)??0);if(w(O.index)&&P<S){T={from:P,to:O.index+O[0].length};break}O=E.exec(i)}if(!T)return null;let j=RA(i,w),z=sm(i,d).filter(P=>j.some(U=>P.from>=U.from&&P.to<=U.to)),V=cm([T,...z]);return um(V,n)?{kind:"select-alias",name:d,definition:T,references:V}:null}return null}function DA(e,t,n){let i=t.exec(e);for(;i!==null;){if(n(i.index))return i;i=t.exec(e)}return null}var dm=/\b(?:GROUP\s+BY|ORDER\s+BY|HAVING|QUALIFY)\b/gi,fm=/\b(?:GROUP\s+BY|ORDER\s+BY|HAVING|QUALIFY|LIMIT|OFFSET|FETCH|WINDOW|UNION|INTERSECT|EXCEPT)\b/gi;function RA(e,t){let n=[];dm.lastIndex=0;let i=dm.exec(e);for(;i!==null;){if(t(i.index)){let o=i.index+i[0].length;fm.lastIndex=o;let l=e.length,u=fm.exec(e);for(;u!==null;){if(t(u.index)){l=u.index;break}u=fm.exec(e)}n.push({from:o,to:l})}i=dm.exec(e)}return n}var IA=class{constructor(e={}){pe(this,"structureAnalyzer");pe(this,"contextAnalyzer");let t=e.parser??new Jr;this.structureAnalyzer=e.structureAnalyzer??new pi(t),this.contextAnalyzer=e.contextAnalyzer??new io(t)}async resolve(e,t){let n=c2(e,t);if(!n)return null;let i=await u2(this.structureAnalyzer,e,t);if(!i||n.from<i.from||n.to>i.to)return null;let o=e.sliceDoc(i.from,i.to),l=TA(o,await this.contextAnalyzer.getContext(o,{state:e}),{from:n.from-i.from,to:n.to-i.from,text:n.text});if(!l)return null;let u=d=>({from:d.from+i.from,to:d.to+i.from});return{...l,definition:u(l.definition),references:l.references.map(u)}}},AA=/([\w$]+|"[^"]+"|`[^`]+`|\[[^\]]+\])$/;function LA(e){return/\b(?:from|join)\s+$/i.test(e)}function f2(e){return/^[A-Za-z_][\w$]*$/.test(e)}function PA(e){return{label:e.name,type:"variable",info:`Common Table Expression: ${e.name}`,boost:10,...f2(e.name)?{}:{apply:`"${e.name}"`}}}function p2(e){return e.columns.map(t=>({label:t,type:"property",detail:`column of ${e.name}`,boost:5,...f2(t)?{}:{apply:`"${t}"`}}))}function m2(e={}){let t=e.parser??new Jr,n=e.contextAnalyzer??new io(t),i=e.structureAnalyzer??new pi(t);return async o=>{let l=o.matchBefore(/[\w$]*/);if(!l)return null;let u=o.state.sliceDoc(Math.max(0,l.from-1),l.from)===".";if(l.from===l.to&&!o.explicit&&!u)return null;let d=await u2(i,o.state,o.pos),p=d?o.state.sliceDoc(d.from,d.to):o.state.doc.toString(),g=await n.getContext(p,{state:o.state});if(g.ctes.length===0)return null;if(u){let x=o.state.doc.lineAt(l.from),S=o.state.sliceDoc(x.from,l.from-1),E=AA.exec(S);if(!E||!E[1]||S.slice(0,S.length-E[1].length).endsWith("."))return null;let T=er(E[1]).toLowerCase(),O=g.ctes.find(j=>j.name.toLowerCase()===T);return!O||O.columns.length===0?null:{from:l.from,options:p2(O),validFor:/^[\w$]*$/}}let w=g.ctes.map(PA);if(!LA(o.state.sliceDoc(Math.max(0,l.from-64),l.from))){let x=new Set(g.tables.map(E=>E.name.toLowerCase())),S=new Set;for(let E of g.ctes)if(x.has(E.name.toLowerCase()))for(let T of p2(E)){let O=T.label.toLowerCase();S.has(O)||(S.add(O),w.push(T))}}return{from:l.from,options:w,validFor:/^[\w$]*$/}}}var OA=750;function h2(e,t){if(t>=e.length)return e.length;let n=e.lineAt(t),i=n.text.slice(t-n.from).match(/^[\w"'`.]+/);return i?t+i[0].length:Math.min(t+1,e.length)}function MA(e,t){let n=t.line(Math.min(e.line,t.lines)),i=Math.min(n.from+Math.max(0,e.column-1),t.length);return{from:i,to:h2(t,i),severity:e.severity,message:e.message,source:"sql-parser"}}function NA(e,t,n){let i;return i=e.line<=1?t.from+Math.max(0,e.column-1):n.line(Math.min(t.lineFrom+e.line-1,n.lines)).from+Math.max(0,e.column-1),i=Math.max(t.from,Math.min(i,t.to)),{from:i,to:Math.max(i,Math.min(h2(n,i),t.to)),severity:e.severity,message:e.message,source:"sql-parser"}}function jA(e={}){return oS(qA(e),{delay:e.delay||OA})}function qA(e={}){let t=e.parser||new Jr,n=e.perStatement!==!1,i=e.structureAnalyzer||new pi(t);return async o=>{let l=o.state.doc,u=l.toString();return u.trim()?n?(await i.analyzeDocument(o.state)).flatMap(d=>d.errors.map(p=>NA(p,d,l))):(await t.validateSql(u,{state:o.state})).map(d=>MA(d,l)):[]}}function g2(e,t){if(t.size===0)return{};if(ya(e)){let n={};for(let[i,o]of Object.entries(e))if(Array.from(t).some(l=>l.toLowerCase()===i.toLowerCase()))n[i]=o;else if(ya(o)){let l=g2(o,t);Object.keys(l).length>0&&(n[i]=l)}return n}return e}function zA(e={}){let{schema:t,keywords:n={},enableKeywords:i=!0,enableTables:o=!0,enableColumns:l=!0,enableFuzzySearch:u=!0,parser:d=new Jr,tooltipRender:p,tooltipRenderers:g={}}=e,w=new pi(d),x=e.contextAnalyzer??new io(d),S=null;return async(E,T,O)=>{let{from:j,to:z,text:V}=E.state.doc.lineAt(T),P=T,U=T;S===null&&(S=typeof n=="function"?n(E):Promise.resolve(n));let me;try{me=await S}catch{S=null,me={}}for(;P>j&&/[\w.]/.test(V[P-j-1]??"");)P--;for(;U<z&&/[\w.]/.test(V[U-j]??"");)U++;if(P===T&&O<0||U===T&&O>0)return null;let $=V.slice(P-j,U-j).toLowerCase();if(!$||$.length===0)return null;let W=t2(t,E)??{},ae=null;`${$}`;let xe=Object.hasOwn(me,$)?me[$]:void 0;if(!ae&&i&&xe&&(ae={word:$,view:E,pos:T,tooltipType:"keyword",keywordData:{keyword:$,info:xe}}),!ae&&(o||l)&&W){let Te=await w.getStatementAtPosition(E.state,T),Z=Te?E.state.doc.sliceString(Te.from,Te.to):E.state.doc.toString(),Q=await x.getContext(Z,{state:E.state}),[Y="",...ce]=$.split("."),te=Q.aliases.get(Y),he=te?[te,...ce].join(".").toLowerCase():$,G=new Set(Q.tables.map(Qe=>Qe.name.toLowerCase())),Ne=g2(W,G),qe=e2(Ne,he,{enableFuzzySearch:u});if(!qe&&G.size===0&&(qe=e2(W,he,{enableFuzzySearch:u})),qe){let{semanticType:Qe}=qe;(Qe==="table"&&!o||Qe==="column"&&!l)&&(qe=null)}qe&&(Array.from(G),ae={word:$,view:E,pos:T,tooltipType:"namespace",namespaceData:{item:qe,word:$,resolvedSchema:G.size>0?Ne:W,...te?{aliasFor:te}:{}}})}if(!ae)return null;let _e=ae;return{pos:P,end:U,above:!0,create(Te){if(p){let Y=p($,Te,T);if(Y)return{dom:Y}}let Z=null;if(_e.tooltipType==="keyword"&&_e.keywordData)Z=g.keyword?g.keyword(_e.keywordData):b2(_e.keywordData);else if(_e.tooltipType==="namespace"&&_e.namespaceData){let Y=_e.namespaceData,{semanticType:ce}=Y.item;ce==="table"&&g.table?Z=g.table(Y):ce==="column"&&g.column?Z=g.column(Y):(ce==="database"||ce==="schema"||ce==="namespace")&&g.namespace?Z=g.namespace(Y):(Z=v2(Y.item),Y.aliasFor&&(Z=`<div class="sql-hover-alias"><code>${y2(Y.word.split(".")[0]??"")}</code> is an alias for <code>${y2(Y.aliasFor)}</code></div>`+Z))}if(!Z)return{dom:document.createElement("div")};let Q=document.createElement("div");return Q.className="cm-sql-hover-tooltip",Q.innerHTML=Z,{dom:Q}}}}}function FA(e={}){let{hoverTime:t=300}=e;return Ig(zA(e),{hoverTime:t})}function y2(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function v2(e){var o,l,u,d,p,g,w;let t=e.path.join("."),n=((o=e.completion)==null?void 0:o.label)||e.value||e.path[e.path.length-1]||"unknown",i=`<div class="sql-hover-${e.semanticType}">`;switch(i+=`<div class="sql-hover-header"><strong>${n}</strong> <span class="sql-hover-type">${e.semanticType}</span></div>`,e.semanticType){case"database":if(i+=`<div class="sql-hover-description">Database${(l=e.completion)!=null&&l.detail?`: ${e.completion.detail}`:""}</div>`,e.namespace){let x=Tu(e.namespace);x>0&&(i+=`<div class="sql-hover-children">Contains ${x} schema${x===1?"":"s"}</div>`)}break;case"schema":if(i+=`<div class="sql-hover-description">Schema${(u=e.completion)!=null&&u.detail?`: ${e.completion.detail}`:""}</div>`,t&&(i+=`<div class="sql-hover-path"><strong>Path:</strong> <code>${t}</code></div>`),e.namespace){let x=Tu(e.namespace);x>0&&(i+=`<div class="sql-hover-children">Contains ${x} table${x===1?"":"s"}</div>`)}break;case"table":if(i+=`<div class="sql-hover-description">Table${(d=e.completion)!=null&&d.detail?`: ${e.completion.detail}`:""}</div>`,t){let x=e.path;x.length>1&&(i+=`<div class="sql-hover-path"><strong>Schema:</strong> <code>${x.slice(0,-1).join(".")}</code></div>`)}if(e.namespace&&Zn(e.namespace)){let x=e.namespace;if(x.length>0){i+=`<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);i+=S.map(E=>`<code>${E}</code>`).join(", "),x.length>8&&(i+=`, <em>and ${x.length-8} more...</em>`),i+="</div>"}}break;case"column":if(i+=`<div class="sql-hover-description">Column${(p=e.completion)!=null&&p.detail?`: ${e.completion.detail}`:""}</div>`,t){let x=e.path;x.length>1&&(i+=`<div class="sql-hover-path"><strong>Table:</strong> <code>${x.slice(0,-1).join(".")}</code></div>`)}break;default:if(i+=`<div class="sql-hover-description">Namespace${(g=e.completion)!=null&&g.detail?`: ${e.completion.detail}`:""}</div>`,t&&(i+=`<div class="sql-hover-path"><strong>Path:</strong> <code>${t}</code></div>`),e.namespace){let x=Tu(e.namespace);x>0&&(i+=`<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"&&(i+=`<div class="sql-hover-info">${e.completion.info}</div>`),i+="</div>",i}function Tu(e){return Array.isArray(e)?e.length:typeof e=="object"&&e?"self"in e&&"children"in e?1+Tu(e.children):Object.keys(e).length:0}function b2(e){let{keyword:t,info:n}=e,i='<div class="sql-hover-keyword">';if(i+=`<div class="sql-hover-header"><strong>${t.toUpperCase()}</strong> <span class="sql-hover-type">keyword</span></div>`,i+=`<div class="sql-hover-description">${n.description}</div>`,n.syntax&&(i+=`<div class="sql-hover-syntax"><strong>Syntax:</strong> <code>${n.syntax}</code></div>`),n.example&&(i+=`<div class="sql-hover-example"><strong>Example:</strong><br><code>${n.example}</code></div>`),n.metadata&&typeof n.metadata=="object"&&Object.keys(n.metadata).length>0){i+='<div class="sql-hover-metadata">';for(let[o,l]of Object.entries(n.metadata))i+=`<span class="sql-hover-tag" title="${o}">${l}</span> `;i+="</div>"}return i+="</div>",i}function $A(e){let{tableName:t,columns:n,metadata:i}=e,o='<div class="sql-hover-table">';if(o+=`<div class="sql-hover-header"><strong>${t}</strong> <span class="sql-hover-type">table</span></div>`,o+=`<div class="sql-hover-description">Table with ${n.length} column${n.length===1?"":"s"}</div>`,n.length>0){o+='<div class="sql-hover-columns"><strong>Columns:</strong><br>';let l=n.slice(0,10);o+=l.map(u=>`<code>${u}</code>`).join(", "),n.length>10&&(o+=`, <em>and ${n.length-10} more...</em>`),o+="</div>"}if(i&&typeof i=="object"&&Object.keys(i).length>0){o+='<div class="sql-hover-metadata">';for(let[l,u]of Object.entries(i))o+=`<span class="sql-hover-tag" title="${l}">${u}</span> `;o+="</div>"}return o+="</div>",o}function VA(e){let{tableName:t,columnName:n,schema:i,metadata:o}=e,l='<div class="sql-hover-column">';l+=`<div class="sql-hover-header"><strong>${n}</strong> <span class="sql-hover-type">column</span></div>`,l+=`<div class="sql-hover-description">Column in table <code>${t}</code></div>`;let u=i[t];if(u&&u.length>1){let d=u.filter(p=>p!==n);if(d.length>0){l+=`<div class="sql-hover-related"><strong>Other columns in ${t}:</strong><br>`;let p=d.slice(0,8);l+=p.map(g=>`<code>${g}</code>`).join(", "),d.length>8&&(l+=`, <em>and ${d.length-8} more...</em>`),l+="</div>"}}if(o&&typeof o=="object"&&Object.keys(o).length>0){l+='<div class="sql-hover-metadata">';for(let[d,p]of Object.entries(o))l+=`<span class="sql-hover-tag" title="${d}">${p}</span> `;l+="</div>"}return l+="</div>",l}const HA={keyword:b2,table:$A,column:VA,namespace:v2},w2=(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 At.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-alias":{marginBottom:"6px",color:t.tooltipChildren,fontSize:"12px"},".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}})};function cs(e){return e.resolver??new IA(e)}var x2=At.baseTheme({".cm-sqlReference":{backgroundColor:"rgba(96, 165, 250, 0.18)"},".cm-sqlReference.cm-sqlDefinition":{backgroundColor:"rgba(96, 165, 250, 0.35)"},".cm-sqlGotoTarget":{textDecoration:"underline",cursor:"pointer"}}),BA=Xt.mark({class:"cm-sqlReference"}),WA=Xt.mark({class:"cm-sqlReference cm-sqlDefinition"}),UA=Xt.mark({class:"cm-sqlGotoTarget"});function KA(e){return Xt.set(e.references.map(t=>(t.from===e.definition.from?WA:BA).range(t.from,t.to)),!0)}var _2=sr.define(),k2=li.define({create:()=>Xt.none,update(e,t){for(let n of t.effects)if(n.is(_2))return n.value;return t.docChanged?e.map(t.changes):e},provide:e=>At.decorations.from(e)});function QA(e={}){let t=cs(e),n=e.highlightDelay??150;return[k2,Cr.fromClass(class{constructor(i){pe(this,"view");pe(this,"timer",null);pe(this,"generation",0);this.view=i,this.schedule()}update(i){(i.selectionSet||i.docChanged)&&this.schedule()}schedule(){this.generation++,this.timer!=null&&clearTimeout(this.timer),this.timer=setTimeout(()=>{this.timer=null,this.run()},n)}async run(){let i=this.generation,o=this.view.state,l=o.selection.main,u=Xt.none;if(l.empty)try{let p=await t.resolve(o,l.head);p&&(u=KA(p))}catch{}if(i!==this.generation)return;let d=this.view.state.field(k2,!1);u.size===0&&(d==null||d.size===0)||this.view.dispatch({effects:_2.of(u)})}destroy(){this.generation++,this.timer!=null&&clearTimeout(this.timer)}}),x2]}async function GA(e,t,n={}){let i=e.state,o=t??i.selection.main.head,l=await cs(n).resolve(i,o);return!l||e.state!==i?!1:(e.dispatch({selection:{anchor:l.definition.from,head:l.definition.to},scrollIntoView:!0,userEvent:"select"}),!0)}var pm=sr.define(),C2=li.define({create:()=>Xt.none,update(e,t){for(let n of t.effects)if(n.is(pm))return n.value;return t.docChanged?e.map(t.changes):e},provide:e=>At.decorations.from(e)});function XA(e={}){let t=cs(e);return[C2,Cr.fromClass(class{constructor(n){pe(this,"view");pe(this,"hovered",null);this.view=n}update(n){n.docChanged&&(this.hovered=null)}resultAt(n){return this.hovered&&n>=this.hovered.from&&n<=this.hovered.to?this.hovered.result:null}clear(){if(this.hovered){this.hovered=null;let n=this.view.state.field(C2,!1);n&&n.size>0&&this.view.dispatch({effects:pm.of(Xt.none)})}}async hover(n){let i=c2(this.view.state,n);if(!i){this.clear();return}if(this.hovered&&this.hovered.from===i.from&&this.hovered.to===i.to)return;let o={from:i.from,to:i.to,result:null};this.hovered=o;let l=this.view.state;try{let u=await t.resolve(l,n);if(this.hovered!==o||this.view.state!==l)return;o.result=u,this.view.dispatch({effects:pm.of(u?Xt.set([UA.range(i.from,i.to)]):Xt.none)})}catch{}}destroy(){this.hovered=null}},{eventHandlers:{mousemove(n,i){if(!(n.metaKey||n.ctrlKey)){this.clear();return}let o=i.posAtCoords({x:n.clientX,y:n.clientY});if(o==null){this.clear();return}this.hover(o)},mousedown(n,i){if(!(n.metaKey||n.ctrlKey)||n.button!==0)return!1;let o=i.posAtCoords({x:n.clientX,y:n.clientY});if(o==null)return!1;let l=this.resultAt(o);return l?(i.dispatch({selection:{anchor:l.definition.from,head:l.definition.to},scrollIntoView:!0,userEvent:"select.pointer"}),!0):!1}}}),x2]}var JA=e=>typeof window<"u"&&typeof window.prompt=="function"?window.prompt(`Rename '${e}' to:`,e):null,YA=/^[A-Za-z_][\w$]*$/,ZA=new Set("all.and.as.asc.between.by.case.cross.delete.desc.distinct.else.end.except.exists.fetch.from.full.group.having.in.inner.insert.intersect.into.is.join.lateral.left.like.limit.natural.not.null.offset.on.or.order.outer.qualify.recursive.right.select.set.table.then.union.update.using.values.when.where.window.with".split("."));async function eL(e,t={}){let n=e.state,i=await cs(t).resolve(n,n.selection.main.head);if(!i)return!1;let o=await(t.prompt??JA)(i.name);return!o||o===i.name||!YA.test(o)||ZA.has(o.toLowerCase())||e.state!==n?!1:(e.dispatch({changes:i.references.map(l=>({from:l.from,to:l.to,insert:o})),userEvent:"rename"}),!0)}function tL(e={}){let t={...e,resolver:cs(e)},n=e.gotoDefinitionKeys??["F12","Mod-b"],i=e.renameKey??"F2";return Si.of([...n.map(o=>({key:o,run:l=>(GA(l,void 0,t),!0)})),{key:i,run:o=>(eL(o,t),!0)}])}function nL(e={}){let t={...e,resolver:cs(e)},n=[QA(t),XA(t)];return e.keymap&&n.push(tL(t)),n}var rL=750;function us(e){return typeof e=="object"&&!!e&&!Array.isArray(e)&&e.type==="select"}function ba(e){return Array.isArray(e)?e:[]}function ds(e){return{sources:[],columnRefs:[],selectAliases:new Set,checkUnqualified:e,hasUsingJoin:!1}}function Du(e,t,n){let i=ba(e.with);for(let o of i){let l=o.name,u=typeof l=="string"?l:l==null?void 0:l.value;typeof u=="string"&&t.add(u.toLowerCase())}for(let o of i){let l=o.stmt,u=(l==null?void 0:l.ast)??l;us(u)&&ao(u,t,n,!1)}}function Dl(e,t,n,i){e.using!=null&&(t.hasUsingJoin=!0),typeof e.join=="string"&&e.join.toLowerCase().includes("natural")&&(t.hasUsingJoin=!0),e.on!=null&&mi(e.on,t,n,i);let o=e.expr;if(o!=null){let l=o.ast??o;us(l)&&ao(l,n,i,!1),t.sources.push({path:"",name:"",alias:typeof e.as=="string"?e.as:null,isCte:!1,opaque:!0});return}if(typeof e.table=="string"){let l=[e.db??e.catalog,e.schema,e.table].filter(u=>typeof u=="string"&&u.length>0);t.sources.push({path:l.join("."),name:e.table,alias:typeof e.as=="string"?e.as:null,isCte:l.length===1&&n.has(e.table.toLowerCase()),opaque:!1})}}function mi(e,t,n,i){if(typeof e!="object"||!e)return;if(Array.isArray(e)){for(let l of e)mi(l,t,n,i);return}let o=e;if(o.type==="column_ref"){t.columnRefs.push(o);return}if(us(o)){ao(o,n,i,!0);return}if(us(o.ast)){ao(o.ast,n,i,!0);return}for(let[l,u]of Object.entries(o))l==="loc"||l==="tableList"||l==="columnList"||mi(u,t,n,i)}function ao(e,t,n,i){let o=new Set(t);Du(e,o,n);let l=ds(!i);n.push(l);for(let u of ba(e.from))Dl(u,l,o,n);for(let u of ba(e.columns))typeof u.as=="string"&&l.selectAliases.add(u.as.toLowerCase());for(let[u,d]of Object.entries(e))u==="with"||u==="from"||u==="loc"||mi(d,l,o,n)}function iL(e,t){let n=new Set;switch(e.type){case"select":ao(e,n,t,!1);return;case"update":{Du(e,n,t);let i=ds(!0);t.push(i);for(let o of ba(e.table))Dl(o,i,n,t);for(let o of ba(e.from))Dl(o,i,n,t);for(let o of ba(e.set))o.column!=null&&i.columnRefs.push({type:"column_ref",table:o.table??null,column:o.column}),mi(o.value,i,n,t);for(let[o,l]of Object.entries(e))o==="with"||o==="table"||o==="from"||o==="set"||o==="loc"||mi(l,i,n,t);return}case"delete":{Du(e,n,t);let i=ds(!0);t.push(i);for(let o of ba(e.from))Dl(o,i,n,t);for(let[o,l]of Object.entries(e))o==="with"||o==="table"||o==="from"||o==="loc"||mi(l,i,n,t);return}case"insert":case"replace":{Du(e,n,t);let i=ds(!1);t.push(i);for(let o of ba(e.table))Dl(o,i,n,t);for(let[o,l]of Object.entries(e))o==="with"||o==="table"||o==="columns"||o==="loc"||(us(l)?ao(l,n,t,!1):mi(l,i,n,t));return}case"create":case"alter":case"drop":{let i=ds(!1);t.push(i);for(let[o,l]of Object.entries(e))o==="table"||o==="loc"||(us(l)?ao(l,n,t,!1):mi(l,i,n,t));return}default:{let i=ds(!1);t.push(i);for(let[o,l]of Object.entries(e))o!=="loc"&&mi(l,i,n,t)}}}function aL(e){var n;let t=e.column;if(typeof t=="string")return t;if(typeof t=="object"&&t){let i=((n=t.expr)==null?void 0:n.value)??t.value;if(typeof i=="string")return i}return null}function oL(e){return typeof e.table!="string"||e.table.length===0?null:typeof e.db=="string"&&e.db.length>0?`${e.db}.${e.table}`:e.table}function mm(e){if(e==null)return null;let t=Ar(e)?e.children:e;return Zn(t)?t.map(n=>typeof n=="string"?n:n.label):null}function sL(e,t){var u;let n=ku(e,t,{caseSensitive:!1});if(n)return{exists:!0,columns:mm(n.namespace)};let i=t.split(".").map(d=>d.toLowerCase()),o=i[i.length-1];if(!o)return{exists:!1,columns:null};let l=Zp(e,o).filter(d=>{if(mm(d.namespace)===null||d.path.length<i.length)return!1;let p=d.path.slice(-i.length).map(g=>g.toLowerCase());return i.every((g,w)=>p[w]===g)});return l.length===0?{exists:!1,columns:null}:{exists:!0,columns:l.length===1?mm((u=l[0])==null?void 0:u.namespace):null}}function S2(e,t){let n=t.toLowerCase();return e.some(i=>i.toLowerCase()===n)}function lL(e,t){let n=[];iL(e,n);let i=new Map,o=l=>{let u=`${l.kind}::${l.identifier.toLowerCase()}`;i.has(u)||i.set(u,l)};for(let l of n){let u=l.sources.map(d=>{if(d.opaque||d.isCte)return{source:d,exists:!0,columns:null};let p=sL(t,d.path);return{source:d,exists:p.exists,columns:p.columns}});for(let{source:d,exists:p}of u)!d.opaque&&!d.isCte&&!p&&o({kind:"unknownTable",identifier:d.name,message:`Unknown table '${d.path}'`});for(let d of l.columnRefs){let p=aL(d);if(!p||p==="*")continue;let g=oL(d);if(g){let S=g.toLowerCase(),E=u.find(T=>{var O;return((O=T.source.alias)==null?void 0:O.toLowerCase())===S})??u.find(T=>T.source.name.toLowerCase()===S||T.source.path.toLowerCase()===S);E!=null&&E.columns&&!S2(E.columns,p)&&o({kind:"unknownColumn",identifier:p,message:`Column '${p}' not found in table '${E.source.path||g}'`});continue}if(!l.checkUnqualified||l.selectAliases.has(p.toLowerCase()))continue;let w=u.filter(S=>S.columns!==null&&S2(S.columns,p));if(w.length>=2&&!l.hasUsingJoin){o({kind:"ambiguousColumn",identifier:p,message:`Column '${p}' is ambiguous; it exists in ${w.map(S=>S.source.name).join(", ")}`});continue}let x=u.length===1?u[0]:void 0;x&&x.columns!==null&&w.length===0&&o({kind:"unknownColumn",identifier:p,message:`Column '${p}' not found in table '${x.source.path}'`})}}return[...i.values()]}function cL(e,t){let n=e.toLowerCase(),i=t.toLowerCase(),o=n.indexOf(i);for(;o!==-1;){let l=o>0?n[o-1]??"":"",u=n[o+i.length]??"";if(!/[\w$]/.test(l)&&!/[\w$]/.test(u))return o;o=n.indexOf(i,o+1)}return-1}function uL(e,t,n,i){var d;let o=n.sliceString(t.from,t.to),l=cL(o,e.identifier),u=l===-1?t.from:t.from+l;return{from:u,to:Math.min(l===-1?t.from+(((d=o.match(/^[\w"'`.]+/))==null?void 0:d[0].length)??1):u+e.identifier.length,t.to),severity:i,message:e.message,source:"sql-schema"}}function dL(e){return Zn(e)?e.length===0:ya(e)?Object.keys(e).length===0:!1}function fL(e={}){var o,l,u;let t=e.parser||new Jr,n=e.structureAnalyzer||new pi(t),i={unknownTable:((o=e.severity)==null?void 0:o.unknownTable)??"warning",unknownColumn:((l=e.severity)==null?void 0:l.unknownColumn)??"warning",ambiguousColumn:((u=e.severity)==null?void 0:u.ambiguousColumn)??"warning"};return async d=>{let p=t2(e.schema,d);if(p==null||dL(p))return[];let g=d.state.doc;if(!g.toString().trim())return[];let w=[],x=await n.analyzeDocument(d.state);for(let S of x){if(!S.isValid)continue;let E=await t.parse(S.content,{state:d.state});if(!E.success||E.ast==null)continue;let T=Array.isArray(E.ast)?E.ast:[E.ast];for(let O of T)for(let j of lL(O,p)){let z=i[j.kind];z!=="off"&&w.push(uL(j,S,g,z))}}return w}}function pL(e={}){return oS(fL(e),{delay:e.delay||rL})}var E2=sr.define(),T2=li.define({create(){return{currentStatement:null,allStatements:[],cursorPosition:0,isFocused:!0}},update(e,t){for(let n of t.effects)if(n.is(E2))return n.value;return e}});function mL(e,t){let{isCurrent:n,isValid:i,isFocused:o}=t,l=e.backgroundColor||"#3b82f6";!i&&e.showInvalid!==!1&&(l=e.errorBackgroundColor||"#ef4444");let u=n?"1":(e.inactiveOpacity??.3).toString(),d;return d=o?u:e.unfocusedOpacity===void 0?e.hideWhenNotFocused?"0":u:e.unfocusedOpacity.toString(),{backgroundColor:l,opacity:d}}var hL=class extends ZC{constructor(t,n,i=!0,o=!0){super();pe(this,"config");pe(this,"isCurrent");pe(this,"isValid");pe(this,"isFocused");this.config=t,this.isCurrent=n,this.isValid=i,this.isFocused=o}toDOM(){let t=document.createElement("div");t.className="cm-sql-gutter-marker";let{backgroundColor:n,opacity:i}=mL(this.config,{isCurrent:this.isCurrent,isValid:this.isValid,isFocused:this.isFocused});return t.style.cssText=`
|
|
154
|
+
`||d==="\r")){o=!1,t+=d,u++;continue}if(o||l){u++;continue}if(!n&&(d==="'"||d==='"'||d==="`"))n=!0,i=d,t+=d;else if(n&&d===i){if(p===i){t+=d+p,u+=2;continue}n=!1,i="",t+=d}else t+=d;u++}return t}clearCache(){this.cache.clear()}};function bA(e={}){let t=e.parser??new Jr,n=e.contextAnalyzer??new ao(t),i=new pi(t);return async o=>{let l=o.matchBefore(/(?:[\w$]+|"[^"]+"|`[^`]+`|\[[^\]]+\])\.[\w$]*/);if(!l||o.state.sliceDoc(Math.max(0,l.from-1),l.from)===".")return null;let u=l.text.lastIndexOf("."),d=er(l.text.slice(0,u)),p=await i.getStatementAtPosition(o.state,o.pos),g=p?o.state.sliceDoc(p.from,p.to):o.state.doc.toString(),w=await n.getContext(g,{state:o.state}),x=w.aliases.get(d.toLowerCase());if(!x)return null;let S=null,E=w.ctes.find(O=>O.name.toLowerCase()===x.toLowerCase());if(E&&E.columns.length>0)S=E.columns;else if(!E){let O=n2(e.schema,o);O!=null&&(S=r2(O,x))}if(!S||S.length===0)return null;let T=`column of ${x}`;return{from:l.from+u+1,options:S.map(O=>i2(O,T)),validFor:/^[\w$]*$/}}}var wA=1,xA=/\b(?:from|join|into|update|table)\s+$/i,_A=/\bfrom\s+[\w$."`[\]]+(?:\s+(?:as\s+)?[\w$"`[\]]+)?(?:\s*,\s*[\w$."`[\]]+(?:\s+(?:as\s+)?[\w$"`[\]]+)?)*\s*,\s*$/i;function kA(e={}){let t=e.parser??new Jr,n=e.contextAnalyzer??new ao(t),i=new pi(t);return async o=>{let l=o.matchBefore(/[\w$]*/);if(!l||l.from===l.to&&!o.explicit||o.state.sliceDoc(Math.max(0,l.from-1),l.from)===".")return null;let u=o.state.sliceDoc(Math.max(0,l.from-256),l.from);if(xA.test(u)||_A.test(u))return null;let d=await i.getStatementAtPosition(o.state,o.pos),p=(d==null?void 0:d.from)??0,g=d?o.state.sliceDoc(d.from,d.to):o.state.doc.toString(),w=Eu(g),x=Math.max(p,l.from-1)-p,S=l.to-p;if(w.slice(x,S)!==g.slice(x,S))return null;let E=await n.getContext(g,{state:o.state});if(E.tables.length===0)return null;let T=n2(e.schema,o),O=[],j=new Set,z=new Set;for(let V of E.tables){let P=V.path.join(".").toLowerCase();if(z.has(P))continue;z.add(P);let U=E.ctes.find(W=>W.name.toLowerCase()===V.name.toLowerCase()),me=null;if(U?me=U.columns.length>0?U.columns:null:T!=null&&(me=r2(T,V.path)),!me)continue;let $=`column of ${V.name}`;for(let W of me){let ae=(typeof W=="string"?W:W.label).toLowerCase();j.has(ae)||(j.add(ae),O.push(i2(W,$,wA)))}}return O.length===0?null:{from:l.from,options:O,validFor:/^[\w$]*$/}}}var am=/[\w$]/,om=/"[^"]*"|`[^`]*`|\[[^\]]*\]/g;function c2(e,t){let n=e.doc.lineAt(t),i=n.text,o=t-n.from;om.lastIndex=0;let l=om.exec(i);for(;l!==null&&l.index<=o;){let p=l.index+l[0].length;if(o<=p)return{from:n.from+l.index,to:n.from+p,text:er(l[0])};l=om.exec(i)}let u=o,d=o;for(;u>0&&am.test(i[u-1]??"");)u--;for(;d<i.length&&am.test(i[d]??"");)d++;return u===d?null:{from:n.from+u,to:n.from+d,text:i.slice(u,d)}}async function u2(e,t,n){let i=await e.analyzeDocument(t),o=null;for(let l of i){if(n>=l.from&&n<=l.to)return l;l.from<=n&&(o=l)}return o}function CA(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Tu(e,t={}){let n=CA(e);return`(?:"${n}"|\`${n}\`|\\[${n}\\]|${t.allowLeadingDot?"(?<![\\w$])":"(?<![\\w$.])"}${n}(?![\\w$]))`}function sm(e,t,n={}){let i=new RegExp(Tu(t),"gi"),o=[],l=i.exec(e);for(;l!==null;){let u=l.index+l[0].length;(!n.followedByDot||e[u]===".")&&o.push({from:l.index,to:u}),l=i.exec(e)}return o}function SA(e){let t=[],n=0;for(let i=0;i<e.length;i++)e[i]===")"&&(n=Math.max(0,n-1)),t[i]=n,e[i]==="("&&n++;return t}var lm=/\b(select|from|where|having|qualify|on|set|values|by|join|limit|offset|union|intersect|except|window)\b/gi;function EA(e){lm.lastIndex=0;let t=null,n=lm.exec(e);for(;n!==null;)t=(n[1]??"").toLowerCase(),n=lm.exec(e);return t}function d2(e,t){var o,l;let n=t-1;for(;;){for(;n>=0&&/\s/.test(e[n]??"");)n--;if(n>=0&&e[n]==="."){for(n--;n>=0&&/\s/.test(e[n]??"");)n--;let u=e[n];if(u==='"'||u==="`"||u==="]"){let d=u==="]"?"[":u;for(n--;n>=0&&e[n]!==d;)n--;n--}else for(;n>=0&&am.test(e[n]??"");)n--;continue}break}if(n<0)return!1;if(e[n]===",")return EA(e.slice(0,n))==="from";let i=(l=(o=/([A-Za-z_]+)$/.exec(e.slice(0,n+1)))==null?void 0:o[1])==null?void 0:l.toLowerCase();return i==="from"||i==="join"}function cm(e){let t=new Map;for(let n of e)t.has(n.from)||t.set(n.from,n);return[...t.values()].sort((n,i)=>n.from-i.from)}function um(e,t){return e.some(n=>n.from<=t.from&&t.to<=n.to)}function TA(e,t,n){var p;let i=Eu(e),o=n.text.toLowerCase(),l=t.selectAliases.some(g=>g.toLowerCase()===o),u=t.ctes.find(g=>g.name.toLowerCase()===o);if(u){let g=t.aliases.get(o);if(g&&g.toLowerCase()!==o||l||u.from<0)return null;let w={from:u.from,to:u.to},x=cm([w,...sm(i,u.name).filter(S=>i[S.to]==="."||d2(i,S.from))]);return um(x,n)?{kind:"cte",name:u.name,definition:w,references:x}:null}if(t.aliases.has(o)){if(l)return null;let g=t.tables.filter(z=>{var V;return((V=z.alias)==null?void 0:V.toLowerCase())===o});if(g.length!==1||!g[0])return null;let w=g[0],x=w.alias??n.text,S=Tu(w.name,{allowLeadingDot:!0}),E=RegExp(`${S}\\s+(?:AS\\s+)?(${Tu(x)})`,"gi"),T=E.exec(i);for(;T!==null&&!d2(i,T.index);)T=E.exec(i);if(!T||T[1]==null)return null;let O={from:T.index+T[0].length-T[1].length,to:T.index+T[0].length},j=cm([O,...sm(i,x,{followedByDot:!0})]);return um(j,n)?{kind:"table-alias",name:x,definition:O,references:j}:null}let d=t.selectAliases.find(g=>g.toLowerCase()===o);if(d){let g=SA(i),w=P=>g[P]===0,x=DA(i,/\bFROM\b/gi,w),S=x?x.index:i.length,E=RegExp(`\\bAS\\s+(${Tu(d)})`,"gi"),T=null,O=E.exec(i);for(;O!==null;){let P=O.index+O[0].length-(((p=O[1])==null?void 0:p.length)??0);if(w(O.index)&&P<S){T={from:P,to:O.index+O[0].length};break}O=E.exec(i)}if(!T)return null;let j=RA(i,w),z=sm(i,d).filter(P=>j.some(U=>P.from>=U.from&&P.to<=U.to)),V=cm([T,...z]);return um(V,n)?{kind:"select-alias",name:d,definition:T,references:V}:null}return null}function DA(e,t,n){let i=t.exec(e);for(;i!==null;){if(n(i.index))return i;i=t.exec(e)}return null}var dm=/\b(?:GROUP\s+BY|ORDER\s+BY|HAVING|QUALIFY)\b/gi,fm=/\b(?:GROUP\s+BY|ORDER\s+BY|HAVING|QUALIFY|LIMIT|OFFSET|FETCH|WINDOW|UNION|INTERSECT|EXCEPT)\b/gi;function RA(e,t){let n=[];dm.lastIndex=0;let i=dm.exec(e);for(;i!==null;){if(t(i.index)){let o=i.index+i[0].length;fm.lastIndex=o;let l=e.length,u=fm.exec(e);for(;u!==null;){if(t(u.index)){l=u.index;break}u=fm.exec(e)}n.push({from:o,to:l})}i=dm.exec(e)}return n}var IA=class{constructor(e={}){pe(this,"structureAnalyzer");pe(this,"contextAnalyzer");let t=e.parser??new Jr;this.structureAnalyzer=e.structureAnalyzer??new pi(t),this.contextAnalyzer=e.contextAnalyzer??new ao(t)}async resolve(e,t){let n=c2(e,t);if(!n)return null;let i=await u2(this.structureAnalyzer,e,t);if(!i||n.from<i.from||n.to>i.to)return null;let o=e.sliceDoc(i.from,i.to),l=TA(o,await this.contextAnalyzer.getContext(o,{state:e}),{from:n.from-i.from,to:n.to-i.from,text:n.text});if(!l)return null;let u=d=>({from:d.from+i.from,to:d.to+i.from});return{...l,definition:u(l.definition),references:l.references.map(u)}}},AA=/([\w$]+|"[^"]+"|`[^`]+`|\[[^\]]+\])$/;function LA(e){return/\b(?:from|join)\s+$/i.test(e)}function f2(e){return/^[A-Za-z_][\w$]*$/.test(e)}function PA(e){return{label:e.name,type:"variable",info:`Common Table Expression: ${e.name}`,boost:10,...f2(e.name)?{}:{apply:`"${e.name}"`}}}function p2(e){return e.columns.map(t=>({label:t,type:"property",detail:`column of ${e.name}`,boost:5,...f2(t)?{}:{apply:`"${t}"`}}))}function m2(e={}){let t=e.parser??new Jr,n=e.contextAnalyzer??new ao(t),i=e.structureAnalyzer??new pi(t);return async o=>{let l=o.matchBefore(/[\w$]*/);if(!l)return null;let u=o.state.sliceDoc(Math.max(0,l.from-1),l.from)===".";if(l.from===l.to&&!o.explicit&&!u)return null;let d=await u2(i,o.state,o.pos),p=d?o.state.sliceDoc(d.from,d.to):o.state.doc.toString(),g=await n.getContext(p,{state:o.state});if(g.ctes.length===0)return null;if(u){let x=o.state.doc.lineAt(l.from),S=o.state.sliceDoc(x.from,l.from-1),E=AA.exec(S);if(!E||!E[1]||S.slice(0,S.length-E[1].length).endsWith("."))return null;let T=er(E[1]).toLowerCase(),O=g.ctes.find(j=>j.name.toLowerCase()===T);return!O||O.columns.length===0?null:{from:l.from,options:p2(O),validFor:/^[\w$]*$/}}let w=g.ctes.map(PA);if(!LA(o.state.sliceDoc(Math.max(0,l.from-64),l.from))){let x=new Set(g.tables.map(E=>E.name.toLowerCase())),S=new Set;for(let E of g.ctes)if(x.has(E.name.toLowerCase()))for(let T of p2(E)){let O=T.label.toLowerCase();S.has(O)||(S.add(O),w.push(T))}}return{from:l.from,options:w,validFor:/^[\w$]*$/}}}var OA=750;function h2(e,t){if(t>=e.length)return e.length;let n=e.lineAt(t),i=n.text.slice(t-n.from).match(/^[\w"'`.]+/);return i?t+i[0].length:Math.min(t+1,e.length)}function MA(e,t){let n=t.line(Math.min(e.line,t.lines)),i=Math.min(n.from+Math.max(0,e.column-1),t.length);return{from:i,to:h2(t,i),severity:e.severity,message:e.message,source:"sql-parser"}}function NA(e,t,n){let i;return i=e.line<=1?t.from+Math.max(0,e.column-1):n.line(Math.min(t.lineFrom+e.line-1,n.lines)).from+Math.max(0,e.column-1),i=Math.max(t.from,Math.min(i,t.to)),{from:i,to:Math.max(i,Math.min(h2(n,i),t.to)),severity:e.severity,message:e.message,source:"sql-parser"}}function jA(e={}){return oS(qA(e),{delay:e.delay||OA})}function qA(e={}){let t=e.parser||new Jr,n=e.perStatement!==!1,i=e.structureAnalyzer||new pi(t);return async o=>{let l=o.state.doc,u=l.toString();return u.trim()?n?(await i.analyzeDocument(o.state)).flatMap(d=>d.errors.map(p=>NA(p,d,l))):(await t.validateSql(u,{state:o.state})).map(d=>MA(d,l)):[]}}function g2(e,t){if(t.size===0)return{};if(va(e)){let n={};for(let[i,o]of Object.entries(e))if(Array.from(t).some(l=>l.toLowerCase()===i.toLowerCase()))n[i]=o;else if(va(o)){let l=g2(o,t);Object.keys(l).length>0&&(n[i]=l)}return n}return e}function zA(e={}){let{schema:t,keywords:n={},enableKeywords:i=!0,enableTables:o=!0,enableColumns:l=!0,enableFuzzySearch:u=!0,parser:d=new Jr,tooltipRender:p,tooltipRenderers:g={}}=e,w=new pi(d),x=e.contextAnalyzer??new ao(d),S=null;return async(E,T,O)=>{let{from:j,to:z,text:V}=E.state.doc.lineAt(T),P=T,U=T;S===null&&(S=typeof n=="function"?n(E):Promise.resolve(n));let me;try{me=await S}catch{S=null,me={}}for(;P>j&&/[\w.]/.test(V[P-j-1]??"");)P--;for(;U<z&&/[\w.]/.test(V[U-j]??"");)U++;if(P===T&&O<0||U===T&&O>0)return null;let $=V.slice(P-j,U-j).toLowerCase();if(!$||$.length===0)return null;let W=t2(t,E)??{},ae=null;`${$}`;let xe=Object.hasOwn(me,$)?me[$]:void 0;if(!ae&&i&&xe&&(ae={word:$,view:E,pos:T,tooltipType:"keyword",keywordData:{keyword:$,info:xe}}),!ae&&(o||l)&&W){let Te=await w.getStatementAtPosition(E.state,T),Z=Te?E.state.doc.sliceString(Te.from,Te.to):E.state.doc.toString(),Q=await x.getContext(Z,{state:E.state}),[Y="",...ce]=$.split("."),te=Q.aliases.get(Y),he=te?[te,...ce].join(".").toLowerCase():$,G=new Set(Q.tables.map(Qe=>Qe.name.toLowerCase())),je=g2(W,G),qe=e2(je,he,{enableFuzzySearch:u});if(!qe&&G.size===0&&(qe=e2(W,he,{enableFuzzySearch:u})),qe){let{semanticType:Qe}=qe;(Qe==="table"&&!o||Qe==="column"&&!l)&&(qe=null)}qe&&(Array.from(G),ae={word:$,view:E,pos:T,tooltipType:"namespace",namespaceData:{item:qe,word:$,resolvedSchema:G.size>0?je:W,...te?{aliasFor:te}:{}}})}if(!ae)return null;let _e=ae;return{pos:P,end:U,above:!0,create(Te){if(p){let Y=p($,Te,T);if(Y)return{dom:Y}}let Z=null;if(_e.tooltipType==="keyword"&&_e.keywordData)Z=g.keyword?g.keyword(_e.keywordData):b2(_e.keywordData);else if(_e.tooltipType==="namespace"&&_e.namespaceData){let Y=_e.namespaceData,{semanticType:ce}=Y.item;ce==="table"&&g.table?Z=g.table(Y):ce==="column"&&g.column?Z=g.column(Y):(ce==="database"||ce==="schema"||ce==="namespace")&&g.namespace?Z=g.namespace(Y):(Z=v2(Y.item),Y.aliasFor&&(Z=`<div class="sql-hover-alias"><code>${y2(Y.word.split(".")[0]??"")}</code> is an alias for <code>${y2(Y.aliasFor)}</code></div>`+Z))}if(!Z)return{dom:document.createElement("div")};let Q=document.createElement("div");return Q.className="cm-sql-hover-tooltip",Q.innerHTML=Z,{dom:Q}}}}}function FA(e={}){let{hoverTime:t=300}=e;return Ig(zA(e),{hoverTime:t})}function y2(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function v2(e){var o,l,u,d,p,g,w;let t=e.path.join("."),n=((o=e.completion)==null?void 0:o.label)||e.value||e.path[e.path.length-1]||"unknown",i=`<div class="sql-hover-${e.semanticType}">`;switch(i+=`<div class="sql-hover-header"><strong>${n}</strong> <span class="sql-hover-type">${e.semanticType}</span></div>`,e.semanticType){case"database":if(i+=`<div class="sql-hover-description">Database${(l=e.completion)!=null&&l.detail?`: ${e.completion.detail}`:""}</div>`,e.namespace){let x=Du(e.namespace);x>0&&(i+=`<div class="sql-hover-children">Contains ${x} schema${x===1?"":"s"}</div>`)}break;case"schema":if(i+=`<div class="sql-hover-description">Schema${(u=e.completion)!=null&&u.detail?`: ${e.completion.detail}`:""}</div>`,t&&(i+=`<div class="sql-hover-path"><strong>Path:</strong> <code>${t}</code></div>`),e.namespace){let x=Du(e.namespace);x>0&&(i+=`<div class="sql-hover-children">Contains ${x} table${x===1?"":"s"}</div>`)}break;case"table":if(i+=`<div class="sql-hover-description">Table${(d=e.completion)!=null&&d.detail?`: ${e.completion.detail}`:""}</div>`,t){let x=e.path;x.length>1&&(i+=`<div class="sql-hover-path"><strong>Schema:</strong> <code>${x.slice(0,-1).join(".")}</code></div>`)}if(e.namespace&&Zn(e.namespace)){let x=e.namespace;if(x.length>0){i+=`<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);i+=S.map(E=>`<code>${E}</code>`).join(", "),x.length>8&&(i+=`, <em>and ${x.length-8} more...</em>`),i+="</div>"}}break;case"column":if(i+=`<div class="sql-hover-description">Column${(p=e.completion)!=null&&p.detail?`: ${e.completion.detail}`:""}</div>`,t){let x=e.path;x.length>1&&(i+=`<div class="sql-hover-path"><strong>Table:</strong> <code>${x.slice(0,-1).join(".")}</code></div>`)}break;default:if(i+=`<div class="sql-hover-description">Namespace${(g=e.completion)!=null&&g.detail?`: ${e.completion.detail}`:""}</div>`,t&&(i+=`<div class="sql-hover-path"><strong>Path:</strong> <code>${t}</code></div>`),e.namespace){let x=Du(e.namespace);x>0&&(i+=`<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"&&(i+=`<div class="sql-hover-info">${e.completion.info}</div>`),i+="</div>",i}function Du(e){return Array.isArray(e)?e.length:typeof e=="object"&&e?"self"in e&&"children"in e?1+Du(e.children):Object.keys(e).length:0}function b2(e){let{keyword:t,info:n}=e,i='<div class="sql-hover-keyword">';if(i+=`<div class="sql-hover-header"><strong>${t.toUpperCase()}</strong> <span class="sql-hover-type">keyword</span></div>`,i+=`<div class="sql-hover-description">${n.description}</div>`,n.syntax&&(i+=`<div class="sql-hover-syntax"><strong>Syntax:</strong> <code>${n.syntax}</code></div>`),n.example&&(i+=`<div class="sql-hover-example"><strong>Example:</strong><br><code>${n.example}</code></div>`),n.metadata&&typeof n.metadata=="object"&&Object.keys(n.metadata).length>0){i+='<div class="sql-hover-metadata">';for(let[o,l]of Object.entries(n.metadata))i+=`<span class="sql-hover-tag" title="${o}">${l}</span> `;i+="</div>"}return i+="</div>",i}function $A(e){let{tableName:t,columns:n,metadata:i}=e,o='<div class="sql-hover-table">';if(o+=`<div class="sql-hover-header"><strong>${t}</strong> <span class="sql-hover-type">table</span></div>`,o+=`<div class="sql-hover-description">Table with ${n.length} column${n.length===1?"":"s"}</div>`,n.length>0){o+='<div class="sql-hover-columns"><strong>Columns:</strong><br>';let l=n.slice(0,10);o+=l.map(u=>`<code>${u}</code>`).join(", "),n.length>10&&(o+=`, <em>and ${n.length-10} more...</em>`),o+="</div>"}if(i&&typeof i=="object"&&Object.keys(i).length>0){o+='<div class="sql-hover-metadata">';for(let[l,u]of Object.entries(i))o+=`<span class="sql-hover-tag" title="${l}">${u}</span> `;o+="</div>"}return o+="</div>",o}function VA(e){let{tableName:t,columnName:n,schema:i,metadata:o}=e,l='<div class="sql-hover-column">';l+=`<div class="sql-hover-header"><strong>${n}</strong> <span class="sql-hover-type">column</span></div>`,l+=`<div class="sql-hover-description">Column in table <code>${t}</code></div>`;let u=i[t];if(u&&u.length>1){let d=u.filter(p=>p!==n);if(d.length>0){l+=`<div class="sql-hover-related"><strong>Other columns in ${t}:</strong><br>`;let p=d.slice(0,8);l+=p.map(g=>`<code>${g}</code>`).join(", "),d.length>8&&(l+=`, <em>and ${d.length-8} more...</em>`),l+="</div>"}}if(o&&typeof o=="object"&&Object.keys(o).length>0){l+='<div class="sql-hover-metadata">';for(let[d,p]of Object.entries(o))l+=`<span class="sql-hover-tag" title="${d}">${p}</span> `;l+="</div>"}return l+="</div>",l}const HA={keyword:b2,table:$A,column:VA,namespace:v2},w2=(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 At.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-alias":{marginBottom:"6px",color:t.tooltipChildren,fontSize:"12px"},".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}})};function cs(e){return e.resolver??new IA(e)}var x2=At.baseTheme({".cm-sqlReference":{backgroundColor:"rgba(96, 165, 250, 0.18)"},".cm-sqlReference.cm-sqlDefinition":{backgroundColor:"rgba(96, 165, 250, 0.35)"},".cm-sqlGotoTarget":{textDecoration:"underline",cursor:"pointer"}}),BA=Xt.mark({class:"cm-sqlReference"}),WA=Xt.mark({class:"cm-sqlReference cm-sqlDefinition"}),UA=Xt.mark({class:"cm-sqlGotoTarget"});function KA(e){return Xt.set(e.references.map(t=>(t.from===e.definition.from?WA:BA).range(t.from,t.to)),!0)}var _2=sr.define(),k2=li.define({create:()=>Xt.none,update(e,t){for(let n of t.effects)if(n.is(_2))return n.value;return t.docChanged?e.map(t.changes):e},provide:e=>At.decorations.from(e)});function QA(e={}){let t=cs(e),n=e.highlightDelay??150;return[k2,Cr.fromClass(class{constructor(i){pe(this,"view");pe(this,"timer",null);pe(this,"generation",0);this.view=i,this.schedule()}update(i){(i.selectionSet||i.docChanged)&&this.schedule()}schedule(){this.generation++,this.timer!=null&&clearTimeout(this.timer),this.timer=setTimeout(()=>{this.timer=null,this.run()},n)}async run(){let i=this.generation,o=this.view.state,l=o.selection.main,u=Xt.none;if(l.empty)try{let p=await t.resolve(o,l.head);p&&(u=KA(p))}catch{}if(i!==this.generation)return;let d=this.view.state.field(k2,!1);u.size===0&&(d==null||d.size===0)||this.view.dispatch({effects:_2.of(u)})}destroy(){this.generation++,this.timer!=null&&clearTimeout(this.timer)}}),x2]}async function GA(e,t,n={}){let i=e.state,o=t??i.selection.main.head,l=await cs(n).resolve(i,o);return!l||e.state!==i?!1:(e.dispatch({selection:{anchor:l.definition.from,head:l.definition.to},scrollIntoView:!0,userEvent:"select"}),!0)}var pm=sr.define(),C2=li.define({create:()=>Xt.none,update(e,t){for(let n of t.effects)if(n.is(pm))return n.value;return t.docChanged?e.map(t.changes):e},provide:e=>At.decorations.from(e)});function XA(e={}){let t=cs(e);return[C2,Cr.fromClass(class{constructor(n){pe(this,"view");pe(this,"hovered",null);this.view=n}update(n){n.docChanged&&(this.hovered=null)}resultAt(n){return this.hovered&&n>=this.hovered.from&&n<=this.hovered.to?this.hovered.result:null}clear(){if(this.hovered){this.hovered=null;let n=this.view.state.field(C2,!1);n&&n.size>0&&this.view.dispatch({effects:pm.of(Xt.none)})}}async hover(n){let i=c2(this.view.state,n);if(!i){this.clear();return}if(this.hovered&&this.hovered.from===i.from&&this.hovered.to===i.to)return;let o={from:i.from,to:i.to,result:null};this.hovered=o;let l=this.view.state;try{let u=await t.resolve(l,n);if(this.hovered!==o||this.view.state!==l)return;o.result=u,this.view.dispatch({effects:pm.of(u?Xt.set([UA.range(i.from,i.to)]):Xt.none)})}catch{}}destroy(){this.hovered=null}},{eventHandlers:{mousemove(n,i){if(!(n.metaKey||n.ctrlKey)){this.clear();return}let o=i.posAtCoords({x:n.clientX,y:n.clientY});if(o==null){this.clear();return}this.hover(o)},mousedown(n,i){if(!(n.metaKey||n.ctrlKey)||n.button!==0)return!1;let o=i.posAtCoords({x:n.clientX,y:n.clientY});if(o==null)return!1;let l=this.resultAt(o);return l?(i.dispatch({selection:{anchor:l.definition.from,head:l.definition.to},scrollIntoView:!0,userEvent:"select.pointer"}),!0):!1}}}),x2]}var JA=e=>typeof window<"u"&&typeof window.prompt=="function"?window.prompt(`Rename '${e}' to:`,e):null,YA=/^[A-Za-z_][\w$]*$/,ZA=new Set("all.and.as.asc.between.by.case.cross.delete.desc.distinct.else.end.except.exists.fetch.from.full.group.having.in.inner.insert.intersect.into.is.join.lateral.left.like.limit.natural.not.null.offset.on.or.order.outer.qualify.recursive.right.select.set.table.then.union.update.using.values.when.where.window.with".split("."));async function eL(e,t={}){let n=e.state,i=await cs(t).resolve(n,n.selection.main.head);if(!i)return!1;let o=await(t.prompt??JA)(i.name);return!o||o===i.name||!YA.test(o)||ZA.has(o.toLowerCase())||e.state!==n?!1:(e.dispatch({changes:i.references.map(l=>({from:l.from,to:l.to,insert:o})),userEvent:"rename"}),!0)}function tL(e={}){let t={...e,resolver:cs(e)},n=e.gotoDefinitionKeys??["F12","Mod-b"],i=e.renameKey??"F2";return Si.of([...n.map(o=>({key:o,run:l=>(GA(l,void 0,t),!0)})),{key:i,run:o=>(eL(o,t),!0)}])}function nL(e={}){let t={...e,resolver:cs(e)},n=[QA(t),XA(t)];return e.keymap&&n.push(tL(t)),n}var rL=750;function us(e){return typeof e=="object"&&!!e&&!Array.isArray(e)&&e.type==="select"}function wa(e){return Array.isArray(e)?e:[]}function ds(e){return{sources:[],columnRefs:[],selectAliases:new Set,checkUnqualified:e,hasUsingJoin:!1}}function Ru(e,t,n){let i=wa(e.with);for(let o of i){let l=o.name,u=typeof l=="string"?l:l==null?void 0:l.value;typeof u=="string"&&t.add(u.toLowerCase())}for(let o of i){let l=o.stmt,u=(l==null?void 0:l.ast)??l;us(u)&&oo(u,t,n,!1)}}function Dl(e,t,n,i){e.using!=null&&(t.hasUsingJoin=!0),typeof e.join=="string"&&e.join.toLowerCase().includes("natural")&&(t.hasUsingJoin=!0),e.on!=null&&mi(e.on,t,n,i);let o=e.expr;if(o!=null){let l=o.ast??o;us(l)&&oo(l,n,i,!1),t.sources.push({path:"",name:"",alias:typeof e.as=="string"?e.as:null,isCte:!1,opaque:!0});return}if(typeof e.table=="string"){let l=[e.db??e.catalog,e.schema,e.table].filter(u=>typeof u=="string"&&u.length>0);t.sources.push({path:l.join("."),name:e.table,alias:typeof e.as=="string"?e.as:null,isCte:l.length===1&&n.has(e.table.toLowerCase()),opaque:!1})}}function mi(e,t,n,i){if(typeof e!="object"||!e)return;if(Array.isArray(e)){for(let l of e)mi(l,t,n,i);return}let o=e;if(o.type==="column_ref"){t.columnRefs.push(o);return}if(us(o)){oo(o,n,i,!0);return}if(us(o.ast)){oo(o.ast,n,i,!0);return}for(let[l,u]of Object.entries(o))l==="loc"||l==="tableList"||l==="columnList"||mi(u,t,n,i)}function oo(e,t,n,i){let o=new Set(t);Ru(e,o,n);let l=ds(!i);n.push(l);for(let u of wa(e.from))Dl(u,l,o,n);for(let u of wa(e.columns))typeof u.as=="string"&&l.selectAliases.add(u.as.toLowerCase());for(let[u,d]of Object.entries(e))u==="with"||u==="from"||u==="loc"||mi(d,l,o,n)}function iL(e,t){let n=new Set;switch(e.type){case"select":oo(e,n,t,!1);return;case"update":{Ru(e,n,t);let i=ds(!0);t.push(i);for(let o of wa(e.table))Dl(o,i,n,t);for(let o of wa(e.from))Dl(o,i,n,t);for(let o of wa(e.set))o.column!=null&&i.columnRefs.push({type:"column_ref",table:o.table??null,column:o.column}),mi(o.value,i,n,t);for(let[o,l]of Object.entries(e))o==="with"||o==="table"||o==="from"||o==="set"||o==="loc"||mi(l,i,n,t);return}case"delete":{Ru(e,n,t);let i=ds(!0);t.push(i);for(let o of wa(e.from))Dl(o,i,n,t);for(let[o,l]of Object.entries(e))o==="with"||o==="table"||o==="from"||o==="loc"||mi(l,i,n,t);return}case"insert":case"replace":{Ru(e,n,t);let i=ds(!1);t.push(i);for(let o of wa(e.table))Dl(o,i,n,t);for(let[o,l]of Object.entries(e))o==="with"||o==="table"||o==="columns"||o==="loc"||(us(l)?oo(l,n,t,!1):mi(l,i,n,t));return}case"create":case"alter":case"drop":{let i=ds(!1);t.push(i);for(let[o,l]of Object.entries(e))o==="table"||o==="loc"||(us(l)?oo(l,n,t,!1):mi(l,i,n,t));return}default:{let i=ds(!1);t.push(i);for(let[o,l]of Object.entries(e))o!=="loc"&&mi(l,i,n,t)}}}function aL(e){var n;let t=e.column;if(typeof t=="string")return t;if(typeof t=="object"&&t){let i=((n=t.expr)==null?void 0:n.value)??t.value;if(typeof i=="string")return i}return null}function oL(e){return typeof e.table!="string"||e.table.length===0?null:typeof e.db=="string"&&e.db.length>0?`${e.db}.${e.table}`:e.table}function mm(e){if(e==null)return null;let t=Ar(e)?e.children:e;return Zn(t)?t.map(n=>typeof n=="string"?n:n.label):null}function sL(e,t){var u;let n=Cu(e,t,{caseSensitive:!1});if(n)return{exists:!0,columns:mm(n.namespace)};let i=t.split(".").map(d=>d.toLowerCase()),o=i[i.length-1];if(!o)return{exists:!1,columns:null};let l=Zp(e,o).filter(d=>{if(mm(d.namespace)===null||d.path.length<i.length)return!1;let p=d.path.slice(-i.length).map(g=>g.toLowerCase());return i.every((g,w)=>p[w]===g)});return l.length===0?{exists:!1,columns:null}:{exists:!0,columns:l.length===1?mm((u=l[0])==null?void 0:u.namespace):null}}function S2(e,t){let n=t.toLowerCase();return e.some(i=>i.toLowerCase()===n)}function lL(e,t){let n=[];iL(e,n);let i=new Map,o=l=>{let u=`${l.kind}::${l.identifier.toLowerCase()}`;i.has(u)||i.set(u,l)};for(let l of n){let u=l.sources.map(d=>{if(d.opaque||d.isCte)return{source:d,exists:!0,columns:null};let p=sL(t,d.path);return{source:d,exists:p.exists,columns:p.columns}});for(let{source:d,exists:p}of u)!d.opaque&&!d.isCte&&!p&&o({kind:"unknownTable",identifier:d.name,message:`Unknown table '${d.path}'`});for(let d of l.columnRefs){let p=aL(d);if(!p||p==="*")continue;let g=oL(d);if(g){let S=g.toLowerCase(),E=u.find(T=>{var O;return((O=T.source.alias)==null?void 0:O.toLowerCase())===S})??u.find(T=>T.source.name.toLowerCase()===S||T.source.path.toLowerCase()===S);E!=null&&E.columns&&!S2(E.columns,p)&&o({kind:"unknownColumn",identifier:p,message:`Column '${p}' not found in table '${E.source.path||g}'`});continue}if(!l.checkUnqualified||l.selectAliases.has(p.toLowerCase()))continue;let w=u.filter(S=>S.columns!==null&&S2(S.columns,p));if(w.length>=2&&!l.hasUsingJoin){o({kind:"ambiguousColumn",identifier:p,message:`Column '${p}' is ambiguous; it exists in ${w.map(S=>S.source.name).join(", ")}`});continue}let x=u.length===1?u[0]:void 0;x&&x.columns!==null&&w.length===0&&o({kind:"unknownColumn",identifier:p,message:`Column '${p}' not found in table '${x.source.path}'`})}}return[...i.values()]}function cL(e,t){let n=e.toLowerCase(),i=t.toLowerCase(),o=n.indexOf(i);for(;o!==-1;){let l=o>0?n[o-1]??"":"",u=n[o+i.length]??"";if(!/[\w$]/.test(l)&&!/[\w$]/.test(u))return o;o=n.indexOf(i,o+1)}return-1}function uL(e,t,n,i){var d;let o=n.sliceString(t.from,t.to),l=cL(o,e.identifier),u=l===-1?t.from:t.from+l;return{from:u,to:Math.min(l===-1?t.from+(((d=o.match(/^[\w"'`.]+/))==null?void 0:d[0].length)??1):u+e.identifier.length,t.to),severity:i,message:e.message,source:"sql-schema"}}function dL(e){return Zn(e)?e.length===0:va(e)?Object.keys(e).length===0:!1}function fL(e={}){var o,l,u;let t=e.parser||new Jr,n=e.structureAnalyzer||new pi(t),i={unknownTable:((o=e.severity)==null?void 0:o.unknownTable)??"warning",unknownColumn:((l=e.severity)==null?void 0:l.unknownColumn)??"warning",ambiguousColumn:((u=e.severity)==null?void 0:u.ambiguousColumn)??"warning"};return async d=>{let p=t2(e.schema,d);if(p==null||dL(p))return[];let g=d.state.doc;if(!g.toString().trim())return[];let w=[],x=await n.analyzeDocument(d.state);for(let S of x){if(!S.isValid)continue;let E=await t.parse(S.content,{state:d.state});if(!E.success||E.ast==null)continue;let T=Array.isArray(E.ast)?E.ast:[E.ast];for(let O of T)for(let j of lL(O,p)){let z=i[j.kind];z!=="off"&&w.push(uL(j,S,g,z))}}return w}}function pL(e={}){return oS(fL(e),{delay:e.delay||rL})}var E2=sr.define(),T2=li.define({create(){return{currentStatement:null,allStatements:[],cursorPosition:0,isFocused:!0}},update(e,t){for(let n of t.effects)if(n.is(E2))return n.value;return e}});function mL(e,t){let{isCurrent:n,isValid:i,isFocused:o}=t,l=e.backgroundColor||"#3b82f6";!i&&e.showInvalid!==!1&&(l=e.errorBackgroundColor||"#ef4444");let u=n?"1":(e.inactiveOpacity??.3).toString(),d;return d=o?u:e.unfocusedOpacity===void 0?e.hideWhenNotFocused?"0":u:e.unfocusedOpacity.toString(),{backgroundColor:l,opacity:d}}var hL=class extends ZC{constructor(t,n,i=!0,o=!0){super();pe(this,"config");pe(this,"isCurrent");pe(this,"isValid");pe(this,"isFocused");this.config=t,this.isCurrent=n,this.isValid=i,this.isFocused=o}toDOM(){let t=document.createElement("div");t.className="cm-sql-gutter-marker";let{backgroundColor:n,opacity:i}=mL(this.config,{isCurrent:this.isCurrent,isValid:this.isValid,isFocused:this.isFocused});return t.style.cssText=`
|
|
155
155
|
background: ${n};
|
|
156
156
|
height: 100%;
|
|
157
157
|
width: 100%;
|
|
158
158
|
opacity: ${i};
|
|
159
159
|
transition: opacity 150ms ease-in-out;
|
|
160
160
|
border-radius: 1px;
|
|
161
|
-
`,t}eq(t){return this.isCurrent===t.isCurrent&&this.isValid===t.isValid&&this.isFocused===t.isFocused&&this.config===t.config}};function gL(e,t){var d;let n=UC.empty;if((d=t.whenHide)!=null&&d.call(t,e))return n;let i=e.state.field(T2,!1);if(!i)return n;let{currentStatement:o,allStatements:l,isFocused:u}=i;try{let p=e.state.doc.lineAt(e.viewport.from).number,g=e.state.doc.lineAt(e.viewport.to).number;for(let w of l){if(w.lineTo<p||w.lineFrom>g)continue;let x=(o==null?void 0:o.from)===w.from&&(o==null?void 0:o.to)===w.to;if(!w.isValid&&t.showInvalid===!1)continue;let S=new hL(t,x,w.isValid,u),E=Math.max(w.lineFrom,p),T=Math.min(w.lineTo,g);for(let O=E;O<=T;O++)try{if(O<1||O>e.state.doc.lines)continue;let j=e.state.doc.line(O);n=n.update({add:[S.range(j.from)]})}catch(j){console.warn("SqlGutter: Invalid line number",O,j)}}}catch(p){console.warn("SqlGutter: Error creating markers",p)}return n}async function D2(e,t){let{state:n}=e,i=n.selection.main.head,o=await t.analyzeDocument(n),l={currentStatement:await t.getStatementAtPosition(n,i),allStatements:o,cursorPosition:i,isFocused:e.hasFocus};e.dispatch({effects:E2.of(l)})}function yL(e){return Cr.define(t=>(D2(t,e),{update(n){!n.docChanged&&!n.selectionSet&&!n.focusChanged||D2(n.view,e)}}))}function vL(e){let t=e.width||3;return At.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 bL(e){return YC({class:`cm-sql-gutter ${e.className||""}`,markers:t=>gL(t,e)})}function wL(e={}){return[T2,yL(new pi(e.parser||new Jr)),vL(e),bL(e)]}function xL(e={}){let t=[],{schema:n,enableLinting:i=!0,enableSemanticLinting:o=!0,enableGutterMarkers:l=!0,enableHover:u=!0,enableNavigation:d=!0,linterConfig:p,semanticLinterConfig:g,gutterConfig:w,hoverConfig:x,navigationConfig:S}=e;if(n!=null&&t.push(em.of(n)),i&&t.push(jA(p)),o){let E=(g==null?void 0:g.parser)??(p==null?void 0:p.parser),T=(g==null?void 0:g.structureAnalyzer)??((g==null?void 0:g.parser)==null?p==null?void 0:p.structureAnalyzer:void 0);t.push(pL({...g,parser:E,structureAnalyzer:T}))}if(l&&t.push(wL(w)),u&&(t.push(FA(x)),t.push((x==null?void 0:x.theme)??w2())),d){let E=(S==null?void 0:S.parser)??(p==null?void 0:p.parser),T=(S==null?void 0:S.structureAnalyzer)??((S==null?void 0:S.parser)==null?p==null?void 0:p.structureAnalyzer:void 0);t.push(...nL({...S,parser:E,structureAnalyzer:T}))}return t}var _L=class LT{static jsonStringifySortKeys(){return t=>typeof t!="object"||!t?String(t):JSON.stringify(t,Object.keys(t).toSorted(),2)}constructor(t,n={}){this.delegate=t,this.toKey=n.toKey??LT.jsonStringifySortKeys(),this.cache=new uu(n.maxSize??128)}request(t){let n=this.toKey(t),i=this.cache.get(n);if(i!==void 0)return i;let o=this.delegate.request(t);return this.cache.set(n,o),o.catch(l=>{throw this.cache.delete(n),l})}resolve(t,n){this.delegate.resolve(t,n)}reject(t,n){this.delegate.reject(t,n)}};qS=new el("data-source-discovery-result",async e=>{await Sr().discoverDataSources({requestId:e})}),ST=new el("sql-table-preview",async(e,t)=>{await Sr().previewSQLTable({requestId:e,...t})}),XS=new el("sql-schema-list-preview",async(e,t)=>{await Sr().previewSQLSchemaList({requestId:e,...t})}),xS=new el("sql-table-list-preview",async(e,t)=>{await Sr().previewSQLTableList({requestId:e,...t})}),x0=new _L(new el("validate-sql",async(e,t)=>{await Sr().validateSQL({requestId:e,...t})}),{maxSize:3});var kL=kr();let oo;oo=je(new Map),OS=e=>{let t=(0,kL.c)(3),n=$n(oo),i;return t[0]!==e||t[1]!==n?(i=n.get(e),t[0]=e,t[1]=n,t[2]=i):i=t[2],i};function hm(e){let t=Me.get(oo),n=new Map(t);n.delete(e),Me.set(oo,n)}function CL(){Me.set(oo,new Map)}function SL({cellId:e,errorMessage:t,dialect:n}){let i=Me.get(oo),o=new Map(i),l=n==="DuckDB"?EL(t):R2(t);o.set(e,l),Me.set(oo,o)}function EL(e){let{errorType:t,errorMessage:n}=R2(e),i=n,o,l=n.indexOf("LINE ");return l!==-1&&(o=n.slice(Math.max(0,l)).trim(),i=n.slice(0,Math.max(0,l)).trim()),{errorType:t,errorMessage:i,codeblock:o}}function R2(e){return{errorType:e.split(":")[0].trim(),errorMessage:e.split(":").slice(1).join(":").trim()}}function I2(e){return e.field(Ei)}function TL(){return e=>{let t=I2(e.state).engine,n=no.getCompletionSource(t);return n&&g6(n)(e)||null}}function DL(){return e=>{let t=I2(e.state).engine,n=no.getDialect(t);return e.matchBefore(/\.\w*/)?null:_6(n,!0,(i,o)=>({label:i,type:o,info:async()=>{let l=(await RL())[i.toLocaleLowerCase()];if(!l)return null;let u=document.createElement("div");return u.innerHTML=HA.keyword({keyword:i,info:l}),u}}))(e)}}var RL=Ur(async()=>{let e=await de(()=>import("./common-keywords-CL5lDC0w.js").then(async n=>(await n.__tla,n)),[],import.meta.url),t=await de(()=>import("./duckdb-keywords-CKBoTxEb.js").then(async n=>(await n.__tla,n)),[],import.meta.url);return{...e.default.keywords,...t.default.keywords}}),IL=kr(),A2=Pc("marimo:notebook-sql-mode","default",ff);function AL(){let e=(0,IL.c)(3),[t,n]=LC(A2),i;return e[0]!==n||e[1]!==t?(i={sqlMode:t,setSQLMode:n},e[0]=n,e[1]=t,e[2]=i):i=e[2],i}function L2(){return Me.get(A2)}var LL=Cb,gm="DuckDB",P2=new Jd;function ym(){return Me.get(Vo).latestEngineSelected}lf=(Tm=class{constructor(){pe(this,"parser",new kf);pe(this,"type","sql");this.sqlModeEnabled=!0}get defaultMetadata(){return{...this.parser.defaultMetadata,engine:ym()||"__marimo_duckdb"}}get defaultCode(){let e=ym();return e&&e!=="__marimo_duckdb"?`_df = mo.sql(f"""SELECT * FROM """, engine=${e})`:this.parser.defaultCode}transformIn(e){this.parser.defaultMetadata.engine=ym()||"__marimo_duckdb";let t=this.parser.transformIn(e),n=t.metadata;return n.engine&&n.engine!=="__marimo_duckdb"&&Db(n.engine),[t.code,t.offset,n]}transformOut(e,t){let n=this.parser.transformOut(e,t);return[n.code,n.offset]}isSupported(e){return this.parser.isSupported(e)}getExtension(e,t,n,i,o){var d;let l=PL(),u=[P2.of(uS({dialect:LL})),Si.of([{key:"Tab",run:p=>c6(p)||H5(p),preventDefault:!0}]),ef({defaultKeymap:!1,activateOnTyping:!0,override:[TL(),mI,DL(),l.cteCompletionSource,l.aliasCompletionSource,l.columnCompletionSource]})];if(((d=o==null?void 0:o.diagnostics)==null?void 0:d.sql_linter)??!1){let p=Me.get(N6),g=new NL({getParserOptions:w=>({database:j2(w)??gm})});u.push(xL({schema:bm,enableLinting:!0,linterConfig:{delay:250,parser:g,perStatement:!1},enableSemanticLinting:!0,semanticLinterConfig:{parser:l.parser,structureAnalyzer:l.structureAnalyzer,severity:{unknownTable:"off",unknownColumn:"warning",ambiguousColumn:"warning"}},enableGutterMarkers:!0,gutterConfig:{backgroundColor:"#3b82f6",errorBackgroundColor:"#ef4444",hideWhenNotFocused:!0,parser:g},hoverConfig:{hoverTime:300,enableKeywords:!0,enableTables:!0,enableColumns:!0,parser:l.parser,contextAnalyzer:l.contextAnalyzer,theme:w2(p)},enableNavigation:!0,navigationConfig:{contextAnalyzer:l.contextAnalyzer,keymap:!1,parser:l.parser,structureAnalyzer:l.structureAnalyzer}}),At.updateListener.of(w=>{w.focusChanged&&g.setFocusState(w.view.hasFocus)}))}return this.sqlModeEnabled&&u.push(FL()),u}},pe(Tm,"fromQuery",e=>kf.fromQuery(e)),Tm);function PL(){let e=new Jr({getParserOptions:i=>({database:vm(i)})}),t=new OL(e),n=new ML(e);return{parser:e,contextAnalyzer:t,structureAnalyzer:n,cteCompletionSource:m2({parser:e,contextAnalyzer:t,structureAnalyzer:n}),aliasCompletionSource:bA({schema:bm,parser:e,contextAnalyzer:t}),columnCompletionSource:kA({schema:bm,parser:e,contextAnalyzer:t})}}function vm(e){return j2(e)??gm}var OL=class extends io{constructor(t){super(t);pe(this,"analyzers",new Map);this.analysisParser=t}getContext(t,n){return this.getAnalyzer(n.state).getContext(t,n)}clearCache(){for(let t of this.analyzers.values())t.clearCache()}getAnalyzer(t){let n=vm(t),i=this.analyzers.get(n);return i||(i=new io(this.analysisParser),this.analyzers.set(n,i)),i}},ML=class extends pi{constructor(t){super(t);pe(this,"analyzers",new Map);this.analysisParser=t}analyzeDocument(t){return this.getAnalyzer(t).analyzeDocument(t)}getStatementAtPosition(t,n){return this.getAnalyzer(t).getStatementAtPosition(t,n)}getStatementsInRange(t,n,i){return this.getAnalyzer(t).getStatementsInRange(t,n,i)}clearCache(){for(let t of this.analyzers.values())t.clearCache()}getAnalyzer(t){let n=vm(t),i=this.analyzers.get(n);return i||(i=new pi(this.analysisParser),this.analyzers.set(n,i)),i}},NL=class extends Jr{constructor(){super(...arguments);pe(this,"validationTimeout",null);pe(this,"pendingValidationResolve",null);pe(this,"VALIDATION_DELAY_MS",300);pe(this,"isFocused",!1)}setFocusState(t){this.isFocused=t}resolvePendingValidation(t){var n;(n=this.pendingValidationResolve)==null||n.call(this,t),this.pendingValidationResolve=null}async validateWithDelay(t,n,i){return this.validationTimeout&&(window.clearTimeout(this.validationTimeout),this.resolvePendingValidation([])),new Promise(o=>{this.pendingValidationResolve=o,this.validationTimeout=window.setTimeout(async()=>{var l;if(this.validationTimeout=null,!this.isFocused){this.resolvePendingValidation([]);return}try{let u=await q2(t,n,i,Ho.has(n)?L2():"default");if(u.error){Se.error("Failed to validate SQL",{error:u.error}),this.resolvePendingValidation([]);return}this.resolvePendingValidation(((l=u.parse_result)==null?void 0:l.errors)??[])}catch(u){Se.error("Failed to validate SQL",{error:u}),this.resolvePendingValidation([])}},this.VALIDATION_DELAY_MS)})}async validateSql(t,n){let i=fs(n.state),o=Ru(i.engine);return this.isFocused?O2(i.engine,o)?this.validateWithDelay(t,i.engine,o??gm):super.validateSql(t,n):[]}async parse(t,n){let i=fs(n.state).engine;return O2(i,Ru(i))?{success:!0,errors:[]}:super.parse(t,n)}};function O2(e,t){return e==="__marimo_duckdb"||t==="DuckDB"}function M2(e,t){e.dispatch({effects:P2.reconfigure(uS({dialect:t}))})}function jL(e,t){M2(e,no.getDialect(t))}function qL(e){let t=fs(e.state).engine;M2(e,no.getDialect(t))}function fs(e){return e.field(Ei)}function bm(e){let t=fs(e.state).engine,n=no.getCompletionSource(t);if(!(n!=null&&n.schema))return{};let i=n.schema;if(!N2(i))return i;let o=n.defaultSchema,l=o?i[o]:void 0;return l&&!Array.isArray(l)&&typeof l=="object"&&"children"in l&&N2(l.children)?{...i,...Object.fromEntries(Object.entries(l.children).filter(([u])=>!Object.hasOwn(i,u)))}:i}function N2(e){if(Array.isArray(e))return!1;if(!("self"in e)||!("children"in e))return!0;let t=e.self;return!(typeof t=="object"&&t&&!Array.isArray(t)&&"label"in t&&typeof t.label=="string")}function j2(e){let t=fs(e).engine;return Ru(t)}function Ru(e){var n;let t=(n=no.getInternalDialect(e))==null?void 0:n.toLowerCase();if(!t||!lu(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 Se.debug("Unsupported dialect",{dialect:t}),null;default:return Zs(t),null}}var zL=300;function FL(){return Cr.define(e=>{let t,n=null,i=e.state.facet(aa);return{update(o){if(!o.docChanged)return;let l=L2();if(l==="default")return;let u=fs(o.state).engine;if(!Ho.has(u))return;let d=o.state.doc.toString();t&&window.clearTimeout(t),t=window.setTimeout(async()=>{if(n!==d){if(n=d,d===""){hm(i);return}try{let p=Ru(u),g=(await q2(d,u,p,l)).validate_result;g!=null&&g.error_message?SL({cellId:i,errorMessage:g.error_message,dialect:p}):hm(i)}catch(p){Se.error("Failed to validate SQL",{error:p})}}},zL)},destroy(){t&&window.clearTimeout(t),hm(i)}}})}async function q2(e,t,n,i){let o=await x0.request({onlyParse:i==="default",engine:t,dialect:n,query:e});if(o.error)throw Error(o.error);return o}var $L=Ur(()=>new nA),VL=Ur(()=>new df),HL=Ur(()=>new lf);Tr={get python(){return $L()},get markdown(){return VL()},get sql(){return HL()}};function BL(){return Object.values(Tr)}let z2;z2=kr(),Rc=Re.forwardRef((e,t)=>{let n=(0,z2.c)(13),i,o;n[0]===e?(i=n[1],o=n[2]):({className:i,...o}=e,n[0]=e,n[1]=i,n[2]=o);let l;n[3]===i?l=n[4]:(l=Ci("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",i),n[3]=i,n[4]=l);let u;n[5]===Symbol.for("react.memo_cache_sentinel")?(u=Ci("flex items-center justify-center text-current max-h-[14px] overflow-hidden"),n[5]=u):u=n[5];let d;n[6]===o.checked?d=n[7]:(d=(0,M.jsx)(xy,{className:u,children:o.checked==="indeterminate"?(0,M.jsx)(l0,{className:"h-4 w-4"}):(0,M.jsx)(T6,{className:"h-4 w-4"})}),n[6]=o.checked,n[7]=d);let p;return n[8]!==o||n[9]!==t||n[10]!==l||n[11]!==d?(p=(0,M.jsx)(Hf,{ref:t,className:l,...o,children:d}),n[8]=o,n[9]=t,n[10]=l,n[11]=d,n[12]=p):p=n[12],p}),Rc.displayName=Hf.displayName,BS="_";var WL=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("."));s0=function(e,t=!0){return e=e.trim(),e?(/^\d/.test(e)&&(e=`_${e}`),e=e.replaceAll(/\W/g,"_"),t?e.toLowerCase():e):"_"},vS=function(e,t){let n=new Set(t),i=e,o=u=>!n.has(u)&&!WL.has(u);if(o(e))return e;let l=1;for(;!o(i);)i=`${e}_${l}`,l++;return i},VE=function(e,t){return H0(e)?`cell-${t}`:e},H0=function(e){return e?e==="_"||e==="__":!0};var UL=kr();function KL(e){let t=(0,UL.c)(15),{minWidth:n,padding:i}=e,o=n===void 0?70:n,l=i===void 0?15:i,[u,d]=(0,Re.useState)(50),p=(0,Re.useRef)(null),g=(0,Re.useRef)(null),w;t[0]===l?w=t[1]:(w=$=>{if(g.current&&p.current){let W=g.current;W.style.fontSize=window.getComputedStyle(p.current).fontSize,W.style.fontFamily=window.getComputedStyle(p.current).fontFamily,W.textContent=$;let ae=W.offsetWidth;d(ae+l)}},t[0]=l,t[1]=w);let x=w,S;t[2]===x?S=t[3]:(S=()=>{var $;x((($=p.current)==null?void 0:$.value)??"")},t[2]=x,t[3]=S),E6(S);let E;t[4]===x?E=t[5]:(E=$=>{x($.target.value)},t[4]=x,t[5]=E);let T=`${u}px`,O=`${o}px`,j;t[6]!==T||t[7]!==O?(j={width:T,minWidth:O},t[6]=T,t[7]=O,t[8]=j):j=t[8];let z;t[9]!==E||t[10]!==j?(z={ref:p,type:"text",onChange:E,style:j},t[9]=E,t[10]=j,t[11]=z):z=t[11];let V=z,P;t[12]===Symbol.for("react.memo_cache_sentinel")?(P={ref:g,style:{visibility:"hidden",position:"absolute",whiteSpace:"pre"}},t[12]=P):P=t[12];let U=P,me;return t[13]===V?me=t[14]:(me={inputProps:V,spanProps:U},t[13]=V,t[14]=me),me}var QL=kr();function GL({currentQuotePrefix:e,checked:t,prefix:n}){let i=e;return t?e===""?i=n:e!=="rf"&&n!==e&&(i="rf"):e===n?i="":e==="rf"&&(i=n==="r"?"f":"r"),i}let F2;F2=()=>{let e=(0,QL.c)(2),t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,M.jsxs)("section",{className:"flex flex-col gap-0.5",children:[(0,M.jsxs)("header",{className:"flex items-center gap-1",children:[(0,M.jsx)("code",{className:"text-xs px-1 py-0.5 bg-(--slate-2) rounded",children:"r"}),(0,M.jsx)("span",{className:"font-semibold",children:"Raw String"})]}),(0,M.jsx)("p",{className:"text-sm text-muted-foreground",children:"Write LaTeX without escaping special characters"}),(0,M.jsx)("pre",{className:"text-xs bg-(--slate-2) p-2 rounded",children:"\\alpha \\beta"})]}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for("react.memo_cache_sentinel")?(n=(0,M.jsxs)("div",{className:"flex flex-col gap-3.5",children:[t,(0,M.jsxs)("section",{className:"flex flex-col gap-0.5",children:[(0,M.jsxs)("header",{className:"flex items-center gap-1",children:[(0,M.jsx)("code",{className:"text-xs px-1 py-0.5 bg-(--slate-2) rounded",children:"f"}),(0,M.jsx)("span",{className:"font-semibold",children:"Format String"})]}),(0,M.jsx)("p",{className:"text-sm text-muted-foreground",children:"Interpolate Python values"}),(0,M.jsxs)("pre",{className:"text-xs bg-(--slate-2) p-2 rounded",children:["Hello ","{name}","! \u{1F601}"]})]})]}),e[1]=n):n=e[1],n},cy="data-cell-id",RS=function(e){return{[cy]:e}},h0="data-for-cell-id",af=function(e){return{[h0]:e}};var XL="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",JL="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",YL="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==",ZL="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",eP="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",tP=""+new URL("iceberg-COKYXo-A.png",import.meta.url).href,nP="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",rP="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",$2=""+new URL("postgresql-q8VEBKGg.svg",import.meta.url).href,iP="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",aP="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",oP="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",sP="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",lP="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",cP="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",uP=""+new URL("trino-DFsJbQoT.svg",import.meta.url).href,dP=kr(),fP={sqlite:sP,duckdb:ZL,motherduck:nP,postgres:$2,postgresql:$2,mysql:rP,snowflake:aP,databricks:JL,clickhouse:XL,timeplus:cP,bigquery:eP,trino:uP,iceberg:tP,datafusion:YL,pyspark:oP,redshift:iP,supabase:lP};Bg=e=>{let t=(0,dP.c)(11),{name:n,className:i}=e,o=fP[n.toLowerCase()];if(!o){let d;t[0]===i?d=t[1]:(d=Ci("mt-0.5",i),t[0]=i,t[1]=d);let p;return t[2]===d?p=t[3]:(p=(0,M.jsx)(sl,{className:d}),t[2]=d,t[3]=p),p}let l;t[4]!==i||t[5]!==o?(l=Ci("invert-[.5] dark:invert-[.7]",i,o.endsWith(".png")&&"brightness-100 dark:brightness-100 invert-0 dark:invert-0"),t[4]=i,t[5]=o,t[6]=l):l=t[6];let u;return t[7]!==n||t[8]!==l||t[9]!==o?(u=(0,M.jsx)("img",{src:o,alt:n,className:l}),t[7]=n,t[8]=l,t[9]=o,t[10]=u):u=t[10],u};var wm=kr();const pP=e=>{let t=(0,wm.c)(34),{selectedEngine:n,onChange:i,cellId:o}=e,l=$n(bf),u=[],d=[];for(let[Y,ce]of l.entries())Ho.has(Y)?u.push(ce):d.push(ce);let p=d6(),g=n&&!l.has(n),w;t[0]!==l||t[1]!==i||t[2]!==p?(w=Y=>{if(Y===V2){window.open(H2,"_blank");return}let ce=l.get(Y);ce&&(p(),i(ce.name),Db(ce.name))},t[0]=l,t[1]=i,t[2]=p,t[3]=w):w=t[3];let x=w,S=vP,E=E5,T;t[4]===o?T=t[5]:(T=af(o),t[4]=o,t[5]=T);let O;t[6]===Symbol.for("react.memo_cache_sentinel")?(O=(0,M.jsx)(x5,{placeholder:"Select an engine"}),t[6]=O):O=t[6];let j;t[7]===T?j=t[8]:(j=(0,M.jsx)(hP,{...T,children:O}),t[7]=T,t[8]=j);let z=k5,V;t[9]===o?V=t[10]:(V=af(o),t[9]=o,t[10]=V);let P=C5,U;t[11]===Symbol.for("react.memo_cache_sentinel")?(U=(0,M.jsx)(w5,{children:"Database connections"}),t[11]=U):U=t[11];let me;t[12]!==g||t[13]!==n?(me=g&&(0,M.jsx)(Eg,{value:n,children:(0,M.jsxs)("div",{className:"flex items-center gap-1 opacity-50",children:[(0,M.jsx)(y0,{className:"h-3 w-3"}),(0,M.jsx)("span",{className:"truncate",children:Pb(n)})]})},n),t[12]=g,t[13]=n,t[14]=me):me=t[14];let $=S(d),W=d.length>0&&(0,M.jsx)(HC,{}),ae=S(u),xe;t[15]===Symbol.for("react.memo_cache_sentinel")?(xe=(0,M.jsx)(HC,{}),t[15]=xe):xe=t[15];let _e;t[16]===Symbol.for("react.memo_cache_sentinel")?(_e=(0,M.jsx)(Eg,{className:"text-muted-foreground",value:V2,children:(0,M.jsxs)("a",{className:"flex items-center gap-1",href:H2,target:"_blank",rel:"noreferrer",children:[(0,M.jsx)(I6,{className:"h-3 w-3"}),(0,M.jsx)("span",{children:"How to add a database connection"})]})}),t[16]=_e):_e=t[16];let Te;t[17]!==P||t[18]!==W||t[19]!==ae||t[20]!==U||t[21]!==me||t[22]!==$?(Te=(0,M.jsxs)(P,{children:[U,me,$,W,ae,xe,_e]}),t[17]=P,t[18]=W,t[19]=ae,t[20]=U,t[21]=me,t[22]=$,t[23]=Te):Te=t[23];let Z;t[24]!==z||t[25]!==Te||t[26]!==V?(Z=(0,M.jsx)(z,{...V,children:Te}),t[24]=z,t[25]=Te,t[26]=V,t[27]=Z):Z=t[27];let Q;return t[28]!==E||t[29]!==x||t[30]!==n||t[31]!==Z||t[32]!==j?(Q=(0,M.jsx)("div",{className:"flex flex-row gap-1 items-center",children:(0,M.jsxs)(E,{value:n,onValueChange:x,children:[j,Z]})}),t[28]=E,t[29]=x,t[30]=n,t[31]=Z,t[32]=j,t[33]=Q):Q=t[33],Q};var V2="__help__",H2="http://docs.marimo.io/guides/working_with_data/sql/#connecting-to-a-custom-database";const mP=()=>{let e=(0,wm.c)(16),{sqlMode:t,setSQLMode:n}=AL(),i;e[0]!==n||e[1]!==t?(i=()=>{let E=t==="validate"?"default":"validate";E==="default"&&CL(),n(E)},e[0]=n,e[1]=t,e[2]=i):i=e[2];let o=i,l=bP,u=wP,d;e[3]===t?d=e[4]:(d=u(t),e[3]=t,e[4]=d);let p;e[5]===t?p=e[6]:(p=l(t),e[5]=t,e[6]=p);let g=t==="validate"?"Validate":"Default",w;e[7]===g?w=e[8]:(w=(0,M.jsx)("span",{className:"ml-1",children:g}),e[7]=g,e[8]=w);let x;e[9]!==o||e[10]!==p||e[11]!==w?(x=(0,M.jsxs)(BC,{variant:"ghost",size:"sm",onClick:o,className:"h-5 px-1.5 text-xs border-border shadow-none hover:bg-accent",children:[p,w]}),e[9]=o,e[10]=p,e[11]=w,e[12]=x):x=e[12];let S;return e[13]!==d||e[14]!==x?(S=(0,M.jsx)("div",{className:"flex flex-row gap-1 items-center",children:(0,M.jsx)(Tg,{delayDuration:300,content:d,children:x})}),e[13]=d,e[14]=x,e[15]=S):S=e[15],S};var hP=e=>{let t=(0,wm.c)(6),n,i;t[0]===e?(n=t[1],i=t[2]):({children:n,...i}=e,t[0]=e,t[1]=n,t[2]=i);let o;return t[3]!==n||t[4]!==i?(o=(0,M.jsx)(S5,{className:"text-xs border-border shadow-none! ring-0! h-5 px-1.5 hover:bg-accent transition-colors",...i,children:n}),t[3]=n,t[4]=i,t[5]=o):o=t[5],o};function gP(e){return e.source!=="iceberg"}function yP(e){return(0,M.jsx)(Eg,{value:e.name,children:(0,M.jsxs)("div",{className:"flex items-center gap-1",children:[(0,M.jsx)(Bg,{className:"h-3 w-3",name:e.dialect}),(0,M.jsx)("span",{className:"truncate ml-0.5",children:Pb(e.display_name)})]})},e.name)}function vP(e){return e=e.filter(gP),e.map(yP)}function bP(e){return e==="validate"?(0,M.jsx)(Rp,{className:"h-3 w-3"}):(0,M.jsx)(Ng,{className:"h-3 w-3"})}function wP(e){return e==="validate"?(0,M.jsxs)("div",{className:"text-xs",children:[(0,M.jsxs)("div",{className:"font-semibold mb-1 flex flex-row items-center gap-1",children:[(0,M.jsx)(Rp,{className:"h-3 w-3"}),"Validate Mode"]}),(0,M.jsx)("p",{children:"Queries are validated as you write them"})]}):(0,M.jsxs)("div",{className:"text-xs",children:[(0,M.jsxs)("div",{className:"font-semibold mb-1 flex flex-row items-center gap-1",children:[(0,M.jsx)(Ng,{className:"h-3 w-3"}),"Default Mode"]}),(0,M.jsx)("p",{children:"Standard editing"})]})}var B2=kr(),W2=()=>{let e=(0,B2.c)(1),t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,M.jsx)("div",{className:"h-4 border-r border-border"}),e[0]=t):t=e[0],t};const xP=e=>{let t=(0,B2.c)(102),{view:n}=e,i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i={minWidth:50},t[0]=i):i=t[0];let{spanProps:o,inputProps:l}=KL(i),u;t[1]===n.state?u=t[2]:(u=n.state.field(Ir),t[1]=n.state,t[2]=u);let d=u,p;t[3]===n.state?p=t[4]:(p=n.state.facet(aa),t[3]=n.state,t[4]=p);let g=p,w;t[5]===Symbol.for("react.memo_cache_sentinel")?(w=(0,M.jsx)("div",{}),t[5]=w):w=t[5];let x=w,S=!1,E;t[6]===n?E=t[7]:(E=z=>{n.dispatch({effects:_f.of(z),changes:{from:0,to:n.state.doc.length,insert:n.state.doc.toString()}})},t[6]=n,t[7]=E);let T=E;if(d instanceof lf){let z;t[8]===n.state?z=t[9]:(z=n.state.field(Ei),t[8]=n.state,t[9]=z);let V=z;S=!0;let P;t[10]===T?P=t[11]:(P=gt=>{let bt=s0(gt.currentTarget.value,!1);gt.currentTarget.value=bt,T({dataframeName:bt})},t[10]=T,t[11]=P);let U=P,me;t[12]!==T||t[13]!==n?(me=gt=>{T({engine:gt}),jL(n,gt)},t[12]=T,t[13]=n,t[14]=me):me=t[14];let $=me,W;t[15]===Symbol.for("react.memo_cache_sentinel")?(W=(0,M.jsx)("span",{className:"select-none",children:"Output variable: "}),t[15]=W):W=t[15];let ae;t[16]===l?ae=t[17]:(ae=gt=>{var bt;(bt=l.onChange)==null||bt.call(l,gt)},t[16]=l,t[17]=ae);let xe;t[18]===U?xe=t[19]:(xe=gt=>{gt.key==="Enter"&>.shiftKey&&U(gt)},t[18]=U,t[19]=xe);let _e;t[20]!==l||t[21]!==V.dataframeName||t[22]!==U||t[23]!==ae||t[24]!==xe?(_e=(0,M.jsx)("input",{...l,defaultValue:V.dataframeName,onChange:ae,onBlur:U,onKeyDown:xe,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]=l,t[21]=V.dataframeName,t[22]=U,t[23]=ae,t[24]=xe,t[25]=_e):_e=t[25];let Te;t[26]===o?Te=t[27]:(Te=(0,M.jsx)("span",{...o}),t[26]=o,t[27]=Te);let Z;t[28]!==_e||t[29]!==Te?(Z=(0,M.jsxs)("label",{className:"flex gap-2 items-center",children:[W,_e,Te]}),t[28]=_e,t[29]=Te,t[30]=Z):Z=t[30];let Q;t[31]!==g||t[32]!==V.engine||t[33]!==$?(Q=(0,M.jsx)(pP,{selectedEngine:V.engine,onChange:$,cellId:g}),t[31]=g,t[32]=V.engine,t[33]=$,t[34]=Q):Q=t[34];let Y;t[35]===V.engine?Y=t[36]:(Y=V.engine==="__marimo_duckdb"&&(0,M.jsx)(mP,{}),t[35]=V.engine,t[36]=Y);let ce;t[37]!==V.engine||t[38]!==n?(ce=async()=>{await VD(n,V.engine)},t[37]=V.engine,t[38]=n,t[39]=ce):ce=t[39];let te;t[40]===Symbol.for("react.memo_cache_sentinel")?(te=(0,M.jsx)(Vg,{className:"h-3 w-3"}),t[40]=te):te=t[40];let he;t[41]===ce?he=t[42]:(he=(0,M.jsx)(Tg,{content:"Format SQL",children:(0,M.jsx)(BC,{variant:"text",size:"icon",onClick:ce,children:te})}),t[41]=ce,t[42]=he);let G;t[43]===Symbol.for("react.memo_cache_sentinel")?(G=(0,M.jsx)(W2,{}),t[43]=G):G=t[43];let Ne;t[44]===T?Ne=t[45]:(Ne=gt=>{T({showOutput:!gt.target.checked})},t[44]=T,t[45]=Ne);let qe=!V.showOutput,Qe;t[46]!==Ne||t[47]!==qe?(Qe=(0,M.jsx)("input",{type:"checkbox",onChange:Ne,checked:qe}),t[46]=Ne,t[47]=qe,t[48]=Qe):Qe=t[48];let He;t[49]===Symbol.for("react.memo_cache_sentinel")?(He=(0,M.jsx)("span",{className:"select-none",children:"Hide output"}),t[49]=He):He=t[49];let Fe;t[50]===Qe?Fe=t[51]:(Fe=(0,M.jsxs)("label",{className:"flex items-center gap-2",children:[Qe,He]}),t[50]=Qe,t[51]=Fe);let Oe;t[52]!==Y||t[53]!==he||t[54]!==Fe?(Oe=(0,M.jsxs)("div",{className:"flex items-center gap-2 ml-auto",children:[Y,he,G,Fe]}),t[52]=Y,t[53]=he,t[54]=Fe,t[55]=Oe):Oe=t[55];let Be;t[56]!==Z||t[57]!==Q||t[58]!==Oe?(Be=(0,M.jsxs)("div",{className:"flex flex-1 gap-2 items-center",children:[Z,Q,Oe]}),t[56]=Z,t[57]=Q,t[58]=Oe,t[59]=Be):Be=t[59],x=Be}if(d instanceof df){S=!0;let z,V,P,U,me,$,W,ae,xe,_e;if(t[60]!==T||t[61]!==n.state){let{quotePrefix:Ne}=n.state.field(Ei);V=Ne,V===void 0&&(V="r",T({quotePrefix:V})),_e=(qe,Qe)=>{typeof Qe=="boolean"&&T({quotePrefix:GL({currentQuotePrefix:V,checked:Qe,prefix:qe})})},U="flex flex-row w-full justify-end gap-1.5 items-center",xe="flex items-center gap-1.5",t[72]===Symbol.for("react.memo_cache_sentinel")?(P=(0,M.jsx)("span",{children:"r"}),t[72]=P):P=t[72],z=Rc,$="Toggle raw string",W="w-3 h-3",ae=V.includes("r"),me=qe=>{_e("r",qe)},t[60]=T,t[61]=n.state,t[62]=z,t[63]=V,t[64]=P,t[65]=U,t[66]=me,t[67]=$,t[68]=W,t[69]=ae,t[70]=xe,t[71]=_e}else z=t[62],V=t[63],P=t[64],U=t[65],me=t[66],$=t[67],W=t[68],ae=t[69],xe=t[70],_e=t[71];let Te;t[73]!==z||t[74]!==me||t[75]!==$||t[76]!==W||t[77]!==ae?(Te=(0,M.jsx)(z,{"aria-label":$,className:W,checked:ae,onCheckedChange:me}),t[73]=z,t[74]=me,t[75]=$,t[76]=W,t[77]=ae,t[78]=Te):Te=t[78];let Z;t[79]!==P||t[80]!==Te||t[81]!==xe?(Z=(0,M.jsxs)("div",{className:xe,children:[P,Te]}),t[79]=P,t[80]=Te,t[81]=xe,t[82]=Z):Z=t[82];let Q;t[83]===Symbol.for("react.memo_cache_sentinel")?(Q=(0,M.jsx)("span",{children:"f"}),t[83]=Q):Q=t[83];let Y;t[84]===V?Y=t[85]:(Y=V.includes("f"),t[84]=V,t[85]=Y);let ce;t[86]===_e?ce=t[87]:(ce=Ne=>{_e("f",Ne)},t[86]=_e,t[87]=ce);let te;t[88]!==Y||t[89]!==ce?(te=(0,M.jsxs)("div",{className:"flex items-center gap-1.5",children:[Q,(0,M.jsx)(Rc,{"aria-label":"Toggle f-string",className:"w-3 h-3",checked:Y,onCheckedChange:ce})]}),t[88]=Y,t[89]=ce,t[90]=te):te=t[90];let he;t[91]===Symbol.for("react.memo_cache_sentinel")?(he=(0,M.jsx)(Tg,{content:(0,M.jsx)(F2,{}),children:(0,M.jsx)(uf,{className:"w-3 h-3"})}),t[91]=he):he=t[91];let G;t[92]!==U||t[93]!==Z||t[94]!==te?(G=(0,M.jsxs)("div",{className:U,children:[Z,te,he]}),t[92]=U,t[93]=Z,t[94]=te,t[95]=G):G=t[95],x=G}let O;t[96]===S?O=t[97]:(O=S&&(0,M.jsx)(W2,{}),t[96]=S,t[97]=O);let j;return t[98]!==x||t[99]!==d.type||t[100]!==O?(j=(0,M.jsx)(T5,{children:(0,M.jsxs)("div",{className:"flex justify-between items-center gap-4 pl-2 pt-2",children:[x,O,d.type]})}),t[98]=x,t[99]=d.type,t[100]=O,t[101]=j):j=t[101],j};var xm=new Jd;qf=sr.define(),Ir=li.define({create(){return Tr.python},update(e,t){for(let n of t.effects)if(n.is(qf))return n.value;return e},provide:e=>Rg.from(e,t=>t.type==="python"?null:n=>WD(n,xP))});function _P(){let e=BL(),t=(n,i)=>{let o=e[i%e.length];return o.isSupported(n)?o:t(n,i+1)};return[Si.of([{key:"F4",preventDefault:!0,run:n=>{let i=n.state.field(Ir),o=e.findIndex(u=>u.type===i.type),l=t(n.state.doc.toString(),o+1);return i===l?!1:(U2({view:n,nextLanguage:l,opts:{keepCodeAsIs:!1}}),!0)}}])]}function U2({view:e,nextLanguage:t,opts:n}){let i=e.state.field(Ir),o=e.state.doc.toString(),l=e.state.facet(wb),u=e.state.facet(xb),d=e.state.facet(Tp),p=e.state.facet(su),g=e.state.facet(_b),w=e.state.field(Ei),x=e.state.selection.main.head,S;if(n.keepCodeAsIs)S=o,i.type!==t.type&&(w={...t.defaultMetadata});else{let[E,T]=i.transformOut(o,w),[O,j,z]=t.transformIn(E);x+=T,x-=j,x=Pg(x,0,O.length),S=O,w=z}e.dispatch({effects:[qf.of(t),wf.of(w),xm.reconfigure(t.getExtension(p,l,u,d,g)),pf.reconfigure([]),wl.of(!0)],changes:n.keepCodeAsIs?void 0:{from:0,to:e.state.doc.length,insert:S},selection:n.keepCodeAsIs?void 0:xn.cursor(x)}),e.dispatch({effects:[pf.reconfigure([K5()])]}),t.type==="sql"&&qL(e)}pE=function(e){let{placeholderType:t,completionConfig:n,hotkeys:i,cellId:o,lspConfig:l}=e;return[_P(),xm.of(Tr.python.getExtension(o,n,i,t,l)),Ir,Ei]},gT=function(e){return K2(ci({state:e}).trim())};function K2(e){return e?Tr.markdown.isSupported(e)?Tr.markdown:Tr.sql.isSupported(e)?Tr.sql:Tr.python:Tr.python}yf=function(e,t){e.state.field(Ir).type!==t.language&&U2({view:e,nextLanguage:Tr[t.language],opts:{keepCodeAsIs:t.keepCodeAsIs??!1}})},wE=function(e,{completionConfig:t,hotkeysProvider:n,lspConfig:i}){let o=e.state.field(Ir),l=e.state.facet(Tp),u=e.state.facet(su);return u===void 0&&Se.error("Cell ID is undefined in reconfigureLanguageEffect"),l===void 0&&Se.error("Placeholder type is undefined in reconfigureLanguageEffect"),t===void 0&&Se.error("Completion config is undefined in reconfigureLanguageEffect"),xm.reconfigure(o.getExtension(u,t,n,l,i))},ci=function(e,t,n){let i=e.state.field(Ir),o=e.state.field(Ei),l=e.state.doc.toString();return t===void 0?i.transformOut(l,o)[0]:i.transformOut(l.slice(t,n),o)[0]},Bo=function(e,t){let n=e.state.field(Ir),i=K2(t);i.type!==n.type&&yf(e,{language:i.type,keepCodeAsIs:!0});let[o]=e.state.field(Ir).transformIn(t);return cf(e,o),o};function kP(e){let t=e.state.selection.main.head,n=e.state.doc.toString(),i=n.length>0&&n[t-1]===`
|
|
161
|
+
`,t}eq(t){return this.isCurrent===t.isCurrent&&this.isValid===t.isValid&&this.isFocused===t.isFocused&&this.config===t.config}};function gL(e,t){var d;let n=UC.empty;if((d=t.whenHide)!=null&&d.call(t,e))return n;let i=e.state.field(T2,!1);if(!i)return n;let{currentStatement:o,allStatements:l,isFocused:u}=i;try{let p=e.state.doc.lineAt(e.viewport.from).number,g=e.state.doc.lineAt(e.viewport.to).number;for(let w of l){if(w.lineTo<p||w.lineFrom>g)continue;let x=(o==null?void 0:o.from)===w.from&&(o==null?void 0:o.to)===w.to;if(!w.isValid&&t.showInvalid===!1)continue;let S=new hL(t,x,w.isValid,u),E=Math.max(w.lineFrom,p),T=Math.min(w.lineTo,g);for(let O=E;O<=T;O++)try{if(O<1||O>e.state.doc.lines)continue;let j=e.state.doc.line(O);n=n.update({add:[S.range(j.from)]})}catch(j){console.warn("SqlGutter: Invalid line number",O,j)}}}catch(p){console.warn("SqlGutter: Error creating markers",p)}return n}async function D2(e,t){let{state:n}=e,i=n.selection.main.head,o=await t.analyzeDocument(n),l={currentStatement:await t.getStatementAtPosition(n,i),allStatements:o,cursorPosition:i,isFocused:e.hasFocus};e.dispatch({effects:E2.of(l)})}function yL(e){return Cr.define(t=>(D2(t,e),{update(n){!n.docChanged&&!n.selectionSet&&!n.focusChanged||D2(n.view,e)}}))}function vL(e){let t=e.width||3;return At.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 bL(e){return YC({class:`cm-sql-gutter ${e.className||""}`,markers:t=>gL(t,e)})}function wL(e={}){return[T2,yL(new pi(e.parser||new Jr)),vL(e),bL(e)]}function xL(e={}){let t=[],{schema:n,enableLinting:i=!0,enableSemanticLinting:o=!0,enableGutterMarkers:l=!0,enableHover:u=!0,enableNavigation:d=!0,linterConfig:p,semanticLinterConfig:g,gutterConfig:w,hoverConfig:x,navigationConfig:S}=e;if(n!=null&&t.push(em.of(n)),i&&t.push(jA(p)),o){let E=(g==null?void 0:g.parser)??(p==null?void 0:p.parser),T=(g==null?void 0:g.structureAnalyzer)??((g==null?void 0:g.parser)==null?p==null?void 0:p.structureAnalyzer:void 0);t.push(pL({...g,parser:E,structureAnalyzer:T}))}if(l&&t.push(wL(w)),u&&(t.push(FA(x)),t.push((x==null?void 0:x.theme)??w2())),d){let E=(S==null?void 0:S.parser)??(p==null?void 0:p.parser),T=(S==null?void 0:S.structureAnalyzer)??((S==null?void 0:S.parser)==null?p==null?void 0:p.structureAnalyzer:void 0);t.push(...nL({...S,parser:E,structureAnalyzer:T}))}return t}var _L=class LT{static jsonStringifySortKeys(){return t=>typeof t!="object"||!t?String(t):JSON.stringify(t,Object.keys(t).toSorted(),2)}constructor(t,n={}){this.delegate=t,this.toKey=n.toKey??LT.jsonStringifySortKeys(),this.cache=new du(n.maxSize??128)}request(t){let n=this.toKey(t),i=this.cache.get(n);if(i!==void 0)return i;let o=this.delegate.request(t);return this.cache.set(n,o),o.catch(l=>{throw this.cache.delete(n),l})}resolve(t,n){this.delegate.resolve(t,n)}reject(t,n){this.delegate.reject(t,n)}};qS=new el("data-source-discovery-result",async e=>{await Sr().discoverDataSources({requestId:e})}),ST=new el("sql-table-preview",async(e,t)=>{await Sr().previewSQLTable({requestId:e,...t})}),GS=new el("sql-schema-list-preview",async(e,t)=>{await Sr().previewSQLSchemaList({requestId:e,...t})}),xS=new el("sql-table-list-preview",async(e,t)=>{await Sr().previewSQLTableList({requestId:e,...t})}),x0=new _L(new el("validate-sql",async(e,t)=>{await Sr().validateSQL({requestId:e,...t})}),{maxSize:3});var kL=kr();let so;so=Ne(new Map),OS=e=>{let t=(0,kL.c)(3),n=$n(so),i;return t[0]!==e||t[1]!==n?(i=n.get(e),t[0]=e,t[1]=n,t[2]=i):i=t[2],i};function hm(e){let t=Me.get(so),n=new Map(t);n.delete(e),Me.set(so,n)}function CL(){Me.set(so,new Map)}function SL({cellId:e,errorMessage:t,dialect:n}){let i=Me.get(so),o=new Map(i),l=n==="DuckDB"?EL(t):R2(t);o.set(e,l),Me.set(so,o)}function EL(e){let{errorType:t,errorMessage:n}=R2(e),i=n,o,l=n.indexOf("LINE ");return l!==-1&&(o=n.slice(Math.max(0,l)).trim(),i=n.slice(0,Math.max(0,l)).trim()),{errorType:t,errorMessage:i,codeblock:o}}function R2(e){return{errorType:e.split(":")[0].trim(),errorMessage:e.split(":").slice(1).join(":").trim()}}function I2(e){return e.field(Ei)}function TL(){return e=>{let t=I2(e.state).engine,n=ro.getCompletionSource(t);return n&&y6(n)(e)||null}}function DL(){return e=>{let t=I2(e.state).engine,n=ro.getDialect(t);return e.matchBefore(/\.\w*/)?null:k6(n,!0,(i,o)=>({label:i,type:o,info:async()=>{let l=(await RL())[i.toLocaleLowerCase()];if(!l)return null;let u=document.createElement("div");return u.innerHTML=HA.keyword({keyword:i,info:l}),u}}))(e)}}var RL=Ur(async()=>{let e=await de(()=>import("./common-keywords-DpBQRN1C.js").then(async n=>(await n.__tla,n)),[],import.meta.url),t=await de(()=>import("./duckdb-keywords-DrrKcwLz.js").then(async n=>(await n.__tla,n)),[],import.meta.url);return{...e.default.keywords,...t.default.keywords}}),IL=kr(),A2=Oc("marimo:notebook-sql-mode","default",pf);function AL(){let e=(0,IL.c)(3),[t,n]=LC(A2),i;return e[0]!==n||e[1]!==t?(i={sqlMode:t,setSQLMode:n},e[0]=n,e[1]=t,e[2]=i):i=e[2],i}function L2(){return Me.get(A2)}var LL=Cb,gm="DuckDB",P2=new Yd;function ym(){return Me.get(Ho).latestEngineSelected}cf=(Tm=class{constructor(){pe(this,"parser",new kf);pe(this,"type","sql");this.sqlModeEnabled=!0}get defaultMetadata(){return{...this.parser.defaultMetadata,engine:ym()||"__marimo_duckdb"}}get defaultCode(){let e=ym();return e&&e!=="__marimo_duckdb"?`_df = mo.sql(f"""SELECT * FROM """, engine=${e})`:this.parser.defaultCode}transformIn(e){this.parser.defaultMetadata.engine=ym()||"__marimo_duckdb";let t=this.parser.transformIn(e),n=t.metadata;return n.engine&&n.engine!=="__marimo_duckdb"&&Db(n.engine),[t.code,t.offset,n]}transformOut(e,t){let n=this.parser.transformOut(e,t);return[n.code,n.offset]}isSupported(e){return this.parser.isSupported(e)}getExtension(e,t,n,i,o){var d;let l=PL(),u=[P2.of(uS({dialect:LL})),Si.of([{key:"Tab",run:p=>u6(p)||H5(p),preventDefault:!0}]),tf({defaultKeymap:!1,activateOnTyping:!0,override:[TL(),mI,DL(),l.cteCompletionSource,l.aliasCompletionSource,l.columnCompletionSource]})];if(((d=o==null?void 0:o.diagnostics)==null?void 0:d.sql_linter)??!1){let p=Me.get(j6),g=new NL({getParserOptions:w=>({database:j2(w)??gm})});u.push(xL({schema:bm,enableLinting:!0,linterConfig:{delay:250,parser:g,perStatement:!1},enableSemanticLinting:!0,semanticLinterConfig:{parser:l.parser,structureAnalyzer:l.structureAnalyzer,severity:{unknownTable:"off",unknownColumn:"warning",ambiguousColumn:"warning"}},enableGutterMarkers:!0,gutterConfig:{backgroundColor:"#3b82f6",errorBackgroundColor:"#ef4444",hideWhenNotFocused:!0,parser:g},hoverConfig:{hoverTime:300,enableKeywords:!0,enableTables:!0,enableColumns:!0,parser:l.parser,contextAnalyzer:l.contextAnalyzer,theme:w2(p)},enableNavigation:!0,navigationConfig:{contextAnalyzer:l.contextAnalyzer,keymap:!1,parser:l.parser,structureAnalyzer:l.structureAnalyzer}}),At.updateListener.of(w=>{w.focusChanged&&g.setFocusState(w.view.hasFocus)}))}return this.sqlModeEnabled&&u.push(FL()),u}},pe(Tm,"fromQuery",e=>kf.fromQuery(e)),Tm);function PL(){let e=new Jr({getParserOptions:i=>({database:vm(i)})}),t=new OL(e),n=new ML(e);return{parser:e,contextAnalyzer:t,structureAnalyzer:n,cteCompletionSource:m2({parser:e,contextAnalyzer:t,structureAnalyzer:n}),aliasCompletionSource:bA({schema:bm,parser:e,contextAnalyzer:t}),columnCompletionSource:kA({schema:bm,parser:e,contextAnalyzer:t})}}function vm(e){return j2(e)??gm}var OL=class extends ao{constructor(t){super(t);pe(this,"analyzers",new Map);this.analysisParser=t}getContext(t,n){return this.getAnalyzer(n.state).getContext(t,n)}clearCache(){for(let t of this.analyzers.values())t.clearCache()}getAnalyzer(t){let n=vm(t),i=this.analyzers.get(n);return i||(i=new ao(this.analysisParser),this.analyzers.set(n,i)),i}},ML=class extends pi{constructor(t){super(t);pe(this,"analyzers",new Map);this.analysisParser=t}analyzeDocument(t){return this.getAnalyzer(t).analyzeDocument(t)}getStatementAtPosition(t,n){return this.getAnalyzer(t).getStatementAtPosition(t,n)}getStatementsInRange(t,n,i){return this.getAnalyzer(t).getStatementsInRange(t,n,i)}clearCache(){for(let t of this.analyzers.values())t.clearCache()}getAnalyzer(t){let n=vm(t),i=this.analyzers.get(n);return i||(i=new pi(this.analysisParser),this.analyzers.set(n,i)),i}},NL=class extends Jr{constructor(){super(...arguments);pe(this,"validationTimeout",null);pe(this,"pendingValidationResolve",null);pe(this,"VALIDATION_DELAY_MS",300);pe(this,"isFocused",!1)}setFocusState(t){this.isFocused=t}resolvePendingValidation(t){var n;(n=this.pendingValidationResolve)==null||n.call(this,t),this.pendingValidationResolve=null}async validateWithDelay(t,n,i){return this.validationTimeout&&(window.clearTimeout(this.validationTimeout),this.resolvePendingValidation([])),new Promise(o=>{this.pendingValidationResolve=o,this.validationTimeout=window.setTimeout(async()=>{var l;if(this.validationTimeout=null,!this.isFocused){this.resolvePendingValidation([]);return}try{let u=await q2(t,n,i,ia.has(n)?L2():"default");if(u.error){Se.error("Failed to validate SQL",{error:u.error}),this.resolvePendingValidation([]);return}this.resolvePendingValidation(((l=u.parse_result)==null?void 0:l.errors)??[])}catch(u){Se.error("Failed to validate SQL",{error:u}),this.resolvePendingValidation([])}},this.VALIDATION_DELAY_MS)})}async validateSql(t,n){let i=fs(n.state),o=Iu(i.engine);return this.isFocused?O2(i.engine,o)?this.validateWithDelay(t,i.engine,o??gm):super.validateSql(t,n):[]}async parse(t,n){let i=fs(n.state).engine;return O2(i,Iu(i))?{success:!0,errors:[]}:super.parse(t,n)}};function O2(e,t){return e==="__marimo_duckdb"||t==="DuckDB"}function M2(e,t){e.dispatch({effects:P2.reconfigure(uS({dialect:t}))})}function jL(e,t){M2(e,ro.getDialect(t))}function qL(e){let t=fs(e.state).engine;M2(e,ro.getDialect(t))}function fs(e){return e.field(Ei)}function bm(e){let t=fs(e.state).engine,n=ro.getCompletionSource(t);if(!(n!=null&&n.schema))return{};let i=n.schema;if(!N2(i))return i;let o=n.defaultSchema,l=o?i[o]:void 0;return l&&!Array.isArray(l)&&typeof l=="object"&&"children"in l&&N2(l.children)?{...i,...Object.fromEntries(Object.entries(l.children).filter(([u])=>!Object.hasOwn(i,u)))}:i}function N2(e){if(Array.isArray(e))return!1;if(!("self"in e)||!("children"in e))return!0;let t=e.self;return!(typeof t=="object"&&t&&!Array.isArray(t)&&"label"in t&&typeof t.label=="string")}function j2(e){let t=fs(e).engine;return Iu(t)}function Iu(e){var n;let t=(n=ro.getInternalDialect(e))==null?void 0:n.toLowerCase();if(!t||!cu(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 Se.debug("Unsupported dialect",{dialect:t}),null;default:return Zs(t),null}}var zL=300;function FL(){return Cr.define(e=>{let t,n=null,i=e.state.facet(oa);return{update(o){if(!o.docChanged)return;let l=L2();if(l==="default")return;let u=fs(o.state).engine;if(!ia.has(u))return;let d=o.state.doc.toString();t&&window.clearTimeout(t),t=window.setTimeout(async()=>{if(n!==d){if(n=d,d===""){hm(i);return}try{let p=Iu(u),g=(await q2(d,u,p,l)).validate_result;g!=null&&g.error_message?SL({cellId:i,errorMessage:g.error_message,dialect:p}):hm(i)}catch(p){Se.error("Failed to validate SQL",{error:p})}}},zL)},destroy(){t&&window.clearTimeout(t),hm(i)}}})}async function q2(e,t,n,i){let o=await x0.request({onlyParse:i==="default",engine:t,dialect:n,query:e});if(o.error)throw Error(o.error);return o}var $L=Ur(()=>new nA),VL=Ur(()=>new ff),HL=Ur(()=>new cf);Tr={get python(){return $L()},get markdown(){return VL()},get sql(){return HL()}};function BL(){return Object.values(Tr)}let z2;z2=kr(),Rc=Re.forwardRef((e,t)=>{let n=(0,z2.c)(13),i,o;n[0]===e?(i=n[1],o=n[2]):({className:i,...o}=e,n[0]=e,n[1]=i,n[2]=o);let l;n[3]===i?l=n[4]:(l=Ci("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",i),n[3]=i,n[4]=l);let u;n[5]===Symbol.for("react.memo_cache_sentinel")?(u=Ci("flex items-center justify-center text-current max-h-[14px] overflow-hidden"),n[5]=u):u=n[5];let d;n[6]===o.checked?d=n[7]:(d=(0,M.jsx)(xy,{className:u,children:o.checked==="indeterminate"?(0,M.jsx)(l0,{className:"h-4 w-4"}):(0,M.jsx)(D6,{className:"h-4 w-4"})}),n[6]=o.checked,n[7]=d);let p;return n[8]!==o||n[9]!==t||n[10]!==l||n[11]!==d?(p=(0,M.jsx)(Hf,{ref:t,className:l,...o,children:d}),n[8]=o,n[9]=t,n[10]=l,n[11]=d,n[12]=p):p=n[12],p}),Rc.displayName=Hf.displayName,BS="_";var WL=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("."));s0=function(e,t=!0){return e=e.trim(),e?(/^\d/.test(e)&&(e=`_${e}`),e=e.replaceAll(/\W/g,"_"),t?e.toLowerCase():e):"_"},vS=function(e,t){let n=new Set(t),i=e,o=u=>!n.has(u)&&!WL.has(u);if(o(e))return e;let l=1;for(;!o(i);)i=`${e}_${l}`,l++;return i},$E=function(e,t){return H0(e)?`cell-${t}`:e},H0=function(e){return e?e==="_"||e==="__":!0};var UL=kr();function KL(e){let t=(0,UL.c)(15),{minWidth:n,padding:i}=e,o=n===void 0?70:n,l=i===void 0?15:i,[u,d]=(0,Re.useState)(50),p=(0,Re.useRef)(null),g=(0,Re.useRef)(null),w;t[0]===l?w=t[1]:(w=$=>{if(g.current&&p.current){let W=g.current;W.style.fontSize=window.getComputedStyle(p.current).fontSize,W.style.fontFamily=window.getComputedStyle(p.current).fontFamily,W.textContent=$;let ae=W.offsetWidth;d(ae+l)}},t[0]=l,t[1]=w);let x=w,S;t[2]===x?S=t[3]:(S=()=>{var $;x((($=p.current)==null?void 0:$.value)??"")},t[2]=x,t[3]=S),T6(S);let E;t[4]===x?E=t[5]:(E=$=>{x($.target.value)},t[4]=x,t[5]=E);let T=`${u}px`,O=`${o}px`,j;t[6]!==T||t[7]!==O?(j={width:T,minWidth:O},t[6]=T,t[7]=O,t[8]=j):j=t[8];let z;t[9]!==E||t[10]!==j?(z={ref:p,type:"text",onChange:E,style:j},t[9]=E,t[10]=j,t[11]=z):z=t[11];let V=z,P;t[12]===Symbol.for("react.memo_cache_sentinel")?(P={ref:g,style:{visibility:"hidden",position:"absolute",whiteSpace:"pre"}},t[12]=P):P=t[12];let U=P,me;return t[13]===V?me=t[14]:(me={inputProps:V,spanProps:U},t[13]=V,t[14]=me),me}var QL=kr();function GL({currentQuotePrefix:e,checked:t,prefix:n}){let i=e;return t?e===""?i=n:e!=="rf"&&n!==e&&(i="rf"):e===n?i="":e==="rf"&&(i=n==="r"?"f":"r"),i}let F2;F2=()=>{let e=(0,QL.c)(2),t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,M.jsxs)("section",{className:"flex flex-col gap-0.5",children:[(0,M.jsxs)("header",{className:"flex items-center gap-1",children:[(0,M.jsx)("code",{className:"text-xs px-1 py-0.5 bg-(--slate-2) rounded",children:"r"}),(0,M.jsx)("span",{className:"font-semibold",children:"Raw String"})]}),(0,M.jsx)("p",{className:"text-sm text-muted-foreground",children:"Write LaTeX without escaping special characters"}),(0,M.jsx)("pre",{className:"text-xs bg-(--slate-2) p-2 rounded",children:"\\alpha \\beta"})]}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for("react.memo_cache_sentinel")?(n=(0,M.jsxs)("div",{className:"flex flex-col gap-3.5",children:[t,(0,M.jsxs)("section",{className:"flex flex-col gap-0.5",children:[(0,M.jsxs)("header",{className:"flex items-center gap-1",children:[(0,M.jsx)("code",{className:"text-xs px-1 py-0.5 bg-(--slate-2) rounded",children:"f"}),(0,M.jsx)("span",{className:"font-semibold",children:"Format String"})]}),(0,M.jsx)("p",{className:"text-sm text-muted-foreground",children:"Interpolate Python values"}),(0,M.jsxs)("pre",{className:"text-xs bg-(--slate-2) p-2 rounded",children:["Hello ","{name}","! \u{1F601}"]})]})]}),e[1]=n):n=e[1],n},cy="data-cell-id",RS=function(e){return{[cy]:e}},h0="data-for-cell-id",of=function(e){return{[h0]:e}};var XL="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",JL="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",YL="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==",ZL="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",eP="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",tP=""+new URL("iceberg-COKYXo-A.png",import.meta.url).href,nP="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",rP="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",$2=""+new URL("postgresql-q8VEBKGg.svg",import.meta.url).href,iP="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",aP="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",oP="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",sP="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",lP="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",cP="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",uP=""+new URL("trino-DFsJbQoT.svg",import.meta.url).href,dP=kr(),fP={sqlite:sP,duckdb:ZL,motherduck:nP,postgres:$2,postgresql:$2,mysql:rP,snowflake:aP,databricks:JL,clickhouse:XL,timeplus:cP,bigquery:eP,trino:uP,iceberg:tP,datafusion:YL,pyspark:oP,redshift:iP,supabase:lP};Bg=e=>{let t=(0,dP.c)(11),{name:n,className:i}=e,o=fP[n.toLowerCase()];if(!o){let d;t[0]===i?d=t[1]:(d=Ci("mt-0.5",i),t[0]=i,t[1]=d);let p;return t[2]===d?p=t[3]:(p=(0,M.jsx)(sl,{className:d}),t[2]=d,t[3]=p),p}let l;t[4]!==i||t[5]!==o?(l=Ci("invert-[.5] dark:invert-[.7]",i,o.endsWith(".png")&&"brightness-100 dark:brightness-100 invert-0 dark:invert-0"),t[4]=i,t[5]=o,t[6]=l):l=t[6];let u;return t[7]!==n||t[8]!==l||t[9]!==o?(u=(0,M.jsx)("img",{src:o,alt:n,className:l}),t[7]=n,t[8]=l,t[9]=o,t[10]=u):u=t[10],u};var wm=kr();const pP=e=>{let t=(0,wm.c)(34),{selectedEngine:n,onChange:i,cellId:o}=e,l=$n(Lc),u=[],d=[];for(let[Y,ce]of l.entries())ia.has(Y)?u.push(ce):d.push(ce);let p=f6(),g=n&&!l.has(n),w;t[0]!==l||t[1]!==i||t[2]!==p?(w=Y=>{if(Y===V2){window.open(H2,"_blank");return}let ce=l.get(Y);ce&&(p(),i(ce.name),Db(ce.name))},t[0]=l,t[1]=i,t[2]=p,t[3]=w):w=t[3];let x=w,S=vP,E=E5,T;t[4]===o?T=t[5]:(T=of(o),t[4]=o,t[5]=T);let O;t[6]===Symbol.for("react.memo_cache_sentinel")?(O=(0,M.jsx)(x5,{placeholder:"Select an engine"}),t[6]=O):O=t[6];let j;t[7]===T?j=t[8]:(j=(0,M.jsx)(hP,{...T,children:O}),t[7]=T,t[8]=j);let z=k5,V;t[9]===o?V=t[10]:(V=of(o),t[9]=o,t[10]=V);let P=C5,U;t[11]===Symbol.for("react.memo_cache_sentinel")?(U=(0,M.jsx)(w5,{children:"Database connections"}),t[11]=U):U=t[11];let me;t[12]!==g||t[13]!==n?(me=g&&(0,M.jsx)(Eg,{value:n,children:(0,M.jsxs)("div",{className:"flex items-center gap-1 opacity-50",children:[(0,M.jsx)(y0,{className:"h-3 w-3"}),(0,M.jsx)("span",{className:"truncate",children:Pb(n)})]})},n),t[12]=g,t[13]=n,t[14]=me):me=t[14];let $=S(d),W=d.length>0&&(0,M.jsx)(HC,{}),ae=S(u),xe;t[15]===Symbol.for("react.memo_cache_sentinel")?(xe=(0,M.jsx)(HC,{}),t[15]=xe):xe=t[15];let _e;t[16]===Symbol.for("react.memo_cache_sentinel")?(_e=(0,M.jsx)(Eg,{className:"text-muted-foreground",value:V2,children:(0,M.jsxs)("a",{className:"flex items-center gap-1",href:H2,target:"_blank",rel:"noreferrer",children:[(0,M.jsx)(A6,{className:"h-3 w-3"}),(0,M.jsx)("span",{children:"How to add a database connection"})]})}),t[16]=_e):_e=t[16];let Te;t[17]!==P||t[18]!==W||t[19]!==ae||t[20]!==U||t[21]!==me||t[22]!==$?(Te=(0,M.jsxs)(P,{children:[U,me,$,W,ae,xe,_e]}),t[17]=P,t[18]=W,t[19]=ae,t[20]=U,t[21]=me,t[22]=$,t[23]=Te):Te=t[23];let Z;t[24]!==z||t[25]!==Te||t[26]!==V?(Z=(0,M.jsx)(z,{...V,children:Te}),t[24]=z,t[25]=Te,t[26]=V,t[27]=Z):Z=t[27];let Q;return t[28]!==E||t[29]!==x||t[30]!==n||t[31]!==Z||t[32]!==j?(Q=(0,M.jsx)("div",{className:"flex flex-row gap-1 items-center",children:(0,M.jsxs)(E,{value:n,onValueChange:x,children:[j,Z]})}),t[28]=E,t[29]=x,t[30]=n,t[31]=Z,t[32]=j,t[33]=Q):Q=t[33],Q};var V2="__help__",H2="http://docs.marimo.io/guides/working_with_data/sql/#connecting-to-a-custom-database";const mP=()=>{let e=(0,wm.c)(16),{sqlMode:t,setSQLMode:n}=AL(),i;e[0]!==n||e[1]!==t?(i=()=>{let E=t==="validate"?"default":"validate";E==="default"&&CL(),n(E)},e[0]=n,e[1]=t,e[2]=i):i=e[2];let o=i,l=bP,u=wP,d;e[3]===t?d=e[4]:(d=u(t),e[3]=t,e[4]=d);let p;e[5]===t?p=e[6]:(p=l(t),e[5]=t,e[6]=p);let g=t==="validate"?"Validate":"Default",w;e[7]===g?w=e[8]:(w=(0,M.jsx)("span",{className:"ml-1",children:g}),e[7]=g,e[8]=w);let x;e[9]!==o||e[10]!==p||e[11]!==w?(x=(0,M.jsxs)(BC,{variant:"ghost",size:"sm",onClick:o,className:"h-5 px-1.5 text-xs border-border shadow-none hover:bg-accent",children:[p,w]}),e[9]=o,e[10]=p,e[11]=w,e[12]=x):x=e[12];let S;return e[13]!==d||e[14]!==x?(S=(0,M.jsx)("div",{className:"flex flex-row gap-1 items-center",children:(0,M.jsx)(Tg,{delayDuration:300,content:d,children:x})}),e[13]=d,e[14]=x,e[15]=S):S=e[15],S};var hP=e=>{let t=(0,wm.c)(6),n,i;t[0]===e?(n=t[1],i=t[2]):({children:n,...i}=e,t[0]=e,t[1]=n,t[2]=i);let o;return t[3]!==n||t[4]!==i?(o=(0,M.jsx)(S5,{className:"text-xs border-border shadow-none! ring-0! h-5 px-1.5 hover:bg-accent transition-colors",...i,children:n}),t[3]=n,t[4]=i,t[5]=o):o=t[5],o};function gP(e){return e.source!=="iceberg"}function yP(e){return(0,M.jsx)(Eg,{value:e.name,children:(0,M.jsxs)("div",{className:"flex items-center gap-1",children:[(0,M.jsx)(Bg,{className:"h-3 w-3",name:e.dialect}),(0,M.jsx)("span",{className:"truncate ml-0.5",children:Pb(e.display_name)})]})},e.name)}function vP(e){return e=e.filter(gP),e.map(yP)}function bP(e){return e==="validate"?(0,M.jsx)(Rp,{className:"h-3 w-3"}):(0,M.jsx)(Ng,{className:"h-3 w-3"})}function wP(e){return e==="validate"?(0,M.jsxs)("div",{className:"text-xs",children:[(0,M.jsxs)("div",{className:"font-semibold mb-1 flex flex-row items-center gap-1",children:[(0,M.jsx)(Rp,{className:"h-3 w-3"}),"Validate Mode"]}),(0,M.jsx)("p",{children:"Queries are validated as you write them"})]}):(0,M.jsxs)("div",{className:"text-xs",children:[(0,M.jsxs)("div",{className:"font-semibold mb-1 flex flex-row items-center gap-1",children:[(0,M.jsx)(Ng,{className:"h-3 w-3"}),"Default Mode"]}),(0,M.jsx)("p",{children:"Standard editing"})]})}var B2=kr(),W2=()=>{let e=(0,B2.c)(1),t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,M.jsx)("div",{className:"h-4 border-r border-border"}),e[0]=t):t=e[0],t};const xP=e=>{let t=(0,B2.c)(102),{view:n}=e,i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i={minWidth:50},t[0]=i):i=t[0];let{spanProps:o,inputProps:l}=KL(i),u;t[1]===n.state?u=t[2]:(u=n.state.field(Ir),t[1]=n.state,t[2]=u);let d=u,p;t[3]===n.state?p=t[4]:(p=n.state.facet(oa),t[3]=n.state,t[4]=p);let g=p,w;t[5]===Symbol.for("react.memo_cache_sentinel")?(w=(0,M.jsx)("div",{}),t[5]=w):w=t[5];let x=w,S=!1,E;t[6]===n?E=t[7]:(E=z=>{n.dispatch({effects:_f.of(z),changes:{from:0,to:n.state.doc.length,insert:n.state.doc.toString()}})},t[6]=n,t[7]=E);let T=E;if(d instanceof cf){let z;t[8]===n.state?z=t[9]:(z=n.state.field(Ei),t[8]=n.state,t[9]=z);let V=z;S=!0;let P;t[10]===T?P=t[11]:(P=gt=>{let bt=s0(gt.currentTarget.value,!1);gt.currentTarget.value=bt,T({dataframeName:bt})},t[10]=T,t[11]=P);let U=P,me;t[12]!==T||t[13]!==n?(me=gt=>{T({engine:gt}),jL(n,gt)},t[12]=T,t[13]=n,t[14]=me):me=t[14];let $=me,W;t[15]===Symbol.for("react.memo_cache_sentinel")?(W=(0,M.jsx)("span",{className:"select-none",children:"Output variable: "}),t[15]=W):W=t[15];let ae;t[16]===l?ae=t[17]:(ae=gt=>{var bt;(bt=l.onChange)==null||bt.call(l,gt)},t[16]=l,t[17]=ae);let xe;t[18]===U?xe=t[19]:(xe=gt=>{gt.key==="Enter"&>.shiftKey&&U(gt)},t[18]=U,t[19]=xe);let _e;t[20]!==l||t[21]!==V.dataframeName||t[22]!==U||t[23]!==ae||t[24]!==xe?(_e=(0,M.jsx)("input",{...l,defaultValue:V.dataframeName,onChange:ae,onBlur:U,onKeyDown:xe,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]=l,t[21]=V.dataframeName,t[22]=U,t[23]=ae,t[24]=xe,t[25]=_e):_e=t[25];let Te;t[26]===o?Te=t[27]:(Te=(0,M.jsx)("span",{...o}),t[26]=o,t[27]=Te);let Z;t[28]!==_e||t[29]!==Te?(Z=(0,M.jsxs)("label",{className:"flex gap-2 items-center",children:[W,_e,Te]}),t[28]=_e,t[29]=Te,t[30]=Z):Z=t[30];let Q;t[31]!==g||t[32]!==V.engine||t[33]!==$?(Q=(0,M.jsx)(pP,{selectedEngine:V.engine,onChange:$,cellId:g}),t[31]=g,t[32]=V.engine,t[33]=$,t[34]=Q):Q=t[34];let Y;t[35]===V.engine?Y=t[36]:(Y=V.engine==="__marimo_duckdb"&&(0,M.jsx)(mP,{}),t[35]=V.engine,t[36]=Y);let ce;t[37]!==V.engine||t[38]!==n?(ce=async()=>{await VD(n,V.engine)},t[37]=V.engine,t[38]=n,t[39]=ce):ce=t[39];let te;t[40]===Symbol.for("react.memo_cache_sentinel")?(te=(0,M.jsx)(Vg,{className:"h-3 w-3"}),t[40]=te):te=t[40];let he;t[41]===ce?he=t[42]:(he=(0,M.jsx)(Tg,{content:"Format SQL",children:(0,M.jsx)(BC,{variant:"text",size:"icon",onClick:ce,children:te})}),t[41]=ce,t[42]=he);let G;t[43]===Symbol.for("react.memo_cache_sentinel")?(G=(0,M.jsx)(W2,{}),t[43]=G):G=t[43];let je;t[44]===T?je=t[45]:(je=gt=>{T({showOutput:!gt.target.checked})},t[44]=T,t[45]=je);let qe=!V.showOutput,Qe;t[46]!==je||t[47]!==qe?(Qe=(0,M.jsx)("input",{type:"checkbox",onChange:je,checked:qe}),t[46]=je,t[47]=qe,t[48]=Qe):Qe=t[48];let He;t[49]===Symbol.for("react.memo_cache_sentinel")?(He=(0,M.jsx)("span",{className:"select-none",children:"Hide output"}),t[49]=He):He=t[49];let Fe;t[50]===Qe?Fe=t[51]:(Fe=(0,M.jsxs)("label",{className:"flex items-center gap-2",children:[Qe,He]}),t[50]=Qe,t[51]=Fe);let Oe;t[52]!==Y||t[53]!==he||t[54]!==Fe?(Oe=(0,M.jsxs)("div",{className:"flex items-center gap-2 ml-auto",children:[Y,he,G,Fe]}),t[52]=Y,t[53]=he,t[54]=Fe,t[55]=Oe):Oe=t[55];let Be;t[56]!==Z||t[57]!==Q||t[58]!==Oe?(Be=(0,M.jsxs)("div",{className:"flex flex-1 gap-2 items-center",children:[Z,Q,Oe]}),t[56]=Z,t[57]=Q,t[58]=Oe,t[59]=Be):Be=t[59],x=Be}if(d instanceof ff){S=!0;let z,V,P,U,me,$,W,ae,xe,_e;if(t[60]!==T||t[61]!==n.state){let{quotePrefix:je}=n.state.field(Ei);V=je,V===void 0&&(V="r",T({quotePrefix:V})),_e=(qe,Qe)=>{typeof Qe=="boolean"&&T({quotePrefix:GL({currentQuotePrefix:V,checked:Qe,prefix:qe})})},U="flex flex-row w-full justify-end gap-1.5 items-center",xe="flex items-center gap-1.5",t[72]===Symbol.for("react.memo_cache_sentinel")?(P=(0,M.jsx)("span",{children:"r"}),t[72]=P):P=t[72],z=Rc,$="Toggle raw string",W="w-3 h-3",ae=V.includes("r"),me=qe=>{_e("r",qe)},t[60]=T,t[61]=n.state,t[62]=z,t[63]=V,t[64]=P,t[65]=U,t[66]=me,t[67]=$,t[68]=W,t[69]=ae,t[70]=xe,t[71]=_e}else z=t[62],V=t[63],P=t[64],U=t[65],me=t[66],$=t[67],W=t[68],ae=t[69],xe=t[70],_e=t[71];let Te;t[73]!==z||t[74]!==me||t[75]!==$||t[76]!==W||t[77]!==ae?(Te=(0,M.jsx)(z,{"aria-label":$,className:W,checked:ae,onCheckedChange:me}),t[73]=z,t[74]=me,t[75]=$,t[76]=W,t[77]=ae,t[78]=Te):Te=t[78];let Z;t[79]!==P||t[80]!==Te||t[81]!==xe?(Z=(0,M.jsxs)("div",{className:xe,children:[P,Te]}),t[79]=P,t[80]=Te,t[81]=xe,t[82]=Z):Z=t[82];let Q;t[83]===Symbol.for("react.memo_cache_sentinel")?(Q=(0,M.jsx)("span",{children:"f"}),t[83]=Q):Q=t[83];let Y;t[84]===V?Y=t[85]:(Y=V.includes("f"),t[84]=V,t[85]=Y);let ce;t[86]===_e?ce=t[87]:(ce=je=>{_e("f",je)},t[86]=_e,t[87]=ce);let te;t[88]!==Y||t[89]!==ce?(te=(0,M.jsxs)("div",{className:"flex items-center gap-1.5",children:[Q,(0,M.jsx)(Rc,{"aria-label":"Toggle f-string",className:"w-3 h-3",checked:Y,onCheckedChange:ce})]}),t[88]=Y,t[89]=ce,t[90]=te):te=t[90];let he;t[91]===Symbol.for("react.memo_cache_sentinel")?(he=(0,M.jsx)(Tg,{content:(0,M.jsx)(F2,{}),children:(0,M.jsx)(df,{className:"w-3 h-3"})}),t[91]=he):he=t[91];let G;t[92]!==U||t[93]!==Z||t[94]!==te?(G=(0,M.jsxs)("div",{className:U,children:[Z,te,he]}),t[92]=U,t[93]=Z,t[94]=te,t[95]=G):G=t[95],x=G}let O;t[96]===S?O=t[97]:(O=S&&(0,M.jsx)(W2,{}),t[96]=S,t[97]=O);let j;return t[98]!==x||t[99]!==d.type||t[100]!==O?(j=(0,M.jsx)(T5,{children:(0,M.jsxs)("div",{className:"flex justify-between items-center gap-4 pl-2 pt-2",children:[x,O,d.type]})}),t[98]=x,t[99]=d.type,t[100]=O,t[101]=j):j=t[101],j};var xm=new Yd;qf=sr.define(),Ir=li.define({create(){return Tr.python},update(e,t){for(let n of t.effects)if(n.is(qf))return n.value;return e},provide:e=>Rg.from(e,t=>t.type==="python"?null:n=>WD(n,xP))});function _P(){let e=BL(),t=(n,i)=>{let o=e[i%e.length];return o.isSupported(n)?o:t(n,i+1)};return[Si.of([{key:"F4",preventDefault:!0,run:n=>{let i=n.state.field(Ir),o=e.findIndex(u=>u.type===i.type),l=t(n.state.doc.toString(),o+1);return i===l?!1:(U2({view:n,nextLanguage:l,opts:{keepCodeAsIs:!1}}),!0)}}])]}function U2({view:e,nextLanguage:t,opts:n}){let i=e.state.field(Ir),o=e.state.doc.toString(),l=e.state.facet(wb),u=e.state.facet(xb),d=e.state.facet(Tp),p=e.state.facet(lu),g=e.state.facet(_b),w=e.state.field(Ei),x=e.state.selection.main.head,S;if(n.keepCodeAsIs)S=o,i.type!==t.type&&(w={...t.defaultMetadata});else{let[E,T]=i.transformOut(o,w),[O,j,z]=t.transformIn(E);x+=T,x-=j,x=Pg(x,0,O.length),S=O,w=z}e.dispatch({effects:[qf.of(t),wf.of(w),xm.reconfigure(t.getExtension(p,l,u,d,g)),mf.reconfigure([]),wl.of(!0)],changes:n.keepCodeAsIs?void 0:{from:0,to:e.state.doc.length,insert:S},selection:n.keepCodeAsIs?void 0:xn.cursor(x)}),e.dispatch({effects:[mf.reconfigure([K5()])]}),t.type==="sql"&&qL(e)}pE=function(e){let{placeholderType:t,completionConfig:n,hotkeys:i,cellId:o,lspConfig:l}=e;return[_P(),xm.of(Tr.python.getExtension(o,n,i,t,l)),Ir,Ei]},gT=function(e){return K2(ci({state:e}).trim())};function K2(e){return e?Tr.markdown.isSupported(e)?Tr.markdown:Tr.sql.isSupported(e)?Tr.sql:Tr.python:Tr.python}vf=function(e,t){e.state.field(Ir).type!==t.language&&U2({view:e,nextLanguage:Tr[t.language],opts:{keepCodeAsIs:t.keepCodeAsIs??!1}})},xE=function(e,{completionConfig:t,hotkeysProvider:n,lspConfig:i}){let o=e.state.field(Ir),l=e.state.facet(Tp),u=e.state.facet(lu);return u===void 0&&Se.error("Cell ID is undefined in reconfigureLanguageEffect"),l===void 0&&Se.error("Placeholder type is undefined in reconfigureLanguageEffect"),t===void 0&&Se.error("Completion config is undefined in reconfigureLanguageEffect"),xm.reconfigure(o.getExtension(u,t,n,l,i))},ci=function(e,t,n){let i=e.state.field(Ir),o=e.state.field(Ei),l=e.state.doc.toString();return t===void 0?i.transformOut(l,o)[0]:i.transformOut(l.slice(t,n),o)[0]},Bo=function(e,t){let n=e.state.field(Ir),i=K2(t);i.type!==n.type&&vf(e,{language:i.type,keepCodeAsIs:!0});let[o]=e.state.field(Ir).transformIn(t);return uf(e,o),o};function kP(e){let t=e.state.selection.main.head,n=e.state.doc.toString(),i=n.length>0&&n[t-1]===`
|
|
162
162
|
`,o=n.length>0&&n[t]===`
|
|
163
|
-
`,l=i?t-1:t,u=o?t+1:t;return{beforeCursorCode:ci(e,0,l),afterCursorCode:ci(e,u)}}if(typeof document<"u"){let e="data-temp-href-target";qg.addHook("beforeSanitizeAttributes",t=>{t.tagName==="A"&&(t.hasAttribute("target")||t.setAttribute("target","_self"),t.hasAttribute("target")&&t.setAttribute(e,t.getAttribute("target")||""))}),qg.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"))})}G0=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 qg.sanitize(e,t)};var CP=["marimo-carousel","marimo-tabs","marimo-accordion","marimo-sidebar"],SP="h1, h2, h3, h4, h5, h6";function EP(e){if(typeof DOMParser>"u")return null;let t=[],n=new DOMParser().parseFromString(e,"text/html").querySelectorAll(SP);for(let i of Array.from(n)){let o=i.textContent;if(CP.some(p=>i.closest(p))||!o)continue;let l=Number.parseInt(i.tagName[1],10),u=i.innerHTML,d={name:o,level:l,by:N0(i)};u!==o&&(d.html=G0(u)),t.push(d)}return{items:t}}function TP(e){if(!e.includes('"'))return`"${e}"`;if(!e.includes("'"))return`'${e}'`;let t=e.split('"'),n=[];for(let[i,o]of t.entries())o&&n.push(`"${o}"`),i<t.length-1&&n.push(`'"'`);return`concat(${n.join(", ")})`}N0=function(e){let t=e.id;if(t)return{id:t};let n=e.textContent??"";return{path:`//${e.tagName}[contains(., ${TP(n)})]`}};function DP(e){return{items:e.filter(Boolean).flatMap(t=>t.items)}}Z0=function(e){if(e==null||e.mimetype!=="text/html"&&e.mimetype!=="text/markdown"||e.data==null)return null;try{return Vn(typeof e.data=="string","expected string"),EP(e.data)}catch{return Se.error("Failed to parse outline"),null}},
|
|
164
|
-
`: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 n=
|
|
165
|
-
`)}},pe(
|
|
166
|
-
`||o==="\r"||o===" "||o==="\b"||o==="\v"){if(i>t){let l=e.slice(t,i),u=this.filterControlChars(l);u.length>0&&this.buffer.writeString(u)}this.buffer.control(o),t=i+1}else if(o<" "){if(i>t){let l=e.slice(t,i);l.length>0&&this.buffer.writeString(l)}t=i+1}}if(t<n){let i=e.slice(t),o=this.filterControlChars(i);o.length>0&&this.buffer.writeString(o)}}filterControlChars(e){let t=!1;for(let i of e)if(i<" "){t=!0;break}if(!t)return e;let n="";for(let i of e)i>=" "&&(n+=i);return n}},
|
|
163
|
+
`,l=i?t-1:t,u=o?t+1:t;return{beforeCursorCode:ci(e,0,l),afterCursorCode:ci(e,u)}}if(typeof document<"u"){let e="data-temp-href-target";qg.addHook("beforeSanitizeAttributes",t=>{t.tagName==="A"&&(t.hasAttribute("target")||t.setAttribute("target","_self"),t.hasAttribute("target")&&t.setAttribute(e,t.getAttribute("target")||""))}),qg.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"))})}G0=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 qg.sanitize(e,t)};var CP=["marimo-carousel","marimo-tabs","marimo-accordion","marimo-sidebar"],SP="h1, h2, h3, h4, h5, h6";function EP(e){if(typeof DOMParser>"u")return null;let t=[],n=new DOMParser().parseFromString(e,"text/html").querySelectorAll(SP);for(let i of Array.from(n)){let o=i.textContent;if(CP.some(p=>i.closest(p))||!o)continue;let l=Number.parseInt(i.tagName[1],10),u=i.innerHTML,d={name:o,level:l,by:N0(i)};u!==o&&(d.html=G0(u)),t.push(d)}return{items:t}}function TP(e){if(!e.includes('"'))return`"${e}"`;if(!e.includes("'"))return`'${e}'`;let t=e.split('"'),n=[];for(let[i,o]of t.entries())o&&n.push(`"${o}"`),i<t.length-1&&n.push(`'"'`);return`concat(${n.join(", ")})`}N0=function(e){let t=e.id;if(t)return{id:t};let n=e.textContent??"";return{path:`//${e.tagName}[contains(., ${TP(n)})]`}};function DP(e){return{items:e.filter(Boolean).flatMap(t=>t.items)}}Z0=function(e){if(e==null||e.mimetype!=="text/html"&&e.mimetype!=="text/markdown"||e.data==null)return null;try{return Vn(typeof e.data=="string","expected string"),EP(e.data)}catch{return Se.error("Failed to parse outline"),null}},EE=function(e){return e==null?!1:e.items.some(t=>t.level<=3)};function Q2(e,t){let n=u=>u.items.length===0?7:Math.min(...u.items.map(d=>d.level)),i=t[e];if(i==null||i.items.length===0)return Se.warn("Failed to find a starting outline"),null;let o=n(i),l=e+1;for(;l<t.length;){let u=t[l];if(u&&n(u)<=o)return[e,l-1];l++}return[e,t.length-1]}pT=Oc("marimo:rtc:username","",pf),Q0=Ur(()=>tl("rtc_v2")),L0=function(e){return e!==Uo};var G2=(fo=class{constructor(){pe(this,"lines",[""]);pe(this,"cursor",{row:0,col:0})}ensureLine(t){for(;this.lines.length<=t;)this.lines.push("")}moveCursor(t,n){let i=this.cursor.row;this.cursor.row=Math.max(0,this.cursor.row+t),this.cursor.col=Math.max(0,this.cursor.col+n),this.ensureLine(this.cursor.row),t<0&&this.cursor.row<i&&this.lines.splice(this.cursor.row+1)}setCursor(t,n){this.cursor.row=Math.max(0,t),this.cursor.col=Math.max(0,n),this.ensureLine(this.cursor.row)}writeChar(t){this.ensureLine(this.cursor.row);let n=this.lines[this.cursor.row].padEnd(this.cursor.col," ");this.lines[this.cursor.row]=n.slice(0,this.cursor.col)+t+n.slice(this.cursor.col+1),this.cursor.col++}writeString(t){if(t.length===0)return;this.ensureLine(this.cursor.row);let n=this.lines[this.cursor.row].padEnd(this.cursor.col," ");this.lines[this.cursor.row]=n.slice(0,this.cursor.col)+t+n.slice(this.cursor.col+t.length),this.cursor.col+=t.length}control(t){switch(t){case`
|
|
164
|
+
`: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 n=fo.ESCAPE_REGEX.exec(t);if(!n){this.writeString(t);return}let i=n[1].split(";").map(o=>o===""?1:Number.parseInt(o,10));switch(n[2]){case"A":this.moveCursor(-i[0],0);break;case"B":this.moveCursor(i[0],0);break;case"C":this.moveCursor(0,i[0]);break;case"D":this.moveCursor(0,-i[0]);break;case"H":this.setCursor(i[0]-1||0,i[1]-1||0);break;case"J":i[0]===2&&(this.lines=[""],this.setCursor(0,0));break;case"K":switch(this.ensureLine(this.cursor.row),i[0]){case 0:this.lines[this.cursor.row]=this.lines[this.cursor.row].slice(0,this.cursor.col);break;case 1:{let o=this.lines[this.cursor.row].length;this.lines[this.cursor.row]=" ".repeat(this.cursor.col)+this.lines[this.cursor.row].slice(this.cursor.col,o);break}case 2:this.lines[this.cursor.row]="";break}break;default:this.writeString(t);break}}render(){return this.lines.join(`
|
|
165
|
+
`)}},pe(fo,"ESCAPE_REGEX",/\u001B\[([0-9;]*)([A-DJKH])/u),fo),RP=class{constructor(){pe(this,"ESC_REGEX",/\u001B(?:\[[0-9;]*[A-Za-z]|\([0-9A-Za-z])/gu)}parse(e){let t=[],n=0;for(let i of e.matchAll(this.ESC_REGEX)){let o=i.index??0;o>n&&t.push({type:"text",value:e.slice(n,o)}),t.push({type:"escape",value:i[0]}),n=o+i[0].length}return n<e.length&&t.push({type:"text",value:e.slice(n)}),t}},X2=class{constructor(){pe(this,"parser",new RP);pe(this,"buffer",new G2)}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 n=t[0].value;if(!this.hasControlChars(n)){this.buffer.writeString(n);return}}for(let n of t)n.type==="text"?this.processText(n.value):this.buffer.handleEscape(n.value)}reset(){this.buffer=new G2}render(){return this.buffer.render()}hasControlChars(e){for(let t of e)if(t<" ")return!0;return!1}processText(e){let t=0,n=e.length;for(let i=0;i<n;i++){let o=e[i];if(o===`
|
|
166
|
+
`||o==="\r"||o===" "||o==="\b"||o==="\v"){if(i>t){let l=e.slice(t,i),u=this.filterControlChars(l);u.length>0&&this.buffer.writeString(u)}this.buffer.control(o),t=i+1}else if(o<" "){if(i>t){let l=e.slice(t,i);l.length>0&&this.buffer.writeString(l)}t=i+1}}if(t<n){let i=e.slice(t),o=this.filterControlChars(i);o.length>0&&this.buffer.writeString(o)}}filterControlChars(e){let t=!1;for(let i of e)if(i<" "){t=!0;break}if(!t)return e;let n="";for(let i of e)i>=" "&&(n+=i);return n}},Au=class py{constructor(t,n,i,o){pe(this,"ansiReducer",new X2);this.mimetype=t,this.channel=n,this.timestamp=i,this.ansiReducer=o,this._data=this.ansiReducer.render()}get data(){return this._data}static create(t){let n=new X2;return n.append(t.data),new py(t.mimetype,t.channel,t.timestamp,n)}appendData(t){return this.ansiReducer.append(t),new py(this.mimetype,this.channel,this.timestamp,this.ansiReducer)}toJSON(){return{mimetype:this.mimetype,channel:this.channel,timestamp:this.timestamp,data:this.data}}};function IP(e,t=5e3){let n=[...e];if(n.length<2)return Y2(n.map(LP),t);let i=n[n.length-1],o=n[n.length-2];return AP(i,o)&&(J2(i),J2(o),n[n.length-2]=PP(o,i),n.pop()),Y2(n,t)}function AP(e,t){let n=e.mimetype==="text/plain"&&t.mimetype==="text/plain";if(!n)return!1;let i=e.channel===t.channel,o=e.channel!=="stdin";return n&&i&&o}function LP(e){return e instanceof Au?e:typeof e.data=="string"?Au.create(e):e}function PP(e,t){return e instanceof Au?e.appendData(t.data):Au.create(e).appendData(t.data)}function J2(e){Vn(typeof e.data=="string","expected string output")}function Y2(e,t){let n=0,i;for(i=e.length-1;i>=0&&n<t;i--){let d=e[i];d.mimetype==="text/plain"?(Vn(typeof d.data=="string","expected string"),n+=d.data.split(`
|
|
167
167
|
`).length):n++}if(n<t)return e;let o=i+1,l={channel:"stderr",mimetype:"text/html",data:`<pre>Streaming output truncated to last ${t} lines.
|
|
168
168
|
</pre>`,timestamp:-1},u=e[o];if(u==null)return[l,...e.slice(o+1)];if(u.mimetype==="text/plain"){Vn(typeof u.data=="string","expected string");let d=u.data.split(`
|
|
169
169
|
`),p=t-(n-d.length);return[l,{...u,data:d.slice(-p).join(`
|
|
170
|
-
`)},...e.slice(o+1)]}return[l,...e.slice(o+1)]}function OP(e,t){let n={...e};switch(t.status){case"queued":n.interrupted=!1,n.errored=!1,n.runElapsedTimeMs=null,n.debuggerActive=!1;break;case"running":n.interrupted=!1,e.stopped&&(n.output=null),n.status==="queued"&&(n.consoleOutputs=[]),n.stopped=!1,n.runStartTimestamp=t.timestamp,n.lastRunStartTimestamp=t.timestamp;break;case"idle":e.runStartTimestamp&&(n.runElapsedTimeMs=z0.fromSeconds((t.timestamp??0)-e.runStartTimestamp).toMilliseconds(),n.runStartTimestamp=null,n.staleInputs=!1),!e.lastRunStartTimestamp&&t.timestamp&&(n.lastRunStartTimestamp=t.timestamp),n.debuggerActive=!1;break;case null:break;case"disabled-transitively":break;case void 0:break;default:Zs(t.status)}n.output=t.output??n.output,n.staleInputs=t.stale_inputs??n.staleInputs,n.status=t.status??n.status,t.serialization!==void 0&&(n.serialization=t.serialization);let i=!1;t.output!=null&&t.output.mimetype==="application/vnd.marimo+error"&&((n.status==="queued"||n.status==="running")&&(n.status="idle"),Vn(Array.isArray(t.output.data),"Expected error output data to be an array"),t.output.data.some(d=>d.type==="interruption")?(n.interrupted=!0,i=!0):t.output.data.some(d=>d.type.includes("ancestor"))?n.stopped=!0:n.errored=!0);let o=e.consoleOutputs;(i||t.status==="idle")&&(n.debuggerActive=!1,o=o.map(d=>d.channel==="stdin"?{...d,response:d.response??""}:d));let l=t.console;l!=null&&(o=IP(Array.isArray(l)?l:[...o,l])),n.consoleOutputs=o,n.outline=Z0(n.output);let u=[t.console].flat().filter(Boolean).filter(d=>d.channel==="pdb");return u.length>0&&u.some(d=>d.data==="start")&&(n.debuggerActive=!0),n}function MP(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}Y0=function(e){return e==="running"||e==="queued"},lT=function(e,t){let{status:n,output:i,runStartTimestamp:o,interrupted:l,staleInputs:u}=e;if(l)return!1;if(t)return!0;let d=Y0(n),p=n==="running"&&i!==null&&o!==null&&(i.timestamp??0)>o;return d&&!p?!0:u};function so(e,t){if(!e){Se.warn("getCell: cellId is undefined");return}let n=t.cellData[e];if(!n){Se.warn(`getCell: cell ${e} not found in state`);return}return n}function Z2(e,t){let n=t.cellIds.inOrderIds,i=n.indexOf(e);if(i>0)return{after:n[i-1]};if(i===0&&n.length>1)return{before:n[1]}}function ex(e){let t=new Map,n=e.cellIds.getColumns();for(let[i,o]of n.entries())for(let l of o.inOrderIds)t.set(l,i);return t}function ps(e,t){let n=new Set(e.cellIds.inOrderIds),i=[];for(let o of t.cellIds.inOrderIds)if(!n.has(o)){let l=so(o,t);l&&i.push({type:"create-cell",cellId:l.id,code:l.code,name:l.name,config:l.config,...Z2(l.id,t)})}return i}function NP(e,t){let n=new Set(t.cellIds.inOrderIds),i=[];for(let o of e.cellIds.inOrderIds)n.has(o)||i.push({type:"delete-cell",cellId:o});return i}function Au(e,t){let n=ex(e),i=ex(t),o=[];for(let[l,u]of i)if(n.get(l)!==u){let d=so(l,t);o.push({type:"set-config",cellId:l,column:u,disabled:(d==null?void 0:d.config.disabled)??!1,hideCode:(d==null?void 0:d.config.hide_code)??!1})}return o.push({type:"reorder-cells",cellIds:t.cellIds.inOrderIds}),o}function jP(e,t,n){switch(n.type){case"createNewCell":return ps(e,t);case"deleteCell":return[{type:"delete-cell",cellId:n.payload.cellId}];case"moveCell":case"sendToTop":case"sendToBottom":{let{cellId:i}=n.payload;return[{type:"move-cell",cellId:i,...Z2(i,t)}]}case"dropCellOverCell":case"dropCellOverColumn":case"moveCellToIndex":case"moveCellsRelativeTo":return Au(e,t);case"updateCellCode":{let i=so(n.payload.cellId,t);return i?[{type:"set-code",cellId:i.id,code:i.code}]:[]}case"updateCellName":{let i=so(n.payload.cellId,t);return i?[{type:"set-name",cellId:i.id,name:i.name}]:[]}case"updateCellConfig":{let{cellId:i}=n.payload,o=so(i,t);return o?[{type:"set-config",cellId:i,column:o.config.column??null,disabled:o.config.disabled??!1,hideCode:o.config.hide_code??!1}]:[]}case"dropOverNewColumn":case"moveColumn":case"addColumnBreakpoint":case"deleteColumn":case"mergeAllColumns":case"compactColumns":return Au(e,t);case"addColumn":return[...ps(e,t),...Au(e,t)];case"undoDeleteCell":{let i=ps(e,t),o=Au(e,t);return i.length===0?o:o.length>1?[...i,...o]:i}case"splitCell":{let{cellId:i}=n.payload,o=so(i,t);return o?[{type:"set-code",cellId:i,code:o.code},...ps(e,t)]:[]}case"undoSplitCell":{let{cellId:i}=n.payload,o=so(i,t);return o?[{type:"set-code",cellId:i,code:o.code},...NP(e,t)]:[]}case"moveToNextCell":return ps(e,t);case"addSetupCellIfDoesntExist":return ps(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":case"addLogs":return[];case"foldAll":case"unfoldAll":case"collapseCell":case"expandCell":case"collapseAllCells":case"expandAllCells":return[];default:f6(n)}}function qP(e){let t=new Set,n=new Set;for(let i of e)i.type==="create-cell"?t.add(i.cellId):i.type==="delete-cell"&&n.add(i.cellId);return t.intersection(n)}function zP(e,t){var i,o,l;let n=[];for(let u of e)switch(u.type){case"create-cell":{let d="__end__",p=!1;u.after?(d=u.after,p=!1):u.before&&(d=u.before,p=!0),n.push({type:"createNewCell",payload:{cellId:d,before:p,code:u.code,newCellId:u.cellId,autoFocus:!1,hideCode:((i=u.config)==null?void 0:i.hide_code)??!1}}),u.name&&n.push({type:"updateCellName",payload:{cellId:u.cellId,name:u.name}}),(((o=u.config)==null?void 0:o.disabled)!=null||((l=u.config)==null?void 0:l.column)!=null)&&n.push({type:"updateCellConfig",payload:{cellId:u.cellId,config:{...u.config.disabled!=null&&{disabled:u.config.disabled},...u.config.column!=null&&{column:u.config.column}}}});break}case"delete-cell":n.push({type:"deleteCell",payload:{cellId:u.cellId}});break;case"move-cell":{let d=[...t()],p=u.cellId,g=d.indexOf(p);if(g<0)break;if(d.splice(g,1),u.after){let w=d.indexOf(u.after);w>=0?d.splice(w+1,0,p):d.push(p)}else if(u.before){let w=d.indexOf(u.before);w>=0?d.splice(w,0,p):d.unshift(p)}else d.push(p);n.push({type:"setCellIds",payload:{cellIds:d}});break}case"reorder-cells":n.push({type:"setCellIds",payload:{cellIds:u.cellIds}});break;case"set-code":n.push({type:"setCellCodes",payload:{ids:[u.cellId],codes:[u.code],codeIsStale:!0}});break;case"set-name":n.push({type:"updateCellName",payload:{cellId:u.cellId,name:u.name}});break;case"set-config":n.push({type:"updateCellConfig",payload:{cellId:u.cellId,config:{column:u.column,disabled:u.disabled,hide_code:u.hideCode}}});break}return n}var tx=new Set(["set-code","set-name","set-config"]),FP=new Set(["set-code","set-name","set-config","move-cell"]);function $P(e){let t=new Set;for(let o of e)o.type==="delete-cell"&&t.add(o.cellId);let n=e.filter(o=>!(FP.has(o.type)&&"cellId"in o&&t.has(o.cellId))),i=new Map;return n.forEach((o,l)=>{tx.has(o.type)&&"cellId"in o&&i.set(`${o.type}:${o.cellId}`,l)}),n.filter((o,l)=>tx.has(o.type)&&"cellId"in o?i.get(`${o.type}:${o.cellId}`)===l:!0)}var _m=[],VP=Sg(()=>{let e=$P(_m);_m=[],e.length!==0&&Sr().sendDocumentTransaction({changes:e})},400);function HP(e){return"cellId"in e&&e.cellId==="__scratch__"}function BP(e){Me.get(s5)||HP(e)||(_m.push(e),VP())}function WP(e,t,n){for(let i of jP(e,t,n))BP(i)}gE=function(e,t,n){var d;let i=qP(e),o=[...e.filter(p=>p.type!=="set-config"),...e.filter(p=>p.type==="set-config")],l=!1,u=null;for(let p of o)if(!(i.size>0&&"cellId"in p&&i.has(p.cellId))){p.type==="set-config"&&(l=!0),p.type==="create-cell"&&((d=p.config)==null?void 0:d.column)!=null&&(l=!0),p.type==="reorder-cells"&&(u=p.cellIds);for(let g of zP([p],n))t[g.type](g.payload)}l&&t.rebuildCellColumns({cellIds:u??n()})};function UP(e,t){return R6(e*1e3,t==null?void 0:t.in)}var km=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},$t;(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"})($t||($t={})),F0=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(n=>{n.forEach(i=>{this.palette_256.push(i)})});let e=[0,95,135,175,215,255];for(let n=0;n<6;++n)for(let i=0;i<6;++i)for(let o=0;o<6;++o){let l={rgb:[e[n],e[i],e[o]],class_name:"truecolor"};this.palette_256.push(l)}let t=8;for(let n=0;n<24;++n,t+=10){let i={rgb:[t,t,t],class_name:"truecolor"};this.palette_256.push(i)}}escape_txt_for_html(e){return this._escape_html?e.replace(/[&<>"']/gm,t=>{if(t==="&")return"&";if(t==="<")return"<";if(t===">")return">";if(t==='"')return""";if(t==="'")return"'"}):e}append_buffer(e){this._buffer+=e}get_next_packet(){var e={kind:$t.EOS,text:"",url:""},t=this._buffer.length;if(t==0)return e;var n=this._buffer.indexOf("\x1B");if(n==-1)return e.kind=$t.Text,e.text=this._buffer,this._buffer="",e;if(n>0)return e.kind=$t.Text,e.text=this._buffer.slice(0,n),this._buffer=this._buffer.slice(n),e;if(n==0){if(t<3)return e.kind=$t.Incomplete,e;var i=this._buffer.charAt(1);if(i!="["&&i!="]"&&i!="(")return e.kind=$t.ESC,e.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),e;if(i=="["){this._csi_regex||(this._csi_regex=nx(QP||(QP=km([`
|
|
170
|
+
`)},...e.slice(o+1)]}return[l,...e.slice(o+1)]}function OP(e,t){let n={...e};switch(t.status){case"queued":n.interrupted=!1,n.errored=!1,n.runElapsedTimeMs=null,n.debuggerActive=!1;break;case"running":n.interrupted=!1,e.stopped&&(n.output=null),n.status==="queued"&&(n.consoleOutputs=[]),n.stopped=!1,n.runStartTimestamp=t.timestamp,n.lastRunStartTimestamp=t.timestamp;break;case"idle":e.runStartTimestamp&&(n.runElapsedTimeMs=z0.fromSeconds((t.timestamp??0)-e.runStartTimestamp).toMilliseconds(),n.runStartTimestamp=null,n.staleInputs=!1),!e.lastRunStartTimestamp&&t.timestamp&&(n.lastRunStartTimestamp=t.timestamp),n.debuggerActive=!1;break;case null:break;case"disabled-transitively":break;case void 0:break;default:Zs(t.status)}n.output=t.output??n.output,n.staleInputs=t.stale_inputs??n.staleInputs,n.status=t.status??n.status,t.serialization!==void 0&&(n.serialization=t.serialization);let i=!1;t.output!=null&&t.output.mimetype==="application/vnd.marimo+error"&&((n.status==="queued"||n.status==="running")&&(n.status="idle"),Vn(Array.isArray(t.output.data),"Expected error output data to be an array"),t.output.data.some(d=>d.type==="interruption")?(n.interrupted=!0,i=!0):t.output.data.some(d=>d.type.includes("ancestor"))?n.stopped=!0:n.errored=!0);let o=e.consoleOutputs;(i||t.status==="idle")&&(n.debuggerActive=!1,o=o.map(d=>d.channel==="stdin"?{...d,response:d.response??""}:d));let l=t.console;l!=null&&(o=IP(Array.isArray(l)?l:[...o,l])),n.consoleOutputs=o,n.outline=Z0(n.output);let u=[t.console].flat().filter(Boolean).filter(d=>d.channel==="pdb");return u.length>0&&u.some(d=>d.data==="start")&&(n.debuggerActive=!0),n}function MP(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}Y0=function(e){return e==="running"||e==="queued"},sT=function(e,t){let{status:n,output:i,runStartTimestamp:o,interrupted:l,staleInputs:u}=e;if(l)return!1;if(t)return!0;let d=Y0(n),p=n==="running"&&i!==null&&o!==null&&(i.timestamp??0)>o;return d&&!p?!0:u};function lo(e,t){if(!e){Se.warn("getCell: cellId is undefined");return}let n=t.cellData[e];if(!n){Se.warn(`getCell: cell ${e} not found in state`);return}return n}function Z2(e,t){let n=t.cellIds.inOrderIds,i=n.indexOf(e);if(i>0)return{after:n[i-1]};if(i===0&&n.length>1)return{before:n[1]}}function ex(e){let t=new Map,n=e.cellIds.getColumns();for(let[i,o]of n.entries())for(let l of o.inOrderIds)t.set(l,i);return t}function ps(e,t){let n=new Set(e.cellIds.inOrderIds),i=[];for(let o of t.cellIds.inOrderIds)if(!n.has(o)){let l=lo(o,t);l&&i.push({type:"create-cell",cellId:l.id,code:l.code,name:l.name,config:l.config,...Z2(l.id,t)})}return i}function NP(e,t){let n=new Set(t.cellIds.inOrderIds),i=[];for(let o of e.cellIds.inOrderIds)n.has(o)||i.push({type:"delete-cell",cellId:o});return i}function Lu(e,t){let n=ex(e),i=ex(t),o=[];for(let[l,u]of i)if(n.get(l)!==u){let d=lo(l,t);o.push({type:"set-config",cellId:l,column:u,disabled:(d==null?void 0:d.config.disabled)??!1,hideCode:(d==null?void 0:d.config.hide_code)??!1})}return o.push({type:"reorder-cells",cellIds:t.cellIds.inOrderIds}),o}function jP(e,t,n){switch(n.type){case"createNewCell":return ps(e,t);case"deleteCell":return[{type:"delete-cell",cellId:n.payload.cellId}];case"moveCell":case"sendToTop":case"sendToBottom":{let{cellId:i}=n.payload;return[{type:"move-cell",cellId:i,...Z2(i,t)}]}case"dropCellOverCell":case"dropCellOverColumn":case"moveCellToIndex":case"moveCellsRelativeTo":return Lu(e,t);case"updateCellCode":{let i=lo(n.payload.cellId,t);return i?[{type:"set-code",cellId:i.id,code:i.code}]:[]}case"updateCellName":{let i=lo(n.payload.cellId,t);return i?[{type:"set-name",cellId:i.id,name:i.name}]:[]}case"updateCellConfig":{let{cellId:i}=n.payload,o=lo(i,t);return o?[{type:"set-config",cellId:i,column:o.config.column??null,disabled:o.config.disabled??!1,hideCode:o.config.hide_code??!1}]:[]}case"dropOverNewColumn":case"moveColumn":case"addColumnBreakpoint":case"deleteColumn":case"mergeAllColumns":case"compactColumns":return Lu(e,t);case"addColumn":return[...ps(e,t),...Lu(e,t)];case"undoDeleteCell":{let i=ps(e,t),o=Lu(e,t);return i.length===0?o:o.length>1?[...i,...o]:i}case"splitCell":{let{cellId:i}=n.payload,o=lo(i,t);return o?[{type:"set-code",cellId:i,code:o.code},...ps(e,t)]:[]}case"undoSplitCell":{let{cellId:i}=n.payload,o=lo(i,t);return o?[{type:"set-code",cellId:i,code:o.code},...NP(e,t)]:[]}case"moveToNextCell":return ps(e,t);case"addSetupCellIfDoesntExist":return ps(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":case"addLogs":return[];case"foldAll":case"unfoldAll":case"collapseCell":case"expandCell":case"collapseAllCells":case"expandAllCells":return[];default:p6(n)}}function qP(e){let t=new Set,n=new Set;for(let i of e)i.type==="create-cell"?t.add(i.cellId):i.type==="delete-cell"&&n.add(i.cellId);return t.intersection(n)}function zP(e,t){var i,o,l;let n=[];for(let u of e)switch(u.type){case"create-cell":{let d="__end__",p=!1;u.after?(d=u.after,p=!1):u.before&&(d=u.before,p=!0),n.push({type:"createNewCell",payload:{cellId:d,before:p,code:u.code,newCellId:u.cellId,autoFocus:!1,hideCode:((i=u.config)==null?void 0:i.hide_code)??!1}}),u.name&&n.push({type:"updateCellName",payload:{cellId:u.cellId,name:u.name}}),(((o=u.config)==null?void 0:o.disabled)!=null||((l=u.config)==null?void 0:l.column)!=null)&&n.push({type:"updateCellConfig",payload:{cellId:u.cellId,config:{...u.config.disabled!=null&&{disabled:u.config.disabled},...u.config.column!=null&&{column:u.config.column}}}});break}case"delete-cell":n.push({type:"deleteCell",payload:{cellId:u.cellId}});break;case"move-cell":{let d=[...t()],p=u.cellId,g=d.indexOf(p);if(g<0)break;if(d.splice(g,1),u.after){let w=d.indexOf(u.after);w>=0?d.splice(w+1,0,p):d.push(p)}else if(u.before){let w=d.indexOf(u.before);w>=0?d.splice(w,0,p):d.unshift(p)}else d.push(p);n.push({type:"setCellIds",payload:{cellIds:d}});break}case"reorder-cells":n.push({type:"setCellIds",payload:{cellIds:u.cellIds}});break;case"set-code":n.push({type:"setCellCodes",payload:{ids:[u.cellId],codes:[u.code],codeIsStale:!0}});break;case"set-name":n.push({type:"updateCellName",payload:{cellId:u.cellId,name:u.name}});break;case"set-config":n.push({type:"updateCellConfig",payload:{cellId:u.cellId,config:{column:u.column,disabled:u.disabled,hide_code:u.hideCode}}});break}return n}var tx=new Set(["set-code","set-name","set-config"]),FP=new Set(["set-code","set-name","set-config","move-cell"]);function $P(e){let t=new Set;for(let o of e)o.type==="delete-cell"&&t.add(o.cellId);let n=e.filter(o=>!(FP.has(o.type)&&"cellId"in o&&t.has(o.cellId))),i=new Map;return n.forEach((o,l)=>{tx.has(o.type)&&"cellId"in o&&i.set(`${o.type}:${o.cellId}`,l)}),n.filter((o,l)=>tx.has(o.type)&&"cellId"in o?i.get(`${o.type}:${o.cellId}`)===l:!0)}var _m=[],VP=Sg(()=>{let e=$P(_m);_m=[],e.length!==0&&Sr().sendDocumentTransaction({changes:e})},400);function HP(e){return"cellId"in e&&e.cellId==="__scratch__"}function BP(e){Me.get(s5)||HP(e)||(_m.push(e),VP())}function WP(e,t,n){for(let i of jP(e,t,n))BP(i)}yE=function(e,t,n){var d;let i=qP(e),o=[...e.filter(p=>p.type!=="set-config"),...e.filter(p=>p.type==="set-config")],l=!1,u=null;for(let p of o)if(!(i.size>0&&"cellId"in p&&i.has(p.cellId))){p.type==="set-config"&&(l=!0),p.type==="create-cell"&&((d=p.config)==null?void 0:d.column)!=null&&(l=!0),p.type==="reorder-cells"&&(u=p.cellIds);for(let g of zP([p],n))t[g.type](g.payload)}l&&t.rebuildCellColumns({cellIds:u??n()})};function UP(e,t){return I6(e*1e3,t==null?void 0:t.in)}var km=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},$t;(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"})($t||($t={})),F0=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(n=>{n.forEach(i=>{this.palette_256.push(i)})});let e=[0,95,135,175,215,255];for(let n=0;n<6;++n)for(let i=0;i<6;++i)for(let o=0;o<6;++o){let l={rgb:[e[n],e[i],e[o]],class_name:"truecolor"};this.palette_256.push(l)}let t=8;for(let n=0;n<24;++n,t+=10){let i={rgb:[t,t,t],class_name:"truecolor"};this.palette_256.push(i)}}escape_txt_for_html(e){return this._escape_html?e.replace(/[&<>"']/gm,t=>{if(t==="&")return"&";if(t==="<")return"<";if(t===">")return">";if(t==='"')return""";if(t==="'")return"'"}):e}append_buffer(e){this._buffer+=e}get_next_packet(){var e={kind:$t.EOS,text:"",url:""},t=this._buffer.length;if(t==0)return e;var n=this._buffer.indexOf("\x1B");if(n==-1)return e.kind=$t.Text,e.text=this._buffer,this._buffer="",e;if(n>0)return e.kind=$t.Text,e.text=this._buffer.slice(0,n),this._buffer=this._buffer.slice(n),e;if(n==0){if(t<3)return e.kind=$t.Incomplete,e;var i=this._buffer.charAt(1);if(i!="["&&i!="]"&&i!="(")return e.kind=$t.ESC,e.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),e;if(i=="["){this._csi_regex||(this._csi_regex=nx(QP||(QP=km([`
|
|
171
171
|
^ # beginning of line
|
|
172
172
|
#
|
|
173
173
|
# First attempt
|
|
@@ -264,6 +264,6 @@ mark line col
|
|
|
264
264
|
| # alternate
|
|
265
265
|
(?:\\x07) # BEL (what xterm did)
|
|
266
266
|
)
|
|
267
|
-
`]))));let l=this._buffer.match(this._osc_regex);if(l===null)return e.kind=$t.ESC,e.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),e;e.kind=$t.OSCURL,e.url=l[1],e.text=l[2];var o=l[0].length;return this._buffer=this._buffer.slice(o),e}else if(i=="(")return e.kind=$t.Unknown,this._buffer=this._buffer.slice(3),e}}ansi_to_html(e){this.append_buffer(e);for(var t=[];;){var n=this.get_next_packet();if(n.kind==$t.EOS||n.kind==$t.Incomplete)break;n.kind==$t.ESC||n.kind==$t.Unknown||(n.kind==$t.Text?t.push(this.transform_to_html(this.with_state(n))):n.kind==$t.SGR?this.process_ansi(n):n.kind==$t.OSCURL&&t.push(this.process_hyperlink(n)))}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 n=t.shift(),i=parseInt(n,10);if(isNaN(i)||i===0)this.fg=null,this.bg=null,this.bold=!1,this.faint=!1,this.italic=!1,this.underline=!1;else if(i===1)this.bold=!0;else if(i===2)this.faint=!0;else if(i===3)this.italic=!0;else if(i===4)this.underline=!0;else if(i===21)this.bold=!1;else if(i===22)this.faint=!1,this.bold=!1;else if(i===23)this.italic=!1;else if(i===24)this.underline=!1;else if(i===39)this.fg=null;else if(i===49)this.bg=null;else if(i>=30&&i<38)this.fg=this.ansi_colors[0][i-30];else if(i>=40&&i<48)this.bg=this.ansi_colors[0][i-40];else if(i>=90&&i<98)this.fg=this.ansi_colors[1][i-90];else if(i>=100&&i<108)this.bg=this.ansi_colors[1][i-100];else if((i===38||i===48)&&t.length>0){let o=i===38,l=t.shift();if(l==="5"&&t.length>0){let u=parseInt(t.shift(),10);u>=0&&u<=255&&(o?this.fg=this.palette_256[u]:this.bg=this.palette_256[u])}if(l==="2"&&t.length>2){let u=parseInt(t.shift(),10),d=parseInt(t.shift(),10),p=parseInt(t.shift(),10);if(u>=0&&u<=255&&d>=0&&d<=255&&p>=0&&p<=255){let g={rgb:[u,d,p],class_name:"truecolor"};o?this.fg=g:this.bg=g}}}}}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 n=[],i=[],o=e.fg,l=e.bg;e.bold&&n.push(this._boldStyle),e.faint&&n.push(this._faintStyle),e.italic&&n.push(this._italicStyle),e.underline&&n.push(this._underlineStyle),this._use_classes?(o&&(o.class_name==="truecolor"?n.push(`color:rgb(${o.rgb.join(",")})`):i.push(`${o.class_name}-fg`)),l&&(l.class_name==="truecolor"?n.push(`background-color:rgb(${l.rgb.join(",")})`):i.push(`${l.class_name}-bg`))):(o&&n.push(`color:rgb(${o.rgb.join(",")})`),l&&n.push(`background-color:rgb(${l.rgb})`));let u="",d="";return i.length&&(u=` class="${i.join(" ")}"`),n.length&&(d=` style="${n.join(";")}"`),`<span${d}${u}>${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 nx(e,...t){let n=e.raw[0].replace(/^\s+|\s+\n|\s*#[\s\S]*?\n|\n/gm,"");return new RegExp(n)}function KP(e,...t){let n=e.raw[0].replace(/^\s+|\s+\n|\s*#[\s\S]*?\n|\n/gm,"");return new RegExp(n,"g")}var QP,GP,XP,JP=new F0;
|
|
267
|
+
`]))));let l=this._buffer.match(this._osc_regex);if(l===null)return e.kind=$t.ESC,e.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),e;e.kind=$t.OSCURL,e.url=l[1],e.text=l[2];var o=l[0].length;return this._buffer=this._buffer.slice(o),e}else if(i=="(")return e.kind=$t.Unknown,this._buffer=this._buffer.slice(3),e}}ansi_to_html(e){this.append_buffer(e);for(var t=[];;){var n=this.get_next_packet();if(n.kind==$t.EOS||n.kind==$t.Incomplete)break;n.kind==$t.ESC||n.kind==$t.Unknown||(n.kind==$t.Text?t.push(this.transform_to_html(this.with_state(n))):n.kind==$t.SGR?this.process_ansi(n):n.kind==$t.OSCURL&&t.push(this.process_hyperlink(n)))}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 n=t.shift(),i=parseInt(n,10);if(isNaN(i)||i===0)this.fg=null,this.bg=null,this.bold=!1,this.faint=!1,this.italic=!1,this.underline=!1;else if(i===1)this.bold=!0;else if(i===2)this.faint=!0;else if(i===3)this.italic=!0;else if(i===4)this.underline=!0;else if(i===21)this.bold=!1;else if(i===22)this.faint=!1,this.bold=!1;else if(i===23)this.italic=!1;else if(i===24)this.underline=!1;else if(i===39)this.fg=null;else if(i===49)this.bg=null;else if(i>=30&&i<38)this.fg=this.ansi_colors[0][i-30];else if(i>=40&&i<48)this.bg=this.ansi_colors[0][i-40];else if(i>=90&&i<98)this.fg=this.ansi_colors[1][i-90];else if(i>=100&&i<108)this.bg=this.ansi_colors[1][i-100];else if((i===38||i===48)&&t.length>0){let o=i===38,l=t.shift();if(l==="5"&&t.length>0){let u=parseInt(t.shift(),10);u>=0&&u<=255&&(o?this.fg=this.palette_256[u]:this.bg=this.palette_256[u])}if(l==="2"&&t.length>2){let u=parseInt(t.shift(),10),d=parseInt(t.shift(),10),p=parseInt(t.shift(),10);if(u>=0&&u<=255&&d>=0&&d<=255&&p>=0&&p<=255){let g={rgb:[u,d,p],class_name:"truecolor"};o?this.fg=g:this.bg=g}}}}}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 n=[],i=[],o=e.fg,l=e.bg;e.bold&&n.push(this._boldStyle),e.faint&&n.push(this._faintStyle),e.italic&&n.push(this._italicStyle),e.underline&&n.push(this._underlineStyle),this._use_classes?(o&&(o.class_name==="truecolor"?n.push(`color:rgb(${o.rgb.join(",")})`):i.push(`${o.class_name}-fg`)),l&&(l.class_name==="truecolor"?n.push(`background-color:rgb(${l.rgb.join(",")})`):i.push(`${l.class_name}-bg`))):(o&&n.push(`color:rgb(${o.rgb.join(",")})`),l&&n.push(`background-color:rgb(${l.rgb})`));let u="",d="";return i.length&&(u=` class="${i.join(" ")}"`),n.length&&(d=` style="${n.join(";")}"`),`<span${d}${u}>${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 nx(e,...t){let n=e.raw[0].replace(/^\s+|\s+\n|\s*#[\s\S]*?\n|\n/gm,"");return new RegExp(n)}function KP(e,...t){let n=e.raw[0].replace(/^\s+|\s+\n|\s*#[\s\S]*?\n|\n/gm,"");return new RegExp(n,"g")}var QP,GP,XP,JP=new F0;Nf=function(e){try{let t=document.createElement("div");return t.innerHTML=e,(t.textContent||t.innerText||"").split(`
|
|
268
268
|
`).map(n=>n.trimEnd()).join(`
|
|
269
|
-
`)}catch(t){return Se.error("Error parsing HTML content:",t),e}},QE=function(e){if(!e)return"";try{return Of(JP.ansi_to_html(e))}catch(t){return Se.error("Error converting ANSI to plain text:",t),e}},iy=je(null);let lo;lo=kr(),KS=n3,M0=Re.forwardRef((e,t)=>{let n=(0,lo.c)(9),i,o;n[0]===e?(i=n[1],o=n[2]):({className:i,...o}=e,n[0]=e,n[1]=i,n[2]=o);let l;n[3]===i?l=n[4]:(l=Ci("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",i),n[3]=i,n[4]=l);let u;return n[5]!==o||n[6]!==t||n[7]!==l?(u=(0,M.jsx)(zy,{ref:t,className:l,...o}),n[5]=o,n[6]=t,n[7]=l,n[8]=u):u=n[8],u}),M0.displayName=zy.displayName;var rx={default:"bg-background border",danger:"group destructive text-error border-destructive bg-(--red-1) shadow-md-solid shadow-error"},YP=d5("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:rx},defaultVariants:{variant:"default"}});function ZP(e){return typeof e=="string"&&e in rx}S0=Re.forwardRef((e,t)=>{let n=(0,lo.c)(11),i,o,l;n[0]===e?(i=n[1],o=n[2],l=n[3]):({className:i,variant:l,...o}=e,n[0]=e,n[1]=i,n[2]=o,n[3]=l);let u=ZP(l)?l:"default",d;n[4]!==i||n[5]!==u?(d=Ci(YP({variant:u}),"print:hidden",i),n[4]=i,n[5]=u,n[6]=d):d=n[6];let p;return n[7]!==o||n[8]!==t||n[9]!==d?(p=(0,M.jsx)(Fy,{ref:t,className:d,...o}),n[7]=o,n[8]=t,n[9]=d,n[10]=p):p=n[10],p}),S0.displayName=Fy.displayName;var ix=Re.forwardRef((e,t)=>{let n=(0,lo.c)(9),i,o;n[0]===e?(i=n[1],o=n[2]):({className:i,...o}=e,n[0]=e,n[1]=i,n[2]=o);let l;n[3]===i?l=n[4]:(l=Ci("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",i),n[3]=i,n[4]=l);let u;return n[5]!==o||n[6]!==t||n[7]!==l?(u=(0,M.jsx)(Hy,{ref:t,className:l,...o}),n[5]=o,n[6]=t,n[7]=l,n[8]=u):u=n[8],u});ix.displayName=Hy.displayName,C0=Re.forwardRef((e,t)=>{let n=(0,lo.c)(10),i,o;n[0]===e?(i=n[1],o=n[2]):({className:i,...o}=e,n[0]=e,n[1]=i,n[2]=o);let l;n[3]===i?l=n[4]:(l=Ci("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",i),n[3]=i,n[4]=l);let u;n[5]===Symbol.for("react.memo_cache_sentinel")?(u=(0,M.jsx)(D6,{className:"h-4 w-4"}),n[5]=u):u=n[5];let d;return n[6]!==o||n[7]!==t||n[8]!==l?(d=(0,M.jsx)(By,{ref:t,className:l,"toast-close":"",...o,children:u}),n[6]=o,n[7]=t,n[8]=l,n[9]=d):d=n[9],d}),C0.displayName=By.displayName,zg=Re.forwardRef((e,t)=>{let n=(0,lo.c)(9),i,o;n[0]===e?(i=n[1],o=n[2]):({className:i,...o}=e,n[0]=e,n[1]=i,n[2]=o);let l;n[3]===i?l=n[4]:(l=Ci("text-sm font-semibold",i),n[3]=i,n[4]=l);let u;return n[5]!==o||n[6]!==t||n[7]!==l?(u=(0,M.jsx)($y,{ref:t,className:l,...o}),n[5]=o,n[6]=t,n[7]=l,n[8]=u):u=n[8],u}),zg.displayName=$y.displayName,T0=Re.forwardRef((e,t)=>{let n=(0,lo.c)(13),i,o,l;n[0]===e?(i=n[1],o=n[2],l=n[3]):({className:i,onPointerDown:o,...l}=e,n[0]=e,n[1]=i,n[2]=o,n[3]=l);let u;n[4]===i?u=n[5]:(u=Ci("max-h-48 overflow-auto text-sm opacity-90 whitespace-pre-wrap wrap-break-word select-text cursor-text",i),n[4]=i,n[5]=u);let d;n[6]===o?d=n[7]:(d=g=>{g.stopPropagation(),o==null||o(g)},n[6]=o,n[7]=d);let p;return n[8]!==l||n[9]!==t||n[10]!==u||n[11]!==d?(p=(0,M.jsx)(Vy,{ref:t,className:u,onPointerDown:d,...l}),n[8]=l,n[9]=t,n[10]=u,n[11]=d,n[12]=p):p=n[12],p}),T0.displayName=Vy.displayName,e0=function(e){return e.type==="cell"?e.cellId:`lsp:${e.name}`};var ax=!1;function eO(e){var i;let t=[],n=[e.console].filter(Boolean).flat();for(let o of n){let l=o.mimetype==="text/plain",u=o.mimetype==="text/html"||o.mimetype==="application/vnd.marimo+traceback";if(l||u){let d=o.channel==="stderr"||o.channel==="marimo-error";switch(o.channel){case"stdout":case"stderr":case"marimo-error":{let p=p6.asString(o.data),g=u?Of(p):p;t.push({timestamp:o.timestamp||Date.now(),level:d?"stderr":"stdout",message:g,source:{type:"cell",cellId:e.cell_id}});break}default:break}}}if(t.forEach(ox.log),n.length===0&&Sc((i=e.output)==null?void 0:i.mimetype)&&Array.isArray(e.output.data)){e.output.data.forEach(u=>{ox.log({level:"stderr",source:{type:"cell",cellId:e.cell_id},timestamp:e.timestamp??0,message:JSON.stringify(u)})});let o=e.output.data.filter(u=>"type"in u&&u.type==="exception"||u.type==="internal"),l=Me.get(o5)==="read";if(o.length>0&&!ax&&l){ax=!0;let u=o.find(d=>d.traceback);Cc(u?{title:"An internal error occurred",description:u.msg||"Click 'View' to see traceback",variant:"danger",action:Re.createElement(ix,{altText:"View traceback",onClick:()=>{Me.set(iy,{traceback:u.traceback,errorMessage:u.msg||"An internal error occurred"})}},"View")}:{title:"An internal error occurred",description:"See console for details.",variant:"danger"})}}return t}var ox={log:e=>{let t=e.level==="stdout"?"gray":e.level==="stderr"?"red":"orange",n=e.level.toUpperCase();console.log(`%c[${n}]`,`color:${t}; padding:2px 0; border-radius:2px; font-weight:bold`,`[${ey(e.timestamp)}]`,`(${e0(e.source)}) ${e.message}`)}};ey=function(e){try{return UP(e).toLocaleTimeString(void 0,{hour12:!0,hour:"numeric",minute:"numeric",second:"numeric"})}catch{return""}},iE=function(e,t){let n=Cf(t);n?n.focus():Se.warn(`[CellFocusManager] focusCellEditor: element not found: ${t}`)},tE=function(e){let t=document.getElementById(lr.create(e));t?Cm(t):Se.warn(`[CellFocusManager] focusCell: element not found: ${e}`)},jS=function(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})},Ug=function(){return document.activeElement instanceof HTMLElement&&document.activeElement.classList.contains("marimo-cell")};function Cm(e){try{e.focus()}catch{Se.warn("[CellFocusManager] element may not be focusable",e)}}Xg=function(e,t){let{retries:n,delay:i,initialDelay:o=0}=t,l=0,u=()=>{if(l<n){try{if(e())return}catch(d){Se.error(`Error executing function on attempt ${l+1}, retrying`,{error:d})}l++,setTimeout(u,i)}};o>0?setTimeout(u,o):u()};function tO(){let e=globalThis.scheduler;if(typeof(e==null?void 0:e.postTask)=="function")return t=>{e.postTask(t,{priority:"user-visible"}).catch(n=>{setTimeout(()=>{throw n})})};if(typeof MessageChannel=="function"){let t=[],n=new MessageChannel;return n.port1.onmessage=()=>{var i;(i=t.shift())==null||i()},i=>{t.push(i),n.port2.postMessage(null)}}return t=>{setTimeout(t,0)}}const nO=tO();function rO(e=nO){let t=new Map,n=new Set,i=!1;function o(){i||t.size===0||(i=!0,e(u))}function l(){for(let d of n){if(t.has(d))return d;n.delete(d)}return t.keys().next().value}function u(){i=!1;try{let d=l();if(d!==void 0){let p=t.get(d);t.delete(d),n.delete(d),p==null||p()}}finally{o()}}return{request(d,p){t.set(d,p),o()},promote(d){let p=t.get(d);p&&(t.delete(d),n.delete(d),p())},prioritize(d){t.has(d)&&n.add(d)},deprioritize(d){n.delete(d)},cancel(d){t.delete(d),n.delete(d)}}}b0=rO();function Rl({cellId:e,cell:t,isCodeHidden:n,codeFocus:i,variableName:o}){var u;if(!t)return;let l=document.getElementById(lr.create(e));if(!l){Se.warn("scrollCellIntoView: element not found");return}if(Ug()){Cm(l);return}if(n)Cm(l);else{b0.promote(e);let d=(u=t.current)==null?void 0:u.editorView;if(!d){Se.warn("scrollCellIntoView: editor not found",e);return}if(d.hasFocus||!document.hasFocus())return;if(Xg(()=>(d.focus(),d.hasFocus),{retries:5,delay:20}),i==="top")d.dispatch({selection:{anchor:0,head:0}});else if(i==="bottom"){let p=d.state.doc.line(d.state.doc.lines);d.dispatch({selection:{anchor:p.from,head:p.from}})}else o&&jc(d,o)}l.scrollIntoView({behavior:"smooth",block:"nearest"})}CT=function(e){let t=document.getElementById(lr.create(e));if(!t){Se.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 iO(){let e=document.getElementById("App");e==null||e.scrollTo({top:e.scrollHeight,behavior:"smooth"})}function aO(){var e;(e=document.getElementById("App"))==null||e.scrollTo({top:0,behavior:"smooth"})}bS=function(e){let t=Cf(e);if(t!=null&&t.hasFocus){tw(t,{behavior:"instant"});return}let n=document.getElementById(lr.create(e));n?n.scrollIntoView({behavior:"instant",block:"nearest"}):Se.warn(`[CellFocusManager] scrollCellIntoView: element not found: ${e}`)},Kr=function({id:e,name:t="_",code:n="",lastCodeRun:i=null,lastExecutionTime:o=null,edited:l=!1,config:u,serializedEditorState:d=null}){return{id:e,config:u||{hide_code:!1,disabled:!1,column:null},name:t,code:n,edited:l,lastCodeRun:i,lastExecutionTime:o,serializedEditorState:d}};function sx(e){return{hide_code:!1,disabled:!1,column:null,...e}}Dr=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 Lu=kr();function lx(e){let t={column:0,hide_code:!1,disabled:!1};return{...e,cellData:{[Uo]:Kr({id:Uo,config:t}),...e.cellData},cellRuntime:{[Uo]:Dr(),...e.cellRuntime},cellHandles:{[Uo]:(0,Re.createRef)(),...e.cellHandles}}}function oO(){return lx({cellIds:al.from([]),cellData:{},cellRuntime:{},cellHandles:{},history:[],scrollKey:null,cellLogs:[],untouchedNewCells:new Set})}let cx,ux,dx,fx;({reducer:cx,addMiddleware:ux,createActions:dx,useActions:fx,valueAtom:ft}=Ys(oO,{createNewCell:(e,t)=>{var j;let{cellId:n,before:i,code:o,name:l,config:u,lastCodeRun:d=null,lastExecutionTime:p=null,autoFocus:g=!0,skipIfCodeExists:w=!1,hideCode:x=void 0}=t,S,E;if(w){for(let z of e.cellIds.inOrderIds)if(((j=e.cellData[z])==null?void 0:j.code)===o)return e}if(n==="__end__"){let z=e.cellIds.atOrThrow(0);S=z.id,E=z.length}else if(typeof n=="string"){let z=e.cellIds.findWithId(n);S=z.id,E=z.topLevelIds.indexOf(n)}else if(n.type==="__end__"){let z=e.cellIds.get(n.columnId)||e.cellIds.atOrThrow(0);S=z.id,E=z.length}else throw Error("Invalid cellId");let T=t.newCellId||Ga.create(),O=i?E:E+1;return{...e,cellIds:e.cellIds.insertId(T,S,O),cellData:{...e.cellData,[T]:Kr({id:T,code:o,name:l,lastCodeRun:d,config:sx({...u,...x!=null&&{hide_code:x}}),lastExecutionTime:p,edited:!!o&&o!==d})},cellRuntime:{...e.cellRuntime,[T]:Dr()},cellHandles:{...e.cellHandles,[T]:(0,Re.createRef)()},scrollKey:g?T:null,untouchedNewCells:x&&g?new Set([...e.untouchedNewCells,T]):e.untouchedNewCells}},moveCell:(e,t)=>{let{cellId:n,before:i,direction:o}=t;if(i!==void 0&&o!==void 0&&Se.warn("Both before and direction specified for moveCell. Ignoring one."),o){let d=e.cellIds.findWithId(n),p=e.cellIds.indexOf(d),g=o==="left"?p-1:p+1,w=e.cellIds.at(g);return w?{...e,cellIds:e.cellIds.moveAcrossColumns(d.id,n,w.id,void 0),scrollKey:n}:e}let l=e.cellIds.findWithId(n),u=l.indexOfOrThrow(n);return i&&u===0?{...e,cellIds:e.cellIds.moveWithinColumn(l.id,u,0),scrollKey:n}:!i&&u===l.length-1?{...e,cellIds:e.cellIds.moveWithinColumn(l.id,u,l.length-1),scrollKey:n}:i?{...e,cellIds:e.cellIds.moveWithinColumn(l.id,u,u-1),scrollKey:n}:{...e,cellIds:e.cellIds.moveWithinColumn(l.id,u,u+1),scrollKey:n}},moveCellToIndex:(e,t)=>{let{cellId:n,columnId:i,index:o}=t,l=e.cellIds.findWithId(n),u=l.indexOfOrThrow(n),d=e.cellIds.get(i);if(!d)return e;let p=Math.max(0,Math.min(o,d.length)),g=l.id===i&&u<p?p-1:p;if(l.id===i&&u===g)return e;let w=e.cellIds.deleteById(n),x=w.get(i);return x?{...e,cellIds:w.insertId(n,i,Math.max(0,Math.min(g,x.length))),scrollKey:null}:e},dropCellOverCell:(e,t)=>{let{cellId:n,overCellId:i}=t,o=e.cellIds.findWithId(n),l=e.cellIds.findWithId(i),u=o.indexOfOrThrow(n),d=l.indexOfOrThrow(i);return o.id===l.id?u===d?e:{...e,cellIds:e.cellIds.moveWithinColumn(o.id,u,d),scrollKey:null}:{...e,cellIds:e.cellIds.moveAcrossColumns(o.id,n,l.id,i),scrollKey:null}},moveCellsRelativeTo:(e,t)=>{let{cellIds:n,targetCellId:i,position:o,previousPlacements:l}=t;if(n.length===0)return e;let u=e.cellIds.moveCellsRelativeTo(n,i,o),d=l&&l.length===n.length?[...e.history,{type:"move",cellIds:n,placements:l}]:e.history;return{...e,cellIds:u,history:d,scrollKey:null}},dropCellOverColumn:(e,t)=>{let{cellId:n,columnId:i}=t,o=e.cellIds.findWithId(n);return{...e,cellIds:e.cellIds.moveAcrossColumns(o.id,n,i,void 0)}},dropOverNewColumn:(e,t)=>{let{cellId:n}=t;return{...e,cellIds:e.cellIds.moveToNewColumn(n)}},moveColumn:(e,t)=>t.column===t.overColumn?e:{...e,cellIds:e.cellIds.moveColumn(t.column,t.overColumn)},focusCell:(e,t)=>{let n=e.cellIds.findWithId(t.cellId);if(n.length===0)return e;let{cellId:i,where:o}=t,l=n.indexOfOrThrow(i),u;u=o==="before"?Pg(l-1,0,n.length-1):o==="after"?Pg(l+1,0,n.length-1):l;let d=n.atOrThrow(u);return Rl({cellId:d,cell:e.cellHandles[d],isCodeHidden:Il(e,d),codeFocus:o==="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 n=t.first();return Rl({cellId:n,cell:e.cellHandles[n],isCodeHidden:Il(e,n),codeFocus:void 0,variableName:void 0}),aO(),e},focusBottomCell:e=>{let t=e.cellIds.getColumns().at(-1);if(t===void 0||t.length===0)return e;let n=t.last();return Rl({cellId:n,cell:e.cellHandles[n],isCodeHidden:Il(e,n),codeFocus:void 0,variableName:void 0}),iO(),e},sendToTop:(e,t)=>{let n=e.cellIds.findWithId(t.cellId);if(n.length===0)return e;let{cellId:i,scroll:o=!0}=t,l=n.indexOfOrThrow(i);return l===0?e:{...e,cellIds:e.cellIds.moveWithinColumn(n.id,l,0),scrollKey:o?i:null}},sendToBottom:(e,t)=>{let n=e.cellIds.findWithId(t.cellId);if(n.length===0)return e;let{cellId:i,scroll:o=!0}=t,l=n.indexOfOrThrow(i),u=n.length-1;return l===u?e:{...e,cellIds:e.cellIds.moveWithinColumn(n.id,l,u),scrollKey:o?i:null}},addColumn:(e,t)=>{let n=Ga.create();return{...e,cellIds:e.cellIds.addColumn(t.columnId,[n]),cellData:{...e.cellData,[n]:Kr({id:n})},cellRuntime:{...e.cellRuntime,[n]:Dr()},cellHandles:{...e.cellHandles,[n]:(0,Re.createRef)()},scrollKey:n}},addColumnBreakpoint:(e,t)=>{let{cellId:n}=t;return e.cellIds.getColumns()[0].inOrderIds[0]===n?e:{...e,cellIds:e.cellIds.insertBreakpoint(n)}},deleteColumn:(e,t)=>{let{columnId:n}=t;return{...e,cellIds:e.cellIds.delete(n)}},mergeAllColumns:e=>({...e,cellIds:e.cellIds.mergeAllColumns()}),compactColumns:e=>({...e,cellIds:e.cellIds.compact()}),deleteCell:(e,t)=>{var g,w;let n=t.cellId;if(e.cellIds.hasOnlyOneId())return e;let i;try{i=e.cellIds.findWithId(n)}catch(x){return Se.warn("Skipping delete for missing cellId",{cellId:n,error:x}),e}let o=i.indexOfOrThrow(n),l=o===0?1:o-1,u=null;i.length>1&&(u=i.atOrThrow(l));let d=(w=(g=e.cellHandles[n].current)==null?void 0:g.editorView)==null?void 0:w.state.toJSON({history:B5});d&&(d.doc=e.cellData[n].code),cO(n);let p=e.cellData[n];return{...e,cellIds:e.cellIds.deleteById(n),history:[...e.history,{type:"delete",name:p.name,serializedEditorState:d,column:i.id,index:o,isSetupCell:n===Rr,config:p.config}],scrollKey:u}},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:n,serializedEditorState:i={doc:""},column:o,index:l,isSetupCell:u,config:d}=t,p=u?Rr:Ga.create(),g=Kr({id:p,name:n,code:i.doc,edited:i.doc.trim().length>0,serializedEditorState:i,config:d});return{...e,cellIds:e.cellIds.insertId(p,o,l),cellData:{...e.cellData,[p]:g},cellRuntime:{...e.cellRuntime,[p]:Dr()},cellHandles:{...e.cellHandles,[p]:(0,Re.createRef)()},history:e.history.slice(0,-1),scrollKey:p}},clearSerializedEditorState:(e,t)=>{let{cellId:n}=t;return ms({state:e,cellId:n,cellReducer:i=>({...i,serializedEditorState:null})})},updateCellCode:(e,t)=>{let{cellId:n,code:i,formattingChange:o}=t;return e.cellData[n]?ms({state:e,cellId:n,cellReducer:l=>o?{...l,code:i,lastCodeRun:l.edited?l.lastCodeRun:i}:{...l,code:i,edited:i.trim()!==l.lastCodeRun}}):e},updateCellName:(e,t)=>{let{cellId:n,name:i}=t;return ms({state:e,cellId:n,cellReducer:o=>({...o,name:i})})},updateCellConfig:(e,t)=>{let{cellId:n,config:i}=t;return ms({state:e,cellId:n,cellReducer:o=>({...o,config:sx({...o.config,...i})})})},prepareForRun:(e,t)=>ms({state:Al({state:e,cellId:t.cellId,cellReducer:n=>MP(n)}),cellId:t.cellId,cellReducer:n=>({...n,edited:!1,lastCodeRun:n.code.trim()})}),handleCellMessage:(e,t)=>{let n=t.cell_id,i=Al({state:e,cellId:n,cellReducer:o=>OP(o,t)});return t.status==="queued"&&(i=ms({state:i,cellId:n,cellReducer:o=>({...o,lastCodeRun:o.code.trim(),edited:!1})})),{...i,cellLogs:[...i.cellLogs,...eO(t)]}},addLogs:(e,t)=>({...e,cellLogs:[...e.cellLogs,...t.logs]}),setCellIds:(e,t)=>{if(JM(e.cellIds.inOrderIds,t.cellIds))return e;let n={...e.cellData},i={...e.cellRuntime},o={...e.cellHandles};for(let l of t.cellIds)l in e.cellData||(n[l]=Kr({id:l})),l in e.cellRuntime||(i[l]=Dr()),l in e.cellHandles||(o[l]=(0,Re.createRef)());return{...e,cellIds:al.fromWithPreviousShape(t.cellIds,e.cellIds),cellData:n,cellRuntime:i,cellHandles:o}},rebuildCellColumns:(e,t)=>{let n=al.fromIdsAndColumns(t.cellIds.map(i=>{var o;return[i,((o=e.cellData[i])==null?void 0:o.config.column)??null]}));return{...e,cellIds:n}},setCellCodes:(e,t)=>{var o,l;Vn(t.codes.length===t.ids.length,"Expected codes and ids to have the same length");let n={...e},i=({cell:u,code:d,cellId:p,name:g,config:w})=>{if(!u)return Kr({id:p,code:d,name:g,config:w,lastCodeRun:t.codeIsStale?null:d,edited:t.codeIsStale&&d.trim().length>0});let x=t.codeIsStale?u.lastCodeRun:d,S=x?x.trim()!==d.trim():!!d;if(u.code.trim()===d.trim())return{...u,code:d,edited:S,lastCodeRun:x,...g!==void 0&&{name:g},...w!==void 0&&{config:w}};if(!Q0()||!L0(p)){let E=n.cellHandles[p].current;E!=null&&E.editorViewOrNull&&Bo(E.editorViewOrNull,d)}return{...u,code:d,edited:S,lastCodeRun:x,...g!==void 0&&{name:g},...w!==void 0&&{config:w}}};for(let u=0;u<t.ids.length;u++){let d=t.ids[u],p=t.codes[u];if(d===void 0||p===void 0)continue;let g=(o=t.names)==null?void 0:o[u],w=(l=t.configs)==null?void 0:l[u];n={...n,cellData:{...n.cellData,[d]:i({cell:n.cellData[d],code:p,cellId:d,name:g,config:w})}}}return n},setStdinResponse:(e,t)=>{let{cellId:n,response:i,outputIndex:o}=t;return Al({state:e,cellId:n,cellReducer:l=>{let u=[...l.consoleOutputs],d=u[o];return d==null||d.channel!=="stdin"?(Se.warn("Expected stdin output"),l):(u[o]={channel:"stdin",mimetype:d.mimetype,data:d.data,timestamp:d.timestamp,response:i},{...l,interrupted:!1,consoleOutputs:u})}})},setCells:(e,t)=>{let n=Object.fromEntries(t.map(u=>[u.id,u])),i=Gd(),o=u=>{if(!i)return Dr();let d=e.cellRuntime[u];return d&&(d.output!=null||d.consoleOutputs.length>0)?d:Dr()},l=Object.fromEntries(t.map(u=>[u.id,o(u.id)]));return lx({...e,cellIds:al.fromIdsAndColumns(t.map(u=>[u.id,u.config.column])),cellData:n,cellRuntime:l,cellHandles:Object.fromEntries(t.map(u=>[u.id,(0,Re.createRef)()]))})},moveToNextCell:(e,t)=>{let{cellId:n,before:i,noCreate:o=!1}=t;if(n==="__scratch__")return e;let l=e.cellIds.findWithId(n),u=l.indexOfOrThrow(n),d=i?u-1:u+1,p=d===l.length,g=d===-1;if(p&&!o){let w=Ga.create();return{...e,cellIds:e.cellIds.insertId(w,l.id,d),cellData:{...e.cellData,[w]:Kr({id:w})},cellRuntime:{...e.cellRuntime,[w]:Dr()},cellHandles:{...e.cellHandles,[w]:(0,Re.createRef)()},scrollKey:w}}if(g&&!o){let w=Ga.create();return{...e,cellIds:e.cellIds.insertId(w,l.id,0),cellData:{...e.cellData,[w]:Kr({id:w})},cellRuntime:{...e.cellRuntime,[w]:Dr()},cellHandles:{...e.cellHandles,[w]:(0,Re.createRef)()},scrollKey:w}}if((p||g)&&o)return e;if(d>=0&&d<l.length){let w=l.atOrThrow(d);Rl({cellId:w,cell:e.cellHandles[w],isCodeHidden:Il(e,w),codeFocus:i?"bottom":"top",variableName:void 0})}return e},markTouched:(e,t)=>{let{cellId:n}=t;if(e.untouchedNewCells.has(n)){let i=new Set(e.untouchedNewCells);return i.delete(n),{...e,untouchedNewCells:i}}return e},markUntouched:(e,t)=>{let{cellId:n}=t;if(!e.untouchedNewCells.has(n)){let i=new Set(e.untouchedNewCells);return i.add(n),{...e,untouchedNewCells:i}}return e},scrollToTarget:e=>{let t=e.scrollKey;if(t===null)return e;let n=e.cellIds.findWithId(t),i=n.indexOfOrThrow(t),o=i===n.length-1?n.last():n.atOrThrow(i);return Rl({cellId:o,cell:e.cellHandles[o],isCodeHidden:Il(e,o),codeFocus:void 0,variableName:void 0}),{...e,scrollKey:null}},foldAll:e=>(v3(Object.values(e.cellHandles).map(t=>{var n;return(n=t.current)==null?void 0:n.editorView})),e),unfoldAll:e=>(b3(Object.values(e.cellHandles).map(t=>{var n;return(n=t.current)==null?void 0:n.editorView})),e),clearLogs:e=>({...e,cellLogs:[]}),collapseCell:(e,t)=>{let{cellId:n}=t,i=e.cellIds.findWithId(n),o=i.topLevelIds.map(d=>e.cellRuntime[d].outline),l=Q2(i.indexOfOrThrow(n),o);if(!l)return e;let u=i.atOrThrow(l[1]);return{...e,cellIds:e.cellIds.transformWithCellId(n,d=>d.collapse(n,u)),scrollKey:n}},expandCell:(e,t)=>{let{cellId:n}=t;return{...e,cellIds:e.cellIds.transformWithCellId(n,i=>i.expand(n)),scrollKey:n}},collapseAllCells:e=>({...e,cellIds:e.cellIds.transformAll(t=>{let n=t.topLevelIds.map(p=>e.cellRuntime[p].outline),i=[...t.nodes],o=[],l=[],u=i.length-1;for(;u>=0;){let p=Q2(u,n);if(p){let g=u,w=p[1],x=o.find(T=>T.start<=w&&T.end===w);x&&(w=x.start),o.push({start:g,end:w});let S=t.atOrThrow(g),E=t.atOrThrow(w);l.push({id:S,until:E})}else l.push(null);u--}let d=l.toReversed();return t.collapseAll(d)})}),expandAllCells:e=>({...e,cellIds:e.cellIds.transformAll(t=>t.expandAll())}),showCellIfHidden:(e,t)=>{let{cellId:n}=t,i=e.cellIds.findWithId(n),o=i,l=i.findAndExpandDeep(n);return l.equals(o)?e:{...e,cellIds:e.cellIds.transformWithCellId(n,()=>l)}},splitCell:(e,t)=>{var w;let{cellId:n}=t,i=e.cellIds.findWithId(n),o=i.indexOfOrThrow(n),l=e.cellData[n],u=e.cellHandles[n].current;if((u==null?void 0:u.editorView)==null)return e;let{beforeCursorCode:d,afterCursorCode:p}=kP(u.editorView);Bo(u.editorView,d);let g=Ga.create();return{...e,cellIds:e.cellIds.insertId(g,i.id,o+1),cellData:{...e.cellData,[n]:{...l,code:d,edited:!!d&&d.trim()!==((w=l.lastCodeRun)==null?void 0:w.trim())},[g]:Kr({id:g,code:p,edited:!!p})},cellRuntime:{...e.cellRuntime,[n]:{...e.cellRuntime[n],output:null,consoleOutputs:[]},[g]:Dr()},cellHandles:{...e.cellHandles,[g]:(0,Re.createRef)()},scrollKey:g}},undoSplitCell:(e,t)=>{var u;let{cellId:n,snapshot:i}=t,o=e.cellData[n],l=e.cellHandles[n].current;return(l==null?void 0:l.editorView)==null?e:(Bo(l.editorView,i),{...e,cellIds:e.cellIds.transformWithCellId(n,d=>{let p=d.indexOfOrThrow(n)+1;return d.deleteAtIndex(p)}),cellData:{...e.cellData,[n]:{...o,code:i,edited:!!i&&(i==null?void 0:i.trim())!==((u=o.lastCodeRun)==null?void 0:u.trim())}},cellRuntime:{...e.cellRuntime,[n]:{...e.cellRuntime[n],output:null,consoleOutputs:[]}},cellHandles:{...e.cellHandles}})},clearCellOutput:(e,t)=>{let{cellId:n}=t;return Al({state:e,cellId:n,cellReducer:i=>({...i,output:null,consoleOutputs:[]})})},clearCellConsoleOutput:(e,t)=>{let{cellId:n}=t;return Al({state:e,cellId:n,cellReducer:i=>({...i,consoleOutputs:i.consoleOutputs.filter(o=>o.channel==="stdin"&&o.response==null)})})},clearAllCellOutputs:e=>{let t={...e.cellRuntime};for(let n of e.cellIds.inOrderIds)t[n]={...t[n],output:null,consoleOutputs:[]};return{...e,cellRuntime:t}},addSetupCellIfDoesntExist:(e,t)=>{let{code:n}=t;return e.cellIds.setupCellExists()?{...e,scrollKey:Rr}:{...e,cellIds:e.cellIds.insertId(Rr,e.cellIds.atOrThrow(0).id,0),cellData:{...e.cellData,[Rr]:Kr({id:Rr,name:Rr,code:n,edited:!!n})},cellRuntime:{...e.cellRuntime,[Rr]:Dr()},cellHandles:{...e.cellHandles,[Rr]:(0,Re.createRef)()},scrollKey:Rr}}})),ux(WP);function Il(e,t){return!!e.cellData[t].config.hide_code&&!e.untouchedNewCells.has(t)}function Al({state:e,cellId:t,cellReducer:n}){return t in e.cellRuntime?{...e,cellRuntime:{...e.cellRuntime,[t]:n(e.cellRuntime[t])}}:(Se.warn(`Cell ${t} not found in state`),e)}function ms({state:e,cellId:t,cellReducer:n}){return t in e.cellData?{...e,cellData:{...e.cellData,[t]:n(e.cellData[t])}}:(Se.warn(`Cell ${t} not found in state`),e)}dT=function(e){let t=e.cellData,n={column:null};return e.cellIds.getColumns().length>1?e.cellIds.getColumns().flatMap((i,o)=>i.inOrderIds.map((l,u)=>{let d={...n};return u===0&&(d.column=o),{...t[l].config,...d}})):e.cellIds.getColumns().flatMap(i=>i.inOrderIds.map(o=>({...t[o].config,...n})))};let px;px=dx(e=>{Me.set(ft,t=>cx(t,e))}).addLogs,Oc=je(e=>e(ft).cellIds),uE=je(e=>e(Oc).hasOnlyOneId()),OE=je(e=>uy(e(ft)).length>0),je(e=>f0(e(ft)).length>0);let Sm,mx;cT=je(e=>gD(e(ft))),ZS=je(e=>yD(e(ft))),mT=je(e=>hD(e(ft))),Sm=je(e=>{let{cellIds:t,cellRuntime:n,cellData:i}=e(ft);return t.inOrderIds.map(o=>{var d;let l=n[o],{name:u}=i[o];if(Sc((d=l.output)==null?void 0:d.mimetype)){Vn(Array.isArray(l.output.data),"Expected array data");let p=l.output.data.filter(g=>!g.type.includes("ancestor"));if(p.length>0)return{output:{...l.output,data:p},cellId:o,cellName:u}}return null}).filter(Boolean)}),bT=je(e=>{let{cellIds:t,cellRuntime:n}=e(ft);return DP(t.inOrderIds.map(i=>n[i].outline))}),nT=je(e=>e(Sm).length),mx=XM(je(e=>{let{cellIds:t,cellData:n}=e(ft);return ki.fromEntries(t.inOrderIds.map(i=>{var o;return[i,(o=n[i])==null?void 0:o.name]}))}));var sO=je(e=>e(ft).scrollKey);IS=()=>$n(ft),zE=()=>$n(Oc),FS=()=>$n(mx),$E=()=>$n(Sm),zS=()=>$n(ft).cellLogs,PS=()=>$n(sO),Af=()=>Me.get(ft),YE=()=>Me.get(ft).cellIds,IE=()=>{let{cellIds:e,cellData:t}=Me.get(ft);return e.inOrderIds.map(n=>{var i;return(i=t[n])==null?void 0:i.name}).filter(Boolean)};var lO=d3(o3(ft,e=>e.cellIds.inOrderIds.map(t=>e.cellData[t])));$S=()=>LC(lO),mE=je(e=>e(ft).cellRuntime),yE=je(e=>pD(e(ft))),yT=je(e=>{let{cellRuntime:t}=e(ft);return Object.entries(t).every(([n,i])=>i.status!=="running"||n==="__scratch__")}),JS=je(e=>mD(e(ft))),_S=je(e=>e(ft).cellIds.colLength),NE=je(e=>e(ft).cellIds.idLength>0),GE=je(e=>e(ft).cellIds.getColumnIds()),Lf=Jf(e=>je(t=>t(ft).cellData[e]));var Em=Jf(e=>je(t=>t(ft).cellRuntime[e]));const hx=Jf(e=>je(t=>t(ft).cellHandles[e]));function cO(e){Lf.remove(e),Em.remove(e),hx.remove(e)}CS=e=>{let t=(0,Lu.c)(2),n;return t[0]===e?n=t[1]:(n=Lf(e),t[0]=e,t[1]=n),$n(n)},WS=e=>{let t=(0,Lu.c)(2),n;return t[0]===e?n=t[1]:(n=Em(e),t[0]=e,t[1]=n),$n(n)},yS=e=>{let t=(0,Lu.c)(2),n;return t[0]===e?n=t[1]:(n=hx(e),t[0]=e,t[1]=n),$n(n)},U0=()=>{let{cellIds:e,cellHandles:t}=Me.get(ft);return e.inOrderIds.map(n=>{var i,o;return(o=(i=t[n])==null?void 0:i.current)==null?void 0:o.editorViewOrNull}).filter(Boolean)},Cf=e=>{var n;let{cellHandles:t}=Me.get(ft);return(n=t[e].current)==null?void 0:n.editorView},xE=function(e){let{cellIds:t,cellData:n,cellRuntime:i}=e;return t.getColumns().flatMap(o=>o.topLevelIds.map(l=>({...n[l],...i[l]})))},aT=function(e){return je(t=>t(ft).untouchedNewCells.has(e))};function uO(e){let t=Em(e);return je(n=>{let i=n(t);if(!i||i.status==="queued"||i.status==="running")return;let o=[],l=i.consoleOutputs;if(l&&l.length>0){let d=l.find(p=>p.mimetype==="application/vnd.marimo+traceback");if(d){let p=d.data;o.push(...g0(p))}}let u=i.output;if((u==null?void 0:u.mimetype)==="application/vnd.marimo+error"){let d=u.data;if(Array.isArray(d))for(let p of d)p.type==="syntax"&&p.lineno!=null&&o.push({kind:"cell",cellId:e,lineNumber:p.lineno}),p.type==="import-star"&&p.lineno!=null&&o.push({kind:"cell",cellId:e,lineNumber:p.lineno})}return o.length>0?o:void 0})}TS=function(e){let t=(0,Lu.c)(2),n;return t[0]===e?n=t[1]:(n=e===void 0?{}:e,t[0]=e,t[1]=n),fx(n)}})();export{zg as $,hS as $i,tl as $n,gS as $r,Fg as $t,yS as A,Sc as Ai,$g as An,Vg as Ar,vS as At,bS as B,nl as Bi,wS as Bn,Hg as Br,xS as Bt,_S as C,kS as Ci,Ec as Cn,rf as Cr,Bg as Ct,CS as D,SS as Di,ES as Dn,zo as Dr,af as Dt,TS as E,DS as Ei,of as En,Wg as Er,RS as Et,IS as F,Fo as Fi,sf as Fn,$o as Fr,lf as Ft,Ug as G,Kg as Gi,Qg as Gn,Gg as Gr,AS as Gt,Xg as H,LS as Hi,Tc as Hn,Jg as Hr,Yg as Ht,PS as I,cf as Ii,Zg as In,uf as Ir,OS as It,e0 as J,MS as Ji,NS as Jn,t0 as Jr,df as Jt,jS as K,Ka as Ki,ff as Kn,n0 as Kr,na as Kt,Kr as L,r0 as Li,Dc as Ln,i0 as Lr,qS as Lt,zS as M,a0 as Mi,Xn as Mn,o0 as Mr,s0 as Mt,FS as N,pf as Ni,Ee as Nn,l0 as Nr,Rc as Nt,$S as O,VS as Oi,HS as On,c0 as Or,BS as Ot,WS as P,US as Pi,rl as Pn,u0 as Pr,Tr as Pt,KS as Q,il as Qi,mf as Qn,QS as Qr,d0 as Qt,Dr as R,Ic as Ri,GS as Rn,hf as Rr,XS as Rt,JS as S,gf as Sa,f0 as Si,ra as Sn,YS as Sr,yf as St,ZS as T,p0 as Ti,eE as Tn,m0 as Tr,h0 as Tt,tE as U,g0 as Ui,nE as Un,y0 as Ur,v0 as Ut,b0 as V,vf as Vi,rE as Vn,w0 as Vr,x0 as Vt,iE as W,_0 as Wi,aE as Wn,k0 as Wr,oE as Wt,C0 as X,sE as Xi,lE as Xn,bf as Xr,wf as Xt,S0 as Y,E0 as Yi,Qa as Yn,cE as Yr,Ei as Yt,T0 as Z,xf as Zi,Ac as Zn,Vo as Zr,_f as Zt,uE as _,j6 as __tla,dE as _a,Lt as _i,fE as _n,Lc as _r,pE as _t,mE as a,Pc as aa,D0 as ai,R0 as an,hE as ar,gE as at,yE as b,I0 as ba,vE as bi,A0 as bn,bE as br,wE as bt,xE as c,_E as ca,kE as ci,CE as cn,kf as cr,L0 as ct,Cf as d,Ga as da,SE as di,Sf as dn,EE as dr,TE as dt,DE as ea,RE as ei,P0 as en,O0 as er,M0 as et,IE as f,AE as fa,LE as fi,PE as fn,Ef as fr,N0 as ft,OE as g,Tf as ga,Ho as gi,j0 as gn,ME as gr,Bo as gt,NE as h,Rr as ha,ia as hi,q0 as hn,Wo as hr,ci as ht,Oc as i,jE as ia,qE as ii,z0 as in,Df as ir,F0 as it,zE as j,$0 as ji,FE as jn,V0 as jr,H0 as jt,$E as k,B0 as ki,Rf as kn,W0 as kr,VE as kt,U0 as l,HE as la,Mc as li,K0 as ln,If as lr,Q0 as lt,Af as m,Uo as ma,BE as mi,WE as mn,ui as mr,G0 as mt,Lf as n,Nc as na,UE as ni,Pf as nn,KE as nr,QE as nt,GE as o,X0 as oa,J0 as oi,XE as on,JE as or,Y0 as ot,YE as p,lr as pa,ZE as pi,jc as pn,Ko as pr,Z0 as pt,ey as q,al as qi,eT as qn,ty as qr,tT as qt,nT as r,Jn as ra,rT as ri,iT as rn,ny as rr,Of as rt,aT as s,Mf as sa,ry as si,oT as sn,sT as sr,lT as st,cT as t,ol as ta,Nf as ti,uT as tn,Xa as tr,iy as tt,dT as u,ay as ua,jf as ui,fT as un,qc as ur,pT as ut,mT as v,oy as va,aa as vi,hT as vn,sy as vr,gT as vt,yT as w,ly as wi,vT as wn,zc as wr,cy as wt,bT as x,wT as xa,uy as xi,xT as xn,Fc as xr,qf as xt,ft as y,_T as ya,kT as yi,dy as yn,Ja as yr,Ir as yt,CT as z,$c as zi,fy as zn,sl as zr,ST as zt};
|
|
269
|
+
`)}catch(t){return Se.error("Error parsing HTML content:",t),e}},KE=function(e){if(!e)return"";try{return Nf(JP.ansi_to_html(e))}catch(t){return Se.error("Error converting ANSI to plain text:",t),e}},iy=Ne(null);let co;co=kr(),KS=n3,M0=Re.forwardRef((e,t)=>{let n=(0,co.c)(9),i,o;n[0]===e?(i=n[1],o=n[2]):({className:i,...o}=e,n[0]=e,n[1]=i,n[2]=o);let l;n[3]===i?l=n[4]:(l=Ci("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",i),n[3]=i,n[4]=l);let u;return n[5]!==o||n[6]!==t||n[7]!==l?(u=(0,M.jsx)(zy,{ref:t,className:l,...o}),n[5]=o,n[6]=t,n[7]=l,n[8]=u):u=n[8],u}),M0.displayName=zy.displayName;var rx={default:"bg-background border",danger:"group destructive text-error border-destructive bg-(--red-1) shadow-md-solid shadow-error"},YP=d5("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:rx},defaultVariants:{variant:"default"}});function ZP(e){return typeof e=="string"&&e in rx}S0=Re.forwardRef((e,t)=>{let n=(0,co.c)(11),i,o,l;n[0]===e?(i=n[1],o=n[2],l=n[3]):({className:i,variant:l,...o}=e,n[0]=e,n[1]=i,n[2]=o,n[3]=l);let u=ZP(l)?l:"default",d;n[4]!==i||n[5]!==u?(d=Ci(YP({variant:u}),"print:hidden",i),n[4]=i,n[5]=u,n[6]=d):d=n[6];let p;return n[7]!==o||n[8]!==t||n[9]!==d?(p=(0,M.jsx)(Fy,{ref:t,className:d,...o}),n[7]=o,n[8]=t,n[9]=d,n[10]=p):p=n[10],p}),S0.displayName=Fy.displayName;var ix=Re.forwardRef((e,t)=>{let n=(0,co.c)(9),i,o;n[0]===e?(i=n[1],o=n[2]):({className:i,...o}=e,n[0]=e,n[1]=i,n[2]=o);let l;n[3]===i?l=n[4]:(l=Ci("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",i),n[3]=i,n[4]=l);let u;return n[5]!==o||n[6]!==t||n[7]!==l?(u=(0,M.jsx)(Hy,{ref:t,className:l,...o}),n[5]=o,n[6]=t,n[7]=l,n[8]=u):u=n[8],u});ix.displayName=Hy.displayName,C0=Re.forwardRef((e,t)=>{let n=(0,co.c)(10),i,o;n[0]===e?(i=n[1],o=n[2]):({className:i,...o}=e,n[0]=e,n[1]=i,n[2]=o);let l;n[3]===i?l=n[4]:(l=Ci("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",i),n[3]=i,n[4]=l);let u;n[5]===Symbol.for("react.memo_cache_sentinel")?(u=(0,M.jsx)(R6,{className:"h-4 w-4"}),n[5]=u):u=n[5];let d;return n[6]!==o||n[7]!==t||n[8]!==l?(d=(0,M.jsx)(By,{ref:t,className:l,"toast-close":"",...o,children:u}),n[6]=o,n[7]=t,n[8]=l,n[9]=d):d=n[9],d}),C0.displayName=By.displayName,zg=Re.forwardRef((e,t)=>{let n=(0,co.c)(9),i,o;n[0]===e?(i=n[1],o=n[2]):({className:i,...o}=e,n[0]=e,n[1]=i,n[2]=o);let l;n[3]===i?l=n[4]:(l=Ci("text-sm font-semibold",i),n[3]=i,n[4]=l);let u;return n[5]!==o||n[6]!==t||n[7]!==l?(u=(0,M.jsx)($y,{ref:t,className:l,...o}),n[5]=o,n[6]=t,n[7]=l,n[8]=u):u=n[8],u}),zg.displayName=$y.displayName,T0=Re.forwardRef((e,t)=>{let n=(0,co.c)(13),i,o,l;n[0]===e?(i=n[1],o=n[2],l=n[3]):({className:i,onPointerDown:o,...l}=e,n[0]=e,n[1]=i,n[2]=o,n[3]=l);let u;n[4]===i?u=n[5]:(u=Ci("max-h-48 overflow-auto text-sm opacity-90 whitespace-pre-wrap wrap-break-word select-text cursor-text",i),n[4]=i,n[5]=u);let d;n[6]===o?d=n[7]:(d=g=>{g.stopPropagation(),o==null||o(g)},n[6]=o,n[7]=d);let p;return n[8]!==l||n[9]!==t||n[10]!==u||n[11]!==d?(p=(0,M.jsx)(Vy,{ref:t,className:u,onPointerDown:d,...l}),n[8]=l,n[9]=t,n[10]=u,n[11]=d,n[12]=p):p=n[12],p}),T0.displayName=Vy.displayName,e0=function(e){return e.type==="cell"?e.cellId:`lsp:${e.name}`};var ax=!1;function eO(e){var i;let t=[],n=[e.console].filter(Boolean).flat();for(let o of n){let l=o.mimetype==="text/plain",u=o.mimetype==="text/html"||o.mimetype==="application/vnd.marimo+traceback";if(l||u){let d=o.channel==="stderr"||o.channel==="marimo-error";switch(o.channel){case"stdout":case"stderr":case"marimo-error":{let p=m6.asString(o.data),g=u?Nf(p):p;t.push({timestamp:o.timestamp||Date.now(),level:d?"stderr":"stdout",message:g,source:{type:"cell",cellId:e.cell_id}});break}default:break}}}if(t.forEach(ox.log),n.length===0&&Sc((i=e.output)==null?void 0:i.mimetype)&&Array.isArray(e.output.data)){e.output.data.forEach(u=>{ox.log({level:"stderr",source:{type:"cell",cellId:e.cell_id},timestamp:e.timestamp??0,message:JSON.stringify(u)})});let o=e.output.data.filter(u=>"type"in u&&u.type==="exception"||u.type==="internal"),l=Me.get(o5)==="read";if(o.length>0&&!ax&&l){ax=!0;let u=o.find(d=>d.traceback);Cc(u?{title:"An internal error occurred",description:u.msg||"Click 'View' to see traceback",variant:"danger",action:Re.createElement(ix,{altText:"View traceback",onClick:()=>{Me.set(iy,{traceback:u.traceback,errorMessage:u.msg||"An internal error occurred"})}},"View")}:{title:"An internal error occurred",description:"See console for details.",variant:"danger"})}}return t}var ox={log:e=>{let t=e.level==="stdout"?"gray":e.level==="stderr"?"red":"orange",n=e.level.toUpperCase();console.log(`%c[${n}]`,`color:${t}; padding:2px 0; border-radius:2px; font-weight:bold`,`[${ey(e.timestamp)}]`,`(${e0(e.source)}) ${e.message}`)}};ey=function(e){try{return UP(e).toLocaleTimeString(void 0,{hour12:!0,hour:"numeric",minute:"numeric",second:"numeric"})}catch{return""}},rE=function(e,t){let n=Cf(t);n?n.focus():Se.warn(`[CellFocusManager] focusCellEditor: element not found: ${t}`)},eE=function(e){let t=document.getElementById(lr.create(e));t?Cm(t):Se.warn(`[CellFocusManager] focusCell: element not found: ${e}`)},jS=function(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})},Ug=function(){return document.activeElement instanceof HTMLElement&&document.activeElement.classList.contains("marimo-cell")};function Cm(e){try{e.focus()}catch{Se.warn("[CellFocusManager] element may not be focusable",e)}}Xg=function(e,t){let{retries:n,delay:i,initialDelay:o=0}=t,l=0,u=()=>{if(l<n){try{if(e())return}catch(d){Se.error(`Error executing function on attempt ${l+1}, retrying`,{error:d})}l++,setTimeout(u,i)}};o>0?setTimeout(u,o):u()};function tO(){let e=globalThis.scheduler;if(typeof(e==null?void 0:e.postTask)=="function")return t=>{e.postTask(t,{priority:"user-visible"}).catch(n=>{setTimeout(()=>{throw n})})};if(typeof MessageChannel=="function"){let t=[],n=new MessageChannel;return n.port1.onmessage=()=>{var i;(i=t.shift())==null||i()},i=>{t.push(i),n.port2.postMessage(null)}}return t=>{setTimeout(t,0)}}const nO=tO();function rO(e=nO){let t=new Map,n=new Set,i=!1;function o(){i||t.size===0||(i=!0,e(u))}function l(){for(let d of n){if(t.has(d))return d;n.delete(d)}return t.keys().next().value}function u(){i=!1;try{let d=l();if(d!==void 0){let p=t.get(d);t.delete(d),n.delete(d),p==null||p()}}finally{o()}}return{request(d,p){t.set(d,p),o()},promote(d){let p=t.get(d);p&&(t.delete(d),n.delete(d),p())},prioritize(d){t.has(d)&&n.add(d)},deprioritize(d){n.delete(d)},cancel(d){t.delete(d),n.delete(d)}}}b0=rO();function Rl({cellId:e,cell:t,isCodeHidden:n,codeFocus:i,variableName:o}){var u;if(!t)return;let l=document.getElementById(lr.create(e));if(!l){Se.warn("scrollCellIntoView: element not found");return}if(Ug()){Cm(l);return}if(n)Cm(l);else{b0.promote(e);let d=(u=t.current)==null?void 0:u.editorView;if(!d){Se.warn("scrollCellIntoView: editor not found",e);return}if(d.hasFocus||!document.hasFocus())return;if(Xg(()=>(d.focus(),d.hasFocus),{retries:5,delay:20}),i==="top")d.dispatch({selection:{anchor:0,head:0}});else if(i==="bottom"){let p=d.state.doc.line(d.state.doc.lines);d.dispatch({selection:{anchor:p.from,head:p.from}})}else o&&jc(d,o)}l.scrollIntoView({behavior:"smooth",block:"nearest"})}CT=function(e){let t=document.getElementById(lr.create(e));if(!t){Se.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 iO(){let e=document.getElementById("App");e==null||e.scrollTo({top:e.scrollHeight,behavior:"smooth"})}function aO(){var e;(e=document.getElementById("App"))==null||e.scrollTo({top:0,behavior:"smooth"})}bS=function(e){let t=Cf(e);if(t!=null&&t.hasFocus){tw(t,{behavior:"instant"});return}let n=document.getElementById(lr.create(e));n?n.scrollIntoView({behavior:"instant",block:"nearest"}):Se.warn(`[CellFocusManager] scrollCellIntoView: element not found: ${e}`)},Kr=function({id:e,name:t="_",code:n="",lastCodeRun:i=null,lastExecutionTime:o=null,edited:l=!1,config:u,serializedEditorState:d=null}){return{id:e,config:u||{hide_code:!1,disabled:!1,column:null},name:t,code:n,edited:l,lastCodeRun:i,lastExecutionTime:o,serializedEditorState:d}};function sx(e){return{hide_code:!1,disabled:!1,column:null,...e}}Dr=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 Pu=kr();function lx(e){let t={column:0,hide_code:!1,disabled:!1};return{...e,cellData:{[Uo]:Kr({id:Uo,config:t}),...e.cellData},cellRuntime:{[Uo]:Dr(),...e.cellRuntime},cellHandles:{[Uo]:(0,Re.createRef)(),...e.cellHandles}}}function oO(){return lx({cellIds:al.from([]),cellData:{},cellRuntime:{},cellHandles:{},history:[],scrollKey:null,cellLogs:[],untouchedNewCells:new Set})}let cx,ux,dx,fx;({reducer:cx,addMiddleware:ux,createActions:dx,useActions:fx,valueAtom:ft}=Ys(oO,{createNewCell:(e,t)=>{var j;let{cellId:n,before:i,code:o,name:l,config:u,lastCodeRun:d=null,lastExecutionTime:p=null,autoFocus:g=!0,skipIfCodeExists:w=!1,hideCode:x=void 0}=t,S,E;if(w){for(let z of e.cellIds.inOrderIds)if(((j=e.cellData[z])==null?void 0:j.code)===o)return e}if(n==="__end__"){let z=e.cellIds.atOrThrow(0);S=z.id,E=z.length}else if(typeof n=="string"){let z=e.cellIds.findWithId(n);S=z.id,E=z.topLevelIds.indexOf(n)}else if(n.type==="__end__"){let z=e.cellIds.get(n.columnId)||e.cellIds.atOrThrow(0);S=z.id,E=z.length}else throw Error("Invalid cellId");let T=t.newCellId||Xa.create(),O=i?E:E+1;return{...e,cellIds:e.cellIds.insertId(T,S,O),cellData:{...e.cellData,[T]:Kr({id:T,code:o,name:l,lastCodeRun:d,config:sx({...u,...x!=null&&{hide_code:x}}),lastExecutionTime:p,edited:!!o&&o!==d})},cellRuntime:{...e.cellRuntime,[T]:Dr()},cellHandles:{...e.cellHandles,[T]:(0,Re.createRef)()},scrollKey:g?T:null,untouchedNewCells:x&&g?new Set([...e.untouchedNewCells,T]):e.untouchedNewCells}},moveCell:(e,t)=>{let{cellId:n,before:i,direction:o}=t;if(i!==void 0&&o!==void 0&&Se.warn("Both before and direction specified for moveCell. Ignoring one."),o){let d=e.cellIds.findWithId(n),p=e.cellIds.indexOf(d),g=o==="left"?p-1:p+1,w=e.cellIds.at(g);return w?{...e,cellIds:e.cellIds.moveAcrossColumns(d.id,n,w.id,void 0),scrollKey:n}:e}let l=e.cellIds.findWithId(n),u=l.indexOfOrThrow(n);return i&&u===0?{...e,cellIds:e.cellIds.moveWithinColumn(l.id,u,0),scrollKey:n}:!i&&u===l.length-1?{...e,cellIds:e.cellIds.moveWithinColumn(l.id,u,l.length-1),scrollKey:n}:i?{...e,cellIds:e.cellIds.moveWithinColumn(l.id,u,u-1),scrollKey:n}:{...e,cellIds:e.cellIds.moveWithinColumn(l.id,u,u+1),scrollKey:n}},moveCellToIndex:(e,t)=>{let{cellId:n,columnId:i,index:o}=t,l=e.cellIds.findWithId(n),u=l.indexOfOrThrow(n),d=e.cellIds.get(i);if(!d)return e;let p=Math.max(0,Math.min(o,d.length)),g=l.id===i&&u<p?p-1:p;if(l.id===i&&u===g)return e;let w=e.cellIds.deleteById(n),x=w.get(i);return x?{...e,cellIds:w.insertId(n,i,Math.max(0,Math.min(g,x.length))),scrollKey:null}:e},dropCellOverCell:(e,t)=>{let{cellId:n,overCellId:i}=t,o=e.cellIds.findWithId(n),l=e.cellIds.findWithId(i),u=o.indexOfOrThrow(n),d=l.indexOfOrThrow(i);return o.id===l.id?u===d?e:{...e,cellIds:e.cellIds.moveWithinColumn(o.id,u,d),scrollKey:null}:{...e,cellIds:e.cellIds.moveAcrossColumns(o.id,n,l.id,i),scrollKey:null}},moveCellsRelativeTo:(e,t)=>{let{cellIds:n,targetCellId:i,position:o,previousPlacements:l}=t;if(n.length===0)return e;let u=e.cellIds.moveCellsRelativeTo(n,i,o),d=l&&l.length===n.length?[...e.history,{type:"move",cellIds:n,placements:l}]:e.history;return{...e,cellIds:u,history:d,scrollKey:null}},dropCellOverColumn:(e,t)=>{let{cellId:n,columnId:i}=t,o=e.cellIds.findWithId(n);return{...e,cellIds:e.cellIds.moveAcrossColumns(o.id,n,i,void 0)}},dropOverNewColumn:(e,t)=>{let{cellId:n}=t;return{...e,cellIds:e.cellIds.moveToNewColumn(n)}},moveColumn:(e,t)=>t.column===t.overColumn?e:{...e,cellIds:e.cellIds.moveColumn(t.column,t.overColumn)},focusCell:(e,t)=>{let n=e.cellIds.findWithId(t.cellId);if(n.length===0)return e;let{cellId:i,where:o}=t,l=n.indexOfOrThrow(i),u;u=o==="before"?Pg(l-1,0,n.length-1):o==="after"?Pg(l+1,0,n.length-1):l;let d=n.atOrThrow(u);return Rl({cellId:d,cell:e.cellHandles[d],isCodeHidden:Il(e,d),codeFocus:o==="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 n=t.first();return Rl({cellId:n,cell:e.cellHandles[n],isCodeHidden:Il(e,n),codeFocus:void 0,variableName:void 0}),aO(),e},focusBottomCell:e=>{let t=e.cellIds.getColumns().at(-1);if(t===void 0||t.length===0)return e;let n=t.last();return Rl({cellId:n,cell:e.cellHandles[n],isCodeHidden:Il(e,n),codeFocus:void 0,variableName:void 0}),iO(),e},sendToTop:(e,t)=>{let n=e.cellIds.findWithId(t.cellId);if(n.length===0)return e;let{cellId:i,scroll:o=!0}=t,l=n.indexOfOrThrow(i);return l===0?e:{...e,cellIds:e.cellIds.moveWithinColumn(n.id,l,0),scrollKey:o?i:null}},sendToBottom:(e,t)=>{let n=e.cellIds.findWithId(t.cellId);if(n.length===0)return e;let{cellId:i,scroll:o=!0}=t,l=n.indexOfOrThrow(i),u=n.length-1;return l===u?e:{...e,cellIds:e.cellIds.moveWithinColumn(n.id,l,u),scrollKey:o?i:null}},addColumn:(e,t)=>{let n=Xa.create();return{...e,cellIds:e.cellIds.addColumn(t.columnId,[n]),cellData:{...e.cellData,[n]:Kr({id:n})},cellRuntime:{...e.cellRuntime,[n]:Dr()},cellHandles:{...e.cellHandles,[n]:(0,Re.createRef)()},scrollKey:n}},addColumnBreakpoint:(e,t)=>{let{cellId:n}=t;return e.cellIds.getColumns()[0].inOrderIds[0]===n?e:{...e,cellIds:e.cellIds.insertBreakpoint(n)}},deleteColumn:(e,t)=>{let{columnId:n}=t;return{...e,cellIds:e.cellIds.delete(n)}},mergeAllColumns:e=>({...e,cellIds:e.cellIds.mergeAllColumns()}),compactColumns:e=>({...e,cellIds:e.cellIds.compact()}),deleteCell:(e,t)=>{var g,w;let n=t.cellId;if(e.cellIds.hasOnlyOneId())return e;let i;try{i=e.cellIds.findWithId(n)}catch(x){return Se.warn("Skipping delete for missing cellId",{cellId:n,error:x}),e}let o=i.indexOfOrThrow(n),l=o===0?1:o-1,u=null;i.length>1&&(u=i.atOrThrow(l));let d=(w=(g=e.cellHandles[n].current)==null?void 0:g.editorView)==null?void 0:w.state.toJSON({history:B5});d&&(d.doc=e.cellData[n].code),cO(n);let p=e.cellData[n];return{...e,cellIds:e.cellIds.deleteById(n),history:[...e.history,{type:"delete",name:p.name,serializedEditorState:d,column:i.id,index:o,isSetupCell:n===Rr,config:p.config}],scrollKey:u}},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:n,serializedEditorState:i={doc:""},column:o,index:l,isSetupCell:u,config:d}=t,p=u?Rr:Xa.create(),g=Kr({id:p,name:n,code:i.doc,edited:i.doc.trim().length>0,serializedEditorState:i,config:d});return{...e,cellIds:e.cellIds.insertId(p,o,l),cellData:{...e.cellData,[p]:g},cellRuntime:{...e.cellRuntime,[p]:Dr()},cellHandles:{...e.cellHandles,[p]:(0,Re.createRef)()},history:e.history.slice(0,-1),scrollKey:p}},clearSerializedEditorState:(e,t)=>{let{cellId:n}=t;return ms({state:e,cellId:n,cellReducer:i=>({...i,serializedEditorState:null})})},updateCellCode:(e,t)=>{let{cellId:n,code:i,formattingChange:o}=t;return e.cellData[n]?ms({state:e,cellId:n,cellReducer:l=>o?{...l,code:i,lastCodeRun:l.edited?l.lastCodeRun:i}:{...l,code:i,edited:i.trim()!==l.lastCodeRun}}):e},updateCellName:(e,t)=>{let{cellId:n,name:i}=t;return ms({state:e,cellId:n,cellReducer:o=>({...o,name:i})})},updateCellConfig:(e,t)=>{let{cellId:n,config:i}=t;return ms({state:e,cellId:n,cellReducer:o=>({...o,config:sx({...o.config,...i})})})},prepareForRun:(e,t)=>ms({state:Al({state:e,cellId:t.cellId,cellReducer:n=>MP(n)}),cellId:t.cellId,cellReducer:n=>({...n,edited:!1,lastCodeRun:n.code.trim()})}),handleCellMessage:(e,t)=>{let n=t.cell_id,i=Al({state:e,cellId:n,cellReducer:o=>OP(o,t)});return t.status==="queued"&&(i=ms({state:i,cellId:n,cellReducer:o=>({...o,lastCodeRun:o.code.trim(),edited:!1})})),{...i,cellLogs:[...i.cellLogs,...eO(t)]}},addLogs:(e,t)=>({...e,cellLogs:[...e.cellLogs,...t.logs]}),setCellIds:(e,t)=>{if(JM(e.cellIds.inOrderIds,t.cellIds))return e;let n={...e.cellData},i={...e.cellRuntime},o={...e.cellHandles};for(let l of t.cellIds)l in e.cellData||(n[l]=Kr({id:l})),l in e.cellRuntime||(i[l]=Dr()),l in e.cellHandles||(o[l]=(0,Re.createRef)());return{...e,cellIds:al.fromWithPreviousShape(t.cellIds,e.cellIds),cellData:n,cellRuntime:i,cellHandles:o}},rebuildCellColumns:(e,t)=>{let n=al.fromIdsAndColumns(t.cellIds.map(i=>{var o;return[i,((o=e.cellData[i])==null?void 0:o.config.column)??null]}));return{...e,cellIds:n}},setCellCodes:(e,t)=>{var o,l;Vn(t.codes.length===t.ids.length,"Expected codes and ids to have the same length");let n={...e},i=({cell:u,code:d,cellId:p,name:g,config:w})=>{if(!u)return Kr({id:p,code:d,name:g,config:w,lastCodeRun:t.codeIsStale?null:d,edited:t.codeIsStale&&d.trim().length>0});let x=t.codeIsStale?u.lastCodeRun:d,S=x?x.trim()!==d.trim():!!d;if(u.code.trim()===d.trim())return{...u,code:d,edited:S,lastCodeRun:x,...g!==void 0&&{name:g},...w!==void 0&&{config:w}};if(!Q0()||!L0(p)){let E=n.cellHandles[p].current;E!=null&&E.editorViewOrNull&&Bo(E.editorViewOrNull,d)}return{...u,code:d,edited:S,lastCodeRun:x,...g!==void 0&&{name:g},...w!==void 0&&{config:w}}};for(let u=0;u<t.ids.length;u++){let d=t.ids[u],p=t.codes[u];if(d===void 0||p===void 0)continue;let g=(o=t.names)==null?void 0:o[u],w=(l=t.configs)==null?void 0:l[u];n={...n,cellData:{...n.cellData,[d]:i({cell:n.cellData[d],code:p,cellId:d,name:g,config:w})}}}return n},setStdinResponse:(e,t)=>{let{cellId:n,response:i,outputIndex:o}=t;return Al({state:e,cellId:n,cellReducer:l=>{let u=[...l.consoleOutputs],d=u[o];return d==null||d.channel!=="stdin"?(Se.warn("Expected stdin output"),l):(u[o]={channel:"stdin",mimetype:d.mimetype,data:d.data,timestamp:d.timestamp,response:i},{...l,interrupted:!1,consoleOutputs:u})}})},setCells:(e,t)=>{let n=Object.fromEntries(t.map(u=>[u.id,u])),i=Xd(),o=u=>{if(!i)return Dr();let d=e.cellRuntime[u];return d&&(d.output!=null||d.consoleOutputs.length>0)?d:Dr()},l=Object.fromEntries(t.map(u=>[u.id,o(u.id)]));return lx({...e,cellIds:al.fromIdsAndColumns(t.map(u=>[u.id,u.config.column])),cellData:n,cellRuntime:l,cellHandles:Object.fromEntries(t.map(u=>[u.id,(0,Re.createRef)()]))})},moveToNextCell:(e,t)=>{let{cellId:n,before:i,noCreate:o=!1}=t;if(n==="__scratch__")return e;let l=e.cellIds.findWithId(n),u=l.indexOfOrThrow(n),d=i?u-1:u+1,p=d===l.length,g=d===-1;if(p&&!o){let w=Xa.create();return{...e,cellIds:e.cellIds.insertId(w,l.id,d),cellData:{...e.cellData,[w]:Kr({id:w})},cellRuntime:{...e.cellRuntime,[w]:Dr()},cellHandles:{...e.cellHandles,[w]:(0,Re.createRef)()},scrollKey:w}}if(g&&!o){let w=Xa.create();return{...e,cellIds:e.cellIds.insertId(w,l.id,0),cellData:{...e.cellData,[w]:Kr({id:w})},cellRuntime:{...e.cellRuntime,[w]:Dr()},cellHandles:{...e.cellHandles,[w]:(0,Re.createRef)()},scrollKey:w}}if((p||g)&&o)return e;if(d>=0&&d<l.length){let w=l.atOrThrow(d);Rl({cellId:w,cell:e.cellHandles[w],isCodeHidden:Il(e,w),codeFocus:i?"bottom":"top",variableName:void 0})}return e},markTouched:(e,t)=>{let{cellId:n}=t;if(e.untouchedNewCells.has(n)){let i=new Set(e.untouchedNewCells);return i.delete(n),{...e,untouchedNewCells:i}}return e},markUntouched:(e,t)=>{let{cellId:n}=t;if(!e.untouchedNewCells.has(n)){let i=new Set(e.untouchedNewCells);return i.add(n),{...e,untouchedNewCells:i}}return e},scrollToTarget:e=>{let t=e.scrollKey;if(t===null)return e;let n=e.cellIds.findWithId(t),i=n.indexOfOrThrow(t),o=i===n.length-1?n.last():n.atOrThrow(i);return Rl({cellId:o,cell:e.cellHandles[o],isCodeHidden:Il(e,o),codeFocus:void 0,variableName:void 0}),{...e,scrollKey:null}},foldAll:e=>(v3(Object.values(e.cellHandles).map(t=>{var n;return(n=t.current)==null?void 0:n.editorView})),e),unfoldAll:e=>(b3(Object.values(e.cellHandles).map(t=>{var n;return(n=t.current)==null?void 0:n.editorView})),e),clearLogs:e=>({...e,cellLogs:[]}),collapseCell:(e,t)=>{let{cellId:n}=t,i=e.cellIds.findWithId(n),o=i.topLevelIds.map(d=>e.cellRuntime[d].outline),l=Q2(i.indexOfOrThrow(n),o);if(!l)return e;let u=i.atOrThrow(l[1]);return{...e,cellIds:e.cellIds.transformWithCellId(n,d=>d.collapse(n,u)),scrollKey:n}},expandCell:(e,t)=>{let{cellId:n}=t;return{...e,cellIds:e.cellIds.transformWithCellId(n,i=>i.expand(n)),scrollKey:n}},collapseAllCells:e=>({...e,cellIds:e.cellIds.transformAll(t=>{let n=t.topLevelIds.map(p=>e.cellRuntime[p].outline),i=[...t.nodes],o=[],l=[],u=i.length-1;for(;u>=0;){let p=Q2(u,n);if(p){let g=u,w=p[1],x=o.find(T=>T.start<=w&&T.end===w);x&&(w=x.start),o.push({start:g,end:w});let S=t.atOrThrow(g),E=t.atOrThrow(w);l.push({id:S,until:E})}else l.push(null);u--}let d=l.toReversed();return t.collapseAll(d)})}),expandAllCells:e=>({...e,cellIds:e.cellIds.transformAll(t=>t.expandAll())}),showCellIfHidden:(e,t)=>{let{cellId:n}=t,i=e.cellIds.findWithId(n),o=i,l=i.findAndExpandDeep(n);return l.equals(o)?e:{...e,cellIds:e.cellIds.transformWithCellId(n,()=>l)}},splitCell:(e,t)=>{var w;let{cellId:n}=t,i=e.cellIds.findWithId(n),o=i.indexOfOrThrow(n),l=e.cellData[n],u=e.cellHandles[n].current;if((u==null?void 0:u.editorView)==null)return e;let{beforeCursorCode:d,afterCursorCode:p}=kP(u.editorView);Bo(u.editorView,d);let g=Xa.create();return{...e,cellIds:e.cellIds.insertId(g,i.id,o+1),cellData:{...e.cellData,[n]:{...l,code:d,edited:!!d&&d.trim()!==((w=l.lastCodeRun)==null?void 0:w.trim())},[g]:Kr({id:g,code:p,edited:!!p})},cellRuntime:{...e.cellRuntime,[n]:{...e.cellRuntime[n],output:null,consoleOutputs:[]},[g]:Dr()},cellHandles:{...e.cellHandles,[g]:(0,Re.createRef)()},scrollKey:g}},undoSplitCell:(e,t)=>{var u;let{cellId:n,snapshot:i}=t,o=e.cellData[n],l=e.cellHandles[n].current;return(l==null?void 0:l.editorView)==null?e:(Bo(l.editorView,i),{...e,cellIds:e.cellIds.transformWithCellId(n,d=>{let p=d.indexOfOrThrow(n)+1;return d.deleteAtIndex(p)}),cellData:{...e.cellData,[n]:{...o,code:i,edited:!!i&&(i==null?void 0:i.trim())!==((u=o.lastCodeRun)==null?void 0:u.trim())}},cellRuntime:{...e.cellRuntime,[n]:{...e.cellRuntime[n],output:null,consoleOutputs:[]}},cellHandles:{...e.cellHandles}})},clearCellOutput:(e,t)=>{let{cellId:n}=t;return Al({state:e,cellId:n,cellReducer:i=>({...i,output:null,consoleOutputs:[]})})},clearCellConsoleOutput:(e,t)=>{let{cellId:n}=t;return Al({state:e,cellId:n,cellReducer:i=>({...i,consoleOutputs:i.consoleOutputs.filter(o=>o.channel==="stdin"&&o.response==null)})})},clearAllCellOutputs:e=>{let t={...e.cellRuntime};for(let n of e.cellIds.inOrderIds)t[n]={...t[n],output:null,consoleOutputs:[]};return{...e,cellRuntime:t}},addSetupCellIfDoesntExist:(e,t)=>{let{code:n}=t;return e.cellIds.setupCellExists()?{...e,scrollKey:Rr}:{...e,cellIds:e.cellIds.insertId(Rr,e.cellIds.atOrThrow(0).id,0),cellData:{...e.cellData,[Rr]:Kr({id:Rr,name:Rr,code:n,edited:!!n})},cellRuntime:{...e.cellRuntime,[Rr]:Dr()},cellHandles:{...e.cellHandles,[Rr]:(0,Re.createRef)()},scrollKey:Rr}}})),ux(WP);function Il(e,t){return!!e.cellData[t].config.hide_code&&!e.untouchedNewCells.has(t)}function Al({state:e,cellId:t,cellReducer:n}){return t in e.cellRuntime?{...e,cellRuntime:{...e.cellRuntime,[t]:n(e.cellRuntime[t])}}:(Se.warn(`Cell ${t} not found in state`),e)}function ms({state:e,cellId:t,cellReducer:n}){return t in e.cellData?{...e,cellData:{...e.cellData,[t]:n(e.cellData[t])}}:(Se.warn(`Cell ${t} not found in state`),e)}dT=function(e){let t=e.cellData,n={column:null};return e.cellIds.getColumns().length>1?e.cellIds.getColumns().flatMap((i,o)=>i.inOrderIds.map((l,u)=>{let d={...n};return u===0&&(d.column=o),{...t[l].config,...d}})):e.cellIds.getColumns().flatMap(i=>i.inOrderIds.map(o=>({...t[o].config,...n})))};let px;px=dx(e=>{Me.set(ft,t=>cx(t,e))}).addLogs,Mc=Ne(e=>e(ft).cellIds),uE=Ne(e=>e(Mc).hasOnlyOneId()),PE=Ne(e=>uy(e(ft)).length>0),Ne(e=>f0(e(ft)).length>0);let Sm,mx;lT=Ne(e=>gD(e(ft))),YS=Ne(e=>yD(e(ft))),mT=Ne(e=>hD(e(ft))),Sm=Ne(e=>{let{cellIds:t,cellRuntime:n,cellData:i}=e(ft);return t.inOrderIds.map(o=>{var d;let l=n[o],{name:u}=i[o];if(Sc((d=l.output)==null?void 0:d.mimetype)){Vn(Array.isArray(l.output.data),"Expected array data");let p=l.output.data.filter(g=>!g.type.includes("ancestor"));if(p.length>0)return{output:{...l.output,data:p},cellId:o,cellName:u}}return null}).filter(Boolean)}),bT=Ne(e=>{let{cellIds:t,cellRuntime:n}=e(ft);return DP(t.inOrderIds.map(i=>n[i].outline))}),tT=Ne(e=>e(Sm).length),mx=XM(Ne(e=>{let{cellIds:t,cellData:n}=e(ft);return ki.fromEntries(t.inOrderIds.map(i=>{var o;return[i,(o=n[i])==null?void 0:o.name]}))}));var sO=Ne(e=>e(ft).scrollKey);IS=()=>$n(ft),qE=()=>$n(Mc),FS=()=>$n(mx),FE=()=>$n(Sm),zS=()=>$n(ft).cellLogs,PS=()=>$n(sO),Lf=()=>Me.get(ft),JE=()=>Me.get(ft).cellIds,RE=()=>{let{cellIds:e,cellData:t}=Me.get(ft);return e.inOrderIds.map(n=>{var i;return(i=t[n])==null?void 0:i.name}).filter(Boolean)};var lO=d3(o3(ft,e=>e.cellIds.inOrderIds.map(t=>e.cellData[t])));$S=()=>LC(lO),mE=Ne(e=>e(ft).cellRuntime),vE=Ne(e=>pD(e(ft))),yT=Ne(e=>{let{cellRuntime:t}=e(ft);return Object.entries(t).every(([n,i])=>i.status!=="running"||n==="__scratch__")}),XS=Ne(e=>mD(e(ft))),_S=Ne(e=>e(ft).cellIds.colLength),ME=Ne(e=>e(ft).cellIds.idLength>0),QE=Ne(e=>e(ft).cellIds.getColumnIds()),Pf=Jf(e=>Ne(t=>t(ft).cellData[e]));var Em=Jf(e=>Ne(t=>t(ft).cellRuntime[e]));const hx=Jf(e=>Ne(t=>t(ft).cellHandles[e]));function cO(e){Pf.remove(e),Em.remove(e),hx.remove(e)}CS=e=>{let t=(0,Pu.c)(2),n;return t[0]===e?n=t[1]:(n=Pf(e),t[0]=e,t[1]=n),$n(n)},WS=e=>{let t=(0,Pu.c)(2),n;return t[0]===e?n=t[1]:(n=Em(e),t[0]=e,t[1]=n),$n(n)},yS=e=>{let t=(0,Pu.c)(2),n;return t[0]===e?n=t[1]:(n=hx(e),t[0]=e,t[1]=n),$n(n)},U0=()=>{let{cellIds:e,cellHandles:t}=Me.get(ft);return e.inOrderIds.map(n=>{var i,o;return(o=(i=t[n])==null?void 0:i.current)==null?void 0:o.editorViewOrNull}).filter(Boolean)},Cf=e=>{var n;let{cellHandles:t}=Me.get(ft);return(n=t[e].current)==null?void 0:n.editorView},_E=function(e){let{cellIds:t,cellData:n,cellRuntime:i}=e;return t.getColumns().flatMap(o=>o.topLevelIds.map(l=>({...n[l],...i[l]})))},iT=function(e){return Ne(t=>t(ft).untouchedNewCells.has(e))};function uO(e){let t=Em(e);return Ne(n=>{let i=n(t);if(!i||i.status==="queued"||i.status==="running")return;let o=[],l=i.consoleOutputs;if(l&&l.length>0){let d=l.find(p=>p.mimetype==="application/vnd.marimo+traceback");if(d){let p=d.data;o.push(...g0(p))}}let u=i.output;if((u==null?void 0:u.mimetype)==="application/vnd.marimo+error"){let d=u.data;if(Array.isArray(d))for(let p of d)p.type==="syntax"&&p.lineno!=null&&o.push({kind:"cell",cellId:e,lineNumber:p.lineno}),p.type==="import-star"&&p.lineno!=null&&o.push({kind:"cell",cellId:e,lineNumber:p.lineno})}return o.length>0?o:void 0})}TS=function(e){let t=(0,Pu.c)(2),n;return t[0]===e?n=t[1]:(n=e===void 0?{}:e,t[0]=e,t[1]=n),fx(n)}})();export{zg as $,hS as $i,tl as $n,gS as $r,Fg as $t,yS as A,Sc as Ai,$g as An,Vg as Ar,vS as At,bS as B,nl as Bi,wS as Bn,Hg as Br,xS as Bt,_S as C,kS as Ci,Ec as Cn,af as Cr,Bg as Ct,CS as D,SS as Di,ES as Dn,Fo as Dr,of as Dt,TS as E,DS as Ei,sf as En,Wg as Er,RS as Et,IS as F,$o as Fi,lf as Fn,Vo as Fr,cf as Ft,Ug as G,Kg as Gi,Qg as Gn,Gg as Gr,AS as Gt,Xg as H,LS as Hi,Tc as Hn,Jg as Hr,Yg as Ht,PS as I,uf as Ii,Zg as In,df as Ir,OS as It,e0 as J,MS as Ji,NS as Jn,t0 as Jr,ff as Jt,jS as K,Qa as Ki,pf as Kn,n0 as Kr,na as Kt,Kr as L,r0 as Li,Dc as Ln,i0 as Lr,qS as Lt,zS as M,a0 as Mi,Xn as Mn,o0 as Mr,s0 as Mt,FS as N,mf as Ni,Ee as Nn,l0 as Nr,Rc as Nt,$S as O,VS as Oi,HS as On,c0 as Or,BS as Ot,WS as P,US as Pi,rl as Pn,u0 as Pr,Tr as Pt,KS as Q,il as Qi,hf as Qn,Ho as Qr,d0 as Qt,Dr as R,Ic as Ri,QS as Rn,gf as Rr,GS as Rt,XS as S,yf as Sa,f0 as Si,ra as Sn,JS as Sr,vf as St,YS as T,p0 as Ti,ZS as Tn,m0 as Tr,h0 as Tt,eE as U,g0 as Ui,tE as Un,y0 as Ur,v0 as Ut,b0 as V,bf as Vi,nE as Vn,w0 as Vr,x0 as Vt,rE as W,_0 as Wi,iE as Wn,k0 as Wr,aE as Wt,C0 as X,oE as Xi,sE as Xn,lE as Xr,wf as Xt,S0 as Y,E0 as Yi,Ga as Yn,cE as Yr,Ei as Yt,T0 as Z,xf as Zi,Ac as Zn,Lc as Zr,_f as Zt,uE as _,q6 as __tla,dE as _a,Lt as _i,fE as _n,Pc as _r,pE as _t,mE as a,Oc as aa,hE as ai,D0 as an,gE as ar,yE as at,vE as b,R0 as ba,bE as bi,I0 as bn,wE as br,xE as bt,_E as c,kE as ca,A0 as ci,CE as cn,kf as cr,L0 as ct,Cf as d,Xa as da,Sf as di,Ef as dn,SE as dr,EE as dt,TE as ea,DE as ei,P0 as en,O0 as er,M0 as et,RE as f,IE as fa,AE as fi,LE as fn,Tf as fr,N0 as ft,PE as g,Df as ga,ia as gi,j0 as gn,OE as gr,Bo as gt,ME as h,Rr as ha,aa as hi,q0 as hn,Wo as hr,ci as ht,Mc as i,NE as ia,jE as ii,z0 as in,Rf as ir,F0 as it,qE as j,$0 as ji,zE as jn,V0 as jr,H0 as jt,FE as k,B0 as ki,If as kn,W0 as kr,$E as kt,U0 as l,VE as la,HE as li,K0 as ln,Af as lr,Q0 as lt,Lf as m,Uo as ma,BE as mi,WE as mn,ui as mr,G0 as mt,Pf as n,Nc as na,Of as ni,Mf as nn,UE as nr,KE as nt,QE as o,X0 as oa,J0 as oi,GE as on,XE as or,Y0 as ot,JE as p,lr as pa,YE as pi,jc as pn,Ko as pr,Z0 as pt,ey as q,al as qi,ZE as qn,ty as qr,eT as qt,tT as r,Jn as ra,nT as ri,rT as rn,ny as rr,Nf as rt,iT as s,jf as sa,ry as si,aT as sn,oT as sr,sT as st,lT as t,ol as ta,cT as ti,uT as tn,Ja as tr,iy as tt,dT as u,ay as ua,qc as ui,fT as un,zc as ur,pT as ut,mT as v,oy as va,oa as vi,hT as vn,sy as vr,gT as vt,yT as w,ly as wi,vT as wn,Fc as wr,cy as wt,bT as x,wT as xa,uy as xi,xT as xn,$c as xr,qf as xt,ft as y,_T as ya,kT as yi,dy as yn,Ya as yr,Ir as yt,CT as z,Vc as zi,fy as zn,sl as zr,ST as zt};
|