collabmd 0.1.34 → 0.1.35
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/client/assets/{CodeMirrorEditor-UCMRAMCV-Bg0dawOb.js → CodeMirrorEditor-UCMRAMCV-CvLFeHXu.js} +1 -1
- package/dist/client/assets/_baseFor-Bfo4esZ5.js +1 -0
- package/dist/client/assets/arc-tRoMuWFi.js +1 -0
- package/dist/client/assets/architecture-YZFGNWBL-CtU43_5T.js +1 -0
- package/dist/client/assets/{architectureDiagram-2XIMDMQ5-kYbOThe4.js → architectureDiagram-Q4EWVU46-CVdcOotN.js} +4 -4
- package/dist/client/assets/blockDiagram-DXYQGD6D-B_gNUKQ4.js +132 -0
- package/dist/client/assets/c4Diagram-AHTNJAMY-BSDwfduG.js +10 -0
- package/dist/client/assets/channel-BDb1g_mJ.js +1 -0
- package/dist/client/assets/chunk-2KRD3SAO-C6u8y11R.js +1 -0
- package/dist/client/assets/chunk-336JU56O-Ch9X5KoM.js +2 -0
- package/dist/client/assets/{chunk-HHEYEP7N-DlevL8bq.js → chunk-426QAEUC-CwJ7loGf.js} +1 -1
- package/dist/client/assets/chunk-4TB4RGXK-BEsauZP5.js +206 -0
- package/dist/client/assets/chunk-5FUZZQ4R-6x8SlhH9.js +62 -0
- package/dist/client/assets/chunk-5PVQY5BW-R5SE6dhE.js +2 -0
- package/dist/client/assets/chunk-67CJDMHE-CjXw5hFa.js +1 -0
- package/dist/client/assets/chunk-7N4EOEYR-DNHyuswJ.js +1 -0
- package/dist/client/assets/chunk-AA7GKIK3-DayE4IF_.js +1 -0
- package/dist/client/assets/chunk-BSJP7CBP-CexlYBxB.js +1 -0
- package/dist/client/assets/chunk-CIAEETIT-CkDJ4DYI.js +1 -0
- package/dist/client/assets/{chunk-KX2RTZJC-BTiOJb7N.js → chunk-EDXVE4YY-BVR_nF3y.js} +1 -1
- package/dist/client/assets/chunk-ENJZ2VHE-CFVWytAB.js +10 -0
- package/dist/client/assets/chunk-FOC6F5B3-DzCiCLGs.js +1 -0
- package/dist/client/assets/chunk-ICPOFSXX-B9LPHgU7.js +122 -0
- package/dist/client/assets/chunk-K5T4RW27-kmGSebVE.js +94 -0
- package/dist/client/assets/chunk-KGLVRYIC-DVjPRsaR.js +1 -0
- package/dist/client/assets/chunk-LIHQZDEY-DKFj13sC.js +1 -0
- package/dist/client/assets/chunk-NU2UP6EN-UVL-wkIc.js +35 -0
- package/dist/client/assets/chunk-ORNJ4GCN-D0uTAC-5.js +1 -0
- package/dist/client/assets/{chunk-NQ4KR5QH-CMJKI6Oj.js → chunk-OYMX7WX6-nWiNHNyD.js} +25 -14
- package/dist/client/assets/{chunk-PU5JKC2W-D_6N6t8f.js → chunk-U2HBQHQK-Bue4Ufzn.js} +6 -6
- package/dist/client/assets/{chunk-PQ6SQG4A-D1AbThjy.js → chunk-X2U36JSP-CRE6lp7n.js} +1 -1
- package/dist/client/assets/{chunk-XPW4576I-DJr4_4Yy.js → chunk-XPW4576I-BL5M-tF8.js} +1 -1
- package/dist/client/assets/{chunk-JSJVCQXG-DPQ9cPJt.js → chunk-YZCP3GAM-D7Z5wUWA.js} +1 -1
- package/dist/client/assets/chunk-ZZ45TVLE-CBbl1Qec.js +1 -0
- package/dist/client/assets/classDiagram-6PBFFD2Q-MIbgV5UL.js +1 -0
- package/dist/client/assets/classDiagram-v2-HSJHXN6E-Bb70vg2O.js +1 -0
- package/dist/client/assets/clike-BFTLRaGS.js +1 -0
- package/dist/client/assets/clone-D6JWrlxJ.js +1 -0
- package/dist/client/assets/{coffeescript-B_7eyHAa.js → coffeescript-B7GZajzV.js} +1 -1
- package/dist/client/assets/{cose-bilkent-S5V4N54A-DASO2hrk.js → cose-bilkent-S5V4N54A-xxgR5OJ-.js} +1 -1
- package/dist/client/assets/{cypher-DE6I2lIA.js → cypher-DEGl2llJ.js} +1 -1
- package/dist/client/assets/cytoscape.esm-B3PRdePO.js +321 -0
- package/dist/client/assets/{d-BNkKjn0o.js → d-BspB0dox.js} +1 -1
- package/dist/client/assets/dagre-KV5264BT-C2K9mFg1.js +4 -0
- package/dist/client/assets/dagre-VaFYRFbD.js +1 -0
- package/dist/client/assets/diagram-5BDNPKRD-DE0M0jaM.js +10 -0
- package/dist/client/assets/diagram-G4DWMVQ6-BfaRuSTT.js +24 -0
- package/dist/client/assets/diagram-MMDJMWI5-91Bly_hN.js +43 -0
- package/dist/client/assets/diagram-TYMM5635-fBkLwZGN.js +24 -0
- package/dist/client/assets/{dist-BzpfHRaE.js → dist-74GtnE06.js} +1 -1
- package/dist/client/assets/dist-B3lARV_e.js +1 -0
- package/dist/client/assets/{dist-O1z0Ayg0.js → dist-BCvzlTeb.js} +1 -1
- package/dist/client/assets/{dist-DsL7sqZR.js → dist-BMlUxhOz.js} +1 -1
- package/dist/client/assets/dist-BSED50tI.js +13 -0
- package/dist/client/assets/{dist-B-02vKOA.js → dist-Bkn7JaJv.js} +1 -1
- package/dist/client/assets/dist-Bq8Z0WUT.js +1 -0
- package/dist/client/assets/{dist-E_jPb93e.js → dist-Bzb9nPam.js} +1 -1
- package/dist/client/assets/{dist-CL-jjdvG.js → dist-C0e9kfNh.js} +1 -1
- package/dist/client/assets/dist-C8wdW7W4.js +1 -0
- package/dist/client/assets/dist-CDUQ5ELn.js +1 -0
- package/dist/client/assets/dist-CHSg_nUM.js +1 -0
- package/dist/client/assets/dist-CSAH9iuE.js +6 -0
- package/dist/client/assets/{dist-CxfohGIV.js → dist-CSNMpi-w.js} +1 -1
- package/dist/client/assets/dist-CZPTvk_g2.js +1 -0
- package/dist/client/assets/{dist-k47-Io7D.js → dist-Co8HE14w.js} +1 -1
- package/dist/client/assets/{dist-Bc2ND6i3.js → dist-CqU98NzX.js} +1 -1
- package/dist/client/assets/{dist-BzbYwa8m.js → dist-D0dQAc9b.js} +1 -1
- package/dist/client/assets/{dist-Dyt7n5Ui.js → dist-D1-dK0Dk.js} +1 -1
- package/dist/client/assets/{dist-B4uQVR_X.js → dist-DAKGEzm0.js} +1 -1
- package/dist/client/assets/dist-DBzteOlY.js +1 -0
- package/dist/client/assets/{dist-CjII8VDS.js → dist-DSRCADL9.js} +1 -1
- package/dist/client/assets/{dist-lDhnP-K1.js → dist-DdR2aYqj.js} +1 -1
- package/dist/client/assets/{dist-DUvaQ-Bj.js → dist-DidT3Jay.js} +1 -1
- package/dist/client/assets/dist-Doo91MTa.js +1 -0
- package/dist/client/assets/{dist-BLAlZer_.js → dist-Dwy75xI6.js} +1 -1
- package/dist/client/assets/{dist-3uAMa5w5.js → dist-FC9LftvP.js} +1 -1
- package/dist/client/assets/{dist-CGV1S_as.js → dist-PPAeaw4t.js} +1 -1
- package/dist/client/assets/{dist-BtnXjRx0.js → dist-VPEWg0Ob.js} +1 -1
- package/dist/client/assets/{dist-CXpKYW9s.js → dist-cQSK4Xor.js} +1 -1
- package/dist/client/assets/{dist-rMhng5DK.js → dist-r5I9Jgww.js} +1 -1
- package/dist/client/assets/drawio-editor-CWLEpwps.js +9 -0
- package/dist/client/assets/{drawioEditor-D6clB5OH.js → drawioEditor-5rJhxjA4.js} +2 -2
- package/dist/client/assets/{ecl-M7Iek4lq.js → ecl-D9rhJ9-u.js} +1 -1
- package/dist/client/assets/{editor-session-Dzy_85Wp.js → editor-session-CLOuvy37.js} +3 -3
- package/dist/client/assets/{erDiagram-INFDFZHY-DlIf-fb7.js → erDiagram-SMLLAGMA-DUQcqEQ1.js} +33 -18
- package/dist/client/assets/excalidraw-editor-ukEKPqGJ.js +9 -0
- package/dist/client/assets/{excalidraw-mermaid-stub-Bwe-bKcT.js → excalidraw-mermaid-stub-Df0Q2qkW.js} +1 -1
- package/dist/client/assets/excalidraw-scene-CDK3oDnm.js +176 -0
- package/dist/client/assets/excalidrawEditor-BJ8QLmWc.js +2 -0
- package/dist/client/assets/{export-page-PeexH2QK.js → export-page-D2rCmrUH.js} +2 -2
- package/dist/client/assets/exportDocument-Dunnjgii.js +2 -0
- package/dist/client/assets/{fcl-BWKK0S4-.js → fcl-CUXJFJn1.js} +1 -1
- package/dist/client/assets/flatten-CX_XvnUf.js +1 -0
- package/dist/client/assets/flowDiagram-DWJPFMVM-B_A5JyId.js +162 -0
- package/dist/client/assets/ganttDiagram-T4ZO3ILL-HM3CD7bk.js +292 -0
- package/dist/client/assets/gitGraph-7Q5UKJZL-BrBlB49D.js +1 -0
- package/dist/client/assets/gitGraphDiagram-UUTBAWPF-Dw7twZDm.js +106 -0
- package/dist/client/assets/graphlib-DDD4Vdye.js +1 -0
- package/dist/client/assets/{groovy-BEKazBrO.js → groovy-Di--Vb9Z.js} +1 -1
- package/dist/client/assets/{haxe-BY9d_5nB.js → haxe-CcPA1xnA.js} +1 -1
- package/dist/client/assets/image-XLNPCCAD-BFNybKza.js +1 -0
- package/dist/client/assets/{image-blob-reduce.esm-DriR2zT9.js → image-blob-reduce.esm-DiuPkovC.js} +1 -1
- package/dist/client/assets/{index-BLrtj9YM.js → index-BbziNMqE.js} +2 -2
- package/dist/client/assets/info-OMHHGYJF-BcmgcSx1.js +1 -0
- package/dist/client/assets/{infoDiagram-LFFYTUFH-DFTI0nfs.js → infoDiagram-42DDH7IO-DX-d3DMp.js} +1 -1
- package/dist/client/assets/isEmpty-BKDbo1FH.js +1 -0
- package/dist/client/assets/ishikawaDiagram-UXIWVN3A-BHmsxpMs.js +70 -0
- package/dist/client/assets/{javascript-CdiVhQeA.js → javascript-gTK9fxz6.js} +1 -1
- package/dist/client/assets/javascript-qUBHINSy.js +1 -0
- package/dist/client/assets/{journeyDiagram-4ABVD52K-DDur6iHm.js → journeyDiagram-VCZTEJTY-jxDSjgE1.js} +2 -2
- package/dist/client/assets/{jsx-runtime-C2p7wRmT.js → jsx-runtime-B_8UNt-W.js} +1 -1
- package/dist/client/assets/{kanban-definition-K7BYSVSG-dA6NPLsg.js → kanban-definition-6JOO6SKY-od3qY1mE.js} +2 -2
- package/dist/client/assets/line-CZsGUM4H.js +1 -0
- package/dist/client/assets/{lua-kutgyRGY.js → lua-Cg0FqIlO.js} +1 -1
- package/dist/client/assets/main-CN0kbtGk.js +1369 -0
- package/dist/client/assets/mermaid-parser.core-DtIbxv6L.js +4 -0
- package/dist/client/assets/mermaid-runtime-vVJfjscE.js +11 -0
- package/dist/client/assets/{mindmap-definition-YRQLILUH-DjQcsPoe.js → mindmap-definition-QFDTVHPH-C9qrdAqo.js} +39 -11
- package/dist/client/assets/packet-4T2RLAQJ-DYYSvRuJ.js +1 -0
- package/dist/client/assets/pica-BEurQXMu.js +2 -0
- package/dist/client/assets/pie-ZZUOXDRM-cG65Mc64.js +1 -0
- package/dist/client/assets/pieDiagram-DEJITSTG-BHXxj7wl.js +30 -0
- package/dist/client/assets/{preview-render-compiler-BjLlHmiQ.js → preview-render-compiler-BHeDhYho.js} +2 -2
- package/dist/client/assets/preview-render-compiler-D3QM1Ryz.js +1 -0
- package/dist/client/assets/{preview-render-profile-CR4dJZrp.js → preview-render-profile-BF6os3x9.js} +5 -5
- package/dist/client/assets/{preview-render-worker-B4dH2yxj.js → preview-render-worker-C4AFtMIr.js} +6 -6
- package/dist/client/assets/{pug-DkUcLYWt.js → pug-lkTEco3G.js} +1 -1
- package/dist/client/assets/{python-CZtTmYkS.js → python-BUyhM0Ew.js} +1 -1
- package/dist/client/assets/{q-I27iQntV.js → q-Dls1OX0D.js} +1 -1
- package/dist/client/assets/{quadrantDiagram-337W2JSQ-CYKgdx7K.js → quadrantDiagram-34T5L4WZ-CWW7LORF.js} +1 -1
- package/dist/client/assets/{quick-switcher-controller-DcyllYpm.js → quick-switcher-controller-B1erSgJ1.js} +1 -1
- package/dist/client/assets/{r-DN_EydfL.js → r-DeZ8Mdev.js} +1 -1
- package/dist/client/assets/radar-PYXPWWZC-Bmpup_xw.js +1 -0
- package/dist/client/assets/reduce-C6FuFJbE.js +1 -0
- package/dist/client/assets/requirementDiagram-MS252O5E-CTljNdQH.js +84 -0
- package/dist/client/assets/{room-yJaBAoEU.js → room-DI7DXGeS.js} +1 -1
- package/dist/client/assets/{sankeyDiagram-WA2Y5GQK-CfHe3D6R.js → sankeyDiagram-XADWPNL6-CCfFkC74.js} +1 -1
- package/dist/client/assets/sequenceDiagram-FGHM5R23-BD9vj6WG.js +157 -0
- package/dist/client/assets/{sparql-BOvq0dv7.js → sparql-vm8qNO8J.js} +1 -1
- package/dist/client/assets/sql-GL7dVWcd.js +1 -0
- package/dist/client/assets/stateDiagram-FHFEXIEX-CpiX3KPd.js +1 -0
- package/dist/client/assets/stateDiagram-v2-QKLJ7IA2-D_5ufPqT.js +1 -0
- package/dist/client/assets/{swift-BCxe4-cw.js → swift-CKcKnWv9.js} +1 -1
- package/dist/client/assets/timeline-definition-GMOUNBTQ-BafRAkSF.js +120 -0
- package/dist/client/assets/treeView-SZITEDCU-NbjhK5cw.js +1 -0
- package/dist/client/assets/treemap-W4RFUUIX-DJzRbb-x.js +1 -0
- package/dist/client/assets/{turtle-GBz_E4RG.js → turtle-BkP3ExOG.js} +1 -1
- package/dist/client/assets/{vault-api-client-p7h7cXKM.js → vault-api-client-DSx3mWkH.js} +1 -1
- package/dist/client/assets/{vault-utils-5Xr0MXCb.js → vault-utils-CRpy8MQz.js} +1 -1
- package/dist/client/assets/vennDiagram-DHZGUBPP-DSngq_Zj.js +34 -0
- package/dist/client/assets/{verilog-C4wTycyo.js → verilog-DSARZZPc.js} +1 -1
- package/dist/client/assets/{vhdl-Bwndeg44.js → vhdl-CnYyYTpa.js} +1 -1
- package/dist/client/assets/wardley-RL74JXVD-DTNoH_BY.js +1 -0
- package/dist/client/assets/wardleyDiagram-NUSXRM2D-CAEd2kJG.js +20 -0
- package/dist/client/assets/{xychartDiagram-JWTSCODW-C3vA70iJ.js → xychartDiagram-5P7HB3ND-BScQpnru.js} +6 -6
- package/dist/client/assets/{yjs-provider-reset-guard-CtERLBID.js → yjs-provider-reset-guard-_Q3mj6tP.js} +1 -1
- package/dist/client/drawio-editor.html +1 -1
- package/dist/client/excalidraw-editor.html +1 -1
- package/dist/client/export-document.html +1 -1
- package/dist/client/index.html +1 -1
- package/package.json +11 -11
- package/src/client/application/app-shell/ui-feature-shell.js +5 -2
- package/src/client/application/quick-switcher-loader.js +39 -0
- package/src/client/bootstrap/collabmd-app-shell.js +16 -20
- package/src/client/domain/keyboard-shortcuts.js +8 -0
- package/src/client/drawio-editor.js +13 -0
- package/src/client/excalidraw-editor.js +13 -0
- package/src/client/infrastructure/excalidraw-room-client.js +1 -1
- package/src/client/infrastructure/workspace-sync-client.js +26 -3
- package/src/client/presentation/comment-ui/comment-ui-card.js +83 -3
- package/src/client/presentation/comment-ui/comment-ui-state.js +25 -2
- package/src/client/presentation/drawio-embed-controller.js +18 -0
- package/src/client/presentation/excalidraw-embed-controller.js +7 -0
- package/src/client/presentation/git-panel-controller.js +2 -0
- package/src/server/domain/backlink-index.js +33 -72
- package/src/server/domain/bases/base-index-snapshot-store.js +46 -62
- package/src/server/domain/markdown-reference-extractor.js +233 -0
- package/src/server/infrastructure/persistence/vault-file-store.js +39 -4
- package/src/server/infrastructure/workspace/file-system-sync-service.js +37 -11
- package/dist/client/assets/_basePickBy-Dv0sK1l7.js +0 -1
- package/dist/client/assets/_baseUniq-DKYX57ji.js +0 -1
- package/dist/client/assets/arc-DrfYGhWk.js +0 -1
- package/dist/client/assets/architecture-PBZL5I3N-DiglIZi9.js +0 -1
- package/dist/client/assets/blockDiagram-WCTKOSBZ-GIgTqnhk.js +0 -132
- package/dist/client/assets/c4Diagram-IC4MRINW-CkHO1i_L.js +0 -10
- package/dist/client/assets/channel-CgsU9TSN.js +0 -1
- package/dist/client/assets/chunk-7E7YKBS2-TdU92i9i.js +0 -1
- package/dist/client/assets/chunk-7R4GIKGN-mqd2GwMg.js +0 -80
- package/dist/client/assets/chunk-C72U2L5F-CJKQWBtz.js +0 -1
- package/dist/client/assets/chunk-EGIJ26TM-C4nq20om.js +0 -1
- package/dist/client/assets/chunk-GEFDOKGD-Bs7FmFox.js +0 -2
- package/dist/client/assets/chunk-GLR3WWYH-qQe2O5VQ.js +0 -2
- package/dist/client/assets/chunk-KYZI473N-CTSCuqRb.js +0 -53
- package/dist/client/assets/chunk-L3YUKLVL-CJZMBtKF.js +0 -1
- package/dist/client/assets/chunk-MX3YWQON-DQpSwRf6.js +0 -1
- package/dist/client/assets/chunk-NU2UP6EN-DlUENSHU.js +0 -35
- package/dist/client/assets/chunk-O4XLMI2P-CcVxZh41.js +0 -7
- package/dist/client/assets/chunk-OZEHJAEY-DjBZbgu0.js +0 -1
- package/dist/client/assets/chunk-R5LLSJPH-CkjKXM73.js +0 -1
- package/dist/client/assets/chunk-WL4C6EOR-axcuKSup.js +0 -189
- package/dist/client/assets/chunk-XIRO2GV7-4wqVHjs_.js +0 -1
- package/dist/client/assets/chunk-XZSTWKYB-C8Y_hIKZ.js +0 -94
- package/dist/client/assets/chunk-YBOYWFTD-CKg4ymFF.js +0 -1
- package/dist/client/assets/classDiagram-VBA2DB6C-BHZpvOxK.js +0 -1
- package/dist/client/assets/classDiagram-v2-RAHNMMFH-DA7HMUUs.js +0 -1
- package/dist/client/assets/clike-1_ZsiVV8.js +0 -1
- package/dist/client/assets/clone-Dgi8Z4IL.js +0 -1
- package/dist/client/assets/cytoscape.esm-Czjc507F.js +0 -321
- package/dist/client/assets/dagre-CfB3Fw33.js +0 -1
- package/dist/client/assets/dagre-KLK3FWXG-CC7tq2Ky.js +0 -4
- package/dist/client/assets/diagram-E7M64L7V-CMt7BN5M.js +0 -24
- package/dist/client/assets/diagram-IFDJBPK2-BFMBUGpd.js +0 -43
- package/dist/client/assets/diagram-P4PSJMXO-CviA1xXr.js +0 -24
- package/dist/client/assets/dist-3bQB_we3.js +0 -1
- package/dist/client/assets/dist-8Igu3Ee_2.js +0 -1
- package/dist/client/assets/dist-BU8uusJX.js +0 -1
- package/dist/client/assets/dist-BVB8rn7o.js +0 -1
- package/dist/client/assets/dist-D5QOYy7y.js +0 -6
- package/dist/client/assets/dist-DIi0uqLJ.js +0 -1
- package/dist/client/assets/dist-DJ16N7ol.js +0 -1
- package/dist/client/assets/dist-DWJL3_bF.js +0 -13
- package/dist/client/assets/dist-OQE68wIX.js +0 -1
- package/dist/client/assets/dist-x7PIEmJu.js +0 -1
- package/dist/client/assets/drawio-editor-BMTwP5mD.js +0 -9
- package/dist/client/assets/excalidraw-editor-CAP9F8CB.js +0 -9
- package/dist/client/assets/excalidraw-scene-BF_bT1OL.js +0 -176
- package/dist/client/assets/excalidrawEditor-DD4AvzYP.js +0 -2
- package/dist/client/assets/exportDocument-Zfwq1XVx.js +0 -2
- package/dist/client/assets/flowDiagram-PKNHOUZH-C_t-mkwb.js +0 -162
- package/dist/client/assets/ganttDiagram-A5KZAMGK-BtK9Tb--.js +0 -292
- package/dist/client/assets/gitGraph-HDMCJU4V-CT7YfbD3.js +0 -1
- package/dist/client/assets/gitGraphDiagram-K3NZZRJ6-DULDLGiJ.js +0 -65
- package/dist/client/assets/graphlib-BgRST-Qg.js +0 -1
- package/dist/client/assets/image-XLNPCCAD-CFiKwiWK.js +0 -1
- package/dist/client/assets/info-3K5VOQVL-DUpNyDC-.js +0 -1
- package/dist/client/assets/isArrayLikeObject-BId_dPHM.js +0 -1
- package/dist/client/assets/isEmpty-CVvRj8fj.js +0 -1
- package/dist/client/assets/ishikawaDiagram-PHBUUO56-DpBuDpC6.js +0 -70
- package/dist/client/assets/javascript-UJe68_xi.js +0 -1
- package/dist/client/assets/line-B2GMovaI.js +0 -1
- package/dist/client/assets/main-CfSHaGes.js +0 -1368
- package/dist/client/assets/math-B-LMBwub.js +0 -1
- package/dist/client/assets/mermaid-parser.core-B1ogGcR8.js +0 -4
- package/dist/client/assets/mermaid-runtime-Bn8A6DGx.js +0 -11
- package/dist/client/assets/packet-RMMSAZCW-DEwNbIrA.js +0 -1
- package/dist/client/assets/pica-C1TdTz-C.js +0 -2
- package/dist/client/assets/pie-UPGHQEXC-D5M_lSjo.js +0 -1
- package/dist/client/assets/pieDiagram-SKSYHLDU-jhHouFpk.js +0 -30
- package/dist/client/assets/preview-render-compiler-Duy_3IcP.js +0 -1
- package/dist/client/assets/radar-KQ55EAFF-AU1qh3Bw.js +0 -1
- package/dist/client/assets/requirementDiagram-Z7DCOOCP-D9SHxoW7.js +0 -73
- package/dist/client/assets/sequenceDiagram-2WXFIKYE-CZsMMqAJ.js +0 -145
- package/dist/client/assets/sql-DDFeQNTK.js +0 -1
- package/dist/client/assets/stateDiagram-RAJIS63D-CoNZjTYV.js +0 -1
- package/dist/client/assets/stateDiagram-v2-FVOUBMTO-1zOw6NmQ.js +0 -1
- package/dist/client/assets/timeline-definition-YZTLITO2-DSe2mrG8.js +0 -61
- package/dist/client/assets/treemap-KZPCXAKY-C9UI2fwP.js +0 -1
- package/dist/client/assets/vennDiagram-LZ73GAT5-xSzaIpy1.js +0 -34
- /package/dist/client/assets/{chunk-55IACEB6-CpncB3ru.js → chunk-55IACEB6-DLqevMSj.js} +0 -0
- /package/dist/client/assets/{chunk-QZHKN3VN-CgLPFSk5.js → chunk-QZHKN3VN-BnOS2iQW.js} +0 -0
- /package/dist/client/assets/{drawio-room-DEivFyNV.js → drawio-room-1i6Nn0_Z.js} +0 -0
- /package/dist/client/assets/{excalidraw-mermaid-stub-BZPU4ZhU.js → excalidraw-mermaid-stub-DzxtBcQW.js} +0 -0
- /package/dist/client/assets/{file-kind-DBptLlF_.js → file-kind-DmKq2MvD.js} +0 -0
- /package/dist/client/assets/{preview-diagram-utils-COt-IYMD.js → preview-diagram-utils-D8VypUft.js} +0 -0
- /package/dist/client/assets/{rough.esm-DE_lJ5Ge.js → rough.esm-BU2knLt9.js} +0 -0
- /package/dist/client/assets/{runtime-config-CqhchMC4.js → runtime-config-DWTejofP.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as e,N as t,P as n,_ as r,m as i,o as a,r as o,y as s}from"./dist-
|
|
1
|
+
import{C as e,N as t,P as n,_ as r,m as i,o as a,r as o,y as s}from"./dist-BSED50tI.js";import{r as c}from"./dist-BCvzlTeb.js";var l={__proto__:null,anyref:34,dataref:34,eqref:34,externref:34,i31ref:34,funcref:34,i8:34,i16:34,i32:34,i64:34,f32:34,f64:34},u=c.deserialize({version:14,states:`!^Q]QPOOOqQPO'#CbOOQO'#Cd'#CdOOQO'#Cl'#ClOOQO'#Ch'#ChQ]QPOOOOQO,58|,58|OxQPO,58|OOQO-E6f-E6fOOQO1G.h1G.h`,stateData:`!P~O_OSPOSQOS~OTPOVROXROYROZROaQO~OSUO~P]OSXO~P]O`,goto:`xaPPPPPPbPbPPPhPPPrXROPTVQTOQVPTWTVXSOPTV`,nodeNames:`⚠ LineComment BlockComment Module ) ( App Identifier Type Keyword Number String`,maxTerm:17,nodeProps:[[`isolate`,-3,1,2,11,``],[`openedBy`,4,`(`],[`closedBy`,5,`)`],[`group`,-6,6,7,8,9,10,11,`Expression`]],skippedNodes:[0,1,2],repeatNodeCount:1,tokenData:"0o~R^XY}YZ}]^}pq}rs!Stu#pxy'Uyz(e{|(j}!O(j!Q!R(s!R![*p!]!^.^#T#o.{~!SO_~~!VVOr!Srs!ls#O!S#O#P!q#P;'S!S;'S;=`#j<%lO!S~!qOZ~~!tRO;'S!S;'S;=`!};=`O!S~#QWOr!Srs!ls#O!S#O#P!q#P;'S!S;'S;=`#j;=`<%l!S<%lO!S~#mP;=`<%l!S~#siqr%bst%btu%buv%bvw%bwx%bz{%b{|%b}!O%b!O!P%b!P!Q%b!Q![%b![!]%b!^!_%b!_!`%b!`!a%b!a!b%b!b!c%b!c!}%b#Q#R%b#R#S%b#S#T%b#T#o%b#p#q%b#r#s%b~%giV~qr%bst%btu%buv%bvw%bwx%bz{%b{|%b}!O%b!O!P%b!P!Q%b!Q![%b![!]%b!^!_%b!_!`%b!`!a%b!a!b%b!b!c%b!c!}%b#Q#R%b#R#S%b#S#T%b#T#o%b#p#q%b#r#s%b~'ZPT~!]!^'^~'aTO!]'^!]!^'p!^;'S'^;'S;=`(_<%lO'^~'sVOy'^yz(Yz!]'^!]!^'p!^;'S'^;'S;=`(_<%lO'^~(_OQ~~(bP;=`<%l'^~(jOS~~(mQ!Q!R(s!R![*p~(xUY~!O!P)[!Q![*p!g!h){#R#S+U#X#Y){#l#m+[~)aRY~!Q![)j!g!h){#X#Y){~)oSY~!Q![)j!g!h){#R#S*j#X#Y){~*OR{|*X}!O*X!Q![*_~*[P!Q![*_~*dQY~!Q![*_#R#S*X~*mP!Q![)j~*uTY~!O!P)[!Q![*p!g!h){#R#S+U#X#Y){~+XP!Q![*p~+_R!Q![+h!c!i+h#T#Z+h~+mVY~!O!P,S!Q![+h!c!i+h!r!s-P#R#S+[#T#Z+h#d#e-P~,XTY~!Q![,h!c!i,h!r!s-P#T#Z,h#d#e-P~,mUY~!Q![,h!c!i,h!r!s-P#R#S.Q#T#Z,h#d#e-P~-ST{|-c}!O-c!Q![-o!c!i-o#T#Z-o~-fR!Q![-o!c!i-o#T#Z-o~-tSY~!Q![-o!c!i-o#R#S-c#T#Z-o~.TR!Q![,h!c!i,h#T#Z,h~.aP!]!^.d~.iSP~OY.dZ;'S.d;'S;=`.u<%lO.d~.xP;=`<%l.d~/QiX~qr.{st.{tu.{uv.{vw.{wx.{z{.{{|.{}!O.{!O!P.{!P!Q.{!Q![.{![!].{!^!_.{!_!`.{!`!a.{!a!b.{!b!c.{!c!}.{#Q#R.{#R#S.{#S#T.{#T#o.{#p#q.{#r#s.{",tokenizers:[0],topRules:{Module:[0,3]},specialized:[{term:9,get:e=>l[e]||-1}],tokenPrec:0}),d=o.define({name:`wast`,parser:u.configure({props:[e.add({App:i({closing:`)`,align:!1})}),s.add({App:r,BlockComment(e){return{from:e.from+2,to:e.to-2}}}),t({Keyword:n.keyword,Type:n.typeName,Number:n.number,String:n.string,Identifier:n.variableName,LineComment:n.lineComment,BlockComment:n.blockComment,"( )":n.paren})]}),languageData:{commentTokens:{line:`;;`,block:{open:`(;`,close:`;)`}},closeBrackets:{brackets:[`(`,`"`]}}});function f(){return new a(d)}export{f as wast};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/* empty css */import{n as e,r as t,t as n}from"./vault-api-client-DSx3mWkH.js";import{f as r,n as i}from"./runtime-config-DWTejofP.js";import{n as ee,r as te,t as a}from"./yjs-provider-reset-guard-_Q3mj6tP.js";import{n as o,t as s}from"./drawio-room-1i6Nn0_Z.js";var c=4e3;function l(e,t=0){let n=Number(e);return Number.isFinite(n)?n:t}var u=class{constructor({clearIntervalFn:e=e=>window.clearInterval(e),filePath:t=``,heartbeatIntervalMs:n=s,now:i=()=>Date.now(),onStateChange:a=()=>{},resolveWsBaseUrlFn:l=r,roomName:u=``,setIntervalFn:d=(e,t)=>window.setInterval(e,t),setTimeoutFn:f=(e,t)=>window.setTimeout(e,t),staleLeaseMs:p=o,syncTimeoutMs:m=c,websocketProviderFactory:h=(e,t,n,r)=>new ee(e,t,n,r),ydocFactory:g=()=>new te}){this.clearIntervalFn=e,this.filePath=t,this.heartbeatIntervalMs=n,this.now=i,this.onStateChange=a,this.resolveWsBaseUrlFn=l,this.roomName=u,this.setIntervalFn=d,this.setTimeoutFn=f,this.staleLeaseMs=p,this.syncTimeoutMs=m,this.websocketProviderFactory=h,this.ydocFactory=g,this.ydoc=null,this.provider=null,this.awareness=null,this.leaseMap=null,this.statusMap=null,this.localUser=null,this.localMode=`viewer`,this.heartbeatTimer=null,this.currentState=this.createState(),this.handleLeaseChange=()=>this.emitState(),this.handleStatusChange=()=>this.emitState(),this.handleAwarenessChange=()=>this.emitState()}createState(e={}){return{acquiredAt:0,canClaim:!1,hasHealthyHolder:!1,heartbeatAt:0,holderClientId:``,holderName:``,holderPeerId:``,isEditor:!1,isStale:!0,mode:`viewer`,savedAt:0,savedVersion:0,...e}}async connect({initialUser:e=null,requestedMode:t=`edit`}={}){return this.localUser=e??null,this.localMode=`viewer`,this.roomName?(this.ydoc=this.ydocFactory(),this.provider=this.websocketProviderFactory(this.resolveWsBaseUrlFn(),this.roomName,this.ydoc,{disableBc:!0,maxBackoffTime:5e3}),a(this.provider),this.awareness=this.provider.awareness,this.leaseMap=this.ydoc.getMap(`lease`),this.statusMap=this.ydoc.getMap(`status`),this.setLocalAwareness({mode:`viewer`}),this.leaseMap.observe(this.handleLeaseChange),this.statusMap.observe(this.handleStatusChange),this.awareness.on(`change`,this.handleAwarenessChange),await this.waitForSync(),t===`edit`?this.tryAcquireLease():this.emitState(),this.currentState):(this.currentState=this.createState(),this.onStateChange(this.currentState),this.currentState)}waitForSync(){return this.provider?new Promise(e=>{let t=!1,n=this.setTimeoutFn(()=>{t||(t=!0,this.provider.off?.(`sync`,r),e(!1))},this.syncTimeoutMs),r=i=>{!i||t||(t=!0,clearTimeout(n),this.provider.off?.(`sync`,r),e(!0))};this.provider.on?.(`sync`,r)}):Promise.resolve(!1)}setLocalUser(e=null){return this.localUser=e??null,this.setLocalAwareness({mode:this.currentState.isEditor?`editor`:`viewer`}),this.localUser}setLocalAwareness({mode:e=`viewer`}={}){this.localMode=e,this.awareness&&this.awareness.setLocalStateField(`drawio`,{filePath:this.filePath,mode:e,name:this.localUser?.name||``,peerId:this.localUser?.peerId||``})}getLocalClientId(){return this.ydoc?String(this.ydoc.clientID):``}getLeaseSnapshot(){return{acquiredAt:l(this.leaseMap?.get(`acquiredAt`)),heartbeatAt:l(this.leaseMap?.get(`heartbeatAt`)),holderClientId:String(this.leaseMap?.get(`holderClientId`)||``),holderName:String(this.leaseMap?.get(`holderName`)||``),holderPeerId:String(this.leaseMap?.get(`holderPeerId`)||``)}}findHolderAwarenessState(e){if(!e||!this.awareness)return null;for(let[t,n]of this.awareness.getStates())if(String(t)===String(e)&&n?.drawio?.filePath===this.filePath)return n.drawio;return null}isLeaseStale(e=this.getLeaseSnapshot()){return!e.holderClientId||!this.findHolderAwarenessState(e.holderClientId)?!0:this.now()-e.heartbeatAt>this.staleLeaseMs}isLeaseHeldByLocal(e=this.getLeaseSnapshot()){return!!e.holderClientId&&e.holderClientId===this.getLocalClientId()}tryAcquireLease(){if(!this.leaseMap)return!1;let e=this.getLeaseSnapshot();if(e.holderClientId&&!this.isLeaseStale(e)&&!this.isLeaseHeldByLocal(e))return this.emitState(),!1;let t=this.now();return this.ydoc.transact(()=>{this.leaseMap.set(`holderClientId`,this.getLocalClientId()),this.leaseMap.set(`holderName`,this.localUser?.name||``),this.leaseMap.set(`holderPeerId`,this.localUser?.peerId||``),this.leaseMap.set(`acquiredAt`,t),this.leaseMap.set(`heartbeatAt`,t)},`drawio-lease-acquire`),this.emitState(),this.currentState.isEditor}renewLeaseHeartbeat(){return!this.leaseMap||!this.isLeaseHeldByLocal()?!1:(this.leaseMap.set(`heartbeatAt`,this.now()),!0)}startHeartbeat(){this.heartbeatTimer||=this.setIntervalFn(()=>{this.renewLeaseHeartbeat()},this.heartbeatIntervalMs)}stopHeartbeat(){this.heartbeatTimer&&=(this.clearIntervalFn(this.heartbeatTimer),null)}releaseLease(){return!this.leaseMap||!this.isLeaseHeldByLocal()?!1:(this.stopHeartbeat(),this.ydoc.transact(()=>{this.leaseMap.delete(`holderClientId`),this.leaseMap.delete(`holderName`),this.leaseMap.delete(`holderPeerId`),this.leaseMap.delete(`acquiredAt`),this.leaseMap.delete(`heartbeatAt`)},`drawio-lease-release`),this.setLocalAwareness({mode:`viewer`}),this.emitState(),!0)}publishSave(){if(!this.statusMap)return 0;let e=l(this.statusMap.get(`savedVersion`))+1,t=this.now();return this.ydoc.transact(()=>{this.statusMap.set(`savedVersion`,e),this.statusMap.set(`savedAt`,t)},`drawio-save-status`),this.emitState(),e}emitState(){let e=this.getLeaseSnapshot(),t=this.isLeaseStale(e),n=this.isLeaseHeldByLocal(e),r=this.createState({acquiredAt:e.acquiredAt,canClaim:!n&&t,hasHealthyHolder:!!e.holderClientId&&!t,heartbeatAt:e.heartbeatAt,holderClientId:e.holderClientId,holderName:e.holderName,holderPeerId:e.holderPeerId,isEditor:n,isStale:t,mode:n?`editor`:`viewer`,savedAt:l(this.statusMap?.get(`savedAt`)),savedVersion:l(this.statusMap?.get(`savedVersion`))});return n?(this.startHeartbeat(),this.setLocalAwareness({mode:`editor`})):(this.stopHeartbeat(),this.setLocalAwareness({mode:`viewer`})),this.currentState=r,this.onStateChange(r),r}destroy(){this.releaseLease(),this.stopHeartbeat(),this.leaseMap?.unobserve?.(this.handleLeaseChange),this.statusMap?.unobserve?.(this.handleStatusChange),this.awareness?.off?.(`change`,this.handleAwarenessChange),this.provider?.destroy?.(),this.ydoc?.destroy?.(),this.provider=null,this.ydoc=null,this.awareness=null,this.leaseMap=null,this.statusMap=null}},d=1e3,f=15e3,p=window.location.origin,m=new URLSearchParams(window.location.search),h=m.get(`file`)||``,g=m.get(`leaseRoom`)||``,_=m.get(`mode`)===`view`?`view`:`edit`,v=m.get(`hostMode`)||``,y=m.get(`instanceId`)||``,b=m.get(`theme`)===`light`?`light`:`dark`,x=v===`export-image`,S=Number.parseInt(m.get(`previewWidth`)||``,10),C=i(),w=``,T=b,E=null,D=null,O=!1,k=null,A=null,j=null,M=null,N=0,P=!1,F=!1,I=document.getElementById(`loadingState`),L=document.getElementById(`root`),R={bannerText:``,canClaim:!1,isEditor:!1},z=document.createElement(`div`);z.className=`drawio-shell`;var B=document.createElement(`div`);B.className=`drawio-banner`,B.innerHTML=`
|
|
2
|
+
<div class="drawio-banner-status">
|
|
3
|
+
<span class="drawio-banner-pill" id="drawioModePill">Loading</span>
|
|
4
|
+
<span class="drawio-banner-copy" id="drawioBannerText">Connecting…</span>
|
|
5
|
+
</div>
|
|
6
|
+
<div class="drawio-banner-actions">
|
|
7
|
+
<button type="button" class="drawio-toolbar-btn" id="claimEditBtn" hidden>Claim edit</button>
|
|
8
|
+
</div>
|
|
9
|
+
`;var V=document.createElement(`div`);V.className=`drawio-frame-shell`;var H=g?new u({filePath:h,onStateChange:e=>le(e),roomName:g}):null;function U(e,t={}){window.parent!==window&&window.parent.postMessage({source:`drawio-editor`,instanceId:y,type:e,...t},p)}function ne(t){e(t)&&(t.preventDefault(),t.stopPropagation(),U(`request-toggle-quick-switcher`))}function re(e){if(typeof e==`string`)try{return JSON.parse(e)}catch{return null}return e&&typeof e==`object`?e:null}function W(e){document.body.dataset.theme=e===`light`?`light`:`dark`}function ie(e,{isError:t=!1}={}){I&&(I.className=t?`drawio-error`:`drawio-loading`,I.textContent=e)}function G(){let e=document.getElementById(`drawioModePill`),t=document.getElementById(`drawioBannerText`),n=document.getElementById(`claimEditBtn`);!e||!t||!n||(e.textContent=R.isEditor?`Editing`:`Read-only`,t.textContent=R.bannerText||(R.isEditor?`Editing`:`Read-only mode`),n.hidden=!R.canClaim,n.disabled=!R.canClaim)}function K(){k&&=(window.clearTimeout(k),null)}function q(){K(),A&&=(window.removeEventListener(`message`,A),null),D?.remove(),D=null,O=!1,P=!1,F=!1}function ae(){let e=C.drawioBaseUrl||`https://embed.diagrams.net`,t=new URL(e);return t.searchParams.set(`embed`,`1`),t.searchParams.set(`proto`,`json`),t.searchParams.set(`spin`,`1`),t.searchParams.set(`ui`,T===`light`?`simple`:`dark`),t.searchParams.set(`libraries`,`1`),t.toString()}function J(e,t={}){D?.contentWindow&&D.contentWindow.postMessage(JSON.stringify({action:e,...t}),`*`)}function Y(){J(`load`,{autosave:R.isEditor&&!x?1:0,dark:+(T===`dark`),modified:`unsavedChanges`,noExitBtn:1,noSaveBtn:x?1:+!R.isEditor,saveAndExit:0,theme:T===`light`?`simple`:`dark`,xml:w||``})}function oe(){D&&(D.classList.toggle(`is-read-only`,!R.isEditor),O&&Y())}function X(e,{fallbackToText:t=!1}={}){console.error(`[drawio] Failed to initialize:`,e),q(),L.replaceChildren(z),V.replaceChildren(),V.appendChild(Object.assign(document.createElement(`div`),{className:`drawio-error`,textContent:e})),R.bannerText=e,R.isEditor=!1,R.canClaim=!1,G(),U(t?`fallback-text`:`error`,{filePath:h,message:e})}function se(){F||!O||(F=!0,J(`export`,{border:0,currentPage:!0,format:`png`,grid:!1,keepTheme:!0,scale:2,shadow:!1,size:`diagram`,transparent:!1,...Number.isFinite(S)&&S>0?{width:S}:{}}))}async function Z(){if(!M||!h||!R.isEditor)return null;let e=M;return M=null,n.writeFile({content:e,path:h}).then(()=>(w=e,N=H?.publishSave?.()??N,!0)).catch(t=>{throw console.error(`[drawio] Failed to save diagram:`,t),M=e,t})}function Q(e,{immediate:t=!1}={}){if(!(!R.isEditor||!e)){if(M=e,j&&=(window.clearTimeout(j),null),t){Z();return}j=window.setTimeout(()=>{j=null,Z()},d)}}async function ce(){if(!h)return;let e=await n.readFile(h),t=String(e?.content??``);t!==w&&(w=t,O&&Y())}function $(){q();let e=document.createElement(`iframe`);e.className=`drawio-frame`,e.title=`draw.io`,e.allow=`clipboard-read; clipboard-write`,e.src=ae(),V.replaceChildren(e),D=e,oe(),A=e=>{if(e.source!==D?.contentWindow)return;let t=re(e.data);if(t?.event){if(t.event===`ready`||t.event===`init`){O=!0,K(),Y(),P||(P=!0,U(`ready`,{filePath:h,instanceMode:R.isEditor?`edit`:`view`}));return}if(t.event===`load`){x&&se();return}if(t.event===`autosave`){Q(String(t.xml||``));return}if(t.event===`save`){Q(String(t.xml||``),{immediate:!0});return}if(t.event===`export`){if(x&&typeof t.data==`string`&&t.data){U(`export-image`,{data:t.data,filePath:h,format:t.format||`svg`});return}x&&X(`Failed to export draw.io preview`);return}t.event===`exit`&&v===`file-preview`&&!R.isEditor&&U(`request-open-file`,{filePath:h})}},window.addEventListener(`message`,A),k=window.setTimeout(()=>{X(`Failed to initialize draw.io editor`,{fallbackToText:v===`file-preview`})},f)}function le(e){let t=E;E=e,R.isEditor=!!e?.isEditor,R.canClaim=!!e?.canClaim,R.isEditor?R.bannerText=`Editing`:e?.hasHealthyHolder?R.bannerText=`${e.holderName||`Another user`} is editing this diagram. Read-only mode. Updates appear after they save.`:e?.isStale?R.bannerText=`Editor disconnected. Claim edit to continue editing.`:R.bannerText=`Read-only mode. Updates appear after save.`,G();let n=t&&t.isEditor!==e.isEditor;if(!t||n){$();return}let r=e.savedVersion!==N;N=e.savedVersion,!R.isEditor&&r&&ce()}function ue(e){let t=e.data;!t||t.source!==`collabmd-host`||t.type===`set-theme`&&(T=t.theme===`light`?`light`:`dark`,W(T),$())}async function de(){H&&H.tryAcquireLease()}window.addEventListener(`keydown`,ne,{capture:!0});async function fe(){W(T);try{if(await t(),C=i(),!h)throw Error(`Missing draw.io file path`);let e=await n.readFile(h);if(w=String(e?.content??``),I?.remove(),L.replaceChildren(z),z.replaceChildren(B,V),document.getElementById(`claimEditBtn`)?.addEventListener(`click`,()=>{de()}),window.addEventListener(`message`,ue),window.addEventListener(`beforeunload`,()=>{j&&window.clearTimeout(j),H?.releaseLease?.()}),window.addEventListener(`pagehide`,()=>{j&&window.clearTimeout(j),H?.releaseLease?.()}),_===`view`||!H){R.isEditor=!1,R.canClaim=!1,R.bannerText=x?`Rendering preview…`:`Read-only mode`,x||G(),$();return}await H.connect({initialUser:{name:m.get(`userName`)||localStorage.getItem(`collabmd-user-name`)||``,peerId:m.get(`peerId`)||``},requestedMode:`edit`})}catch(e){let t=e instanceof Error?e.message:String(e);X(t,{fallbackToText:v===`file-preview`}),ie(`Failed to load draw.io: ${t}`,{isError:!0})}}fe();
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./drawio-editor-
|
|
2
|
-
import{t as e}from"./runtime-config-loader-_D2KZKn-.js";import{t}from"./preload-helper-Bo9GmnuQ.js";await e(),await t(()=>import(`./drawio-editor-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./drawio-editor-CWLEpwps.js","./yjs-provider-reset-guard-_Q3mj6tP.js","./vault-api-client-DSx3mWkH.js","./runtime-config-DWTejofP.js","./vault-api-client-D7Ck0CvR.css","./drawio-room-1i6Nn0_Z.js","./drawio-editor-UQQ8XHou.css","./embedded-editor-base-CgEkjNYn.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{t as e}from"./runtime-config-loader-_D2KZKn-.js";import{t}from"./preload-helper-Bo9GmnuQ.js";await e(),await t(()=>import(`./drawio-editor-CWLEpwps.js`),__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function e(e){for(var t={},n=e.split(` `),r=0;r<n.length;++r)t[n[r]]=!0;return t}function t(e,t){return t.startOfLine?(e.skipToEnd(),`meta`):!1}var n=e(`abs acos allnodes ascii asin asstring atan atan2 ave case choose choosen choosesets clustersize combine correlation cos cosh count covariance cron dataset dedup define denormalize distribute distributed distribution ebcdic enth error evaluate event eventextra eventname exists exp failcode failmessage fetch fromunicode getisvalid global graph group hash hash32 hash64 hashcrc hashmd5 having if index intformat isvalid iterate join keyunicode length library limit ln local log loop map matched matchlength matchposition matchtext matchunicode max merge mergejoin min nolocal nonempty normalize parse pipe power preload process project pull random range rank ranked realformat recordof regexfind regexreplace regroup rejected rollup round roundup row rowdiff sample set sin sinh sizeof soapcall sort sorted sqrt stepped stored sum table tan tanh thisnode topn tounicode transfer trim truncate typeof ungroup unicodeorder variance which workunit xmldecode xmlencode xmltext xmlunicode`),r=e(`apply assert build buildindex evaluate fail keydiff keypatch loadxml nothor notify output parallel sequential soapcall wait`),i=e(`__compressed__ all and any as atmost before beginc++ best between case const counter csv descend encrypt end endc++ endmacro except exclusive expire export extend false few first flat from full function group header heading hole ifblock import in interface joined keep keyed last left limit load local locale lookup macro many maxcount maxlength min skew module named nocase noroot noscan nosort not of only opt or outer overwrite packed partition penalty physicallength pipe quote record relationship repeat return right scan self separator service shared skew skip sql store terminator thor threshold token transform trim true type unicodeorder unsorted validate virtual whole wild within xml xpath`),a=e(`ascii big_endian boolean data decimal ebcdic integer pattern qstring real record rule set of string token udecimal unicode unsigned varstring varunicode`),o=e(`checkpoint deprecated failcode failmessage failure global independent onwarning persist priority recovery stored success wait when`),s=e(`catch class do else finally for if switch try while`),c=e(`true false null`),l={"#":t},u=/[+\-*&%=<>!?|\/]/,d;function f(e,t){var f=e.next();if(l[f]){var h=l[f](e,t);if(h!==!1)return h}if(f==`"`||f==`'`)return t.tokenize=p(f),t.tokenize(e,t);if(/[\[\]{}\(\),;\:\.]/.test(f))return d=f,null;if(/\d/.test(f))return e.eatWhile(/[\w\.]/),`number`;if(f==`/`){if(e.eat(`*`))return t.tokenize=m,m(e,t);if(e.eat(`/`))return e.skipToEnd(),`comment`}if(u.test(f))return e.eatWhile(u),`operator`;e.eatWhile(/[\w\$_]/);var g=e.current().toLowerCase();if(n.propertyIsEnumerable(g))return s.propertyIsEnumerable(g)&&(d=`newstatement`),`keyword`;if(r.propertyIsEnumerable(g))return s.propertyIsEnumerable(g)&&(d=`newstatement`),`variable`;if(i.propertyIsEnumerable(g))return s.propertyIsEnumerable(g)&&(d=`newstatement`),`modifier`;if(a.propertyIsEnumerable(g))return s.propertyIsEnumerable(g)&&(d=`newstatement`),`type`;if(o.propertyIsEnumerable(g))return s.propertyIsEnumerable(g)&&(d=`newstatement`),`builtin`;for(var _=g.length-1;_>=0&&(!isNaN(g[_])||g[_]==`_`);)--_;if(_>0){var v=g.substr(0,_+1);if(a.propertyIsEnumerable(v))return s.propertyIsEnumerable(v)&&(d=`newstatement`),`type`}return c.propertyIsEnumerable(g)?`atom`:null}function p(e){return function(t,n){for(var r=!1,i,a=!1;(i=t.next())!=null;){if(i==e&&!r){a=!0;break}r=!r&&i==`\\`}return(a||!r)&&(n.tokenize=f),`string`}}function m(e,t){for(var n=!1,r;r=e.next();){if(r==`/`&&n){t.tokenize=f;break}n=r==`*`}return`comment`}function h(e,t,n,r,i){this.indented=e,this.column=t,this.type=n,this.align=r,this.prev=i}function g(e,t,n){return e.context=new h(e.indented,t,n,null,e.context)}function _(e){var t=e.context.type;return(t==`)`||t==`]`||t==`}`)&&(e.indented=e.context.indented),e.context=e.context.prev}var v={name:`ecl`,startState:function(e){return{tokenize:null,context:new h(-e,0,`top`,!1),indented:0,startOfLine:!0}},token:function(e,t){var n=t.context;if(e.sol()&&(n.align??=!1,t.indented=e.indentation(),t.startOfLine=!0),e.eatSpace())return null;d=null;var r=(t.tokenize||f)(e,t);if(r==`comment`||r==`meta`)return r;if(n.align??=!0,(d==`;`||d==`:`)&&n.type==`statement`)_(t);else if(d==`{`)g(t,e.column(),`}`);else if(d==`[`)g(t,e.column(),`]`);else if(d==`(`)g(t,e.column(),`)`);else if(d==`}`){for(;n.type==`statement`;)n=_(t);for(n.type==`}`&&(n=_(t));n.type==`statement`;)n=_(t)}else d==n.type?_(t):(n.type==`}`||n.type==`top`||n.type==`statement`&&d==`newstatement`)&&g(t,e.column(),`statement`);return t.startOfLine=!1,r},indent:function(e,t,n){if(e.tokenize!=f&&e.tokenize!=null)return 0;var r=e.context,i=t&&t.charAt(0);r.type==`statement`&&i==`}`&&(r=r.prev);var a=i==r.type;return r.type==`statement`?r.indented+(i==`{`?0:n.unit):r.align?r.column+
|
|
1
|
+
function e(e){for(var t={},n=e.split(` `),r=0;r<n.length;++r)t[n[r]]=!0;return t}function t(e,t){return t.startOfLine?(e.skipToEnd(),`meta`):!1}var n=e(`abs acos allnodes ascii asin asstring atan atan2 ave case choose choosen choosesets clustersize combine correlation cos cosh count covariance cron dataset dedup define denormalize distribute distributed distribution ebcdic enth error evaluate event eventextra eventname exists exp failcode failmessage fetch fromunicode getisvalid global graph group hash hash32 hash64 hashcrc hashmd5 having if index intformat isvalid iterate join keyunicode length library limit ln local log loop map matched matchlength matchposition matchtext matchunicode max merge mergejoin min nolocal nonempty normalize parse pipe power preload process project pull random range rank ranked realformat recordof regexfind regexreplace regroup rejected rollup round roundup row rowdiff sample set sin sinh sizeof soapcall sort sorted sqrt stepped stored sum table tan tanh thisnode topn tounicode transfer trim truncate typeof ungroup unicodeorder variance which workunit xmldecode xmlencode xmltext xmlunicode`),r=e(`apply assert build buildindex evaluate fail keydiff keypatch loadxml nothor notify output parallel sequential soapcall wait`),i=e(`__compressed__ all and any as atmost before beginc++ best between case const counter csv descend encrypt end endc++ endmacro except exclusive expire export extend false few first flat from full function group header heading hole ifblock import in interface joined keep keyed last left limit load local locale lookup macro many maxcount maxlength min skew module named nocase noroot noscan nosort not of only opt or outer overwrite packed partition penalty physicallength pipe quote record relationship repeat return right scan self separator service shared skew skip sql store terminator thor threshold token transform trim true type unicodeorder unsorted validate virtual whole wild within xml xpath`),a=e(`ascii big_endian boolean data decimal ebcdic integer pattern qstring real record rule set of string token udecimal unicode unsigned varstring varunicode`),o=e(`checkpoint deprecated failcode failmessage failure global independent onwarning persist priority recovery stored success wait when`),s=e(`catch class do else finally for if switch try while`),c=e(`true false null`),l={"#":t},u=/[+\-*&%=<>!?|\/]/,d;function f(e,t){var f=e.next();if(l[f]){var h=l[f](e,t);if(h!==!1)return h}if(f==`"`||f==`'`)return t.tokenize=p(f),t.tokenize(e,t);if(/[\[\]{}\(\),;\:\.]/.test(f))return d=f,null;if(/\d/.test(f))return e.eatWhile(/[\w\.]/),`number`;if(f==`/`){if(e.eat(`*`))return t.tokenize=m,m(e,t);if(e.eat(`/`))return e.skipToEnd(),`comment`}if(u.test(f))return e.eatWhile(u),`operator`;e.eatWhile(/[\w\$_]/);var g=e.current().toLowerCase();if(n.propertyIsEnumerable(g))return s.propertyIsEnumerable(g)&&(d=`newstatement`),`keyword`;if(r.propertyIsEnumerable(g))return s.propertyIsEnumerable(g)&&(d=`newstatement`),`variable`;if(i.propertyIsEnumerable(g))return s.propertyIsEnumerable(g)&&(d=`newstatement`),`modifier`;if(a.propertyIsEnumerable(g))return s.propertyIsEnumerable(g)&&(d=`newstatement`),`type`;if(o.propertyIsEnumerable(g))return s.propertyIsEnumerable(g)&&(d=`newstatement`),`builtin`;for(var _=g.length-1;_>=0&&(!isNaN(g[_])||g[_]==`_`);)--_;if(_>0){var v=g.substr(0,_+1);if(a.propertyIsEnumerable(v))return s.propertyIsEnumerable(v)&&(d=`newstatement`),`type`}return c.propertyIsEnumerable(g)?`atom`:null}function p(e){return function(t,n){for(var r=!1,i,a=!1;(i=t.next())!=null;){if(i==e&&!r){a=!0;break}r=!r&&i==`\\`}return(a||!r)&&(n.tokenize=f),`string`}}function m(e,t){for(var n=!1,r;r=e.next();){if(r==`/`&&n){t.tokenize=f;break}n=r==`*`}return`comment`}function h(e,t,n,r,i){this.indented=e,this.column=t,this.type=n,this.align=r,this.prev=i}function g(e,t,n){return e.context=new h(e.indented,t,n,null,e.context)}function _(e){var t=e.context.type;return(t==`)`||t==`]`||t==`}`)&&(e.indented=e.context.indented),e.context=e.context.prev}var v={name:`ecl`,startState:function(e){return{tokenize:null,context:new h(-e,0,`top`,!1),indented:0,startOfLine:!0}},token:function(e,t){var n=t.context;if(e.sol()&&(n.align??=!1,t.indented=e.indentation(),t.startOfLine=!0),e.eatSpace())return null;d=null;var r=(t.tokenize||f)(e,t);if(r==`comment`||r==`meta`)return r;if(n.align??=!0,(d==`;`||d==`:`)&&n.type==`statement`)_(t);else if(d==`{`)g(t,e.column(),`}`);else if(d==`[`)g(t,e.column(),`]`);else if(d==`(`)g(t,e.column(),`)`);else if(d==`}`){for(;n.type==`statement`;)n=_(t);for(n.type==`}`&&(n=_(t));n.type==`statement`;)n=_(t)}else d==n.type?_(t):(n.type==`}`||n.type==`top`||n.type==`statement`&&d==`newstatement`)&&g(t,e.column(),`statement`);return t.startOfLine=!1,r},indent:function(e,t,n){if(e.tokenize!=f&&e.tokenize!=null)return 0;var r=e.context,i=t&&t.charAt(0);r.type==`statement`&&i==`}`&&(r=r.prev);var a=i==r.type;return r.type==`statement`?r.indented+(i==`{`?0:n.unit):r.align?r.column+ +!a:r.indented+(a?0:n.unit)},languageData:{indentOnInput:/^\s*[{}]$/}};export{v as ecl};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./dist-
|
|
2
|
-
import{t as e}from"./preload-helper-Bo9GmnuQ.js";import{$ as t,A as n,B as r,F as i,G as a,H as o,J as s,K as c,L as l,P as u,Q as d,R as f,St as p,Tt as m,V as h,W as g,Z as _,_t as ee,a as v,bt as te,c as ne,ct as y,et as re,f as ie,ft as ae,g as oe,gt as b,l as se,lt as x,mt as ce,nt as S,o as le,ot as C,pt as ue,q as de,rt as fe,st as pe,t as me,ut as w,v as he,w as ge,wt as _e,xt as ve,z as ye}from"./dist-DWJL3_bF.js";import{i as be,n as xe,r as Se}from"./dist-DIi0uqLJ.js";import{a as Ce,s as we}from"./dist-D5QOYy7y.js";import{t as Te}from"./dist-B4uQVR_X.js";import{a as Ee,c as De,i as Oe,n as ke,o as Ae,r as je,s as Me,t as Ne}from"./dist-BU8uusJX.js";import{d as Pe,i as Fe}from"./file-kind-DBptLlF_.js";import{f as Ie}from"./runtime-config-CqhchMC4.js";import{a as Le,c as T,d as E,f as Re,g as ze,h as Be,i as Ve,l as D,m as O,n as He,o as k,p as A,r as Ue,s as We,t as Ge,u as j}from"./yjs-provider-reset-guard-CtERLBID.js";import{a as Ke,c as qe,d as Je,i as Ye,n as Xe,o as Ze,s as Qe,t as $e,u as et}from"./room-yJaBAoEU.js";function tt({body:e,user:t}){return{body:e,createdAt:Date.now(),id:Ye(`comment`),peerId:t?.peerId??``,reactions:[],userColor:t?.color??``,userName:t?.name??`Anonymous`}}function nt(e,t){return e instanceof k?e.get(t):e?.[t]}function rt(e=[]){return Array.isArray(e)?e.map(e=>({emoji:typeof e?.emoji==`string`?e.emoji:``,users:Array.isArray(e?.users)?e.users.map(e=>({reactedAt:Number.isFinite(e?.reactedAt)?e.reactedAt:Date.now(),userColor:typeof e?.userColor==`string`?e.userColor:``,userId:typeof e?.userId==`string`?e.userId:``,userName:typeof e?.userName==`string`&&e.userName?e.userName:`Anonymous`})).filter(e=>e.userId):[]})).filter(e=>e.emoji&&e.users.length>0):[]}function it(e,t){let n=t?.doc;if(!n)return null;let r=e?.anchor??e,i=r?.anchorKind===`text`?`text`:`line`,a=n.lines,o=Math.min(Math.max(Math.round(r?.startLine??1),1),a),s=Math.min(Math.max(Math.round(r?.endLine??o),o),a),c=n.line(o).from,l=n.line(s).to,u=Math.min(Math.max(Math.round(r?.startIndex??c),0),n.length),d=Math.min(Math.max(Math.round(r?.endIndex??l),u),n.length);return{anchorEndLine:s,anchorKind:i,anchorQuote:qe(r?.anchorQuote||n.sliceString(u,d)),anchorStartLine:o,endIndex:d,startIndex:u}}var at=class{constructor({getDoc:e,getEditorState:t,getLocalUser:n,onCommentsChange:r=null}){this.getDoc=e,this.getEditorState=t,this.getLocalUser=n,this.onCommentsChange=r,this.commentThreads=null,this.ydoc=null,this.ytext=null,this.handleCommentThreadsChange=null,this.handleTextChange=null}bind({commentThreads:e,ydoc:t,ytext:n}){this.unbind(),this.commentThreads=e,this.ydoc=t,this.ytext=n,this.handleCommentThreadsChange=()=>{this.emitCommentsChange()},this.handleTextChange=()=>{this.emitCommentsChange()},this.commentThreads.observeDeep(this.handleCommentThreadsChange),this.ytext?.observe?.(this.handleTextChange),this.emitCommentsChange()}unbind(){this.commentThreads&&this.handleCommentThreadsChange&&this.commentThreads.unobserveDeep(this.handleCommentThreadsChange),this.ytext&&this.handleTextChange&&this.ytext.unobserve(this.handleTextChange),this.commentThreads=null,this.ydoc=null,this.ytext=null,this.handleCommentThreadsChange=null,this.handleTextChange=null}emitCommentsChange(){this.onCommentsChange?.(this.getCommentThreads())}refreshComments(){this.emitCommentsChange()}getCommentThreads(){return this.commentThreads?et(this.commentThreads).map(e=>this.resolveCommentThread(e)).filter(Boolean):[]}createCommentThread({anchor:e,body:t}){let n=this.getEditorState();if(!n||!this.commentThreads||!this.ytext||!this.ydoc)return null;let r=Qe(t),i=it(e,n);if(!r||!i)return null;let a=Ke({anchorEnd:E(j(this.ytext,i.endIndex)),anchorEndLine:i.anchorEndLine,anchorKind:i.anchorKind,anchorQuote:i.anchorQuote,anchorStart:E(j(this.ytext,i.startIndex)),anchorStartLine:i.anchorStartLine,createdAt:Date.now(),createdByColor:this.getLocalUser()?.color??``,createdByName:this.getLocalUser()?.name??`Anonymous`,createdByPeerId:this.getLocalUser()?.peerId??``,id:Ye(`thread`),messages:[tt({body:r,user:this.getLocalUser()})]});return a?(this.ydoc.transact(()=>{this.commentThreads.push([a])},`comment-thread-create`),a.get(`id`)):null}replyToCommentThread(e,t){let n=Qe(t);if(!n||!this.ydoc)return null;let r=this.findSharedCommentThread(e)?.get(`messages`);if(!(r instanceof Le))return null;let i=tt({body:n,user:this.getLocalUser()});return this.ydoc.transact(()=>{r.push([i])},`comment-thread-reply`),i.id}toggleCommentReaction(e,t,n){if(!this.ydoc||!e||!t||typeof n!=`string`||!n.trim())return!1;let r=this.getLocalUser?.(),i=typeof r?.userId==`string`?r.userId:``;if(!i)return!1;let a=this.findSharedCommentThread(e)?.get(`messages`);if(!(a instanceof Le))return!1;let o=a.toArray(),s=o.findIndex(e=>nt(e,`id`)===t);if(s<0)return!1;let c=o[s]instanceof k?o[s].toJSON():{...o[s]},l=rt(c.reactions),u=l.findIndex(e=>e.emoji===n);if(u>=0){let e=l[u].users.filter(e=>e.userId!==i);e.length===l[u].users.length&&e.push({reactedAt:Date.now(),userColor:r?.color??``,userId:i,userName:r?.name??`Anonymous`}),e.length===0?l.splice(u,1):l[u]={...l[u],users:e}}else l.push({emoji:n,users:[{reactedAt:Date.now(),userColor:r?.color??``,userId:i,userName:r?.name??`Anonymous`}]});let d={...c,reactions:l};return this.ydoc.transact(()=>{a.delete(s,1),a.insert(s,[d])},`comment-reaction-toggle`),!0}deleteCommentThread(e){if(!this.commentThreads||!this.ydoc)return!1;let t=this.findSharedCommentThreadIndex(e);return t<0?!1:(this.ydoc.transact(()=>{this.commentThreads.delete(t,1)},`comment-thread-resolve`),!0)}findSharedCommentThread(e){return this.commentThreads?this.commentThreads.toArray().find(t=>t instanceof k&&t.get(`id`)===e)??null:null}findSharedCommentThreadIndex(e){return this.commentThreads?this.commentThreads.toArray().findIndex(t=>t instanceof k&&t.get(`id`)===e):-1}resolveCommentThread(e){let t=this.getEditorState();if(!e||!t||!this.ydoc)return null;let n=Ze(e);if(!n)return null;let r=this.resolveCommentPosition(n.anchorStart),i=this.resolveCommentPosition(n.anchorEnd),a=r?.index??t.doc.line(n.anchorStartLine).from,o=Math.min(Math.max(n.anchorEndLine??n.anchorStartLine,n.anchorStartLine),t.doc.lines),s=i?.index??t.doc.line(o).to,c=t.doc.lineAt(a).number,l=Math.min(Math.max(s,a),t.doc.length),u=t.doc.lineAt(l).number,d=Je(t.doc.sliceString(a,n.anchorKind===`text`?Math.max(s,a):t.doc.line(u).to))||n.anchorQuote;return{...e,anchor:{endIndex:s,endLine:u,excerpt:d,quote:n.anchorQuote,startIndex:a,startLine:c,kind:n.anchorKind},anchorEnd:n.anchorEnd,anchorEndLine:n.anchorEndLine,anchorKind:n.anchorKind,anchorQuote:n.anchorQuote,anchorStart:n.anchorStart,anchorStartLine:n.anchorStartLine}}resolveCommentPosition(e){if(!e||!this.ydoc||!this.ytext)return null;try{let t=T(D(e),this.ydoc);return!t||t.type!==this.ytext?null:t}catch{return null}}},ot=class{constructor({localUser:e=null,onAwarenessChange:t=null,onConnectionChange:n=null,onInitialSync:r=null,preferredUserName:i,resolveAwarenessCursor:a=null}){this.onAwarenessChange=t,this.onConnectionChange=n,this.onInitialSync=r,this.preferredUserName=i,this.providedLocalUser=e,this.resolveAwarenessCursor=a??(()=>null),this.provider=null,this.awareness=null,this.localUser=null,this.ydoc=null,this.ytext=null,this.commentThreads=null,this.wsBaseUrl=``,this.initialSyncComplete=!1,this.initialSyncPromise=Promise.resolve(),this.resolveInitialSync=null}normalizeViewport(e){if(!e||typeof e!=`object`)return null;let t=Number(e.topLine),n=Number(e.viewportRatio);return!Number.isFinite(t)||t<1?null:{topLine:Math.max(1,Math.round(t)),viewportRatio:Number.isFinite(n)?Math.min(Math.max(n,0),1):.35}}async initialize(e){this.wsBaseUrl=Ie(),this.ydoc=new Ue,this.ytext=this.ydoc.getText(`codemirror`),this.commentThreads=this.ydoc.getArray(`comments`);let t=new Ve(this.ytext),n=new He(this.wsBaseUrl,e,this.ydoc,{disableBc:!0,maxBackoffTime:5e3});Ge(n);let r=n.awareness,i=this.providedLocalUser??$e(this.preferredUserName);this.provider=n,this.awareness=r,this.localUser=i,this.initialSyncComplete=!1,this.initialSyncPromise=new Promise(e=>{this.resolveInitialSync=e}),r.setLocalStateField(`user`,i),r.on(`change`,()=>{this.onAwarenessChange?.(this.collectUsers(this.resolveAwarenessCursor))}),this.trackConnectionStatus();let a=!1;return n.on(`sync`,e=>{!e||a||(a=!0,this.initialSyncComplete=!0,this.resolveInitialSync?.(),this.resolveInitialSync=null,this.onInitialSync?.())}),{awareness:r,commentThreads:this.commentThreads,localUser:this.localUser,undoManager:t,ydoc:this.ydoc,ytext:this.ytext}}destroy(){this.resolveInitialSync?.(),this.resolveInitialSync=null,this.initialSyncComplete=!1,this.initialSyncPromise=Promise.resolve(),this.provider?.disconnect(),this.provider?.destroy(),this.provider=null,this.awareness=null,this.localUser=null,this.ydoc?.destroy(),this.ydoc=null,this.ytext=null,this.commentThreads=null}waitForInitialSync(e=1500){return this.initialSyncComplete?Promise.resolve():e==null||e===!1?this.initialSyncPromise:Promise.race([this.initialSyncPromise,new Promise(t=>{window.setTimeout(t,e)})])}getText(){return this.ytext?.toString()??``}getLocalUser(){return this.localUser}setUserName(e){let t=Xe(e);return!t||!this.awareness||!this.localUser?null:(this.localUser={...this.localUser,name:t},this.awareness.setLocalStateField(`user`,this.localUser),t)}getUserCursor(e,t){return this.awareness?t(this.awareness.getStates().get(e)?.cursor):null}getUserViewport(e){if(!this.awareness)return null;let t=this.awareness.getStates().get(e);return this.normalizeViewport(t?.viewport)}setLocalViewport(e){if(!this.awareness)return null;let t=this.normalizeViewport(e);return this.awareness.setLocalStateField(`viewport`,t),t}collectUsers(e=()=>null){if(!this.awareness)return[];let t=[];return this.awareness.getStates().forEach((n,r)=>{if(!n.user)return;let i=e(n.cursor);t.push({...i??{},...n.user,clientId:r,hasCursor:!!i,isLocal:r===this.awareness.clientID,viewport:this.normalizeViewport(n.viewport)})}),t}trackConnectionStatus(){if(!this.provider)return;let e=0,t=!1;this.provider.on(`status`,({status:n})=>{n===`connecting`&&(e+=1);let r=n===`connected`&&!t;n===`connected`&&(e=0,t=!0),this.onConnectionChange?.({attempts:e,firstConnection:r,hasEverConnected:t,status:n,unreachable:!t&&e>=3,wsBaseUrl:this.wsBaseUrl})})}};function M(e){return new le(ne.define(e))}function N(t){return e(()=>import(`./dist-BtnXjRx0.js`).then(e=>e.sql({dialect:e[t]})),__vite__mapDeps([0,1,2,3]),import.meta.url)}var st=[v.of({name:`C`,extensions:[`c`,`h`,`ino`],load(){return e(()=>import(`./dist-Dyt7n5Ui.js`).then(e=>e.cpp()),__vite__mapDeps([4,2,3]),import.meta.url)}}),v.of({name:`C++`,alias:[`cpp`],extensions:[`cpp`,`c++`,`cc`,`cxx`,`hpp`,`h++`,`hh`,`hxx`],load(){return e(()=>import(`./dist-Dyt7n5Ui.js`).then(e=>e.cpp()),__vite__mapDeps([4,2,3]),import.meta.url)}}),v.of({name:`CQL`,alias:[`cassandra`],extensions:[`cql`],load(){return N(`Cassandra`)}}),v.of({name:`CSS`,extensions:[`css`],load(){return e(()=>import(`./dist-DJ16N7ol.js`).then(e=>e.css()),__vite__mapDeps([5,6,2,3]),import.meta.url)}}),v.of({name:`Go`,extensions:[`go`],load(){return e(()=>import(`./dist-CjII8VDS.js`).then(e=>e.go()),__vite__mapDeps([7,1,2,3]),import.meta.url)}}),v.of({name:`HTML`,alias:[`xhtml`],extensions:[`html`,`htm`,`handlebars`,`hbs`],load(){return e(()=>import(`./dist-BVB8rn7o.js`).then(e=>e.html()),__vite__mapDeps([8,9,6,2,3,10,1]),import.meta.url)}}),v.of({name:`Java`,extensions:[`java`],load(){return e(()=>import(`./dist-BzpfHRaE.js`).then(e=>e.java()),__vite__mapDeps([11,2,3]),import.meta.url)}}),v.of({name:`JavaScript`,alias:[`ecmascript`,`js`,`node`],extensions:[`js`,`mjs`,`cjs`],load(){return e(()=>import(`./dist-OQE68wIX.js`).then(e=>e.javascript()),__vite__mapDeps([12,10,1,2,3]),import.meta.url)}}),v.of({name:`Jinja`,extensions:[`j2`,`jinja`,`jinja2`],load(){return e(()=>import(`./dist-k47-Io7D.js`).then(e=>e.jinja()),__vite__mapDeps([13,9,6,2,3,10,1]),import.meta.url)}}),v.of({name:`JSON`,alias:[`json5`],extensions:[`json`,`map`],load(){return e(()=>import(`./dist-CXpKYW9s.js`).then(e=>e.json()),__vite__mapDeps([14,2,3]),import.meta.url)}}),v.of({name:`JSX`,extensions:[`jsx`],load(){return e(()=>import(`./dist-OQE68wIX.js`).then(e=>e.javascript({jsx:!0})),__vite__mapDeps([12,10,1,2,3]),import.meta.url)}}),v.of({name:`LESS`,extensions:[`less`],load(){return e(()=>import(`./dist-Bc2ND6i3.js`).then(e=>e.less()),__vite__mapDeps([15,6,2,3]),import.meta.url)}}),v.of({name:`Liquid`,extensions:[`liquid`],load(){return e(()=>import(`./dist-CL-jjdvG.js`).then(e=>e.liquid()),__vite__mapDeps([16,9,6,2,3,10,1]),import.meta.url)}}),v.of({name:`MariaDB SQL`,load(){return N(`MariaSQL`)}}),v.of({name:`Markdown`,extensions:[`md`,`markdown`,`mkd`],load(){return e(()=>import(`./dist-3bQB_we3.js`).then(e=>e.markdown()),__vite__mapDeps([17,18,1,2,9,6,3,10]),import.meta.url)}}),v.of({name:`MS SQL`,load(){return N(`MSSQL`)}}),v.of({name:`MySQL`,load(){return N(`MySQL`)}}),v.of({name:`PHP`,extensions:[`php`,`php3`,`php4`,`php5`,`php7`,`phtml`],load(){return e(()=>import(`./dist-DUvaQ-Bj.js`).then(e=>e.php()),__vite__mapDeps([19,9,6,2,3,10,1]),import.meta.url)}}),v.of({name:`PLSQL`,extensions:[`pls`],load(){return N(`PLSQL`)}}),v.of({name:`PostgreSQL`,load(){return N(`PostgreSQL`)}}),v.of({name:`Python`,extensions:[`BUILD`,`bzl`,`py`,`pyw`],filename:/^(BUCK|BUILD)$/,load(){return e(()=>import(`./dist-CGV1S_as.js`).then(e=>e.python()),__vite__mapDeps([20,1,2,3]),import.meta.url)}}),v.of({name:`Rust`,extensions:[`rs`],load(){return e(()=>import(`./dist-lDhnP-K1.js`).then(e=>e.rust()),__vite__mapDeps([21,2,3]),import.meta.url)}}),v.of({name:`Sass`,extensions:[`sass`],load(){return e(()=>import(`./dist-BLAlZer_.js`).then(e=>e.sass({indented:!0})),__vite__mapDeps([22,6,2,3]),import.meta.url)}}),v.of({name:`SCSS`,extensions:[`scss`],load(){return e(()=>import(`./dist-BLAlZer_.js`).then(e=>e.sass()),__vite__mapDeps([22,6,2,3]),import.meta.url)}}),v.of({name:`SQL`,extensions:[`sql`],load(){return N(`StandardSQL`)}}),v.of({name:`SQLite`,load(){return N(`SQLite`)}}),v.of({name:`TSX`,extensions:[`tsx`],load(){return e(()=>import(`./dist-OQE68wIX.js`).then(e=>e.javascript({jsx:!0,typescript:!0})),__vite__mapDeps([12,10,1,2,3]),import.meta.url)}}),v.of({name:`TypeScript`,alias:[`ts`],extensions:[`ts`,`mts`,`cts`],load(){return e(()=>import(`./dist-OQE68wIX.js`).then(e=>e.javascript({typescript:!0})),__vite__mapDeps([12,10,1,2,3]),import.meta.url)}}),v.of({name:`WebAssembly`,extensions:[`wat`,`wast`],load(){return e(()=>import(`./dist-rMhng5DK.js`).then(e=>e.wast()),__vite__mapDeps([23,2,3]),import.meta.url)}}),v.of({name:`XML`,alias:[`rss`,`wsdl`,`xsd`],extensions:[`xml`,`xsl`,`xsd`,`svg`],load(){return e(()=>import(`./dist-BzbYwa8m.js`).then(e=>e.xml()),__vite__mapDeps([24,2,3]),import.meta.url)}}),v.of({name:`YAML`,alias:[`yml`],extensions:[`yaml`,`yml`],load(){return e(()=>import(`./dist-8Igu3Ee_2.js`).then(e=>e.yaml()),__vite__mapDeps([25,26,2,3]),import.meta.url)}}),v.of({name:`APL`,extensions:[`dyalog`,`apl`],load(){return e(()=>import(`./apl-C1JYSI8J.js`).then(e=>M(e.apl)),[],import.meta.url)}}),v.of({name:`PGP`,alias:[`asciiarmor`],extensions:[`asc`,`pgp`,`sig`],load(){return e(()=>import(`./asciiarmor-DHW75j1s.js`).then(e=>M(e.asciiArmor)),[],import.meta.url)}}),v.of({name:`ASN.1`,extensions:[`asn`,`asn1`],load(){return e(()=>import(`./asn1-CQiG40kG.js`).then(e=>M(e.asn1({}))),[],import.meta.url)}}),v.of({name:`Asterisk`,filename:/^extensions\.conf$/i,load(){return e(()=>import(`./asterisk-BWExh0n4.js`).then(e=>M(e.asterisk)),[],import.meta.url)}}),v.of({name:`Brainfuck`,extensions:[`b`,`bf`],load(){return e(()=>import(`./brainfuck-CTNFyOLg.js`).then(e=>M(e.brainfuck)),[],import.meta.url)}}),v.of({name:`Cobol`,extensions:[`cob`,`cpy`],load(){return e(()=>import(`./cobol-DP4QggbL.js`).then(e=>M(e.cobol)),[],import.meta.url)}}),v.of({name:`C#`,alias:[`csharp`,`cs`],extensions:[`cs`],load(){return e(()=>import(`./clike-1_ZsiVV8.js`).then(e=>M(e.csharp)),[],import.meta.url)}}),v.of({name:`Clojure`,extensions:[`clj`,`cljc`,`cljx`],load(){return e(()=>import(`./clojure-D-DYVqu7.js`).then(e=>M(e.clojure)),[],import.meta.url)}}),v.of({name:`ClojureScript`,extensions:[`cljs`],load(){return e(()=>import(`./clojure-D-DYVqu7.js`).then(e=>M(e.clojure)),[],import.meta.url)}}),v.of({name:`Closure Stylesheets (GSS)`,extensions:[`gss`],load(){return e(()=>import(`./css-CmhPNxBE.js`).then(e=>M(e.gss)),[],import.meta.url)}}),v.of({name:`CMake`,extensions:[`cmake`,`cmake.in`],filename:/^CMakeLists\.txt$/,load(){return e(()=>import(`./cmake-DtGL-Unu.js`).then(e=>M(e.cmake)),[],import.meta.url)}}),v.of({name:`CoffeeScript`,alias:[`coffee`,`coffee-script`],extensions:[`coffee`],load(){return e(()=>import(`./coffeescript-B_7eyHAa.js`).then(e=>M(e.coffeeScript)),[],import.meta.url)}}),v.of({name:`Common Lisp`,alias:[`lisp`],extensions:[`cl`,`lisp`,`el`],load(){return e(()=>import(`./commonlisp-COlJYiQT.js`).then(e=>M(e.commonLisp)),[],import.meta.url)}}),v.of({name:`Cypher`,extensions:[`cyp`,`cypher`],load(){return e(()=>import(`./cypher-DE6I2lIA.js`).then(e=>M(e.cypher)),[],import.meta.url)}}),v.of({name:`Cython`,extensions:[`pyx`,`pxd`,`pxi`],load(){return e(()=>import(`./python-CZtTmYkS.js`).then(e=>M(e.cython)),[],import.meta.url)}}),v.of({name:`Crystal`,extensions:[`cr`],load(){return e(()=>import(`./crystal-I_dE9xG-.js`).then(e=>M(e.crystal)),[],import.meta.url)}}),v.of({name:`D`,extensions:[`d`],load(){return e(()=>import(`./d-BNkKjn0o.js`).then(e=>M(e.d)),[],import.meta.url)}}),v.of({name:`Dart`,extensions:[`dart`],load(){return e(()=>import(`./clike-1_ZsiVV8.js`).then(e=>M(e.dart)),[],import.meta.url)}}),v.of({name:`diff`,extensions:[`diff`,`patch`],load(){return e(()=>import(`./diff-BWuPUsEo.js`).then(e=>M(e.diff)),[],import.meta.url)}}),v.of({name:`Dockerfile`,filename:/^Dockerfile$/,load(){return e(()=>import(`./dockerfile-D8_6_FRV.js`).then(e=>M(e.dockerFile)),__vite__mapDeps([27,28]),import.meta.url)}}),v.of({name:`DTD`,extensions:[`dtd`],load(){return e(()=>import(`./dtd-C6brJFPg.js`).then(e=>M(e.dtd)),[],import.meta.url)}}),v.of({name:`Dylan`,extensions:[`dylan`,`dyl`,`intr`],load(){return e(()=>import(`./dylan-Bft86ZSB.js`).then(e=>M(e.dylan)),[],import.meta.url)}}),v.of({name:`EBNF`,load(){return e(()=>import(`./ebnf-D6ifG44A.js`).then(e=>M(e.ebnf)),[],import.meta.url)}}),v.of({name:`ECL`,extensions:[`ecl`],load(){return e(()=>import(`./ecl-M7Iek4lq.js`).then(e=>M(e.ecl)),[],import.meta.url)}}),v.of({name:`edn`,extensions:[`edn`],load(){return e(()=>import(`./clojure-D-DYVqu7.js`).then(e=>M(e.clojure)),[],import.meta.url)}}),v.of({name:`Eiffel`,extensions:[`e`],load(){return e(()=>import(`./eiffel-DwxtewZF.js`).then(e=>M(e.eiffel)),[],import.meta.url)}}),v.of({name:`Elm`,extensions:[`elm`],load(){return e(()=>import(`./elm-B1TncobV.js`).then(e=>M(e.elm)),[],import.meta.url)}}),v.of({name:`Erlang`,extensions:[`erl`],load(){return e(()=>import(`./erlang-BDJZNtt8.js`).then(e=>M(e.erlang)),[],import.meta.url)}}),v.of({name:`Esper`,load(){return e(()=>import(`./sql-DDFeQNTK.js`).then(e=>M(e.esper)),[],import.meta.url)}}),v.of({name:`Factor`,extensions:[`factor`],load(){return e(()=>import(`./factor-Cz-hzBGH.js`).then(e=>M(e.factor)),__vite__mapDeps([29,28]),import.meta.url)}}),v.of({name:`FCL`,load(){return e(()=>import(`./fcl-BWKK0S4-.js`).then(e=>M(e.fcl)),[],import.meta.url)}}),v.of({name:`Forth`,extensions:[`forth`,`fth`,`4th`],load(){return e(()=>import(`./forth-nvhcMz63.js`).then(e=>M(e.forth)),[],import.meta.url)}}),v.of({name:`Fortran`,extensions:[`f`,`for`,`f77`,`f90`,`f95`],load(){return e(()=>import(`./fortran-BZID-z10.js`).then(e=>M(e.fortran)),[],import.meta.url)}}),v.of({name:`F#`,alias:[`fsharp`],extensions:[`fs`],load(){return e(()=>import(`./mllike-C0p7lv48.js`).then(e=>M(e.fSharp)),[],import.meta.url)}}),v.of({name:`Gas`,extensions:[`s`],load(){return e(()=>import(`./gas-DjQsZDGE.js`).then(e=>M(e.gas)),[],import.meta.url)}}),v.of({name:`Gherkin`,extensions:[`feature`],load(){return e(()=>import(`./gherkin-S0kHlzux.js`).then(e=>M(e.gherkin)),[],import.meta.url)}}),v.of({name:`Groovy`,extensions:[`groovy`,`gradle`],filename:/^Jenkinsfile$/,load(){return e(()=>import(`./groovy-BEKazBrO.js`).then(e=>M(e.groovy)),[],import.meta.url)}}),v.of({name:`Haskell`,extensions:[`hs`],load(){return e(()=>import(`./haskell-C6qH3-aI.js`).then(e=>M(e.haskell)),[],import.meta.url)}}),v.of({name:`Haxe`,extensions:[`hx`],load(){return e(()=>import(`./haxe-BY9d_5nB.js`).then(e=>M(e.haxe)),[],import.meta.url)}}),v.of({name:`HXML`,extensions:[`hxml`],load(){return e(()=>import(`./haxe-BY9d_5nB.js`).then(e=>M(e.hxml)),[],import.meta.url)}}),v.of({name:`HTTP`,load(){return e(()=>import(`./http-DG1Y9fpK.js`).then(e=>M(e.http)),[],import.meta.url)}}),v.of({name:`IDL`,extensions:[`pro`],load(){return e(()=>import(`./idl-B64p3NTJ.js`).then(e=>M(e.idl)),[],import.meta.url)}}),v.of({name:`JSON-LD`,alias:[`jsonld`],extensions:[`jsonld`],load(){return e(()=>import(`./javascript-UJe68_xi.js`).then(e=>M(e.jsonld)),__vite__mapDeps([30,31]),import.meta.url)}}),v.of({name:`Julia`,extensions:[`jl`],load(){return e(()=>import(`./julia-B22G9Bym.js`).then(e=>M(e.julia)),[],import.meta.url)}}),v.of({name:`Kotlin`,extensions:[`kt`,`kts`],load(){return e(()=>import(`./clike-1_ZsiVV8.js`).then(e=>M(e.kotlin)),[],import.meta.url)}}),v.of({name:`LiveScript`,alias:[`ls`],extensions:[`ls`],load(){return e(()=>import(`./livescript-CkcuHqeS.js`).then(e=>M(e.liveScript)),[],import.meta.url)}}),v.of({name:`Lua`,extensions:[`lua`],load(){return e(()=>import(`./lua-kutgyRGY.js`).then(e=>M(e.lua)),[],import.meta.url)}}),v.of({name:`mIRC`,extensions:[`mrc`],load(){return e(()=>import(`./mirc-BVG2S5rO.js`).then(e=>M(e.mirc)),[],import.meta.url)}}),v.of({name:`Mathematica`,extensions:[`m`,`nb`,`wl`,`wls`],load(){return e(()=>import(`./mathematica-CKVhKnoY.js`).then(e=>M(e.mathematica)),[],import.meta.url)}}),v.of({name:`Modelica`,extensions:[`mo`],load(){return e(()=>import(`./modelica-vJ-Qa9jV.js`).then(e=>M(e.modelica)),[],import.meta.url)}}),v.of({name:`MUMPS`,extensions:[`mps`],load(){return e(()=>import(`./mumps-D0KfUTSd.js`).then(e=>M(e.mumps)),[],import.meta.url)}}),v.of({name:`Mbox`,extensions:[`mbox`],load(){return e(()=>import(`./mbox-DANyzFJ2.js`).then(e=>M(e.mbox)),[],import.meta.url)}}),v.of({name:`Nginx`,filename:/nginx.*\.conf$/i,load(){return e(()=>import(`./nginx-DkVceJrH.js`).then(e=>M(e.nginx)),[],import.meta.url)}}),v.of({name:`NSIS`,extensions:[`nsh`,`nsi`],load(){return e(()=>import(`./nsis-QPGhLAeY.js`).then(e=>M(e.nsis)),__vite__mapDeps([32,28]),import.meta.url)}}),v.of({name:`NTriples`,extensions:[`nt`,`nq`],load(){return e(()=>import(`./ntriples-BBuCIfS0.js`).then(e=>M(e.ntriples)),[],import.meta.url)}}),v.of({name:`Objective-C`,alias:[`objective-c`,`objc`],extensions:[`m`],load(){return e(()=>import(`./clike-1_ZsiVV8.js`).then(e=>M(e.objectiveC)),[],import.meta.url)}}),v.of({name:`Objective-C++`,alias:[`objective-c++`,`objc++`],extensions:[`mm`],load(){return e(()=>import(`./clike-1_ZsiVV8.js`).then(e=>M(e.objectiveCpp)),[],import.meta.url)}}),v.of({name:`OCaml`,extensions:[`ml`,`mli`,`mll`,`mly`],load(){return e(()=>import(`./mllike-C0p7lv48.js`).then(e=>M(e.oCaml)),[],import.meta.url)}}),v.of({name:`Octave`,extensions:[`m`],load(){return e(()=>import(`./octave-BTv2CqSQ.js`).then(e=>M(e.octave)),[],import.meta.url)}}),v.of({name:`Oz`,extensions:[`oz`],load(){return e(()=>import(`./oz-D8SjVDNU.js`).then(e=>M(e.oz)),[],import.meta.url)}}),v.of({name:`Pascal`,extensions:[`p`,`pas`],load(){return e(()=>import(`./pascal-T-tfhVyx.js`).then(e=>M(e.pascal)),[],import.meta.url)}}),v.of({name:`Perl`,extensions:[`pl`,`pm`],load(){return e(()=>import(`./perl-BDrCkHRd.js`).then(e=>M(e.perl)),[],import.meta.url)}}),v.of({name:`Pig`,extensions:[`pig`],load(){return e(()=>import(`./pig-BEyI4fPq.js`).then(e=>M(e.pig)),[],import.meta.url)}}),v.of({name:`PowerShell`,extensions:[`ps1`,`psd1`,`psm1`],load(){return e(()=>import(`./powershell-DtnFc6GG.js`).then(e=>M(e.powerShell)),[],import.meta.url)}}),v.of({name:`Properties files`,alias:[`ini`,`properties`],extensions:[`properties`,`ini`,`in`],load(){return e(()=>import(`./properties-DWUvbxV9.js`).then(e=>M(e.properties)),[],import.meta.url)}}),v.of({name:`ProtoBuf`,extensions:[`proto`],load(){return e(()=>import(`./protobuf-CQGoYyfE.js`).then(e=>M(e.protobuf)),[],import.meta.url)}}),v.of({name:`Pug`,alias:[`jade`],extensions:[`pug`,`jade`],load(){return e(()=>import(`./pug-DkUcLYWt.js`).then(e=>M(e.pug)),__vite__mapDeps([33,31]),import.meta.url)}}),v.of({name:`Puppet`,extensions:[`pp`],load(){return e(()=>import(`./puppet-Dd-qWO3p.js`).then(e=>M(e.puppet)),[],import.meta.url)}}),v.of({name:`Q`,extensions:[`q`],load(){return e(()=>import(`./q-I27iQntV.js`).then(e=>M(e.q)),[],import.meta.url)}}),v.of({name:`R`,alias:[`rscript`],extensions:[`r`,`R`],load(){return e(()=>import(`./r-DN_EydfL.js`).then(e=>M(e.r)),[],import.meta.url)}}),v.of({name:`RPM Changes`,load(){return e(()=>import(`./rpm-CjWxLM68.js`).then(e=>M(e.rpmChanges)),[],import.meta.url)}}),v.of({name:`RPM Spec`,extensions:[`spec`],load(){return e(()=>import(`./rpm-CjWxLM68.js`).then(e=>M(e.rpmSpec)),[],import.meta.url)}}),v.of({name:`Ruby`,alias:[`jruby`,`macruby`,`rake`,`rb`,`rbx`],extensions:[`rb`],filename:/^(Gemfile|Rakefile)$/,load(){return e(()=>import(`./ruby-CB34f2Gf.js`).then(e=>M(e.ruby)),[],import.meta.url)}}),v.of({name:`SAS`,extensions:[`sas`],load(){return e(()=>import(`./sas-Bji4HDQq.js`).then(e=>M(e.sas)),[],import.meta.url)}}),v.of({name:`Scala`,extensions:[`scala`],load(){return e(()=>import(`./clike-1_ZsiVV8.js`).then(e=>M(e.scala)),[],import.meta.url)}}),v.of({name:`Scheme`,extensions:[`scm`,`ss`],load(){return e(()=>import(`./scheme-C3elI80V.js`).then(e=>M(e.scheme)),[],import.meta.url)}}),v.of({name:`Shell`,alias:[`bash`,`sh`,`zsh`],extensions:[`sh`,`ksh`,`bash`],filename:/^PKGBUILD$/,load(){return e(()=>import(`./shell-DUveK2Hb.js`).then(e=>M(e.shell)),[],import.meta.url)}}),v.of({name:`Sieve`,extensions:[`siv`,`sieve`],load(){return e(()=>import(`./sieve-2ogwMVx4.js`).then(e=>M(e.sieve)),[],import.meta.url)}}),v.of({name:`Smalltalk`,extensions:[`st`],load(){return e(()=>import(`./smalltalk-BuGhc6lW.js`).then(e=>M(e.smalltalk)),[],import.meta.url)}}),v.of({name:`Solr`,load(){return e(()=>import(`./solr-DTxshpm8.js`).then(e=>M(e.solr)),[],import.meta.url)}}),v.of({name:`SML`,extensions:[`sml`,`sig`,`fun`,`smackspec`],load(){return e(()=>import(`./mllike-C0p7lv48.js`).then(e=>M(e.sml)),[],import.meta.url)}}),v.of({name:`SPARQL`,alias:[`sparul`],extensions:[`rq`,`sparql`],load(){return e(()=>import(`./sparql-BOvq0dv7.js`).then(e=>M(e.sparql)),[],import.meta.url)}}),v.of({name:`Spreadsheet`,alias:[`excel`,`formula`],load(){return e(()=>import(`./spreadsheet-C6Vbtl9-.js`).then(e=>M(e.spreadsheet)),[],import.meta.url)}}),v.of({name:`Squirrel`,extensions:[`nut`],load(){return e(()=>import(`./clike-1_ZsiVV8.js`).then(e=>M(e.squirrel)),[],import.meta.url)}}),v.of({name:`Stylus`,extensions:[`styl`],load(){return e(()=>import(`./stylus-D1SZIMDs.js`).then(e=>M(e.stylus)),[],import.meta.url)}}),v.of({name:`Swift`,extensions:[`swift`],load(){return e(()=>import(`./swift-BCxe4-cw.js`).then(e=>M(e.swift)),[],import.meta.url)}}),v.of({name:`sTeX`,load(){return e(()=>import(`./stex-CEwW0Q_0.js`).then(e=>M(e.stex)),[],import.meta.url)}}),v.of({name:`LaTeX`,alias:[`tex`],extensions:[`text`,`ltx`,`tex`],load(){return e(()=>import(`./stex-CEwW0Q_0.js`).then(e=>M(e.stex)),[],import.meta.url)}}),v.of({name:`SystemVerilog`,extensions:[`v`,`sv`,`svh`],load(){return e(()=>import(`./verilog-C4wTycyo.js`).then(e=>M(e.verilog)),[],import.meta.url)}}),v.of({name:`Tcl`,extensions:[`tcl`],load(){return e(()=>import(`./tcl-SPk7uiDB.js`).then(e=>M(e.tcl)),[],import.meta.url)}}),v.of({name:`Textile`,extensions:[`textile`],load(){return e(()=>import(`./textile-C48beRus.js`).then(e=>M(e.textile)),[],import.meta.url)}}),v.of({name:`TiddlyWiki`,load(){return e(()=>import(`./tiddlywiki-CiImjFLN.js`).then(e=>M(e.tiddlyWiki)),[],import.meta.url)}}),v.of({name:`Tiki wiki`,load(){return e(()=>import(`./tiki-HkXZ4BIW.js`).then(e=>M(e.tiki)),[],import.meta.url)}}),v.of({name:`TOML`,extensions:[`toml`],load(){return e(()=>import(`./toml-BmfpMy1_.js`).then(e=>M(e.toml)),[],import.meta.url)}}),v.of({name:`Troff`,extensions:[`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`],load(){return e(()=>import(`./troff-BjbEOT5E.js`).then(e=>M(e.troff)),[],import.meta.url)}}),v.of({name:`TTCN`,extensions:[`ttcn`,`ttcn3`,`ttcnpp`],load(){return e(()=>import(`./ttcn-NA-V4KnY.js`).then(e=>M(e.ttcn)),[],import.meta.url)}}),v.of({name:`TTCN_CFG`,extensions:[`cfg`],load(){return e(()=>import(`./ttcn-cfg-TPHncdGN.js`).then(e=>M(e.ttcnCfg)),[],import.meta.url)}}),v.of({name:`Turtle`,extensions:[`ttl`],load(){return e(()=>import(`./turtle-GBz_E4RG.js`).then(e=>M(e.turtle)),[],import.meta.url)}}),v.of({name:`Web IDL`,extensions:[`webidl`],load(){return e(()=>import(`./webidl-DttrYZRT.js`).then(e=>M(e.webIDL)),[],import.meta.url)}}),v.of({name:`VB.NET`,extensions:[`vb`],load(){return e(()=>import(`./vb-C19AQWqO.js`).then(e=>M(e.vb)),[],import.meta.url)}}),v.of({name:`VBScript`,extensions:[`vbs`],load(){return e(()=>import(`./vbscript-CHJk3s95.js`).then(e=>M(e.vbScript)),[],import.meta.url)}}),v.of({name:`Velocity`,extensions:[`vtl`],load(){return e(()=>import(`./velocity-Ya0P4sQU.js`).then(e=>M(e.velocity)),[],import.meta.url)}}),v.of({name:`Verilog`,extensions:[`v`],load(){return e(()=>import(`./verilog-C4wTycyo.js`).then(e=>M(e.verilog)),[],import.meta.url)}}),v.of({name:`VHDL`,extensions:[`vhd`,`vhdl`],load(){return e(()=>import(`./vhdl-Bwndeg44.js`).then(e=>M(e.vhdl)),[],import.meta.url)}}),v.of({name:`XQuery`,extensions:[`xy`,`xquery`,`xq`,`xqm`,`xqy`],load(){return e(()=>import(`./xquery-CEDTd8qs.js`).then(e=>M(e.xQuery)),[],import.meta.url)}}),v.of({name:`Yacas`,extensions:[`ys`],load(){return e(()=>import(`./yacas-C7dxlPB0.js`).then(e=>M(e.yacas)),[],import.meta.url)}}),v.of({name:`Z80`,extensions:[`z80`],load(){return e(()=>import(`./z80-BqEfFSnA.js`).then(e=>M(e.z80)),[],import.meta.url)}}),v.of({name:`MscGen`,extensions:[`mscgen`,`mscin`,`msc`],load(){return e(()=>import(`./mscgen-vUD-SWGJ.js`).then(e=>M(e.mscgen)),[],import.meta.url)}}),v.of({name:`Xù`,extensions:[`xu`],load(){return e(()=>import(`./mscgen-vUD-SWGJ.js`).then(e=>M(e.xu)),[],import.meta.url)}}),v.of({name:`MsGenny`,extensions:[`msgenny`],load(){return e(()=>import(`./mscgen-vUD-SWGJ.js`).then(e=>M(e.msgenny)),[],import.meta.url)}}),v.of({name:`Vue`,extensions:[`vue`],load(){return e(()=>import(`./dist-3uAMa5w5.js`).then(e=>e.vue()),__vite__mapDeps([34,9,6,2,3,10,1]),import.meta.url)}}),v.of({name:`Angular Template`,load(){return e(()=>import(`./dist-DsL7sqZR.js`).then(e=>e.angular()),__vite__mapDeps([35,9,6,2,3,10,1]),import.meta.url)}})],ct=typeof String.prototype.normalize==`function`?e=>e.normalize(`NFKD`):e=>e,P=class{constructor(e,t,n=0,r=e.length,i,a){this.test=a,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer=``,this.bufferPos=0,this.iter=e.iterRange(n,r),this.bufferStart=n,this.normalize=i?e=>i(ct(e)):ct,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return te(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=m(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=ve(e);let r=this.normalize(t);if(r.length)for(let e=0,i=n;;e++){let a=r.charCodeAt(e),o=this.match(a,i,this.bufferPos+this.bufferStart);if(e==r.length-1){if(o)return this.value=o,this;break}i==n&&e<t.length&&t.charCodeAt(e)==a&&i++}}}match(e,t,n){let r=null;for(let t=0;t<this.matches.length;t+=2){let i=this.matches[t],a=!1;this.query.charCodeAt(i)==e&&(i==this.query.length-1?r={from:this.matches[t+1],to:n}:(this.matches[t]++,a=!0)),a||(this.matches.splice(t,2),t-=2)}return this.query.charCodeAt(0)==e&&(this.query.length==1?r={from:t,to:n}:this.matches.push(1,t)),r&&this.test&&!this.test(r.from,r.to,this.buffer,this.bufferStart)&&(r=null),r}};typeof Symbol<`u`&&(P.prototype[Symbol.iterator]=function(){return this});var lt={from:-1,to:-1,match:/.*/.exec(``)},ut=`gm`+(/x/.unicode==null?``:`u`),dt=class{constructor(e,t,n,r=0,i=e.length){if(this.text=e,this.to=i,this.curLine=``,this.done=!1,this.value=lt,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new mt(e,t,n,r,i);this.re=new RegExp(t,ut+(n?.ignoreCase?`i`:``)),this.test=n?.test,this.iter=e.iter(),this.curLineStart=e.lineAt(r).from,this.matchPos=F(e,r),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine=``:(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine=``:this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let n=this.curLineStart+t.index,r=n+t[0].length;if(this.matchPos=F(this.text,r+(n==r?1:0)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(n<r||n>this.value.to)&&(!this.test||this.test(n,r,t)))return this.value={from:n,to:r,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),e=0;else return this.done=!0,this}}},ft=new WeakMap,pt=class e{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(t,n,r){let i=ft.get(t);if(!i||i.from>=r||i.to<=n){let i=new e(n,t.sliceString(n,r));return ft.set(t,i),i}if(i.from==n&&i.to==r)return i;let{text:a,from:o}=i;return o>n&&(a=t.sliceString(n,o)+a,o=n),i.to<r&&(a+=t.sliceString(i.to,r)),ft.set(t,new e(o,a)),new e(n,a.slice(n-o,r-o))}},mt=class{constructor(e,t,n,r,i){this.text=e,this.to=i,this.done=!1,this.value=lt,this.matchPos=F(e,r),this.re=new RegExp(t,ut+(n?.ignoreCase?`i`:``)),this.test=n?.test,this.flat=pt.get(e,r,this.chunkEnd(r+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let e=this.flat.from+t.index,n=e+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(e,n,t)))return this.value={from:e,to:n,match:t},this.matchPos=F(this.text,n+(e==n?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=pt.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}};typeof Symbol<`u`&&(dt.prototype[Symbol.iterator]=mt.prototype[Symbol.iterator]=function(){return this});function ht(e){try{return new RegExp(e,ut),!0}catch{return!1}}function F(e,t){if(t>=e.length)return t;let n=e.lineAt(t),r;for(;t<n.to&&(r=n.text.charCodeAt(t-n.from))>=56320&&r<57344;)t++;return t}var gt=e=>{let{state:n}=e,r=String(n.doc.lineAt(e.state.selection.main.head).number),{close:i,result:a}=t(e,{label:n.phrase(`Go to line`),input:{type:`text`,name:`line`,value:r},focus:!0,submitLabel:n.phrase(`go`)});return a.then(t=>{let r=t&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.elements.line.value);if(!r){e.dispatch({effects:i});return}let a=n.doc.lineAt(n.selection.main.head),[,o,s,c,u]=r,d=c?+c.slice(1):0,f=s?+s:a.number;if(s&&u){let e=f/100;o&&(e=e*(o==`-`?-1:1)+a.number/n.doc.lines),f=Math.round(n.doc.lines*e)}else s&&o&&(f=f*(o==`-`?-1:1)+a.number);let p=n.doc.line(Math.max(1,Math.min(n.doc.lines,f))),m=y.cursor(p.from+Math.max(0,Math.min(d,p.length)));e.dispatch({effects:[i,l.scrollIntoView(m.from,{y:`center`})],selection:m})}),!0},_t={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},vt=w.define({combine(e){return p(e,_t,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function yt(e){let t=[Tt,wt];return e&&t.push(vt.of(e)),t}var bt=i.mark({class:`cm-selectionMatch`}),xt=i.mark({class:`cm-selectionMatch cm-selectionMatch-main`});function St(e,t,n,r){return(n==0||e(t.sliceDoc(n-1,n))!=C.Word)&&(r==t.doc.length||e(t.sliceDoc(r,r+1))!=C.Word)}function Ct(e,t,n,r){return e(t.sliceDoc(n,n+1))==C.Word&&e(t.sliceDoc(r-1,r))==C.Word}var wt=f.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(vt),{state:n}=e,r=n.selection;if(r.ranges.length>1)return i.none;let a=r.main,o,s=null;if(a.empty){if(!t.highlightWordAroundCursor)return i.none;let e=n.wordAt(a.head);if(!e)return i.none;s=n.charCategorizer(a.head),o=n.sliceDoc(e.from,e.to)}else{let e=a.to-a.from;if(e<t.minSelectionLength||e>200)return i.none;if(t.wholeWords){if(o=n.sliceDoc(a.from,a.to),s=n.charCategorizer(a.head),!(St(s,n,a.from,a.to)&&Ct(s,n,a.from,a.to)))return i.none}else if(o=n.sliceDoc(a.from,a.to),!o)return i.none}let c=[];for(let r of e.visibleRanges){let e=new P(n.doc,o,r.from,r.to);for(;!e.next().done;){let{from:r,to:o}=e.value;if((!s||St(s,n,r,o))&&(a.empty&&r<=a.from&&o>=a.to?c.push(xt.range(r,o)):(r>=a.to||o<=a.from)&&c.push(bt.range(r,o)),c.length>t.maxMatches))return i.none}}return i.set(c)}},{decorations:e=>e.decorations}),Tt=l.baseTheme({".cm-selectionMatch":{backgroundColor:`#99ff7780`},".cm-searchMatch .cm-selectionMatch":{backgroundColor:`transparent`}}),Et=({state:e,dispatch:t})=>{let{selection:n}=e,r=y.create(n.ranges.map(t=>e.wordAt(t.head)||y.cursor(t.head)),n.mainIndex);return r.eq(n)?!1:(t(e.update({selection:r})),!0)};function Dt(e,t){let{main:n,ranges:r}=e.selection,i=e.wordAt(n.head),a=i&&i.from==n.from&&i.to==n.to;for(let n=!1,i=new P(e.doc,t,r[r.length-1].to);;)if(i.next(),i.done){if(n)return null;i=new P(e.doc,t,0,Math.max(0,r[r.length-1].from-1)),n=!0}else{if(n&&r.some(e=>e.from==i.value.from))continue;if(a){let t=e.wordAt(i.value.from);if(!t||t.from!=i.value.from||t.to!=i.value.to)continue}return i.value}}var Ot=({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(e=>e.from===e.to))return Et({state:e,dispatch:t});let r=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some(t=>e.sliceDoc(t.from,t.to)!=r))return!1;let i=Dt(e,r);return i?(t(e.update({selection:e.selection.addRange(y.range(i.from,i.to),!1),effects:l.scrollIntoView(i.to)})),!0):!1},I=w.define({combine(e){return p(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new $t(e),scrollToMatch:e=>l.scrollIntoView(e)})}}),kt=class{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||``,this.valid=!!this.search&&(!this.regexp||ht(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord,this.test=e.test}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(e,t)=>t==`n`?`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./dist-VPEWg0Ob.js","./dist-Doo91MTa.js","./dist-BSED50tI.js","./dist-BCvzlTeb.js","./dist-D1-dK0Dk.js","./dist-B3lARV_e.js","./dist-Bkn7JaJv.js","./dist-DSRCADL9.js","./dist-C8wdW7W4.js","./dist-CSNMpi-w.js","./dist-Bzb9nPam.js","./dist-74GtnE06.js","./dist-Bq8Z0WUT.js","./dist-Co8HE14w.js","./dist-cQSK4Xor.js","./dist-CqU98NzX.js","./dist-C0e9kfNh.js","./dist-CHSg_nUM.js","./dist-CSAH9iuE.js","./dist-DidT3Jay.js","./dist-PPAeaw4t.js","./dist-DdR2aYqj.js","./dist-Dwy75xI6.js","./dist-r5I9Jgww.js","./dist-D0dQAc9b.js","./dist-CZPTvk_g2.js","./dist-DAKGEzm0.js","./dockerfile-D8_6_FRV.js","./simple-mode-pOKc0mfx.js","./factor-Cz-hzBGH.js","./javascript-qUBHINSy.js","./javascript-gTK9fxz6.js","./nsis-QPGhLAeY.js","./pug-lkTEco3G.js","./dist-FC9LftvP.js","./dist-BMlUxhOz.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{t as e}from"./preload-helper-Bo9GmnuQ.js";import{$ as t,A as n,B as r,F as i,G as a,H as o,J as s,K as c,L as l,P as u,Q as d,R as f,St as p,Tt as m,V as h,W as g,Z as _,_t as ee,a as v,bt as te,c as ne,ct as y,et as re,f as ie,ft as ae,g as oe,gt as b,l as se,lt as x,mt as ce,nt as S,o as le,ot as C,pt as ue,q as de,rt as fe,st as pe,t as me,ut as w,v as he,w as ge,wt as _e,xt as ve,z as ye}from"./dist-BSED50tI.js";import{i as be,n as xe,r as Se}from"./dist-Doo91MTa.js";import{a as Ce,s as we}from"./dist-CSAH9iuE.js";import{t as Te}from"./dist-DAKGEzm0.js";import{a as Ee,c as De,i as Oe,n as ke,o as Ae,r as je,s as Me,t as Ne}from"./dist-CDUQ5ELn.js";import{d as Pe,i as Fe}from"./file-kind-DmKq2MvD.js";import{f as Ie}from"./runtime-config-DWTejofP.js";import{a as Le,c as T,d as E,f as Re,g as ze,h as Be,i as Ve,l as D,m as O,n as He,o as k,p as A,r as Ue,s as We,t as Ge,u as j}from"./yjs-provider-reset-guard-_Q3mj6tP.js";import{a as Ke,c as qe,d as Je,i as Ye,n as Xe,o as Ze,s as Qe,t as $e,u as et}from"./room-DI7DXGeS.js";function tt({body:e,user:t}){return{body:e,createdAt:Date.now(),id:Ye(`comment`),peerId:t?.peerId??``,reactions:[],userColor:t?.color??``,userName:t?.name??`Anonymous`}}function nt(e,t){return e instanceof k?e.get(t):e?.[t]}function rt(e=[]){return Array.isArray(e)?e.map(e=>({emoji:typeof e?.emoji==`string`?e.emoji:``,users:Array.isArray(e?.users)?e.users.map(e=>({reactedAt:Number.isFinite(e?.reactedAt)?e.reactedAt:Date.now(),userColor:typeof e?.userColor==`string`?e.userColor:``,userId:typeof e?.userId==`string`?e.userId:``,userName:typeof e?.userName==`string`&&e.userName?e.userName:`Anonymous`})).filter(e=>e.userId):[]})).filter(e=>e.emoji&&e.users.length>0):[]}function it(e,t){let n=t?.doc;if(!n)return null;let r=e?.anchor??e,i=r?.anchorKind===`text`?`text`:`line`,a=n.lines,o=Math.min(Math.max(Math.round(r?.startLine??1),1),a),s=Math.min(Math.max(Math.round(r?.endLine??o),o),a),c=n.line(o).from,l=n.line(s).to,u=Math.min(Math.max(Math.round(r?.startIndex??c),0),n.length),d=Math.min(Math.max(Math.round(r?.endIndex??l),u),n.length);return{anchorEndLine:s,anchorKind:i,anchorQuote:qe(r?.anchorQuote||n.sliceString(u,d)),anchorStartLine:o,endIndex:d,startIndex:u}}var at=class{constructor({getDoc:e,getEditorState:t,getLocalUser:n,onCommentsChange:r=null}){this.getDoc=e,this.getEditorState=t,this.getLocalUser=n,this.onCommentsChange=r,this.commentThreads=null,this.ydoc=null,this.ytext=null,this.handleCommentThreadsChange=null,this.handleTextChange=null}bind({commentThreads:e,ydoc:t,ytext:n}){this.unbind(),this.commentThreads=e,this.ydoc=t,this.ytext=n,this.handleCommentThreadsChange=()=>{this.emitCommentsChange()},this.handleTextChange=()=>{this.emitCommentsChange()},this.commentThreads.observeDeep(this.handleCommentThreadsChange),this.ytext?.observe?.(this.handleTextChange),this.emitCommentsChange()}unbind(){this.commentThreads&&this.handleCommentThreadsChange&&this.commentThreads.unobserveDeep(this.handleCommentThreadsChange),this.ytext&&this.handleTextChange&&this.ytext.unobserve(this.handleTextChange),this.commentThreads=null,this.ydoc=null,this.ytext=null,this.handleCommentThreadsChange=null,this.handleTextChange=null}emitCommentsChange(){this.onCommentsChange?.(this.getCommentThreads())}refreshComments(){this.emitCommentsChange()}getCommentThreads(){return this.commentThreads?et(this.commentThreads).map(e=>this.resolveCommentThread(e)).filter(Boolean):[]}createCommentThread({anchor:e,body:t}){let n=this.getEditorState();if(!n||!this.commentThreads||!this.ytext||!this.ydoc)return null;let r=Qe(t),i=it(e,n);if(!r||!i)return null;let a=Ke({anchorEnd:E(j(this.ytext,i.endIndex)),anchorEndLine:i.anchorEndLine,anchorKind:i.anchorKind,anchorQuote:i.anchorQuote,anchorStart:E(j(this.ytext,i.startIndex)),anchorStartLine:i.anchorStartLine,createdAt:Date.now(),createdByColor:this.getLocalUser()?.color??``,createdByName:this.getLocalUser()?.name??`Anonymous`,createdByPeerId:this.getLocalUser()?.peerId??``,id:Ye(`thread`),messages:[tt({body:r,user:this.getLocalUser()})]});return a?(this.ydoc.transact(()=>{this.commentThreads.push([a])},`comment-thread-create`),a.get(`id`)):null}replyToCommentThread(e,t){let n=Qe(t);if(!n||!this.ydoc)return null;let r=this.findSharedCommentThread(e)?.get(`messages`);if(!(r instanceof Le))return null;let i=tt({body:n,user:this.getLocalUser()});return this.ydoc.transact(()=>{r.push([i])},`comment-thread-reply`),i.id}toggleCommentReaction(e,t,n){if(!this.ydoc||!e||!t||typeof n!=`string`||!n.trim())return!1;let r=this.getLocalUser?.(),i=typeof r?.userId==`string`?r.userId:``;if(!i)return!1;let a=this.findSharedCommentThread(e)?.get(`messages`);if(!(a instanceof Le))return!1;let o=a.toArray(),s=o.findIndex(e=>nt(e,`id`)===t);if(s<0)return!1;let c=o[s]instanceof k?o[s].toJSON():{...o[s]},l=rt(c.reactions),u=l.findIndex(e=>e.emoji===n);if(u>=0){let e=l[u].users.filter(e=>e.userId!==i);e.length===l[u].users.length&&e.push({reactedAt:Date.now(),userColor:r?.color??``,userId:i,userName:r?.name??`Anonymous`}),e.length===0?l.splice(u,1):l[u]={...l[u],users:e}}else l.push({emoji:n,users:[{reactedAt:Date.now(),userColor:r?.color??``,userId:i,userName:r?.name??`Anonymous`}]});let d={...c,reactions:l};return this.ydoc.transact(()=>{a.delete(s,1),a.insert(s,[d])},`comment-reaction-toggle`),!0}deleteCommentThread(e){if(!this.commentThreads||!this.ydoc)return!1;let t=this.findSharedCommentThreadIndex(e);return t<0?!1:(this.ydoc.transact(()=>{this.commentThreads.delete(t,1)},`comment-thread-resolve`),!0)}findSharedCommentThread(e){return this.commentThreads?this.commentThreads.toArray().find(t=>t instanceof k&&t.get(`id`)===e)??null:null}findSharedCommentThreadIndex(e){return this.commentThreads?this.commentThreads.toArray().findIndex(t=>t instanceof k&&t.get(`id`)===e):-1}resolveCommentThread(e){let t=this.getEditorState();if(!e||!t||!this.ydoc)return null;let n=Ze(e);if(!n)return null;let r=this.resolveCommentPosition(n.anchorStart),i=this.resolveCommentPosition(n.anchorEnd),a=r?.index??t.doc.line(n.anchorStartLine).from,o=Math.min(Math.max(n.anchorEndLine??n.anchorStartLine,n.anchorStartLine),t.doc.lines),s=i?.index??t.doc.line(o).to,c=t.doc.lineAt(a).number,l=Math.min(Math.max(s,a),t.doc.length),u=t.doc.lineAt(l).number,d=Je(t.doc.sliceString(a,n.anchorKind===`text`?Math.max(s,a):t.doc.line(u).to))||n.anchorQuote;return{...e,anchor:{endIndex:s,endLine:u,excerpt:d,quote:n.anchorQuote,startIndex:a,startLine:c,kind:n.anchorKind},anchorEnd:n.anchorEnd,anchorEndLine:n.anchorEndLine,anchorKind:n.anchorKind,anchorQuote:n.anchorQuote,anchorStart:n.anchorStart,anchorStartLine:n.anchorStartLine}}resolveCommentPosition(e){if(!e||!this.ydoc||!this.ytext)return null;try{let t=T(D(e),this.ydoc);return!t||t.type!==this.ytext?null:t}catch{return null}}},ot=class{constructor({localUser:e=null,onAwarenessChange:t=null,onConnectionChange:n=null,onInitialSync:r=null,preferredUserName:i,resolveAwarenessCursor:a=null}){this.onAwarenessChange=t,this.onConnectionChange=n,this.onInitialSync=r,this.preferredUserName=i,this.providedLocalUser=e,this.resolveAwarenessCursor=a??(()=>null),this.provider=null,this.awareness=null,this.localUser=null,this.ydoc=null,this.ytext=null,this.commentThreads=null,this.wsBaseUrl=``,this.initialSyncComplete=!1,this.initialSyncPromise=Promise.resolve(),this.resolveInitialSync=null}normalizeViewport(e){if(!e||typeof e!=`object`)return null;let t=Number(e.topLine),n=Number(e.viewportRatio);return!Number.isFinite(t)||t<1?null:{topLine:Math.max(1,Math.round(t)),viewportRatio:Number.isFinite(n)?Math.min(Math.max(n,0),1):.35}}async initialize(e){this.wsBaseUrl=Ie(),this.ydoc=new Ue,this.ytext=this.ydoc.getText(`codemirror`),this.commentThreads=this.ydoc.getArray(`comments`);let t=new Ve(this.ytext),n=new He(this.wsBaseUrl,e,this.ydoc,{disableBc:!0,maxBackoffTime:5e3});Ge(n);let r=n.awareness,i=this.providedLocalUser??$e(this.preferredUserName);this.provider=n,this.awareness=r,this.localUser=i,this.initialSyncComplete=!1,this.initialSyncPromise=new Promise(e=>{this.resolveInitialSync=e}),r.setLocalStateField(`user`,i),r.on(`change`,()=>{this.onAwarenessChange?.(this.collectUsers(this.resolveAwarenessCursor))}),this.trackConnectionStatus();let a=!1;return n.on(`sync`,e=>{!e||a||(a=!0,this.initialSyncComplete=!0,this.resolveInitialSync?.(),this.resolveInitialSync=null,this.onInitialSync?.())}),{awareness:r,commentThreads:this.commentThreads,localUser:this.localUser,undoManager:t,ydoc:this.ydoc,ytext:this.ytext}}destroy(){this.resolveInitialSync?.(),this.resolveInitialSync=null,this.initialSyncComplete=!1,this.initialSyncPromise=Promise.resolve(),this.provider?.disconnect(),this.provider?.destroy(),this.provider=null,this.awareness=null,this.localUser=null,this.ydoc?.destroy(),this.ydoc=null,this.ytext=null,this.commentThreads=null}waitForInitialSync(e=1500){return this.initialSyncComplete?Promise.resolve():e==null||e===!1?this.initialSyncPromise:Promise.race([this.initialSyncPromise,new Promise(t=>{window.setTimeout(t,e)})])}getText(){return this.ytext?.toString()??``}getLocalUser(){return this.localUser}setUserName(e){let t=Xe(e);return!t||!this.awareness||!this.localUser?null:(this.localUser={...this.localUser,name:t},this.awareness.setLocalStateField(`user`,this.localUser),t)}getUserCursor(e,t){return this.awareness?t(this.awareness.getStates().get(e)?.cursor):null}getUserViewport(e){if(!this.awareness)return null;let t=this.awareness.getStates().get(e);return this.normalizeViewport(t?.viewport)}setLocalViewport(e){if(!this.awareness)return null;let t=this.normalizeViewport(e);return this.awareness.setLocalStateField(`viewport`,t),t}collectUsers(e=()=>null){if(!this.awareness)return[];let t=[];return this.awareness.getStates().forEach((n,r)=>{if(!n.user)return;let i=e(n.cursor);t.push({...i??{},...n.user,clientId:r,hasCursor:!!i,isLocal:r===this.awareness.clientID,viewport:this.normalizeViewport(n.viewport)})}),t}trackConnectionStatus(){if(!this.provider)return;let e=0,t=!1;this.provider.on(`status`,({status:n})=>{n===`connecting`&&(e+=1);let r=n===`connected`&&!t;n===`connected`&&(e=0,t=!0),this.onConnectionChange?.({attempts:e,firstConnection:r,hasEverConnected:t,status:n,unreachable:!t&&e>=3,wsBaseUrl:this.wsBaseUrl})})}};function M(e){return new le(ne.define(e))}function N(t){return e(()=>import(`./dist-VPEWg0Ob.js`).then(e=>e.sql({dialect:e[t]})),__vite__mapDeps([0,1,2,3]),import.meta.url)}var st=[v.of({name:`C`,extensions:[`c`,`h`,`ino`],load(){return e(()=>import(`./dist-D1-dK0Dk.js`).then(e=>e.cpp()),__vite__mapDeps([4,2,3]),import.meta.url)}}),v.of({name:`C++`,alias:[`cpp`],extensions:[`cpp`,`c++`,`cc`,`cxx`,`hpp`,`h++`,`hh`,`hxx`],load(){return e(()=>import(`./dist-D1-dK0Dk.js`).then(e=>e.cpp()),__vite__mapDeps([4,2,3]),import.meta.url)}}),v.of({name:`CQL`,alias:[`cassandra`],extensions:[`cql`],load(){return N(`Cassandra`)}}),v.of({name:`CSS`,extensions:[`css`],load(){return e(()=>import(`./dist-B3lARV_e.js`).then(e=>e.css()),__vite__mapDeps([5,6,2,3]),import.meta.url)}}),v.of({name:`Go`,extensions:[`go`],load(){return e(()=>import(`./dist-DSRCADL9.js`).then(e=>e.go()),__vite__mapDeps([7,1,2,3]),import.meta.url)}}),v.of({name:`HTML`,alias:[`xhtml`],extensions:[`html`,`htm`,`handlebars`,`hbs`],load(){return e(()=>import(`./dist-C8wdW7W4.js`).then(e=>e.html()),__vite__mapDeps([8,9,6,2,3,10,1]),import.meta.url)}}),v.of({name:`Java`,extensions:[`java`],load(){return e(()=>import(`./dist-74GtnE06.js`).then(e=>e.java()),__vite__mapDeps([11,2,3]),import.meta.url)}}),v.of({name:`JavaScript`,alias:[`ecmascript`,`js`,`node`],extensions:[`js`,`mjs`,`cjs`],load(){return e(()=>import(`./dist-Bq8Z0WUT.js`).then(e=>e.javascript()),__vite__mapDeps([12,10,1,2,3]),import.meta.url)}}),v.of({name:`Jinja`,extensions:[`j2`,`jinja`,`jinja2`],load(){return e(()=>import(`./dist-Co8HE14w.js`).then(e=>e.jinja()),__vite__mapDeps([13,9,6,2,3,10,1]),import.meta.url)}}),v.of({name:`JSON`,alias:[`json5`],extensions:[`json`,`map`],load(){return e(()=>import(`./dist-cQSK4Xor.js`).then(e=>e.json()),__vite__mapDeps([14,2,3]),import.meta.url)}}),v.of({name:`JSX`,extensions:[`jsx`],load(){return e(()=>import(`./dist-Bq8Z0WUT.js`).then(e=>e.javascript({jsx:!0})),__vite__mapDeps([12,10,1,2,3]),import.meta.url)}}),v.of({name:`LESS`,extensions:[`less`],load(){return e(()=>import(`./dist-CqU98NzX.js`).then(e=>e.less()),__vite__mapDeps([15,6,2,3]),import.meta.url)}}),v.of({name:`Liquid`,extensions:[`liquid`],load(){return e(()=>import(`./dist-C0e9kfNh.js`).then(e=>e.liquid()),__vite__mapDeps([16,9,6,2,3,10,1]),import.meta.url)}}),v.of({name:`MariaDB SQL`,load(){return N(`MariaSQL`)}}),v.of({name:`Markdown`,extensions:[`md`,`markdown`,`mkd`],load(){return e(()=>import(`./dist-CHSg_nUM.js`).then(e=>e.markdown()),__vite__mapDeps([17,18,1,2,9,6,3,10]),import.meta.url)}}),v.of({name:`MS SQL`,load(){return N(`MSSQL`)}}),v.of({name:`MySQL`,load(){return N(`MySQL`)}}),v.of({name:`PHP`,extensions:[`php`,`php3`,`php4`,`php5`,`php7`,`phtml`],load(){return e(()=>import(`./dist-DidT3Jay.js`).then(e=>e.php()),__vite__mapDeps([19,9,6,2,3,10,1]),import.meta.url)}}),v.of({name:`PLSQL`,extensions:[`pls`],load(){return N(`PLSQL`)}}),v.of({name:`PostgreSQL`,load(){return N(`PostgreSQL`)}}),v.of({name:`Python`,extensions:[`BUILD`,`bzl`,`py`,`pyw`],filename:/^(BUCK|BUILD)$/,load(){return e(()=>import(`./dist-PPAeaw4t.js`).then(e=>e.python()),__vite__mapDeps([20,1,2,3]),import.meta.url)}}),v.of({name:`Rust`,extensions:[`rs`],load(){return e(()=>import(`./dist-DdR2aYqj.js`).then(e=>e.rust()),__vite__mapDeps([21,2,3]),import.meta.url)}}),v.of({name:`Sass`,extensions:[`sass`],load(){return e(()=>import(`./dist-Dwy75xI6.js`).then(e=>e.sass({indented:!0})),__vite__mapDeps([22,6,2,3]),import.meta.url)}}),v.of({name:`SCSS`,extensions:[`scss`],load(){return e(()=>import(`./dist-Dwy75xI6.js`).then(e=>e.sass()),__vite__mapDeps([22,6,2,3]),import.meta.url)}}),v.of({name:`SQL`,extensions:[`sql`],load(){return N(`StandardSQL`)}}),v.of({name:`SQLite`,load(){return N(`SQLite`)}}),v.of({name:`TSX`,extensions:[`tsx`],load(){return e(()=>import(`./dist-Bq8Z0WUT.js`).then(e=>e.javascript({jsx:!0,typescript:!0})),__vite__mapDeps([12,10,1,2,3]),import.meta.url)}}),v.of({name:`TypeScript`,alias:[`ts`],extensions:[`ts`,`mts`,`cts`],load(){return e(()=>import(`./dist-Bq8Z0WUT.js`).then(e=>e.javascript({typescript:!0})),__vite__mapDeps([12,10,1,2,3]),import.meta.url)}}),v.of({name:`WebAssembly`,extensions:[`wat`,`wast`],load(){return e(()=>import(`./dist-r5I9Jgww.js`).then(e=>e.wast()),__vite__mapDeps([23,2,3]),import.meta.url)}}),v.of({name:`XML`,alias:[`rss`,`wsdl`,`xsd`],extensions:[`xml`,`xsl`,`xsd`,`svg`],load(){return e(()=>import(`./dist-D0dQAc9b.js`).then(e=>e.xml()),__vite__mapDeps([24,2,3]),import.meta.url)}}),v.of({name:`YAML`,alias:[`yml`],extensions:[`yaml`,`yml`],load(){return e(()=>import(`./dist-CZPTvk_g2.js`).then(e=>e.yaml()),__vite__mapDeps([25,26,2,3]),import.meta.url)}}),v.of({name:`APL`,extensions:[`dyalog`,`apl`],load(){return e(()=>import(`./apl-C1JYSI8J.js`).then(e=>M(e.apl)),[],import.meta.url)}}),v.of({name:`PGP`,alias:[`asciiarmor`],extensions:[`asc`,`pgp`,`sig`],load(){return e(()=>import(`./asciiarmor-DHW75j1s.js`).then(e=>M(e.asciiArmor)),[],import.meta.url)}}),v.of({name:`ASN.1`,extensions:[`asn`,`asn1`],load(){return e(()=>import(`./asn1-CQiG40kG.js`).then(e=>M(e.asn1({}))),[],import.meta.url)}}),v.of({name:`Asterisk`,filename:/^extensions\.conf$/i,load(){return e(()=>import(`./asterisk-BWExh0n4.js`).then(e=>M(e.asterisk)),[],import.meta.url)}}),v.of({name:`Brainfuck`,extensions:[`b`,`bf`],load(){return e(()=>import(`./brainfuck-CTNFyOLg.js`).then(e=>M(e.brainfuck)),[],import.meta.url)}}),v.of({name:`Cobol`,extensions:[`cob`,`cpy`],load(){return e(()=>import(`./cobol-DP4QggbL.js`).then(e=>M(e.cobol)),[],import.meta.url)}}),v.of({name:`C#`,alias:[`csharp`,`cs`],extensions:[`cs`],load(){return e(()=>import(`./clike-BFTLRaGS.js`).then(e=>M(e.csharp)),[],import.meta.url)}}),v.of({name:`Clojure`,extensions:[`clj`,`cljc`,`cljx`],load(){return e(()=>import(`./clojure-D-DYVqu7.js`).then(e=>M(e.clojure)),[],import.meta.url)}}),v.of({name:`ClojureScript`,extensions:[`cljs`],load(){return e(()=>import(`./clojure-D-DYVqu7.js`).then(e=>M(e.clojure)),[],import.meta.url)}}),v.of({name:`Closure Stylesheets (GSS)`,extensions:[`gss`],load(){return e(()=>import(`./css-CmhPNxBE.js`).then(e=>M(e.gss)),[],import.meta.url)}}),v.of({name:`CMake`,extensions:[`cmake`,`cmake.in`],filename:/^CMakeLists\.txt$/,load(){return e(()=>import(`./cmake-DtGL-Unu.js`).then(e=>M(e.cmake)),[],import.meta.url)}}),v.of({name:`CoffeeScript`,alias:[`coffee`,`coffee-script`],extensions:[`coffee`],load(){return e(()=>import(`./coffeescript-B7GZajzV.js`).then(e=>M(e.coffeeScript)),[],import.meta.url)}}),v.of({name:`Common Lisp`,alias:[`lisp`],extensions:[`cl`,`lisp`,`el`],load(){return e(()=>import(`./commonlisp-COlJYiQT.js`).then(e=>M(e.commonLisp)),[],import.meta.url)}}),v.of({name:`Cypher`,extensions:[`cyp`,`cypher`],load(){return e(()=>import(`./cypher-DEGl2llJ.js`).then(e=>M(e.cypher)),[],import.meta.url)}}),v.of({name:`Cython`,extensions:[`pyx`,`pxd`,`pxi`],load(){return e(()=>import(`./python-BUyhM0Ew.js`).then(e=>M(e.cython)),[],import.meta.url)}}),v.of({name:`Crystal`,extensions:[`cr`],load(){return e(()=>import(`./crystal-I_dE9xG-.js`).then(e=>M(e.crystal)),[],import.meta.url)}}),v.of({name:`D`,extensions:[`d`],load(){return e(()=>import(`./d-BspB0dox.js`).then(e=>M(e.d)),[],import.meta.url)}}),v.of({name:`Dart`,extensions:[`dart`],load(){return e(()=>import(`./clike-BFTLRaGS.js`).then(e=>M(e.dart)),[],import.meta.url)}}),v.of({name:`diff`,extensions:[`diff`,`patch`],load(){return e(()=>import(`./diff-BWuPUsEo.js`).then(e=>M(e.diff)),[],import.meta.url)}}),v.of({name:`Dockerfile`,filename:/^Dockerfile$/,load(){return e(()=>import(`./dockerfile-D8_6_FRV.js`).then(e=>M(e.dockerFile)),__vite__mapDeps([27,28]),import.meta.url)}}),v.of({name:`DTD`,extensions:[`dtd`],load(){return e(()=>import(`./dtd-C6brJFPg.js`).then(e=>M(e.dtd)),[],import.meta.url)}}),v.of({name:`Dylan`,extensions:[`dylan`,`dyl`,`intr`],load(){return e(()=>import(`./dylan-Bft86ZSB.js`).then(e=>M(e.dylan)),[],import.meta.url)}}),v.of({name:`EBNF`,load(){return e(()=>import(`./ebnf-D6ifG44A.js`).then(e=>M(e.ebnf)),[],import.meta.url)}}),v.of({name:`ECL`,extensions:[`ecl`],load(){return e(()=>import(`./ecl-D9rhJ9-u.js`).then(e=>M(e.ecl)),[],import.meta.url)}}),v.of({name:`edn`,extensions:[`edn`],load(){return e(()=>import(`./clojure-D-DYVqu7.js`).then(e=>M(e.clojure)),[],import.meta.url)}}),v.of({name:`Eiffel`,extensions:[`e`],load(){return e(()=>import(`./eiffel-DwxtewZF.js`).then(e=>M(e.eiffel)),[],import.meta.url)}}),v.of({name:`Elm`,extensions:[`elm`],load(){return e(()=>import(`./elm-B1TncobV.js`).then(e=>M(e.elm)),[],import.meta.url)}}),v.of({name:`Erlang`,extensions:[`erl`],load(){return e(()=>import(`./erlang-BDJZNtt8.js`).then(e=>M(e.erlang)),[],import.meta.url)}}),v.of({name:`Esper`,load(){return e(()=>import(`./sql-GL7dVWcd.js`).then(e=>M(e.esper)),[],import.meta.url)}}),v.of({name:`Factor`,extensions:[`factor`],load(){return e(()=>import(`./factor-Cz-hzBGH.js`).then(e=>M(e.factor)),__vite__mapDeps([29,28]),import.meta.url)}}),v.of({name:`FCL`,load(){return e(()=>import(`./fcl-CUXJFJn1.js`).then(e=>M(e.fcl)),[],import.meta.url)}}),v.of({name:`Forth`,extensions:[`forth`,`fth`,`4th`],load(){return e(()=>import(`./forth-nvhcMz63.js`).then(e=>M(e.forth)),[],import.meta.url)}}),v.of({name:`Fortran`,extensions:[`f`,`for`,`f77`,`f90`,`f95`],load(){return e(()=>import(`./fortran-BZID-z10.js`).then(e=>M(e.fortran)),[],import.meta.url)}}),v.of({name:`F#`,alias:[`fsharp`],extensions:[`fs`],load(){return e(()=>import(`./mllike-C0p7lv48.js`).then(e=>M(e.fSharp)),[],import.meta.url)}}),v.of({name:`Gas`,extensions:[`s`],load(){return e(()=>import(`./gas-DjQsZDGE.js`).then(e=>M(e.gas)),[],import.meta.url)}}),v.of({name:`Gherkin`,extensions:[`feature`],load(){return e(()=>import(`./gherkin-S0kHlzux.js`).then(e=>M(e.gherkin)),[],import.meta.url)}}),v.of({name:`Groovy`,extensions:[`groovy`,`gradle`],filename:/^Jenkinsfile$/,load(){return e(()=>import(`./groovy-Di--Vb9Z.js`).then(e=>M(e.groovy)),[],import.meta.url)}}),v.of({name:`Haskell`,extensions:[`hs`],load(){return e(()=>import(`./haskell-C6qH3-aI.js`).then(e=>M(e.haskell)),[],import.meta.url)}}),v.of({name:`Haxe`,extensions:[`hx`],load(){return e(()=>import(`./haxe-CcPA1xnA.js`).then(e=>M(e.haxe)),[],import.meta.url)}}),v.of({name:`HXML`,extensions:[`hxml`],load(){return e(()=>import(`./haxe-CcPA1xnA.js`).then(e=>M(e.hxml)),[],import.meta.url)}}),v.of({name:`HTTP`,load(){return e(()=>import(`./http-DG1Y9fpK.js`).then(e=>M(e.http)),[],import.meta.url)}}),v.of({name:`IDL`,extensions:[`pro`],load(){return e(()=>import(`./idl-B64p3NTJ.js`).then(e=>M(e.idl)),[],import.meta.url)}}),v.of({name:`JSON-LD`,alias:[`jsonld`],extensions:[`jsonld`],load(){return e(()=>import(`./javascript-qUBHINSy.js`).then(e=>M(e.jsonld)),__vite__mapDeps([30,31]),import.meta.url)}}),v.of({name:`Julia`,extensions:[`jl`],load(){return e(()=>import(`./julia-B22G9Bym.js`).then(e=>M(e.julia)),[],import.meta.url)}}),v.of({name:`Kotlin`,extensions:[`kt`,`kts`],load(){return e(()=>import(`./clike-BFTLRaGS.js`).then(e=>M(e.kotlin)),[],import.meta.url)}}),v.of({name:`LiveScript`,alias:[`ls`],extensions:[`ls`],load(){return e(()=>import(`./livescript-CkcuHqeS.js`).then(e=>M(e.liveScript)),[],import.meta.url)}}),v.of({name:`Lua`,extensions:[`lua`],load(){return e(()=>import(`./lua-Cg0FqIlO.js`).then(e=>M(e.lua)),[],import.meta.url)}}),v.of({name:`mIRC`,extensions:[`mrc`],load(){return e(()=>import(`./mirc-BVG2S5rO.js`).then(e=>M(e.mirc)),[],import.meta.url)}}),v.of({name:`Mathematica`,extensions:[`m`,`nb`,`wl`,`wls`],load(){return e(()=>import(`./mathematica-CKVhKnoY.js`).then(e=>M(e.mathematica)),[],import.meta.url)}}),v.of({name:`Modelica`,extensions:[`mo`],load(){return e(()=>import(`./modelica-vJ-Qa9jV.js`).then(e=>M(e.modelica)),[],import.meta.url)}}),v.of({name:`MUMPS`,extensions:[`mps`],load(){return e(()=>import(`./mumps-D0KfUTSd.js`).then(e=>M(e.mumps)),[],import.meta.url)}}),v.of({name:`Mbox`,extensions:[`mbox`],load(){return e(()=>import(`./mbox-DANyzFJ2.js`).then(e=>M(e.mbox)),[],import.meta.url)}}),v.of({name:`Nginx`,filename:/nginx.*\.conf$/i,load(){return e(()=>import(`./nginx-DkVceJrH.js`).then(e=>M(e.nginx)),[],import.meta.url)}}),v.of({name:`NSIS`,extensions:[`nsh`,`nsi`],load(){return e(()=>import(`./nsis-QPGhLAeY.js`).then(e=>M(e.nsis)),__vite__mapDeps([32,28]),import.meta.url)}}),v.of({name:`NTriples`,extensions:[`nt`,`nq`],load(){return e(()=>import(`./ntriples-BBuCIfS0.js`).then(e=>M(e.ntriples)),[],import.meta.url)}}),v.of({name:`Objective-C`,alias:[`objective-c`,`objc`],extensions:[`m`],load(){return e(()=>import(`./clike-BFTLRaGS.js`).then(e=>M(e.objectiveC)),[],import.meta.url)}}),v.of({name:`Objective-C++`,alias:[`objective-c++`,`objc++`],extensions:[`mm`],load(){return e(()=>import(`./clike-BFTLRaGS.js`).then(e=>M(e.objectiveCpp)),[],import.meta.url)}}),v.of({name:`OCaml`,extensions:[`ml`,`mli`,`mll`,`mly`],load(){return e(()=>import(`./mllike-C0p7lv48.js`).then(e=>M(e.oCaml)),[],import.meta.url)}}),v.of({name:`Octave`,extensions:[`m`],load(){return e(()=>import(`./octave-BTv2CqSQ.js`).then(e=>M(e.octave)),[],import.meta.url)}}),v.of({name:`Oz`,extensions:[`oz`],load(){return e(()=>import(`./oz-D8SjVDNU.js`).then(e=>M(e.oz)),[],import.meta.url)}}),v.of({name:`Pascal`,extensions:[`p`,`pas`],load(){return e(()=>import(`./pascal-T-tfhVyx.js`).then(e=>M(e.pascal)),[],import.meta.url)}}),v.of({name:`Perl`,extensions:[`pl`,`pm`],load(){return e(()=>import(`./perl-BDrCkHRd.js`).then(e=>M(e.perl)),[],import.meta.url)}}),v.of({name:`Pig`,extensions:[`pig`],load(){return e(()=>import(`./pig-BEyI4fPq.js`).then(e=>M(e.pig)),[],import.meta.url)}}),v.of({name:`PowerShell`,extensions:[`ps1`,`psd1`,`psm1`],load(){return e(()=>import(`./powershell-DtnFc6GG.js`).then(e=>M(e.powerShell)),[],import.meta.url)}}),v.of({name:`Properties files`,alias:[`ini`,`properties`],extensions:[`properties`,`ini`,`in`],load(){return e(()=>import(`./properties-DWUvbxV9.js`).then(e=>M(e.properties)),[],import.meta.url)}}),v.of({name:`ProtoBuf`,extensions:[`proto`],load(){return e(()=>import(`./protobuf-CQGoYyfE.js`).then(e=>M(e.protobuf)),[],import.meta.url)}}),v.of({name:`Pug`,alias:[`jade`],extensions:[`pug`,`jade`],load(){return e(()=>import(`./pug-lkTEco3G.js`).then(e=>M(e.pug)),__vite__mapDeps([33,31]),import.meta.url)}}),v.of({name:`Puppet`,extensions:[`pp`],load(){return e(()=>import(`./puppet-Dd-qWO3p.js`).then(e=>M(e.puppet)),[],import.meta.url)}}),v.of({name:`Q`,extensions:[`q`],load(){return e(()=>import(`./q-Dls1OX0D.js`).then(e=>M(e.q)),[],import.meta.url)}}),v.of({name:`R`,alias:[`rscript`],extensions:[`r`,`R`],load(){return e(()=>import(`./r-DeZ8Mdev.js`).then(e=>M(e.r)),[],import.meta.url)}}),v.of({name:`RPM Changes`,load(){return e(()=>import(`./rpm-CjWxLM68.js`).then(e=>M(e.rpmChanges)),[],import.meta.url)}}),v.of({name:`RPM Spec`,extensions:[`spec`],load(){return e(()=>import(`./rpm-CjWxLM68.js`).then(e=>M(e.rpmSpec)),[],import.meta.url)}}),v.of({name:`Ruby`,alias:[`jruby`,`macruby`,`rake`,`rb`,`rbx`],extensions:[`rb`],filename:/^(Gemfile|Rakefile)$/,load(){return e(()=>import(`./ruby-CB34f2Gf.js`).then(e=>M(e.ruby)),[],import.meta.url)}}),v.of({name:`SAS`,extensions:[`sas`],load(){return e(()=>import(`./sas-Bji4HDQq.js`).then(e=>M(e.sas)),[],import.meta.url)}}),v.of({name:`Scala`,extensions:[`scala`],load(){return e(()=>import(`./clike-BFTLRaGS.js`).then(e=>M(e.scala)),[],import.meta.url)}}),v.of({name:`Scheme`,extensions:[`scm`,`ss`],load(){return e(()=>import(`./scheme-C3elI80V.js`).then(e=>M(e.scheme)),[],import.meta.url)}}),v.of({name:`Shell`,alias:[`bash`,`sh`,`zsh`],extensions:[`sh`,`ksh`,`bash`],filename:/^PKGBUILD$/,load(){return e(()=>import(`./shell-DUveK2Hb.js`).then(e=>M(e.shell)),[],import.meta.url)}}),v.of({name:`Sieve`,extensions:[`siv`,`sieve`],load(){return e(()=>import(`./sieve-2ogwMVx4.js`).then(e=>M(e.sieve)),[],import.meta.url)}}),v.of({name:`Smalltalk`,extensions:[`st`],load(){return e(()=>import(`./smalltalk-BuGhc6lW.js`).then(e=>M(e.smalltalk)),[],import.meta.url)}}),v.of({name:`Solr`,load(){return e(()=>import(`./solr-DTxshpm8.js`).then(e=>M(e.solr)),[],import.meta.url)}}),v.of({name:`SML`,extensions:[`sml`,`sig`,`fun`,`smackspec`],load(){return e(()=>import(`./mllike-C0p7lv48.js`).then(e=>M(e.sml)),[],import.meta.url)}}),v.of({name:`SPARQL`,alias:[`sparul`],extensions:[`rq`,`sparql`],load(){return e(()=>import(`./sparql-vm8qNO8J.js`).then(e=>M(e.sparql)),[],import.meta.url)}}),v.of({name:`Spreadsheet`,alias:[`excel`,`formula`],load(){return e(()=>import(`./spreadsheet-C6Vbtl9-.js`).then(e=>M(e.spreadsheet)),[],import.meta.url)}}),v.of({name:`Squirrel`,extensions:[`nut`],load(){return e(()=>import(`./clike-BFTLRaGS.js`).then(e=>M(e.squirrel)),[],import.meta.url)}}),v.of({name:`Stylus`,extensions:[`styl`],load(){return e(()=>import(`./stylus-D1SZIMDs.js`).then(e=>M(e.stylus)),[],import.meta.url)}}),v.of({name:`Swift`,extensions:[`swift`],load(){return e(()=>import(`./swift-CKcKnWv9.js`).then(e=>M(e.swift)),[],import.meta.url)}}),v.of({name:`sTeX`,load(){return e(()=>import(`./stex-CEwW0Q_0.js`).then(e=>M(e.stex)),[],import.meta.url)}}),v.of({name:`LaTeX`,alias:[`tex`],extensions:[`text`,`ltx`,`tex`],load(){return e(()=>import(`./stex-CEwW0Q_0.js`).then(e=>M(e.stex)),[],import.meta.url)}}),v.of({name:`SystemVerilog`,extensions:[`v`,`sv`,`svh`],load(){return e(()=>import(`./verilog-DSARZZPc.js`).then(e=>M(e.verilog)),[],import.meta.url)}}),v.of({name:`Tcl`,extensions:[`tcl`],load(){return e(()=>import(`./tcl-SPk7uiDB.js`).then(e=>M(e.tcl)),[],import.meta.url)}}),v.of({name:`Textile`,extensions:[`textile`],load(){return e(()=>import(`./textile-C48beRus.js`).then(e=>M(e.textile)),[],import.meta.url)}}),v.of({name:`TiddlyWiki`,load(){return e(()=>import(`./tiddlywiki-CiImjFLN.js`).then(e=>M(e.tiddlyWiki)),[],import.meta.url)}}),v.of({name:`Tiki wiki`,load(){return e(()=>import(`./tiki-HkXZ4BIW.js`).then(e=>M(e.tiki)),[],import.meta.url)}}),v.of({name:`TOML`,extensions:[`toml`],load(){return e(()=>import(`./toml-BmfpMy1_.js`).then(e=>M(e.toml)),[],import.meta.url)}}),v.of({name:`Troff`,extensions:[`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`],load(){return e(()=>import(`./troff-BjbEOT5E.js`).then(e=>M(e.troff)),[],import.meta.url)}}),v.of({name:`TTCN`,extensions:[`ttcn`,`ttcn3`,`ttcnpp`],load(){return e(()=>import(`./ttcn-NA-V4KnY.js`).then(e=>M(e.ttcn)),[],import.meta.url)}}),v.of({name:`TTCN_CFG`,extensions:[`cfg`],load(){return e(()=>import(`./ttcn-cfg-TPHncdGN.js`).then(e=>M(e.ttcnCfg)),[],import.meta.url)}}),v.of({name:`Turtle`,extensions:[`ttl`],load(){return e(()=>import(`./turtle-BkP3ExOG.js`).then(e=>M(e.turtle)),[],import.meta.url)}}),v.of({name:`Web IDL`,extensions:[`webidl`],load(){return e(()=>import(`./webidl-DttrYZRT.js`).then(e=>M(e.webIDL)),[],import.meta.url)}}),v.of({name:`VB.NET`,extensions:[`vb`],load(){return e(()=>import(`./vb-C19AQWqO.js`).then(e=>M(e.vb)),[],import.meta.url)}}),v.of({name:`VBScript`,extensions:[`vbs`],load(){return e(()=>import(`./vbscript-CHJk3s95.js`).then(e=>M(e.vbScript)),[],import.meta.url)}}),v.of({name:`Velocity`,extensions:[`vtl`],load(){return e(()=>import(`./velocity-Ya0P4sQU.js`).then(e=>M(e.velocity)),[],import.meta.url)}}),v.of({name:`Verilog`,extensions:[`v`],load(){return e(()=>import(`./verilog-DSARZZPc.js`).then(e=>M(e.verilog)),[],import.meta.url)}}),v.of({name:`VHDL`,extensions:[`vhd`,`vhdl`],load(){return e(()=>import(`./vhdl-CnYyYTpa.js`).then(e=>M(e.vhdl)),[],import.meta.url)}}),v.of({name:`XQuery`,extensions:[`xy`,`xquery`,`xq`,`xqm`,`xqy`],load(){return e(()=>import(`./xquery-CEDTd8qs.js`).then(e=>M(e.xQuery)),[],import.meta.url)}}),v.of({name:`Yacas`,extensions:[`ys`],load(){return e(()=>import(`./yacas-C7dxlPB0.js`).then(e=>M(e.yacas)),[],import.meta.url)}}),v.of({name:`Z80`,extensions:[`z80`],load(){return e(()=>import(`./z80-BqEfFSnA.js`).then(e=>M(e.z80)),[],import.meta.url)}}),v.of({name:`MscGen`,extensions:[`mscgen`,`mscin`,`msc`],load(){return e(()=>import(`./mscgen-vUD-SWGJ.js`).then(e=>M(e.mscgen)),[],import.meta.url)}}),v.of({name:`Xù`,extensions:[`xu`],load(){return e(()=>import(`./mscgen-vUD-SWGJ.js`).then(e=>M(e.xu)),[],import.meta.url)}}),v.of({name:`MsGenny`,extensions:[`msgenny`],load(){return e(()=>import(`./mscgen-vUD-SWGJ.js`).then(e=>M(e.msgenny)),[],import.meta.url)}}),v.of({name:`Vue`,extensions:[`vue`],load(){return e(()=>import(`./dist-FC9LftvP.js`).then(e=>e.vue()),__vite__mapDeps([34,9,6,2,3,10,1]),import.meta.url)}}),v.of({name:`Angular Template`,load(){return e(()=>import(`./dist-BMlUxhOz.js`).then(e=>e.angular()),__vite__mapDeps([35,9,6,2,3,10,1]),import.meta.url)}})],ct=typeof String.prototype.normalize==`function`?e=>e.normalize(`NFKD`):e=>e,P=class{constructor(e,t,n=0,r=e.length,i,a){this.test=a,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer=``,this.bufferPos=0,this.iter=e.iterRange(n,r),this.bufferStart=n,this.normalize=i?e=>i(ct(e)):ct,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return te(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=m(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=ve(e);let r=this.normalize(t);if(r.length)for(let e=0,i=n;;e++){let a=r.charCodeAt(e),o=this.match(a,i,this.bufferPos+this.bufferStart);if(e==r.length-1){if(o)return this.value=o,this;break}i==n&&e<t.length&&t.charCodeAt(e)==a&&i++}}}match(e,t,n){let r=null;for(let t=0;t<this.matches.length;t+=2){let i=this.matches[t],a=!1;this.query.charCodeAt(i)==e&&(i==this.query.length-1?r={from:this.matches[t+1],to:n}:(this.matches[t]++,a=!0)),a||(this.matches.splice(t,2),t-=2)}return this.query.charCodeAt(0)==e&&(this.query.length==1?r={from:t,to:n}:this.matches.push(1,t)),r&&this.test&&!this.test(r.from,r.to,this.buffer,this.bufferStart)&&(r=null),r}};typeof Symbol<`u`&&(P.prototype[Symbol.iterator]=function(){return this});var lt={from:-1,to:-1,match:/.*/.exec(``)},ut=`gm`+(/x/.unicode==null?``:`u`),dt=class{constructor(e,t,n,r=0,i=e.length){if(this.text=e,this.to=i,this.curLine=``,this.done=!1,this.value=lt,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new mt(e,t,n,r,i);this.re=new RegExp(t,ut+(n?.ignoreCase?`i`:``)),this.test=n?.test,this.iter=e.iter(),this.curLineStart=e.lineAt(r).from,this.matchPos=F(e,r),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine=``:(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine=``:this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let n=this.curLineStart+t.index,r=n+t[0].length;if(this.matchPos=F(this.text,r+ +(n==r)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(n<r||n>this.value.to)&&(!this.test||this.test(n,r,t)))return this.value={from:n,to:r,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),e=0;else return this.done=!0,this}}},ft=new WeakMap,pt=class e{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(t,n,r){let i=ft.get(t);if(!i||i.from>=r||i.to<=n){let i=new e(n,t.sliceString(n,r));return ft.set(t,i),i}if(i.from==n&&i.to==r)return i;let{text:a,from:o}=i;return o>n&&(a=t.sliceString(n,o)+a,o=n),i.to<r&&(a+=t.sliceString(i.to,r)),ft.set(t,new e(o,a)),new e(n,a.slice(n-o,r-o))}},mt=class{constructor(e,t,n,r,i){this.text=e,this.to=i,this.done=!1,this.value=lt,this.matchPos=F(e,r),this.re=new RegExp(t,ut+(n?.ignoreCase?`i`:``)),this.test=n?.test,this.flat=pt.get(e,r,this.chunkEnd(r+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let e=this.flat.from+t.index,n=e+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(e,n,t)))return this.value={from:e,to:n,match:t},this.matchPos=F(this.text,n+ +(e==n)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=pt.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}};typeof Symbol<`u`&&(dt.prototype[Symbol.iterator]=mt.prototype[Symbol.iterator]=function(){return this});function ht(e){try{return new RegExp(e,ut),!0}catch{return!1}}function F(e,t){if(t>=e.length)return t;let n=e.lineAt(t),r;for(;t<n.to&&(r=n.text.charCodeAt(t-n.from))>=56320&&r<57344;)t++;return t}var gt=e=>{let{state:n}=e,r=String(n.doc.lineAt(e.state.selection.main.head).number),{close:i,result:a}=t(e,{label:n.phrase(`Go to line`),input:{type:`text`,name:`line`,value:r},focus:!0,submitLabel:n.phrase(`go`)});return a.then(t=>{let r=t&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.elements.line.value);if(!r){e.dispatch({effects:i});return}let a=n.doc.lineAt(n.selection.main.head),[,o,s,c,u]=r,d=c?+c.slice(1):0,f=s?+s:a.number;if(s&&u){let e=f/100;o&&(e=e*(o==`-`?-1:1)+a.number/n.doc.lines),f=Math.round(n.doc.lines*e)}else s&&o&&(f=f*(o==`-`?-1:1)+a.number);let p=n.doc.line(Math.max(1,Math.min(n.doc.lines,f))),m=y.cursor(p.from+Math.max(0,Math.min(d,p.length)));e.dispatch({effects:[i,l.scrollIntoView(m.from,{y:`center`})],selection:m})}),!0},_t={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},vt=w.define({combine(e){return p(e,_t,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function yt(e){let t=[Tt,wt];return e&&t.push(vt.of(e)),t}var bt=i.mark({class:`cm-selectionMatch`}),xt=i.mark({class:`cm-selectionMatch cm-selectionMatch-main`});function St(e,t,n,r){return(n==0||e(t.sliceDoc(n-1,n))!=C.Word)&&(r==t.doc.length||e(t.sliceDoc(r,r+1))!=C.Word)}function Ct(e,t,n,r){return e(t.sliceDoc(n,n+1))==C.Word&&e(t.sliceDoc(r-1,r))==C.Word}var wt=f.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(vt),{state:n}=e,r=n.selection;if(r.ranges.length>1)return i.none;let a=r.main,o,s=null;if(a.empty){if(!t.highlightWordAroundCursor)return i.none;let e=n.wordAt(a.head);if(!e)return i.none;s=n.charCategorizer(a.head),o=n.sliceDoc(e.from,e.to)}else{let e=a.to-a.from;if(e<t.minSelectionLength||e>200)return i.none;if(t.wholeWords){if(o=n.sliceDoc(a.from,a.to),s=n.charCategorizer(a.head),!(St(s,n,a.from,a.to)&&Ct(s,n,a.from,a.to)))return i.none}else if(o=n.sliceDoc(a.from,a.to),!o)return i.none}let c=[];for(let r of e.visibleRanges){let e=new P(n.doc,o,r.from,r.to);for(;!e.next().done;){let{from:r,to:o}=e.value;if((!s||St(s,n,r,o))&&(a.empty&&r<=a.from&&o>=a.to?c.push(xt.range(r,o)):(r>=a.to||o<=a.from)&&c.push(bt.range(r,o)),c.length>t.maxMatches))return i.none}}return i.set(c)}},{decorations:e=>e.decorations}),Tt=l.baseTheme({".cm-selectionMatch":{backgroundColor:`#99ff7780`},".cm-searchMatch .cm-selectionMatch":{backgroundColor:`transparent`}}),Et=({state:e,dispatch:t})=>{let{selection:n}=e,r=y.create(n.ranges.map(t=>e.wordAt(t.head)||y.cursor(t.head)),n.mainIndex);return r.eq(n)?!1:(t(e.update({selection:r})),!0)};function Dt(e,t){let{main:n,ranges:r}=e.selection,i=e.wordAt(n.head),a=i&&i.from==n.from&&i.to==n.to;for(let n=!1,i=new P(e.doc,t,r[r.length-1].to);;)if(i.next(),i.done){if(n)return null;i=new P(e.doc,t,0,Math.max(0,r[r.length-1].from-1)),n=!0}else{if(n&&r.some(e=>e.from==i.value.from))continue;if(a){let t=e.wordAt(i.value.from);if(!t||t.from!=i.value.from||t.to!=i.value.to)continue}return i.value}}var Ot=({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(e=>e.from===e.to))return Et({state:e,dispatch:t});let r=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some(t=>e.sliceDoc(t.from,t.to)!=r))return!1;let i=Dt(e,r);return i?(t(e.update({selection:e.selection.addRange(y.range(i.from,i.to),!1),effects:l.scrollIntoView(i.to)})),!0):!1},I=w.define({combine(e){return p(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new $t(e),scrollToMatch:e=>l.scrollIntoView(e)})}}),kt=class{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||``,this.valid=!!this.search&&(!this.regexp||ht(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord,this.test=e.test}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(e,t)=>t==`n`?`
|
|
3
3
|
`:t==`r`?`\r`:t==`t`?` `:`\\`)}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord&&this.test==e.test}create(){return this.regexp?new It(this):new Nt(this)}getCursor(e,t=0,n){let r=e.doc?e:x.create({doc:e});return n??=r.doc.length,this.regexp?R(this,r,t,n):L(this,r,t,n)}},At=class{constructor(e){this.spec=e}};function jt(e,t,n){return(r,i,a,o)=>n&&!n(r,i,a,o)?!1:e(r>=o&&i<=o+a.length?a.slice(r-o,i-o):t.doc.sliceString(r,i),t,r,i)}function L(e,t,n,r){let i;return e.wholeWord&&(i=Mt(t.doc,t.charCategorizer(t.selection.main.head))),e.test&&(i=jt(e.test,t,i)),new P(t.doc,e.unquoted,n,r,e.caseSensitive?void 0:e=>e.toLowerCase(),i)}function Mt(e,t){return(n,r,i,a)=>((a>n||a+i.length<r)&&(a=Math.max(0,n-2),i=e.sliceString(a,Math.min(e.length,r+2))),(t(z(i,n-a))!=C.Word||t(B(i,n-a))!=C.Word)&&(t(B(i,r-a))!=C.Word||t(z(i,r-a))!=C.Word))}var Nt=class extends At{constructor(e){super(e)}nextMatch(e,t,n){let r=L(this.spec,e,n,e.doc.length).nextOverlapping();if(r.done){let n=Math.min(e.doc.length,t+this.spec.unquoted.length);r=L(this.spec,e,0,n).nextOverlapping()}return r.done||r.value.from==t&&r.value.to==n?null:r.value}prevMatchInRange(e,t,n){for(let r=n;;){let n=Math.max(t,r-1e4-this.spec.unquoted.length),i=L(this.spec,e,n,r),a=null;for(;!i.nextOverlapping().done;)a=i.value;if(a)return a;if(n==t)return null;r-=1e4}}prevMatch(e,t,n){let r=this.prevMatchInRange(e,0,t);return r||=this.prevMatchInRange(e,Math.max(0,n-this.spec.unquoted.length),e.doc.length),r&&(r.from!=t||r.to!=n)?r:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let n=L(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=L(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}};function Pt(e,t,n){return(r,i,a)=>(!n||n(r,i,a))&&e(a[0],t,r,i)}function R(e,t,n,r){let i;return e.wholeWord&&(i=Ft(t.charCategorizer(t.selection.main.head))),e.test&&(i=Pt(e.test,t,i)),new dt(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:i},n,r)}function z(e,t){return e.slice(_e(e,t,!1),t)}function B(e,t){return e.slice(t,_e(e,t))}function Ft(e){return(t,n,r)=>!r[0].length||(e(z(r.input,r.index))!=C.Word||e(B(r.input,r.index))!=C.Word)&&(e(B(r.input,r.index+r[0].length))!=C.Word||e(z(r.input,r.index+r[0].length))!=C.Word)}var It=class extends At{nextMatch(e,t,n){let r=R(this.spec,e,n,e.doc.length).next();return r.done&&(r=R(this.spec,e,0,t).next()),r.done?null:r.value}prevMatchInRange(e,t,n){for(let r=1;;r++){let i=Math.max(t,n-r*1e4),a=R(this.spec,e,i,n),o=null;for(;!a.next().done;)o=a.value;if(o&&(i==t||o.from>i+10))return o;if(i==t)return null}}prevMatch(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,n)=>{if(n==`&`)return e.match[0];if(n==`$`)return`$`;for(let t=n.length;t>0;t--){let r=+n.slice(0,t);if(r>0&&r<e.match.length)return e.match[r]+n.slice(t)}return t})}matchAll(e,t){let n=R(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=R(this.spec,e,Math.max(0,t-250),Math.min(n+250,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}},V=b.define(),Lt=b.define(),H=ee.define({create(e){return new Rt(qt(e).create(),null)},update(e,t){for(let n of t.effects)n.is(V)?e=new Rt(n.value.create(),e.panel):n.is(Lt)&&(e=new Rt(e.query,n.value?Kt:null));return e},provide:e=>re.from(e,e=>e.panel)}),Rt=class{constructor(e,t){this.query=e,this.panel=t}},zt=i.mark({class:`cm-searchMatch`}),Bt=i.mark({class:`cm-searchMatch cm-searchMatch-selected`}),Vt=f.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(H))}update(e){let t=e.state.field(H);(t!=e.startState.field(H)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return i.none;let{view:n}=this,r=new ce;for(let t=0,i=n.visibleRanges,a=i.length;t<a;t++){let{from:o,to:s}=i[t];for(;t<a-1&&s>i[t+1].from-500;)s=i[++t].to;e.highlight(n.state,o,s,(e,t)=>{let i=n.state.selection.ranges.some(n=>n.from==e&&n.to==t);r.add(e,t,i?Bt:zt)})}return r.finish()}},{decorations:e=>e.decorations});function U(e){return t=>{let n=t.state.field(H,!1);return n&&n.query.spec.valid?e(t,n):Xt(t)}}var W=U((e,{query:t})=>{let{to:n}=e.state.selection.main,r=t.nextMatch(e.state,n,n);if(!r)return!1;let i=y.single(r.from,r.to),a=e.state.facet(I);return e.dispatch({selection:i,effects:[en(e,r),a.scrollToMatch(i.main,e)],userEvent:`select.search`}),Yt(e),!0}),G=U((e,{query:t})=>{let{state:n}=e,{from:r}=n.selection.main,i=t.prevMatch(n,r,r);if(!i)return!1;let a=y.single(i.from,i.to),o=e.state.facet(I);return e.dispatch({selection:a,effects:[en(e,i),o.scrollToMatch(a.main,e)],userEvent:`select.search`}),Yt(e),!0}),Ht=U((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!n||!n.length?!1:(e.dispatch({selection:y.create(n.map(e=>y.range(e.from,e.to))),userEvent:`select.search.matches`}),!0)}),Ut=({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:i}=n.main,a=[],o=0;for(let t=new P(e.doc,e.sliceDoc(r,i));!t.next().done;){if(a.length>1e3)return!1;t.value.from==r&&(o=a.length),a.push(y.range(t.value.from,t.value.to))}return t(e.update({selection:y.create(a,o),userEvent:`select.search.matches`})),!0},Wt=U((e,{query:t})=>{let{state:n}=e,{from:r,to:i}=n.selection.main;if(n.readOnly)return!1;let a=t.nextMatch(n,r,r);if(!a)return!1;let o=a,s=[],c,u,d=[];o.from==r&&o.to==i&&(u=n.toText(t.getReplacement(o)),s.push({from:o.from,to:o.to,insert:u}),o=t.nextMatch(n,o.from,o.to),d.push(l.announce.of(n.phrase(`replaced match on line $`,n.doc.lineAt(r).number)+`.`)));let f=e.state.changes(s);return o&&(c=y.single(o.from,o.to).map(f),d.push(en(e,o)),d.push(n.facet(I).scrollToMatch(c.main,e))),e.dispatch({changes:f,selection:c,effects:d,userEvent:`input.replace`}),!0}),Gt=U((e,{query:t})=>{if(e.state.readOnly)return!1;let n=t.matchAll(e.state,1e9).map(e=>{let{from:n,to:r}=e;return{from:n,to:r,insert:t.getReplacement(e)}});if(!n.length)return!1;let r=e.state.phrase(`replaced $ matches`,n.length)+`.`;return e.dispatch({changes:n,effects:l.announce.of(r),userEvent:`input.replace.all`}),!0});function Kt(e){return e.state.facet(I).createPanel(e)}function qt(e,t){let n=e.selection.main,r=n.empty||n.to>n.from+100?``:e.sliceDoc(n.from,n.to);if(t&&!r)return t;let i=e.facet(I);return new kt({search:t?.literal??i.literal?r:r.replace(/\n/g,`\\n`),caseSensitive:t?.caseSensitive??i.caseSensitive,literal:t?.literal??i.literal,regexp:t?.regexp??i.regexp,wholeWord:t?.wholeWord??i.wholeWord})}function Jt(e){let t=o(e,Kt);return t&&t.dom.querySelector(`[main-field]`)}function Yt(e){let t=Jt(e);t&&t==e.root.activeElement&&t.select()}var Xt=e=>{let t=e.state.field(H,!1);if(t&&t.panel){let n=Jt(e);if(n&&n!=e.root.activeElement){let r=qt(e.state,t.query.spec);r.valid&&e.dispatch({effects:V.of(r)}),n.focus(),n.select()}}else e.dispatch({effects:[Lt.of(!0),t?V.of(qt(e.state,t.query.spec)):b.appendConfig.of(nn)]});return!0},Zt=e=>{let t=e.state.field(H,!1);if(!t||!t.panel)return!1;let n=o(e,Kt);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:Lt.of(!1)}),!0},Qt=[{key:`Mod-f`,run:Xt,scope:`editor search-panel`},{key:`F3`,run:W,shift:G,scope:`editor search-panel`,preventDefault:!0},{key:`Mod-g`,run:W,shift:G,scope:`editor search-panel`,preventDefault:!0},{key:`Escape`,run:Zt,scope:`editor search-panel`},{key:`Mod-Shift-l`,run:Ut},{key:`Mod-Alt-g`,run:gt},{key:`Mod-d`,run:Ot,preventDefault:!0}],$t=class{constructor(e){this.view=e;let t=this.query=e.state.field(H).query.spec;this.commit=this.commit.bind(this),this.searchField=S(`input`,{value:t.search,placeholder:K(e,`Find`),"aria-label":K(e,`Find`),class:`cm-textfield`,name:`search`,form:``,"main-field":`true`,onchange:this.commit,onkeyup:this.commit}),this.replaceField=S(`input`,{value:t.replace,placeholder:K(e,`Replace`),"aria-label":K(e,`Replace`),class:`cm-textfield`,name:`replace`,form:``,onchange:this.commit,onkeyup:this.commit}),this.caseField=S(`input`,{type:`checkbox`,name:`case`,form:``,checked:t.caseSensitive,onchange:this.commit}),this.reField=S(`input`,{type:`checkbox`,name:`re`,form:``,checked:t.regexp,onchange:this.commit}),this.wordField=S(`input`,{type:`checkbox`,name:`word`,form:``,checked:t.wholeWord,onchange:this.commit});function n(e,t,n){return S(`button`,{class:`cm-button`,name:e,onclick:t,type:`button`},n)}this.dom=S(`div`,{onkeydown:e=>this.keydown(e),class:`cm-search`},[this.searchField,n(`next`,()=>W(e),[K(e,`next`)]),n(`prev`,()=>G(e),[K(e,`previous`)]),n(`select`,()=>Ht(e),[K(e,`all`)]),S(`label`,null,[this.caseField,K(e,`match case`)]),S(`label`,null,[this.reField,K(e,`regexp`)]),S(`label`,null,[this.wordField,K(e,`by word`)]),...e.state.readOnly?[]:[S(`br`),this.replaceField,n(`replace`,()=>Wt(e),[K(e,`replace`)]),n(`replaceAll`,()=>Gt(e),[K(e,`replace all`)])],S(`button`,{name:`close`,onclick:()=>Zt(e),"aria-label":K(e,`close`),type:`button`},[`×`])])}commit(){let e=new kt({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:V.of(e)}))}keydown(e){d(this.view,e,`search-panel`)?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?G:W)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),Wt(this.view))}update(e){for(let t of e.transactions)for(let e of t.effects)e.is(V)&&!e.value.eq(this.query)&&this.setQuery(e.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(I).top}};function K(e,t){return e.state.phrase(t)}var q=30,J=/[\s\.,:;?!]/;function en(e,{from:t,to:n}){let r=e.state.doc.lineAt(t),i=e.state.doc.lineAt(n).to,a=Math.max(r.from,t-q),o=Math.min(i,n+q),s=e.state.sliceDoc(a,o);if(a!=r.from){for(let e=0;e<q;e++)if(!J.test(s[e+1])&&J.test(s[e])){s=s.slice(e);break}}if(o!=i){for(let e=s.length-1;e>s.length-q;e--)if(!J.test(s[e-1])&&J.test(s[e])){s=s.slice(0,e);break}}return l.announce.of(`${e.state.phrase(`current match`)}. ${s} ${e.state.phrase(`on line`)} ${r.number}.`)}var tn=l.baseTheme({".cm-panel.cm-search":{padding:`2px 6px 4px`,position:`relative`,"& [name=close]":{position:`absolute`,top:`0`,right:`4px`,backgroundColor:`inherit`,border:`none`,font:`inherit`,padding:0,margin:0},"& input, & button, & label":{margin:`.2em .6em .2em 0`},"& input[type=checkbox]":{marginRight:`.2em`},"& label":{fontSize:`80%`,whiteSpace:`pre`}},"&light .cm-searchMatch":{backgroundColor:`#ffff0054`},"&dark .cm-searchMatch":{backgroundColor:`#00ffff8a`},"&light .cm-searchMatch-selected":{backgroundColor:`#ff6a0054`},"&dark .cm-searchMatch-selected":{backgroundColor:`#ff00ff8a`}}),nn=[H,ae.low(Vt),tn],rn=`#e5c07b`,an=`#e06c75`,on=`#56b6c2`,sn=`#ffffff`,Y=`#abb2bf`,cn=`#7d8799`,ln=`#61afef`,un=`#98c379`,dn=`#d19a66`,fn=`#c678dd`,pn=`#21252b`,mn=`#2c313a`,hn=`#282c34`,gn=`#353a42`,_n=`#3E4451`,vn=`#528bff`,yn=[l.theme({"&":{color:Y,backgroundColor:hn},".cm-content":{caretColor:vn},".cm-cursor, .cm-dropCursor":{borderLeftColor:vn},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:_n},".cm-panels":{backgroundColor:pn,color:Y},".cm-panels.cm-panels-top":{borderBottom:`2px solid black`},".cm-panels.cm-panels-bottom":{borderTop:`2px solid black`},".cm-searchMatch":{backgroundColor:`#72a1ff59`,outline:`1px solid #457dff`},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:`#6199ff2f`},".cm-activeLine":{backgroundColor:`#6699ff0b`},".cm-selectionMatch":{backgroundColor:`#aafe661a`},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:`#bad0f847`},".cm-gutters":{backgroundColor:hn,color:cn,border:`none`},".cm-activeLineGutter":{backgroundColor:mn},".cm-foldPlaceholder":{backgroundColor:`transparent`,border:`none`,color:`#ddd`},".cm-tooltip":{border:`none`,backgroundColor:gn},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:gn,borderBottomColor:gn},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:mn,color:Y}}},{dark:!0}),n(me.define([{tag:u.keyword,color:fn},{tag:[u.name,u.deleted,u.character,u.propertyName,u.macroName],color:an},{tag:[u.function(u.variableName),u.labelName],color:ln},{tag:[u.color,u.constant(u.name),u.standard(u.name)],color:dn},{tag:[u.definition(u.name),u.separator],color:Y},{tag:[u.typeName,u.className,u.number,u.changed,u.annotation,u.modifier,u.self,u.namespace],color:rn},{tag:[u.operator,u.operatorKeyword,u.url,u.escape,u.regexp,u.link,u.special(u.string)],color:on},{tag:[u.meta,u.comment],color:cn},{tag:u.strong,fontWeight:`bold`},{tag:u.emphasis,fontStyle:`italic`},{tag:u.strikethrough,textDecoration:`line-through`},{tag:u.link,color:cn,textDecoration:`underline`},{tag:u.heading,fontWeight:`bold`,color:an},{tag:[u.atom,u.bool,u.special(u.variableName)],color:dn},{tag:[u.processingInstruction,u.string,u.inserted],color:un},{tag:u.invalid,color:sn}]))],bn=class e{constructor(e,t){this.yanchor=e,this.yhead=t}toJSON(){return{yanchor:E(this.yanchor),yhead:E(this.yhead)}}static fromJSON(t){return new e(D(t.yanchor),D(t.yhead))}},xn=class{constructor(e,t){this.ytext=e,this.awareness=t,this.undoManager=new Ve(e)}toYPos(e,t=0){return j(this.ytext,e,t)}fromYPos(e){let t=T(D(e),this.ytext.doc);if(t==null||t.type!==this.ytext)throw Error(`[y-codemirror] The position you want to retrieve was created by a different document`);return{pos:t.index,assoc:t.assoc}}toYRange(e){let t=e.assoc;return new bn(this.toYPos(e.anchor,t),this.toYPos(e.head,t))}fromYRange(e){let t=this.fromYPos(e.yanchor),n=this.fromYPos(e.yhead);return t.pos===n.pos?y.cursor(n.pos,n.assoc):y.range(t.pos,n.pos)}},X=w.define({combine(e){return e[e.length-1]}}),Sn=fe.define(),Cn=class{constructor(e){this.view=e,this.conf=e.state.facet(X),this._observer=(t,n)=>{if(n.origin!==this.conf){let n=t.delta,r=[],i=0;for(let e=0;e<n.length;e++){let t=n[e];t.insert==null?t.delete==null?i+=t.retain:(r.push({from:i,to:i+t.delete,insert:``}),i+=t.delete):r.push({from:i,to:i,insert:t.insert})}e.dispatch({changes:r,annotations:[Sn.of(this.conf)]})}},this._ytext=this.conf.ytext,this._ytext.observe(this._observer)}update(e){if(!e.docChanged||e.transactions.length>0&&e.transactions[0].annotation(Sn)===this.conf)return;let t=this.conf.ytext;t.doc.transact(()=>{let n=0;e.changes.iterChanges((e,r,i,a,o)=>{let s=o.sliceString(0,o.length,`
|
|
4
4
|
`);e!==r&&t.delete(e+n,r-e),s.length>0&&t.insert(e+n,s),n+=s.length-(r-e)})},this.conf)}destroy(){this._ytext.unobserve(this._observer)}},wn=f.fromClass(Cn),Tn=l.baseTheme({".cm-ySelection":{},".cm-yLineSelection":{padding:0,margin:`0px 2px 0px 4px`},".cm-ySelectionCaret":{position:`relative`,borderLeft:`1px solid black`,borderRight:`1px solid black`,marginLeft:`-1px`,marginRight:`-1px`,boxSizing:`border-box`,display:`inline`},".cm-ySelectionCaretDot":{borderRadius:`50%`,position:`absolute`,width:`.4em`,height:`.4em`,top:`-.2em`,left:`-.2em`,backgroundColor:`inherit`,transition:`transform .3s ease-in-out`,boxSizing:`border-box`},".cm-ySelectionCaret:hover > .cm-ySelectionCaretDot":{transformOrigin:`bottom center`,transform:`scale(0)`},".cm-ySelectionInfo":{position:`absolute`,top:`-1.05em`,left:`-1px`,fontSize:`.75em`,fontFamily:`serif`,fontStyle:`normal`,fontWeight:`normal`,lineHeight:`normal`,userSelect:`none`,color:`white`,paddingLeft:`2px`,paddingRight:`2px`,zIndex:101,transition:`opacity .3s ease-in-out`,backgroundColor:`inherit`,opacity:0,transitionDelay:`0s`,whiteSpace:`nowrap`},".cm-ySelectionCaret:hover > .cm-ySelectionInfo":{opacity:1,transitionDelay:`0s`}}),En=fe.define(),Dn=class extends ye{constructor(e,t){super(),this.color=e,this.name=t}toDOM(){return Re(`span`,[O(`class`,`cm-ySelectionCaret`),O(`style`,`background-color: ${this.color}; border-color: ${this.color}`)],[A(``),Re(`div`,[O(`class`,`cm-ySelectionCaretDot`)]),A(``),Re(`div`,[O(`class`,`cm-ySelectionInfo`)],[A(this.name)]),A(``)])}eq(e){return e.color===this.color}compare(e){return e.color===this.color}updateDOM(){return!1}get estimatedHeight(){return-1}ignoreEvent(){return!0}},On=class{constructor(e){this.conf=e.state.facet(X),this._listener=({added:t,updated:n,removed:r},i,a)=>{t.concat(n).concat(r).findIndex(e=>e!==this.conf.awareness.doc.clientID)>=0&&e.dispatch({annotations:[En.of([])]})},this._awareness=this.conf.awareness,this._awareness.on(`change`,this._listener),this.decorations=ue.of([])}destroy(){this._awareness.off(`change`,this._listener)}update(e){let t=this.conf.ytext,n=t.doc,r=this.conf.awareness,a=[],o=this.conf.awareness.getLocalState();if(o!=null){let n=e.view.hasFocus&&e.view.dom.ownerDocument.hasFocus(),i=n?e.state.selection.main:null,a=o.cursor==null?null:D(o.cursor.anchor),s=o.cursor==null?null:D(o.cursor.head);if(i!=null){let e=j(t,i.anchor),n=j(t,i.head);(o.cursor==null||!We(a,e)||!We(s,n))&&r.setLocalStateField(`cursor`,{anchor:e,head:n})}else o.cursor!=null&&n&&r.setLocalStateField(`cursor`,null)}r.getStates().forEach((o,s)=>{if(s===r.doc.clientID)return;let c=o.cursor;if(c==null||c.anchor==null||c.head==null)return;let l=T(c.anchor,n),u=T(c.head,n);if(l==null||u==null||l.type!==t||u.type!==t)return;let{color:d=`#30bced`,name:f=`Anonymous`}=o.user||{},p=o.user&&o.user.colorLight||d+`33`,m=ze(l.index,u.index),h=Be(l.index,u.index),g=e.view.state.doc.lineAt(m),_=e.view.state.doc.lineAt(h);if(g.number===_.number)a.push({from:m,to:h,value:i.mark({attributes:{style:`background-color: ${p}`},class:`cm-ySelection`})});else{a.push({from:m,to:g.from+g.length,value:i.mark({attributes:{style:`background-color: ${p}`},class:`cm-ySelection`})}),a.push({from:_.from,to:h,value:i.mark({attributes:{style:`background-color: ${p}`},class:`cm-ySelection`})});for(let t=g.number+1;t<_.number;t++){let n=e.view.state.doc.line(t).from;a.push({from:n,to:n,value:i.line({attributes:{style:`background-color: ${p}`,class:`cm-yLineSelection`}})})}}a.push({from:u.index,to:u.index,value:i.widget({side:u.index-l.index>0?-1:1,block:!1,widget:new Dn(d,f)})})}),this.decorations=i.set(a,!0)}},kn=f.fromClass(On,{decorations:e=>e.decorations}),An=()=>{let e=!0;return(t,n)=>{if(e){e=!1;try{t()}finally{e=!0}}else n!==void 0&&n()}},jn=class{constructor(e){this.undoManager=e}addTrackedOrigin(e){this.undoManager.addTrackedOrigin(e)}removeTrackedOrigin(e){this.undoManager.removeTrackedOrigin(e)}undo(){return this.undoManager.undo()!=null}redo(){return this.undoManager.redo()!=null}},Mn=w.define({combine(e){return e[e.length-1]}});fe.define();var Nn=class{constructor(e){this.view=e,this.conf=e.state.facet(Mn),this._undoManager=this.conf.undoManager,this.syncConf=e.state.facet(X),this._beforeChangeSelection=null,this._mux=An(),this._onStackItemAdded=({stackItem:e,changedParentTypes:t})=>{t.has(this.syncConf.ytext)&&this._beforeChangeSelection&&!e.meta.has(this)&&e.meta.set(this,this._beforeChangeSelection)},this._onStackItemPopped=({stackItem:t})=>{let n=t.meta.get(this);if(n){let t=this.syncConf.fromYRange(n);e.dispatch(e.state.update({selection:t,effects:[l.scrollIntoView(t)]})),this._storeSelection()}},this._storeSelection=()=>{this._beforeChangeSelection=this.syncConf.toYRange(this.view.state.selection.main)},this._undoManager.on(`stack-item-added`,this._onStackItemAdded),this._undoManager.on(`stack-item-popped`,this._onStackItemPopped),this._undoManager.addTrackedOrigin(this.syncConf)}update(e){e.selectionSet&&(e.transactions.length===0||e.transactions[0].annotation(Sn)!==this.syncConf)&&this._storeSelection()}destroy(){this._undoManager.off(`stack-item-added`,this._onStackItemAdded),this._undoManager.off(`stack-item-popped`,this._onStackItemPopped),this._undoManager.removeTrackedOrigin(this.syncConf)}},Pn=f.fromClass(Nn),Fn=({state:e,dispatch:t})=>e.facet(Mn).undo()||!0,In=({state:e,dispatch:t})=>e.facet(Mn).redo()||!0,Ln=(e,t,{undoManager:n=new Ve(e)}={})=>{let r=new xn(e,t),i=[X.of(r),wn];return t&&i.push(Tn,kn),n!==!1&&i.push(Mn.of(new jn(n)),Pn,l.domEventHandlers({beforeinput(e,t){return e.inputType===`historyUndo`?Fn(t):e.inputType===`historyRedo`?In(t):!1}})),i},Rn=Object.freeze({bold:`bold text`,code:`code`,italic:`emphasis`,strikethrough:`struck text`}),zn=`link text`,Bn=`https://`,Vn=`alt text`,Hn=`https://`,Un=`Video`,Wn=`https://`,Gn=`code`,Kn=Object.freeze([`Column 1`,`Column 2`]),qn=`Value`,Z=Object.freeze({heading:/^#{1,6}\s+/,quote:/^>\s+/,bulletList:/^[-*+]\s+/,numberedList:/^\d+\.\s+/,taskList:/^-\s\[(?: |x|X)\]\s+/});function Jn(e,t){return{from:Math.max(0,Math.min(e.from,e.to,t)),to:Math.max(0,Math.min(Math.max(e.from,e.to),t))}}function Yn(e,t){return t===0||e[t-1]===`
|
|
5
5
|
`}function Xn(e,t){if(t<=0)return 0;let n=e.lastIndexOf(`
|
|
@@ -13,4 +13,4 @@ import{t as e}from"./preload-helper-Bo9GmnuQ.js";import{$ as t,A as n,B as r,F a
|
|
|
13
13
|
`,s=a?`
|
|
14
14
|
`:``,c=`${s}${n}${o?`
|
|
15
15
|
`:``}`,l=t.from+s.length+r;return{anchor:l,from:t.from,head:l+i,insert:c,to:t.to}}function hr(e=``){let t=e.trim()||qn;return[`| ${Kn.join(` | `)} |`,`| --- | --- |`,`| ${t} | ${qn} |`].join(`
|
|
16
|
-
`)}function gr(e,t){return mr(e,t,hr(e.slice(t.from,t.to)),2,Kn[0].length)}function _r(e,t){return mr(e,t,`---`,4,0)}function vr(e,t,n){let r=String(e??``),i=Jn(t,r.length),a;switch(n){case`bold`:a=$n(r,i,`**`,Rn.bold);break;case`italic`:a=$n(r,i,`_`,Rn.italic);break;case`strikethrough`:a=$n(r,i,`~~`,Rn.strikethrough);break;case`code`:a=$n(r,i,"`",Rn.code);break;case`link`:a=tr(r,i);break;case`image`:a=nr(r,i);break;case`video`:a=rr(r,i);break;case`paragraph`:a=dr(r,i);break;case`heading`:a=$(r,i,2);break;case`heading-1`:a=$(r,i,1);break;case`heading-2`:a=$(r,i,2);break;case`heading-3`:a=$(r,i,3);break;case`heading-4`:a=$(r,i,4);break;case`heading-5`:a=$(r,i,5);break;case`heading-6`:a=$(r,i,6);break;case`quote`:a=cr(r,i);break;case`bullet-list`:a=sr(r,i);break;case`numbered-list`:a=ur(r,i);break;case`task-list`:a=lr(r,i);break;case`code-block`:a=pr(r,i);break;case`table`:a=gr(r,i);break;case`horizontal-rule`:a=_r(r,i);break;default:return null}return a?r.slice(a.from,a.to)===a.insert?null:a:null}function yr(e){return t=>{let n=t.state.doc.lineAt(t.pos),r=n.text.slice(0,t.pos-n.from),i=r.lastIndexOf(`[[`);if(i===-1)return null;let a=r.slice(i+2);if(a.includes(`]]`))return null;let o=a.toLowerCase(),s=n.from+i+2,c=e().map(e=>{let t=e.replace(/\.md$/i,``);return{filePath:e,label:t,fileName:t.split(`/`).pop()}}).filter(({label:e,fileName:t})=>e.toLowerCase().includes(o)||t.toLowerCase().includes(o)).map(({label:e,fileName:t})=>({label:e,detail:e.includes(`/`)?` ${t}`:void 0,apply:(e,t,n,r)=>{let i=e.state.doc.toString(),a=r;i.slice(r,r+2)===`]]`&&(a=r+2),e.dispatch({changes:{from:n,to:a,insert:`${t.label}]]`},selection:{anchor:n+t.label.length+2}})},type:`text`,boost:e.toLowerCase().startsWith(o)?1:0}));return c.length===0?null:{from:s,options:c,filter:!1}}}var br=new Set([`@startuml`,`@enduml`,`@startmindmap`,`@endmindmap`,`@startwbs`,`@endwbs`,`@startgantt`,`@endgantt`,`@startjson`,`@endjson`,`@startyaml`,`@endyaml`,`@startsalt`,`@endsalt`]),xr=new Set(`activate.actor.agent.allowmixing.alt.annotation.artifact.as.autonumber.boundary.box.break.caption.card.case.circle.class.cloud.collections.component.control.create.critical.database.deactivate.destroy.detach.else.elseif.end.endlegend.endif.endwhile.entity.enum.exception.file.folder.footer.fork.frame.group.header.hide.hnote.if.interface.json.kill.label.legend.loop.map.namespace.newpage.node.note.object.of.opt.order.over.package.page.par.participant.partition.person.port.protocol.queue.rectangle.ref.repeat.return.rnote.show.skinparam.split.stack.start.state.stop.storage.struct.switch.then.title.usecase.while`.split(`.`)),Sr=new Set([`false`,`no`,`off`,`on`,`true`,`yes`]);function Cr(e){let t=e.match(/[@!A-Za-z_][\w.-]*/u,!1);return t?(e.match(/[@!A-Za-z_][\w.-]*/u),t[0]):``}var wr=new le(ne.define({languageData:{commentTokens:{block:{close:`'/`,open:`/'`},line:`'`}},startState(){return{inBlockComment:!1}},token(e,t){if(t.inBlockComment)return e.skipTo(`'/`)?(e.match(`'/`),t.inBlockComment=!1):e.skipToEnd(),`comment`;if(e.eatSpace())return null;if(e.match(`/'`))return t.inBlockComment=!0,`comment`;let n=e.pos===0?` `:e.string.charAt(e.pos-1);if(e.peek()===`'`&&(e.sol()||/\s/u.test(n)))return e.skipToEnd(),`comment`;if(e.match(/"(?:[^"\\]|\\.)*"?/u))return`string`;if(e.match(/#[0-9a-f]{3,8}\b/iu)||e.match(/#[A-Za-z][\w-]*/u))return`atom`;if(e.match(/\b\d+(?:\.\d+)?\b/u))return`number`;if(e.match(/[<>{}[\]():,]/u))return`punctuation`;if(e.match(/[ox*+<#]?[-=.\\/]+(?:left|right|up|down)?[-=.\\/]*[ox*+>#]?/iu))return`operator`;let r=Cr(e);if(r){let e=r.toLowerCase();return e.startsWith(`!`)||br.has(e)?`meta`:xr.has(e)?`keyword`:Sr.has(e)?`bool`:/^[A-Z][A-Z0-9_]*$/u.test(r)?`typeName`:`variableName`}return e.next(),null}})),Tr=v.of({alias:[`plantuml`,`puml`],extensions:[`plantuml`,`puml`],name:`PlantUML`,support:wr});function Er(e){let t=Array.from(e?.clipboardData?.files??[]);for(let e of t)if(e?.type?.startsWith?.(`image/`))return e;let n=Array.from(e?.clipboardData?.items??[]);for(let e of n){if(e.kind!==`file`||!e.type?.startsWith?.(`image/`))continue;let t=e.getAsFile?.();if(t)return t}return null}function Dr(e,t){let n=Er(e);return n?typeof t==`function`?(console.debug(`[editor] Detected pasted image.`,{name:n.name??``,size:n.size??null,type:n.type??``}),e.preventDefault?.(),Promise.resolve(t(n)).catch(e=>{console.error(`[editor] Failed to process pasted image:`,e)}),!0):(console.warn(`[editor] Ignoring pasted image because no image paste handler is registered.`),!1):!1}var Or=[...st,Tr],kr=i.mark({class:`cm-matchingBracket cm-matchingBracket-paired`}),Ar=i.mark({class:`cm-nonmatchingBracket`}),jr=i.mark({class:`cm-remoteUpdateFlash`}),Mr=1350,Nr=160,Pr=900,Fr=/^(\s*(?:>\s*)*(?:[-+*]|\d+[.)])\s+\[)( |x|X)(\])(\s.*)?$/,Ir=Object.freeze({indentLess:Oe,indentMore:Ee,openSearch:Xt,redo:Me,undo:De}),Lr=class extends ye{toDOM(){let e=document.createElement(`span`);return e.className=`cm-remoteUpdateCaretWidget`,e.setAttribute(`aria-hidden`,`true`),e}ignoreEvent(){return!0}},Rr=b.define(),zr=b.define(),Br=ee.define({create:()=>i.none,update(e,t){let n=e.map(t.changes);return t.effects.forEach(e=>{if(e.is(zr)){n=i.none;return}if(e.is(Rr)){let{from:t,showCaret:r,to:a}=e.value,o=[];a>t&&o.push(jr.range(t,a)),r&&o.push(i.widget({side:-1,widget:new Lr}).range(t)),n=o.length>0?i.set(o,!0):i.none}}),n},provide:e=>l.decorations.from(e)});function Vr(e,t){return t.selection.ranges.some(t=>t.empty&&e.to===t.head)}function Hr(e,t){let n=[];if(!e.matched)return n.push(Ar.range(e.start.from,e.start.to)),e.end&&n.push(Ar.range(e.end.from,e.end.to)),n;let r=Vr(e.start,t),i=e.end?Vr(e.end,t):!1;return r||n.push(kr.range(e.start.from,e.start.to)),e.end&&!i&&n.push(kr.range(e.end.from,e.end.to)),n}function Ur(e){let t=e===`dark`?`oklch(from var(--color-surface-offset) l c h / 0.55)`:`oklch(from var(--color-surface-offset) l c h / 0.75)`,n=e===`dark`?`oklch(from var(--color-primary) l c h / 0.28)`:`oklch(from var(--color-primary) l c h / 0.18)`,r=e===`dark`?`oklch(from var(--color-primary) l c h / 0.4)`:`oklch(from var(--color-primary) l c h / 0.26)`,i=e===`dark`?`oklch(from var(--color-primary) l c h / 0.65)`:`oklch(from var(--color-primary) l c h / 0.5)`,a=e===`dark`?`color-mix(in oklab, var(--color-primary) 78%, white)`:`color-mix(in oklab, var(--color-primary) 84%, black)`,o=e===`dark`?`oklch(from var(--color-primary) l c h / 0.2)`:`oklch(from var(--color-primary) l c h / 0.12)`,s=e===`dark`?`oklch(from var(--color-primary) calc(l + 0.08) c h / 0.85)`:`oklch(from var(--color-primary) calc(l - 0.04) c h / 0.7)`,c=e===`dark`?`oklch(from var(--color-error) l c h / 0.12)`:`oklch(from var(--color-error) l c h / 0.1)`,u=e===`dark`?`oklch(from var(--color-error) calc(l + 0.08) c h / 0.8)`:`oklch(from var(--color-error) calc(l - 0.04) c h / 0.7)`;return l.theme({"&":{backgroundColor:`var(--color-bg)`,color:`var(--color-text)`},".cm-content":{caretColor:a,fontFamily:`var(--font-mono)`,padding:`16px 0`},".cm-cursor, .cm-dropCursor":{borderLeftColor:a,borderLeftWidth:`3px`,marginLeft:`-1px`},".cm-foldPlaceholder":{backgroundColor:`var(--color-surface-dynamic)`,border:`none`,color:`var(--color-text-muted)`},".cm-gutters":{backgroundColor:`var(--color-surface)`,borderRight:`1px solid var(--color-divider)`,color:`var(--color-text-muted)`,minWidth:`44px`},".cm-line":{padding:`0 16px`},".cm-activeLine":{backgroundColor:t,boxShadow:`inset 3px 0 0 ${n}`},".cm-activeLineGutter":{backgroundColor:t,boxShadow:`inset 3px 0 0 ${n}`,color:`var(--color-text-muted)`},".cm-matchingBracket":{borderRadius:`2px`,color:`inherit`},".cm-matchingBracket.cm-matchingBracket-paired":{backgroundColor:o,outline:`1px solid ${s}`},".cm-nonmatchingBracket":{backgroundColor:c,outline:`1px solid ${u}`,borderRadius:`2px`},".cm-selectionMatch":{backgroundColor:`var(--color-primary-highlight)`},".cm-remoteUpdateFlash":{animation:`collabmd-remote-update-flash 1.35s ease-out`,backgroundColor:e===`dark`?`oklch(from var(--color-primary) l c h / 0.22)`:`oklch(from var(--color-primary) l c h / 0.16)`,borderRadius:`3px`,boxShadow:`0 0 0 1px ${e===`dark`?`oklch(from var(--color-primary) calc(l + 0.05) c h / 0.26)`:`oklch(from var(--color-primary) calc(l - 0.04) c h / 0.2)`}`},".cm-remoteUpdateCaretWidget":{animation:`collabmd-remote-update-caret 1s ease-out`,backgroundColor:`transparent`,borderLeft:`2px solid ${e===`dark`?`color-mix(in oklab, var(--color-primary) 78%, white)`:`color-mix(in oklab, var(--color-primary) 84%, black)`}`,borderRadius:`999px`,boxShadow:`0 0 0 1px ${e===`dark`?`oklch(from var(--color-primary) calc(l + 0.06) c h / 0.22)`:`oklch(from var(--color-primary) calc(l - 0.04) c h / 0.16)`}`,display:`inline-block`,height:`1.2em`,marginLeft:`-1px`,marginRight:`-1px`,pointerEvents:`none`,transformOrigin:`center bottom`,verticalAlign:`text-bottom`,width:`0`},"&.cm-focused .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:r},"&.cm-focused .cm-selectionLayer .cm-selectionBackground":{border:`1px solid ${i}`,borderRadius:`2px`},"@keyframes collabmd-remote-update-flash":{"0%":{backgroundColor:e===`dark`?`oklch(from var(--color-primary) l c h / 0.34)`:`oklch(from var(--color-primary) l c h / 0.26)`},"100%":{backgroundColor:`oklch(from var(--color-primary) l c h / 0)`}},"@keyframes collabmd-remote-update-caret":{"0%":{boxShadow:`0 0 0 1px ${e===`dark`?`oklch(from var(--color-primary) calc(l + 0.08) c h / 0.34)`:`oklch(from var(--color-primary) calc(l - 0.04) c h / 0.24)`}`,opacity:`0`,transform:`translateY(0.2em) scaleY(0.7)`},"18%":{opacity:`1`,transform:`translateY(0) scaleY(1)`},"72%":{opacity:`1`,transform:`translateY(0) scaleY(1)`},"100%":{boxShadow:`0 0 0 1px ${e===`dark`?`oklch(from var(--color-primary) calc(l + 0.08) c h / 0)`:`oklch(from var(--color-primary) calc(l - 0.04) c h / 0)`}`,opacity:`0`,transform:`translateY(-0.05em) scaleY(0.9)`}}},{dark:e===`dark`})}function Wr(e){return Pe(e)?wr:Fe(e)?Te():Ce({base:we,codeLanguages:Or})}function Gr(e){return{from:Math.min(...e.ranges.map(e=>Math.min(e.from,e.to))),to:Math.max(...e.ranges.map(e=>Math.max(e.from,e.to)))}}var Kr=class{constructor({editorContainer:e,getFileList:t,initialTheme:n,lineInfoElement:r,lineWrappingEnabled:i=!0,onDocChanged:a=null,onImagePaste:o=null,onSelectionChanged:s=null,onViewportChanged:c=null}){this.editorContainer=e,this.getFileList=t??(()=>[]),this.initialTheme=n,this.lineInfoElement=r,this.lineWrappingEnabled=i,this.onDocChanged=a,this.onImagePaste=o,this.onSelectionChanged=s,this.onViewportChanged=c,this.editorView=null,this.themeCompartment=new pe,this.syntaxThemeCompartment=new pe,this.lineWrappingCompartment=new pe,this.viewportFrame=0,this.remoteUpdateFlashTimer=0,this.lastLocalInputAt=0,this.handleScroll=()=>{this.viewportFrame||=requestAnimationFrame(()=>{this.viewportFrame=0,this.emitViewportChange()})},this.handleLocalInputActivity=()=>{this.lastLocalInputAt=Date.now()}}createUpdateListener(){return l.updateListener.of(e=>{e.docChanged&&this.onDocChanged?.(),(e.selectionSet||e.docChanged)&&(this.updateCursorInfo(e.state),this.onSelectionChanged?.(e.state))})}getBaseExtensions(e,{readOnly:t=!1}={}){let i=[s(),a(),c(),ke(),oe(),h(),x.allowMultipleSelections.of(!0),ge(),n(ie,{fallback:!0}),se({renderMatch:Hr}),Se(),xe({override:[yr(this.getFileList)]}),_(),r(),g(),yt(),de.of([...be,...Ne,...je,...Qt,...he,Ae]),l.contentAttributes.of({"aria-label":`Markdown editor`}),Wr(e),this.themeCompartment.of(Ur(this.initialTheme)),this.syntaxThemeCompartment.of(this.initialTheme===`dark`?yn:[]),this.lineWrappingCompartment.of(this.lineWrappingEnabled?l.lineWrapping:[]),Br,this.createUpdateListener()];return t?(i.push(x.readOnly.of(!0)),i.push(l.editable.of(!1)),i):(i.splice(13,0,ae.highest(l.domEventHandlers({paste:e=>Dr(e,this.onImagePaste)}))),i)}clearEditorDom({preserveLoadingIndicator:e=!0}={}){if(!this.editorContainer)return;let t=e?this.editorContainer.querySelector(`#editorLoading`):null;Array.from(this.editorContainer.children).forEach(e=>{e!==t&&e.remove()})}teardownEditorView({clearContainer:e=!1}={}){this.editorView?.contentDOM?.removeEventListener(`beforeinput`,this.handleLocalInputActivity),this.editorView?.contentDOM?.removeEventListener(`keydown`,this.handleLocalInputActivity),this.editorView?.contentDOM?.removeEventListener(`paste`,this.handleLocalInputActivity),this.editorView?.contentDOM?.removeEventListener(`compositionstart`,this.handleLocalInputActivity),this.editorView?.scrollDOM?.removeEventListener(`scroll`,this.handleScroll),this.editorView?.destroy(),this.editorView=null,e&&this.editorContainer&&(this.editorContainer.innerHTML=``,delete this.editorContainer.dataset.editorMode)}mountEditor(e,{editorMode:t=`collaborative`,preserveScrollTop:n=0}={}){this.clearEditorDom({preserveLoadingIndicator:!0}),this.teardownEditorView(),this.editorView=new l({parent:this.editorContainer,state:e}),this.editorContainer.dataset.editorMode=t,this.editorView.scrollDOM.addEventListener(`scroll`,this.handleScroll,{passive:!0}),this.editorView.contentDOM.addEventListener(`beforeinput`,this.handleLocalInputActivity),this.editorView.contentDOM.addEventListener(`keydown`,this.handleLocalInputActivity),this.editorView.contentDOM.addEventListener(`paste`,this.handleLocalInputActivity),this.editorView.contentDOM.addEventListener(`compositionstart`,this.handleLocalInputActivity),this.updateCursorInfo(this.editorView.state),this.onSelectionChanged?.(this.editorView.state),this.emitViewportChange(),n>0&&requestAnimationFrame(()=>{this.editorView?.scrollDOM&&(this.editorView.scrollDOM.scrollTop=n)})}initialize({awareness:e,filePath:t,undoManager:n,ytext:r}){let i=this.editorView?.scrollDOM?.scrollTop??0,a=x.create({doc:r.toString(),extensions:[...this.getBaseExtensions(t),Ln(r,e,{undoManager:n})]});this.mountEditor(a,{editorMode:`collaborative`,preserveScrollTop:i})}initializeProvisional({content:e=``,filePath:t}){let n=this.editorView?.scrollDOM?.scrollTop??0,r=x.create({doc:String(e??``),extensions:this.getBaseExtensions(t,{readOnly:!0})});this.mountEditor(r,{editorMode:`provisional`,preserveScrollTop:n})}destroy(){this.viewportFrame&&=(cancelAnimationFrame(this.viewportFrame),0),this.remoteUpdateFlashTimer&&=(clearTimeout(this.remoteUpdateFlashTimer),0),this.teardownEditorView({clearContainer:!0})}getText(){return this.editorView?.state.doc.toString()??``}getDoc(){return this.editorView?.state.doc??null}getState(){return this.editorView?.state??null}getScrollContainer(){return this.editorView?.scrollDOM??null}applyTheme(e){this.editorView&&this.editorView.dispatch({effects:[this.themeCompartment.reconfigure(Ur(e)),this.syntaxThemeCompartment.reconfigure(e===`dark`?yn:[])]})}isLineWrappingEnabled(){return this.lineWrappingEnabled}setLineWrapping(e){return this.lineWrappingEnabled=!!e,this.editorView&&this.editorView.dispatch({effects:this.lineWrappingCompartment.reconfigure(this.lineWrappingEnabled?l.lineWrapping:[])}),this.lineWrappingEnabled}requestMeasure(){this.editorView?.requestMeasure()}runEditorCommand(e){if(!this.editorView)return!1;let t=Ir[String(e??``)];if(typeof t!=`function`)return!1;let n=t(this.editorView);return n&&e!==`openSearch`&&this.editorView.focus(),n}flashRemoteRange({from:e=0,to:t=0}={},n=Mr){let r=this.editorView?.state;if(!r||r.doc.length===0)return!1;let i=Math.min(Math.max(Math.round(e),0),r.doc.length),a=Math.min(Math.max(Math.round(t),0),r.doc.length);if(a<=i)if(i<r.doc.length)a=i+1;else if(i>0)--i,a=i+1;else return!1;let o=Math.max(a-i,0)<=Nr&&Date.now()-this.lastLocalInputAt>Pr;return this.editorView.dispatch({effects:Rr.of({from:i,showCaret:o,to:a})}),this.remoteUpdateFlashTimer&&clearTimeout(this.remoteUpdateFlashTimer),this.remoteUpdateFlashTimer=window.setTimeout(()=>{this.remoteUpdateFlashTimer=0,this.editorView?.dispatch({effects:zr.of(null)})},n),!0}getViewportState(e=.35){return{topLine:this.getTopVisibleLineNumber(e),viewportRatio:e}}getTopVisibleLineNumber(e=0){if(!this.editorView)return 1;let t=this.editorView.scrollDOM.getBoundingClientRect(),n=Math.max(t.height*e,8),r=this.editorView.lineBlockAtHeight(t.top+n-this.editorView.documentTop);return r?this.editorView.state.doc.lineAt(r.from).number:1}getCurrentSelectionLineRange(){let e=this.editorView?.state;if(!e)return null;let{doc:t,selection:n}=e,{from:r,to:i}=Gr(n),a=t.lineAt(r).number,o=Math.min(Math.max(i,r),t.length);return o>r&&t.lineAt(o).from===o&&--o,{endLine:t.lineAt(o).number,startLine:a}}getCurrentSelectionCommentAnchor(){let e=this.editorView?.state;if(!e)return null;let{doc:t,selection:n}=e,{from:r,to:i}=Gr(n);if(r===i){let e=t.lineAt(r);return{anchorKind:`line`,anchorQuote:qe(e.text),endIndex:e.to,endLine:e.number,startIndex:e.from,startLine:e.number}}let a=Math.min(Math.max(i,r),t.length);return a>r&&t.lineAt(a).from===a&&--a,{anchorKind:`text`,anchorQuote:qe(t.sliceString(r,i)),endIndex:i,endLine:t.lineAt(a).number,startIndex:r,startLine:t.lineAt(r).number}}normalizeLineRange({endLine:e,startLine:t}){let n=this.editorView?.state;if(!n)return{endLine:1,startLine:1};let r=n.doc.lines,i=Math.min(Math.max(Math.round(t??1),1),r);return{endLine:Math.min(Math.max(Math.round(e??i),i),r),startLine:i}}getLineInfoAt(e){let t=this.editorView?.state;if(!t)return null;let n=Math.min(Math.max(e,0),t.doc.length),r=t.doc.lineAt(n);return{line:r,lineNumber:r.number}}getAnchorClientRect(e){let t=this.editorView?.state,n=this.editorView;if(!t||!n||!e)return null;let r=e.anchorKind||e.kind||`line`,i=Math.min(Math.max(Math.round(e.startIndex??0),0),t.doc.length),a=Math.min(Math.max(Math.round(e.endIndex??i),i),t.doc.length);if(r===`text`&&a>i){let e=n.coordsAtPos(i),t=n.coordsAtPos(Math.max(a-1,i));if(e&&t)return{bottom:Math.max(e.bottom,t.bottom),height:Math.max(e.bottom,t.bottom)-Math.min(e.top,t.top),left:Math.min(e.left,t.left),right:Math.max(e.right,t.right),top:Math.min(e.top,t.top),width:Math.max(e.right,t.right)-Math.min(e.left,t.left)}}let o=t.doc.line(Math.min(Math.max(Math.round(e.startLine??1),1),t.doc.lines)),s=n.lineBlockAt(o.from),c=n.scrollDOM.getBoundingClientRect(),l=n.scrollDOM.scrollTop,u=n.contentDOM.getBoundingClientRect(),d=u.left,f=Math.max(u.right,c.right-8),p=c.top+s.top-l;return{bottom:p+s.height,height:s.height,left:d,right:f,top:p,width:Math.max(f-d,0)}}getSelectionChipClientRect(e){let t=this.editorView?.state,n=this.editorView;if(!t||!n||!e)return null;let r=Math.min(Math.max(Math.round(e.startIndex??0),0),t.doc.length),i=t.doc.lineAt(r),a=n.lineBlockAt(i.from),o=n.scrollDOM.getBoundingClientRect(),s=n.scrollDOM.scrollTop,c=n.contentDOM.getBoundingClientRect(),l=Math.max(c.right,o.right-8),u=o.top+a.top-s;return{bottom:u+a.height,height:a.height,left:c.left,right:l,top:u,width:Math.max(l-c.left,0)}}scrollToLine(e,t=0){let n=this.editorView?.state,r=this.editorView?.scrollDOM;if(!n||!r||!this.editorView)return!1;let i=Math.min(Math.max(Math.round(e),1),n.doc.lines),a=n.doc.line(i),o=this.editorView.lineBlockAt(a.from),s=Math.max(r.scrollHeight-r.clientHeight,0),c=t>0?r.clientHeight*t:8,l=Math.min(Math.max(o.top-c,0),s);return r.scrollTo({top:l}),!0}scrollToPosition(e,t=`center`){let n=this.editorView?.state,r=this.editorView?.scrollDOM;if(!n||!r||!this.editorView)return!1;let i=Math.min(Math.max(Math.round(e),0),n.doc.length),a=this.editorView.lineBlockAt(i),o=Math.max(r.scrollHeight-r.clientHeight,0),s=a.top;return t===`center`&&(s=a.top-(r.clientHeight-a.height)/2),r.scrollTo({top:Math.min(Math.max(s,0),o)}),!0}applyMarkdownToolbarAction(e){if(!this.editorView)return!1;let{state:t}=this.editorView,n=t.doc.toString(),r=!1,i=t.changeByRange(t=>{let i=vr(n,t,e);return i?(r=!0,{changes:{from:i.from,insert:i.insert,to:i.to},range:y.range(i.anchor,i.head)}):{range:t}});return r?(this.editorView.dispatch(t.update(i,{scrollIntoView:!0,userEvent:`input`})),this.editorView.focus(),!0):!1}insertText(e){if(!this.editorView)return!1;let t=String(e??``),{state:n}=this.editorView,r=n.selection.main,i=r.from+t.length;return this.editorView.dispatch({changes:{from:r.from,insert:t,to:r.to},scrollIntoView:!0,selection:{anchor:i,head:i},userEvent:`input`}),this.editorView.focus(),!0}replaceText(e){if(!this.editorView)return!1;let t=String(e??``),{state:n}=this.editorView;return this.editorView.dispatch({changes:{from:0,insert:t,to:n.doc.length},selection:{anchor:0,head:0},userEvent:`input`}),this.editorView.focus(),!0}toggleTaskListItem(e){let t=this.editorView?.state;if(!this.editorView||!t)return!1;let n=Number.parseInt(String(e??``),10);if(!Number.isFinite(n))return!1;let r=Math.min(Math.max(n,1),t.doc.lines),i=t.doc.line(r),a=Fr.exec(i.text);if(!a)return!1;let[,o,s]=a,c=i.from+o.length,l=s===` `?`x`:` `;return this.editorView.dispatch({changes:{from:c,insert:l,to:c+1},userEvent:`input`}),!0}updateCursorInfo(e){if(!this.lineInfoElement)return;let t=e.selection.main.head,n=e.doc.lineAt(t),r=t-n.from+1;this.lineInfoElement.textContent=`Ln ${n.number}, Col ${r}`}emitViewportChange(){this.onViewportChanged?.(this.getViewportState())}},qr=class{constructor({editorContainer:e,lineWrappingEnabled:t=!0,initialTheme:n,lineInfoElement:r,onAwarenessChange:i,onConnectionChange:a,onCommentsChange:o,onContentChange:s,onImagePaste:c,onSelectionChange:l,preferredUserName:u,localUser:d,getFileList:f}){this.onAwarenessChange=i,this.onCommentsChange=o,this.onContentChange=s,this.onSelectionChange=l,this.activeFilePath=``,this.bootstrapContent=null,this.pendingCollaborativeBindings=null,this.hasDeliveredContent=!1,this.lastDeliveredContent=null,this.collaborationClient=new ot({localUser:d,onAwarenessChange:e=>this.onAwarenessChange?.(e),onConnectionChange:a,onInitialSync:()=>this.emitContentChange(),preferredUserName:u,resolveAwarenessCursor:e=>this.resolveAwarenessCursor(e)}),this.viewAdapter=new Kr({editorContainer:e,getFileList:f||(()=>[]),initialTheme:n,lineInfoElement:r,lineWrappingEnabled:t,onDocChanged:()=>{this.emitContentChange()},onImagePaste:c,onViewportChanged:e=>{this.collaborationClient.setLocalViewport(e)},onSelectionChanged:()=>{this.onSelectionChange?.(this.getCurrentSelectionCommentAnchor())}}),this.commentThreadStore=new at({getDoc:()=>this.collaborationClient.ydoc,getEditorState:()=>this.viewAdapter.getState(),getLocalUser:()=>this.collaborationClient.getLocalUser(),onCommentsChange:e=>this.onCommentsChange?.(e)})}async initialize(e){this.activeFilePath=e,this.hasDeliveredContent=!1,this.lastDeliveredContent=null;let t=await this.collaborationClient.initialize(e);this.commentThreadStore.bind({commentThreads:t.commentThreads,ydoc:t.ydoc,ytext:t.ytext}),this.pendingCollaborativeBindings=t,this.collaborationClient.initialSyncComplete&&this.activateCollaborativeView(),this.onAwarenessChange?.(this.collaborationClient.collectUsers(e=>this.resolveAwarenessCursor(e)))}activateCollaborativeView(){return this.pendingCollaborativeBindings?(this.viewAdapter.initialize({awareness:this.pendingCollaborativeBindings.awareness,filePath:this.activeFilePath,undoManager:this.pendingCollaborativeBindings.undoManager,ytext:this.pendingCollaborativeBindings.ytext}),this.commentThreadStore.refreshComments(),this.pendingCollaborativeBindings=null,this.bootstrapContent=null,!0):!1}showBootstrapContent({content:e=``,filePath:t=this.activeFilePath}={}){return this.collaborationClient.initialSyncComplete?!1:(this.activeFilePath=t,this.bootstrapContent=String(e??``),this.viewAdapter.initializeProvisional({content:this.bootstrapContent,filePath:this.activeFilePath}),this.commentThreadStore.refreshComments(),this.emitContentChange())}hasBootstrapContent(){return this.bootstrapContent!==null}emitContentChange({force:e=!1}={}){let t=this.getText();return!e&&this.hasDeliveredContent&&t===this.lastDeliveredContent?!1:(this.hasDeliveredContent=!0,this.lastDeliveredContent=t,this.onContentChange?.(),!0)}ensureInitialContent(){return this.emitContentChange()}applyTheme(e){this.viewAdapter.applyTheme(e)}getText(){return this.collaborationClient.getText()||this.viewAdapter.getText()}getScrollContainer(){return this.viewAdapter.getScrollContainer()}getTopVisibleLineNumber(e=0){return this.viewAdapter.getTopVisibleLineNumber(e)}getLocalUser(){return this.collaborationClient.getLocalUser()}get awareness(){return this.collaborationClient.awareness}get provider(){return this.collaborationClient.provider}get ydoc(){return this.collaborationClient.ydoc}get ytext(){return this.collaborationClient.ytext}getCurrentSelectionLineRange(){return this.viewAdapter.getCurrentSelectionLineRange()}getCurrentSelectionCommentAnchor(){return this.viewAdapter.getCurrentSelectionCommentAnchor()}getCommentAnchorClientRect(e){return this.viewAdapter.getAnchorClientRect(e)}getSelectionChipClientRect(e){return this.viewAdapter.getSelectionChipClientRect(e)}getCommentThreads(){return this.commentThreadStore.getCommentThreads()}createCommentThread(e){return this.commentThreadStore.createCommentThread(e)}replyToCommentThread(e,t){return this.commentThreadStore.replyToCommentThread(e,t)}toggleCommentReaction(e,t,n){return this.commentThreadStore.toggleCommentReaction(e,t,n)}deleteCommentThread(e){return this.commentThreadStore.deleteCommentThread(e)}isLineWrappingEnabled(){return this.viewAdapter.isLineWrappingEnabled()}setLineWrapping(e){return this.viewAdapter.setLineWrapping(e)}scrollToLine(e,t=0){return this.viewAdapter.scrollToLine(e,t)}getUserCursor(e){return this.collaborationClient.getUserCursor(e,e=>this.resolveAwarenessCursor(e))}getUserViewport(e){return this.collaborationClient.getUserViewport(e)}scrollToPosition(e,t=`center`){return this.viewAdapter.scrollToPosition(e,t)}scrollToUserViewport(e){let t=this.getUserViewport(e);return t?this.scrollToLine(t.topLine,t.viewportRatio):!1}scrollToUserCursor(e,t=`center`){let n=this.getUserCursor(e);return n?this.scrollToPosition(n.cursorHead,t)||this.scrollToLine(n.cursorLine):!1}setUserName(e){return this.collaborationClient.setUserName(e)}requestMeasure(){this.viewAdapter.requestMeasure()}runEditorCommand(e){return this.viewAdapter.runEditorCommand(e)}applyMarkdownToolbarAction(e){return this.viewAdapter.applyMarkdownToolbarAction(e)}insertText(e){return this.viewAdapter.insertText(e)}replaceText(e){return this.viewAdapter.replaceText(e)}toggleTaskListItem(e){return this.collaborationClient.initialSyncComplete?this.viewAdapter.toggleTaskListItem(e):!1}flashExternalUpdate(e){return this.viewAdapter.flashRemoteRange(e)}waitForInitialSync(e=1500){return this.collaborationClient.waitForInitialSync(e)}destroy(){this.commentThreadStore.unbind(),this.activeFilePath=``,this.bootstrapContent=null,this.pendingCollaborativeBindings=null,this.hasDeliveredContent=!1,this.lastDeliveredContent=null,this.collaborationClient.destroy(),this.viewAdapter.destroy()}resolveAwarenessCursor(e){let t=this.collaborationClient.ydoc,n=this.collaborationClient.ytext,r=this.viewAdapter.getState();if(!e?.anchor||!e?.head||!t||!r||!n)return null;let i=T(e.anchor,t),a=T(e.head,t);if(!i||!a||i.type!==n||a.type!==n)return null;let o=r.doc.lineAt(a.index);return{cursorAnchor:i.index,cursorHead:a.index,cursorLine:o.number}}};export{qr as EditorSession};
|
|
16
|
+
`)}function gr(e,t){return mr(e,t,hr(e.slice(t.from,t.to)),2,Kn[0].length)}function _r(e,t){return mr(e,t,`---`,4,0)}function vr(e,t,n){let r=String(e??``),i=Jn(t,r.length),a;switch(n){case`bold`:a=$n(r,i,`**`,Rn.bold);break;case`italic`:a=$n(r,i,`_`,Rn.italic);break;case`strikethrough`:a=$n(r,i,`~~`,Rn.strikethrough);break;case`code`:a=$n(r,i,"`",Rn.code);break;case`link`:a=tr(r,i);break;case`image`:a=nr(r,i);break;case`video`:a=rr(r,i);break;case`paragraph`:a=dr(r,i);break;case`heading`:a=$(r,i,2);break;case`heading-1`:a=$(r,i,1);break;case`heading-2`:a=$(r,i,2);break;case`heading-3`:a=$(r,i,3);break;case`heading-4`:a=$(r,i,4);break;case`heading-5`:a=$(r,i,5);break;case`heading-6`:a=$(r,i,6);break;case`quote`:a=cr(r,i);break;case`bullet-list`:a=sr(r,i);break;case`numbered-list`:a=ur(r,i);break;case`task-list`:a=lr(r,i);break;case`code-block`:a=pr(r,i);break;case`table`:a=gr(r,i);break;case`horizontal-rule`:a=_r(r,i);break;default:return null}return a?r.slice(a.from,a.to)===a.insert?null:a:null}function yr(e){return t=>{let n=t.state.doc.lineAt(t.pos),r=n.text.slice(0,t.pos-n.from),i=r.lastIndexOf(`[[`);if(i===-1)return null;let a=r.slice(i+2);if(a.includes(`]]`))return null;let o=a.toLowerCase(),s=n.from+i+2,c=e().map(e=>{let t=e.replace(/\.md$/i,``);return{filePath:e,label:t,fileName:t.split(`/`).pop()}}).filter(({label:e,fileName:t})=>e.toLowerCase().includes(o)||t.toLowerCase().includes(o)).map(({label:e,fileName:t})=>({label:e,detail:e.includes(`/`)?` ${t}`:void 0,apply:(e,t,n,r)=>{let i=e.state.doc.toString(),a=r;i.slice(r,r+2)===`]]`&&(a=r+2),e.dispatch({changes:{from:n,to:a,insert:`${t.label}]]`},selection:{anchor:n+t.label.length+2}})},type:`text`,boost:+!!e.toLowerCase().startsWith(o)}));return c.length===0?null:{from:s,options:c,filter:!1}}}var br=new Set([`@startuml`,`@enduml`,`@startmindmap`,`@endmindmap`,`@startwbs`,`@endwbs`,`@startgantt`,`@endgantt`,`@startjson`,`@endjson`,`@startyaml`,`@endyaml`,`@startsalt`,`@endsalt`]),xr=new Set(`activate.actor.agent.allowmixing.alt.annotation.artifact.as.autonumber.boundary.box.break.caption.card.case.circle.class.cloud.collections.component.control.create.critical.database.deactivate.destroy.detach.else.elseif.end.endlegend.endif.endwhile.entity.enum.exception.file.folder.footer.fork.frame.group.header.hide.hnote.if.interface.json.kill.label.legend.loop.map.namespace.newpage.node.note.object.of.opt.order.over.package.page.par.participant.partition.person.port.protocol.queue.rectangle.ref.repeat.return.rnote.show.skinparam.split.stack.start.state.stop.storage.struct.switch.then.title.usecase.while`.split(`.`)),Sr=new Set([`false`,`no`,`off`,`on`,`true`,`yes`]);function Cr(e){let t=e.match(/[@!A-Za-z_][\w.-]*/u,!1);return t?(e.match(/[@!A-Za-z_][\w.-]*/u),t[0]):``}var wr=new le(ne.define({languageData:{commentTokens:{block:{close:`'/`,open:`/'`},line:`'`}},startState(){return{inBlockComment:!1}},token(e,t){if(t.inBlockComment)return e.skipTo(`'/`)?(e.match(`'/`),t.inBlockComment=!1):e.skipToEnd(),`comment`;if(e.eatSpace())return null;if(e.match(`/'`))return t.inBlockComment=!0,`comment`;let n=e.pos===0?` `:e.string.charAt(e.pos-1);if(e.peek()===`'`&&(e.sol()||/\s/u.test(n)))return e.skipToEnd(),`comment`;if(e.match(/"(?:[^"\\]|\\.)*"?/u))return`string`;if(e.match(/#[0-9a-f]{3,8}\b/iu)||e.match(/#[A-Za-z][\w-]*/u))return`atom`;if(e.match(/\b\d+(?:\.\d+)?\b/u))return`number`;if(e.match(/[<>{}[\]():,]/u))return`punctuation`;if(e.match(/[ox*+<#]?[-=.\\/]+(?:left|right|up|down)?[-=.\\/]*[ox*+>#]?/iu))return`operator`;let r=Cr(e);if(r){let e=r.toLowerCase();return e.startsWith(`!`)||br.has(e)?`meta`:xr.has(e)?`keyword`:Sr.has(e)?`bool`:/^[A-Z][A-Z0-9_]*$/u.test(r)?`typeName`:`variableName`}return e.next(),null}})),Tr=v.of({alias:[`plantuml`,`puml`],extensions:[`plantuml`,`puml`],name:`PlantUML`,support:wr});function Er(e){let t=Array.from(e?.clipboardData?.files??[]);for(let e of t)if(e?.type?.startsWith?.(`image/`))return e;let n=Array.from(e?.clipboardData?.items??[]);for(let e of n){if(e.kind!==`file`||!e.type?.startsWith?.(`image/`))continue;let t=e.getAsFile?.();if(t)return t}return null}function Dr(e,t){let n=Er(e);return n?typeof t==`function`?(console.debug(`[editor] Detected pasted image.`,{name:n.name??``,size:n.size??null,type:n.type??``}),e.preventDefault?.(),Promise.resolve(t(n)).catch(e=>{console.error(`[editor] Failed to process pasted image:`,e)}),!0):(console.warn(`[editor] Ignoring pasted image because no image paste handler is registered.`),!1):!1}var Or=[...st,Tr],kr=i.mark({class:`cm-matchingBracket cm-matchingBracket-paired`}),Ar=i.mark({class:`cm-nonmatchingBracket`}),jr=i.mark({class:`cm-remoteUpdateFlash`}),Mr=1350,Nr=160,Pr=900,Fr=/^(\s*(?:>\s*)*(?:[-+*]|\d+[.)])\s+\[)( |x|X)(\])(\s.*)?$/,Ir=Object.freeze({indentLess:Oe,indentMore:Ee,openSearch:Xt,redo:Me,undo:De}),Lr=class extends ye{toDOM(){let e=document.createElement(`span`);return e.className=`cm-remoteUpdateCaretWidget`,e.setAttribute(`aria-hidden`,`true`),e}ignoreEvent(){return!0}},Rr=b.define(),zr=b.define(),Br=ee.define({create:()=>i.none,update(e,t){let n=e.map(t.changes);return t.effects.forEach(e=>{if(e.is(zr)){n=i.none;return}if(e.is(Rr)){let{from:t,showCaret:r,to:a}=e.value,o=[];a>t&&o.push(jr.range(t,a)),r&&o.push(i.widget({side:-1,widget:new Lr}).range(t)),n=o.length>0?i.set(o,!0):i.none}}),n},provide:e=>l.decorations.from(e)});function Vr(e,t){return t.selection.ranges.some(t=>t.empty&&e.to===t.head)}function Hr(e,t){let n=[];if(!e.matched)return n.push(Ar.range(e.start.from,e.start.to)),e.end&&n.push(Ar.range(e.end.from,e.end.to)),n;let r=Vr(e.start,t),i=e.end?Vr(e.end,t):!1;return r||n.push(kr.range(e.start.from,e.start.to)),e.end&&!i&&n.push(kr.range(e.end.from,e.end.to)),n}function Ur(e){let t=e===`dark`?`oklch(from var(--color-surface-offset) l c h / 0.55)`:`oklch(from var(--color-surface-offset) l c h / 0.75)`,n=e===`dark`?`oklch(from var(--color-primary) l c h / 0.28)`:`oklch(from var(--color-primary) l c h / 0.18)`,r=e===`dark`?`oklch(from var(--color-primary) l c h / 0.4)`:`oklch(from var(--color-primary) l c h / 0.26)`,i=e===`dark`?`oklch(from var(--color-primary) l c h / 0.65)`:`oklch(from var(--color-primary) l c h / 0.5)`,a=e===`dark`?`color-mix(in oklab, var(--color-primary) 78%, white)`:`color-mix(in oklab, var(--color-primary) 84%, black)`,o=e===`dark`?`oklch(from var(--color-primary) l c h / 0.2)`:`oklch(from var(--color-primary) l c h / 0.12)`,s=e===`dark`?`oklch(from var(--color-primary) calc(l + 0.08) c h / 0.85)`:`oklch(from var(--color-primary) calc(l - 0.04) c h / 0.7)`,c=e===`dark`?`oklch(from var(--color-error) l c h / 0.12)`:`oklch(from var(--color-error) l c h / 0.1)`,u=e===`dark`?`oklch(from var(--color-error) calc(l + 0.08) c h / 0.8)`:`oklch(from var(--color-error) calc(l - 0.04) c h / 0.7)`;return l.theme({"&":{backgroundColor:`var(--color-bg)`,color:`var(--color-text)`},".cm-content":{caretColor:a,fontFamily:`var(--font-mono)`,padding:`16px 0`},".cm-cursor, .cm-dropCursor":{borderLeftColor:a,borderLeftWidth:`3px`,marginLeft:`-1px`},".cm-foldPlaceholder":{backgroundColor:`var(--color-surface-dynamic)`,border:`none`,color:`var(--color-text-muted)`},".cm-gutters":{backgroundColor:`var(--color-surface)`,borderRight:`1px solid var(--color-divider)`,color:`var(--color-text-muted)`,minWidth:`44px`},".cm-line":{padding:`0 16px`},".cm-activeLine":{backgroundColor:t,boxShadow:`inset 3px 0 0 ${n}`},".cm-activeLineGutter":{backgroundColor:t,boxShadow:`inset 3px 0 0 ${n}`,color:`var(--color-text-muted)`},".cm-matchingBracket":{borderRadius:`2px`,color:`inherit`},".cm-matchingBracket.cm-matchingBracket-paired":{backgroundColor:o,outline:`1px solid ${s}`},".cm-nonmatchingBracket":{backgroundColor:c,outline:`1px solid ${u}`,borderRadius:`2px`},".cm-selectionMatch":{backgroundColor:`var(--color-primary-highlight)`},".cm-remoteUpdateFlash":{animation:`collabmd-remote-update-flash 1.35s ease-out`,backgroundColor:e===`dark`?`oklch(from var(--color-primary) l c h / 0.22)`:`oklch(from var(--color-primary) l c h / 0.16)`,borderRadius:`3px`,boxShadow:`0 0 0 1px ${e===`dark`?`oklch(from var(--color-primary) calc(l + 0.05) c h / 0.26)`:`oklch(from var(--color-primary) calc(l - 0.04) c h / 0.2)`}`},".cm-remoteUpdateCaretWidget":{animation:`collabmd-remote-update-caret 1s ease-out`,backgroundColor:`transparent`,borderLeft:`2px solid ${e===`dark`?`color-mix(in oklab, var(--color-primary) 78%, white)`:`color-mix(in oklab, var(--color-primary) 84%, black)`}`,borderRadius:`999px`,boxShadow:`0 0 0 1px ${e===`dark`?`oklch(from var(--color-primary) calc(l + 0.06) c h / 0.22)`:`oklch(from var(--color-primary) calc(l - 0.04) c h / 0.16)`}`,display:`inline-block`,height:`1.2em`,marginLeft:`-1px`,marginRight:`-1px`,pointerEvents:`none`,transformOrigin:`center bottom`,verticalAlign:`text-bottom`,width:`0`},"&.cm-focused .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:r},"&.cm-focused .cm-selectionLayer .cm-selectionBackground":{border:`1px solid ${i}`,borderRadius:`2px`},"@keyframes collabmd-remote-update-flash":{"0%":{backgroundColor:e===`dark`?`oklch(from var(--color-primary) l c h / 0.34)`:`oklch(from var(--color-primary) l c h / 0.26)`},"100%":{backgroundColor:`oklch(from var(--color-primary) l c h / 0)`}},"@keyframes collabmd-remote-update-caret":{"0%":{boxShadow:`0 0 0 1px ${e===`dark`?`oklch(from var(--color-primary) calc(l + 0.08) c h / 0.34)`:`oklch(from var(--color-primary) calc(l - 0.04) c h / 0.24)`}`,opacity:`0`,transform:`translateY(0.2em) scaleY(0.7)`},"18%":{opacity:`1`,transform:`translateY(0) scaleY(1)`},"72%":{opacity:`1`,transform:`translateY(0) scaleY(1)`},"100%":{boxShadow:`0 0 0 1px ${e===`dark`?`oklch(from var(--color-primary) calc(l + 0.08) c h / 0)`:`oklch(from var(--color-primary) calc(l - 0.04) c h / 0)`}`,opacity:`0`,transform:`translateY(-0.05em) scaleY(0.9)`}}},{dark:e===`dark`})}function Wr(e){return Pe(e)?wr:Fe(e)?Te():Ce({base:we,codeLanguages:Or})}function Gr(e){return{from:Math.min(...e.ranges.map(e=>Math.min(e.from,e.to))),to:Math.max(...e.ranges.map(e=>Math.max(e.from,e.to)))}}var Kr=class{constructor({editorContainer:e,getFileList:t,initialTheme:n,lineInfoElement:r,lineWrappingEnabled:i=!0,onDocChanged:a=null,onImagePaste:o=null,onSelectionChanged:s=null,onViewportChanged:c=null}){this.editorContainer=e,this.getFileList=t??(()=>[]),this.initialTheme=n,this.lineInfoElement=r,this.lineWrappingEnabled=i,this.onDocChanged=a,this.onImagePaste=o,this.onSelectionChanged=s,this.onViewportChanged=c,this.editorView=null,this.themeCompartment=new pe,this.syntaxThemeCompartment=new pe,this.lineWrappingCompartment=new pe,this.viewportFrame=0,this.remoteUpdateFlashTimer=0,this.lastLocalInputAt=0,this.handleScroll=()=>{this.viewportFrame||=requestAnimationFrame(()=>{this.viewportFrame=0,this.emitViewportChange()})},this.handleLocalInputActivity=()=>{this.lastLocalInputAt=Date.now()}}createUpdateListener(){return l.updateListener.of(e=>{e.docChanged&&this.onDocChanged?.(),(e.selectionSet||e.docChanged)&&(this.updateCursorInfo(e.state),this.onSelectionChanged?.(e.state))})}getBaseExtensions(e,{readOnly:t=!1}={}){let i=[s(),a(),c(),ke(),oe(),h(),x.allowMultipleSelections.of(!0),ge(),n(ie,{fallback:!0}),se({renderMatch:Hr}),Se(),xe({override:[yr(this.getFileList)]}),_(),r(),g(),yt(),de.of([...be,...Ne,...je,...Qt,...he,Ae]),l.contentAttributes.of({"aria-label":`Markdown editor`}),Wr(e),this.themeCompartment.of(Ur(this.initialTheme)),this.syntaxThemeCompartment.of(this.initialTheme===`dark`?yn:[]),this.lineWrappingCompartment.of(this.lineWrappingEnabled?l.lineWrapping:[]),Br,this.createUpdateListener()];return t?(i.push(x.readOnly.of(!0)),i.push(l.editable.of(!1)),i):(i.splice(13,0,ae.highest(l.domEventHandlers({paste:e=>Dr(e,this.onImagePaste)}))),i)}clearEditorDom({preserveLoadingIndicator:e=!0}={}){if(!this.editorContainer)return;let t=e?this.editorContainer.querySelector(`#editorLoading`):null;Array.from(this.editorContainer.children).forEach(e=>{e!==t&&e.remove()})}teardownEditorView({clearContainer:e=!1}={}){this.editorView?.contentDOM?.removeEventListener(`beforeinput`,this.handleLocalInputActivity),this.editorView?.contentDOM?.removeEventListener(`keydown`,this.handleLocalInputActivity),this.editorView?.contentDOM?.removeEventListener(`paste`,this.handleLocalInputActivity),this.editorView?.contentDOM?.removeEventListener(`compositionstart`,this.handleLocalInputActivity),this.editorView?.scrollDOM?.removeEventListener(`scroll`,this.handleScroll),this.editorView?.destroy(),this.editorView=null,e&&this.editorContainer&&(this.editorContainer.innerHTML=``,delete this.editorContainer.dataset.editorMode)}mountEditor(e,{editorMode:t=`collaborative`,preserveScrollTop:n=0}={}){this.clearEditorDom({preserveLoadingIndicator:!0}),this.teardownEditorView(),this.editorView=new l({parent:this.editorContainer,state:e}),this.editorContainer.dataset.editorMode=t,this.editorView.scrollDOM.addEventListener(`scroll`,this.handleScroll,{passive:!0}),this.editorView.contentDOM.addEventListener(`beforeinput`,this.handleLocalInputActivity),this.editorView.contentDOM.addEventListener(`keydown`,this.handleLocalInputActivity),this.editorView.contentDOM.addEventListener(`paste`,this.handleLocalInputActivity),this.editorView.contentDOM.addEventListener(`compositionstart`,this.handleLocalInputActivity),this.updateCursorInfo(this.editorView.state),this.onSelectionChanged?.(this.editorView.state),this.emitViewportChange(),n>0&&requestAnimationFrame(()=>{this.editorView?.scrollDOM&&(this.editorView.scrollDOM.scrollTop=n)})}initialize({awareness:e,filePath:t,undoManager:n,ytext:r}){let i=this.editorView?.scrollDOM?.scrollTop??0,a=x.create({doc:r.toString(),extensions:[...this.getBaseExtensions(t),Ln(r,e,{undoManager:n})]});this.mountEditor(a,{editorMode:`collaborative`,preserveScrollTop:i})}initializeProvisional({content:e=``,filePath:t}){let n=this.editorView?.scrollDOM?.scrollTop??0,r=x.create({doc:String(e??``),extensions:this.getBaseExtensions(t,{readOnly:!0})});this.mountEditor(r,{editorMode:`provisional`,preserveScrollTop:n})}destroy(){this.viewportFrame&&=(cancelAnimationFrame(this.viewportFrame),0),this.remoteUpdateFlashTimer&&=(clearTimeout(this.remoteUpdateFlashTimer),0),this.teardownEditorView({clearContainer:!0})}getText(){return this.editorView?.state.doc.toString()??``}getDoc(){return this.editorView?.state.doc??null}getState(){return this.editorView?.state??null}getScrollContainer(){return this.editorView?.scrollDOM??null}applyTheme(e){this.editorView&&this.editorView.dispatch({effects:[this.themeCompartment.reconfigure(Ur(e)),this.syntaxThemeCompartment.reconfigure(e===`dark`?yn:[])]})}isLineWrappingEnabled(){return this.lineWrappingEnabled}setLineWrapping(e){return this.lineWrappingEnabled=!!e,this.editorView&&this.editorView.dispatch({effects:this.lineWrappingCompartment.reconfigure(this.lineWrappingEnabled?l.lineWrapping:[])}),this.lineWrappingEnabled}requestMeasure(){this.editorView?.requestMeasure()}runEditorCommand(e){if(!this.editorView)return!1;let t=Ir[String(e??``)];if(typeof t!=`function`)return!1;let n=t(this.editorView);return n&&e!==`openSearch`&&this.editorView.focus(),n}flashRemoteRange({from:e=0,to:t=0}={},n=Mr){let r=this.editorView?.state;if(!r||r.doc.length===0)return!1;let i=Math.min(Math.max(Math.round(e),0),r.doc.length),a=Math.min(Math.max(Math.round(t),0),r.doc.length);if(a<=i)if(i<r.doc.length)a=i+1;else if(i>0)--i,a=i+1;else return!1;let o=Math.max(a-i,0)<=Nr&&Date.now()-this.lastLocalInputAt>Pr;return this.editorView.dispatch({effects:Rr.of({from:i,showCaret:o,to:a})}),this.remoteUpdateFlashTimer&&clearTimeout(this.remoteUpdateFlashTimer),this.remoteUpdateFlashTimer=window.setTimeout(()=>{this.remoteUpdateFlashTimer=0,this.editorView?.dispatch({effects:zr.of(null)})},n),!0}getViewportState(e=.35){return{topLine:this.getTopVisibleLineNumber(e),viewportRatio:e}}getTopVisibleLineNumber(e=0){if(!this.editorView)return 1;let t=this.editorView.scrollDOM.getBoundingClientRect(),n=Math.max(t.height*e,8),r=this.editorView.lineBlockAtHeight(t.top+n-this.editorView.documentTop);return r?this.editorView.state.doc.lineAt(r.from).number:1}getCurrentSelectionLineRange(){let e=this.editorView?.state;if(!e)return null;let{doc:t,selection:n}=e,{from:r,to:i}=Gr(n),a=t.lineAt(r).number,o=Math.min(Math.max(i,r),t.length);return o>r&&t.lineAt(o).from===o&&--o,{endLine:t.lineAt(o).number,startLine:a}}getCurrentSelectionCommentAnchor(){let e=this.editorView?.state;if(!e)return null;let{doc:t,selection:n}=e,{from:r,to:i}=Gr(n);if(r===i){let e=t.lineAt(r);return{anchorKind:`line`,anchorQuote:qe(e.text),endIndex:e.to,endLine:e.number,startIndex:e.from,startLine:e.number}}let a=Math.min(Math.max(i,r),t.length);return a>r&&t.lineAt(a).from===a&&--a,{anchorKind:`text`,anchorQuote:qe(t.sliceString(r,i)),endIndex:i,endLine:t.lineAt(a).number,startIndex:r,startLine:t.lineAt(r).number}}normalizeLineRange({endLine:e,startLine:t}){let n=this.editorView?.state;if(!n)return{endLine:1,startLine:1};let r=n.doc.lines,i=Math.min(Math.max(Math.round(t??1),1),r);return{endLine:Math.min(Math.max(Math.round(e??i),i),r),startLine:i}}getLineInfoAt(e){let t=this.editorView?.state;if(!t)return null;let n=Math.min(Math.max(e,0),t.doc.length),r=t.doc.lineAt(n);return{line:r,lineNumber:r.number}}getAnchorClientRect(e){let t=this.editorView?.state,n=this.editorView;if(!t||!n||!e)return null;let r=e.anchorKind||e.kind||`line`,i=Math.min(Math.max(Math.round(e.startIndex??0),0),t.doc.length),a=Math.min(Math.max(Math.round(e.endIndex??i),i),t.doc.length);if(r===`text`&&a>i){let e=n.coordsAtPos(i),t=n.coordsAtPos(Math.max(a-1,i));if(e&&t)return{bottom:Math.max(e.bottom,t.bottom),height:Math.max(e.bottom,t.bottom)-Math.min(e.top,t.top),left:Math.min(e.left,t.left),right:Math.max(e.right,t.right),top:Math.min(e.top,t.top),width:Math.max(e.right,t.right)-Math.min(e.left,t.left)}}let o=t.doc.line(Math.min(Math.max(Math.round(e.startLine??1),1),t.doc.lines)),s=n.lineBlockAt(o.from),c=n.scrollDOM.getBoundingClientRect(),l=n.scrollDOM.scrollTop,u=n.contentDOM.getBoundingClientRect(),d=u.left,f=Math.max(u.right,c.right-8),p=c.top+s.top-l;return{bottom:p+s.height,height:s.height,left:d,right:f,top:p,width:Math.max(f-d,0)}}getSelectionChipClientRect(e){let t=this.editorView?.state,n=this.editorView;if(!t||!n||!e)return null;let r=Math.min(Math.max(Math.round(e.startIndex??0),0),t.doc.length),i=t.doc.lineAt(r),a=n.lineBlockAt(i.from),o=n.scrollDOM.getBoundingClientRect(),s=n.scrollDOM.scrollTop,c=n.contentDOM.getBoundingClientRect(),l=Math.max(c.right,o.right-8),u=o.top+a.top-s;return{bottom:u+a.height,height:a.height,left:c.left,right:l,top:u,width:Math.max(l-c.left,0)}}scrollToLine(e,t=0){let n=this.editorView?.state,r=this.editorView?.scrollDOM;if(!n||!r||!this.editorView)return!1;let i=Math.min(Math.max(Math.round(e),1),n.doc.lines),a=n.doc.line(i),o=this.editorView.lineBlockAt(a.from),s=Math.max(r.scrollHeight-r.clientHeight,0),c=t>0?r.clientHeight*t:8,l=Math.min(Math.max(o.top-c,0),s);return r.scrollTo({top:l}),!0}scrollToPosition(e,t=`center`){let n=this.editorView?.state,r=this.editorView?.scrollDOM;if(!n||!r||!this.editorView)return!1;let i=Math.min(Math.max(Math.round(e),0),n.doc.length),a=this.editorView.lineBlockAt(i),o=Math.max(r.scrollHeight-r.clientHeight,0),s=a.top;return t===`center`&&(s=a.top-(r.clientHeight-a.height)/2),r.scrollTo({top:Math.min(Math.max(s,0),o)}),!0}applyMarkdownToolbarAction(e){if(!this.editorView)return!1;let{state:t}=this.editorView,n=t.doc.toString(),r=!1,i=t.changeByRange(t=>{let i=vr(n,t,e);return i?(r=!0,{changes:{from:i.from,insert:i.insert,to:i.to},range:y.range(i.anchor,i.head)}):{range:t}});return r?(this.editorView.dispatch(t.update(i,{scrollIntoView:!0,userEvent:`input`})),this.editorView.focus(),!0):!1}insertText(e){if(!this.editorView)return!1;let t=String(e??``),{state:n}=this.editorView,r=n.selection.main,i=r.from+t.length;return this.editorView.dispatch({changes:{from:r.from,insert:t,to:r.to},scrollIntoView:!0,selection:{anchor:i,head:i},userEvent:`input`}),this.editorView.focus(),!0}replaceText(e){if(!this.editorView)return!1;let t=String(e??``),{state:n}=this.editorView;return this.editorView.dispatch({changes:{from:0,insert:t,to:n.doc.length},selection:{anchor:0,head:0},userEvent:`input`}),this.editorView.focus(),!0}toggleTaskListItem(e){let t=this.editorView?.state;if(!this.editorView||!t)return!1;let n=Number.parseInt(String(e??``),10);if(!Number.isFinite(n))return!1;let r=Math.min(Math.max(n,1),t.doc.lines),i=t.doc.line(r),a=Fr.exec(i.text);if(!a)return!1;let[,o,s]=a,c=i.from+o.length,l=s===` `?`x`:` `;return this.editorView.dispatch({changes:{from:c,insert:l,to:c+1},userEvent:`input`}),!0}updateCursorInfo(e){if(!this.lineInfoElement)return;let t=e.selection.main.head,n=e.doc.lineAt(t),r=t-n.from+1;this.lineInfoElement.textContent=`Ln ${n.number}, Col ${r}`}emitViewportChange(){this.onViewportChanged?.(this.getViewportState())}},qr=class{constructor({editorContainer:e,lineWrappingEnabled:t=!0,initialTheme:n,lineInfoElement:r,onAwarenessChange:i,onConnectionChange:a,onCommentsChange:o,onContentChange:s,onImagePaste:c,onSelectionChange:l,preferredUserName:u,localUser:d,getFileList:f}){this.onAwarenessChange=i,this.onCommentsChange=o,this.onContentChange=s,this.onSelectionChange=l,this.activeFilePath=``,this.bootstrapContent=null,this.pendingCollaborativeBindings=null,this.hasDeliveredContent=!1,this.lastDeliveredContent=null,this.collaborationClient=new ot({localUser:d,onAwarenessChange:e=>this.onAwarenessChange?.(e),onConnectionChange:a,onInitialSync:()=>this.emitContentChange(),preferredUserName:u,resolveAwarenessCursor:e=>this.resolveAwarenessCursor(e)}),this.viewAdapter=new Kr({editorContainer:e,getFileList:f||(()=>[]),initialTheme:n,lineInfoElement:r,lineWrappingEnabled:t,onDocChanged:()=>{this.emitContentChange()},onImagePaste:c,onViewportChanged:e=>{this.collaborationClient.setLocalViewport(e)},onSelectionChanged:()=>{this.onSelectionChange?.(this.getCurrentSelectionCommentAnchor())}}),this.commentThreadStore=new at({getDoc:()=>this.collaborationClient.ydoc,getEditorState:()=>this.viewAdapter.getState(),getLocalUser:()=>this.collaborationClient.getLocalUser(),onCommentsChange:e=>this.onCommentsChange?.(e)})}async initialize(e){this.activeFilePath=e,this.hasDeliveredContent=!1,this.lastDeliveredContent=null;let t=await this.collaborationClient.initialize(e);this.commentThreadStore.bind({commentThreads:t.commentThreads,ydoc:t.ydoc,ytext:t.ytext}),this.pendingCollaborativeBindings=t,this.collaborationClient.initialSyncComplete&&this.activateCollaborativeView(),this.onAwarenessChange?.(this.collaborationClient.collectUsers(e=>this.resolveAwarenessCursor(e)))}activateCollaborativeView(){return this.pendingCollaborativeBindings?(this.viewAdapter.initialize({awareness:this.pendingCollaborativeBindings.awareness,filePath:this.activeFilePath,undoManager:this.pendingCollaborativeBindings.undoManager,ytext:this.pendingCollaborativeBindings.ytext}),this.commentThreadStore.refreshComments(),this.pendingCollaborativeBindings=null,this.bootstrapContent=null,!0):!1}showBootstrapContent({content:e=``,filePath:t=this.activeFilePath}={}){return this.collaborationClient.initialSyncComplete?!1:(this.activeFilePath=t,this.bootstrapContent=String(e??``),this.viewAdapter.initializeProvisional({content:this.bootstrapContent,filePath:this.activeFilePath}),this.commentThreadStore.refreshComments(),this.emitContentChange())}hasBootstrapContent(){return this.bootstrapContent!==null}emitContentChange({force:e=!1}={}){let t=this.getText();return!e&&this.hasDeliveredContent&&t===this.lastDeliveredContent?!1:(this.hasDeliveredContent=!0,this.lastDeliveredContent=t,this.onContentChange?.(),!0)}ensureInitialContent(){return this.emitContentChange()}applyTheme(e){this.viewAdapter.applyTheme(e)}getText(){return this.collaborationClient.getText()||this.viewAdapter.getText()}getScrollContainer(){return this.viewAdapter.getScrollContainer()}getTopVisibleLineNumber(e=0){return this.viewAdapter.getTopVisibleLineNumber(e)}getLocalUser(){return this.collaborationClient.getLocalUser()}get awareness(){return this.collaborationClient.awareness}get provider(){return this.collaborationClient.provider}get ydoc(){return this.collaborationClient.ydoc}get ytext(){return this.collaborationClient.ytext}getCurrentSelectionLineRange(){return this.viewAdapter.getCurrentSelectionLineRange()}getCurrentSelectionCommentAnchor(){return this.viewAdapter.getCurrentSelectionCommentAnchor()}getCommentAnchorClientRect(e){return this.viewAdapter.getAnchorClientRect(e)}getSelectionChipClientRect(e){return this.viewAdapter.getSelectionChipClientRect(e)}getCommentThreads(){return this.commentThreadStore.getCommentThreads()}createCommentThread(e){return this.commentThreadStore.createCommentThread(e)}replyToCommentThread(e,t){return this.commentThreadStore.replyToCommentThread(e,t)}toggleCommentReaction(e,t,n){return this.commentThreadStore.toggleCommentReaction(e,t,n)}deleteCommentThread(e){return this.commentThreadStore.deleteCommentThread(e)}isLineWrappingEnabled(){return this.viewAdapter.isLineWrappingEnabled()}setLineWrapping(e){return this.viewAdapter.setLineWrapping(e)}scrollToLine(e,t=0){return this.viewAdapter.scrollToLine(e,t)}getUserCursor(e){return this.collaborationClient.getUserCursor(e,e=>this.resolveAwarenessCursor(e))}getUserViewport(e){return this.collaborationClient.getUserViewport(e)}scrollToPosition(e,t=`center`){return this.viewAdapter.scrollToPosition(e,t)}scrollToUserViewport(e){let t=this.getUserViewport(e);return t?this.scrollToLine(t.topLine,t.viewportRatio):!1}scrollToUserCursor(e,t=`center`){let n=this.getUserCursor(e);return n?this.scrollToPosition(n.cursorHead,t)||this.scrollToLine(n.cursorLine):!1}setUserName(e){return this.collaborationClient.setUserName(e)}requestMeasure(){this.viewAdapter.requestMeasure()}runEditorCommand(e){return this.viewAdapter.runEditorCommand(e)}applyMarkdownToolbarAction(e){return this.viewAdapter.applyMarkdownToolbarAction(e)}insertText(e){return this.viewAdapter.insertText(e)}replaceText(e){return this.viewAdapter.replaceText(e)}toggleTaskListItem(e){return this.collaborationClient.initialSyncComplete?this.viewAdapter.toggleTaskListItem(e):!1}flashExternalUpdate(e){return this.viewAdapter.flashRemoteRange(e)}waitForInitialSync(e=1500){return this.collaborationClient.waitForInitialSync(e)}destroy(){this.commentThreadStore.unbind(),this.activeFilePath=``,this.bootstrapContent=null,this.pendingCollaborativeBindings=null,this.hasDeliveredContent=!1,this.lastDeliveredContent=null,this.collaborationClient.destroy(),this.viewAdapter.destroy()}resolveAwarenessCursor(e){let t=this.collaborationClient.ydoc,n=this.collaborationClient.ytext,r=this.viewAdapter.getState();if(!e?.anchor||!e?.head||!t||!r||!n)return null;let i=T(e.anchor,t),a=T(e.head,t);if(!i||!a||i.type!==n||a.type!==n)return null;let o=r.doc.lineAt(a.index);return{cursorAnchor:i.index,cursorHead:a.index,cursorLine:o.number}}};export{qr as EditorSession};
|