uigraph 1.0.0 → 1.0.1
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/bin.mjs +134 -56911
- package/dist/viewer/assets/abnfDiagram-VCTEODGH-D7zWJuPJ.js +1 -0
- package/dist/viewer/assets/actor-avatar-Bu-mKKXB.js +1 -0
- package/dist/viewer/assets/{api-adapters-CnQpLiWI.js → api-adapters-tfr51BsS.js} +1 -1
- package/dist/viewer/assets/{api-endpoints-DCA5GNpC.js → api-endpoints-D-Whnnwd.js} +9 -9
- package/dist/viewer/assets/{api-group-endpoints-page-Di42W69y.js → api-group-endpoints-page-B9R1EI4i.js} +9 -9
- package/dist/viewer/assets/{arc-Cn8owoDw.js → arc-DauzQXFu.js} +1 -1
- package/dist/viewer/assets/architectureDiagram-5GKGNRK7-CXzgHd-c.js +36 -0
- package/dist/viewer/assets/{arrow-left-DWcMgM2U.js → arrow-left-DpQqmf17.js} +1 -1
- package/dist/viewer/assets/avatar-DAFUyk1i.js +43 -0
- package/dist/viewer/assets/badge-hR3QvPWv.js +1 -0
- package/dist/viewer/assets/better-delete-confirmation-modal-CGEQ5O4X.js +1 -0
- package/dist/viewer/assets/better-dialog-DcIxFWwk.js +1 -0
- package/dist/viewer/assets/{blockDiagram-I7D4REHJ-CbYzOsL_.js → blockDiagram-I7D4REHJ-CFHWUw4z.js} +2 -2
- package/dist/viewer/assets/{brands-Bd4RklRx.js → brands-DtmA1AhP.js} +1 -1
- package/dist/viewer/assets/button-DZj74qS7.js +1 -0
- package/dist/viewer/assets/{c4Diagram-7LVT6UL2-CLkVbphC.js → c4Diagram-7LVT6UL2-BHSggPKI.js} +6 -6
- package/dist/viewer/assets/{calendar-C0xdI_ag.js → calendar-Bolgc8E5.js} +1 -1
- package/dist/viewer/assets/channel-CNRSofFP.js +1 -0
- package/dist/viewer/assets/{check-XjanpAFg.js → check-BpmCQNbj.js} +1 -1
- package/dist/viewer/assets/checkbox-CFJfXL6R.js +1 -0
- package/dist/viewer/assets/{chevron-down-R7pQzyLD.js → chevron-down-DDsUE_xz.js} +1 -1
- package/dist/viewer/assets/{chevron-up-CRPypfOs.js → chevron-up-DVznKMGv.js} +1 -1
- package/dist/viewer/assets/{chunk-2Q5K7J3B-CcvtugCu.js → chunk-2Q5K7J3B-CNfz5YDQ.js} +1 -1
- package/dist/viewer/assets/{chunk-5VM5RSS4-CpZHHr12.js → chunk-5VM5RSS4-CwIhjvMe.js} +1 -1
- package/dist/viewer/assets/{chunk-F27PBJKO-DeAl4iOc.js → chunk-F27PBJKO-YFexFJof.js} +1 -1
- package/dist/viewer/assets/{chunk-IMKFNOWR-BfrPe7pS.js → chunk-IMKFNOWR-GY2yrvuo.js} +1 -1
- package/dist/viewer/assets/{chunk-JWPE2WC7-DDjyvUmZ.js → chunk-JWPE2WC7-xd0JGvne.js} +1 -1
- package/dist/viewer/assets/chunk-OB3PAWPO-DJIP1M4r.js +12 -0
- package/dist/viewer/assets/{chunk-POPQ4Y6H-DkDb0mzz.js → chunk-POPQ4Y6H-Bh6rizEy.js} +1 -1
- package/dist/viewer/assets/{chunk-SVP7TREG-D-K2XIGs.js → chunk-SVP7TREG-DtNrjvpq.js} +1 -1
- package/dist/viewer/assets/{chunk-TICWLB2K-DWMQQx6z.js → chunk-TICWLB2K-DrERwtw8.js} +1 -1
- package/dist/viewer/assets/{chunk-XXDRQBXY-DfkljAyM.js → chunk-XXDRQBXY-fYo04iwY.js} +1 -1
- package/dist/viewer/assets/{circle-alert-pm13M-Ef.js → circle-alert-Bl7DXYD_.js} +1 -1
- package/dist/viewer/assets/classDiagram-ZZMXUADV-D7PO-ME9.js +1 -0
- package/dist/viewer/assets/classDiagram-v2-VYDZK3BY-D7PO-ME9.js +1 -0
- package/dist/viewer/assets/color-input-ClkkG_kZ.js +11 -0
- package/dist/viewer/assets/{common-Y7ySZBdh.js → common-DLCsGQ-t.js} +1 -1
- package/dist/viewer/assets/{component-icons-D1BDAuEt.js → component-icons-MJ61E9nt.js} +2 -2
- package/dist/viewer/assets/{copy-CN4K2f_R.js → copy-DMJJonQF.js} +1 -1
- package/dist/viewer/assets/cose-bilkent-JH36ORCC-Dplz8nVT.js +1 -0
- package/dist/viewer/assets/cross-button-D5qst1tj.js +1 -0
- package/dist/viewer/assets/{cynefin-OW5HDTMX-yz-uw9Kz.js → cynefin-OW5HDTMX-DiBs4CI8.js} +1 -1
- package/dist/viewer/assets/cynefinDiagram-5FMLGOSQ-COXS8-dI.js +62 -0
- package/dist/viewer/assets/{dagre-GXQ25YYZ-zjZDwXOe.js → dagre-GXQ25YYZ-K8qvfG8D.js} +2 -2
- package/dist/viewer/assets/dashboard-diagrams-page-Cb0xNr4W.js +2 -0
- package/dist/viewer/assets/dashboard-diagrams-page-inner-CD--zr5q.js +1 -0
- package/dist/viewer/assets/dashboard-docs-page-BfWR9Ai9.js +2 -0
- package/dist/viewer/assets/dashboard-docs-page-inner-BLbX-YwF.js +67 -0
- package/dist/viewer/assets/dashboard-layout-sTeeHNsZ.js +1 -0
- package/dist/viewer/assets/dashboard-lens-layout-D-tu_4kn.js +1 -0
- package/dist/viewer/assets/dashboard-map-frame-page-7pDmbTSe.js +1 -0
- package/dist/viewer/assets/dashboard-plans-page-CfwOZ34A.js +1 -0
- package/dist/viewer/assets/dashboard-service-apis-k93fjW51.js +1 -0
- package/dist/viewer/assets/{dashboard-service-diagrams-CIjk95Jk.js → dashboard-service-diagrams-BIWUxX-Y.js} +3 -3
- package/dist/viewer/assets/dashboard-service-docs-CnniTD6Q.js +1 -0
- package/dist/viewer/assets/{dashboard-service-overview-CzePVPjl.js → dashboard-service-overview-CGBu4omY.js} +5 -5
- package/dist/viewer/assets/dashboard-services-DEscIO2O.js +1 -0
- package/dist/viewer/assets/{db-type-badge-DOgu1Pyc.js → db-type-badge-UbPgpwQf.js} +2 -2
- package/dist/viewer/assets/debounce-Cp8eREM4-D7o-Pzb-.js +2 -0
- package/dist/viewer/assets/{dependencies-CYdEztHw.js → dependencies-DK2GDlhQ.js} +1 -1
- package/dist/viewer/assets/{dependency-graph-DbyfN-rC.js → dependency-graph-xBEnCS0J.js} +3 -3
- package/dist/viewer/assets/{diagram-S7CK7UJ4-q-NHkUCx.js → diagram-S7CK7UJ4-D-liadVe.js} +2 -2
- package/dist/viewer/assets/diagram-UQ7AKVKN-CnA8mgXp.js +41 -0
- package/dist/viewer/assets/{diagram-VSXAHHWV-DZc1kHGx.js → diagram-VSXAHHWV-Ck7dgRFR.js} +2 -2
- package/dist/viewer/assets/diagram-VX7I27RA-Cm1LHbu3.js +24 -0
- package/dist/viewer/assets/diagram-Z3DM3KII-DV3yBUCB.js +24 -0
- package/dist/viewer/assets/diagram-live-preview-DzJ7Nxp1.js +2 -0
- package/dist/viewer/assets/{diagram-portal-page-CWxuok9E.js → diagram-portal-page-gguGLULH.js} +24 -24
- package/dist/viewer/assets/{diagrams-C1xkRPqT.js → diagrams-BqBSv2eb.js} +4 -4
- package/dist/viewer/assets/dialog-D7wzTt0L.js +6 -0
- package/dist/viewer/assets/{doc-file-content-B06roi8L.js → doc-file-content-Be0au9Vo.js} +4 -4
- package/dist/viewer/assets/{download-CLdCXVsO.js → download-DhyZ3g4F.js} +1 -1
- package/dist/viewer/assets/ebnfDiagram-PWID7BFC-BXbHVQvG.js +1 -0
- package/dist/viewer/assets/{editor-vqK4qAnB.js → editor-F9o4zoeB.js} +2 -2
- package/dist/viewer/assets/{erDiagram-RLTQ6QDP-BWuA-aqV.js → erDiagram-RLTQ6QDP-DMfiWput.js} +2 -2
- package/dist/viewer/assets/{file-text-BvszilVL.js → file-text-BFqJQ67P.js} +1 -1
- package/dist/viewer/assets/flow-diagram-preview-B83UU1n_.js +1 -0
- package/dist/viewer/assets/{flowDiagram-HODETNUW-Db0QtNj4.js → flowDiagram-HODETNUW-BNFS2Mkr.js} +1 -1
- package/dist/viewer/assets/ganttDiagram-EL5Y4UJY-DFDsYJNp.js +292 -0
- package/dist/viewer/assets/gitGraphDiagram-WWUBYQGX-BVHabPDp.js +106 -0
- package/dist/viewer/assets/global-loader-XJO9_e0l.js +1 -0
- package/dist/viewer/assets/{globe-Jl6eIZmG.js → globe-CJ35KsQW.js} +1 -1
- package/dist/viewer/assets/gql-FFIj8zdp.js +1 -0
- package/dist/viewer/assets/{grid-scroll-body-CPqSxU6-.js → grid-scroll-body-DC5pYDPJ.js} +2 -2
- package/dist/viewer/assets/iconBase-DtqdW2XR.js +1 -0
- package/dist/viewer/assets/index-B6MxYIzs.js +1 -0
- package/dist/viewer/assets/index-BC5xdBQU.js +48 -0
- package/dist/viewer/assets/index-BIrx3oY4.js +1 -0
- package/dist/viewer/assets/{index-jm22RWpY.js → index-BZGsDmUx.js} +5 -5
- package/dist/viewer/assets/{index-Poftp9f1.js → index-BZXhpoWr.js} +4 -4
- package/dist/viewer/assets/index-Bn2bqqMd.js +1 -0
- package/dist/viewer/assets/{index-HU5pz3kj.js → index-BpCVYTvP.js} +36 -36
- package/dist/viewer/assets/{index-Bt2YHgxl.js → index-CBOYhBKJ.js} +1 -1
- package/dist/viewer/assets/index-CH7cEAxj.js +17 -0
- package/dist/viewer/assets/index-CIf0GId3.js +74 -0
- package/dist/viewer/assets/{index-D7MEHpJf.js → index-Ck66Ic_p.js} +4 -4
- package/dist/viewer/assets/index-Cp9mIQ8F.js +1 -0
- package/dist/viewer/assets/{index-c6Bxcoqm.js → index-DDmBuMKI.js} +1 -1
- package/dist/viewer/assets/{index-BSyJbFDG.js → index-DY3BFyb6.js} +1 -1
- package/dist/viewer/assets/{index-BS94XVnd.js → index-DkzZ-ZvR.js} +1 -1
- package/dist/viewer/assets/{index-C_43VC19.js → index-PglMbhys.js} +1 -1
- package/dist/viewer/assets/infoDiagram-27XIBGKW-CG-wwxBf.js +2 -0
- package/dist/viewer/assets/input--C59pq6j.js +1 -0
- package/dist/viewer/assets/{ishikawaDiagram-5VMMS53U-C4PzFnZ4.js → ishikawaDiagram-5VMMS53U-BlgV7ceJ.js} +2 -2
- package/dist/viewer/assets/{journeyDiagram-3NMN7TZE-Dpn3bBNo.js → journeyDiagram-3NMN7TZE-Cn03_Xl6.js} +2 -2
- package/dist/viewer/assets/{kanban-definition-UXKFOSKX-CJ99H4G6.js → kanban-definition-UXKFOSKX-CJogvDPY.js} +6 -6
- package/dist/viewer/assets/{layout-Bfvxt_D5.js → layout-B26eC4yQ.js} +1 -1
- package/dist/viewer/assets/{lens-run-page-DZneics-.js → lens-run-page-Ba1ppzJt.js} +3 -3
- package/dist/viewer/assets/lens-runs-page-BnUS57LM.js +1 -0
- package/dist/viewer/assets/{link-2-C75goIOt.js → link-2-D1e0xznG.js} +1 -1
- package/dist/viewer/assets/linked-project-dot-BY1gEES9.js +543 -0
- package/dist/viewer/assets/{loader-circle-C5jZoM7X.js → loader-circle-CiqyoJF7.js} +1 -1
- package/dist/viewer/assets/{merge-Cy7YkrN7.js → merge-BhOMvhW1.js} +1 -1
- package/dist/viewer/assets/mermaid.core-BDgZg3kW.js +312 -0
- package/dist/viewer/assets/method-badge-DErZP7y5.js +1 -0
- package/dist/viewer/assets/{mindmap-definition-YA3MSWOX-yQCKA-K4.js → mindmap-definition-YA3MSWOX-DFkLu0ac.js} +2 -2
- package/dist/viewer/assets/nav-links-DZWMpwMR.js +61 -0
- package/dist/viewer/assets/{network-COWNXGMM.js → network-B1apzT1s.js} +1 -1
- package/dist/viewer/assets/{nosql-editor-modal-DTiWkc_r.js → nosql-editor-modal-CvH0SWAi.js} +5 -5
- package/dist/viewer/assets/not-found-page-C-fn8QeM.js +1 -0
- package/dist/viewer/assets/organization-dependency-graph-page-BryP-iJL.js +1 -0
- package/dist/viewer/assets/pegDiagram-XKGWAZYB-g1cM14-L.js +1 -0
- package/dist/viewer/assets/{pieDiagram-E7YTZNPT-DqnkpCX4.js → pieDiagram-E7YTZNPT-WEnDsMY3.js} +2 -2
- package/dist/viewer/assets/{plus-DQakmTjA.js → plus-DbyuOgKB.js} +1 -1
- package/dist/viewer/assets/popover-476u3TN0.js +1 -0
- package/dist/viewer/assets/preload-helper-BlTxHScW.js +1 -0
- package/dist/viewer/assets/{quadrantDiagram-AXDQQJYC-iQjJfars.js → quadrantDiagram-AXDQQJYC-NdfQCpzF.js} +2 -2
- package/dist/viewer/assets/query-D9oj6LGx.js +50 -0
- package/dist/viewer/assets/{quill-rCHj4fCw.js → quill-Cde5JMRD.js} +1 -1
- package/dist/viewer/assets/railroadDiagram-O6MQD6OU-BYhlXlMY.js +1 -0
- package/dist/viewer/assets/{react-BNzYaZuG.js → react-Bx48XWN4.js} +1 -1
- package/dist/viewer/assets/react-flow-wrapper-BcbvHgxz.js +277 -0
- package/dist/viewer/assets/{requirementDiagram-BXWQKSXE-Bv-Vh1dW.js → requirementDiagram-BXWQKSXE-C25Bcm2L.js} +2 -2
- package/dist/viewer/assets/{sankeyDiagram-P5KCCOFB-C__uD07f.js → sankeyDiagram-P5KCCOFB-h8LiCsgk.js} +2 -2
- package/dist/viewer/assets/scroll-area-RagrStGj.js +6 -0
- package/dist/viewer/assets/{search-DW-qhXLk.js → search-vw7ucoOs.js} +1 -1
- package/dist/viewer/assets/section-loader-C4hOfhQS.js +1 -0
- package/dist/viewer/assets/section-not-found-BnrXiPog.js +1 -0
- package/dist/viewer/assets/select-D9fbrr7O.js +1 -0
- package/dist/viewer/assets/{sequenceDiagram-WJ2MYXX4-1RbvcHwO.js → sequenceDiagram-WJ2MYXX4-CDRVvD30.js} +2 -2
- package/dist/viewer/assets/{service-context-C17u_Fw9.js → service-context-D5nBtU18.js} +1 -1
- package/dist/viewer/assets/{service-database-list-page-cYuDHIls.js → service-database-list-page-DBjaDLVy.js} +2 -2
- package/dist/viewer/assets/service-database-page-CenNCgwf.js +2 -0
- package/dist/viewer/assets/service-database-page-inner-gS51TQTZ.js +85 -0
- package/dist/viewer/assets/{service-doc-Dir8g83J.js → service-doc-C-jHqT1U.js} +4 -4
- package/dist/viewer/assets/{service-doc-preview-modal-bJ6tJ5YR.js → service-doc-preview-modal-5sX6FOu1.js} +2 -2
- package/dist/viewer/assets/service-layout-Bf0vZBCH.js +1 -0
- package/dist/viewer/assets/service-pages-CFikvX4t.js +1 -0
- package/dist/viewer/assets/{services-Crqkffr5.js → services-Ivav34WC.js} +4 -4
- package/dist/viewer/assets/{share-2-BmYmqN4k.js → share-2-CQEaWbfH.js} +1 -1
- package/dist/viewer/assets/sizeCapture-INFHLROL-BJ6ndnPM.js +1 -0
- package/dist/viewer/assets/stateDiagram-D77RDMKH-B_tNCX3o.js +1 -0
- package/dist/viewer/assets/stateDiagram-v2-MP3YSRHH-Dl9wqdli.js +1 -0
- package/dist/viewer/assets/{style-DgSU0bQl.js → style-BPesJvJr.js} +8 -8
- package/dist/viewer/assets/super-circle-loader-DSkos6uP.js +1 -0
- package/dist/viewer/assets/super-logo-loader-Cxlbn6MB.js +1 -0
- package/dist/viewer/assets/swimlanes-42K2YHIH-CzURzYwf.js +1 -0
- package/dist/viewer/assets/swimlanesDiagram-VR7AAH4N-DrIlwFtk.js +8 -0
- package/dist/viewer/assets/table-B4pFND-o.js +1 -0
- package/dist/viewer/assets/textarea-Clgdv3Oi.js +1 -0
- package/dist/viewer/assets/{timeline-definition-24CTP7MA-C4yuLwUH.js → timeline-definition-24CTP7MA-D0YXQE1U.js} +2 -2
- package/dist/viewer/assets/ui-graph-logo-gHowu5gP.js +1 -0
- package/dist/viewer/assets/{upload-CRsS43j9.js → upload-CYb3nN_5.js} +1 -1
- package/dist/viewer/assets/{uploads-BOQHX9l4.js → uploads-CX2kdXbM.js} +8 -8
- package/dist/viewer/assets/{use-debounced-value-Ba-kkCUY.js → use-debounced-value-BpNFJd3C.js} +1 -1
- package/dist/viewer/assets/{use-localstorage-DIisTx-J.js → use-localstorage-D233xVb0.js} +1 -1
- package/dist/viewer/assets/use-permissions-BvmxJJ5r.js +1 -0
- package/dist/viewer/assets/{use-scoped-storage-C4RzED-E.js → use-scoped-storage-DL1XVp1j.js} +1 -1
- package/dist/viewer/assets/useMutation-D5ZHwHsx.js +1 -0
- package/dist/viewer/assets/useQuery-Dhe6uxrL.js +1 -0
- package/dist/viewer/assets/{vennDiagram-4TSXK5OY-BCtqXZqe.js → vennDiagram-4TSXK5OY-SSjHlqCQ.js} +2 -2
- package/dist/viewer/assets/{wardleyDiagram-VM6X3IG4-D3OtZJoT.js → wardleyDiagram-VM6X3IG4-CZWNdQxH.js} +2 -2
- package/dist/viewer/assets/{xychartDiagram-S5SC5T6Z-DxLL2CHH.js → xychartDiagram-S5SC5T6Z-B2qAGeb0.js} +2 -2
- package/dist/viewer/assets/zod-BMU4UTQt.js +1 -0
- package/dist/viewer/index.html +10 -1
- package/package.json +56 -56
- package/dist/abort-signals-B4fc3ahg.mjs +0 -34
- package/dist/anthropic-messages-KPxCHqBN.mjs +0 -14327
- package/dist/auth-storage-BvNH97p9.mjs +0 -2180
- package/dist/azure-openai-config-BbeCSg4y.mjs +0 -55
- package/dist/azure-openai-responses-BRzy8RfL.mjs +0 -182
- package/dist/classifier-shared-DBUHiTGw.mjs +0 -105
- package/dist/cli-2R6QQFp1.mjs +0 -451
- package/dist/cloudflare-workers-ai-system-one-BfqwmRQf.mjs +0 -44
- package/dist/config-D8DMGzIq.mjs +0 -647
- package/dist/cross-spawn-B2jIQPlu.mjs +0 -404
- package/dist/diagnostics-xdSgQR8t.mjs +0 -131
- package/dist/dist-BRyghrKX.mjs +0 -404
- package/dist/dist-D0EzrblG.mjs +0 -12161
- package/dist/dist-EKhnHWHG.mjs +0 -140221
- package/dist/dist-pQtuusFv.mjs +0 -1243
- package/dist/easter-egg-3d-C9_btlWn.mjs +0 -1225
- package/dist/env-api-keys-uytNub6O.mjs +0 -122
- package/dist/error-body-FhmCtR7m.mjs +0 -101
- package/dist/esm-D5isprgl.mjs +0 -1533
- package/dist/esm-DnqE4pfM.mjs +0 -104876
- package/dist/execute-BoTKl80U.mjs +0 -1715
- package/dist/github-copilot-headers-DWcTgoXr.mjs +0 -22
- package/dist/google-generative-ai-Brs5YpJo.mjs +0 -332
- package/dist/google-shared-2CyYa4VE.mjs +0 -33438
- package/dist/google-vertex-DZDUQPKa.mjs +0 -378
- package/dist/hash-DN7ukSfd.mjs +0 -16
- package/dist/headers-GhQHLk-3.mjs +0 -17
- package/dist/jiti-9kWALm4Y.mjs +0 -5439
- package/dist/jiti-loader-f21DrY1K.mjs +0 -27
- package/dist/jiti-static-loader-BI_w28l7.mjs +0 -41704
- package/dist/json-parse-B2mHg7o7.mjs +0 -381
- package/dist/keybinding-hints-D0nLU3ZH.mjs +0 -17899
- package/dist/lib-Dj1gKQJc.mjs +0 -24379
- package/dist/llama-cpp-classify-C73BoMYd.mjs +0 -344
- package/dist/mistral-conversations-DXVR7znL.mjs +0 -698
- package/dist/models-DBdii9gQ.mjs +0 -1255
- package/dist/multipart-parser-DLw9Z0uJ.mjs +0 -298
- package/dist/node-B0NU8X55.mjs +0 -2479
- package/dist/node-B8gaKm9g.mjs +0 -23
- package/dist/openai-I3_AqKDX.mjs +0 -17357
- package/dist/openai-codex-responses-PcZHDuBD.mjs +0 -1198
- package/dist/openai-completions-a_mH01ii.mjs +0 -994
- package/dist/openai-decisions-Du8y4mQG.mjs +0 -142
- package/dist/openai-prompt-cache-Bc6qNWt0.mjs +0 -8
- package/dist/openai-responses-a9lV_U7O.mjs +0 -270
- package/dist/openai-responses-shared-CDs_PBiH.mjs +0 -598
- package/dist/openrouter-images-D0Zc8Cjs.mjs +0 -125
- package/dist/photon_rs-DCvMOMu0.mjs +0 -4252
- package/dist/pi-messages-B5ietIBq.mjs +0 -306
- package/dist/provider-env-BJhgA66g.mjs +0 -37
- package/dist/provider-retry-DXYM7rVE.mjs +0 -79
- package/dist/runtime-DTkBxiaM.mjs +0 -2822
- package/dist/sanitize-unicode-CqChtoM6.mjs +0 -26
- package/dist/shell-836_JFnI.mjs +0 -162
- package/dist/source-CKPndhKl.mjs +0 -478
- package/dist/src-DNm2QRm3.mjs +0 -5028
- package/dist/system-one-shared-DUAFtNa8.mjs +0 -75
- package/dist/token-DEUkymby.mjs +0 -56
- package/dist/token-util-Cx5S4eKt.mjs +0 -3
- package/dist/tool-DHDYqsyG.mjs +0 -6673
- package/dist/transform-messages-BClk99Vn.mjs +0 -477
- package/dist/typesafe-system-one-D2d8j8hZ.mjs +0 -24
- package/dist/typescript-Br-vsRJV.mjs +0 -6737
- package/dist/uuid-CNCZqNBb.mjs +0 -49
- package/dist/v2-1z8ijsD3.mjs +0 -6120
- package/dist/viewer/assets/abnfDiagram-VCTEODGH-j5YaKnl9.js +0 -1
- package/dist/viewer/assets/actor-avatar-DqmoY8Xc.js +0 -1
- package/dist/viewer/assets/architectureDiagram-5GKGNRK7-D80cJKz_.js +0 -36
- package/dist/viewer/assets/avatar-BI7D-Aia.js +0 -43
- package/dist/viewer/assets/badge-870-A4Y6.js +0 -1
- package/dist/viewer/assets/better-delete-confirmation-modal-Dib31LVb.js +0 -1
- package/dist/viewer/assets/better-dialog-D3AAiahr.js +0 -1
- package/dist/viewer/assets/button-DadqadpO.js +0 -1
- package/dist/viewer/assets/channel-DRkt3LIn.js +0 -1
- package/dist/viewer/assets/checkbox-BXpR079x.js +0 -1
- package/dist/viewer/assets/classDiagram-ZZMXUADV-G5CebNaC.js +0 -1
- package/dist/viewer/assets/classDiagram-v2-VYDZK3BY-G5CebNaC.js +0 -1
- package/dist/viewer/assets/color-input-Efm-lxDy.js +0 -11
- package/dist/viewer/assets/cose-bilkent-JH36ORCC-CrSHFmnp.js +0 -1
- package/dist/viewer/assets/cross-button-5Sr5rWVP.js +0 -1
- package/dist/viewer/assets/cynefinDiagram-5FMLGOSQ-Bdl_eBdu.js +0 -62
- package/dist/viewer/assets/dashboard-diagrams-page-DMupOe1m.js +0 -2
- package/dist/viewer/assets/dashboard-diagrams-page-inner-Dh0yKh2A.js +0 -1
- package/dist/viewer/assets/dashboard-docs-page-DWJ1qOQz.js +0 -2
- package/dist/viewer/assets/dashboard-docs-page-inner-Fs6G3oGo.js +0 -67
- package/dist/viewer/assets/dashboard-layout-D36InAaB.js +0 -1
- package/dist/viewer/assets/dashboard-lens-layout-Cv1Xx3hY.js +0 -1
- package/dist/viewer/assets/dashboard-map-frame-page-CTn61NUO.js +0 -1
- package/dist/viewer/assets/dashboard-plans-page-DxFJkrgK.js +0 -1
- package/dist/viewer/assets/dashboard-service-apis-BHtD9s5z.js +0 -1
- package/dist/viewer/assets/dashboard-service-docs-Uv_1uxxO.js +0 -1
- package/dist/viewer/assets/dashboard-services-CUP-L4Jg.js +0 -1
- package/dist/viewer/assets/diagram-UQ7AKVKN-DhFcurW6.js +0 -41
- package/dist/viewer/assets/diagram-VX7I27RA-DE1nREE8.js +0 -24
- package/dist/viewer/assets/diagram-Z3DM3KII-CSrYcCbc.js +0 -24
- package/dist/viewer/assets/diagram-live-preview-i5doxXLH.js +0 -2
- package/dist/viewer/assets/dialog-D_HtNS17.js +0 -6
- package/dist/viewer/assets/ebnfDiagram-PWID7BFC-BfL8m_sf.js +0 -1
- package/dist/viewer/assets/flow-diagram-preview-T0Z4iMVU.js +0 -1
- package/dist/viewer/assets/ganttDiagram-EL5Y4UJY-CsITpniw.js +0 -292
- package/dist/viewer/assets/gitGraphDiagram-WWUBYQGX-B4eCBGoe.js +0 -106
- package/dist/viewer/assets/iconBase-BoDZfJgC.js +0 -1
- package/dist/viewer/assets/index-5E1tJ7yK.js +0 -125
- package/dist/viewer/assets/index-7XpV2DRw.js +0 -1
- package/dist/viewer/assets/index-C0Rs3s9Z.js +0 -1
- package/dist/viewer/assets/index-CzHjJWeV.js +0 -1
- package/dist/viewer/assets/index-DcEA6SIV.js +0 -74
- package/dist/viewer/assets/infoDiagram-27XIBGKW-lTebN5Ix.js +0 -2
- package/dist/viewer/assets/input-YvHTVS0E.js +0 -1
- package/dist/viewer/assets/lens-runs-page-DoAOObxx.js +0 -1
- package/dist/viewer/assets/linked-project-dot-Ds2uEmJ9.js +0 -543
- package/dist/viewer/assets/mermaid.core-BCRBv8Us.js +0 -312
- package/dist/viewer/assets/method-badge-DMYDKdDZ.js +0 -1
- package/dist/viewer/assets/nav-links-8vT2ixiI.js +0 -61
- package/dist/viewer/assets/not-found-page-CnfLlhS4.js +0 -1
- package/dist/viewer/assets/organization-dependency-graph-page-3xqIxjNx.js +0 -1
- package/dist/viewer/assets/pegDiagram-XKGWAZYB-CMXqeAum.js +0 -1
- package/dist/viewer/assets/popover-CN9ni1N3.js +0 -1
- package/dist/viewer/assets/railroadDiagram-O6MQD6OU-CfqToX3W.js +0 -1
- package/dist/viewer/assets/react-flow-wrapper-BPlRstyO.js +0 -276
- package/dist/viewer/assets/scroll-area-BodE-n7W.js +0 -6
- package/dist/viewer/assets/section-loader-BzpYM_Nx.js +0 -1
- package/dist/viewer/assets/select-DDtnmSET.js +0 -1
- package/dist/viewer/assets/service-database-page-CMi1wF4h.js +0 -2
- package/dist/viewer/assets/service-database-page-inner-CoqAj93L.js +0 -85
- package/dist/viewer/assets/service-layout-0NMm_bKG.js +0 -1
- package/dist/viewer/assets/service-pages-dfnc91SU.js +0 -1
- package/dist/viewer/assets/sizeCapture-INFHLROL-BRJi3gCg.js +0 -1
- package/dist/viewer/assets/stateDiagram-D77RDMKH-DdLsfxgy.js +0 -1
- package/dist/viewer/assets/stateDiagram-v2-MP3YSRHH-DFwg8Qki.js +0 -1
- package/dist/viewer/assets/super-circle-loader-D8MElOMh.js +0 -1
- package/dist/viewer/assets/super-logo-loader-DJYiRbCS.js +0 -1
- package/dist/viewer/assets/swimlanes-42K2YHIH-AuYjrPqh.js +0 -1
- package/dist/viewer/assets/swimlanesDiagram-VR7AAH4N-0nIGA8_4.js +0 -8
- package/dist/viewer/assets/table-Bi4Auk9Z.js +0 -1
- package/dist/viewer/assets/textarea-MgxZ5x6-.js +0 -1
- package/dist/viewer/assets/ui-graph-logo-D4jRhd4z.js +0 -1
- package/dist/viewer/assets/use-permissions-6JVET753.js +0 -1
- package/dist/viewer/assets/useMutation-CmVaR9zz.js +0 -1
- package/dist/viewer/assets/useQuery-B8yYhO0c.js +0 -1
- package/dist/viewer/assets/zod-Dc4H6VVJ.js +0 -1
- package/dist/virtual-modules-DnCx0Gdx.mjs +0 -340
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/editor-F9o4zoeB.js","assets/index-CH7cEAxj.js","assets/chunk-OB3PAWPO-DJIP1M4r.js","assets/quill-Cde5JMRD.js","assets/mermaid.core-BDgZg3kW.js","assets/preload-helper-BlTxHScW.js","assets/transform-BqqRT-Iy.js","assets/merge-BhOMvhW1.js","assets/index-BpCVYTvP.js","assets/index-CIf0GId3.js","assets/index-Dj_05fqk.js","assets/last-DXTTfs9a.js","assets/index-BIrx3oY4.js","assets/value-wA6veExk.js","assets/react-Bx48XWN4.js","assets/nav-links-DZWMpwMR.js","assets/query-D9oj6LGx.js","assets/iconBase-DtqdW2XR.js","assets/component-icons-MJ61E9nt.js","assets/component-icons-BD8MpcyB.css","assets/style-BPesJvJr.js","assets/gql-FFIj8zdp.js","assets/index-Ck66Ic_p.js","assets/style-BnuhLJ6X.css","assets/index-B6MxYIzs.js","assets/use-localstorage-D233xVb0.js","assets/avatar-DAFUyk1i.js","assets/useMutation-D5ZHwHsx.js","assets/useQuery-Dhe6uxrL.js","assets/index-PglMbhys.js","assets/chevron-down-DDsUE_xz.js","assets/super-circle-loader-DSkos6uP.js","assets/button-DZj74qS7.js","assets/better-delete-confirmation-modal-CGEQ5O4X.js","assets/dialog-D7wzTt0L.js","assets/scroll-area-RagrStGj.js","assets/ui-graph-logo-gHowu5gP.js","assets/check-BpmCQNbj.js","assets/badge-hR3QvPWv.js","assets/table-B4pFND-o.js","assets/services-Ivav34WC.js","assets/common-DLCsGQ-t.js","assets/editor-njNjsRVH.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{i as V$,a as F$,d as q$,e as Y$,g as U$,k as G$,f as rm,b as vi,m as Et,n as H$,A as K$}from"./index-BpCVYTvP.js";import{a as dr,c as im}from"./react-Bx48XWN4.js";import{r as $,g as gx,R as hr,j as g}from"./index-CH7cEAxj.js";import{c as ho,a8 as ff,aJ as Gg,aK as J$,aH as Hg,aL as eC,aM as tC,aN as nC,aO as rC,N as Kg,aP as iC,aE as sC}from"./nav-links-DZWMpwMR.js";import{d as kt,o as tn,s as ne,B as jr,u as Ox,C as id,b as Hi,c as ps,L as oC}from"./index-CIf0GId3.js";import{_ as aC}from"./preload-helper-BlTxHScW.js";import{b as lC,c as F}from"./chunk-OB3PAWPO-DJIP1M4r.js";import{_ as bx,a as se,O as cC,b as uC,A as dC,S as hC,c as fC,d as pC,F as mC,B as gC,f as OC,g as bC,h as yC,i as xC,D as SC,T as kC}from"./component-icons-MJ61E9nt.js";import{a as mi}from"./index-Dj_05fqk.js";import{R as vC,u as sd,a as wC}from"./query-D9oj6LGx.js";import{g as QC,h as $C,H as un,u as On,N as pr,j as sm,k as Qn,r as CC,w as PC,S as TC,s as MC,D as yx,l as Lc,m as AC,a as RC,E as EC,V as NC,n as DC,o as jC,i as IC,M as XC,B as LC,p as _C}from"./style-BPesJvJr.js";import{t as od}from"./index-B6MxYIzs.js";import{u as xo}from"./use-localstorage-D233xVb0.js";import{U as BC,e as ZC,d as WC,A as xx,a as Sx,b as kx}from"./avatar-DAFUyk1i.js";import{u as Ho}from"./useMutation-D5ZHwHsx.js";import{P as ge,b as fc,M as Wi,g as vx,O as pf,a7 as zC,q as VC,af as FC,_ as zd,L as qC,Z as YC}from"./index-BIrx3oY4.js";import{M as UC,j as Vd,u as wx,b as Qx,P as GC,k as HC,L as KC,m as zi,l as JC}from"./index-PglMbhys.js";import{G as mr}from"./iconBase-DtqdW2XR.js";import{C as eP}from"./chevron-down-DDsUE_xz.js";import{g as fo}from"./gql-FFIj8zdp.js";import{u as xa}from"./useQuery-Dhe6uxrL.js";import{S as om}from"./super-circle-loader-DSkos6uP.js";import{B as Dt}from"./button-DZj74qS7.js";import{B as tP}from"./better-delete-confirmation-modal-CGEQ5O4X.js";import{D as nP,a as rP,b as iP,c as Jg,C as sP}from"./scroll-area-RagrStGj.js";import{C as oP}from"./check-BpmCQNbj.js";import{X as aP}from"./dialog-D7wzTt0L.js";import{B as Ur}from"./badge-hR3QvPWv.js";import{T as $x,a as Cx,b as Ko,c as Cr,d as Px,e as rr}from"./table-B4pFND-o.js";import{S as lP}from"./services-Ivav34WC.js";import{C as eO}from"./common-DLCsGQ-t.js";/**
|
|
3
|
+
* @license lucide-react v0.514.0 - ISC
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the ISC license.
|
|
6
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
7
|
+
*/const cP=[["path",{d:"M15.536 11.293a1 1 0 0 0 0 1.414l2.376 2.377a1 1 0 0 0 1.414 0l2.377-2.377a1 1 0 0 0 0-1.414l-2.377-2.377a1 1 0 0 0-1.414 0z",key:"1uwlt4"}],["path",{d:"M2.297 11.293a1 1 0 0 0 0 1.414l2.377 2.377a1 1 0 0 0 1.414 0l2.377-2.377a1 1 0 0 0 0-1.414L6.088 8.916a1 1 0 0 0-1.414 0z",key:"10291m"}],["path",{d:"M8.916 17.912a1 1 0 0 0 0 1.415l2.377 2.376a1 1 0 0 0 1.414 0l2.377-2.376a1 1 0 0 0 0-1.415l-2.377-2.376a1 1 0 0 0-1.414 0z",key:"1tqoq1"}],["path",{d:"M8.916 4.674a1 1 0 0 0 0 1.414l2.377 2.376a1 1 0 0 0 1.414 0l2.377-2.376a1 1 0 0 0 0-1.414l-2.377-2.377a1 1 0 0 0-1.414 0z",key:"1x6lto"}]],uP=ho("component",cP);/**
|
|
8
|
+
* @license lucide-react v0.514.0 - ISC
|
|
9
|
+
*
|
|
10
|
+
* This source code is licensed under the ISC license.
|
|
11
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
12
|
+
*/const dP=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],hP=ho("ellipsis",dP);/**
|
|
13
|
+
* @license lucide-react v0.514.0 - ISC
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the ISC license.
|
|
16
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/const fP=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],tO=ho("key",fP);/**
|
|
18
|
+
* @license lucide-react v0.514.0 - ISC
|
|
19
|
+
*
|
|
20
|
+
* This source code is licensed under the ISC license.
|
|
21
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
22
|
+
*/const pP=[["path",{d:"M20 18v-2a4 4 0 0 0-4-4H4",key:"5vmcpk"}],["path",{d:"m9 17-5-5 5-5",key:"nvlc11"}]],mP=ho("reply",pP);/**
|
|
23
|
+
* @license lucide-react v0.514.0 - ISC
|
|
24
|
+
*
|
|
25
|
+
* This source code is licensed under the ISC license.
|
|
26
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
27
|
+
*/const gP=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],OP=ho("send",gP);/**
|
|
28
|
+
* @license lucide-react v0.514.0 - ISC
|
|
29
|
+
*
|
|
30
|
+
* This source code is licensed under the ISC license.
|
|
31
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
32
|
+
*/const bP=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],yP=ho("square-pen",bP),xP=Ox([jr("dynamodb"),jr("mongodb"),jr("json")]);xP.or(jr("nosql"));const am=tn({name:ne(),description:ne()}),_c=id(()=>tn({id:ne(),name:ne(),type:ne(),required:Hi(),fields:kt(_c).optional(),itemType:ne().optional(),itemFields:kt(_c).optional()})),SP=id(()=>tn({id:ne(),name:ne(),type:ne(),required:Hi(),isArray:Hi(),reference:tn({collectionId:ne(),fieldId:ne().optional()}).optional(),notes:ne().optional(),fields:kt(_c).optional(),itemType:ne().optional(),itemFields:kt(_c).optional()})),kP=tn({id:ne(),name:ne(),fields:kt(ne()),unique:Hi(),ttl:ne().optional()}),vP=tn({id:ne(),name:ne(),label:ne().optional(),description:ne().optional(),tags:ne().optional(),fields:kt(SP),indexes:kt(kP),sample:ne().optional()}),mf=id(()=>tn({id:ne(),name:ne(),type:ne(),required:Hi(),fields:kt(mf).optional(),itemType:ne().optional(),itemFields:kt(mf).optional(),refCollectionId:ne().nullable().optional()})),wP=tn({id:ne(),fieldName:ne(),order:Ox([jr(1),jr(-1)])}),QP=tn({id:ne(),name:ne(),fields:kt(wP),unique:Hi()}),$P=tn({id:ne(),name:ne(),tags:ne(),description:ne(),fields:kt(mf),indexes:kt(QP)}),CP=tn({id:ne(),name:ne(),partitionKey:ne(),partitionKeyType:ne().optional(),sortKey:ne().optional(),sortKeyType:ne().optional()}),gf=id(()=>tn({id:ne(),name:ne(),type:ne(),required:Hi(),notes:ne().optional(),fields:kt(gf).optional(),itemType:ne().optional(),itemFields:kt(gf).optional()})),CU=am.extend({dialect:jr("dynamodb"),primaryKey:tn({partitionKey:ne(),partitionKeyType:ne().optional(),sortKey:ne(),sortKeyType:ne().optional()}),globalSecondaryIndexes:kt(CP),attributes:kt(gf)}),PP=am.extend({dialect:jr("mongodb"),collections:kt($P)}),PU=am.extend({dialect:jr("json"),collections:kt(vP)}),Tx=32;function Rr(n){return n.type==="group"||n.type==="c4Boundary"}function Tr(n){return Rr(n)?n.data?.collapsed===!0:!1}function Mx(n,e,t){const r=new Map(n.map(s=>[s.id,s]));let i=r.get(e);for(let s=0;s<Tx&&i?.parentId;s++){if(i.parentId===t)return!0;i=r.get(i.parentId)}return!1}function TP(n,e){const t=n.find(i=>i.id===e);if(!t)return n;const r=!Tr(t);return n.map(i=>i.id===e?{...i,data:{...i.data,collapsed:r}}:r&&i.selected&&Mx(n,i.id,e)?{...i,selected:!1}:i)}function MP(n){const e=new Map(n.map(r=>[r.id,r])),t=new Map;for(const r of n){if(r.type!=="c4Boundary")continue;let i=1,s=r.parentId?e.get(r.parentId):void 0;for(let o=0;o<Tx&&s;o++)s.type==="c4Boundary"&&i++,s=s.parentId?e.get(s.parentId):void 0;t.set(r.id,i)}return t}function rl(n){const e=$.useRef(n);return e.current=n,e}const AP=5,RP=120,EP=80;function NP(n){const[e,t,r]=QC(n.nodes),[i,s,o]=$C(n.edges),[a,l]=$.useState(n.dataSources),[c,d]=$.useState(n.components),[h,f]=$.useState(n.viewport),[p,m]=$.useState(null),O=p!==null,b=p?p.nodes:e,y=p?p.edges:i,k=$.useRef(b),x=$.useRef(y);k.current=b,x.current=y;const S=$.useCallback(R=>{const M=new Map(k.current.map(_=>[_.id,{..._.position}])),j=new Set,N=R.map(_=>{if(_.type==="position"&&"position"in _&&_.position&&_.id){if(k.current.find(ie=>ie.id===_.id)?.type==="sequenceParticipant"){const ie={..._.position,y:0};return M.set(_.id,ie),j.add(_.id),{..._,position:ie}}M.set(_.id,_.position)}return _}),I=x.current,L=new Map;for(const _ of I){if(_.source.startsWith("participant-")&&_.target.startsWith("message-")){const re=L.get(_.target)??{from:"",to:""};L.set(_.target,{...re,from:_.source})}if(_.source.startsWith("message-")&&_.target.startsWith("participant-")){const re=L.get(_.source)??{from:"",to:""};L.set(_.source,{...re,to:_.target})}}const te=k.current,le=[];for(const[_,{from:re,to:ie}]of L){if(!re||!ie||!j.has(re)&&!j.has(ie))continue;const pe=M.get(re),Oe=M.get(ie),U=te.find(ut=>ut.id===_);if(!pe||!Oe||!U)continue;const de=U.width??RP,Ye=re===ie?pe.x+EP-de/2:(pe.x+Oe.x)/2+AP-de/2;le.push({type:"position",id:_,position:{x:Ye,y:U.position.y}})}r([...N,...le])},[r]),v=$.useMemo(()=>{const R=e.filter(M=>M.selected).map(M=>M.id);return[...new Set(R)]},[e]),w=$.useMemo(()=>{const R=i.filter(M=>M.selected).map(M=>M.id);return[...new Set(R)]},[i]),Q=rl({latestNodes:e,latestEdges:i,latestViewport:h,latestDataSources:a,latestFlowComponents:c,setLatestNodes:t,setLatestEdges:s,setLatestViewport:f,setLatestDataSources:l,setLatestFlowComponents:d,tempDiagramState:p,setTempDiagramState:m}),P=$.useCallback(R=>{const{setLatestNodes:M}=Q.current;M(j=>j.map(N=>({...N,selected:R.includes(N.id)})))},[Q]),T=$.useCallback(R=>{const{setLatestEdges:M}=Q.current;M(j=>j.map(N=>({...N,selected:R.includes(N.id)})))},[Q]),C=$.useCallback(R=>{m(M=>M?{...M,viewport:typeof R=="function"?R(M.viewport):R}:null)},[m]);return{viewport:p?p.viewport:h,setViewport:p?C:f,nodes:b,setNodes:O?console.error:t,onNodesChange:O?console.error:S,edges:y,setEdges:O?console.error:s,onEdgesChange:O?console.error:o,dataSources:p?p.dataSources:a,setDataSources:O?console.error:l,flowComponents:p?p.components:c,setFlowComponents:O?console.error:d,latestData:{nodes:e,edges:i,viewport:h,dataSources:a,components:c},tempDiagramState:p,setTempDiagramState:m,isPreviewing:O,selectedNodeIds:v,setSelectedNodeIds:P,selectedEdgeIds:w,setSelectedEdgeIds:T,setLatestNodes:t,setLatestEdges:s,setLatestViewport:f,setLatestDataSources:l,setLatestFlowComponents:d}}var Fd,nO;function DP(){if(nO)return Fd;nO=1;var n=1e3,e=n*60,t=e*60,r=t*24,i=r*7,s=r*365.25;Fd=function(d,h){h=h||{};var f=typeof d;if(f==="string"&&d.length>0)return o(d);if(f==="number"&&isFinite(d))return h.long?l(d):a(d);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(d))};function o(d){if(d=String(d),!(d.length>100)){var h=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(d);if(h){var f=parseFloat(h[1]),p=(h[2]||"ms").toLowerCase();switch(p){case"years":case"year":case"yrs":case"yr":case"y":return f*s;case"weeks":case"week":case"w":return f*i;case"days":case"day":case"d":return f*r;case"hours":case"hour":case"hrs":case"hr":case"h":return f*t;case"minutes":case"minute":case"mins":case"min":case"m":return f*e;case"seconds":case"second":case"secs":case"sec":case"s":return f*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return f;default:return}}}}function a(d){var h=Math.abs(d);return h>=r?Math.round(d/r)+"d":h>=t?Math.round(d/t)+"h":h>=e?Math.round(d/e)+"m":h>=n?Math.round(d/n)+"s":d+"ms"}function l(d){var h=Math.abs(d);return h>=r?c(d,h,r,"day"):h>=t?c(d,h,t,"hour"):h>=e?c(d,h,e,"minute"):h>=n?c(d,h,n,"second"):d+" ms"}function c(d,h,f,p){var m=h>=f*1.5;return Math.round(d/f)+" "+p+(m?"s":"")}return Fd}var jP=DP();const IP=gx(jP);function XP({nodes:n,edges:e,components:t,dataSources:r,viewport:i,disabled:s,diagramId:o,diagramName:a,organizationId:l,folderId:c,teamId:d,initialLastUpdatedAt:h}){const[f,p]=$.useState(!1),[m]=Ho(BC),O=$.useMemo(()=>h?new Date(h).getTime():0,[h]),[b,y]=dr(O),k=$.useRef(null),x=$.useRef(null),S=rl({updateDiagram:m,lastUpdatedAt:b,setLastUpdatedAt:y,nodes:n,edges:e,viewport:i,components:t,dataSources:r,disabled:s,diagramId:o,diagramName:a,organizationId:l,folderId:c,teamId:d}),v=$.useCallback(async(w=!1)=>{k.current&&clearTimeout(k.current),console.log("> Saving meta data");const{updateDiagram:Q,lastUpdatedAt:P,setLastUpdatedAt:T,disabled:C,diagramId:R,diagramName:M,organizationId:j,folderId:N,teamId:I,...L}=S.current;if(!R||!j||C)return null;const te={name:M,content:ZC({nodes:L.nodes,edges:L.edges,viewport:L.viewport,components:L.components,dataSources:L.dataSources}),...N?{folderId:N}:{},...I?{teamId:I}:{}},le=JSON.stringify(te),_=qd.has(R)&&qd.get(R)===le;if(_&&!w)return console.info("Diagram already up to date, skipping update"),Yd.get(R)??null;let re=Yd.get(R)??null;try{if(p(!0),!_){const ie=await Q({variables:{orgId:j,id:R,input:te}});qd.set(R,le),re=ie.data?.updateDiagram.contentHash??null,re&&Yd.set(R,re)}}catch{return od.error("Failed to update diagram. Please try again."),null}finally{p(!1)}return re},[S]);return $.useEffect(()=>{const{disabled:w}=S.current;if(!w&&!S.current.nodes.some(Q=>Q.data?.autoLayout)){if(x.current===null){x.current=rO(S.current.diagramName,S.current.nodes,S.current.edges);return}return k.current=setTimeout(()=>{const{diagramName:Q,nodes:P,edges:T}=S.current,C=rO(Q,P,T);C!==x.current&&(x.current=C,v())},LP),()=>{k.current&&clearTimeout(k.current)}}},[n,e,t,r,a,v,S,k]),{isMetaUpdating:f,triggerMetaUpdate:v}}function rO(n,e,t){return V$(e)?JSON.stringify({name:n,...F$(e,t)}):q$(e)?JSON.stringify({name:n,...Y$(e,t)}):JSON.stringify({name:n,...U$({nodes:e,edges:t})})}const qd=new Map,Yd=new Map,LP=IP("1s"),[TU,Fr]=im(({diagramId:n,initialInfo:e,initialData:t,organizationId:r,folderId:i,teamId:s,isEmbedded:o})=>{const a=NP(t),[l,c]=$.useState(e.name??"Blank Diagram"),d=$.useRef(null),[h,f]=$.useState(null),[p,m]=$.useState(!1),[O,b]=$.useState(null),[y,k]=xo("flow-diagram-cursor-mode","select"),[x,S]=$.useState(!1),[v,w]=lC(),Q=(v.get("children")??"").split(",").filter(U=>U.length>0);function P(U){const de=new URLSearchParams(v);U.length===0&&de.delete("children"),U.length>0&&de.set("children",U.join(",")),w(de)}function T(U){if(o)return window.parent.__uigraphOpenChild?.(U);P([...Q,U])}const[C,R]=xo("flow-diagram-show-grid",!0),[M,j]=xo("flow-diagram-show-minimap",!1),[N,I]=xo("flow-diagram-drawing-mode",!1),[L,te]=xo("flow-diagram-fullscreen",!1),le=$.useMemo(()=>{const U=a.nodes.filter(de=>de.selected&&Rr(de));return U.length===1?U[0]:null},[a.nodes]),_=$.useMemo(()=>MP(a.nodes),[a.nodes]),re=$.useMemo(()=>a.nodes.some(U=>U.type==="c4"||U.type==="c4Boundary"),[a.nodes]),ie=$.useMemo(()=>{const U=new Map;for(const de of a.dataSources)for(const Ye of de.schemaAst.tables){const ut=de.dialect==="mongodb"?PP.parse(de.sourceContent).collections.find(bn=>bn.id===Ye.id):void 0;U.set(`${de.name}@${Ye.name}`,{source:de,table:Ye,mongoCollectionSource:ut})}return U},[a.dataSources]),{isMetaUpdating:pe,triggerMetaUpdate:Oe}=XP({diagramId:n,diagramName:l,organizationId:r,folderId:i,teamId:s,disabled:a.isPreviewing,initialLastUpdatedAt:e.lastUpdatedAt,nodes:a.latestData.nodes,edges:a.latestData.edges,viewport:a.latestData.viewport,dataSources:a.latestData.dataSources,components:a.latestData.components});return{...a,reactFLowRef:d,isMetaUpdating:pe,triggerMetaUpdate:Oe,diagramId:n,organizationId:r,diagramName:l,setDiagramName:c,isEmbedded:o,childDiagramIds:Q,setChildDiagramIds:P,openChildDiagram:T,selectedFrame:le,boundaryDepths:_,dataTablesMap:ie,isC4Diagram:re,showGrid:C,setShowGrid:R,showMinimap:M,setShowMinimap:j,drawingMode:N,setDrawingMode:I,isFullscreen:L,setIsFullscreen:te,reactFlowInstance:h,setReactFlowInstance:f,sidebarActiveTool:O,setSidebarActiveTool:b,cursorMode:y,setCursorMode:k,isCommandPaletteOpen:x,setIsCommandPaletteOpen:S,isEdgeConnecting:p,setIsEdgeConnecting:m}}),[MU,AU]=im(()=>{const{dataSources:n,setDataSources:e}=Fr();function t(o){e(a=>[...a,o])}function r(o,a){e(l=>l.map(c=>c.id===o?{...c,...a}:c))}function i(o){e(a=>a.filter(l=>l.id!==o))}function s(o){const a=n.find(c=>c.id===o);return!a||!a.schemaAst?"":new G$(a.dialect,2).generate(a.schemaAst)}return{dataSources:n,addDataSource:t,updateDataSource:r,removeDataSource:i,regenerateSql:s}}),_P={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},BP=tn({GRAPHQL_URL:oC(),VITE_DEPLOY_ENV:ps(["local","development","production"]).default("production"),VITE_FEATURE_DIAGRAM_IMPORT_EXPORT:ps(["true","false"]).optional().transform(n=>n==="true"),VITE_FEATURE_ENABLE_DEMO_TEST_CASES:ps(["true","false"]).optional().transform(n=>n==="true"),VITE_FEATURE_ENABLE_INSIGHTS:ps(["true","false"]).optional().transform(n=>n==="true"),VITE_FEATURE_ENABLE_DEBUG_DIAGRAM_NODE_BOUNDS:ps(["true","false"]).optional().transform(n=>n==="true"),VITE_FEATURE_ENABLE_ENTERPRISE:ps(["true","false"]).optional().transform(n=>n==="true")}),ZP=BP.parse({..._P,GRAPHQL_URL:`${window.location.origin}/graphql`}),Sa=.02,ka=8,iO=1.25,wl=1,WP=2,zP=1.5,RU=.15,VP=200,Bc=300;function Ax(n){return n<Sa?Sa:n>ka?ka:n}function EU(n){const e=Ax(n);if(e<=wl)return wl/e;const t=Math.log(e/wl)/Math.log(ka/wl);return(1+(WP-1)*t)/e}function sO(n,e){n.zoomTo(Ax(n.getZoom()*e),{duration:VP,interpolate:"linear"})}function FP(n){if(n.getNodes().length===0){n.zoomTo(1,{duration:Bc,interpolate:"linear"});return}n.fitView({padding:{top:"80px",left:"20px",right:"20px",bottom:"20px"},minZoom:Sa,maxZoom:ka,duration:Bc})}function Rx(n,e){e.length!==0&&n.fitView({nodes:e.map(t=>({id:t})),padding:.2,minZoom:Sa,maxZoom:zP,duration:Bc})}function Mn(n,e){const t=JSON.stringify(e);return $.useMemo(()=>{const r=JSON.parse(t);if(Object.keys(r).length===0||!n)return null;const i=mi(n),s=rm(i,i),a=i.find(l=>{for(const c in r)if(!(l[c]===r[c]))return!1;return!0})?.componentFieldId;return a?s[a]??null:null},[n,t])}function qP(n,e){if(Object.keys(e).length===0||!n)return null;const t=mi(n),r=rm(t,t),s=t.find(o=>{for(const a in e)if(!(o[a]===e[a]))return!1;return!0})?.componentFieldId;return s?r[s]??null:null}var YP=$.useLayoutEffect,UP=function(e){var t=hr.useRef(e);return YP(function(){t.current=e}),t},oO=function(e,t){if(typeof e=="function"){e(t);return}e.current=t},GP=function(e,t){var r=hr.useRef();return hr.useCallback(function(i){e.current=i,r.current&&oO(r.current,null),r.current=t,t&&oO(t,i)},[t])},aO={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0",display:"block"},HP=function(e){Object.keys(aO).forEach(function(t){e.style.setProperty(t,aO[t],"important")})},lO=HP,Bt=null,cO=function(e,t){var r=e.scrollHeight;return t.sizingStyle.boxSizing==="border-box"?r+t.borderSize:r-t.paddingSize};function KP(n,e,t,r){t===void 0&&(t=1),r===void 0&&(r=1/0),Bt||(Bt=document.createElement("textarea"),Bt.setAttribute("tabindex","-1"),Bt.setAttribute("aria-hidden","true"),lO(Bt)),Bt.parentNode===null&&document.body.appendChild(Bt);var i=n.paddingSize,s=n.borderSize,o=n.sizingStyle,a=o.boxSizing;Object.keys(o).forEach(function(f){var p=f;Bt.style[p]=o[p]}),lO(Bt),Bt.value=e;var l=cO(Bt,n);Bt.value=e,l=cO(Bt,n),Bt.value="x";var c=Bt.scrollHeight-i,d=c*t;a==="border-box"&&(d=d+i+s),l=Math.max(d,l);var h=c*r;return a==="border-box"&&(h=h+i+s),l=Math.min(h,l),[l,c]}var uO=function(){},JP=function(e,t){return e.reduce(function(r,i){return r[i]=t[i],r},{})},eT=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak","wordSpacing","scrollbarGutter"],tT=!!document.documentElement.currentStyle,nT=function(e){var t=window.getComputedStyle(e);if(t===null)return null;var r=JP(eT,t),i=r.boxSizing;if(i==="")return null;tT&&i==="border-box"&&(r.width=parseFloat(r.width)+parseFloat(r.borderRightWidth)+parseFloat(r.borderLeftWidth)+parseFloat(r.paddingRight)+parseFloat(r.paddingLeft)+"px");var s=parseFloat(r.paddingBottom)+parseFloat(r.paddingTop),o=parseFloat(r.borderBottomWidth)+parseFloat(r.borderTopWidth);return{sizingStyle:r,paddingSize:s,borderSize:o}},rT=nT;function lm(n,e,t){var r=UP(t);$.useLayoutEffect(function(){var i=function(o){return r.current(o)};if(n)return n.addEventListener(e,i),function(){return n.removeEventListener(e,i)}},[])}var iT=function(e,t){lm(document.body,"reset",function(r){e.current.form===r.target&&t(r)})},sT=function(e){lm(window,"resize",e)},oT=function(e){lm(document.fonts,"loadingdone",e)},aT=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],lT=function(e,t){var r=e.cacheMeasurements,i=e.maxRows,s=e.minRows,o=e.onChange,a=o===void 0?uO:o,l=e.onHeightChange,c=l===void 0?uO:l,d=bx(e,aT),h=d.value!==void 0,f=$.useRef(null),p=GP(f,t),m=$.useRef(0),O=$.useRef(),b=function(){var x=f.current,S=r&&O.current?O.current:rT(x);if(S){O.current=S;var v=KP(S,x.value||x.placeholder||"x",s,i),w=v[0],Q=v[1];m.current!==w&&(m.current=w,x.style.setProperty("height",w+"px","important"),c(w,{rowHeight:Q}))}},y=function(x){h||b(),a(x)};return $.useLayoutEffect(b),iT(f,function(){if(!h){var k=f.current.value;requestAnimationFrame(function(){var x=f.current;x&&k!==x.value&&b()})}}),sT(b),oT(b),$.createElement("textarea",se({},d,{onChange:y,ref:p}))},Fs=$.forwardRef(lT);const Qe=2,So=14,ko=16,dO=16,hO=12,fO=14,cT=40,uT=22,dT=20,Lo=.26,pc=.06;function hT({color:n}){return g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"absolute inset-x-0 bottom-0 rounded-[1.25rem]",style:{top:`${(Lo+pc)*100}%`,border:`${Qe}px solid ${n}`}}),g.jsx("div",{className:"absolute top-0 left-1/2 aspect-square -translate-x-1/2 rounded-full",style:{height:`${Lo*100}%`,border:`${Qe}px solid ${n}`}}),g.jsx("div",{className:"absolute left-[14%] w-0",style:{top:`${(Lo+pc)*100+10}%`,bottom:"24%",borderLeft:`${Qe}px solid ${n}`}}),g.jsx("div",{className:"absolute right-[14%] w-0",style:{top:`${(Lo+pc)*100+10}%`,bottom:"24%",borderRight:`${Qe}px solid ${n}`}})]})}function fT({color:n}){return g.jsx("div",{className:"absolute inset-0 rounded-[0.625rem]",style:{border:`${Qe}px solid ${n}`}})}function pT({color:n}){return g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"absolute inset-x-0",style:{top:`${So}px`,bottom:`${So}px`,borderLeft:`${Qe}px solid ${n}`,borderRight:`${Qe}px solid ${n}`}}),g.jsx("div",{className:"absolute inset-x-0 top-0 rounded-[50%]",style:{height:`${So*2}px`,border:`${Qe}px solid ${n}`}}),g.jsx("div",{className:"absolute inset-x-0 bottom-0 overflow-hidden",style:{height:`${So}px`},children:g.jsx("div",{className:"absolute inset-x-0 bottom-0 rounded-[50%]",style:{height:`${So*2}px`,border:`${Qe}px solid ${n}`}})})]})}function mT({color:n}){return g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"absolute inset-y-0",style:{left:`${ko}px`,right:`${ko}px`,borderTop:`${Qe}px solid ${n}`,borderBottom:`${Qe}px solid ${n}`}}),g.jsx("div",{className:"absolute inset-y-0 left-0 rounded-[50%]",style:{width:`${ko*2}px`,border:`${Qe}px solid ${n}`}}),g.jsx("div",{className:"absolute inset-y-0 right-0 overflow-hidden",style:{width:`${ko}px`},children:g.jsx("div",{className:"absolute inset-y-0 right-0 rounded-[50%]",style:{width:`${ko*2}px`,border:`${Qe}px solid ${n}`}})})]})}function gT({color:n}){return g.jsx("div",{className:"absolute inset-0 rounded-[50%]",style:{border:`${Qe}px solid ${n}`}})}function OT({color:n}){return g.jsxs(g.Fragment,{children:[g.jsx("svg",{className:"absolute inset-x-0 bottom-0",style:{top:`${dO}px`},preserveAspectRatio:"none",viewBox:"0 0 100 100",children:g.jsx("path",{d:`M0,0 L${hO},100 L${100-hO},100 L100,0`,fill:"none",stroke:n,strokeWidth:Qe,vectorEffect:"non-scaling-stroke"})}),g.jsx("div",{className:"absolute inset-x-0 top-0 rounded-[50%]",style:{height:`${dO*2}px`,border:`${Qe}px solid ${n}`}})]})}function bT({color:n}){return g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"absolute top-0 left-0 rounded-t-[0.25rem]",style:{width:`${cT}px`,height:`${fO+Qe}px`,borderTop:`${Qe}px solid ${n}`,borderLeft:`${Qe}px solid ${n}`,borderRight:`${Qe}px solid ${n}`}}),g.jsx("div",{className:"absolute inset-x-0 bottom-0 rounded-[0.25rem] rounded-tl-none",style:{top:`${fO}px`,border:`${Qe}px solid ${n}`}})]})}function yT({color:n}){return g.jsx("div",{className:"absolute inset-0 rounded-[0.375rem]",style:{border:`${Qe}px solid ${n}`},children:g.jsxs("div",{className:"flex items-center gap-1.5 px-2",style:{height:`${uT}px`,borderBottom:`${Qe}px solid ${n}`},children:[g.jsx("span",{className:"size-1.5 shrink-0 rounded-full",style:{backgroundColor:n}}),g.jsx("span",{className:"size-1.5 shrink-0 rounded-full",style:{backgroundColor:n}}),g.jsx("span",{className:"size-1.5 shrink-0 rounded-full",style:{backgroundColor:n}}),g.jsx("span",{className:"ml-1 h-2.5 flex-1 rounded-full",style:{border:`1px solid ${n}`}})]})})}function xT({color:n}){return g.jsx("div",{className:"absolute inset-0 rounded-[0.375rem]",style:{border:`${Qe}px solid ${n}`},children:g.jsx("div",{className:"flex items-center px-2 font-mono text-[0.6875rem] leading-none",style:{height:`${dT}px`,borderBottom:`${Qe}px solid ${n}`,color:n},children:">_"})})}function ST({color:n}){return g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"absolute inset-y-0 rounded-[0.25rem]",style:{left:`${Qe*3}px`,right:0,border:`${Qe}px solid ${n}`}}),g.jsx("div",{className:"absolute left-0 h-4 w-6 rounded-[0.125rem]",style:{top:"22%",border:`${Qe}px solid ${n}`}}),g.jsx("div",{className:"absolute left-0 h-4 w-6 rounded-[0.125rem]",style:{bottom:"22%",border:`${Qe}px solid ${n}`}})]})}const pO={default:fT,db:pT,queue:mT,bucket:OT,folder:bT,browser:yT,terminal:xT,component:ST,ellipse:gT},kT={default:"px-4 py-3",db:"px-4 pt-8 pb-6",queue:"px-10 py-3",bucket:"px-8 pt-8 pb-4",folder:"px-4 pt-6 pb-3",browser:"px-4 pt-8 pb-3",terminal:"px-4 pt-8 pb-3",component:"pt-3 pr-4 pb-3 pl-8",ellipse:"px-8 py-4"};function wi({className:n,...e}){return g.jsx(il,{className:F("outline-stock rounded-[0.5rem] outline","[.selected_&]:outline-primary [.selected_&]:shadow-[0_24px_40px_0_rgba(0,0,0,0.08)]",n),...e})}function il({children:n,...e}){const{isEdgeConnecting:t}=Fr();return g.jsxs("div",{...e,children:[n,g.jsxs(g.Fragment,{children:[g.jsx(un,{id:"target-top",type:"target",position:ge.Top,className:F(t&&"connection-enabled")}),g.jsx(un,{id:"source-top",type:"source",position:ge.Top,className:F(t&&"connection-enabled")}),g.jsx(un,{id:"target-bottom",type:"target",position:ge.Bottom,className:F(t&&"connection-enabled")}),g.jsx(un,{id:"source-bottom",type:"source",position:ge.Bottom,className:F(t&&"connection-enabled")}),g.jsx(un,{id:"target-left",type:"target",position:ge.Left,className:F(t&&"connection-enabled")}),g.jsx(un,{id:"source-left",type:"source",position:ge.Left,className:F(t&&"connection-enabled")}),g.jsx(un,{id:"target-right",type:"target",position:ge.Right,className:F(t&&"connection-enabled")}),g.jsx(un,{id:"source-right",type:"source",position:ge.Right,className:F(t&&"connection-enabled")})]})]})}const NU={person:"Person",system:"System",container:"Container",component:"Component",node:"Node"},vT={person:"Person",system:"Software System",container:"Container",component:"Component",node:"Deployment Node"},wT="#1168BD",mO=60,QT=1;function $T({id:n,data:e,width:t,height:r,selected:i}){const{updateNodeData:s,updateNode:o}=On(),{setNodes:a}=Fr(),l=Mn(e.componentFields,{componentFieldId:"name"}),c=$.useRef(null),[d,h]=dr(l??"");function f(C){h(C),c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{s(n,{componentFields:vi(e.componentFields??[],{name:C})})},1e3)}const p=$.useRef(null),[m,O]=dr(e.description??"");function b(C){O(C),p.current&&clearTimeout(p.current),p.current=setTimeout(()=>{s(n,{description:C})},1e3)}const y=e.fill??wT,k=e.fontColor??y,x=e.c4Shape??"default",S=e.c4Kind==="person",v=pO[x]??pO.default,w=vT[e.c4Kind??"system"],P=(e.c4Kind==="container"||e.c4Kind==="component")&&e.technology?`${w}: ${e.technology}`:w,T=$.useRef(null);return $.useLayoutEffect(()=>{const C=T.current;if(!C)return;const R=Math.max(Math.ceil(C.scrollHeight),mO);R<=(r??0)+QT||a(M=>M.map(j=>j.id===n?{...j,height:R}:j))},[n,t,r,x,S,d,P,m,a]),g.jsxs(il,{selected:!!i,className:F("relative size-full rounded-[0.25rem]",i&&"outline-primary outline"),children:[g.jsx(pr,{minWidth:140,minHeight:mO,isVisible:i,onResize:(C,R)=>{o(n,{width:R.width,height:R.height})}}),S&&g.jsx(hT,{color:y}),!S&&g.jsx(v,{color:y}),g.jsxs("div",{ref:T,className:F("relative flex min-h-full w-full flex-col items-center justify-center gap-0.5 text-center",S?"px-4 pb-4":kT[x]),style:{color:k,paddingTop:S?`${(Lo+pc)*100+8}%`:void 0},children:[g.jsx(Fs,{value:d,placeholder:"Name",onKeyDown:C=>C.stopPropagation(),onMouseDown:C=>C.stopPropagation(),onChange:C=>f(C.currentTarget.value),className:F("w-full cursor-grab resize-none bg-transparent text-center text-sm leading-5 font-bold outline-none",i&&"cursor-text active:cursor-grabbing"),style:{color:k}}),g.jsxs("span",{className:"text-[0.625rem] leading-tight opacity-90",children:["[",P,"]"]}),g.jsx(Fs,{value:m,placeholder:"Description",onKeyDown:C=>C.stopPropagation(),onMouseDown:C=>C.stopPropagation(),onChange:C=>b(C.currentTarget.value),className:F("w-full cursor-grab resize-none bg-transparent text-center text-[0.6875rem] leading-4 opacity-90 outline-none",i&&"cursor-text active:cursor-grabbing"),style:{color:k}})]}),e.subDiagramId&&g.jsx("button",{type:"button",title:"Open sub diagram in a new tab",className:"absolute top-1.5 right-1.5 rounded-sm bg-black/30 p-1 text-white/90 transition-colors hover:bg-black/50",onMouseDown:C=>C.stopPropagation(),onClick:C=>{C.stopPropagation(),window.open(`/diagram/${e.subDiagramId}`,"_blank")},children:g.jsx(ff,{className:"size-3"})})]})}function CT(n){return mr({attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M512 1024c-69.1 0-136.2-13.5-199.3-40.2C251.7 958 197 921 150 874c-47-47-84-101.7-109.8-162.7C13.5 648.2 0 581.1 0 512c0-19.9 16.1-36 36-36s36 16.1 36 36c0 59.4 11.6 117 34.6 171.3 22.2 52.4 53.9 99.5 94.3 139.9 40.4 40.4 87.5 72.2 139.9 94.3C395 940.4 452.6 952 512 952c59.4 0 117-11.6 171.3-34.6 52.4-22.2 99.5-53.9 139.9-94.3 40.4-40.4 72.2-87.5 94.3-139.9C940.4 629 952 571.4 952 512c0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 0 0-94.3-139.9 437.71 437.71 0 0 0-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.2C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3s-13.5 136.2-40.2 199.3C958 772.3 921 827 874 874c-47 47-101.8 83.9-162.7 109.7-63.1 26.8-130.2 40.3-199.3 40.3z"},child:[]}]})(n)}const PT=fo(`
|
|
33
|
+
mutation GenerateDiagramThumbnail($orgId: ID!, $diagramId: ID!) {
|
|
34
|
+
generateDiagramThumbnail(orgId: $orgId, diagramId: $diagramId)
|
|
35
|
+
}
|
|
36
|
+
`);function gO(n){window.open(`/diagram/${n}`,"_blank","noopener,noreferrer")}const TT=260,MT=4;function AT({id:n,data:e,selected:t}){const{organizationId:r,openChildDiagram:i}=Fr(),s=sm(w=>w.nodeLookup.get(n)?.measured.width),o=s?Math.min(Math.max(s/TT,1),MT):1,a=xa(WC,{variables:{orgId:r,id:e.diagramId},skip:!r||!e.diagramId,fetchPolicy:"cache-first"}),l=a.data?.diagram,c=l?.previewStatus,d=l?.name??e.diagramName??"Untitled diagram",h=l?.previewImageUrl??e.thumbnailUrl,[f,p]=$.useState(!1);$.useEffect(()=>p(!1),[h]);const{startPolling:m,stopPolling:O}=a;$.useEffect(()=>c!=="pending"?O():(m(3e3),()=>O()),[c,m,O]);const[b,{loading:y}]=Ho(PT),k=y||c==="pending",x=!!h&&!f;function S(){r&&e.diagramId&&i(e.diagramId)}async function v(){if(!(!r||!e.diagramId))try{await b({variables:{orgId:r,diagramId:e.diagramId}}),await a.refetch()}catch{od.error("Failed to start thumbnail generation")}}return g.jsxs(g.Fragment,{children:[t&&g.jsxs(g.Fragment,{children:[g.jsx(Qn,{resizeDirection:"horizontal",position:"top-left",minWidth:180}),g.jsx(Qn,{resizeDirection:"horizontal",position:"top-right",minWidth:180}),g.jsx(Qn,{resizeDirection:"horizontal",position:"bottom-left",minWidth:180}),g.jsx(Qn,{resizeDirection:"horizontal",position:"bottom-right",minWidth:180})]}),g.jsxs(wi,{selected:!!t,onDoubleClick:w=>{w.stopPropagation(),S()},className:"border-stock bg-shading flex w-full flex-col overflow-hidden rounded-[0.5rem] border outline-transparent",children:[!e.hideThumbnail&&g.jsxs("div",{className:"group relative bg-[#0F131C]",children:[e.diagramId?x?g.jsx("img",{src:h,alt:d,draggable:!1,onError:()=>p(!0),className:"block h-auto w-full"}):k?g.jsxs("div",{className:"text-paragraph flex flex-col items-center justify-center gap-1.5 py-10",children:[g.jsx(CT,{className:"size-5 animate-spin"}),g.jsx("span",{className:"text-[0.6875rem]",children:"Generating preview…"})]}):g.jsxs("div",{className:"text-paragraph flex flex-col items-center justify-center gap-1.5 py-10",children:[g.jsx(J$,{className:"size-5"}),g.jsx("span",{className:"text-[0.6875rem]",children:c==="failed"?"Preview failed":"No preview yet"}),g.jsx("button",{type:"button",onMouseDown:w=>w.stopPropagation(),onClick:w=>{w.stopPropagation(),v()},className:"border-stock bg-input mt-1 rounded-md border px-2 py-1 text-[0.6875rem] text-[#F4F7FC]",children:"Create thumbnail"})]}):g.jsxs("div",{className:"text-paragraph flex flex-col items-center justify-center gap-1.5 py-10",children:[g.jsx(Gg,{className:"size-5"}),g.jsx("span",{className:"text-[0.6875rem]",children:"No diagram linked"})]}),e.diagramId&&x&&g.jsxs("span",{className:"pointer-events-none absolute inset-0 flex items-center justify-center gap-2 bg-black/65 opacity-0 transition-opacity group-hover:opacity-100",children:[r&&g.jsxs(Dt,{type:"button",size:"sm",className:"pointer-events-auto",onMouseDown:w=>w.stopPropagation(),onDoubleClick:w=>w.stopPropagation(),onClick:w=>{w.stopPropagation(),S()},children:[g.jsx(Hg,{className:"size-3.5"}),"Open"]}),g.jsx(Dt,{type:"button",size:"sm",variant:"secondary",title:"Open in new tab",className:"pointer-events-auto size-8 p-0",onMouseDown:w=>w.stopPropagation(),onDoubleClick:w=>w.stopPropagation(),onClick:w=>{w.stopPropagation(),gO(e.diagramId)},children:g.jsx(ff,{className:"size-3.5"})})]})]}),g.jsxs("div",{style:{height:28*o,paddingInline:10*o,gap:6*o,fontSize:12*o},className:F("flex shrink-0 items-center",!e.hideThumbnail&&"border-stock border-t"),children:[g.jsx(Gg,{style:{width:12*o,height:12*o},className:"text-paragraph shrink-0"}),g.jsx("span",{className:"min-w-0 flex-1 truncate font-medium text-[#F4F7FC]",children:d}),e.hideThumbnail&&e.diagramId&&g.jsxs(g.Fragment,{children:[r&&g.jsx("button",{type:"button",title:"Open",onMouseDown:w=>w.stopPropagation(),onDoubleClick:w=>w.stopPropagation(),onClick:w=>{w.stopPropagation(),S()},className:"text-paragraph shrink-0 transition-colors hover:text-[#F4F7FC]",children:g.jsx(Hg,{style:{width:12*o,height:12*o}})}),g.jsx("button",{type:"button",title:"Open in new tab",onMouseDown:w=>w.stopPropagation(),onDoubleClick:w=>w.stopPropagation(),onClick:w=>{w.stopPropagation(),gO(e.diagramId)},className:"text-paragraph shrink-0 transition-colors hover:text-[#F4F7FC]",children:g.jsx(ff,{style:{width:12*o,height:12*o}})})]})]})]})]})}const RT="_icon_3zpuy_1",gr={icon:RT};function ET({className:n,...e}){return g.jsxs("svg",{width:"16",height:"17",viewBox:"0 0 16 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:F(gr.icon,n),...e,children:[g.jsx("path",{d:"M12.6668 3.34351H3.3335C2.71224 3.34351 2.40162 3.34351 2.15658 3.445C1.82988 3.58033 1.57032 3.83989 1.43499 4.16659C1.3335 4.41163 1.3335 4.72225 1.3335 5.34351C1.3335 5.96476 1.3335 6.27539 1.43499 6.52042C1.57032 6.84712 1.82988 7.10669 2.15658 7.24201C2.40162 7.34351 2.71224 7.34351 3.3335 7.34351H12.6668C13.2881 7.34351 13.5987 7.34351 13.8438 7.24201C14.1704 7.10669 14.43 6.84712 14.5654 6.52042C14.6668 6.27539 14.6668 5.96476 14.6668 5.34351C14.6668 4.72225 14.6668 4.41163 14.5654 4.16659C14.43 3.83989 14.1704 3.58033 13.8438 3.445C13.5987 3.34351 13.2881 3.34351 12.6668 3.34351Z",stroke:"#2463EB",strokeLinecap:"round",strokeLinejoin:"round"}),g.jsx("path",{d:"M12.6668 10.01H3.3335C2.71224 10.01 2.40162 10.01 2.15658 10.1115C1.82988 10.2468 1.57032 10.5064 1.43499 10.8331C1.3335 11.0781 1.3335 11.3887 1.3335 12.01C1.3335 12.6313 1.3335 12.9419 1.43499 13.1869C1.57032 13.5136 1.82988 13.7732 2.15658 13.9085C2.40162 14.01 2.71224 14.01 3.3335 14.01H12.6668C13.2881 14.01 13.5987 14.01 13.8438 13.9085C14.1704 13.7732 14.43 13.5136 14.5654 13.1869C14.6668 12.9419 14.6668 12.6313 14.6668 12.01C14.6668 11.3887 14.6668 11.0781 14.5654 10.8331C14.43 10.5064 14.1704 10.2468 13.8438 10.1115C13.5987 10.01 13.2881 10.01 12.6668 10.01Z",stroke:"#2463EB",strokeLinecap:"round",strokeLinejoin:"round"}),g.jsx("path",{d:"M4 12.01H4.00667",stroke:"#2463EB",strokeWidth:"1.33333",strokeLinecap:"round",strokeLinejoin:"round"}),g.jsx("path",{d:"M6.6665 12.01H6.67317",stroke:"#2463EB",strokeWidth:"1.33333",strokeLinecap:"round",strokeLinejoin:"round"}),g.jsx("path",{d:"M4 5.34351H4.00667",stroke:"#2463EB",strokeWidth:"1.33333",strokeLinecap:"round",strokeLinejoin:"round"}),g.jsx("path",{d:"M6.6665 5.34351H6.67317",stroke:"#2463EB",strokeWidth:"1.33333",strokeLinecap:"round",strokeLinejoin:"round"})]})}function NT({className:n,...e}){return g.jsxs("svg",{width:"16",height:"17",viewBox:"0 0 16 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:F(gr.icon,n),...e,children:[g.jsx("path",{d:"M8.00016 15.3433C11.6821 15.3433 14.6668 12.3586 14.6668 8.67668C14.6668 4.99478 11.6821 2.01001 8.00016 2.01001C4.31826 2.01001 1.3335 4.99478 1.3335 8.67668C1.3335 12.3586 4.31826 15.3433 8.00016 15.3433Z",stroke:"#17A34A"}),g.jsx("path",{d:"M5.3335 8.67668C5.3335 12.6767 8.00016 15.3433 8.00016 15.3433C8.00016 15.3433 10.6668 12.6767 10.6668 8.67668C10.6668 4.67668 8.00016 2.01001 8.00016 2.01001C8.00016 2.01001 5.3335 4.67668 5.3335 8.67668Z",stroke:"#17A34A",strokeLinejoin:"round"}),g.jsx("path",{d:"M14 10.6768H2",stroke:"#17A34A",strokeLinecap:"round",strokeLinejoin:"round"}),g.jsx("path",{d:"M14 6.67676H2",stroke:"#17A34A",strokeLinecap:"round",strokeLinejoin:"round"})]})}function DT({className:n,...e}){return g.jsxs("svg",{width:"16",height:"17",viewBox:"0 0 16 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:F(gr.icon,n),...e,children:[g.jsx("path",{d:"M7.99984 6.01001C10.9454 6.01001 13.3332 5.11458 13.3332 4.01001C13.3332 2.90544 10.9454 2.01001 7.99984 2.01001C5.05432 2.01001 2.6665 2.90544 2.6665 4.01001C2.6665 5.11458 5.05432 6.01001 7.99984 6.01001Z",stroke:"#EA580B"}),g.jsx("path",{d:"M4.6665 7.90454C5.06756 8.02514 5.51606 8.12441 5.99984 8.19787",stroke:"#EA580B",strokeLinecap:"round"}),g.jsx("path",{d:"M13.3332 8.67676C13.3332 9.78136 10.9454 10.6768 7.99984 10.6768C5.05432 10.6768 2.6665 9.78136 2.6665 8.67676",stroke:"#EA580B"}),g.jsx("path",{d:"M4.6665 12.5713C5.06756 12.6919 5.51606 12.7912 5.99984 12.8646",stroke:"#EA580B",strokeLinecap:"round"}),g.jsx("path",{d:"M13.3332 4.01001V13.3433C13.3332 14.4479 10.9454 15.3433 7.99984 15.3433C5.05432 15.3433 2.6665 14.4479 2.6665 13.3433V4.01001",stroke:"#EA580B"})]})}function jT({className:n,...e}){return g.jsxs("svg",{width:"16",height:"17",viewBox:"0 0 16 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:F(gr.icon,n),...e,children:[g.jsx("path",{d:"M5.6665 10.3433H10.3332M5.6665 7.01001H7.99984",stroke:"#9334E9",strokeLinecap:"round",strokeLinejoin:"round"}),g.jsx("path",{d:"M9.44723 14.6038C12.2359 14.4185 14.4572 12.1656 14.64 9.33744C14.6758 8.78397 14.6758 8.21077 14.64 7.65731C14.4572 4.82909 12.2359 2.57626 9.44723 2.39089C8.49583 2.32765 7.50256 2.32778 6.55309 2.39089C3.76442 2.57626 1.5431 4.82909 1.36032 7.65731C1.32455 8.21077 1.32455 8.78397 1.36032 9.33744C1.42689 10.3675 1.88245 11.3212 2.41877 12.1266C2.73017 12.6904 2.52465 13.394 2.2003 14.0087C1.96643 14.4519 1.8495 14.6735 1.94339 14.8336C2.03728 14.9936 2.247 14.9988 2.66645 15.009C3.49594 15.0292 4.05528 14.794 4.49928 14.4666C4.75109 14.2809 4.87701 14.188 4.96379 14.1774C5.05056 14.1667 5.22134 14.237 5.56283 14.3777C5.86976 14.5041 6.22613 14.5821 6.55309 14.6038C7.50256 14.667 8.49583 14.6671 9.44723 14.6038Z",stroke:"#9334E9",strokeLinejoin:"round"})]})}function IT({className:n,...e}){return g.jsxs("svg",{width:"16",height:"17",viewBox:"0 0 16 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:F(gr.icon,n),...e,children:[g.jsx("path",{d:"M7.39917 2.67676C4.96653 2.68114 3.69265 2.74087 2.87855 3.5551C2 4.4338 2 5.84804 2 8.67648C2 11.5049 2 12.9192 2.87855 13.7979C3.7571 14.6766 5.17111 14.6766 7.99917 14.6766C10.8271 14.6766 12.2412 14.6766 13.1197 13.7979C13.9338 12.9837 13.9935 11.7095 13.9979 9.27654",stroke:"#DC2625",strokeLinecap:"round",strokeLinejoin:"round"}),g.jsx("path",{d:"M13.7039 3.00734L7.36572 9.38233M13.7039 3.00734C13.3746 2.6776 11.1561 2.70833 10.6871 2.71501M13.7039 3.00734C14.0333 3.33709 14.0025 5.55841 13.9959 6.02802",stroke:"#DC2625",strokeLinecap:"round",strokeLinejoin:"round"})]})}function XT({className:n,...e}){return g.jsx("svg",{width:"16",height:"17",viewBox:"0 0 16 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:F(gr.icon,n),...e,children:g.jsx("path",{d:"M5.75193 9.12582H5.44596C4.4568 9.12582 3.96222 9.12582 3.75141 8.79969C3.5406 8.47362 3.74146 8.01929 4.1432 7.11064L5.35096 4.37891C5.71622 3.55276 5.89885 3.13968 6.25315 2.90822C6.60745 2.67676 7.0571 2.67676 7.9565 2.67676H9.34944C10.442 2.67676 10.9882 2.67676 11.1942 3.03366C11.4003 3.39056 11.1293 3.86734 10.5872 4.82091L9.87264 6.07801C9.60317 6.55206 9.46844 6.78908 9.4703 6.9831C9.47277 7.23526 9.60684 7.46756 9.82344 7.59476C9.9901 7.69269 10.2616 7.69269 10.8048 7.69269C11.4914 7.69269 11.8347 7.69269 12.0135 7.81156C12.2458 7.96596 12.3674 8.24222 12.3248 8.51889C12.292 8.73182 12.061 8.98716 11.5992 9.49789L7.9091 13.5783C7.1843 14.3798 6.8219 14.7805 6.57855 14.6537C6.33519 14.5268 6.45206 13.9982 6.68577 12.9409L7.14364 10.8698C7.32157 10.0648 7.41057 9.66222 7.19657 9.39402C6.98257 9.12582 6.57235 9.12582 5.75193 9.12582Z",stroke:"#CA8A03",strokeLinejoin:"round"})})}function LT({className:n,...e}){return g.jsxs("svg",{width:"16",height:"17",viewBox:"0 0 16 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:F(gr.icon,n),...e,children:[g.jsx("path",{d:"M8.00016 15.3433C11.6821 15.3433 14.6668 12.3586 14.6668 8.67668C14.6668 4.99478 11.6821 2.01001 8.00016 2.01001C4.31826 2.01001 1.3335 4.99478 1.3335 8.67668C1.3335 12.3586 4.31826 15.3433 8.00016 15.3433Z",stroke:"#5046E5"}),g.jsx("path",{d:"M8 6.01001V8.67668L9.33333 10.01",stroke:"#5046E5",strokeLinecap:"round",strokeLinejoin:"round"})]})}function _T({className:n,...e}){return g.jsxs("svg",{width:"16",height:"17",viewBox:"0 0 16 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:F(gr.icon,n),...e,children:[g.jsx("path",{d:"M8.00016 15.3433C11.6821 15.3433 14.6668 12.3586 14.6668 8.67668C14.6668 4.99478 11.6821 2.01001 8.00016 2.01001C4.31826 2.01001 1.3335 4.99478 1.3335 8.67668C1.3335 12.3586 4.31826 15.3433 8.00016 15.3433Z",stroke:"#0A91B1"}),g.jsx("path",{d:"M10.6665 7.34351L11.4842 8.04831C11.828 8.34457 11.9998 8.49277 11.9998 8.67684C11.9998 8.86091 11.828 9.00911 11.4842 9.30537L10.6665 10.0102",stroke:"#0A91B1",strokeLinecap:"round",strokeLinejoin:"round"}),g.jsx("path",{d:"M5.33333 7.34351L4.51564 8.04831C4.17188 8.34457 4 8.49277 4 8.67684C4 8.86091 4.17188 9.00911 4.51564 9.30537L5.33333 10.0102",stroke:"#0A91B1",strokeLinecap:"round",strokeLinejoin:"round"}),g.jsx("path",{d:"M8.66683 6.67676L7.3335 10.6768",stroke:"#0A91B1",strokeLinecap:"round",strokeLinejoin:"round"})]})}function BT({className:n,...e}){return g.jsxs("svg",{width:"16",height:"17",viewBox:"0 0 16 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:F(gr.icon,n),...e,children:[g.jsx("path",{d:"M8.00016 15.3433C11.6821 15.3433 14.6668 12.3586 14.6668 8.67668C14.6668 4.99478 11.6821 2.01001 8.00016 2.01001C4.31826 2.01001 1.3335 4.99478 1.3335 8.67668C1.3335 12.3586 4.31826 15.3433 8.00016 15.3433Z",stroke:"#0A91B1"}),g.jsx("path",{d:"M10.6665 7.34351L11.4842 8.04831C11.828 8.34457 11.9998 8.49277 11.9998 8.67684C11.9998 8.86091 11.828 9.00911 11.4842 9.30537L10.6665 10.0102",stroke:"#0A91B1",strokeLinecap:"round",strokeLinejoin:"round"}),g.jsx("path",{d:"M5.33333 7.34351L4.51564 8.04831C4.17188 8.34457 4 8.49277 4 8.67684C4 8.86091 4.17188 9.00911 4.51564 9.30537L5.33333 10.0102",stroke:"#0A91B1",strokeLinecap:"round",strokeLinejoin:"round"}),g.jsx("path",{d:"M8.66683 6.67676L7.3335 10.6768",stroke:"#0A91B1",strokeLinecap:"round",strokeLinejoin:"round"})]})}function ZT({className:n,...e}){return g.jsxs("svg",{width:"16",height:"17",viewBox:"0 0 16 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:F(gr.icon,n),...e,children:[g.jsx("path",{d:"M5.3335 12.0103H10.6668",stroke:"#DB2877",strokeLinecap:"round",strokeLinejoin:"round"}),g.jsx("path",{d:"M5.3335 9.34326H8.00016",stroke:"#DB2877",strokeLinecap:"round",strokeLinejoin:"round"}),g.jsx("path",{d:"M8.6665 2.34359V2.67692C8.6665 4.56254 8.6665 5.50535 9.2523 6.09113C9.8381 6.67692 10.7809 6.67692 12.6665 6.67692H12.9998M13.3332 7.78152V10.0103C13.3332 12.5244 13.3332 13.7815 12.5521 14.5625C11.7711 15.3436 10.514 15.3436 7.99984 15.3436C5.48568 15.3436 4.2286 15.3436 3.44755 14.5625C2.6665 13.7815 2.6665 12.5244 2.6665 10.0103V6.98081C2.6665 4.81747 2.6665 3.73579 3.25722 3.00314C3.37656 2.85513 3.51138 2.72031 3.65939 2.60097C4.39204 2.01025 5.47372 2.01025 7.63704 2.01025C8.10744 2.01025 8.34257 2.01025 8.55797 2.08626C8.60277 2.10207 8.64664 2.12025 8.6895 2.14075C8.89557 2.23929 9.06184 2.40559 9.39444 2.73817L12.5521 5.89587C12.9375 6.28125 13.1302 6.47393 13.2317 6.71896C13.3332 6.96399 13.3332 7.23649 13.3332 7.78152Z",stroke:"#DB2877",strokeLinecap:"round",strokeLinejoin:"round"})]})}const va={columnWidth:Et.COLUMN_WIDTH,rowHeight:Et.ROW_HEIGHT,headerHeight:Et.HEADER_HEIGHT,messageNodeWidth:Et.MESSAGE_NODE_WIDTH,messageNodeHeight:Et.MESSAGE_NODE_HEIGHT,selfLoopOffset:Et.SELF_LOOP_OFFSET};function Ud(n,e=va){return e.headerHeight+n*e.rowHeight+e.rowHeight/2}function Ql(n,e,t){return`row-${n}-${e}-${t}`}const WT=Et.ROW_VERTICAL_PADDING,OO=5;function cm(n){const e=new Map;for(const t of n){if(t.source.startsWith("participant-")&&t.target.startsWith("message-")){const r=e.get(t.target)??{};e.set(t.target,{...r,from:t.source})}if(t.source.startsWith("message-")&&t.target.startsWith("participant-")){const r=e.get(t.source)??{};e.set(t.source,{...r,to:t.target})}}return e}function zT(n){const e=n.data?.componentFields;return qP(e,{componentFieldId:"name"})??n.data?.label??""}const bO=/^row-\d+-(left|right)-(source|target)$/;function ad(n,e){const t=e.get(n);return!!(t?.from&&t.from===t.to)}function Ex(n){return n.id.startsWith("message-")||n.id.startsWith("note-")}function um(n,e){const t=n.filter(Ex).sort((s,o)=>s.position.y-o.position.y),r=new Map;let i=0;for(const s of t)r.set(s.id,i),i+=ad(s.id,e)?2:1;return r}function VT(n){const e=n.filter(s=>s.id.startsWith("message-")),t=e.map(s=>s.data?.sequenceNumber).filter(s=>typeof s=="number");if(t.length===0)return new Map;const r=t[0],i=t.length>1?t[1]-t[0]:1;return new Map(e.map((s,o)=>[s.id,Number((r+o*i).toFixed(2))]))}function mc(n){const e=n.data?.sequenceBlock;if(e&&typeof e.startRow=="number"&&typeof e.endRow=="number")return e}function FT(n,e,t){const r=new Array(e+1).fill(0),i=new Array(e+1).fill(0);for(const a of n){const l=mc(a);if(l&&!(l.startRow>e-1)){r[l.startRow]+=Et.BLOCK_TOP_PADDING+Et.BLOCK_FRAME_GAP,i[Math.min(l.endRow,e-1)]+=Et.BLOCK_BOTTOM_PADDING;for(const c of(l.sections??[]).slice(1))c.startRow>e-1||(r[c.startRow]+=Et.BLOCK_SECTION_PADDING)}}const s=[];let o=Et.HEADER_HEIGHT;for(let a=0;a<e;a++)o+=r[a],s.push(o),o+=t+i[a];return{tops:s,centers:s.map(a=>a+t/2),height:o}}function DU(n,e){const t=cm(e),r=um(n,t);let i=0;for(const[s,o]of r)i=Math.max(i,o+(ad(s,t)?2:1));return i}function qT(n,e){const t=cm(e),r=um(n,t);if(r.size===0)return{nodes:n,edges:e};const i=e.map(s=>{const o=r.get(s.source),a=o??r.get(s.target);if(a===void 0)return s;const c=o!==void 0&&ad(s.source,t)?a+1:a;let d=s.sourceHandle,h=s.targetHandle,f=!1;return d&&bO.test(d)&&(d=d.replace(/^row-\d+-/,`row-${c}-`),f=f||d!==s.sourceHandle),h&&bO.test(h)&&(h=h.replace(/^row-\d+-/,`row-${c}-`),f=f||h!==s.targetHandle),f?{...s,sourceHandle:d,targetHandle:h}:s});return{nodes:n,edges:i}}function YT(n,e,t,r){return r?n+OO+va.selfLoopOffset:(n+e)/2+OO-t/2}function UT(n,e){const t=n.filter(x=>x.type==="sequenceParticipant"),r=n.filter(Ex);if(t.length===0||r.length===0)return{nodes:n,edges:e};const i=cm(e),s=new Map(t.map(x=>[x.id,x])),o=[...r].sort((x,S)=>x.position.y-S.position.y),a=new Map(o.map(x=>[x.id,H$(zT(x))])),l=Math.max(va.rowHeight,...o.map(x=>a.get(x.id).height+WT)),c=um(n,i),d=Math.max(...[...c].map(([x,S])=>S+(ad(x,i)?2:1))),h=FT(n,d,l),f=VT(o),p=o.map(x=>{const S=a.get(x.id),v=c.get(x.id),w=h.centers[v]-S.height/2,Q=i.get(x.id),P=Q?.from?s.get(Q.from):void 0,T=Q?.to?s.get(Q.to):void 0,C=P&&T?YT(P.position.x,T.position.x,S.width,Q.from===Q.to):x.position.x,R=x.id.startsWith("note-")?x.width??S.width:S.width,M=f.get(x.id);return{...x,data:M===void 0?x.data:{...x.data,sequenceNumber:M},position:{x:C,y:w},width:R,height:S.height,style:{...x.style??{},width:R,height:S.height}}}),m=new Map(p.map(x=>[x.id,x])),O=t.map(x=>({...x,data:{...x.data,rowHeight:l,rowCount:d,rowYs:h.centers,lifelineHeight:h.height}})),b=new Map(O.map(x=>[x.id,x])),y=new Map;for(const x of n){const S=mc(x);if(S){const v=Math.min(S.startRow,d-1),w=Math.min(S.endRow,d-1),Q=n.filter(R=>{const M=mc(R);return!M||R.id===x.id||(M.depth??0)<=(S.depth??0)?!1:Math.min(M.startRow,d-1)===v}).length,P=n.filter(R=>{const M=mc(R);return!M||R.id===x.id||(M.depth??0)<=(S.depth??0)?!1:Math.min(M.endRow,d-1)===w}).length,T=h.tops[v]-Et.BLOCK_TOP_PADDING*(Q+1),C=h.tops[w]+l+Et.BLOCK_BOTTOM_PADDING*(P+1);y.set(x.id,{...x,position:{...x.position,y:T},height:C-T,style:{...x.style??{},height:C-T}});continue}if(x.data?.sequenceBox){const v=h.height+Et.BOX_TOP_INSET+Et.BOX_BOTTOM_PADDING;y.set(x.id,{...x,height:v,style:{...x.style??{},height:v}})}}const k=n.map(x=>b.get(x.id)??m.get(x.id)??y.get(x.id)??x);return qT(k,e)}const GT=32;function HT(n,e){let t=n.position.x,r=n.position.y,i=n,s=0;for(;i.parentId&&s<GT;){const o=e.get(i.parentId);if(!o)break;t+=o.position.x,r+=o.position.y,i=o,s++}return{x:t,y:r}}function wa(n){return{width:n.measured?.width??n.width??0,height:n.measured?.height??n.height??0}}function qs(n,e){const{x:t,y:r}=HT(n,e),{width:i,height:s}=wa(n);return{x:t,y:r,width:i,height:s}}function yO(n){return{x:n.x+n.width/2,y:n.y+n.height/2}}function Of(n,e){const t=yO(n),r=yO(e),i=Math.abs(t.x-r.x),s=Math.abs(t.y-r.y);return i>s?t.x>r.x?ge.Left:ge.Right:t.y>r.y?ge.Top:ge.Bottom}function xO(n,e){return`${e}-${n}`}const KT=new Set([void 0,"default","straight","step","smoothstep","simplebezier"]);function Zc(n){return n.type==="sequenceParticipant"||n.id.startsWith("message-")}function jU(n,e){const t=new Map(n.map(r=>[r.id,r]));return e.map(r=>{if(r.data?.handlesLocked||!KT.has(r.type))return r;const i=t.get(r.source),s=t.get(r.target);if(!i||!s||Zc(i)||Zc(s))return r;const o=qs(i,t),a=qs(s,t),l=Of(o,a),c=Of(a,o);return{...r,sourceHandle:xO(l,"source"),targetHandle:xO(c,"target")}})}function JT(n){const e=document.querySelector(".react-flow"),t=document.querySelector(".react-flow__viewport");if(!e||!t)return fc(n);const r=new DOMMatrixReadOnly(getComputedStyle(t).transform),i=r.a;if(i===0)return fc(n);const s=e.getBoundingClientRect();let o=1/0,a=1/0,l=-1/0,c=-1/0;for(const d of e.querySelectorAll(".react-flow__node"))for(const h of[d,...d.querySelectorAll("*")]){if(h.classList.contains("react-flow__handle"))continue;const f=h.getBoundingClientRect();f.width===0&&f.height===0||(o=Math.min(o,f.left),a=Math.min(a,f.top),l=Math.max(l,f.right),c=Math.max(c,f.bottom))}return o===1/0?fc(n):{x:(o-s.left-r.e)/i,y:(a-s.top-r.f)/i,width:(l-o)/i,height:(c-a)/i}}function SO(n,e){if(typeof n=="function")return n(e);n!=null&&(n.current=e)}function e5(...n){return e=>{let t=!1;const r=n.map(i=>{const s=SO(i,e);return!t&&typeof s=="function"&&(t=!0),s});if(t)return()=>{for(let i=0;i<r.length;i++){const s=r[i];typeof s=="function"?s():SO(n[i],null)}}}}function t5(...n){return $.useCallback(e5(...n),n)}class n5 extends $.Component{getSnapshotBeforeUpdate(e){const t=this.props.childRef.current;if(Vd(t)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const r=t.offsetParent,i=Vd(r)&&r.offsetWidth||0,s=Vd(r)&&r.offsetHeight||0,o=getComputedStyle(t),a=this.props.sizeRef.current;a.height=parseFloat(o.height),a.width=parseFloat(o.width),a.top=t.offsetTop,a.left=t.offsetLeft,a.right=i-a.width-a.left,a.bottom=s-a.height-a.top,a.direction=o.direction}return null}componentDidUpdate(){}render(){return this.props.children}}function r5({children:n,isPresent:e,anchorX:t,anchorY:r,root:i,pop:s}){const o=$.useId(),a=$.useRef(null),l=$.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:"ltr"}),{nonce:c}=$.useContext(UC),d=s!==!1?n.props?.ref??n?.ref:void 0,h=t5(a,d);return $.useInsertionEffect(()=>{const{width:f,height:p,top:m,left:O,right:b,bottom:y,direction:k}=l.current;if(e||s===!1||!a.current||!f||!p)return;const x=k==="rtl",S=t==="left"?x?`right: ${b}`:`left: ${O}`:x?`left: ${O}`:`right: ${b}`,v=r==="bottom"?`bottom: ${y}`:`top: ${m}`;a.current.dataset.motionPopId=o;const w=document.createElement("style");c&&(w.nonce=c);const Q=i??document.head;return Q.appendChild(w),w.sheet&&w.sheet.insertRule(`
|
|
37
|
+
[data-motion-pop-id="${o}"] {
|
|
38
|
+
position: absolute !important;
|
|
39
|
+
width: ${f}px !important;
|
|
40
|
+
height: ${p}px !important;
|
|
41
|
+
${S}px !important;
|
|
42
|
+
${v}px !important;
|
|
43
|
+
}
|
|
44
|
+
`),()=>{a.current?.removeAttribute("data-motion-pop-id"),Q.contains(w)&&Q.removeChild(w)}},[e]),g.jsx(n5,{isPresent:e,childRef:a,sizeRef:l,pop:s,children:s===!1?n:$.cloneElement(n,{ref:h})})}const i5=({children:n,initial:e,isPresent:t,onExitComplete:r,custom:i,presenceAffectsLayout:s,mode:o,anchorX:a,anchorY:l,root:c})=>{const d=wx(s5),h=$.useId(),f=$.useRef(t),p=$.useRef(r);Qx(()=>{f.current=t,p.current=r});let m=!0,O=$.useMemo(()=>(m=!1,{id:h,initial:e,isPresent:t,custom:i,onExitComplete:b=>{d.set(b,!0);for(const y of d.values())if(!y)return;r&&r()},register:b=>(d.set(b,!1),()=>{d.delete(b),!f.current&&!d.size&&p.current?.()})}),[t,d,r]);return s&&m&&(O={...O}),$.useMemo(()=>{d.forEach((b,y)=>d.set(y,!1))},[t]),$.useEffect(()=>{!t&&!d.size&&r&&r()},[t]),n=g.jsx(r5,{pop:o==="popLayout",isPresent:t,anchorX:a,anchorY:l,root:c,children:n}),g.jsx(GC.Provider,{value:O,children:n})};function s5(){return new Map}const $l=n=>n.key||"";function kO(n){const e=[];return $.Children.forEach(n,t=>{$.isValidElement(t)&&e.push(t)}),e}const gc=({children:n,custom:e,initial:t=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:s="sync",propagate:o=!1,anchorX:a="left",anchorY:l="top",root:c})=>{const[d,h]=HC(o),f=$.useMemo(()=>kO(n),[n]),p=o&&!d?[]:f.map($l),m=$.useRef(!0),O=$.useRef(f),b=wx(()=>new Map),y=$.useRef(new Set),[k,x]=$.useState(f),[S,v]=$.useState(f);Qx(()=>{m.current=!1,O.current=f;for(let P=0;P<S.length;P++){const T=$l(S[P]);p.includes(T)?(b.delete(T),y.current.delete(T)):b.get(T)!==!0&&b.set(T,!1)}},[S,p.length,p.join("-")]);const w=[];if(f!==k){let P=[...f];for(let T=0;T<S.length;T++){const C=S[T],R=$l(C);p.includes(R)||(P.splice(T,0,C),w.push(C))}return s==="wait"&&w.length&&(P=w),v(kO(P)),x(f),null}const{forceRender:Q}=$.useContext(KC);return g.jsx(g.Fragment,{children:S.map(P=>{const T=$l(P),C=o&&!d?!1:f===S||p.includes(T),R=()=>{if(y.current.has(T))return;if(b.has(T))y.current.add(T),b.set(T,!0);else return;let M=!0;b.forEach(j=>{j||(M=!1)}),M&&(Q?.(),v(O.current),o&&h?.(),r&&r())};return g.jsx(i5,{isPresent:C,initial:!m.current||t?void 0:!1,custom:e,presenceAffectsLayout:i,mode:s,root:c,onExitComplete:C?void 0:R,anchorX:a,anchorY:l,children:P},T)})})},Nx=1024;let o5=0,$n=class{constructor(e,t){this.from=e,this.to=t}};class he{constructor(e={}){this.id=o5++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=e.combine||null}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=gn.match(e)),t=>{let r=e(t);return r===void 0?null:[this,r]}}}he.closedBy=new he({deserialize:n=>n.split(" ")});he.openedBy=new he({deserialize:n=>n.split(" ")});he.group=new he({deserialize:n=>n.split(" ")});he.isolate=new he({deserialize:n=>{if(n&&n!="rtl"&&n!="ltr"&&n!="auto")throw new RangeError("Invalid value for isolate: "+n);return n||"auto"}});he.contextHash=new he({perNode:!0});he.lookAhead=new he({perNode:!0});he.mounted=new he({perNode:!0});class Ns{constructor(e,t,r,i=!1){this.tree=e,this.overlay=t,this.parser=r,this.bracketed=i}static get(e){return e&&e.props&&e.props[he.mounted.id]}}const a5=Object.create(null);let gn=class Dx{constructor(e,t,r,i=0){this.name=e,this.props=t,this.id=r,this.flags=i}static define(e){let t=e.props&&e.props.length?Object.create(null):a5,r=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),i=new Dx(e.name||"",t,e.id,r);if(e.props){for(let s of e.props)if(Array.isArray(s)||(s=s(i)),s){if(s[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[s[0].id]=s[1]}}return i}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let t=this.prop(he.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let r in e)for(let i of r.split(" "))t[i]=e[r];return r=>{for(let i=r.prop(he.group),s=-1;s<(i?i.length:0);s++){let o=t[s<0?r.name:i[s]];if(o)return o}}}};gn.none=new gn("",Object.create(null),0,8);class dm{constructor(e){this.types=e;for(let t=0;t<e.length;t++)if(e[t].id!=t)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let t=[];for(let r of this.types){let i=null;for(let s of e){let o=s(r);if(o){i||(i=Object.assign({},r.props));let a=o[1],l=o[0];l.combine&&l.id in i&&(a=l.combine(i[l.id],a)),i[l.id]=a}}t.push(i?new gn(r.name,i,r.id,r.flags):r)}return new dm(t)}}const Cl=new WeakMap,vO=new WeakMap;var be;(function(n){n[n.ExcludeBuffers=1]="ExcludeBuffers",n[n.IncludeAnonymous=2]="IncludeAnonymous",n[n.IgnoreMounts=4]="IgnoreMounts",n[n.IgnoreOverlays=8]="IgnoreOverlays",n[n.EnterBracketed=16]="EnterBracketed"})(be||(be={}));class He{constructor(e,t,r,i,s){if(this.type=e,this.children=t,this.positions=r,this.length=i,this.props=null,s&&s.length){this.props=Object.create(null);for(let[o,a]of s)this.props[typeof o=="number"?o:o.id]=a}}toString(){let e=Ns.get(this);if(e&&!e.overlay)return e.tree.toString();let t="";for(let r of this.children){let i=r.toString();i&&(t&&(t+=","),t+=i)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(t.length?"("+t+")":""):t}cursor(e=0){return new Wc(this.topNode,e)}cursorAt(e,t=0,r=0){let i=Cl.get(this)||this.topNode,s=new Wc(i);return s.moveTo(e,t),Cl.set(this,s._tree),s}get topNode(){return new It(this,0,0,null)}resolve(e,t=0){let r=Qa(Cl.get(this)||this.topNode,e,t,!1);return Cl.set(this,r),r}resolveInner(e,t=0){let r=Qa(vO.get(this)||this.topNode,e,t,!0);return vO.set(this,r),r}resolveStack(e,t=0){return u5(this,e,t)}iterate(e){let{enter:t,leave:r,from:i=0,to:s=this.length}=e,o=e.mode||0,a=(o&be.IncludeAnonymous)>0;for(let l=this.cursor(o|be.IncludeAnonymous);;){let c=!1;if(l.from<=s&&l.to>=i&&(!a&&l.type.isAnonymous||t(l)!==!1)){if(l.firstChild())continue;c=!0}for(;c&&r&&(a||!l.type.isAnonymous)&&r(l),!l.nextSibling();){if(!l.parent())return;c=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:pm(gn.none,this.children,this.positions,0,this.children.length,0,this.length,(t,r,i)=>new He(this.type,t,r,i,this.propValues),e.makeTree||((t,r,i)=>new He(gn.none,t,r,i)))}static build(e){return d5(e)}}He.empty=new He(gn.none,[],[],0);class hm{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new hm(this.buffer,this.index)}}class gi{constructor(e,t,r){this.buffer=e,this.length=t,this.set=r}get type(){return gn.none}toString(){let e=[];for(let t=0;t<this.buffer.length;)e.push(this.childString(t)),t=this.buffer[t+3];return e.join(",")}childString(e){let t=this.buffer[e],r=this.buffer[e+3],i=this.set.types[t],s=i.name;if(/\W/.test(s)&&!i.isError&&(s=JSON.stringify(s)),e+=4,r==e)return s;let o=[];for(;e<r;)o.push(this.childString(e)),e=this.buffer[e+3];return s+"("+o.join(",")+")"}findChild(e,t,r,i,s){let{buffer:o}=this,a=-1;for(let l=e;l!=t&&!(jx(s,i,o[l+1],o[l+2])&&(a=l,r>0));l=o[l+3]);return a}slice(e,t,r){let i=this.buffer,s=new Uint16Array(t-e),o=0;for(let a=e,l=0;a<t;){s[l++]=i[a++],s[l++]=i[a++]-r;let c=s[l++]=i[a++]-r;s[l++]=i[a++]-e,o=Math.max(o,c)}return new gi(s,o,this.set)}}function jx(n,e,t,r){switch(n){case-2:return t<e;case-1:return r>=e&&t<e;case 0:return t<e&&r>e;case 1:return t<=e&&r>e;case 2:return r>e;case 4:return!0}}function Qa(n,e,t,r){for(var i;n.from==n.to||(t<1?n.from>=e:n.from>e)||(t>-1?n.to<=e:n.to<e);){let o=!r&&n instanceof It&&n.index<0?null:n.parent;if(!o)return n;n=o}let s=r?0:be.IgnoreOverlays;if(r)for(let o=n,a=o.parent;a;o=a,a=o.parent)o instanceof It&&o.index<0&&((i=a.enter(e,t,s))===null||i===void 0?void 0:i.from)!=o.from&&(n=a);for(;;){let o=n.enter(e,t,s);if(!o)return n;n=o}}class Ix{cursor(e=0){return new Wc(this,e)}getChild(e,t=null,r=null){let i=wO(this,e,t,r);return i.length?i[0]:null}getChildren(e,t=null,r=null){return wO(this,e,t,r)}resolve(e,t=0){return Qa(this,e,t,!1)}resolveInner(e,t=0){return Qa(this,e,t,!0)}matchContext(e){return bf(this.parent,e)}enterUnfinishedNodesBefore(e){let t=this.childBefore(e),r=this;for(;t;){let i=t.lastChild;if(!i||i.to!=t.to)break;i.type.isError&&i.from==i.to?(r=t,t=i.prevSibling):t=i}return r}get node(){return this}get next(){return this.parent}}class It extends Ix{constructor(e,t,r,i){super(),this._tree=e,this.from=t,this.index=r,this._parent=i}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,t,r,i,s=0){for(let o=this;;){for(let{children:a,positions:l}=o._tree,c=t>0?a.length:-1;e!=c;e+=t){let d=a[e],h=l[e]+o.from,f;if(!(!(s&be.EnterBracketed&&d instanceof He&&(f=Ns.get(d))&&!f.overlay&&f.bracketed&&r>=h&&r<=h+d.length)&&!jx(i,r,h,h+d.length))){if(d instanceof gi){if(s&be.ExcludeBuffers)continue;let p=d.findChild(0,d.buffer.length,t,r-h,i);if(p>-1)return new or(new l5(o,d,e,h),null,p)}else if(s&be.IncludeAnonymous||!d.type.isAnonymous||fm(d)){let p;if(!(s&be.IgnoreMounts)&&(p=Ns.get(d))&&!p.overlay)return new It(p.tree,h,e,o);let m=new It(d,h,e,o);return s&be.IncludeAnonymous||!m.type.isAnonymous?m:m.nextChild(t<0?d.children.length-1:0,t,r,i,s)}}}if(s&be.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?e=o.index+t:e=t<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(e,t,r=0){let i;if(!(r&be.IgnoreOverlays)&&(i=Ns.get(this._tree))&&i.overlay){let s=e-this.from,o=r&be.EnterBracketed&&i.bracketed;for(let{from:a,to:l}of i.overlay)if((t>0||o?a<=s:a<s)&&(t<0||o?l>=s:l>s))return new It(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,r)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function wO(n,e,t,r){let i=n.cursor(),s=[];if(!i.firstChild())return s;if(t!=null){for(let o=!1;!o;)if(o=i.type.is(t),!i.nextSibling())return s}for(;;){if(r!=null&&i.type.is(r))return s;if(i.type.is(e)&&s.push(i.node),!i.nextSibling())return r==null?s:[]}}function bf(n,e,t=e.length-1){for(let r=n;t>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(e[t]&&e[t]!=r.name)return!1;t--}}return!0}class l5{constructor(e,t,r,i){this.parent=e,this.buffer=t,this.index=r,this.start=i}}class or extends Ix{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,r){super(),this.context=e,this._parent=t,this.index=r,this.type=e.buffer.set.types[e.buffer.buffer[r]]}child(e,t,r){let{buffer:i}=this.context,s=i.findChild(this.index+4,i.buffer[this.index+3],e,t-this.context.start,r);return s<0?null:new or(this.context,this,s)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(e,t,r=0){if(r&be.ExcludeBuffers)return null;let{buffer:i}=this.context,s=i.findChild(this.index+4,i.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return s<0?null:new or(this.context,this,s)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new or(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new or(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:r}=this.context,i=this.index+4,s=r.buffer[this.index+3];if(s>i){let o=r.buffer[this.index+1];e.push(r.slice(i,s,o)),t.push(0)}return new He(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function Xx(n){if(!n.length)return null;let e=0,t=n[0];for(let s=1;s<n.length;s++){let o=n[s];(o.from>t.from||o.to<t.to)&&(t=o,e=s)}let r=t instanceof It&&t.index<0?null:t.parent,i=n.slice();return r?i[e]=r:i.splice(e,1),new c5(i,t)}class c5{constructor(e,t){this.heads=e,this.node=t}get next(){return Xx(this.heads)}}function u5(n,e,t){let r=n.resolveInner(e,t),i=null;for(let s=r instanceof It?r:r.context.parent;s;s=s.parent)if(s.index<0){let o=s.parent;(i||(i=[r])).push(o.resolve(e,t)),s=o}else{let o=Ns.get(s.tree);if(o&&o.overlay&&o.overlay[0].from<=e&&o.overlay[o.overlay.length-1].to>=e){let a=new It(o.tree,o.overlay[0].from+s.from,-1,s);(i||(i=[r])).push(Qa(a,e,t,!1))}}return i?Xx(i):r}class Wc{get name(){return this.type.name}constructor(e,t=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=t&~be.EnterBracketed,e instanceof It)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let r=e._parent;r;r=r._parent)this.stack.unshift(r.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:r,buffer:i}=this.buffer;return this.type=t||i.set.types[i.buffer[e]],this.from=r+i.buffer[e+1],this.to=r+i.buffer[e+2],!0}yield(e){return e?e instanceof It?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,r){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,r,this.mode));let{buffer:i}=this.buffer,s=i.findChild(this.index+4,i.buffer[this.index+3],e,t-this.buffer.start,r);return s<0?!1:(this.stack.push(this.index),this.yieldBuf(s))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,r=this.mode){return this.buffer?r&be.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&be.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&be.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,r=this.stack.length-1;if(e<0){let i=r<0?0:this.stack[r]+4;if(this.index!=i)return this.yieldBuf(t.findChild(i,this.index,-1,0,4))}else{let i=t.buffer[this.index+3];if(i<(r<0?t.buffer.length:t.buffer[this.stack[r]+3]))return this.yieldBuf(i)}return r<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,r,{buffer:i}=this;if(i){if(e>0){if(this.index<i.buffer.buffer.length)return!1}else for(let s=0;s<this.index;s++)if(i.buffer.buffer[s+3]<this.index)return!1;({index:t,parent:r}=i)}else({index:t,_parent:r}=this._tree);for(;r;{index:t,_parent:r}=r)if(t>-1)for(let s=t+e,o=e<0?-1:r._tree.children.length;s!=o;s+=e){let a=r._tree.children[s];if(this.mode&be.IncludeAnonymous||a instanceof gi||!a.type.isAnonymous||fm(a))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,t););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,t=null,r=0;if(e&&e.context==this.buffer)e:for(let i=this.index,s=this.stack.length;s>=0;){for(let o=e;o;o=o._parent)if(o.index==i){if(i==this.index)return o;t=o,r=s+1;break e}i=this.stack[--s]}for(let i=r;i<this.stack.length;i++)t=new or(this.buffer,t,this.stack[i]);return this.bufferNode=new or(this.buffer,t,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,t){for(let r=0;;){let i=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){r++;continue}this.type.isAnonymous||(i=!0)}for(;;){if(i&&t&&t(this),i=this.type.isAnonymous,!r)return;if(this.nextSibling())break;this.parent(),r--,i=!0}}}matchContext(e){if(!this.buffer)return bf(this.node.parent,e);let{buffer:t}=this.buffer,{types:r}=t.set;for(let i=e.length-1,s=this.stack.length-1;i>=0;s--){if(s<0)return bf(this._tree,e,i);let o=r[t.buffer[this.stack[s]]];if(!o.isAnonymous){if(e[i]&&e[i]!=o.name)return!1;i--}}return!0}}function fm(n){return n.children.some(e=>e instanceof gi||!e.type.isAnonymous||fm(e))}function d5(n){var e;let{buffer:t,nodeSet:r,maxBufferLength:i=Nx,reused:s=[],minRepeatType:o=r.types.length}=n,a=Array.isArray(t)?new hm(t,t.length):t,l=r.types,c=0,d=0;function h(v,w,Q,P,T,C){let{id:R,start:M,end:j,size:N}=a,I=d,L=c;if(N<0)if(a.next(),N==-1){let ie=s[R];Q.push(ie),P.push(M-v);return}else if(N==-3){c=R;return}else if(N==-4){d=R;return}else throw new RangeError(`Unrecognized record size: ${N}`);let te=l[R],le,_,re=M-v;if(j-M<=i&&(_=b(a.pos-w,T))){let ie=new Uint16Array(_.size-_.skip),pe=a.pos-_.size,Oe=ie.length;for(;a.pos>pe;)Oe=y(_.start,ie,Oe);le=new gi(ie,j-_.start,r),re=_.start-v}else{let ie=a.pos-N;a.next();let pe=[],Oe=[],U=R>=o?R:-1,de=0,Ye=j;for(;a.pos>ie;)U>=0&&a.id==U&&a.size>=0?(a.end<=Ye-i&&(m(pe,Oe,M,de,a.end,Ye,U,I,L),de=pe.length,Ye=a.end),a.next()):C>2500?f(M,ie,pe,Oe):h(M,ie,pe,Oe,U,C+1);if(U>=0&&de>0&&de<pe.length&&m(pe,Oe,M,de,M,Ye,U,I,L),pe.reverse(),Oe.reverse(),U>-1&&de>0){let ut=p(te,L);le=pm(te,pe,Oe,0,pe.length,0,j-M,ut,ut)}else le=O(te,pe,Oe,j-M,I-j,L)}Q.push(le),P.push(re)}function f(v,w,Q,P){let T=[],C=0,R=-1;for(;a.pos>w;){let{id:M,start:j,end:N,size:I}=a;if(I>4)a.next();else{if(R>-1&&j<R)break;R<0&&(R=N-i),T.push(M,j,N),C++,a.next()}}if(C){let M=new Uint16Array(C*4),j=T[T.length-2];for(let N=T.length-3,I=0;N>=0;N-=3)M[I++]=T[N],M[I++]=T[N+1]-j,M[I++]=T[N+2]-j,M[I++]=I;Q.push(new gi(M,T[2]-j,r)),P.push(j-v)}}function p(v,w){return(Q,P,T)=>{let C=0,R=Q.length-1,M,j;if(R>=0&&(M=Q[R])instanceof He){if(!R&&M.type==v&&M.length==T)return M;(j=M.prop(he.lookAhead))&&(C=P[R]+M.length+j)}return O(v,Q,P,T,C,w)}}function m(v,w,Q,P,T,C,R,M,j){let N=[],I=[];for(;v.length>P;)N.push(v.pop()),I.push(w.pop()+Q-T);v.push(O(r.types[R],N,I,C-T,M-C,j)),w.push(T-Q)}function O(v,w,Q,P,T,C,R){if(C){let M=[he.contextHash,C];R=R?[M].concat(R):[M]}if(T>25){let M=[he.lookAhead,T];R=R?[M].concat(R):[M]}return new He(v,w,Q,P,R)}function b(v,w){let Q=a.fork(),P=0,T=0,C=0,R=Q.end-i,M={size:0,start:0,skip:0};e:for(let j=Q.pos-v;Q.pos>j;){let N=Q.size;if(Q.id==w&&N>=0){M.size=P,M.start=T,M.skip=C,C+=4,P+=4,Q.next();continue}let I=Q.pos-N;if(N<0||I<j||Q.start<R)break;let L=Q.id>=o?4:0,te=Q.start;for(Q.next();Q.pos>I;){if(Q.size<0)if(Q.size==-3||Q.size==-4)L+=4;else break e;else Q.id>=o&&(L+=4);Q.next()}T=te,P+=N,C+=L}return(w<0||P==v)&&(M.size=P,M.start=T,M.skip=C),M.size>4?M:void 0}function y(v,w,Q){let{id:P,start:T,end:C,size:R}=a;if(a.next(),R>=0&&P<o){let M=Q;if(R>4){let j=a.pos-(R-4);for(;a.pos>j;)Q=y(v,w,Q)}w[--Q]=M,w[--Q]=C-v,w[--Q]=T-v,w[--Q]=P}else R==-3?c=P:R==-4&&(d=P);return Q}let k=[],x=[];for(;a.pos>0;)h(n.start||0,n.bufferStart||0,k,x,-1,0);let S=(e=n.length)!==null&&e!==void 0?e:k.length?x[0]+k[0].length:0;return new He(l[n.topID],k.reverse(),x.reverse(),S)}const QO=new WeakMap;function Oc(n,e){if(!n.isAnonymous||e instanceof gi||e.type!=n)return 1;let t=QO.get(e);if(t==null){t=1;for(let r of e.children){if(r.type!=n||!(r instanceof He)){t=1;break}t+=Oc(n,r)}QO.set(e,t)}return t}function pm(n,e,t,r,i,s,o,a,l){let c=0;for(let m=r;m<i;m++)c+=Oc(n,e[m]);let d=Math.ceil(c*1.5/8),h=[],f=[];function p(m,O,b,y,k){for(let x=b;x<y;){let S=x,v=O[x],w=Oc(n,m[x]);for(x++;x<y;x++){let Q=Oc(n,m[x]);if(w+Q>=d)break;w+=Q}if(x==S+1){if(w>d){let Q=m[S];p(Q.children,Q.positions,0,Q.children.length,O[S]+k);continue}h.push(m[S])}else{let Q=O[x-1]+m[x-1].length-v;h.push(pm(n,m,O,S,x,v,Q,null,l))}f.push(v+k-s)}}return p(e,t,r,i,0),(a||l)(h,f,o)}class mm{constructor(){this.map=new WeakMap}setBuffer(e,t,r){let i=this.map.get(e);i||this.map.set(e,i=new Map),i.set(t,r)}getBuffer(e,t){let r=this.map.get(e);return r&&r.get(t)}set(e,t){e instanceof or?this.setBuffer(e.context.buffer,e.index,t):e instanceof It&&this.map.set(e.tree,t)}get(e){return e instanceof or?this.getBuffer(e.context.buffer,e.index):e instanceof It?this.map.get(e.tree):void 0}cursorSet(e,t){e.buffer?this.setBuffer(e.buffer.buffer,e.index,t):this.map.set(e.tree,t)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class Ir{constructor(e,t,r,i,s=!1,o=!1){this.from=e,this.to=t,this.tree=r,this.offset=i,this.open=(s?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,t=[],r=!1){let i=[new Ir(0,e.length,e,0,!1,r)];for(let s of t)s.to>e.length&&i.push(s);return i}static applyChanges(e,t,r=128){if(!t.length)return e;let i=[],s=1,o=e.length?e[0]:null;for(let a=0,l=0,c=0;;a++){let d=a<t.length?t[a]:null,h=d?d.fromA:1e9;if(h-l>=r)for(;o&&o.from<h;){let f=o;if(l>=f.from||h<=f.to||c){let p=Math.max(f.from,l)-c,m=Math.min(f.to,h)-c;f=p>=m?null:new Ir(p,m,f.tree,f.offset+c,a>0,!!d)}if(f&&i.push(f),o.to>h)break;o=s<e.length?e[s++]:null}if(!d)break;l=d.toA,c=d.toA-d.toB}return i}}class Lx{startParse(e,t,r){return typeof e=="string"&&(e=new h5(e)),r=r?r.length?r.map(i=>new $n(i.from,i.to)):[new $n(0,0)]:[new $n(0,e.length)],this.createParse(e,t||[],r)}parse(e,t,r){let i=this.startParse(e,t,r);for(;;){let s=i.advance();if(s)return s}}}class h5{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}function f5(n){return(e,t,r,i)=>new m5(e,n,t,r,i)}class $O{constructor(e,t,r,i,s,o){this.parser=e,this.parse=t,this.overlay=r,this.bracketed=i,this.target=s,this.from=o}}function CO(n){if(!n.length||n.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(n))}class p5{constructor(e,t,r,i,s,o,a,l){this.parser=e,this.predicate=t,this.mounts=r,this.index=i,this.start=s,this.bracketed=o,this.target=a,this.prev=l,this.depth=0,this.ranges=[]}}const yf=new he({perNode:!0});class m5{constructor(e,t,r,i,s){this.nest=t,this.input=r,this.fragments=i,this.ranges=s,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let r=this.baseParse.advance();if(!r)return null;if(this.baseParse=null,this.baseTree=r,this.startInner(),this.stoppedAt!=null)for(let i of this.inner)i.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let r=this.baseTree;return this.stoppedAt!=null&&(r=new He(r.type,r.children,r.positions,r.length,r.propValues.concat([[yf,this.stoppedAt]]))),r}let e=this.inner[this.innerDone],t=e.parse.advance();if(t){this.innerDone++;let r=Object.assign(Object.create(null),e.target.props);r[he.mounted.id]=new Ns(t,e.overlay,e.parser,e.bracketed),e.target.props=r}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let t=this.innerDone;t<this.inner.length;t++)this.inner[t].from<e&&(e=Math.min(e,this.inner[t].parse.parsedPos));return e}stopAt(e){if(this.stoppedAt=e,this.baseParse)this.baseParse.stopAt(e);else for(let t=this.innerDone;t<this.inner.length;t++)this.inner[t].parse.stopAt(e)}startInner(){let e=new b5(this.fragments),t=null,r=null,i=new Wc(new It(this.baseTree,this.ranges[0].from,0,null),be.IncludeAnonymous|be.IgnoreMounts);e:for(let s,o;;){let a=!0,l;if(this.stoppedAt!=null&&i.from>=this.stoppedAt)a=!1;else if(e.hasNode(i)){if(t){let c=t.mounts.find(d=>d.frag.from<=i.from&&d.frag.to>=i.to&&d.mount.overlay);if(c)for(let d of c.mount.overlay){let h=d.from+c.pos,f=d.to+c.pos;h>=i.from&&f<=i.to&&!t.ranges.some(p=>p.from<f&&p.to>h)&&t.ranges.push({from:h,to:f})}}a=!1}else if(r&&(o=g5(r.ranges,i.from,i.to)))a=o!=2;else if(!i.type.isAnonymous&&(s=this.nest(i,this.input))&&(i.from<i.to||!s.overlay)){i.tree||(O5(i),t&&t.depth++,r&&r.depth++);let c=e.findMounts(i.from,s.parser);if(typeof s.overlay=="function")t=new p5(s.parser,s.overlay,c,this.inner.length,i.from,!!s.bracketed,i.tree,t);else{let d=MO(this.ranges,s.overlay||(i.from<i.to?[new $n(i.from,i.to)]:[]));d.length&&CO(d),(d.length||!s.overlay)&&this.inner.push(new $O(s.parser,d.length?s.parser.startParse(this.input,AO(c,d),d):s.parser.startParse(""),s.overlay?s.overlay.map(h=>new $n(h.from-i.from,h.to-i.from)):null,!!s.bracketed,i.tree,d.length?d[0].from:i.from)),s.overlay?d.length&&(r={ranges:d,depth:0,prev:r}):a=!1}}else if(t&&(l=t.predicate(i))&&(l===!0&&(l=new $n(i.from,i.to)),l.from<l.to)){let c=t.ranges.length-1;c>=0&&t.ranges[c].to==l.from?t.ranges[c]={from:t.ranges[c].from,to:l.to}:t.ranges.push(l)}if(a&&i.firstChild())t&&t.depth++,r&&r.depth++;else for(;!i.nextSibling();){if(!i.parent())break e;if(t&&!--t.depth){let c=MO(this.ranges,t.ranges);c.length&&(CO(c),this.inner.splice(t.index,0,new $O(t.parser,t.parser.startParse(this.input,AO(t.mounts,c),c),t.ranges.map(d=>new $n(d.from-t.start,d.to-t.start)),t.bracketed,t.target,c[0].from))),t=t.prev}r&&!--r.depth&&(r=r.prev)}}}}function g5(n,e,t){for(let r of n){if(r.from>=t)break;if(r.to>e)return r.from<=e&&r.to>=t?2:1}return 0}function PO(n,e,t,r,i,s){if(e<t){let o=n.buffer[e+1];r.push(n.slice(e,t,o)),i.push(o-s)}}function O5(n){let{node:e}=n,t=[],r=e.context.buffer;do t.push(n.index),n.parent();while(!n.tree);let i=n.tree,s=i.children.indexOf(r),o=i.children[s],a=o.buffer,l=[s];function c(d,h,f,p,m,O){let b=t[O],y=[],k=[];PO(o,d,b,y,k,p);let x=a[b+1],S=a[b+2];l.push(y.length);let v=O?c(b+4,a[b+3],o.set.types[a[b]],x,S-x,O-1):e.toTree();return y.push(v),k.push(x-p),PO(o,a[b+3],h,y,k,p),new He(f,y,k,m)}i.children[s]=c(0,a.length,gn.none,0,o.length,t.length-1);for(let d of l){let h=n.tree.children[d],f=n.tree.positions[d];n.yield(new It(h,f+n.from,d,n._tree))}}class TO{constructor(e,t){this.offset=t,this.done=!1,this.cursor=e.cursor(be.IncludeAnonymous|be.IgnoreMounts|be.ExcludeBuffers)}moveTo(e){let{cursor:t}=this,r=e-this.offset;for(;!this.done&&t.from<r;)if(!(t.to>=r&&t.enter(r,1,be.IncludeAnonymous|be.IgnoreOverlays|be.ExcludeBuffers)))if(t.to<=r)t.next(!1)||(this.done=!0);else break}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let t=this.cursor.tree;;){if(t==e.tree)return!0;if(t.children.length&&t.positions[0]==0&&t.children[0]instanceof He)t=t.children[0];else break}return!1}}let b5=class{constructor(e){var t;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let r=this.curFrag=e[0];this.curTo=(t=r.tree.prop(yf))!==null&&t!==void 0?t:r.to,this.inner=new TO(r.tree,-r.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let t=this.curFrag=this.fragments[this.fragI];this.curTo=(e=t.tree.prop(yf))!==null&&e!==void 0?e:t.to,this.inner=new TO(t.tree,-t.offset)}}findMounts(e,t){var r;let i=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let s=this.inner.cursor.node;s;s=s.parent){let o=(r=s.tree)===null||r===void 0?void 0:r.prop(he.mounted);if(o&&o.parser==t)for(let a=this.fragI;a<this.fragments.length;a++){let l=this.fragments[a];if(l.from>=s.to)break;l.tree==this.curFrag.tree&&i.push({frag:l,pos:s.from-l.offset,mount:o})}}}return i}};function MO(n,e){let t=null,r=e;for(let i=1,s=0;i<n.length;i++){let o=n[i-1].to,a=n[i].from;for(;s<r.length;s++){let l=r[s];if(l.from>=a)break;l.to<=o||(t||(r=t=e.slice()),l.from<o?(t[s]=new $n(l.from,o),l.to>a&&t.splice(s+1,0,new $n(a,l.to))):l.to>a?t[s--]=new $n(a,l.to):t.splice(s--,1))}}return r}function y5(n,e,t,r){let i=0,s=0,o=!1,a=!1,l=-1e9,c=[];for(;;){let d=i==n.length?1e9:o?n[i].to:n[i].from,h=s==e.length?1e9:a?e[s].to:e[s].from;if(o!=a){let f=Math.max(l,t),p=Math.min(d,h,r);f<p&&c.push(new $n(f,p))}if(l=Math.min(d,h),l==1e9)break;d==l&&(o?(o=!1,i++):o=!0),h==l&&(a?(a=!1,s++):a=!0)}return c}function AO(n,e){let t=[];for(let{pos:r,mount:i,frag:s}of n){let o=r+(i.overlay?i.overlay[0].from:0),a=o+i.tree.length,l=Math.max(s.from,o),c=Math.min(s.to,a);if(i.overlay){let d=i.overlay.map(f=>new $n(f.from+r,f.to+r)),h=y5(e,d,l,c);for(let f=0,p=l;;f++){let m=f==h.length,O=m?c:h[f].from;if(O>p&&t.push(new Ir(p,O,i.tree,-o,s.from>=p||s.openStart,s.to<=O||s.openEnd)),m)break;p=h[f].to}}else t.push(new Ir(l,c,i.tree,-o,s.from>=o||s.openStart,s.to<=a||s.openEnd))}return t}var RO={};class zc{constructor(e,t,r,i,s,o,a,l,c,d=0,h){this.p=e,this.stack=t,this.state=r,this.reducePos=i,this.pos=s,this.score=o,this.buffer=a,this.bufferBase=l,this.curContext=c,this.lookAhead=d,this.parent=h}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,r=0){let i=e.parser.context;return new zc(e,[],t,r,r,0,[],0,i?new EO(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var t;let r=e>>19,i=e&65535,{parser:s}=this.p,o=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),a=s.dynamicPrecedence(i);if(a&&(this.score+=a),r==0){i<s.minRepeatTerm&&this.reducePos<this.pos&&(this.reducePos=this.pos),this.pushState(s.getGoto(this.state,i,!0),this.reducePos),i<s.minRepeatTerm&&this.storeNode(i,this.reducePos,this.reducePos,o?8:4,!0),this.reduceContext(i,this.reducePos);return}let l=this.stack.length-(r-1)*3-(e&262144?6:0),c=l?this.stack[l-2]:this.p.ranges[0].from;i<s.minRepeatTerm&&c==this.reducePos&&this.reducePos<this.pos&&(this.reducePos=this.pos);let d=this.reducePos-c;d>=2e3&&!(!((t=this.p.parser.nodeSet.types[i])===null||t===void 0)&&t.isAnonymous)&&(c==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=d):this.p.lastBigReductionSize<d&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=c,this.p.lastBigReductionSize=d));let h=l?this.stack[l-1]:0,f=this.bufferBase+this.buffer.length-h;if(i<s.minRepeatTerm||e&131072){let p=s.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(i,c,p,f+4,!0)}if(e&262144)this.state=this.stack[l];else{let p=this.stack[l-3];this.state=s.getGoto(p,i,!0)}for(;this.stack.length>l;)this.stack.pop();this.reduceContext(i,c)}storeNode(e,t,r,i=4,s=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let o=this.buffer.length;if(o>0&&this.buffer[o-4]==0&&this.buffer[o-1]>-1){if(t==r)return;if(this.buffer[o-2]>=t){this.buffer[o-2]=r;return}}}if(!s||this.pos==r)this.buffer.push(e,t,r,i);else{let o=this.buffer.length;if(o>0&&(this.buffer[o-4]!=0||this.buffer[o-1]<0)){let a=!1;for(let l=o;l>0&&this.buffer[l-2]>r;l-=4)if(this.buffer[l-1]>=0){a=!0;break}if(a)for(;o>0&&this.buffer[o-2]>r;)this.buffer[o]=this.buffer[o-4],this.buffer[o+1]=this.buffer[o-3],this.buffer[o+2]=this.buffer[o-2],this.buffer[o+3]=this.buffer[o-1],o-=4,i>4&&(i-=4)}this.buffer[o]=e,this.buffer[o+1]=t,this.buffer[o+2]=r,this.buffer[o+3]=i}}shift(e,t,r,i){if(e&131072)this.pushState(e&65535,this.pos);else if((e&262144)==0){let s=e,{parser:o}=this.p;this.pos=i;let a=o.stateFlag(s,1);!a&&(i>r||t<=o.maxNode)&&(this.reducePos=i),this.pushState(s,a?r:Math.min(r,this.reducePos)),this.shiftContext(t,r),t<=o.maxNode&&this.buffer.push(t,r,i,4)}else this.pos=i,this.shiftContext(t,r),t<=this.p.parser.maxNode&&this.buffer.push(t,r,i,4)}apply(e,t,r,i){e&65536?this.reduce(e):this.shift(e,t,r,i)}useNode(e,t,r){let i=this.p.reused.length-1;(i<0||this.p.reused[i]!=e)&&(this.p.reused.push(e),i++);let s=this.reducePos=this.pos=r+e.length;this.pushState(t,r),this.buffer.push(i,r,s,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,t=e.buffer.length;for(t&&e.buffer[t-4]==0&&(t-=4);t>0&&e.buffer[t-2]>e.reducePos;)t-=4;let r=e.buffer.slice(t),i=e.bufferBase+t;for(;e&&i==e.bufferBase;)e=e.parent;return new zc(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,i,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let r=e<=this.p.parser.maxNode;r&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,r?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new x5(this);;){let r=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(r==0)return!1;if((r&65536)==0)return!0;t.reduce(r)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let i=[];for(let s=0,o;s<t.length;s+=2)(o=t[s+1])!=this.state&&this.p.parser.hasAction(o,e)&&i.push(t[s],o);if(this.stack.length<120)for(let s=0;i.length<8&&s<t.length;s+=2){let o=t[s+1];i.some((a,l)=>l&1&&a==o)||i.push(t[s],o)}t=i}let r=[];for(let i=0;i<t.length&&r.length<4;i+=2){let s=t[i+1];if(s==this.state)continue;let o=this.split();o.pushState(s,this.pos),o.storeNode(0,o.pos,o.pos,4,!0),o.shiftContext(t[i],this.pos),o.reducePos=this.pos,o.score-=200,r.push(o)}return r}forceReduce(){let{parser:e}=this.p,t=e.stateSlot(this.state,5);if((t&65536)==0)return!1;if(!e.validAction(this.state,t)){let r=t>>19,i=t&65535,s=this.stack.length-r*3;if(s<0||e.getGoto(this.stack[s],i,!1)<0){let o=this.findForcedReduction();if(o==null)return!1;t=o}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],r=(i,s)=>{if(!t.includes(i))return t.push(i),e.allActions(i,o=>{if(!(o&393216))if(o&65536){let a=(o>>19)-s;if(a>1){let l=o&65535,c=this.stack.length-a*3;if(c>=0&&e.getGoto(this.stack[c],l,!1)>=0)return a<<19|65536|l}}else{let a=r(o,s+1);if(a!=null)return a}})};return r(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;t<this.stack.length;t+=3)if(this.stack[t]!=e.stack[t])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(t)))}reduceContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(t)))}emitContext(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-3)&&this.storeNode(this.curContext.hash,this.reducePos,this.reducePos,-3,!0)}emitLookAhead(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let t=new EO(this.curContext.tracker,e);t.hash!=this.curContext.hash&&this.emitContext(),this.curContext=t}}setLookAhead(e){return e<=this.lookAhead?!1:(this.emitLookAhead(),this.lookAhead=e,!0)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class EO{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}}class x5{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e&65535,r=e>>19;r==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(r-1)*3;let i=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=i}}class Vc{constructor(e,t,r){this.stack=e,this.pos=t,this.index=r,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new Vc(e,t,t-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new Vc(this.stack,this.pos,this.index)}}function _o(n,e=Uint16Array){if(typeof n!="string")return n;let t=null;for(let r=0,i=0;r<n.length;){let s=0;for(;;){let o=n.charCodeAt(r++),a=!1;if(o==126){s=65535;break}o>=92&&o--,o>=34&&o--;let l=o-32;if(l>=46&&(l-=46,a=!0),s+=l,a)break;s*=46}t?t[i++]=s:t=new e(s)}return t}class bc{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const NO=new bc;class S5{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=NO,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let r=this.range,i=this.rangeIndex,s=this.pos+e;for(;s<r.from;){if(!i)return null;let o=this.ranges[--i];s-=r.from-o.to,r=o}for(;t<0?s>r.to:s>=r.to;){if(i==this.ranges.length-1)return null;let o=this.ranges[++i];s+=o.from-r.to,r=o}return s}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let t of this.ranges)if(t.to>e)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,r,i;if(t>=0&&t<this.chunk.length)r=this.pos+e,i=this.chunk.charCodeAt(t);else{let s=this.resolveOffset(e,1);if(s==null)return-1;if(r=s,r>=this.chunk2Pos&&r<this.chunk2Pos+this.chunk2.length)i=this.chunk2.charCodeAt(r-this.chunk2Pos);else{let o=this.rangeIndex,a=this.range;for(;a.to<=r;)a=this.ranges[++o];this.chunk2=this.input.chunk(this.chunk2Pos=r),r+this.chunk2.length>a.to&&(this.chunk2=this.chunk2.slice(0,a.to-r)),i=this.chunk2.charCodeAt(0)}}return r>=this.token.lookAhead&&(this.token.lookAhead=r+1),i}acceptToken(e,t=0){let r=t?this.resolveOffset(t,-1):this.pos;if(r==null||r<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=e,this.token.end=r}acceptTokenTo(e,t){this.token.value=e,this.token.end=t}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:t}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=t,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),t=this.pos+e.length;this.chunk=t>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=NO,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(e,t){if(e>=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let r="";for(let i of this.ranges){if(i.from>=t)break;i.to>e&&(r+=this.input.read(Math.max(i.from,e),Math.min(i.to,t)))}return r}}class Ds{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:r}=t.p;_x(this.data,e,t,this.id,r.data,r.tokenPrecTable)}}Ds.prototype.contextual=Ds.prototype.fallback=Ds.prototype.extend=!1;class $a{constructor(e,t,r){this.precTable=t,this.elseToken=r,this.data=typeof e=="string"?_o(e):e}token(e,t){let r=e.pos,i=0;for(;;){let s=e.next<0,o=e.resolveOffset(1,1);if(_x(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(s||i++,o==null)break;e.reset(o,e.token)}i&&(e.reset(r,e.token),e.acceptToken(this.elseToken,i))}}$a.prototype.contextual=Ds.prototype.fallback=Ds.prototype.extend=!1;class rn{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}}function _x(n,e,t,r,i,s){let o=0,a=1<<r,{dialect:l}=t.p.parser;e:for(;(a&n[o])!=0;){let c=n[o+1];for(let p=o+3;p<c;p+=2)if((n[p+1]&a)>0){let m=n[p];if(l.allows(m)&&(e.token.value==-1||e.token.value==m||k5(m,e.token.value,i,s))){e.acceptToken(m);break}}let d=e.next,h=0,f=n[o+2];if(e.next<0&&f>h&&n[c+f*3-3]==65535){o=n[c+f*3-1];continue e}for(;h<f;){let p=h+f>>1,m=c+p+(p<<1),O=n[m],b=n[m+1]||65536;if(d<O)f=p;else if(d>=b)h=p+1;else{o=n[m+2],e.advance();continue e}}break}}function DO(n,e,t){for(let r=e,i;(i=n[r])!=65535;r++)if(i==t)return r-e;return-1}function k5(n,e,t,r){let i=DO(t,r,e);return i<0||DO(t,r,n)<i}const an=typeof process<"u"&&RO&&/\bparse\b/.test(RO.LOG);let Gd=null;function jO(n,e,t){let r=n.cursor(be.IncludeAnonymous);for(r.moveTo(e);;)if(!(t<0?r.childBefore(e):r.childAfter(e)))for(;;){if((t<0?r.to<e:r.from>e)&&!r.type.isError)return t<0?Math.max(0,Math.min(r.to-1,e-25)):Math.min(n.length,Math.max(r.from+1,e+25));if(t<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return t<0?0:n.length}}class v5{constructor(e,t){this.fragments=e,this.minRepeat=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.lastRepeat=null,this.lastRepeatPos=-1,this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?jO(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?jO(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let t=this.trees.length-1;if(t<0)return this.nextFragment(),null;let r=this.trees[t],i=this.index[t];if(i==r.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let s=r.children[i],o=this.start[t]+r.positions[i];if(o>e)return this.nextStart=o,null;if(s instanceof He){let a=o>this.lastRepeatPos&&s.type.id>=this.minRepeat;if(o==e||a){let l=o+s.length,c;if(o>=this.safeFrom&&l<=this.safeTo&&(!(c=s.prop(he.lookAhead))||l+c<this.fragment.to)){if(a&&(this.lastRepeat=s,this.lastRepeatPos=o),o==e)return s}else if(o==e)return null}this.index[t]++,o+s.length>=Math.max(this.safeFrom,e)&&(this.trees.push(s),this.start.push(o),this.index.push(0))}else this.index[t]++,this.nextStart=o+s.length}}}class w5{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(r=>new bc)}getActions(e){let t=0,r=null,{parser:i}=e.p,{tokenizers:s}=i,o=i.stateSlot(e.state,3),a=e.curContext?e.curContext.hash:0,l=0;for(let c=0;c<s.length;c++){if((1<<c&o)==0)continue;let d=s[c],h=this.tokens[c];if(!(r&&!d.fallback)&&((d.contextual||h.start!=e.pos||h.mask!=o||h.context!=a)&&(this.updateCachedToken(h,d,e),h.mask=o,h.context=a),h.lookAhead>h.end+25&&(l=Math.max(h.lookAhead,l)),h.value!=0)){let f=t;if(h.extended>-1&&(t=this.addActions(e,h.extended,h.end,t)),t=this.addActions(e,h.value,h.end,t),!d.extend&&(r=h,t>f))break}}for(;this.actions.length>t;)this.actions.pop();return l&&e.setLookAhead(l),!r&&e.pos==this.stream.end&&(r=new bc,r.value=e.p.parser.eofTerm,r.start=r.end=e.pos,t=this.addActions(e,r.value,r.end,t)),this.mainToken=r,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new bc,{pos:r,p:i}=e;return t.start=r,t.end=Math.min(r+1,i.stream.end),t.value=r==i.stream.end?i.parser.eofTerm:0,t}updateCachedToken(e,t,r){let i=this.stream.clipPos(r.pos);if(t.token(this.stream.reset(i,e),r),e.value>-1){let{parser:s}=r.p;for(let o=0;o<s.specialized.length;o++)if(s.specialized[o]==e.value){let a=s.specializers[o](this.stream.read(e.start,e.end),r);if(a>=0&&r.p.parser.dialect.allows(a>>1)){(a&1)==0?e.value=a>>1:e.extended=a>>1;break}}}else e.value=0,e.end=this.stream.clipPos(i+1)}putAction(e,t,r,i){for(let s=0;s<i;s+=3)if(this.actions[s]==e)return i;return this.actions[i++]=e,this.actions[i++]=t,this.actions[i++]=r,i}addActions(e,t,r,i){let{state:s}=e,{parser:o}=e.p,{data:a}=o;for(let l=0;l<2;l++)for(let c=o.stateSlot(s,l?2:1);;c+=3){if(a[c]==65535)if(a[c+1]==1)c=Pr(a,c+2);else{i==0&&a[c+1]==2&&(i=this.putAction(Pr(a,c+2),t,r,i));break}a[c]==t&&(i=this.putAction(Pr(a,c+1),t,r,i))}return i}}class Q5{constructor(e,t,r,i){this.parser=e,this.input=t,this.ranges=i,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new S5(t,i),this.tokens=new w5(e,this.stream),this.topTerm=e.top[1];let{from:s}=i[0];this.stacks=[zc.start(this,e.top[0],s)],this.fragments=r.length&&this.stream.end-s>e.bufferLength*4?new v5(r,e.minRepeatTerm):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,r=this.stacks=[],i,s;if(this.bigReductionCount>300&&e.length==1){let[o]=e;for(;o.forceReduce()&&o.stack.length&&o.stack[o.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let o=0;o<e.length;o++){let a=e[o];for(;;){if(this.tokens.mainToken=null,a.pos>t)r.push(a);else{if(this.advanceStack(a,r,e))continue;{i||(i=[],s=[]),i.push(a);let l=this.tokens.getMainToken(a);s.push(l.value,l.end)}}break}}if(!r.length){let o=i&&C5(i);if(o)return an&&console.log("Finish with "+this.stackID(o)),this.stackToTree(o);if(this.parser.strict)throw an&&i&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+t);this.recovering||(this.recovering=5)}if(this.recovering&&i){let o=this.stoppedAt!=null&&i[0].pos>this.stoppedAt?i[0]:this.runRecovery(i,s,r);if(o)return an&&console.log("Force-finish "+this.stackID(o)),this.stackToTree(o.forceAll())}if(this.recovering){let o=this.recovering==1?1:this.recovering*3;if(r.length>o)for(r.sort((a,l)=>l.score-a.score);r.length>o;)r.pop();r.some(a=>a.reducePos>t)&&this.recovering--}else if(r.length>1){e:for(let o=0;o<r.length-1;o++){let a=r[o];for(let l=o+1;l<r.length;l++){let c=r[l];if(a.sameState(c)||a.buffer.length>500&&c.buffer.length>500)if((a.score-c.score||a.buffer.length-c.buffer.length)>0)r.splice(l--,1);else{r.splice(o--,1);continue e}}}r.length>12&&(r.sort((o,a)=>a.score-o.score),r.splice(12,r.length-12))}this.minStackPos=r[0].pos;for(let o=1;o<r.length;o++)r[o].pos<this.minStackPos&&(this.minStackPos=r[o].pos);return null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}tryReuse(e,t,r,i){if(!r)return null;let s=e.curContext&&e.curContext.tracker.strict,o=s?e.curContext.hash:0;for(;r;){let a=this.parser.nodeSet.types[r.type.id]!=r.type?-1:this.parser.getGoto(e.state,r.type.id);if(a>-1&&r.length&&(!s||(r.prop(he.contextHash)||0)==o))return e.useNode(r,a,t),r;if(r.children.length==0||r.positions[0]>0)break;let l=r.children[0];if(l instanceof He&&(!i||l.type.id>=this.parser.minRepeatTerm))r=l;else break}return null}advanceStack(e,t,r){let i=e.pos,{parser:s}=this,o=an?this.stackID(e)+" -> ":"";if(this.stoppedAt!=null&&i>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let c=e.reducePos<i&&e.buffer.length&&e.buffer[e.buffer.length-2]<=e.reducePos&&this.fragments.lastRepeatPos==e.reducePos&&this.tryReuse(e,e.reducePos,this.fragments.lastRepeat,!0)||this.tryReuse(e,i,this.fragments.nodeAt(i),!1);if(c)return an&&console.log(o+this.stackID(e)+` (via reuse of ${s.getName(c.type.id)})`),!0}let a=s.stateSlot(e.state,4);if(a>0)return e.reduce(a),an&&console.log(o+this.stackID(e)+` (via always-reduce ${s.getName(a&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let l=this.tokens.getActions(e);for(let c=0;c<l.length;){let d=l[c++],h=l[c++],f=l[c++],p=c==l.length||!r,m=p?e:e.split(),O=this.tokens.mainToken;if(m.apply(d,h,O?O.start:m.pos,f),an&&console.log(o+this.stackID(m)+` (via ${(d&65536)==0?"shift":`reduce of ${s.getName(d&65535)}`} for ${s.getName(h)} @ ${i}${m==e?"":", split"})`),p)return!0;m.pos>i?t.push(m):r.push(m)}return!1}advanceFully(e,t){let r=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>r)return IO(e,t),!0}}runRecovery(e,t,r){let i=null,s=!1;for(let o=0;o<e.length;o++){let a=e[o],l=t[o<<1],c=t[(o<<1)+1],d=an?this.stackID(a)+" -> ":"";if(a.deadEnd&&(s||(s=!0,a.restart(),an&&console.log(d+this.stackID(a)+" (restarted)"),this.advanceFully(a,r))))continue;let h=a.split(),f=d;for(let p=0;p<10&&h.forceReduce()&&(an&&console.log(f+this.stackID(h)+" (via force-reduce)"),!this.advanceFully(h,r));p++)an&&(f=this.stackID(h)+" -> ");for(let p of a.recoverByInsert(l))an&&console.log(d+this.stackID(p)+" (via recover-insert)"),this.advanceFully(p,r);this.stream.end>a.pos?(c==a.pos&&(c++,l=0),a.recoverByDelete(l,c),an&&console.log(d+this.stackID(a)+` (via recover-delete ${this.parser.getName(l)})`),IO(a,r)):(!i||i.score<h.score)&&(i=h)}return i}stackToTree(e){return e.close(),He.build({buffer:Vc.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let t=(Gd||(Gd=new WeakMap)).get(e);return t||Gd.set(e,t=String.fromCodePoint(this.nextStackID++)),t+e}}function IO(n,e){for(let t=0;t<e.length;t++){let r=e[t];if(r.pos==n.pos&&r.sameState(n)){e[t].score<n.score&&(e[t]=n);return}}e.push(n)}class $5{constructor(e,t,r){this.source=e,this.flags=t,this.disabled=r}allows(e){return!this.disabled||this.disabled[e]==0}}const Hd=n=>n;class gm{constructor(e){this.start=e.start,this.shift=e.shift||Hd,this.reduce=e.reduce||Hd,this.reuse=e.reuse||Hd,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class Ki extends Lx{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let a=0;a<e.repeatNodeCount;a++)t.push("");let r=Object.keys(e.topRules).map(a=>e.topRules[a][1]),i=[];for(let a=0;a<t.length;a++)i.push([]);function s(a,l,c){i[a].push([l,l.deserialize(String(c))])}if(e.nodeProps)for(let a of e.nodeProps){let l=a[0];typeof l=="string"&&(l=he[l]);for(let c=1;c<a.length;){let d=a[c++];if(d>=0)s(d,l,a[c++]);else{let h=a[c+-d];for(let f=-d;f>0;f--)s(a[c++],l,h);c++}}}this.nodeSet=new dm(t.map((a,l)=>gn.define({name:l>=this.minRepeatTerm?void 0:a,id:l,props:i[l],top:r.indexOf(l)>-1,error:l==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(l)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=Nx;let o=_o(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let a=0;a<this.specializerSpecs.length;a++)this.specialized[a]=this.specializerSpecs[a].term;this.specializers=this.specializerSpecs.map(XO),this.states=_o(e.states,Uint32Array),this.data=_o(e.stateData),this.goto=_o(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(a=>typeof a=="number"?new Ds(o,a):a),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,r){let i=new Q5(this,e,t,r);for(let s of this.wrappers)i=s(i,e,t,r);return i}getGoto(e,t,r=!1){let i=this.goto;if(t>=i[0])return-1;for(let s=i[t+1];;){let o=i[s++],a=o&1,l=i[s++];if(a&&r)return l;for(let c=s+(o>>1);s<c;s++)if(i[s]==e)return l;if(a)return-1}}hasAction(e,t){let r=this.data;for(let i=0;i<2;i++)for(let s=this.stateSlot(e,i?2:1),o;;s+=3){if((o=r[s])==65535)if(r[s+1]==1)o=r[s=Pr(r,s+2)];else{if(r[s+1]==2)return Pr(r,s+2);break}if(o==t||o==0)return Pr(r,s+1)}return 0}stateSlot(e,t){return this.states[e*6+t]}stateFlag(e,t){return(this.stateSlot(e,0)&t)>0}validAction(e,t){return!!this.allActions(e,r=>r==t?!0:null)}allActions(e,t){let r=this.stateSlot(e,4),i=r?t(r):void 0;for(let s=this.stateSlot(e,1);i==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=Pr(this.data,s+2);else break;i=t(Pr(this.data,s+1))}return i}nextStates(e){let t=[];for(let r=this.stateSlot(e,1);;r+=3){if(this.data[r]==65535)if(this.data[r+1]==1)r=Pr(this.data,r+2);else break;if((this.data[r+2]&1)==0){let i=this.data[r+1];t.some((s,o)=>o&1&&s==i)||t.push(this.data[r],i)}}return t}configure(e){let t=Object.assign(Object.create(Ki.prototype),this);if(e.props&&(t.nodeSet=this.nodeSet.extend(...e.props)),e.top){let r=this.topRules[e.top];if(!r)throw new RangeError(`Invalid top rule name ${e.top}`);t.top=r}return e.tokenizers&&(t.tokenizers=this.tokenizers.map(r=>{let i=e.tokenizers.find(s=>s.from==r);return i?i.to:r})),e.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map((r,i)=>{let s=e.specializers.find(a=>a.from==r.external);if(!s)return r;let o=Object.assign(Object.assign({},r),{external:s.to});return t.specializers[i]=XO(o),o})),e.contextTracker&&(t.context=e.contextTracker),e.dialect&&(t.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(t.strict=e.strict),e.wrap&&(t.wrappers=t.wrappers.concat(e.wrap)),e.bufferLength!=null&&(t.bufferLength=e.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return t==null?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),r=t.map(()=>!1);if(e)for(let s of e.split(" ")){let o=t.indexOf(s);o>=0&&(r[o]=!0)}let i=null;for(let s=0;s<t.length;s++)if(!r[s])for(let o=this.dialects[t[s]],a;(a=this.data[o++])!=65535;)(i||(i=new Uint8Array(this.maxTerm+1)))[a]=1;return new $5(e,r,i)}static deserialize(e){return new Ki(e)}}function Pr(n,e){return n[e]|n[e+1]<<16}function C5(n){let e=null;for(let t of n){let r=t.p.stoppedAt;(t.pos==t.p.stream.end||r!=null&&t.pos>r)&&t.p.parser.stateFlag(t.state,2)&&(!e||e.score<t.score)&&(e=t)}return e}function XO(n){if(n.external){let e=n.extend?1:0;return(t,r)=>n.external(t,r)<<1|e}return n.get}let P5=0;class wn{constructor(e,t,r,i){this.name=e,this.set=t,this.base=r,this.modified=i,this.id=P5++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(e,t){let r=typeof e=="string"?e:"?";if(e instanceof wn&&(t=e),t?.base)throw new Error("Can not derive from a modified tag");let i=new wn(r,[],null,[]);if(i.set.push(i),t)for(let s of t.set)i.set.push(s);return i}static defineModifier(e){let t=new Fc(e);return r=>r.modified.indexOf(t)>-1?r:Fc.get(r.base||r,r.modified.concat(t).sort((i,s)=>i.id-s.id))}}let T5=0;class Fc{constructor(e){this.name=e,this.instances=[],this.id=T5++}static get(e,t){if(!t.length)return e;let r=t[0].instances.find(a=>a.base==e&&M5(t,a.modified));if(r)return r;let i=[],s=new wn(e.name,i,e,t);for(let a of t)a.instances.push(s);let o=A5(t);for(let a of e.set)if(!a.modified.length)for(let l of o)i.push(Fc.get(a,l));return s}}function M5(n,e){return n.length==e.length&&n.every((t,r)=>t==e[r])}function A5(n){let e=[[]];for(let t=0;t<n.length;t++)for(let r=0,i=e.length;r<i;r++)e.push(e[r].concat(n[t]));return e.sort((t,r)=>r.length-t.length)}function sl(n){let e=Object.create(null);for(let t in n){let r=n[t];Array.isArray(r)||(r=[r]);for(let i of t.split(" "))if(i){let s=[],o=2,a=i;for(let h=0;;){if(a=="..."&&h>0&&h+3==i.length){o=1;break}let f=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(a);if(!f)throw new RangeError("Invalid path: "+i);if(s.push(f[0]=="*"?"":f[0][0]=='"'?JSON.parse(f[0]):f[0]),h+=f[0].length,h==i.length)break;let p=i[h++];if(h==i.length&&p=="!"){o=0;break}if(p!="/")throw new RangeError("Invalid path: "+i);a=i.slice(h)}let l=s.length-1,c=s[l];if(!c)throw new RangeError("Invalid path: "+i);let d=new Ca(r,o,l>0?s.slice(0,l):null);e[c]=d.sort(e[c])}}return Bx.add(e)}const Bx=new he({combine(n,e){let t,r,i;for(;n||e;){if(!n||e&&n.depth<=e.depth?(i=e,e=e.next):(i=n,n=n.next),t&&t.mode==i.mode&&!i.context&&!t.context)continue;let s=new Ca(i.tags,i.mode,i.context);t?t.next=s:r=s,t=s}return r}});class Ca{constructor(e,t,r,i){this.tags=e,this.mode=t,this.context=r,this.next=i}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}}Ca.empty=new Ca([],2,null);function Zx(n,e){let t=Object.create(null);for(let s of n)if(!Array.isArray(s.tag))t[s.tag.id]=s.class;else for(let o of s.tag)t[o.id]=s.class;let{scope:r,all:i=null}=e||{};return{style:s=>{let o=i;for(let a of s)for(let l of a.set){let c=t[l.id];if(c){o=o?o+" "+c:c;break}}return o},scope:r}}function R5(n,e){let t=null;for(let r of n){let i=r.style(e);i&&(t=t?t+" "+i:i)}return t}function E5(n,e,t,r=0,i=n.length){let s=new N5(r,Array.isArray(e)?e:[e],t);s.highlightRange(n.cursor(),r,i,"",s.highlighters),s.flush(i)}class N5{constructor(e,t,r){this.at=e,this.highlighters=t,this.span=r,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,r,i,s){let{type:o,from:a,to:l}=e;if(a>=r||l<=t)return;o.isTop&&(s=this.highlighters.filter(p=>!p.scope||p.scope(o)));let c=i,d=D5(e)||Ca.empty,h=R5(s,d.tags);if(h&&(c&&(c+=" "),c+=h,d.mode==1&&(i+=(i?" ":"")+h)),this.startSpan(Math.max(t,a),c),d.opaque)return;let f=e.tree&&e.tree.prop(he.mounted);if(f&&f.overlay){let p=e.node.enter(f.overlay[0].from+a,1),m=this.highlighters.filter(b=>!b.scope||b.scope(f.tree.type)),O=e.firstChild();for(let b=0,y=a;;b++){let k=b<f.overlay.length?f.overlay[b]:null,x=k?k.from+a:l,S=Math.max(t,y),v=Math.min(r,x);if(S<v&&O)for(;e.from<v&&(this.highlightRange(e,S,v,i,s),this.startSpan(Math.min(v,e.to),c),!(e.to>=x||!e.nextSibling())););if(!k||x>r)break;y=k.to+a,y>t&&(this.highlightRange(p.cursor(),Math.max(t,k.from+a),Math.min(r,y),"",m),this.startSpan(Math.min(r,y),c))}O&&e.parent()}else if(e.firstChild()){f&&(i="");do if(!(e.to<=t)){if(e.from>=r)break;this.highlightRange(e,t,r,i,s),this.startSpan(Math.min(r,e.to),c)}while(e.nextSibling());e.parent()}}}function D5(n){let e=n.type.prop(Bx);for(;e&&e.context&&!n.matchContext(e.context);)e=e.next;return e||null}const B=wn.define,Pl=B(),Hr=B(),LO=B(Hr),_O=B(Hr),Kr=B(),Tl=B(Kr),Kd=B(Kr),Jn=B(),Mi=B(Jn),Gn=B(),Hn=B(),xf=B(),vo=B(xf),Ml=B(),u={comment:Pl,lineComment:B(Pl),blockComment:B(Pl),docComment:B(Pl),name:Hr,variableName:B(Hr),typeName:LO,tagName:B(LO),propertyName:_O,attributeName:B(_O),className:B(Hr),labelName:B(Hr),namespace:B(Hr),macroName:B(Hr),literal:Kr,string:Tl,docString:B(Tl),character:B(Tl),attributeValue:B(Tl),number:Kd,integer:B(Kd),float:B(Kd),bool:B(Kr),regexp:B(Kr),escape:B(Kr),color:B(Kr),url:B(Kr),keyword:Gn,self:B(Gn),null:B(Gn),atom:B(Gn),unit:B(Gn),modifier:B(Gn),operatorKeyword:B(Gn),controlKeyword:B(Gn),definitionKeyword:B(Gn),moduleKeyword:B(Gn),operator:Hn,derefOperator:B(Hn),arithmeticOperator:B(Hn),logicOperator:B(Hn),bitwiseOperator:B(Hn),compareOperator:B(Hn),updateOperator:B(Hn),definitionOperator:B(Hn),typeOperator:B(Hn),controlOperator:B(Hn),punctuation:xf,separator:B(xf),bracket:vo,angleBracket:B(vo),squareBracket:B(vo),paren:B(vo),brace:B(vo),content:Jn,heading:Mi,heading1:B(Mi),heading2:B(Mi),heading3:B(Mi),heading4:B(Mi),heading5:B(Mi),heading6:B(Mi),contentSeparator:B(Jn),list:B(Jn),quote:B(Jn),emphasis:B(Jn),strong:B(Jn),link:B(Jn),monospace:B(Jn),strikethrough:B(Jn),inserted:B(),deleted:B(),changed:B(),invalid:B(),meta:Ml,documentMeta:B(Ml),annotation:B(Ml),processingInstruction:B(Ml),definition:wn.defineModifier("definition"),constant:wn.defineModifier("constant"),function:wn.defineModifier("function"),standard:wn.defineModifier("standard"),local:wn.defineModifier("local"),special:wn.defineModifier("special")};for(let n in u){let e=u[n];e instanceof wn&&(e.name=n)}Zx([{tag:u.link,class:"tok-link"},{tag:u.heading,class:"tok-heading"},{tag:u.emphasis,class:"tok-emphasis"},{tag:u.strong,class:"tok-strong"},{tag:u.keyword,class:"tok-keyword"},{tag:u.atom,class:"tok-atom"},{tag:u.bool,class:"tok-bool"},{tag:u.url,class:"tok-url"},{tag:u.labelName,class:"tok-labelName"},{tag:u.inserted,class:"tok-inserted"},{tag:u.deleted,class:"tok-deleted"},{tag:u.literal,class:"tok-literal"},{tag:u.string,class:"tok-string"},{tag:u.number,class:"tok-number"},{tag:[u.regexp,u.escape,u.special(u.string)],class:"tok-string2"},{tag:u.variableName,class:"tok-variableName"},{tag:u.local(u.variableName),class:"tok-variableName tok-local"},{tag:u.definition(u.variableName),class:"tok-variableName tok-definition"},{tag:u.special(u.variableName),class:"tok-variableName2"},{tag:u.definition(u.propertyName),class:"tok-propertyName tok-definition"},{tag:u.typeName,class:"tok-typeName"},{tag:u.namespace,class:"tok-namespace"},{tag:u.className,class:"tok-className"},{tag:u.macroName,class:"tok-macroName"},{tag:u.propertyName,class:"tok-propertyName"},{tag:u.operator,class:"tok-operator"},{tag:u.comment,class:"tok-comment"},{tag:u.meta,class:"tok-meta"},{tag:u.invalid,class:"tok-invalid"},{tag:u.punctuation,class:"tok-punctuation"}]);const j5=148,BO=1,I5=149,X5=150,Wx=2,L5=151,_5=3,B5=4,Z5=152,zx=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],W5=58,z5=40,Vx=95,V5=91,yc=45,F5=46,q5=35,Y5=37,U5=38,G5=92,H5=10,K5=42;function Pa(n){return n>=65&&n<=90||n>=97&&n<=122||n>=161}function Om(n){return n>=48&&n<=57}function ZO(n){return Om(n)||n>=97&&n<=102||n>=65&&n<=70}const Fx=(n,e,t)=>(r,i)=>{for(let s=!1,o=0,a=0;;a++){let{next:l}=r;if(Pa(l)||l==yc||l==Vx||s&&Om(l))!s&&(l!=yc||a>0)&&(s=!0),o===a&&l==yc&&o++,r.advance();else if(l==G5&&r.peek(1)!=H5){if(r.advance(),ZO(r.next)){do r.advance();while(ZO(r.next));r.next==32&&r.advance()}else r.next>-1&&r.advance();s=!0}else{s&&r.acceptToken(o>=2&&i.canShift(Wx)?e:l==z5?t:n);break}}},J5=new rn(Fx(I5,Wx,X5),{contextual:!0}),eM=new rn(Fx(L5,_5,B5),{contextual:!0}),tM=new rn(n=>{if(zx.includes(n.peek(-1))){let{next:e}=n;(Pa(e)||e==Vx||e==q5||e==F5||e==K5||e==V5||e==W5&&Pa(n.peek(1))||e==yc||e==U5)&&n.acceptToken(j5)}}),nM=new rn(n=>{if(!zx.includes(n.peek(-1))){let{next:e}=n;if(e==Y5&&(n.advance(),n.acceptToken(BO)),Pa(e)){do n.advance();while(Pa(n.next)||Om(n.next));n.acceptToken(BO)}}});function WO(n){let e=n.length;return(e==4||e==5||e==7||e==9)&&/^#[a-f\d]+$/i.test(n)?Z5:-1}const rM=sl({"AtKeyword import charset namespace keyframes media supports font-feature-values":u.definitionKeyword,"from to selector scope MatchFlag":u.keyword,NamespaceName:u.namespace,KeyframeName:u.labelName,KeyframeRangeName:u.operatorKeyword,TagName:u.tagName,ClassName:u.className,PseudoClassName:u.constant(u.className),IdName:u.labelName,"FeatureName PropertyName":u.propertyName,AttributeName:u.attributeName,NumberLiteral:u.number,KeywordQuery:u.keyword,UnaryQueryOp:u.operatorKeyword,"CallTag ValueName FontName":u.atom,VariableName:u.variableName,Callee:u.operatorKeyword,Unit:u.unit,"UniversalSelector NestingSelector":u.definitionOperator,"MatchOp CompareOp":u.compareOperator,"ChildOp SiblingOp, LogicOp":u.logicOperator,BinOp:u.arithmeticOperator,Important:u.modifier,Comment:u.blockComment,ColorLiteral:u.color,"ParenthesizedContent StringLiteral":u.string,":":u.punctuation,PseudoOp:u.derefOperator,"; , |":u.separator,"( )":u.paren,"[ ]":u.squareBracket,"{ }":u.brace}),iM={__proto__:null,lang:44,"nth-child":44,"nth-last-child":44,"nth-of-type":44,"nth-last-of-type":44,dir:44,"host-context":44,if:88,url:158,"url-prefix":158,domain:158,regexp:158},sM={__proto__:null,or:102,and:102,not:112,only:112,layer:212},oM={__proto__:null,selector:118,style:124,layer:208},aM={__proto__:null,"@import":204,"@media":216,"@charset":220,"@namespace":224,"@keyframes":230,"@supports":242,"@scope":246,"@font-feature-values":252},lM={__proto__:null,to:249},cM=Ki.deserialize({version:14,states:"MrQYQdOOO$TQdOOP$[O`OOO%XQaO'#CfOOQP'#Ce'#CeO%`QdO'#CgO%eQ`O'#CgO%jQaO'#FrO&eQdO'#CkO'XQaO'#CcO'c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S#S#[#o%P&ie{X!_!`#h#i#j#k$u%Y'gQ!^]R#g|T!]]|Q#r![R%_#sQ!TXQ!haQ#TkQ#m!RQ$Q!cQ$n!zQ$t#RQ$w#VQ$z#YQ%g$PQ&`$vQ'^&[Q'a&aR(S']SoP!SQ#^pQ%O#[R&g%PZnPp!S#[%PQ$}#ZQ&e${R'd&dR$g!rQ'R%{R(['yR#OhR#QiR$s#QS&[$r&]R(Q'[V&Y$r&]'[R#YlQ#`rR%S#`QdOSpP!SU!kdp%PR%P#[Q%]#p[&l%]&r'i'r'x(bQ&r%aQ'i&mQ'r&wQ'x'OR(b(VQ$[!mQ$^!nQ$`!oV%v$[$^$`Q&Q$iR'X&QQ&v%iS'q&v(WR(W'rQ&n%]R'j&nQ&j%YR'h&jQ!RXR#l!RQ&d${R'c&dQ#]oS%Q#]%RR%R#^Q'z'RR(]'zQ$m!yR&U$mQ&]$rR'_&]Q']&[R(R']Q#XlR$y#XQ$P!cR%f$P_cOPdp!S#[%P^XOPdp!S#[%PQ!_^Q!`_Q#h}Q#i!OQ#j!PQ#k!QQ$u#SQ%Y#oR'g&iR%^#pQ!reQ!{g[$X!m!n!o$[$^$`Q${#Zh%[#p%]%a&m&r&w'O'i'r'x(V(bQ%`#uQ%z$cS&b${&dQ&h%WQ'b&cR'|'T]$Z!m!n!o$[$^$`Q!caU!yf!r$gQ#RjQ#x!bS#|!c$PQ$R!dQ%d#}Q%e$OQ%i$SS&O$i&QQ&T$lR'o&uQ#{!bW%s$W%m&z'uQ&t%bQ'w&}Q(U'mR(d(ZQ%u$WQ&y%mQ't&zR(Y'uR%k$SR%Z#oQqPR#n!SQ!zfQ$f!rR%}$g",nodeNames:"⚠ Unit VariableName VariableName QueryCallee Comment StyleSheet RuleSet UniversalSelector TagSelector TagName NamespacedTagSelector NamespaceName TagName NestingSelector ClassSelector . ClassName PseudoClassSelector : :: PseudoClassName PseudoClassName ) ( ArgList ValueName ParenthesizedValue AtKeyword ; ] [ BracketedValue } { BracedValue ColorLiteral NumberLiteral StringLiteral BinaryExpression BinOp CallExpression Callee IfExpression if ArgList IfBranch KeywordQuery FeatureQuery FeatureName BinaryQuery LogicOp ComparisonQuery ColorLiteral CompareOp UnaryQuery UnaryQueryOp ParenthesizedQuery SelectorQuery selector ParenthesizedSelector StyleQuery style ParenthesedQuery CallQuery ArgList PropertyName , PropertyName UnaryQuery ParenthesedQuery BinaryQuery ParenthesedQuery ParenthesedQuery StyleFeature PropertyName StyleRange PseudoQuery CallLiteral CallTag ParenthesizedContent PseudoClassName ArgList IdSelector IdName AttributeSelector AttributeName NamespacedAttribute NamespaceName AttributeName MatchOp MatchFlag ChildSelector ChildOp DescendantSelector SiblingSelector SiblingOp Block Declaration PropertyName Important ImportStatement import Layer layer LayerName layer MediaStatement media CharsetStatement charset NamespaceStatement namespace NamespaceName KeyframesStatement keyframes KeyframeName KeyframeList KeyframeSelector KeyframeRangeName SupportsStatement supports ScopeStatement scope to FontFeatureStatement font-feature-values FontName AtRule Styles",maxTerm:176,nodeProps:[["isolate",-2,5,38,""],["openedBy",23,"(",30,"[",33,"{"],["closedBy",24,")",31,"]",34,"}"]],propSources:[rM],skippedNodes:[0,5,130],repeatNodeCount:17,tokenData:"IO~R!bOX%ZX^&R^p%Zpq&Rqr)ers)vst+jtu/wuv%Zvw0qwx1Sxy2qyz3Sz{3X{|3r|}8e}!O8v!O!P9e!P!Q9|!Q![:u![!];p!]!^<l!^!_<}!_!`=y!`!a>^!a!b%Z!b!c?_!c!k%Z!k!lAl!l!u%Z!u!vAl!v!}%Z!}#OA}#O#P%Z#P#QB`#Q#R/w#R#]%Z#]#^Bq#^#g%Z#g#hAl#h#o%Z#o#pGU#p#qGg#q#rHO#r#sHa#s#y%Z#y#z&R#z$f%Z$f$g&R$g#BY%Z#BY#BZ&R#BZ$IS%Z$IS$I_&R$I_$I|%Z$I|$JO&R$JO$JT%Z$JT$JU&R$JU$KV%Z$KV$KW&R$KW&FU%Z&FU&FV&R&FV;'S%Z;'S;=`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U#SQOy%jz!_%j!_!`0^!`;'S%j;'S;=`%{<%lO%j`H{P;=`<%l%Z",tokenizers:[tM,nM,J5,eM,1,2,3,4,new $a("m~RRYZ[z{a~~g~aO$c~~dP!P!Qg~lO$d~~",28,156)],topRules:{StyleSheet:[0,6],Styles:[1,129]},dynamicPrecedences:{97:1},specialized:[{term:172,get:(n,e)=>WO(n)<<1,external:WO},{term:150,get:n=>iM[n]||-1},{term:151,get:n=>sM[n]||-1},{term:4,get:n=>oM[n]||-1},{term:28,get:n=>aM[n]||-1},{term:149,get:n=>lM[n]||-1}],tokenPrec:2433});let Sf=[],qx=[];(()=>{let n="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,1n,9,16,o,,x,1i,3,,i,,7,a,2,t,3,1k,,,7,2,2,2,3,9,,a,2,q,,2,3,1k,,,5,4,2,2,3,3,,u,2,3,,b,3,1k,,,8,,3,,3,k,2,m,6,,3,1k,,,7,2,2,2,3,7,3,a,2,u,,1n,5,3,3,,4,9,,14,5,1j,,,7,,3,,4,7,2,b,2,t,3,1k,,,7,,3,,4,7,2,b,2,f,,c,4,1j,2,,7,,3,,4,9,,a,2,t,3,1y,,4,6,,,,8,i,2,1p,,,8,c,8,2q,,,a,b,7,21,2,r,,,,,,4,2,1d,k,,2,5,b,,10,9,,2u,b,,6,n,4,4,3,g,4,d,,,3,6,,f,,jj,3,qa,4,s,3,t,2,u,2,1s,w,9,,19,3,,,39,2,y,,3a,c,4,c,63,5,1l,a,,,,,2,o,2,,1c,1a,2,c,k,5,1b,h,12,9,c,3,u,d,1k,e,1c,k,48,3,,l,4,,6,,2,3,5i,1s,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,n,5,4,,2b,2,1e,i,q,i,d,,12,8,p,d,18,4,1b,e,10,,1v,e,c,,8,2,1a,,1f,,,3,2,2,5,2,,,15,5,5,2,6k,8,,2,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,1t,5,8t,2,25,6,1y,b,1d,4,3e,3,1h,f,15,,2,2,a,4,19,b,7,,1p,3,10,e,g,2,18,,c,3,1c,e,8,4,,2,2k,c,6,,2,,4d,c,l,4,1j,2,,7,2,2,2,3,9,,a,2,2,7,3,5,1v,9,,,2,,,4,,5,,,e,2,2a,i,n,,29,k,6j,7,2,9,r,2,2a,h,2y,d,2t,3,2,a,74,f,6t,6,,2,2,4,,,,2,3x,7,2,7,3,,s,a,14,7,,4,8,,9,b,1a,g,5i,8,5j,8,,8,2a,m,,e,3e,6,3,,,2,,7,,,1u,5,,2,,5,9n,4,9,2,,,1c,7,3,5,n,,44l,,6,f,8ug,i,1xc,5,1n,7,t4,,,1j,7,4,29,,b,2,f57,2,3mp,1a,2,n,f2,5,3,6,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,2s,,4g,7,af,,1p,4,e4,4,72,2,6r,,2,,7,2,5,,d6,7,31,7,240,5".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,t=0;e<n.length;e++)(e%2?qx:Sf).push(t=t+n[e])})();function uM(n){if(n<768)return!1;for(let e=0,t=Sf.length;;){let r=e+t>>1;if(n<Sf[r])t=r;else if(n>=qx[r])e=r+1;else return!0;if(e==t)return!1}}function zO(n){return n>=127462&&n<=127487}const VO=8205;function dM(n,e,t=!0,r=!0){return(t?Yx:hM)(n,e,r)}function Yx(n,e,t){if(e==n.length)return e;e&&Ux(n.charCodeAt(e))&&Gx(n.charCodeAt(e-1))&&e--;let r=Jd(n,e);for(e+=FO(r);e<n.length;){let i=Jd(n,e);if(r==VO||i==VO||t&&uM(i))e+=FO(i),r=i;else if(zO(i)){let s=0,o=e-2;for(;o>=0&&zO(Jd(n,o));)s++,o-=2;if(s%2==0)break;e+=2}else break}return e}function hM(n,e,t){for(;e>1;){let r=Yx(n,e-2,t);if(r<e)return r;e--}return 0}function Jd(n,e){let t=n.charCodeAt(e);if(!Gx(t)||e+1==n.length)return t;let r=n.charCodeAt(e+1);return Ux(r)?(t-55296<<10)+(r-56320)+65536:t}function Ux(n){return n>=56320&&n<57344}function Gx(n){return n>=55296&&n<56320}function FO(n){return n<65536?1:2}let xe=class Hx{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,r){[e,t]=Ys(this,e,t);let i=[];return this.decompose(0,e,i,2),r.length&&r.decompose(0,r.length,i,3),this.decompose(t,this.length,i,1),xc.from(i,this.length-(t-e)+r.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=Ys(this,e,t);let r=[];return this.decompose(e,t,r,0),xc.from(r,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),r=this.length-this.scanIdentical(e,-1),i=new Jo(this),s=new Jo(e);for(let o=t,a=t;;){if(i.next(o),s.next(o),o=0,i.lineBreak!=s.lineBreak||i.done!=s.done||i.value!=s.value)return!1;if(a+=i.value.length,i.done||a>=r)return!0}}iter(e=1){return new Jo(this,e)}iterRange(e,t=this.length){return new Kx(this,e,t)}iterLines(e,t){let r;if(e==null)r=this.iter();else{t==null&&(t=this.lines+1);let i=this.line(e).from;r=this.iterRange(i,Math.max(i,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new Jx(r)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?Hx.empty:e.length<=32?new lt(e):xc.from(lt.split(e,[]))}};class lt extends xe{constructor(e,t=fM(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,r,i){for(let s=0;;s++){let o=this.text[s],a=i+o.length;if((t?r:a)>=e)return new pM(i,a,r,o);i=a+1,r++}}decompose(e,t,r,i){let s=e<=0&&t>=this.length?this:new lt(qO(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(i&1){let o=r.pop(),a=Sc(s.text,o.text.slice(),0,s.length);if(a.length<=32)r.push(new lt(a,o.length+s.length));else{let l=a.length>>1;r.push(new lt(a.slice(0,l)),new lt(a.slice(l)))}}else r.push(s)}replace(e,t,r){if(!(r instanceof lt))return super.replace(e,t,r);[e,t]=Ys(this,e,t);let i=Sc(this.text,Sc(r.text,qO(this.text,0,e)),t),s=this.length+r.length-(t-e);return i.length<=32?new lt(i,s):xc.from(lt.split(i,[]),s)}sliceString(e,t=this.length,r=`
|
|
45
|
+
`){[e,t]=Ys(this,e,t);let i="";for(let s=0,o=0;s<=t&&o<this.text.length;o++){let a=this.text[o],l=s+a.length;s>e&&o&&(i+=r),e<l&&t>s&&(i+=a.slice(Math.max(0,e-s),t-s)),s=l+1}return i}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let r=[],i=-1;for(let s of e)r.push(s),i+=s.length+1,r.length==32&&(t.push(new lt(r,i)),r=[],i=-1);return i>-1&&t.push(new lt(r,i)),t}}let xc=class Ss extends xe{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let r of e)this.lines+=r.lines}lineInner(e,t,r,i){for(let s=0;;s++){let o=this.children[s],a=i+o.length,l=r+o.lines-1;if((t?l:a)>=e)return o.lineInner(e,t,r,i);i=a+1,r=l+1}}decompose(e,t,r,i){for(let s=0,o=0;o<=t&&s<this.children.length;s++){let a=this.children[s],l=o+a.length;if(e<=l&&t>=o){let c=i&((o<=e?1:0)|(l>=t?2:0));o>=e&&l<=t&&!c?r.push(a):a.decompose(e-o,t-o,r,c)}o=l+1}}replace(e,t,r){if([e,t]=Ys(this,e,t),r.lines<this.lines)for(let i=0,s=0;i<this.children.length;i++){let o=this.children[i],a=s+o.length;if(e>=s&&t<=a){let l=o.replace(e-s,t-s,r),c=this.lines-o.lines+l.lines;if(l.lines<c>>4&&l.lines>c>>6){let d=this.children.slice();return d[i]=l,new Ss(d,this.length-(t-e)+r.length)}return super.replace(s,a,l)}s=a+1}return super.replace(e,t,r)}sliceString(e,t=this.length,r=`
|
|
46
|
+
`){[e,t]=Ys(this,e,t);let i="";for(let s=0,o=0;s<this.children.length&&o<=t;s++){let a=this.children[s],l=o+a.length;o>e&&s&&(i+=r),e<l&&t>o&&(i+=a.sliceString(e-o,t-o,r)),o=l+1}return i}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof Ss))return 0;let r=0,[i,s,o,a]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;i+=t,s+=t){if(i==o||s==a)return r;let l=this.children[i],c=e.children[s];if(l!=c)return r+l.scanIdentical(c,t);r+=l.length+1}}static from(e,t=e.reduce((r,i)=>r+i.length+1,-1)){let r=0;for(let p of e)r+=p.lines;if(r<32){let p=[];for(let m of e)m.flatten(p);return new lt(p,t)}let i=Math.max(32,r>>5),s=i<<1,o=i>>1,a=[],l=0,c=-1,d=[];function h(p){let m;if(p.lines>s&&p instanceof Ss)for(let O of p.children)h(O);else p.lines>o&&(l>o||!l)?(f(),a.push(p)):p instanceof lt&&l&&(m=d[d.length-1])instanceof lt&&p.lines+m.lines<=32?(l+=p.lines,c+=p.length+1,d[d.length-1]=new lt(m.text.concat(p.text),m.length+1+p.length)):(l+p.lines>i&&f(),l+=p.lines,c+=p.length+1,d.push(p))}function f(){l!=0&&(a.push(d.length==1?d[0]:Ss.from(d,c)),c=-1,l=d.length=0)}for(let p of e)h(p);return f(),a.length==1?a[0]:new Ss(a,t)}};xe.empty=new lt([""],0);function fM(n){let e=-1;for(let t of n)e+=t.length+1;return e}function Sc(n,e,t=0,r=1e9){for(let i=0,s=0,o=!0;s<n.length&&i<=r;s++){let a=n[s],l=i+a.length;l>=t&&(l>r&&(a=a.slice(0,r-i)),i<t&&(a=a.slice(t-i)),o?(e[e.length-1]+=a,o=!1):e.push(a)),i=l+1}return e}function qO(n,e,t){return Sc(n,[""],e,t)}class Jo{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[t>0?1:(e instanceof lt?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let r=this.nodes.length-1,i=this.nodes[r],s=this.offsets[r],o=s>>1,a=i instanceof lt?i.text.length:i.children.length;if(o==(t>0?a:0)){if(r==0)return this.done=!0,this.value="",this;t>0&&this.offsets[r-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(t>0?0:1)){if(this.offsets[r]+=t,e==0)return this.lineBreak=!0,this.value=`
|
|
47
|
+
`,this;e--}else if(i instanceof lt){let l=i.text[o+(t<0?-1:0)];if(this.offsets[r]+=t,l.length>Math.max(0,e))return this.value=e==0?l:t>0?l.slice(e):l.slice(0,l.length-e),this;e-=l.length}else{let l=i.children[o+(t<0?-1:0)];e>l.length?(e-=l.length,this.offsets[r]+=t):(t<0&&this.offsets[r]--,this.nodes.push(l),this.offsets.push(t>0?1:(l instanceof lt?l.text.length:l.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class Kx{constructor(e,t,r){this.value="",this.done=!1,this.cursor=new Jo(e,t>r?-1:1),this.pos=t>r?e.length:0,this.from=Math.min(t,r),this.to=Math.max(t,r)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let r=t<0?this.pos-this.from:this.to-this.pos;e>r&&(e=r),r-=e;let{value:i}=this.cursor.next(e);return this.pos+=(i.length+e)*t,this.value=i.length<=r?i:t<0?i.slice(i.length-r):i.slice(0,r),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class Jx{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:r,value:i}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):r?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=i,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(xe.prototype[Symbol.iterator]=function(){return this.iter()},Jo.prototype[Symbol.iterator]=Kx.prototype[Symbol.iterator]=Jx.prototype[Symbol.iterator]=function(){return this});class pM{constructor(e,t,r,i){this.from=e,this.to=t,this.number=r,this.text=i}get length(){return this.to-this.from}}function Ys(n,e,t){return e=Math.max(0,Math.min(n.length,e)),[e,Math.max(e,Math.min(n.length,t))]}function bt(n,e,t=!0,r=!0){return dM(n,e,t,r)}function mM(n){return n>=56320&&n<57344}function gM(n){return n>=55296&&n<56320}function Yt(n,e){let t=n.charCodeAt(e);if(!gM(t)||e+1==n.length)return t;let r=n.charCodeAt(e+1);return mM(r)?(t-55296<<10)+(r-56320)+65536:t}function bm(n){return n<=65535?String.fromCharCode(n):(n-=65536,String.fromCharCode((n>>10)+55296,(n&1023)+56320))}function ir(n){return n<65536?1:2}const kf=/\r\n?|\n/;var Ct=(function(n){return n[n.Simple=0]="Simple",n[n.TrackDel=1]="TrackDel",n[n.TrackBefore=2]="TrackBefore",n[n.TrackAfter=3]="TrackAfter",n})(Ct||(Ct={}));class cr{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let r=this.sections[t+1];e+=r<0?this.sections[t]:r}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,r=0,i=0;t<this.sections.length;){let s=this.sections[t++],o=this.sections[t++];o<0?(e(r,i,s),i+=s):i+=o,r+=s}}iterChangedRanges(e,t=!1){vf(this,e,t)}get invertedDesc(){let e=[];for(let t=0;t<this.sections.length;){let r=this.sections[t++],i=this.sections[t++];i<0?e.push(r,i):e.push(i,r)}return new cr(e)}composeDesc(e){return this.empty?e:e.empty?this:eS(this,e)}mapDesc(e,t=!1){return e.empty?this:wf(this,e,t)}mapPos(e,t=-1,r=Ct.Simple){let i=0,s=0;for(let o=0;o<this.sections.length;){let a=this.sections[o++],l=this.sections[o++],c=i+a;if(l<0){if(c>e)return s+(e-i);s+=a}else{if(r!=Ct.Simple&&c>=e&&(r==Ct.TrackDel&&i<e&&c>e||r==Ct.TrackBefore&&i<e||r==Ct.TrackAfter&&c>e))return null;if(c>e||c==e&&t<0&&!a)return e==i||t<0?s:s+l;s+=l}i=c}if(e>i)throw new RangeError(`Position ${e} is out of range for changeset of length ${i}`);return s}touchesRange(e,t=e){for(let r=0,i=0;r<this.sections.length&&i<=t;){let s=this.sections[r++],o=this.sections[r++],a=i+s;if(o>=0&&i<=t&&a>=e)return i<e&&a>t?"cover":!0;i=a}return!1}toString(){let e="";for(let t=0;t<this.sections.length;){let r=this.sections[t++],i=this.sections[t++];e+=(e?" ":"")+r+(i>=0?":"+i:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new cr(e)}static create(e){return new cr(e)}}class ft extends cr{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return vf(this,(t,r,i,s,o)=>e=e.replace(i,i+(r-t),o),!1),e}mapDesc(e,t=!1){return wf(this,e,t,!0)}invert(e){let t=this.sections.slice(),r=[];for(let i=0,s=0;i<t.length;i+=2){let o=t[i],a=t[i+1];if(a>=0){t[i]=a,t[i+1]=o;let l=i>>1;for(;r.length<l;)r.push(xe.empty);r.push(o?e.slice(s,s+o):xe.empty)}s+=o}return new ft(t,r)}compose(e){return this.empty?e:e.empty?this:eS(this,e,!0)}map(e,t=!1){return e.empty?this:wf(this,e,t,!0)}iterChanges(e,t=!1){vf(this,e,t)}get desc(){return cr.create(this.sections)}filter(e){let t=[],r=[],i=[],s=new Ta(this);e:for(let o=0,a=0;;){let l=o==e.length?1e9:e[o++];for(;a<l||a==l&&s.len==0;){if(s.done)break e;let d=Math.min(s.len,l-a);Rt(i,d,-1);let h=s.ins==-1?-1:s.off==0?s.ins:0;Rt(t,d,h),h>0&&ii(r,t,s.text),s.forward(d),a+=d}let c=e[o++];for(;a<c;){if(s.done)break e;let d=Math.min(s.len,c-a);Rt(t,d,-1),Rt(i,d,s.ins==-1?-1:s.off==0?s.ins:0),s.forward(d),a+=d}}return{changes:new ft(t,r),filtered:cr.create(i)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+=2){let r=this.sections[t],i=this.sections[t+1];i<0?e.push(r):i==0?e.push([r]):e.push([r].concat(this.inserted[t>>1].toJSON()))}return e}static of(e,t,r){let i=[],s=[],o=0,a=null;function l(d=!1){if(!d&&!i.length)return;o<t&&Rt(i,t-o,-1);let h=new ft(i,s);a=a?a.compose(h.map(a)):h,i=[],s=[],o=0}function c(d){if(Array.isArray(d))for(let h of d)c(h);else if(d instanceof ft){if(d.length!=t)throw new RangeError(`Mismatched change set length (got ${d.length}, expected ${t})`);l(),a=a?a.compose(d.map(a)):d}else{let{from:h,to:f=h,insert:p}=d;if(h>f||h<0||f>t)throw new RangeError(`Invalid change range ${h} to ${f} (in doc of length ${t})`);let m=p?typeof p=="string"?xe.of(p.split(r||kf)):p:xe.empty,O=m.length;if(h==f&&O==0)return;h<o&&l(),h>o&&Rt(i,h-o,-1),Rt(i,f-h,O),ii(s,i,m),o=f}}return c(e),l(!a),a}static empty(e){return new ft(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],r=[];for(let i=0;i<e.length;i++){let s=e[i];if(typeof s=="number")t.push(s,-1);else{if(!Array.isArray(s)||typeof s[0]!="number"||s.some((o,a)=>a&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(s.length==1)t.push(s[0],0);else{for(;r.length<i;)r.push(xe.empty);r[i]=xe.of(s.slice(1)),t.push(s[0],r[i].length)}}}return new ft(t,r)}static createSet(e,t){return new ft(e,t)}}function Rt(n,e,t,r=!1){if(e==0&&t<=0)return;let i=n.length-2;i>=0&&t<=0&&t==n[i+1]?n[i]+=e:i>=0&&e==0&&n[i]==0?n[i+1]+=t:r?(n[i]+=e,n[i+1]+=t):n.push(e,t)}function ii(n,e,t){if(t.length==0)return;let r=e.length-2>>1;if(r<n.length)n[n.length-1]=n[n.length-1].append(t);else{for(;n.length<r;)n.push(xe.empty);n.push(t)}}function vf(n,e,t){let r=n.inserted;for(let i=0,s=0,o=0;o<n.sections.length;){let a=n.sections[o++],l=n.sections[o++];if(l<0)i+=a,s+=a;else{let c=i,d=s,h=xe.empty;for(;c+=a,d+=l,l&&r&&(h=h.append(r[o-2>>1])),!(t||o==n.sections.length||n.sections[o+1]<0);)a=n.sections[o++],l=n.sections[o++];e(i,c,s,d,h),i=c,s=d}}}function wf(n,e,t,r=!1){let i=[],s=r?[]:null,o=new Ta(n),a=new Ta(e);for(let l=-1;;){if(o.done&&a.len||a.done&&o.len)throw new Error("Mismatched change set lengths");if(o.ins==-1&&a.ins==-1){let c=Math.min(o.len,a.len);Rt(i,c,-1),o.forward(c),a.forward(c)}else if(a.ins>=0&&(o.ins<0||l==o.i||o.off==0&&(a.len<o.len||a.len==o.len&&!t))){let c=a.len;for(Rt(i,a.ins,-1);c;){let d=Math.min(o.len,c);o.ins>=0&&l<o.i&&o.len<=d&&(Rt(i,0,o.ins),s&&ii(s,i,o.text),l=o.i),o.forward(d),c-=d}a.next()}else if(o.ins>=0){let c=0,d=o.len;for(;d;)if(a.ins==-1){let h=Math.min(d,a.len);c+=h,d-=h,a.forward(h)}else if(a.ins==0&&a.len<d)d-=a.len,a.next();else break;Rt(i,c,l<o.i?o.ins:0),s&&l<o.i&&ii(s,i,o.text),l=o.i,o.forward(o.len-d)}else{if(o.done&&a.done)return s?ft.createSet(i,s):cr.create(i);throw new Error("Mismatched change set lengths")}}}function eS(n,e,t=!1){let r=[],i=t?[]:null,s=new Ta(n),o=new Ta(e);for(let a=!1;;){if(s.done&&o.done)return i?ft.createSet(r,i):cr.create(r);if(s.ins==0)Rt(r,s.len,0,a),s.next();else if(o.len==0&&!o.done)Rt(r,0,o.ins,a),i&&ii(i,r,o.text),o.next();else{if(s.done||o.done)throw new Error("Mismatched change set lengths");{let l=Math.min(s.len2,o.len),c=r.length;if(s.ins==-1){let d=o.ins==-1?-1:o.off?0:o.ins;Rt(r,l,d,a),i&&d&&ii(i,r,o.text)}else o.ins==-1?(Rt(r,s.off?0:s.len,l,a),i&&ii(i,r,s.textBit(l))):(Rt(r,s.off?0:s.len,o.off?0:o.ins,a),i&&!o.off&&ii(i,r,o.text));a=(s.ins>l||o.ins>=0&&o.len>l)&&(a||r.length>c),s.forward2(l),o.forward(l)}}}}class Ta{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,t=this.i-2>>1;return t>=e.length?xe.empty:e[t]}textBit(e){let{inserted:t}=this.set,r=this.i-2>>1;return r>=t.length&&!e?xe.empty:t[r].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}let wo=class Qf{constructor(e,t,r,i){this.from=e,this.to=t,this.flags=r,this.goalColumn=i}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get undirectional(){return(this.flags&64)>0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}map(e,t=-1){let r,i;return this.empty?r=i=e.mapPos(this.from,t):(r=e.mapPos(this.from,1),i=e.mapPos(this.to,-1)),r==this.from&&i==this.to?this:new Qf(r,i,this.flags,this.goalColumn)}extend(e,t=e,r=0){if(e<=this.anchor&&t>=this.anchor)return A.range(e,t,void 0,void 0,r);let i=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return A.range(this.anchor,i,void 0,void 0,r)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!t||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return A.range(e.anchor,e.head)}static create(e,t,r,i){return new Qf(e,t,r,i)}};class A{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:A.create(this.ranges.map(r=>r.map(e,t)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let r=0;r<this.ranges.length;r++)if(!this.ranges[r].eq(e.ranges[r],t))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new A([this.main],0)}addRange(e,t=!0){return A.create([e].concat(this.ranges),t?0:this.mainIndex+1)}replaceRange(e,t=this.mainIndex){let r=this.ranges.slice();return r[t]=e,A.create(r,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new A(e.ranges.map(t=>wo.fromJSON(t)),e.main)}static single(e,t=e){return new A([A.range(e,t)],0)}static create(e,t=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let r=0,i=0;i<e.length;i++){let s=e[i];if(s.empty?s.from<=r:s.from<r)return A.normalized(e.slice(),t);r=s.to}return new A(e,t)}static cursor(e,t=0,r,i){return wo.create(e,e,(t==0?0:t<0?8:16)|(r==null?7:Math.min(6,r)),i)}static range(e,t,r,i,s){let o=i==null?7:Math.min(6,i);return!s&&e!=t&&(s=t<e?1:-1),s&&(o|=s<0?8:16),t<e?wo.create(t,e,o|32,r):wo.create(e,t,o,r)}static undirectionalRange(e,t){return wo.create(e,t,64,void 0)}static normalized(e,t=0){let r=e[t];e.sort((i,s)=>i.from-s.from),t=e.indexOf(r);for(let i=1;i<e.length;i++){let s=e[i],o=e[i-1];if(s.empty?s.from<=o.to:s.from<o.to){let a=o.from,l=Math.max(s.to,o.to);i<=t&&t--,e.splice(--i,2,s.anchor>s.head?A.range(l,a):A.range(a,l))}}return new A(e,t)}}function tS(n,e){for(let t of n.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}let ym=0;class W{constructor(e,t,r,i,s){this.combine=e,this.compareInput=t,this.compare=r,this.isStatic=i,this.id=ym++,this.default=e([]),this.extensions=typeof s=="function"?s(this):s}get reader(){return this}static define(e={}){return new W(e.combine||(t=>t),e.compareInput||((t,r)=>t===r),e.compare||(e.combine?(t,r)=>t===r:xm),!!e.static,e.enables)}of(e){return new kc([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new kc(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new kc(e,this,2,t)}from(e,t){return t||(t=r=>r),this.compute([e],r=>t(r.field(e)))}}function xm(n,e){return n==e||n.length==e.length&&n.every((t,r)=>t===e[r])}class kc{constructor(e,t,r,i){this.dependencies=e,this.facet=t,this.type=r,this.value=i,this.id=ym++}dynamicSlot(e){var t;let r=this.value,i=this.facet.compareInput,s=this.id,o=e[s]>>1,a=this.type==2,l=!1,c=!1,d=[];for(let h of this.dependencies)h=="doc"?l=!0:h=="selection"?c=!0:(((t=e[h.id])!==null&&t!==void 0?t:1)&1)==0&&d.push(e[h.id]);return{create(h){return h.values[o]=r(h),1},update(h,f){if(l&&f.docChanged||c&&(f.docChanged||f.selection)||$f(h,d)){let p=r(h);if(a?!YO(p,h.values[o],i):!i(p,h.values[o]))return h.values[o]=p,1}return 0},reconfigure:(h,f)=>{let p,m=f.config.address[s];if(m!=null){let O=qc(f,m);if(this.dependencies.every(b=>b instanceof W?f.facet(b)===h.facet(b):b instanceof Mt?f.field(b,!1)==h.field(b,!1):!0)||(a?YO(p=r(h),O,i):i(p=r(h),O)))return h.values[o]=O,0}else p=r(h);return h.values[o]=p,1}}}}function YO(n,e,t){if(n.length!=e.length)return!1;for(let r=0;r<n.length;r++)if(!t(n[r],e[r]))return!1;return!0}function $f(n,e){let t=!1;for(let r of e)ea(n,r)&1&&(t=!0);return t}function OM(n,e,t){let r=t.map(l=>n[l.id]),i=t.map(l=>l.type),s=r.filter(l=>!(l&1)),o=n[e.id]>>1;function a(l){let c=[];for(let d=0;d<r.length;d++){let h=qc(l,r[d]);if(i[d]==2)for(let f of h)c.push(f);else c.push(h)}return e.combine(c)}return{create(l){for(let c of r)ea(l,c);return l.values[o]=a(l),1},update(l,c){if(!$f(l,s))return 0;let d=a(l);return e.compare(d,l.values[o])?0:(l.values[o]=d,1)},reconfigure(l,c){let d=$f(l,r),h=c.config.facets[e.id],f=c.facet(e);if(h&&!d&&xm(t,h))return l.values[o]=f,0;let p=a(l);return e.compare(p,f)?(l.values[o]=f,0):(l.values[o]=p,1)}}}const Al=W.define({static:!0});class Mt{constructor(e,t,r,i,s){this.id=e,this.createF=t,this.updateF=r,this.compareF=i,this.spec=s,this.provides=void 0}static define(e){let t=new Mt(ym++,e.create,e.update,e.compare||((r,i)=>r===i),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(Al).find(r=>r.field==this);return(t?.create||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:r=>(r.values[t]=this.create(r),1),update:(r,i)=>{let s=r.values[t],o=this.updateF(s,i);return this.compareF(s,o)?0:(r.values[t]=o,1)},reconfigure:(r,i)=>{let s=r.facet(Al),o=i.facet(Al),a;return(a=s.find(l=>l.field==this))&&a!=o.find(l=>l.field==this)?(r.values[t]=a.create(r),1):i.config.address[this.id]!=null?(r.values[t]=i.field(this),0):(r.values[t]=this.create(r),1)}}}init(e){return[this,Al.of({field:this,create:e})]}get extension(){return this}}const Ei={lowest:4,low:3,default:2,high:1,highest:0};function Qo(n){return e=>new nS(e,n)}const Qi={highest:Qo(Ei.highest),high:Qo(Ei.high),default:Qo(Ei.default),low:Qo(Ei.low),lowest:Qo(Ei.lowest)};class nS{constructor(e,t){this.inner=e,this.prec=t}}class ld{of(e){return new Cf(this,e)}reconfigure(e){return ld.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class Cf{constructor(e,t){this.compartment=e,this.inner=t}}let UO=class rS{constructor(e,t,r,i,s,o){for(this.base=e,this.compartments=t,this.dynamicSlots=r,this.address=i,this.staticValues=s,this.facets=o,this.statusTemplate=[];this.statusTemplate.length<r.length;)this.statusTemplate.push(0)}staticFacet(e){let t=this.address[e.id];return t==null?e.default:this.staticValues[t>>1]}static resolve(e,t,r){let i=[],s=Object.create(null),o=new Map;for(let f of bM(e,t,o))f instanceof Mt?i.push(f):(s[f.facet.id]||(s[f.facet.id]=[])).push(f);let a=Object.create(null),l=[],c=[];for(let f of i)a[f.id]=c.length<<1,c.push(p=>f.slot(p));let d=r?.config.facets;for(let f in s){let p=s[f],m=p[0].facet,O=d&&d[f]||[];if(p.every(b=>b.type==0))if(a[m.id]=l.length<<1|1,xm(O,p))l.push(r.facet(m));else{let b=m.combine(p.map(y=>y.value));l.push(r&&m.compare(b,r.facet(m))?r.facet(m):b)}else{for(let b of p)b.type==0?(a[b.id]=l.length<<1|1,l.push(b.value)):(a[b.id]=c.length<<1,c.push(y=>b.dynamicSlot(y)));a[m.id]=c.length<<1,c.push(b=>OM(b,m,p))}}let h=c.map(f=>f(a));return new rS(e,o,h,a,l,s)}};function bM(n,e,t){let r=[[],[],[],[],[]],i=new Map;function s(o,a){let l=i.get(o);if(l!=null){if(l<=a)return;let c=r[l].indexOf(o);c>-1&&r[l].splice(c,1),o instanceof Cf&&t.delete(o.compartment)}if(i.set(o,a),Array.isArray(o))for(let c of o)s(c,a);else if(o instanceof Cf){if(t.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let c=e.get(o.compartment)||o.inner;t.set(o.compartment,c),s(c,a)}else if(o instanceof nS)s(o.inner,o.prec);else if(o instanceof Mt)r[a].push(o),o.provides&&s(o.provides,a);else if(o instanceof kc)r[a].push(o),o.facet.extensions&&s(o.facet.extensions,Ei.default);else{let c=o.extension;if(!c)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);s(c,a)}}return s(n,Ei.default),r.reduce((o,a)=>o.concat(a))}function ea(n,e){if(e&1)return 2;let t=e>>1,r=n.status[t];if(r==4)throw new Error("Cyclic dependency between fields and/or facets");if(r&2)return r;n.status[t]=4;let i=n.computeSlot(n,n.config.dynamicSlots[t]);return n.status[t]=2|i}function qc(n,e){return e&1?n.config.staticValues[e>>1]:n.values[e>>1]}const iS=W.define(),Pf=W.define({combine:n=>n.some(e=>e),static:!0}),sS=W.define({combine:n=>n.length?n[0]:void 0,static:!0}),oS=W.define(),aS=W.define(),lS=W.define(),cS=W.define({combine:n=>n.length?n[0]:!1});class Or{constructor(e,t){this.type=e,this.value=t}static define(){return new yM}}class yM{of(e){return new Or(this,e)}}class xM{constructor(e){this.map=e}of(e){return new oe(this,e)}}class oe{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return t===void 0?void 0:t==this.value?this:new oe(this.type,t)}is(e){return this.type==e}static define(e={}){return new xM(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let r=[];for(let i of e){let s=i.map(t);s&&r.push(s)}return r}}oe.reconfigure=oe.define();oe.appendConfig=oe.define();let Wt=class Bo{constructor(e,t,r,i,s,o){this.startState=e,this.changes=t,this.selection=r,this.effects=i,this.annotations=s,this.scrollIntoView=o,this._doc=null,this._state=null,r&&tS(r,t.newLength),s.some(a=>a.type==Bo.time)||(this.annotations=s.concat(Bo.time.of(Date.now())))}static create(e,t,r,i,s,o){return new Bo(e,t,r,i,s,o)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(Bo.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}};Wt.time=Or.define();Wt.userEvent=Or.define();Wt.addToHistory=Or.define();Wt.remote=Or.define();function SM(n,e){let t=[];for(let r=0,i=0;;){let s,o;if(r<n.length&&(i==e.length||e[i]>=n[r]))s=n[r++],o=n[r++];else if(i<e.length)s=e[i++],o=e[i++];else return t;!t.length||t[t.length-1]<s?t.push(s,o):t[t.length-1]<o&&(t[t.length-1]=o)}}function uS(n,e,t){var r;let i,s,o;return t?(i=e.changes,s=ft.empty(e.changes.length),o=n.changes.compose(e.changes)):(i=e.changes.map(n.changes),s=n.changes.mapDesc(e.changes,!0),o=n.changes.compose(i)),{changes:o,selection:e.selection?e.selection.map(s):(r=n.selection)===null||r===void 0?void 0:r.map(i),effects:oe.mapEffects(n.effects,i).concat(oe.mapEffects(e.effects,s)),annotations:n.annotations.length?n.annotations.concat(e.annotations):e.annotations,scrollIntoView:n.scrollIntoView||e.scrollIntoView}}function Tf(n,e,t){let r=e.selection,i=js(e.annotations);return e.userEvent&&(i=i.concat(Wt.userEvent.of(e.userEvent))),{changes:e.changes instanceof ft?e.changes:ft.of(e.changes||[],t,n.facet(sS)),selection:r&&(r instanceof A?r:A.single(r.anchor,r.head)),effects:js(e.effects),annotations:i,scrollIntoView:!!e.scrollIntoView}}function dS(n,e,t){let r=Tf(n,e.length?e[0]:{},n.doc.length);e.length&&e[0].filter===!1&&(t=!1);for(let s=1;s<e.length;s++){e[s].filter===!1&&(t=!1);let o=!!e[s].sequential;r=uS(r,Tf(n,e[s],o?r.changes.newLength:n.doc.length),o)}let i=Wt.create(n,r.changes,r.selection,r.effects,r.annotations,r.scrollIntoView);return vM(t?kM(i):i)}function kM(n){let e=n.startState,t=!0;for(let i of e.facet(oS)){let s=i(n);if(s===!1){t=!1;break}Array.isArray(s)&&(t=t===!0?s:SM(t,s))}if(t!==!0){let i,s;if(t===!1)s=n.changes.invertedDesc,i=ft.empty(e.doc.length);else{let o=n.changes.filter(t);i=o.changes,s=o.filtered.mapDesc(o.changes).invertedDesc}n=Wt.create(e,i,n.selection&&n.selection.map(s),oe.mapEffects(n.effects,s),n.annotations,n.scrollIntoView)}let r=e.facet(aS);for(let i=r.length-1;i>=0;i--){let s=r[i](n);s instanceof Wt?n=s:Array.isArray(s)&&s.length==1&&s[0]instanceof Wt?n=s[0]:n=dS(e,js(s),!1)}return n}function vM(n){let e=n.startState,t=e.facet(lS),r=n;for(let i=t.length-1;i>=0;i--){let s=t[i](n);s&&Object.keys(s).length&&(r=uS(r,Tf(e,s,n.changes.newLength),!0))}return r==n?n:Wt.create(e,n.changes,n.selection,r.effects,r.annotations,r.scrollIntoView)}const wM=[];function js(n){return n==null?wM:Array.isArray(n)?n:[n]}var Ue=(function(n){return n[n.Word=0]="Word",n[n.Space=1]="Space",n[n.Other=2]="Other",n})(Ue||(Ue={}));const QM=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let Mf;try{Mf=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function $M(n){if(Mf)return Mf.test(n);for(let e=0;e<n.length;e++){let t=n[e];if(/\w/.test(t)||t>""&&(t.toUpperCase()!=t.toLowerCase()||QM.test(t)))return!0}return!1}function CM(n){return e=>{if(!/\S/.test(e))return Ue.Space;if($M(e))return Ue.Word;for(let t=0;t<n.length;t++)if(e.indexOf(n[t])>-1)return Ue.Word;return Ue.Other}}let Ge=class jn{constructor(e,t,r,i,s,o){this.config=e,this.doc=t,this.selection=r,this.values=i,this.status=e.statusTemplate.slice(),this.computeSlot=s,o&&(o._state=this);for(let a=0;a<this.config.dynamicSlots.length;a++)ea(this,a<<1);this.computeSlot=null}field(e,t=!0){let r=this.config.address[e.id];if(r==null){if(t)throw new RangeError("Field is not present in this state");return}return ea(this,r),qc(this,r)}update(...e){return dS(this,e,!0)}applyTransaction(e){let t=this.config,{base:r,compartments:i}=t;for(let a of e.effects)a.is(ld.reconfigure)?(t&&(i=new Map,t.compartments.forEach((l,c)=>i.set(c,l)),t=null),i.set(a.value.compartment,a.value.extension)):a.is(oe.reconfigure)?(t=null,r=a.value):a.is(oe.appendConfig)&&(t=null,r=js(r).concat(a.value));let s;t?s=e.startState.values.slice():(t=UO.resolve(r,i,this),s=new jn(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(l,c)=>c.reconfigure(l,this),null).values);let o=e.startState.facet(Pf)?e.newSelection:e.newSelection.asSingle();new jn(t,e.newDoc,o,s,(a,l)=>l.update(a,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:A.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,r=e(t.ranges[0]),i=this.changes(r.changes),s=[r.range],o=js(r.effects);for(let a=1;a<t.ranges.length;a++){let l=e(t.ranges[a]),c=this.changes(l.changes),d=c.map(i);for(let f=0;f<a;f++)s[f]=s[f].map(d);let h=i.mapDesc(c,!0);s.push(l.range.map(h)),i=i.compose(d),o=oe.mapEffects(o,d).concat(oe.mapEffects(js(l.effects),h))}return{changes:i,selection:A.create(s,t.mainIndex),effects:o}}changes(e=[]){return e instanceof ft?e:ft.of(e,this.doc.length,this.facet(jn.lineSeparator))}toText(e){return xe.of(e.split(this.facet(jn.lineSeparator)||kf))}sliceDoc(e=0,t=this.doc.length){return this.doc.sliceString(e,t,this.lineBreak)}facet(e){let t=this.config.address[e.id];return t==null?e.default:(ea(this,t),qc(this,t))}toJSON(e){let t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let r in e){let i=e[r];i instanceof Mt&&this.config.address[i.id]!=null&&(t[r]=i.spec.toJSON(this.field(e[r]),this))}return t}static fromJSON(e,t={},r){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let i=[];if(r){for(let s in r)if(Object.prototype.hasOwnProperty.call(e,s)){let o=r[s],a=e[s];i.push(o.init(l=>o.spec.fromJSON(a,l)))}}return jn.create({doc:e.doc,selection:A.fromJSON(e.selection),extensions:t.extensions?i.concat([t.extensions]):i})}static create(e={}){let t=UO.resolve(e.extensions||[],new Map),r=e.doc instanceof xe?e.doc:xe.of((e.doc||"").split(t.staticFacet(jn.lineSeparator)||kf)),i=e.selection?e.selection instanceof A?e.selection:A.single(e.selection.anchor,e.selection.head):A.single(0);return tS(i,r.length),t.staticFacet(Pf)||(i=i.asSingle()),new jn(t,r,i,t.dynamicSlots.map(()=>null),(s,o)=>o.create(s),null)}get tabSize(){return this.facet(jn.tabSize)}get lineBreak(){return this.facet(jn.lineSeparator)||`
|
|
48
|
+
`}get readOnly(){return this.facet(cS)}phrase(e,...t){for(let r of this.facet(jn.phrases))if(Object.prototype.hasOwnProperty.call(r,e)){e=r[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(r,i)=>{if(i=="$")return"$";let s=+(i||1);return!s||s>t.length?r:t[s-1]})),e}languageDataAt(e,t,r=-1){let i=[];for(let s of this.facet(iS))for(let o of s(this,t,r))Object.prototype.hasOwnProperty.call(o,e)&&i.push(o[e]);return i}charCategorizer(e){let t=this.languageDataAt("wordChars",e);return CM(t.length?t[0]:"")}wordAt(e){let{text:t,from:r,length:i}=this.doc.lineAt(e),s=this.charCategorizer(e),o=e-r,a=e-r;for(;o>0;){let l=bt(t,o,!1);if(s(t.slice(l,o))!=Ue.Word)break;o=l}for(;a<i;){let l=bt(t,a);if(s(t.slice(a,l))!=Ue.Word)break;a=l}return o==a?null:A.range(o+r,a+r)}};Ge.allowMultipleSelections=Pf;Ge.tabSize=W.define({combine:n=>n.length?n[0]:4});Ge.lineSeparator=sS;Ge.readOnly=cS;Ge.phrases=W.define({compare(n,e){let t=Object.keys(n),r=Object.keys(e);return t.length==r.length&&t.every(i=>n[i]==e[i])}});Ge.languageData=iS;Ge.changeFilter=oS;Ge.transactionFilter=aS;Ge.transactionExtender=lS;ld.reconfigure=oe.define();function br(n,e,t={}){let r={};for(let i of n)for(let s of Object.keys(i)){let o=i[s],a=r[s];if(a===void 0)r[s]=o;else if(!(a===o||o===void 0))if(Object.hasOwnProperty.call(t,s))r[s]=t[s](a,o);else throw new Error("Config merge conflict for field "+s)}for(let i in e)r[i]===void 0&&(r[i]=e[i]);return r}class Oi{eq(e){return this==e}range(e,t=e){return Ma.create(e,t,this)}}Oi.prototype.startSide=Oi.prototype.endSide=0;Oi.prototype.point=!1;Oi.prototype.mapMode=Ct.TrackDel;function Sm(n,e){return n==e||n.constructor==e.constructor&&n.eq(e)}class Ma{constructor(e,t,r){this.from=e,this.to=t,this.value=r}static create(e,t,r){return new Ma(e,t,r)}}function Af(n,e){return n.from-e.from||n.value.startSide-e.value.startSide}class km{constructor(e,t,r,i){this.from=e,this.to=t,this.value=r,this.maxPoint=i}get length(){return this.to[this.to.length-1]}findIndex(e,t,r,i=0){let s=r?this.to:this.from;for(let o=i,a=s.length;;){if(o==a)return o;let l=o+a>>1,c=s[l]-e||(r?this.value[l].endSide:this.value[l].startSide)-t;if(l==o)return c>=0?o:a;c>=0?a=l:o=l+1}}between(e,t,r,i){for(let s=this.findIndex(t,-1e9,!0),o=this.findIndex(r,1e9,!1,s);s<o;s++)if(i(this.from[s]+e,this.to[s]+e,this.value[s])===!1)return!1}map(e,t){let r=[],i=[],s=[],o=-1,a=-1;for(let l=0;l<this.value.length;l++){let c=this.value[l],d=this.from[l]+e,h=this.to[l]+e,f,p;if(d==h){let m=t.mapPos(d,c.startSide,c.mapMode);if(m==null||(f=p=m,c.startSide!=c.endSide&&(p=t.mapPos(d,c.endSide),p<f)))continue}else if(f=t.mapPos(d,c.startSide),p=t.mapPos(h,c.endSide),f>p||f==p&&c.startSide>0&&c.endSide<=0)continue;(p-f||c.endSide-c.startSide)<0||(o<0&&(o=f),c.point&&(a=Math.max(a,p-f)),r.push(c),i.push(f-o),s.push(p-o))}return{mapped:r.length?new km(i,s,r,a):null,pos:o}}}class me{constructor(e,t,r,i){this.chunkPos=e,this.chunk=t,this.nextLayer=r,this.maxPoint=i}static create(e,t,r,i){return new me(e,t,r,i)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:r=!1,filterFrom:i=0,filterTo:s=this.length}=e,o=e.filter;if(t.length==0&&!o)return this;if(r&&(t=t.slice().sort(Af)),this.isEmpty)return t.length?me.of(t):this;let a=new hS(this,null,-1).goto(0),l=0,c=[],d=new Br;for(;a.value||l<t.length;)if(l<t.length&&(a.from-t[l].from||a.startSide-t[l].value.startSide)>=0){let h=t[l++];d.addInner(h.from,h.to,h.value)||c.push(h)}else a.rangeIndex==1&&a.chunkIndex<this.chunk.length&&(l==t.length||this.chunkEnd(a.chunkIndex)<t[l].from)&&(!o||i>this.chunkEnd(a.chunkIndex)||s<this.chunkPos[a.chunkIndex])&&d.addChunk(this.chunkPos[a.chunkIndex],this.chunk[a.chunkIndex])?a.nextChunk():((!o||i>a.to||s<a.from||o(a.from,a.to,a.value))&&(d.addInner(a.from,a.to,a.value)||c.push(Ma.create(a.from,a.to,a.value))),a.next());return d.finishInner(this.nextLayer.isEmpty&&!c.length?me.empty:this.nextLayer.update({add:c,filter:o,filterFrom:i,filterTo:s}))}map(e){if(e.empty||this.isEmpty)return this;let t=[],r=[],i=-1;for(let o=0;o<this.chunk.length;o++){let a=this.chunkPos[o],l=this.chunk[o],c=e.touchesRange(a,a+l.length);if(c===!1)i=Math.max(i,l.maxPoint),t.push(l),r.push(e.mapPos(a));else if(c===!0){let{mapped:d,pos:h}=l.map(a,e);d&&(i=Math.max(i,d.maxPoint),t.push(d),r.push(h))}}let s=this.nextLayer.map(e);return t.length==0?s:new me(r,t,s||me.empty,i)}between(e,t,r){if(!this.isEmpty){for(let i=0;i<this.chunk.length;i++){let s=this.chunkPos[i],o=this.chunk[i];if(t>=s&&e<=s+o.length&&o.between(s,e-s,t-s,r)===!1)return}this.nextLayer.between(e,t,r)}}iter(e=0){return Aa.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return Aa.from(e).goto(t)}static compare(e,t,r,i,s=-1){let o=e.filter(h=>h.maxPoint>0||!h.isEmpty&&h.maxPoint>=s),a=t.filter(h=>h.maxPoint>0||!h.isEmpty&&h.maxPoint>=s),l=GO(o,a,r),c=new $o(o,l,s),d=new $o(a,l,s);r.iterGaps((h,f,p)=>HO(c,h,d,f,p,i)),r.empty&&r.length==0&&HO(c,0,d,0,0,i)}static eq(e,t,r=0,i){i==null&&(i=999999999);let s=e.filter(d=>!d.isEmpty&&t.indexOf(d)<0),o=t.filter(d=>!d.isEmpty&&e.indexOf(d)<0);if(s.length!=o.length)return!1;if(!s.length)return!0;let a=GO(s,o),l=new $o(s,a,0).goto(r),c=new $o(o,a,0).goto(r);for(;;){if(l.to!=c.to||!Rf(l.active,c.active)||l.point&&(!c.point||!Sm(l.point,c.point)))return!1;if(l.to>i)return!0;l.next(),c.next()}}static spans(e,t,r,i,s=-1){let o=new $o(e,null,s).goto(t),a=t,l=o.openStart;for(;;){let c=Math.min(o.to,r);if(o.point){let d=o.activeForPoint(o.to),h=o.pointFrom<t?d.length+1:o.point.startSide<0?d.length:Math.min(d.length,l);i.point(a,c,o.point,d,h,o.pointRank),l=Math.min(o.openEnd(c),d.length)}else c>a&&(i.span(a,c,o.active,l),l=o.openEnd(c));if(o.to>r)return l+(o.point&&o.to>r?1:0);a=o.to,o.next()}}static of(e,t=!1){let r=new Br;for(let i of e instanceof Ma?[e]:t?PM(e):e)r.add(i.from,i.to,i.value);return r.finish()}static join(e){if(!e.length)return me.empty;let t=e[e.length-1];for(let r=e.length-2;r>=0;r--)for(let i=e[r];i!=me.empty;i=i.nextLayer)t=new me(i.chunkPos,i.chunk,t,Math.max(i.maxPoint,t.maxPoint));return t}}me.empty=new me([],[],null,-1);function PM(n){if(n.length>1)for(let e=n[0],t=1;t<n.length;t++){let r=n[t];if(Af(e,r)>0)return n.slice().sort(Af);e=r}return n}me.empty.nextLayer=me.empty;class Br{finishChunk(e){this.chunks.push(new km(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,t,r){this.addInner(e,t,r)||(this.nextLayer||(this.nextLayer=new Br)).add(e,t,r)}addInner(e,t,r){let i=e-this.lastTo||r.startSide-this.last.endSide;if(i<=0&&(e-this.lastFrom||r.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return i<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=r,this.lastFrom=e,this.lastTo=t,this.value.push(r),r.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let r=t.value.length-1;return this.last=t.value[r],this.lastFrom=t.from[r]+e,this.lastTo=t.to[r]+e,!0}finish(){return this.finishInner(me.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=me.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function GO(n,e,t){let r=new Map;for(let s of n)for(let o=0;o<s.chunk.length;o++)s.chunk[o].maxPoint<=0&&r.set(s.chunk[o],s.chunkPos[o]);let i=new Set;for(let s of e)for(let o=0;o<s.chunk.length;o++){let a=r.get(s.chunk[o]);a!=null&&(t?t.mapPos(a):a)==s.chunkPos[o]&&!t?.touchesRange(a,a+s.chunk[o].length)&&i.add(s.chunk[o])}return i}class hS{constructor(e,t,r,i=0){this.layer=e,this.skip=t,this.minPoint=r,this.rank=i}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,t=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,t,!1),this}gotoInner(e,t,r){for(;this.chunkIndex<this.layer.chunk.length;){let i=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(i)||this.layer.chunkEnd(this.chunkIndex)<e||i.maxPoint<this.minPoint))break;this.chunkIndex++,r=!1}if(this.chunkIndex<this.layer.chunk.length){let i=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],t,!0);(!r||this.rangeIndex<i)&&this.setRangeIndex(i)}this.next()}forward(e,t){(this.to-e||this.endSide-t)<0&&this.gotoInner(e,t,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let e=this.layer.chunkPos[this.chunkIndex],t=this.layer.chunk[this.chunkIndex],r=e+t.from[this.rangeIndex];if(this.from=r,this.to=e+t.to[this.rangeIndex],this.value=t.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}}class Aa{constructor(e){this.heap=e}static from(e,t=null,r=-1){let i=[];for(let s=0;s<e.length;s++)for(let o=e[s];!o.isEmpty;o=o.nextLayer)o.maxPoint>=r&&i.push(new hS(o,t,r,s));return i.length==1?i[0]:new Aa(i)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let r of this.heap)r.goto(e,t);for(let r=this.heap.length>>1;r>=0;r--)eh(this.heap,r);return this.next(),this}forward(e,t){for(let r of this.heap)r.forward(e,t);for(let r=this.heap.length>>1;r>=0;r--)eh(this.heap,r);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),eh(this.heap,0)}}}function eh(n,e){for(let t=n[e];;){let r=(e<<1)+1;if(r>=n.length)break;let i=n[r];if(r+1<n.length&&i.compare(n[r+1])>=0&&(i=n[r+1],r++),t.compare(i)<0)break;n[r]=t,n[e]=i,e=r}}class $o{constructor(e,t,r){this.minPoint=r,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=Aa.from(e,t,r)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){Rl(this.active,e),Rl(this.activeTo,e),Rl(this.activeRank,e),this.minActive=KO(this.active,this.activeTo)}addActive(e){let t=0,{value:r,to:i,rank:s}=this.cursor;for(;t<this.activeRank.length&&(s-this.activeRank[t]||i-this.activeTo[t])>0;)t++;El(this.active,t,r),El(this.activeTo,t,i),El(this.activeRank,t,s),e&&El(e,t,this.cursor.from),this.minActive=KO(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let r=this.openStart<0?[]:null;for(;;){let i=this.minActive;if(i>-1&&(this.activeTo[i]-this.cursor.from||this.active[i].endSide-this.cursor.startSide)<0){if(this.activeTo[i]>e){this.to=this.activeTo[i],this.endSide=this.active[i].endSide;break}this.removeActive(i),r&&Rl(r,i)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let s=this.cursor.value;if(!s.point)this.addActive(r),this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=s,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=s.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else{this.to=this.endSide=1e9;break}}if(r){this.openStart=0;for(let i=r.length-1;i>=0&&r[i]<e;i--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let t=[];for(let r=this.active.length-1;r>=0&&!(this.activeRank[r]<this.pointRank);r--)(this.activeTo[r]>e||this.activeTo[r]==e&&this.active[r].endSide>=this.point.endSide)&&t.push(this.active[r]);return t.reverse()}openEnd(e){let t=0;for(let r=this.activeTo.length-1;r>=0&&this.activeTo[r]>e;r--)t++;return t}}function HO(n,e,t,r,i,s){n.goto(e),t.goto(r);let o=r+i,a=r,l=r-e,c=!!s.boundChange;for(let d=!1;;){let h=n.to+l-t.to,f=h||n.endSide-t.endSide,p=f<0?n.to+l:t.to,m=Math.min(p,o);if(n.point||t.point?(n.point&&t.point&&Sm(n.point,t.point)&&Rf(n.activeForPoint(n.to),t.activeForPoint(t.to))||s.comparePoint(a,m,n.point,t.point),d=!1):(d&&s.boundChange(a),m>a&&!Rf(n.active,t.active)&&s.compareRange(a,m,n.active,t.active),c&&m<o&&(h||n.openEnd(p)!=t.openEnd(p))&&(d=!0)),p>o)break;a=p,f<=0&&n.next(),f>=0&&t.next()}}function Rf(n,e){if(n.length!=e.length)return!1;for(let t=0;t<n.length;t++)if(n[t]!=e[t]&&!Sm(n[t],e[t]))return!1;return!0}function Rl(n,e){for(let t=e,r=n.length-1;t<r;t++)n[t]=n[t+1];n.pop()}function El(n,e,t){for(let r=n.length-1;r>=e;r--)n[r+1]=n[r];n[e]=t}function KO(n,e){let t=-1,r=1e9;for(let i=0;i<e.length;i++)(e[i]-r||n[i].endSide-n[t].endSide)<0&&(t=i,r=e[i]);return t}function po(n,e,t=n.length){let r=0;for(let i=0;i<t&&i<n.length;)n.charCodeAt(i)==9?(r+=e-r%e,i++):(r++,i=bt(n,i));return r}function Ef(n,e,t,r){for(let i=0,s=0;;){if(s>=e)return i;if(i==n.length)break;s+=n.charCodeAt(i)==9?t-s%t:1,i=bt(n,i)}return r===!0?-1:n.length}const Nf="ͼ",JO=typeof Symbol>"u"?"__"+Nf:Symbol.for(Nf),Df=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),e0=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class bi{constructor(e,t){this.rules=[];let{finish:r}=t||{};function i(o){return/^@/.test(o)?[o]:o.split(/,\s*/)}function s(o,a,l,c){let d=[],h=/^@(\w+)\b/.exec(o[0]),f=h&&h[1]=="keyframes";if(h&&a==null)return l.push(o[0]+";");for(let p in a){let m=a[p];if(/&/.test(p))s(p.split(/,\s*/).map(O=>o.map(b=>O.replace(/&/,b))).reduce((O,b)=>O.concat(b)),m,l);else if(m&&typeof m=="object"){if(!h)throw new RangeError("The value of a property ("+p+") should be a primitive value.");s(i(p),m,d,f)}else m!=null&&d.push(p.replace(/_.*/,"").replace(/[A-Z]/g,O=>"-"+O.toLowerCase())+": "+m+";")}(d.length||f)&&l.push((r&&!h&&!c?o.map(r):o).join(", ")+" {"+d.join(" ")+"}")}for(let o in e)s(i(o),e[o],this.rules)}getRules(){return this.rules.join(`
|
|
49
|
+
`)}static newName(){let e=e0[JO]||1;return e0[JO]=e+1,Nf+e.toString(36)}static mount(e,t,r){let i=e[Df],s=r&&r.nonce;i?s&&i.setNonce(s):i=new TM(e,s),i.mount(Array.isArray(t)?t:[t],e)}}let t0=new Map;class TM{constructor(e,t){let r=e.ownerDocument||e,i=r.defaultView;if(!e.head&&e.adoptedStyleSheets&&i.CSSStyleSheet){let s=t0.get(r);if(s)return e[Df]=s;this.sheet=new i.CSSStyleSheet,t0.set(r,this)}else this.styleTag=r.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);this.modules=[],e[Df]=this}mount(e,t){let r=this.sheet,i=0,s=0,o=!1;for(let a=0;a<e.length;a++){let l=e[a],c=this.modules.indexOf(l);if(c<s&&c>-1&&(this.modules.splice(c,1),o=!0,s--,c=-1),c==-1){if(this.modules.splice(s++,0,l),o=!0,r)for(let d=0;d<l.rules.length;d++)r.insertRule(l.rules[d],i++)}else{for(;s<c;)i+=this.modules[s++].rules.length;i+=l.rules.length,s++}}if(r)t.adoptedStyleSheets.indexOf(this.sheet)<0&&(t.adoptedStyleSheets=[this.sheet,...t.adoptedStyleSheets]);else{if(o){let l="";for(let c=0;c<this.modules.length;c++)l+=this.modules[c].getRules()+`
|
|
50
|
+
`;this.styleTag.textContent=l}let a=t.head||t;this.styleTag.parentNode!=a&&a.insertBefore(this.styleTag,a.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}var Zr={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Ra={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},MM=typeof navigator<"u"&&/Mac/.test(navigator.platform),AM=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Qt=0;Qt<10;Qt++)Zr[48+Qt]=Zr[96+Qt]=String(Qt);for(var Qt=1;Qt<=24;Qt++)Zr[Qt+111]="F"+Qt;for(var Qt=65;Qt<=90;Qt++)Zr[Qt]=String.fromCharCode(Qt+32),Ra[Qt]=String.fromCharCode(Qt);for(var th in Zr)Ra.hasOwnProperty(th)||(Ra[th]=Zr[th]);function fS(n){var e=MM&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||AM&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?Ra:Zr)[n.keyCode]||n.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}function Ce(){var n=arguments[0];typeof n=="string"&&(n=document.createElement(n));var e=1,t=arguments[1];if(t&&typeof t=="object"&&t.nodeType==null&&!Array.isArray(t)){for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){var i=t[r];typeof i=="string"?n.setAttribute(r,i):i!=null&&(n[r]=i)}e++}for(;e<arguments.length;e++)pS(n,arguments[e]);return n}function pS(n,e){if(typeof e=="string")n.appendChild(document.createTextNode(e));else if(e!=null)if(e.nodeType!=null)n.appendChild(e);else if(Array.isArray(e))for(var t=0;t<e.length;t++)pS(n,e[t]);else throw new RangeError("Unsupported child node: "+e)}let Zt=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},jf=typeof document<"u"?document:{documentElement:{style:{}}};const If=/Edge\/(\d+)/.exec(Zt.userAgent),mS=/MSIE \d/.test(Zt.userAgent),Xf=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Zt.userAgent),cd=!!(mS||Xf||If),n0=!cd&&/gecko\/(\d+)/i.test(Zt.userAgent),nh=!cd&&/Chrome\/(\d+)/.exec(Zt.userAgent),r0="webkitFontSmoothing"in jf.documentElement.style,Lf=!cd&&/Apple Computer/.test(Zt.vendor),i0=Lf&&(/Mobile\/\w+/.test(Zt.userAgent)||Zt.maxTouchPoints>2);var Z={mac:i0||/Mac/.test(Zt.platform),windows:/Win/.test(Zt.platform),linux:/Linux|X11/.test(Zt.platform),ie:cd,ie_version:mS?jf.documentMode||6:Xf?+Xf[1]:If?+If[1]:0,gecko:n0,gecko_version:n0?+(/Firefox\/(\d+)/.exec(Zt.userAgent)||[0,0])[1]:0,chrome:!!nh,chrome_version:nh?+nh[1]:0,ios:i0,android:/Android\b/.test(Zt.userAgent),webkit:r0,webkit_version:r0?+(/\bAppleWebKit\/(\d+)/.exec(Zt.userAgent)||[0,0])[1]:0,safari:Lf,safari_version:Lf?+(/\bVersion\/(\d+(\.\d+)?)/.exec(Zt.userAgent)||[0,0])[1]:0,tabSize:jf.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function vm(n,e){for(let t in n)t=="class"&&e.class?e.class+=" "+n.class:t=="style"&&e.style?e.style+=";"+n.style:e[t]=n[t];return e}const Yc=Object.create(null);function wm(n,e,t){if(n==e)return!0;n||(n=Yc),e||(e=Yc);let r=Object.keys(n),i=Object.keys(e);if(r.length-0!=i.length-0)return!1;for(let s of r)if(s!=t&&(i.indexOf(s)==-1||n[s]!==e[s]))return!1;return!0}function RM(n,e){for(let t=n.attributes.length-1;t>=0;t--){let r=n.attributes[t].name;e[r]==null&&n.removeAttribute(r)}for(let t in e){let r=e[t];t=="style"?n.style.cssText=r:n.getAttribute(t)!=r&&n.setAttribute(t,r)}}function s0(n,e,t){let r=!1;if(e)for(let i in e)t&&i in t||(r=!0,i=="style"?n.style.cssText="":n.removeAttribute(i));if(t)for(let i in t)e&&e[i]==t[i]||(r=!0,i=="style"?n.style.cssText=t[i]:n.setAttribute(i,t[i]));return r}function EM(n){let e=Object.create(null);for(let t=0;t<n.attributes.length;t++){let r=n.attributes[t];e[r.name]=r.value}return e}let zn=class{eq(e){return!1}updateDOM(e,t,r){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,t,r){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}};var Tt=(function(n){return n[n.Text=0]="Text",n[n.WidgetBefore=1]="WidgetBefore",n[n.WidgetAfter=2]="WidgetAfter",n[n.WidgetRange=3]="WidgetRange",n})(Tt||(Tt={}));let G=class extends Oi{constructor(e,t,r,i){super(),this.startSide=e,this.endSide=t,this.widget=r,this.spec=i}get heightRelevant(){return!1}static mark(e){return new ol(e)}static widget(e){let t=Math.max(-1e4,Math.min(1e4,e.side||0)),r=!!e.block;return t+=r&&!e.inlineOrder?t>0?3e8:-4e8:t>0?1e8:-1e8,new Ji(e,t,t,r,e.widget||null,!1)}static replace(e){let t=!!e.block,r,i;if(e.isBlockGap)r=-5e8,i=4e8;else{let{start:s,end:o}=gS(e,t);r=(s?t?-3e8:-1:5e8)-1,i=(o?t?2e8:1:-6e8)+1}return new Ji(e,r,i,t,e.widget||null,!0)}static line(e){return new al(e)}static set(e,t=!1){return me.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}};G.none=me.empty;class ol extends G{constructor(e){let{start:t,end:r}=gS(e);super(t?-1:5e8,r?1:-6e8,null,e),this.tagName=e.tagName||"span",this.attrs=e.class&&e.attributes?vm(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||Yc}eq(e){return this==e||e instanceof ol&&this.tagName==e.tagName&&wm(this.attrs,e.attrs)}range(e,t=e){if(e>=t)throw new RangeError("Mark decorations may not be empty");return super.range(e,t)}}ol.prototype.point=!1;class al extends G{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof al&&this.spec.class==e.spec.class&&wm(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,t)}}al.prototype.mapMode=Ct.TrackBefore;al.prototype.point=!0;class Ji extends G{constructor(e,t,r,i,s,o){super(t,r,s,e),this.block=i,this.isReplace=o,this.mapMode=i?t<=0?Ct.TrackBefore:Ct.TrackAfter:Ct.TrackDel}get type(){return this.startSide!=this.endSide?Tt.WidgetRange:this.startSide<=0?Tt.WidgetBefore:Tt.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof Ji&&NM(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,t)}}Ji.prototype.point=!0;function gS(n,e=!1){let{inclusiveStart:t,inclusiveEnd:r}=n;return t==null&&(t=n.inclusive),r==null&&(r=n.inclusive),{start:t??e,end:r??e}}function NM(n,e){return n==e||!!(n&&e&&n.compare(e))}function Is(n,e,t,r=0){let i=t.length-1;i>=0&&t[i]+r>=n?t[i]=Math.max(t[i],e):t.push(n,e)}class Ea extends Oi{constructor(e,t,r){super(),this.tagName=e,this.attributes=t,this.rank=r}eq(e){return e==this||e instanceof Ea&&this.tagName==e.tagName&&wm(this.attributes,e.attributes)}static create(e){return new Ea(e.tagName,e.attributes||Yc,e.rank==null?50:Math.max(0,Math.min(e.rank,100)))}static set(e,t=!1){return me.of(e,t)}}Ea.prototype.startSide=Ea.prototype.endSide=-1;const yt=n=>n.nodeType==1,Us=n=>n.nodeType==3;function Na(n){let e;return n.nodeType==11?e=n.getSelection?n:n.ownerDocument:e=n,e.getSelection()}function _f(n,e){return e?n==e||n.contains(e.nodeType!=1?e.parentNode:e):!1}function ta(n,e){if(!e.anchorNode)return!1;try{return _f(n,e.anchorNode)}catch{return!1}}function na(n){return Us(n)?ja(n,0,n.nodeValue.length).getClientRects():yt(n)?n.getClientRects():[]}function ra(n,e,t,r){return t?o0(n,e,t,r,-1)||o0(n,e,t,r,1):!1}function yi(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e}function Uc(n){return yt(n)&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(n.nodeName)}function o0(n,e,t,r,i){for(;;){if(n==t&&e==r)return!0;if(e==(i<0?0:Wr(n))){if(n.nodeName=="DIV")return!1;let s=n.parentNode;if(!s||!yt(s))return!1;e=yi(n)+(i<0?0:1),n=s}else if(yt(n)){if(n=n.childNodes[e+(i<0?-1:0)],yt(n)&&(n.nodeName=="IMG"||n.nodeName=="BR"||n.contentEditable=="false"))return!1;e=i<0?Wr(n):0}else return!1}}function Wr(n){return Us(n)?n.nodeValue.length:n.childNodes.length}function Da(n,e){let{left:t,right:r}=n;if(t==r)return n;let i=e?t:r;return{left:i,right:i,top:n.top,bottom:n.bottom}}function DM(n){let e=n.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:n.innerWidth,top:0,bottom:n.innerHeight}}function OS(n,e){let t=e.width/n.offsetWidth,r=e.height/n.offsetHeight;return(t>.995&&t<1.005||!isFinite(t)||Math.abs(e.width-n.offsetWidth)<1)&&(t=1),(r>.995&&r<1.005||!isFinite(r)||Math.abs(e.height-n.offsetHeight)<1)&&(r=1),{scaleX:t,scaleY:r}}function jM(n,e,t,r,i,s,o,a){let l=n.ownerDocument,c=l.defaultView||window;for(let d=n,h=!1;d&&!h;)if(yt(d)){let f,p=d==l.body,m=1,O=1;if(p)f=DM(c);else{if(/^(fixed|sticky)$/.test(getComputedStyle(d).position)&&(h=!0),d.scrollHeight<=d.clientHeight&&d.scrollWidth<=d.clientWidth){d=d.assignedSlot||d.parentNode;continue}let k=d.getBoundingClientRect();({scaleX:m,scaleY:O}=OS(d,k)),f={left:k.left,right:k.left+d.clientWidth*m,top:k.top,bottom:k.top+d.clientHeight*O}}let b=0,y=0;if(i=="nearest")e.top<f.top+o?(y=e.top-(f.top+o),t>0&&e.bottom>f.bottom+y&&(y=e.bottom-f.bottom+o)):e.bottom>f.bottom-o&&(y=e.bottom-f.bottom+o,t<0&&e.top-y<f.top&&(y=e.top-(f.top+o)));else{let k=e.bottom-e.top,x=f.bottom-f.top;y=(i=="center"&&k<=x?e.top+k/2-x/2:i=="start"||i=="center"&&t<0?e.top-o:e.bottom-x+o)-f.top}if(r=="nearest"?e.left<f.left+s?(b=e.left-(f.left+s),t>0&&e.right>f.right+b&&(b=e.right-f.right+s)):e.right>f.right-s&&(b=e.right-f.right+s,t<0&&e.left<f.left+b&&(b=e.left-(f.left+s))):b=(r=="center"?e.left+(e.right-e.left)/2-(f.right-f.left)/2:r=="start"==a?e.left-s:e.right-(f.right-f.left)+s)-f.left,b||y)if(p)c.scrollBy(b,y);else{let k=0,x=0;if(y){let S=d.scrollTop;d.scrollTop+=y/O,x=(d.scrollTop-S)*O}if(b){let S=d.scrollLeft;d.scrollLeft+=b/m,k=(d.scrollLeft-S)*m}e={left:e.left-k,top:e.top-x,right:e.right-k,bottom:e.bottom-x},k&&Math.abs(k-b)<1&&(r="nearest"),x&&Math.abs(x-y)<1&&(i="nearest")}if(p)break;(e.top<f.top||e.bottom>f.bottom||e.left<f.left||e.right>f.right)&&(e={left:Math.max(e.left,f.left),right:Math.min(e.right,f.right),top:Math.max(e.top,f.top),bottom:Math.min(e.bottom,f.bottom)}),d=d.assignedSlot||d.parentNode}else if(d.nodeType==11)d=d.host;else break}function bS(n,e=!0){let t=n.ownerDocument,r=null,i=null;for(let s=n.parentNode;s&&!(s==t.body||(!e||r)&&i);)if(yt(s))!i&&s.scrollHeight>s.clientHeight&&(i=s),e&&!r&&s.scrollWidth>s.clientWidth&&(r=s),s=s.assignedSlot||s.parentNode;else if(s.nodeType==11)s=s.host;else break;return{x:r,y:i}}class IM{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:r}=e;this.set(t,Math.min(e.anchorOffset,t?Wr(t):0),r,Math.min(e.focusOffset,r?Wr(r):0))}set(e,t,r,i){this.anchorNode=e,this.anchorOffset=t,this.focusNode=r,this.focusOffset=i}}function yS(n){let e=[];for(let t=n;t;t=t.nodeType==11?t.host:t.parentNode)yt(t)&&e.push({node:t,left:t.scrollLeft,top:t.scrollTop});return e}function xS(n,e=!0){for(let{node:t,left:r,top:i}of n)e&&t.scrollTop!=i&&(t.scrollTop=i),t.scrollLeft!=r&&(t.scrollLeft=r)}let Ri=null;Z.safari&&Z.safari_version>=26&&(Ri=!1);function SS(n){if(n.setActive)return n.setActive();if(Ri)return n.focus(Ri);let e=yS(n);n.focus(Ri==null?{get preventScroll(){return Ri={preventScroll:!0},!0}}:void 0),Ri||(Ri=!1,xS(e))}let a0;function ja(n,e,t=e){let r=a0||(a0=document.createRange());return r.setEnd(n,t),r.setStart(n,e),r}function Xs(n,e,t,r){let i={key:e,code:e,keyCode:t,which:t,cancelable:!0};r&&({altKey:i.altKey,ctrlKey:i.ctrlKey,shiftKey:i.shiftKey,metaKey:i.metaKey}=r);let s=new KeyboardEvent("keydown",i);s.synthetic=!0,n.dispatchEvent(s);let o=new KeyboardEvent("keyup",i);return o.synthetic=!0,n.dispatchEvent(o),s.defaultPrevented||o.defaultPrevented}function XM(n){for(;n;){if(n&&(n.nodeType==9||n.nodeType==11&&n.host))return n;n=n.assignedSlot||n.parentNode}return null}function LM(n,e){let t=e.focusNode,r=e.focusOffset;if(!t||e.anchorNode!=t||e.anchorOffset!=r)return!1;for(r=Math.min(r,Wr(t));;)if(r){if(!yt(t))return!1;let i=t.childNodes[r-1];i.contentEditable=="false"?r--:(t=i,r=Wr(t))}else{if(t==n)return!0;r=yi(t),t=t.parentNode}}function kS(n){return n instanceof Window?n.pageYOffset>Math.max(0,n.document.documentElement.scrollHeight-n.innerHeight-4):n.scrollTop>Math.max(1,n.scrollHeight-n.clientHeight-4)}function vS(n,e){for(let t=n,r=e;;){if(Us(t)&&r>0)return{node:t,offset:r};if(yt(t)&&r>0){if(t.contentEditable=="false")return null;t=t.childNodes[r-1],r=Wr(t)}else if(t.parentNode&&!Uc(t))r=yi(t),t=t.parentNode;else return null}}function wS(n,e){for(let t=n,r=e;;){if(Us(t)&&r<t.nodeValue.length)return{node:t,offset:r};if(yt(t)&&r<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[r],r=0}else if(t.parentNode&&!Uc(t))r=yi(t)+1,t=t.parentNode;else return null}}class Ln{constructor(e,t,r=!0){this.node=e,this.offset=t,this.precise=r}static before(e,t){return new Ln(e.parentNode,yi(e),t)}static after(e,t){return new Ln(e.parentNode,yi(e)+1,t)}}var Re=(function(n){return n[n.LTR=0]="LTR",n[n.RTL=1]="RTL",n})(Re||(Re={}));const es=Re.LTR,Qm=Re.RTL;function QS(n){let e=[];for(let t=0;t<n.length;t++)e.push(1<<+n[t]);return e}const _M=QS("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),BM=QS("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),Bf=Object.create(null),Kn=[];for(let n of["()","[]","{}"]){let e=n.charCodeAt(0),t=n.charCodeAt(1);Bf[e]=t,Bf[t]=-e}function $S(n){return n<=247?_M[n]:1424<=n&&n<=1524?2:1536<=n&&n<=1785?BM[n-1536]:1774<=n&&n<=2220?4:8192<=n&&n<=8204?256:64336<=n&&n<=65023?4:1}const ZM=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class ar{get dir(){return this.level%2?Qm:es}constructor(e,t,r){this.from=e,this.to=t,this.level=r}side(e,t){return this.dir==t==e?this.to:this.from}forward(e,t){return e==(this.dir==t)}static find(e,t,r,i){let s=-1;for(let o=0;o<e.length;o++){let a=e[o];if(a.from<=t&&a.to>=t){if(a.level==r)return o;(s<0||(i!=0?i<0?a.from<t:a.to>t:e[s].level>a.level))&&(s=o)}}if(s<0)throw new RangeError("Index out of range");return s}}function CS(n,e){if(n.length!=e.length)return!1;for(let t=0;t<n.length;t++){let r=n[t],i=e[t];if(r.from!=i.from||r.to!=i.to||r.direction!=i.direction||!CS(r.inner,i.inner))return!1}return!0}const Me=[];function WM(n,e,t,r,i){for(let s=0;s<=r.length;s++){let o=s?r[s-1].to:e,a=s<r.length?r[s].from:t,l=s?256:i;for(let c=o,d=l,h=l;c<a;c++){let f=$S(n.charCodeAt(c));f==512?f=d:f==8&&h==4&&(f=16),Me[c]=f==4?2:f,f&7&&(h=f),d=f}for(let c=o,d=l,h=l;c<a;c++){let f=Me[c];if(f==128)c<a-1&&d==Me[c+1]&&d&24?f=Me[c]=d:Me[c]=256;else if(f==64){let p=c+1;for(;p<a&&Me[p]==64;)p++;let m=c&&d==8||p<t&&Me[p]==8?h==1?1:8:256;for(let O=c;O<p;O++)Me[O]=m;c=p-1}else f==8&&h==1&&(Me[c]=1);d=f,f&7&&(h=f)}}}function zM(n,e,t,r,i){let s=i==1?2:1;for(let o=0,a=0,l=0;o<=r.length;o++){let c=o?r[o-1].to:e,d=o<r.length?r[o].from:t;for(let h=c,f,p,m;h<d;h++)if(p=Bf[f=n.charCodeAt(h)])if(p<0){for(let O=a-3;O>=0;O-=3)if(Kn[O+1]==-p){let b=Kn[O+2],y=b&2?i:b&4?b&1?s:i:0;y&&(Me[h]=Me[Kn[O]]=y),a=O;break}}else{if(Kn.length==189)break;Kn[a++]=h,Kn[a++]=f,Kn[a++]=l}else if((m=Me[h])==2||m==1){let O=m==i;l=O?0:1;for(let b=a-3;b>=0;b-=3){let y=Kn[b+2];if(y&2)break;if(O)Kn[b+2]|=2;else{if(y&4)break;Kn[b+2]|=4}}}}}function VM(n,e,t,r){for(let i=0,s=r;i<=t.length;i++){let o=i?t[i-1].to:n,a=i<t.length?t[i].from:e;for(let l=o;l<a;){let c=Me[l];if(c==256){let d=l+1;for(;;)if(d==a){if(i==t.length)break;d=t[i++].to,a=i<t.length?t[i].from:e}else if(Me[d]==256)d++;else break;let h=s==1,f=(d<e?Me[d]:r)==1,p=h==f?h?1:2:r;for(let m=d,O=i,b=O?t[O-1].to:n;m>l;)m==b&&(m=t[--O].from,b=O?t[O-1].to:n),Me[--m]=p;l=d}else s=c,l++}}}function Zf(n,e,t,r,i,s,o){let a=r%2?2:1;if(r%2==i%2)for(let l=e,c=0;l<t;){let d=!0,h=!1;if(c==s.length||l<s[c].from){let O=Me[l];O!=a&&(d=!1,h=O==16)}let f=!d&&a==1?[]:null,p=d?r:r+1,m=l;e:for(;;)if(c<s.length&&m==s[c].from){if(h)break e;let O=s[c];if(!d)for(let b=O.to,y=c+1;;){if(b==t)break e;if(y<s.length&&s[y].from==b)b=s[y++].to;else{if(Me[b]==a)break e;break}}if(c++,f)f.push(O);else{O.from>l&&o.push(new ar(l,O.from,p));let b=O.direction==es!=!(p%2);Wf(n,b?r+1:r,i,O.inner,O.from,O.to,o),l=O.to}m=O.to}else{if(m==t||(d?Me[m]!=a:Me[m]==a))break;m++}f?Zf(n,l,m,r+1,i,f,o):l<m&&o.push(new ar(l,m,p)),l=m}else for(let l=t,c=s.length;l>e;){let d=!0,h=!1;if(!c||l>s[c-1].to){let O=Me[l-1];O!=a&&(d=!1,h=O==16)}let f=!d&&a==1?[]:null,p=d?r:r+1,m=l;e:for(;;)if(c&&m==s[c-1].to){if(h)break e;let O=s[--c];if(!d)for(let b=O.from,y=c;;){if(b==e)break e;if(y&&s[y-1].to==b)b=s[--y].from;else{if(Me[b-1]==a)break e;break}}if(f)f.push(O);else{O.to<l&&o.push(new ar(O.to,l,p));let b=O.direction==es!=!(p%2);Wf(n,b?r+1:r,i,O.inner,O.from,O.to,o),l=O.from}m=O.from}else{if(m==e||(d?Me[m-1]!=a:Me[m-1]==a))break;m--}f?Zf(n,m,l,r+1,i,f,o):m<l&&o.push(new ar(m,l,p)),l=m}}function Wf(n,e,t,r,i,s,o){let a=e%2?2:1;WM(n,i,s,r,a),zM(n,i,s,r,a),VM(i,s,r,a),Zf(n,i,s,e,t,r,o)}function FM(n,e,t){if(!n)return[new ar(0,0,e==Qm?1:0)];if(e==es&&!t.length&&!ZM.test(n))return PS(n.length);if(t.length)for(;n.length>Me.length;)Me[Me.length]=256;let r=[],i=e==es?0:1;return Wf(n,i,i,t,0,n.length,r),r}function PS(n){return[new ar(0,n,0)]}let TS="";function qM(n,e,t,r,i){var s;if(!n.length)return null;let o=r.head-n.from,a;if(r.head==n.from&&r.assoc<0){if(!i)return null;o=e[a=0].side(!1,t)}else if(r.head==n.to&&r.assoc>0){if(i)return null;o=e[a=e.length-1].side(!0,t)}else a=ar.find(e,o,(s=r.bidiLevel)!==null&&s!==void 0?s:-1,r.assoc);let l=e[a],c=l.side(i,t);if(o==c){let f=a+=i?1:-1;if(f<0||f>=e.length)return null;l=e[a=f],o=l.side(!i,t),c=l.side(i,t)}let d=bt(n.text,o,l.forward(i,t));(d<l.from||d>l.to)&&(d=c),TS=n.text.slice(Math.min(o,d),Math.max(o,d));let h=a==(i?e.length-1:0)?null:e[a+(i?1:-1)];if(d==c){if(!h)return i?A.cursor(n.to,1):A.cursor(n.from,-1);if(h.level+(i?0:1)<l.level)return A.cursor(h.side(!i,t)+n.from,h.forward(i,t)?1:-1,h.level)}return A.cursor(d+n.from,l.forward(i,t)?-1:1,l.level)}function YM(n,e,t){for(let r=e;r<t;r++){let i=$S(n.charCodeAt(r));if(i==1)return es;if(i==2||i==4)return Qm}return es}const MS=W.define(),AS=W.define(),RS=W.define(),ES=W.define(),zf=W.define(),NS=W.define(),DS=W.define(),$m=W.define(),Cm=W.define(),jS=W.define({combine:n=>n.some(e=>e)}),IS=W.define({combine:n=>n.some(e=>e)}),XS=W.define();class Ls{constructor(e,t,r,i,s,o=!1){this.range=e,this.y=t,this.x=r,this.yMargin=i,this.xMargin=s,this.isSnapshot=o}map(e){return e.empty?this:new Ls(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new Ls(A.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const Nl=oe.define({map:(n,e)=>n.map(e)}),LS=oe.define();function Kt(n,e,t){let r=n.facet(ES);r.length?r[0](e):window.onerror&&window.onerror(String(e),t,void 0,void 0,e)||(t?console.error(t+":",e):console.error(e))}const Mr=W.define({combine:n=>n.length?n[0]:!0});let UM=0;const Ms=W.define({combine(n){return n.filter((e,t)=>{for(let r=0;r<t;r++)if(n[r].plugin==e.plugin)return!1;return!0})}});class ot{constructor(e,t,r,i,s){this.id=e,this.create=t,this.domEventHandlers=r,this.domEventObservers=i,this.baseExtensions=s(this),this.extension=this.baseExtensions.concat(Ms.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(Ms.of({plugin:this,arg:e}))}static define(e,t){const{eventHandlers:r,eventObservers:i,provide:s,decorations:o}=t||{};return new ot(UM++,e,r,i,a=>{let l=[];return o&&l.push(ud.of(c=>{let d=c.plugin(a);return d?o(d):G.none})),s&&l.push(s(a)),l})}static fromClass(e,t){return ot.define((r,i)=>new e(r,i),t)}}class rh{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(this.value){if(this.mustUpdate){let t=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(t)}catch(r){if(Kt(t.state,r,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(t){Kt(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(!((t=this.value)===null||t===void 0)&&t.destroy)try{this.value.destroy()}catch(r){Kt(e.state,r,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const _S=W.define(),Pm=W.define(),ud=W.define(),BS=W.define(),Tm=W.define(),ll=W.define(),ZS=W.define();function l0(n,e){let t=n.state.facet(ZS);if(!t.length)return t;let r=t.map(s=>s instanceof Function?s(n):s),i=[];return me.spans(r,e.from,e.to,{point(){},span(s,o,a,l){let c=s-e.from,d=o-e.from,h=i;for(let f=a.length-1;f>=0;f--,l--){let p=a[f].spec.bidiIsolate,m;if(p==null&&(p=YM(e.text,c,d)),l>0&&h.length&&(m=h[h.length-1]).to==c&&m.direction==p)m.to=d,h=m.inner;else{let O={from:c,to:d,direction:p,inner:[]};h.push(O),h=O.inner}}}}),i}const WS=W.define();function Mm(n){let e=0,t=0,r=0,i=0;for(let s of n.state.facet(WS)){let o=s(n);o&&(o.left!=null&&(e=Math.max(e,o.left)),o.right!=null&&(t=Math.max(t,o.right)),o.top!=null&&(r=Math.max(r,o.top)),o.bottom!=null&&(i=Math.max(i,o.bottom)))}return{left:e,right:t,top:r,bottom:i}}const Zo=W.define();class Cn{constructor(e,t,r,i){this.fromA=e,this.toA=t,this.fromB=r,this.toB=i}join(e){return new Cn(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let t=e.length,r=this;for(;t>0;t--){let i=e[t-1];if(!(i.fromA>r.toA)){if(i.toA<r.fromA)break;r=r.join(i),e.splice(t-1,1)}}return e.splice(t,0,r),e}static extendWithRanges(e,t){if(t.length==0)return e;let r=[];for(let i=0,s=0,o=0;;){let a=i<e.length?e[i].fromB:1e9,l=s<t.length?t[s]:1e9,c=Math.min(a,l);if(c==1e9)break;let d=c+o,h=c,f=d;for(;;)if(s<t.length&&t[s]<=h){let p=t[s+1];s+=2,h=Math.max(h,p);for(let m=i;m<e.length&&e[m].fromB<=h;m++)o=e[m].toA-e[m].toB;f=Math.max(f,p+o)}else if(i<e.length&&e[i].fromB<=h){let p=e[i++];h=Math.max(h,p.toB),f=Math.max(f,p.toA),o=p.toA-p.toB}else break;r.push(new Cn(d,f,c,h))}return r}}class Gc{constructor(e,t,r){this.view=e,this.state=t,this.transactions=r,this.flags=0,this.startState=e.state,this.changes=ft.empty(this.startState.doc.length);for(let s of r)this.changes=this.changes.compose(s.changes);let i=[];this.changes.iterChangedRanges((s,o,a,l)=>i.push(new Cn(s,o,a,l))),this.changedRanges=i}static create(e,t,r){return new Gc(e,t,r)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}const GM=[];class st{constructor(e,t,r=0){this.dom=e,this.length=t,this.flags=r,this.parent=null,e.cmTile=this}get breakAfter(){return this.flags&1}get children(){return GM}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(e){if(this.flags|=2,this.flags&4){this.flags&=-5;let t=this.domAttrs;t&&RM(this.dom,t)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:"")+(this.breakAfter?"#":"")}destroy(){this.parent=null}setDOM(e){this.dom=e,e.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e,t=this.posAtStart){let r=t;for(let i of this.children){if(i==e)return r;r+=i.length+i.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}covers(e){return!0}coordsIn(e,t,r){return null}domPosFor(e,t){let r=yi(this.dom),i=this.length?e>0:t>0;return new Ln(this.parent.dom,r+(i?1:0),e==0||e==this.length)}markDirty(e){this.flags&=-3,e&&(this.flags|=4),this.parent&&this.parent.flags&2&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let e=this;e;e=e.parent)if(e instanceof hd)return e;return null}static get(e){return e.cmTile}}class dd extends st{constructor(e){super(e,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(e){this.children.push(e),e.parent=this}sync(e){if(this.flags&2)return;super.sync(e);let t=this.dom,r=null,i,s=e?.node==t?e:null,o=0;for(let a of this.children){if(a.sync(e),o+=a.length+a.breakAfter,i=r?r.nextSibling:t.firstChild,s&&i!=a.dom&&(s.written=!0),a.dom.parentNode==t)for(;i&&i!=a.dom;)i=c0(i);else t.insertBefore(a.dom,i);r=a.dom}for(i=r?r.nextSibling:t.firstChild,s&&i&&(s.written=!0);i;)i=c0(i);this.length=o}}function c0(n){let e=n.nextSibling;return n.parentNode.removeChild(n),e}class hd extends dd{constructor(e,t){super(t),this.view=e}owns(e){for(;e;e=e.parent)if(e==this)return!0;return!1}isBlock(){return!0}nearest(e){for(;;){if(!e)return null;let t=st.get(e);if(t&&this.owns(t))return t;e=e.parentNode}}blockTiles(e){for(let t=[],r=this,i=0,s=0;;)if(i==r.children.length){if(!t.length)return;r=r.parent,r.breakAfter&&s++,i=t.pop()}else{let o=r.children[i++];if(o instanceof Xr)t.push(i),r=o,i=0;else{let a=s+o.length,l=e(o,s);if(l!==void 0)return l;s=a+o.breakAfter}}}resolveBlock(e,t){let r,i=-1,s,o=-1;if(this.blockTiles((a,l)=>{let c=l+a.length;if(e>=l&&e<=c){if(a.isWidget()&&t>=-1&&t<=1){if(a.flags&32)return!0;a.flags&16&&(r=void 0)}(l<e||e==c&&(t<-1?a.length:a.covers(1)))&&(!r||!a.isWidget()&&r.isWidget())&&(r=a,i=e-l),(c>e||e==l&&(t>1?a.length:a.covers(-1)))&&(!s||!a.isWidget()&&s.isWidget())&&(s=a,o=e-l)}}),!r&&!s)throw new Error("No tile at position "+e);return r&&t<0||!s?{tile:r,offset:i}:{tile:s,offset:o}}}class Xr extends dd{constructor(e,t){super(e),this.wrapper=t}isBlock(){return!0}covers(e){return this.children.length?e<0?this.children[0].covers(-1):this.lastChild.covers(1):!1}get domAttrs(){return this.wrapper.attributes}static of(e,t){let r=new Xr(t||document.createElement(e.tagName),e);return t||(r.flags|=4),r}}class Gs extends dd{constructor(e,t){super(e),this.attrs=t}isLine(){return!0}static start(e,t,r){let i=new Gs(t||document.createElement("div"),e);return(!t||!r)&&(i.flags|=4),i}get domAttrs(){return this.attrs}resolveInline(e,t,r=!1){let i=null,s=-1,o=null,a=-1;function l(d,h){for(let f=0,p=0;f<d.children.length&&p<=h;f++){let m=d.children[f],O=p+m.length;O>=h&&(m.isComposite()?l(m,h-p):(!o||r&&o.isHidden&&(t>0&&!(o.flags&32)||r&&KM(o,m)))&&(O>h||m.flags&32&&t<=1)?(o=m,a=h-p):(p<h||m.flags&16&&!(r&&m.isHidden)&&t>=-1)&&(i=m,s=h-p)),p=O}}l(this,e);let c=(t<0?i:o)||i||o;return c?{tile:c,offset:c==i?s:a}:null}coordsIn(e,t,r){let i=this.resolveInline(e,t,!0);return i?i.tile.coordsIn(Math.max(0,i.offset),t,r):HM(this)}domIn(e,t){let r=this.resolveInline(e,t);if(r){let{tile:i,offset:s}=r;if(this.dom.contains(i.dom))return i.isText()?new Ln(i.dom,Math.min(i.dom.nodeValue.length,s)):i.domPosFor(s,i.flags&16?1:i.flags&32?-1:t);let o=r.tile.parent,a=!1;for(let l of o.children){if(a)return new Ln(l.dom,0);l==r.tile&&(a=!0)}}return new Ln(this.dom,0)}}function HM(n){let e=n.dom.lastChild;if(!e)return n.dom.getBoundingClientRect();let t=na(e);return t[t.length-1]||null}function KM(n,e){let t=n.coordsIn(0,1),r=e.coordsIn(0,1);return t&&r&&r.top<t.bottom}class Ht extends dd{constructor(e,t){super(e),this.mark=t}get domAttrs(){return this.mark.attrs}static of(e,t){let r=new Ht(t||document.createElement(e.tagName),e);return t||(r.flags|=4),r}}class ji extends st{constructor(e,t){super(e,t.length),this.text=t}sync(e){this.flags&2||(super.sync(e),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text))}isText(){return!0}toString(){return JSON.stringify(this.text)}coordsIn(e,t,r){let i=this.dom.nodeValue.length;e>i&&(e=i);let s=e,o=e,a=0;e==0&&t<0||e==i&&t>=0?Z.chrome||Z.gecko||(e?(s--,a=1):o<i&&(o++,a=-1)):t<0?s--:o<i&&o++;let l=ja(this.dom,s,o).getClientRects();if(!l.length)return null;let c=l[(a?a<0:t>=0)?0:l.length-1];return Z.safari&&!a&&c.width==0&&(c=Array.prototype.find.call(l,d=>d.width)||c),r==null?c:Da(c,(a?a>0:t<0)==r)}static of(e,t){let r=new ji(t||document.createTextNode(e),e);return t||(r.flags|=2),r}}class ts extends st{constructor(e,t,r,i){super(e,t,i),this.widget=r}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(e){return this.flags&48?!1:(this.flags&(e<0?64:128))>0}coordsIn(e,t){return this.coordsInWidget(e,t,!1)}coordsInWidget(e,t,r){let i=this.widget.coordsAt(this.dom,e,t);if(i)return i;if(r)return Da(this.dom.getBoundingClientRect(),this.length?e==0:t<=0);{let s=this.dom.getClientRects(),o=null;if(!s.length)return null;let a=this.flags&16?!0:this.flags&32?!1:e>0;for(let l=a?s.length-1:0;o=s[l],!(e>0?l==0:l==s.length-1||o.top<o.bottom);l+=a?-1:1);return Da(o,!a)}}get overrideDOMText(){if(!this.length)return xe.empty;let{root:e}=this;if(!e)return xe.empty;let t=this.posAtStart;return e.view.state.doc.slice(t,t+this.length)}destroy(){super.destroy(),this.widget.destroy(this.dom)}static of(e,t,r,i,s){return s||(s=e.toDOM(t),e.editable||(s.contentEditable="false")),new ts(s,r,e,i)}}class Hc extends st{constructor(e){let t=document.createElement("img");t.className="cm-widgetBuffer",t.setAttribute("aria-hidden","true"),super(t,0,e)}get isHidden(){return!0}get overrideDOMText(){return xe.empty}coordsIn(e,t,r){let i=this.dom.getBoundingClientRect();return r==null?i:Da(i,t>0==r)}}class JM{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,t,r){let{tile:i,index:s,beforeBreak:o,parents:a}=this;for(;e||t>0;)if(i.isComposite())if(o){if(!e)break;r&&r.break(),e--,o=!1}else if(s==i.children.length){if(!e&&!a.length)break;r&&r.leave(i),o=!!i.breakAfter,{tile:i,index:s}=a.pop(),s++}else{let l=i.children[s],c=l.breakAfter;(t>0?l.length<=e:l.length<e)&&(!r||r.skip(l,0,l.length)!==!1||!l.isComposite)?(o=!!c,s++,e-=l.length):(a.push({tile:i,index:s}),i=l,s=0,r&&l.isComposite()&&r.enter(l))}else{let l=i.length;if(s<l&&e){let c=Math.min(e,l-s);r&&r.skip(i,s,s+c),e-=c,s+=c}if(s==l)o=!!i.breakAfter,{tile:i,index:s}=a.pop(),s++;else if(!e)break}return this.tile=i,this.index=s,this.beforeBreak=o,this}get root(){return this.parents.length?this.parents[0].tile:this.tile}}class e3{constructor(e,t,r,i){this.from=e,this.to=t,this.wrapper=r,this.rank=i}}class t3{constructor(e,t,r){this.cache=e,this.root=t,this.blockWrappers=r,this.curLine=null,this.lastBlock=null,this.afterWidget=null,this.pos=0,this.wrappers=[],this.wrapperPos=0}addText(e,t,r,i){var s;this.flushBuffer();let o=this.ensureMarks(t,r),a=o.lastChild;if(a&&a.isText()&&!(a.flags&8)&&a.length+e.length<512){this.cache.reused.set(a,2);let l=o.children[o.children.length-1]=new ji(a.dom,a.text+e);l.parent=o}else o.append(i||ji.of(e,(s=this.cache.find(ji))===null||s===void 0?void 0:s.dom));this.pos+=e.length,this.afterWidget=null}addComposition(e,t){let r=this.curLine;r.dom!=t.line.dom&&(r.setDOM(this.cache.reused.has(t.line)?ih(t.line.dom):t.line.dom),this.cache.reused.set(t.line,2));let i=r;for(let a=t.marks.length-1;a>=0;a--){let l=t.marks[a],c=i.lastChild;if(c instanceof Ht&&c.mark.eq(l.mark))c.dom!=l.dom&&c.setDOM(ih(l.dom)),i=c;else{let{dom:d}=l;this.cache.reused.get(l)&&st.get(l.dom)&&(d=ih(l.dom));let h=Ht.of(l.mark,d);i.append(h),i=h}this.cache.reused.set(l,2)}let s=st.get(e.text);s&&this.cache.reused.set(s,2);let o=new ji(e.text,e.text.nodeValue);o.flags|=8,this.pos=e.range.toB,i.append(o)}addInlineWidget(e,t,r){let i=this.afterWidget&&e.flags&48&&(this.afterWidget.flags&48)==(e.flags&48);i||this.flushBuffer();let s=this.ensureMarks(t,r);!i&&!(e.flags&16)&&s.append(this.getBuffer(1)),s.append(e),this.pos+=e.length,this.afterWidget=e}addMark(e,t,r){this.flushBuffer(),this.ensureMarks(t,r).append(e),this.pos+=e.length,this.afterWidget=null}addBlockWidget(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}continueWidget(e){let t=this.afterWidget||this.lastBlock;t.length+=e,this.pos+=e}addLineStart(e,t){var r;e||(e=zS);let i=Gs.start(e,t||((r=this.cache.find(Gs))===null||r===void 0?void 0:r.dom),!!t);this.getBlockPos().append(this.lastBlock=this.curLine=i)}addLine(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(e){this.blockPosCovered()||this.addLineStart(e)}ensureLine(e){this.curLine||this.addLineStart(e)}ensureMarks(e,t){var r;let i=this.curLine;for(let s=e.length-1;s>=0;s--){let o=e[s],a;if(t>0&&(a=i.lastChild)&&a instanceof Ht&&a.mark.eq(o))i=a,t--;else{let l=Ht.of(o,(r=this.cache.find(Ht,c=>c.mark.eq(o)))===null||r===void 0?void 0:r.dom);i.append(l),i=l,t=0}}return i}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;(!e||!u0(this.curLine,!1)||e.dom.nodeName!="BR"&&e.isWidget()&&!(Z.ios&&u0(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(sh,0,32)||new ts(sh.toDOM(),0,sh,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let e=this.wrappers.length-1;e>=0;e--)this.wrappers[e].to<this.pos&&this.wrappers.splice(e,1);for(let e=this.blockWrappers;e.value&&e.from<=this.pos;e.next())if(e.to>=this.pos){let t=e.rank*102+e.value.rank,r=new e3(e.from,e.to,e.value,t),i=this.wrappers.length;for(;i>0&&(this.wrappers[i-1].rank-r.rank||this.wrappers[i-1].to-r.to)<0;)i--;this.wrappers.splice(i,0,r)}this.wrapperPos=this.pos}getBlockPos(){var e;this.updateBlockWrappers();let t=this.root;for(let r of this.wrappers){let i=t.lastChild;if(r.from<this.pos&&i instanceof Xr&&i.wrapper.eq(r.wrapper))t=i;else{let s=Xr.of(r.wrapper,(e=this.cache.find(Xr,o=>o.wrapper.eq(r.wrapper)))===null||e===void 0?void 0:e.dom);t.append(s),t=s}}return t}blockPosCovered(){let e=this.lastBlock;return e!=null&&!e.breakAfter&&(!e.isWidget()||(e.flags&160)>0)}getBuffer(e){let t=2|(e<0?16:32),r=this.cache.find(Hc,void 0,1);return r&&(r.flags=t),r||new Hc(t)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class n3{constructor(e){this.skipCount=0,this.text="",this.textOff=0,this.cursor=e.iter()}skip(e){this.textOff+e<=this.text.length?this.textOff+=e:(this.skipCount+=e-(this.text.length-this.textOff),this.text="",this.textOff=0)}next(e){if(this.textOff==this.text.length){let{value:i,lineBreak:s,done:o}=this.cursor.next(this.skipCount);if(this.skipCount=0,o)throw new Error("Ran out of text content when drawing inline views");this.text=i;let a=this.textOff=Math.min(e,i.length);return s?null:i.slice(0,a)}let t=Math.min(this.text.length,this.textOff+e),r=this.text.slice(this.textOff,t);return this.textOff=t,r}}const Kc=[ts,Gs,ji,Ht,Hc,Xr,hd];for(let n=0;n<Kc.length;n++)Kc[n].bucket=n;class r3{constructor(e){this.view=e,this.buckets=Kc.map(()=>[]),this.index=Kc.map(()=>0),this.reused=new Map}add(e){let t=e.constructor.bucket,r=this.buckets[t];r.length<6?r.push(e):r[this.index[t]=(this.index[t]+1)%6]=e}find(e,t,r=2){let i=e.bucket,s=this.buckets[i],o=this.index[i];for(let a=0;a<s.length;a++){let l=(a+o)%s.length,c=s[l];if((!t||t(c))&&!this.reused.has(c))return s.splice(l,1),l<o&&this.index[i]--,this.reused.set(c,r),c}return null}findWidget(e,t,r){let i=this.buckets[0];if(i.length)for(let s=0,o=0;;s++){if(s==i.length){if(o)return null;o=1,s=0}let a=i[s];if(!this.reused.has(a)&&(o==0?a.widget.compare(e):a.widget.constructor==e.constructor&&e.updateDOM(a.dom,this.view,a.widget)))return i.splice(s,1),s<this.index[0]&&this.index[0]--,a.widget==e&&a.length==t&&(a.flags&497)==r?(this.reused.set(a,1),a):(this.reused.set(a,2),new ts(a.dom,t,e,a.flags&-498|r))}}reuse(e){return this.reused.set(e,1),e}maybeReuse(e,t=2){if(!this.reused.has(e))return this.reused.set(e,t),e.dom}clear(){for(let e=0;e<this.buckets.length;e++)this.buckets[e].length=this.index[e]=0}}class i3{constructor(e,t,r,i,s){this.view=e,this.decorations=i,this.disallowBlockEffectsFor=s,this.openWidget=!1,this.openMarks=0,this.cache=new r3(e),this.text=new n3(e.state.doc),this.builder=new t3(this.cache,new hd(e,e.contentDOM),me.iter(r)),this.cache.reused.set(t,2),this.old=new JM(t),this.reuseWalker={skip:(o,a,l)=>{if(this.cache.add(o),o.isComposite())return!1},enter:o=>this.cache.add(o),leave:()=>{},break:()=>{}}}run(e,t){let r=t&&this.getCompositionContext(t.text);for(let i=0,s=0,o=0;;){let a=o<e.length?e[o++]:null,l=a?a.fromA:this.old.root.length;if(l>i){let c=l-i;this.preserve(c,!o,!a),i=l,s+=c}if(!a)break;t&&a.fromA<=t.range.fromA&&a.toA>=t.range.toA?(this.forward(a.fromA,t.range.fromA,t.range.fromA<t.range.toA?1:-1),this.emit(s,t.range.fromB),this.builder.flushBuffer(),this.cache.clear(),this.builder.addComposition(t,r),this.text.skip(t.range.toB-t.range.fromB),this.forward(t.range.fromA,a.toA),this.emit(t.range.toB,a.toB)):(this.forward(a.fromA,a.toA),this.emit(s,a.toB)),s=a.toB,i=a.toA}return this.builder.curLine&&this.builder.endLine(),this.builder.root}preserve(e,t,r){let i=a3(this.old),s=this.openMarks;this.old.advance(e,r?1:-1,{skip:(o,a,l)=>{if(o.isWidget())if(this.openWidget)this.builder.continueWidget(l-a);else{let c=l>0||a<o.length?ts.of(o.widget,this.view,l-a,o.flags&496,this.cache.maybeReuse(o)):this.cache.reuse(o);c.flags&256?(c.flags&=-2,this.builder.addBlockWidget(c)):(this.builder.ensureLine(null),this.builder.addInlineWidget(c,i,s),s=i.length)}else if(o.isText())this.builder.ensureLine(null),!a&&l==o.length&&!this.cache.reused.has(o)?this.builder.addText(o.text,i,s,this.cache.reuse(o)):(this.cache.add(o),this.builder.addText(o.text.slice(a,l),i,s)),s=i.length;else if(o.isLine())o.flags&=-2,this.cache.reused.set(o,1),this.builder.addLine(o);else if(o instanceof Hc)this.cache.add(o);else if(o instanceof Ht)this.builder.ensureLine(null),this.builder.addMark(o,i,s),this.cache.reused.set(o,1),s=i.length;else return!1;this.openWidget=!1},enter:o=>{o.isLine()?this.builder.addLineStart(o.attrs,this.cache.maybeReuse(o)):(this.cache.add(o),o instanceof Ht&&i.unshift(o.mark)),this.openWidget=!1},leave:o=>{o.isLine()?i.length&&(i.length=s=0):o instanceof Ht&&(i.shift(),s=Math.min(s,i.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,t){let r=null,i=this.builder,s=-1,o=me.spans(this.decorations,e,t,{point:(a,l,c,d,h,f)=>{if(c instanceof Ji){if(this.disallowBlockEffectsFor[f]){if(c.block)throw new RangeError("Block decorations may not be specified via plugins");if(l>this.view.state.doc.lineAt(a).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}if(s=d.length,h>d.length)i.continueWidget(l-a);else{let p=c.widget||(c.block?Hs.block:Hs.inline),m=s3(c),O=this.cache.findWidget(p,l-a,m)||ts.of(p,this.view,l-a,m);c.block?(c.startSide>0&&i.addLineStartIfNotCovered(r),i.addBlockWidget(O)):(i.ensureLine(r),i.addInlineWidget(O,d,h))}r=null}else r=o3(r,c);l>a&&this.text.skip(l-a)},span:(a,l,c,d)=>{for(let h=a;h<l;){let f=this.text.next(Math.min(512,l-h));f==null?(i.addLineStartIfNotCovered(r),i.addBreak(),h++):(i.ensureLine(r),i.addText(f,c,h==a?d:c.length),h+=f.length),r=null}s=c.length}});s>-1&&(this.openWidget=o>s),this.openWidget||i.addLineStartIfNotCovered(r),this.openMarks=o}forward(e,t,r=1){t-e<=10?this.old.advance(t-e,r,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(t-e-10,-1),this.old.advance(5,r,this.reuseWalker))}getCompositionContext(e){let t=[],r=null;for(let i=e.parentNode;;i=i.parentNode){let s=st.get(i);if(i==this.view.contentDOM)break;s instanceof Ht?t.push(s):s?.isLine()?r=s:s instanceof Xr||(i.nodeName=="DIV"&&!r?r=new Gs(i,zS):r||t.push(Ht.of(new ol({tagName:i.nodeName.toLowerCase(),attributes:EM(i)}),i)))}return r?{line:r,marks:t}:null}}function u0(n,e){let t=r=>{for(let i of r.children)if((e?i.isText():i.length)||t(i))return!0;return!1};return t(n)}function s3(n){let e=n.isReplace?(n.startSide<0?64:0)|(n.endSide>0?128:0):n.startSide>0?32:16;return n.block&&(e|=256),e}const zS={class:"cm-line"};function o3(n,e){let t=e.spec.attributes,r=e.spec.class;return!t&&!r||(n||(n={class:"cm-line"}),t&&vm(t,n),r&&(n.class+=" "+r)),n}function a3(n){let e=[];for(let t=n.parents.length;t>1;t--){let r=t==n.parents.length?n.tile:n.parents[t].tile;r instanceof Ht&&e.push(r.mark)}return e}function ih(n){let e=st.get(n);return e&&e.setDOM(n.cloneNode()),n}class Hs extends zn{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}Hs.inline=new Hs("span");Hs.block=new Hs("div");const sh=new class extends zn{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class d0{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=G.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new hd(e,e.contentDOM),this.updateInner([new Cn(0,0,0,e.state.doc.length)],null)}update(e){var t;let r=e.changedRanges;this.minWidth>0&&r.length&&(r.every(({fromA:d,toA:h})=>h<this.minWidthFrom||d>this.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let i=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((t=this.domChanged)===null||t===void 0)&&t.newSel?i=this.domChanged.newSel.head:!g3(e.changes,this.hasComposition)&&!e.selectionSet&&(i=e.state.selection.main.head));let s=i>-1?c3(this.view,e.changes,i):null;if(this.domChanged=null,this.hasComposition){let{from:d,to:h}=this.hasComposition;r=new Cn(d,h,e.changes.mapPos(d,-1),e.changes.mapPos(h,1)).addToSet(r.slice())}this.hasComposition=s?{from:s.range.fromB,to:s.range.toB}:null,(Z.ie||Z.chrome)&&!s&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let o=this.decorations,a=this.blockWrappers;this.updateDeco();let l=h3(o,this.decorations,e.changes);l.length&&(r=Cn.extendWithRanges(r,l));let c=p3(a,this.blockWrappers,e.changes);return c.length&&(r=Cn.extendWithRanges(r,c)),s&&!r.some(d=>d.fromA<=s.range.fromA&&d.toA>=s.range.toA)&&(r=s.range.addToSet(r.slice())),this.tile.flags&2&&r.length==0?!1:(this.updateInner(r,s),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t){this.view.viewState.mustMeasureContent=!0;let{observer:r}=this.view;r.ignore(()=>{if(t||e.length){let o=this.tile,a=new i3(this.view,o,this.blockWrappers,this.decorations,this.dynamicDecorationMap);t&&st.get(t.text)&&a.cache.reused.set(st.get(t.text),2),this.tile=a.run(e,t),Vf(o,a.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let s=Z.chrome||Z.ios?{node:r.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(s),s&&(s.written||r.selectionRange.focusNode!=s.node||!this.tile.dom.contains(s.node))&&(this.forceSelection=!0),this.tile.dom.style.height=""});let i=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let s of this.tile.children)s.isWidget()&&s.widget instanceof oh&&i.push(s.dom);r.updateGaps(i)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let t of e.transactions)for(let r of t.effects)r.is(LS)&&(this.editContextFormatting=r.value)}updateSelection(e=!1,t=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let{dom:r}=this.tile,i=this.view.root.activeElement,s=i==r,o=!s&&!(this.view.state.facet(Mr)||r.tabIndex>-1)&&ta(r,this.view.observer.selectionRange)&&!(i&&r.contains(i));if(!(s||t||o))return;let a=this.forceSelection;this.forceSelection=!1;let l=this.view.state.selection.main,c,d;if(l.empty?d=c=this.inlineDOMNearPos(l.anchor,l.assoc||1):(d=this.inlineDOMNearPos(l.head,l.head==l.from?1:-1),c=this.inlineDOMNearPos(l.anchor,l.anchor==l.from?1:-1)),Z.gecko&&l.empty&&!this.hasComposition&&l3(c)){let f=document.createTextNode("");this.view.observer.ignore(()=>c.node.insertBefore(f,c.node.childNodes[c.offset]||null)),c=d=new Ln(f,0),a=!0}let h=this.view.observer.selectionRange;(a||!h.focusNode||(!ra(c.node,c.offset,h.anchorNode,h.anchorOffset)||!ra(d.node,d.offset,h.focusNode,h.focusOffset))&&!this.suppressWidgetCursorChange(h,l))&&(this.view.observer.ignore(()=>{Z.android&&Z.chrome&&r.contains(h.focusNode)&&m3(h.focusNode,r)&&(r.blur(),r.focus({preventScroll:!0}));let f=Na(this.view.root);if(f)if(l.empty){if(Z.gecko){let p=u3(c.node,c.offset);if(p&&p!=3){let m=(p==1?vS:wS)(c.node,c.offset);m&&(c=new Ln(m.node,m.offset))}}f.collapse(c.node,c.offset),l.bidiLevel!=null&&f.caretBidiLevel!==void 0&&(f.caretBidiLevel=l.bidiLevel)}else if(f.extend){f.collapse(c.node,c.offset);try{f.extend(d.node,d.offset)}catch{}}else{let p=document.createRange();l.anchor>l.head&&([c,d]=[d,c]),p.setEnd(d.node,d.offset),p.setStart(c.node,c.offset),f.removeAllRanges(),f.addRange(p)}o&&this.view.root.activeElement==r&&(r.blur(),i&&i.focus())}),this.view.observer.setSelectionRange(c,d)),this.impreciseAnchor=c.precise?null:new Ln(h.anchorNode,h.anchorOffset),this.impreciseHead=d.precise?null:new Ln(h.focusNode,h.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&ra(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==t.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,r=Na(e.root),{anchorNode:i,anchorOffset:s}=e.observer.selectionRange;if(!r||!t.empty||!t.assoc||!r.modify)return;let o=this.lineAt(t.head,t.assoc);if(!o)return;let a=o.posAtStart;if(t.head==a||t.head==a+o.length)return;let l=this.coordsAt(t.head,-1),c=this.coordsAt(t.head,1);if(!l||!c||l.bottom>c.top)return;let d=this.domAtPos(t.head+t.assoc,t.assoc);r.collapse(d.node,d.offset),r.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let h=e.observer.selectionRange;e.docView.posFromDOM(h.anchorNode,h.anchorOffset)!=t.from&&r.collapse(i,s)}posFromDOM(e,t){let r=this.tile.nearest(e);if(!r)return this.tile.dom.compareDocumentPosition(e)&2?0:this.view.state.doc.length;let i=r.posAtStart;if(r.isComposite()){let s;if(e==r.dom)s=r.dom.childNodes[t];else{let o=Wr(e)==0?0:t==0?-1:1;for(;;){let a=e.parentNode;if(a==r.dom)break;o==0&&a.firstChild!=a.lastChild&&(e==a.firstChild?o=-1:o=1),e=a}o<0?s=e:s=e.nextSibling}if(s==r.dom.firstChild)return i;for(;s&&!st.get(s);)s=s.nextSibling;if(!s)return i+r.length;for(let o=0,a=i;;o++){let l=r.children[o];if(l.dom==s)return a;a+=l.length+l.breakAfter}}else return r.isText()?e==r.dom?i+t:i+(t?r.length:0):i}domAtPos(e,t){let{tile:r,offset:i}=this.tile.resolveBlock(e,t);return r.isWidget()?r.domPosFor(i,t):r.domIn(i,t)}inlineDOMNearPos(e,t){let r,i=-1,s=!1,o,a=-1,l=!1;return this.tile.blockTiles((c,d)=>{if(c.isWidget()){if(c.flags&32&&d>=e)return!0;c.flags&16&&(s=!0)}else{let h=d+c.length;if(d<=e&&(r=c,i=e-d,s=h<e),h>=e&&!o&&(o=c,a=e-d,l=d>e),d>e&&o)return!0}}),!r&&!o?this.domAtPos(e,t):(s&&o?r=null:l&&r&&(o=null),r&&t<0||!o?r.domIn(i,t):o.domIn(a,t))}coordsAt(e,t,r){let{tile:i,offset:s}=this.tile.resolveBlock(e,t);return i.isWidget()?i.widget instanceof oh?null:i.coordsInWidget(s,t,!0):i.coordsIn(s,t,r)}lineAt(e,t){let{tile:r}=this.tile.resolveBlock(e,t);return r.isLine()?r:null}coordsForChar(e){let{tile:t,offset:r}=this.tile.resolveBlock(e,1);if(!t.isLine())return null;function i(s,o){if(s.isComposite())for(let a of s.children){if(a.length>=o){let l=i(a,o);if(l)return l}if(o-=a.length,o<0)break}else if(s.isText()&&o<s.length){let a=bt(s.text,o);if(a==o)return null;let l=ja(s.dom,o,a).getClientRects();for(let c=0;c<l.length;c++){let d=l[c];if(c==l.length-1||d.top<d.bottom&&d.left<d.right)return d}}return null}return i(t,r)}measureVisibleLineHeights(e){let t=[],{from:r,to:i}=e,s=this.view.contentDOM.clientWidth,o=s>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,a=-1,l=this.view.textDirection==Re.LTR,c=0,d=(h,f,p)=>{for(let m=0;m<h.children.length&&!(f>i);m++){let O=h.children[m],b=f+O.length,y=O.dom.getBoundingClientRect(),{height:k}=y;if(p&&!m&&(c+=y.top-p.top),O instanceof Xr)b>r&&d(O,f,y);else if(f>=r&&(c>0&&t.push(-c),t.push(k+c),c=0,o)){let x=O.dom.lastChild,S=x?na(x):[];if(S.length){let v=S[S.length-1],w=l?v.right-y.left:y.right-v.left;w>a&&(a=w,this.minWidth=s,this.minWidthFrom=f,this.minWidthTo=b)}}p&&m==h.children.length-1&&(c+=p.bottom-y.bottom),f=b+O.breakAfter}};return d(this.tile,0,null),t}textDirectionAt(e){let{tile:t}=this.tile.resolveBlock(e,1);return getComputedStyle(t.dom).direction=="rtl"?Re.RTL:Re.LTR}measureTextSize(){let e=this.tile.blockTiles(o=>{if(o.isLine()&&o.children.length&&o.length<=20){let a=0,l;for(let c of o.children){if(!c.isText()||/[^ -~]/.test(c.text))return;let d=na(c.dom);if(d.length!=1)return;a+=d[0].width,l=d[0].height}if(a)return{lineHeight:o.dom.getBoundingClientRect().height,charWidth:a/o.length,textHeight:l}}});if(e)return e;let t=document.createElement("div"),r,i,s;return t.className="cm-line",t.style.width="99999px",t.style.position="absolute",t.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.tile.dom.appendChild(t);let o=na(t.firstChild)[0];r=t.getBoundingClientRect().height,i=o&&o.width?o.width/27:7,s=o&&o.height?o.height:r,t.remove()}),{lineHeight:r,charWidth:i,textHeight:s}}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let r=0,i=0;;i++){let s=i==t.viewports.length?null:t.viewports[i],o=s?s.from-1:this.view.state.doc.length;if(o>r){let a=(t.lineBlockAt(o).bottom-t.lineBlockAt(r).top)/this.view.scaleY;e.push(G.replace({widget:new oh(a),block:!0,inclusive:!0,isBlockGap:!0}).range(r,o))}if(!s)break;r=s.to+1}return G.set(e)}updateDeco(){let e=1,t=this.view.state.facet(ud).map(s=>(this.dynamicDecorationMap[e++]=typeof s=="function")?s(this.view):s),r=!1,i=this.view.state.facet(Tm).map((s,o)=>{let a=typeof s=="function";return a&&(r=!0),a?s(this.view):s});for(i.length&&(this.dynamicDecorationMap[e++]=r,t.push(me.join(i))),this.decorations=[this.editContextFormatting,...t,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;this.blockWrappers=this.view.state.facet(BS).map(s=>typeof s=="function"?s(this.view):s)}scrollIntoView(e){if(e.isSnapshot){let c=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=c.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let c of this.view.state.facet(XS))try{if(c(this.view,e.range,e))return!0}catch(d){Kt(this.view.state,d,"scroll handler")}let{range:t}=e,r=this.coordsAt(t.head,t.assoc||(t.head>t.anchor?-1:1)),i;if(!r)return;!t.empty&&(i=this.coordsAt(t.anchor,t.anchor>t.head?-1:1))&&(r={left:Math.min(r.left,i.left),top:Math.min(r.top,i.top),right:Math.max(r.right,i.right),bottom:Math.max(r.bottom,i.bottom)});let s=Mm(this.view),o={left:r.left-s.left,top:r.top-s.top,right:r.right+s.right,bottom:r.bottom+s.bottom},{offsetWidth:a,offsetHeight:l}=this.view.scrollDOM;if(jM(this.view.scrollDOM,o,t.head<t.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,a),-a),Math.max(Math.min(e.yMargin,l),-l),this.view.textDirection==Re.LTR),window.visualViewport&&window.innerHeight-window.visualViewport.height>1&&(r.top>window.visualViewport.offsetTop+window.visualViewport.height||r.bottom<window.visualViewport.offsetTop)){let c=this.view.docView.lineAt(t.head,1);if(c){let d=yS(c.dom);c.dom.scrollIntoView({block:"nearest"}),xS(d,!1)}}}lineHasWidget(e){let t=r=>r.isWidget()||r.children.some(t);return t(this.tile.resolveBlock(e,1).tile)}destroy(){Vf(this.tile)}}function Vf(n,e){let t=e?.get(n);if(t!=1){t==null&&n.destroy();for(let r of n.children)Vf(r,e)}}function l3(n){return yt(n.node)&&n.node.firstChild&&(n.offset==0||n.node.childNodes[n.offset-1].contentEditable=="false")&&(n.offset==n.node.childNodes.length||n.node.childNodes[n.offset].contentEditable=="false")}function VS(n,e){let t=n.observer.selectionRange;if(!t.focusNode)return null;let r=vS(t.focusNode,t.focusOffset),i=wS(t.focusNode,t.focusOffset),s=r||i;if(i&&r&&i.node!=r.node){let a=st.get(i.node);if(!a||a.isText()&&a.text!=i.node.nodeValue)s=i;else if(n.docView.lastCompositionAfterCursor){let l=st.get(r.node);!l||l.isText()&&l.text!=r.node.nodeValue||(s=i)}}if(n.docView.lastCompositionAfterCursor=s!=r,!s)return null;let o=e-s.offset;return{from:o,to:o+s.node.nodeValue.length,node:s.node}}function c3(n,e,t){let r=VS(n,t);if(!r)return null;let{node:i,from:s,to:o}=r,a=i.nodeValue;if(/[\n\r]/.test(a)||n.state.doc.sliceString(r.from,r.to)!=a)return null;let l=e.invertedDesc;return{range:new Cn(l.mapPos(s),l.mapPos(o),s,o),text:i}}function u3(n,e){return yt(n)?(e&&n.childNodes[e-1].contentEditable=="false"?1:0)|(e<n.childNodes.length&&n.childNodes[e].contentEditable=="false"?2:0):0}let d3=class{constructor(){this.changes=[]}compareRange(e,t){Is(e,t,this.changes)}comparePoint(e,t){Is(e,t,this.changes)}boundChange(e){Is(e,e,this.changes)}};function h3(n,e,t){let r=new d3;return me.compare(n,e,t,r),r.changes}class f3{constructor(){this.changes=[]}compareRange(e,t){Is(e,t,this.changes)}comparePoint(){}boundChange(e){Is(e,e,this.changes)}}function p3(n,e,t){let r=new f3;return me.compare(n,e,t,r),r.changes}function m3(n,e){for(let t=n;t&&t!=e;t=t.assignedSlot||t.parentNode)if(yt(t)&&t.contentEditable=="false")return!0;return!1}function g3(n,e){let t=!1;return e&&n.iterChangedRanges((r,i)=>{r<e.to&&i>e.from&&(t=!0)}),t}class oh extends zn{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}function O3(n,e,t=1){let r=n.charCategorizer(e),i=n.doc.lineAt(e),s=e-i.from;if(i.length==0)return A.cursor(e);s==0?t=1:s==i.length&&(t=-1);let o=s,a=s;t<0?o=bt(i.text,s,!1):a=bt(i.text,s);let l=r(i.text.slice(o,a));for(;o>0;){let c=bt(i.text,o,!1);if(r(i.text.slice(c,o))!=l)break;o=c}for(;a<i.length;){let c=bt(i.text,a);if(r(i.text.slice(a,c))!=l)break;a=c}return A.undirectionalRange(o+i.from,a+i.from)}function b3(n,e,t,r,i){let s=Math.round((r-e.left)*n.defaultCharacterWidth);if(n.lineWrapping&&t.height>n.defaultLineHeight*1.5){let a=n.viewState.heightOracle.textHeight,l=Math.floor((i-t.top-(n.defaultLineHeight-a)*.5)/a);s+=l*n.viewState.heightOracle.lineLength}let o=n.state.sliceDoc(t.from,t.to);return t.from+Ef(o,s,n.state.tabSize)}function Ff(n,e,t){let r=n.lineBlockAt(e);if(Array.isArray(r.type)){let i;for(let s of r.type){if(s.from>e)break;if(!(s.to<e)){if(s.from<e&&s.to>e)return s;(!i||s.type==Tt.Text&&(i.type!=s.type||(t<0?s.from<e:s.to>e)))&&(i=s)}}return i||r}return r}function y3(n,e,t,r){let i=Ff(n,e.head,e.assoc||-1),s=!r||i.type!=Tt.Text||!(n.lineWrapping||i.widgetLineBreaks)?null:n.coordsAtPos(e.assoc<0&&e.head>i.from?e.head-1:e.head);if(s){let o=n.dom.getBoundingClientRect(),a=n.textDirectionAt(i.from),l=n.posAtCoords({x:t==(a==Re.LTR)?o.right-1:o.left+1,y:(s.top+s.bottom)/2});if(l!=null)return A.cursor(l,t?-1:1)}return A.cursor(t?i.to:i.from,t?-1:1)}function h0(n,e,t,r){let i=n.state.doc.lineAt(e.head),s=n.bidiSpans(i),o=n.textDirectionAt(i.from);for(let a=e,l=null;;){let c=qM(i,s,o,a,t),d=TS;if(!c){if(i.number==(t?n.state.doc.lines:1))return a;d=`
|
|
51
|
+
`,i=n.state.doc.line(i.number+(t?1:-1)),s=n.bidiSpans(i),c=t?A.cursor(i.from,-1):A.cursor(i.to,1)}if(l){if(!l(d))return a}else{if(!r)return c;l=r(d)}a=c}}function x3(n,e,t){let r=n.state.charCategorizer(e),i=r(t);return s=>{let o=r(s);return i==Ue.Space&&(i=o),i==o}}function S3(n,e,t,r){let i=e.head,s=t?1:-1;if(i==(t?n.state.doc.length:0))return A.cursor(i,e.assoc);let o=e.goalColumn,a,l=n.contentDOM.getBoundingClientRect(),c=n.coordsAtPos(i,e.assoc||((e.empty?t:e.head==e.from)?1:-1)),d=n.documentTop;if(c)o==null&&(o=c.left-l.left),a=s<0?c.top:c.bottom;else{let m=n.viewState.lineBlockAt(i);o==null&&(o=Math.min(l.right-l.left,n.defaultCharacterWidth*(i-m.from))),a=(s<0?m.top:m.bottom)+d}let h=l.left+o,f=n.viewState.heightOracle.textHeight>>1,p=r??f;for(let m=0;;m+=f){let O=a+(p+m)*s,b=qf(n,{x:h,y:O},!1,s);if(t?O>l.bottom:O<l.top)return A.cursor(b.pos,b.assoc);let y=n.coordsAtPos(b.pos,b.assoc),k=y?(y.top+y.bottom)/2:0;if(!y||(t?k>a:k<a))return A.cursor(b.pos,b.assoc,void 0,o)}}function ia(n,e,t){for(;;){let r=0;for(let i of n)i.between(e-1,e+1,(s,o,a)=>{if(e>s&&e<o){let l=r||t||(e-s<o-e?-1:1);e=l<0?s:o,r=l}});if(!r)return e}}function FS(n,e){let t=null;for(let r=0;r<e.ranges.length;r++){let i=e.ranges[r],s=null;if(i.empty){let o=ia(n,i.from,0);o!=i.from&&(s=A.cursor(o,-1))}else{let o=ia(n,i.from,-1),a=ia(n,i.to,1);(o!=i.from||a!=i.to)&&(i.undirectional?s=A.undirectionalRange(i.from,i.to):s=A.range(i.from==i.anchor?o:a,i.from==i.head?o:a))}s&&(t||(t=e.ranges.slice()),t[r]=s)}return t?A.create(t,e.mainIndex):e}function ah(n,e,t){let r=ia(n.state.facet(ll).map(i=>i(n)),t.from,e.head>t.from?-1:1);return r==t.from?t:A.cursor(r,r<t.from?1:-1)}class sr{constructor(e,t){this.pos=e,this.assoc=t}}function qf(n,e,t,r){let i=n.contentDOM.getBoundingClientRect(),s=i.top+n.viewState.paddingTop,{x:o,y:a}=e,l=a-s,c;for(;;){if(l<0)return new sr(0,1);if(l>n.viewState.docHeight)return new sr(n.state.doc.length,-1);if(c=n.elementAtHeight(l),r==null)break;if(c.type==Tt.Text){if(r<0?c.to<n.viewport.from:c.from>n.viewport.to)break;let f=n.docView.coordsAt(r<0?c.from:c.to,r>0?-1:1);if(f&&(r<0?f.top<=l+s:f.bottom>=l+s))break}let h=n.viewState.heightOracle.textHeight/2;l=r>0?c.bottom+h:c.top-h}if(n.viewport.from>=c.to||n.viewport.to<=c.from){if(t)return null;if(c.type==Tt.Text){let h=b3(n,i,c,o,a);return new sr(h,h==c.from?1:-1)}}if(c.type!=Tt.Text)return l<(c.top+c.bottom)/2?new sr(c.from,1):new sr(c.to,-1);let d=n.docView.lineAt(c.from,2);return(!d||d.length!=c.length)&&(d=n.docView.lineAt(c.from,-2)),new k3(n,o,a,n.textDirectionAt(c.from)).scanTile(d,c.from)}class k3{constructor(e,t,r,i){this.view=e,this.x=t,this.y=r,this.baseDir=i,this.line=null,this.spans=null}bidiSpansAt(e){return(!this.line||this.line.from>e||this.line.to<e)&&(this.line=this.view.state.doc.lineAt(e),this.spans=this.view.bidiSpans(this.line)),this}baseDirAt(e,t){let{line:r,spans:i}=this.bidiSpansAt(e);return i[ar.find(i,e-r.from,-1,t)].level==this.baseDir}dirAt(e,t){let{line:r,spans:i}=this.bidiSpansAt(e);return i[ar.find(i,e-r.from,-1,t)].dir}bidiIn(e,t){let{spans:r,line:i}=this.bidiSpansAt(e);return r.length>1||r.length&&(r[0].level!=this.baseDir||r[0].to+i.from<t)}scan(e,t,r=!1){let i=0,s=e.length-1,o=new Set,a=this.bidiIn(e[0],e[s]),l,c,d=-1,h=1e9,f;e:for(;i<s;){let m=s-i,O=i+s>>1;t:if(o.has(O)){for(let k=1;k<m;k++){let x=O+k;if(x>=s&&(x-=m),!o.has(x)){O=x;break t}}break e}o.add(O);let b=t(O),y=0;if(b)for(let k=0;k<b.length;k++){let x=b[k];if(!(x.width==0&&b.length>1))if(x.bottom<this.y)(!l||l.bottom<x.bottom)&&(l=x),y=1;else if(x.top>this.y)(!c||c.top>x.top)&&(c=x),y=-1;else{let S=x.left>this.x?this.x-x.left:x.right<this.x?this.x-x.right:0,v=Math.abs(S);v<h&&(d=O,h=v,f=x),S&&(y=S<0==(this.baseDir==Re.LTR)?-1:1)}}y==-1&&(!a||this.baseDirAt(e[O],1))?s=O:y==1&&(!a||this.baseDirAt(e[O+1],-1))&&(i=O+1)}if(!f){if(!c&&!l)return{i:0,after:!1};let m=l&&(!c||this.y-l.bottom<c.top-this.y)?l:c;return this.y=(m.top+m.bottom)/2,this.scan(e,t,!0)}if(h&&!r){let{top:m,bottom:O}=f;if(l&&l.bottom>(m+m+O)/3)return this.y=l.bottom-1,this.scan(e,t,!0);if(c&&c.top<(m+O+O)/3)return this.y=c.top+1,this.scan(e,t,!0)}let p=(a?this.dirAt(e[d],1):this.baseDir)==Re.LTR;return{i:d,after:this.x>(f.left+f.right)/2==p}}scanText(e,t){let r=[];for(let s=0;s<e.length;s=bt(e.text,s))r.push(t+s);r.push(t+e.length);let i=this.scan(r,s=>{let o=r[s]-t,a=r[s+1]-t;return ja(e.dom,o,a).getClientRects()});return i.after?new sr(r[i.i+1],-1):new sr(r[i.i],1)}scanTile(e,t){if(!e.length)return new sr(t,1);if(e.children.length==1){let a=e.children[0];if(a.isText())return this.scanText(a,t);if(a.isComposite())return this.scanTile(a,t)}let r=[t];for(let a=0,l=t;a<e.children.length;a++)r.push(l+=e.children[a].length);let i=this.scan(r,a=>{let l=e.children[a];return l.flags&48?null:(yt(l.dom)?l.dom:ja(l.dom,0,l.length)).getClientRects()}),s=e.children[i.i],o=r[i.i];return s.isText()?this.scanText(s,o):s.isComposite()?this.scanTile(s,o):i.after?new sr(r[i.i+1],-1):new sr(o,1)}}const ks="";class v3{constructor(e,t){this.points=e,this.view=t,this.text="",this.lineSeparator=t.state.facet(Ge.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=ks}readRange(e,t){if(!e)return this;let r=e.parentNode;for(let i=e;;){this.findPointBefore(r,i);let s=this.text.length;this.readNode(i);let o=st.get(i),a=i.nextSibling;if(a==t){o?.breakAfter&&!a&&r!=this.view.contentDOM&&this.lineBreak();break}let l=st.get(a);(o&&l?o.breakAfter:(o?o.breakAfter:Uc(i))||Uc(a)&&(i.nodeName!="BR"||o?.isWidget())&&this.text.length>s)&&!Q3(a,t)&&this.lineBreak(),i=a}return this.findPointBefore(r,t),this}readTextNode(e){let t=e.nodeValue;for(let r of this.points)r.node==e&&(r.pos=this.text.length+Math.min(r.offset,t.length));for(let r=0,i=this.lineSeparator?null:/\r\n?|\n/g;;){let s=-1,o=1,a;if(this.lineSeparator?(s=t.indexOf(this.lineSeparator,r),o=this.lineSeparator.length):(a=i.exec(t))&&(s=a.index,o=a[0].length),this.append(t.slice(r,s<0?t.length:s)),s<0)break;if(this.lineBreak(),o>1)for(let l of this.points)l.node==e&&l.pos>this.text.length&&(l.pos-=o-1);r=s+o}}readNode(e){let t=st.get(e),r=t&&t.overrideDOMText;if(r!=null){this.findPointInside(e,r.length);for(let i=r.iter();!i.next().done;)i.lineBreak?this.lineBreak():this.append(i.value)}else Us(e)?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():yt(e)&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let r of this.points)r.node==e&&e.childNodes[r.offset]==t&&(r.pos=this.text.length)}findPointInside(e,t){for(let r of this.points)(Us(e)?r.node==e:e.contains(r.node))&&(r.pos=this.text.length+(w3(e,r.node,r.offset)?t:0))}}function w3(n,e,t){for(;;){if(!e||t<Wr(e))return!1;if(e==n)return!0;t=yi(e)+1,e=e.parentNode}}function Q3(n,e){let t;for(;!(n==e||!n);n=n.nextSibling){let r=st.get(n);if(!r?.isWidget())return!1;r&&(t||(t=[])).push(r)}if(t)for(let r of t){let i=r.overrideDOMText;if(i?.length)return!1}return!0}class f0{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}}class $3{constructor(e,t,r,i){this.typeOver=i,this.bounds=null,this.text="",this.domChanged=t>-1;let{impreciseHead:s,impreciseAnchor:o}=e.docView,a=e.state.selection;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=qS(e.docView.tile,t,r,0))){let l=s||o?[]:P3(e),c=new v3(l,e);c.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=c.text,this.newSel=T3(l,this.bounds.from)}else{let l=e.observer.selectionRange,c=s&&s.node==l.focusNode&&s.offset==l.focusOffset||!_f(e.contentDOM,l.focusNode)?a.main.head:e.docView.posFromDOM(l.focusNode,l.focusOffset),d=o&&o.node==l.anchorNode&&o.offset==l.anchorOffset||!_f(e.contentDOM,l.anchorNode)?a.main.anchor:e.docView.posFromDOM(l.anchorNode,l.anchorOffset),h=e.viewport;if((Z.ios||Z.chrome)&&c!=d&&Math.min(c,d)<=a.main.from&&Math.max(c,d)>=a.main.to&&(h.from>0||h.to<e.state.doc.length)){let f=Math.min(c,d),p=Math.max(c,d),m=h.from-f,O=h.to-p;(m==0||m==1||f==0)&&(O==0||O==-1||p==e.state.doc.length)&&(c=0,d=e.state.doc.length)}if(e.inputState.composing>-1&&a.ranges.length>1)this.newSel=a.replaceRange(A.range(d,c));else if(e.lineWrapping&&d==c&&!(a.main.empty&&a.main.head==c)&&e.inputState.lastTouchTime>Date.now()-100){let f=e.coordsAtPos(c,-1),p=0;f&&(p=e.inputState.lastTouchY<=f.bottom?-1:1),this.newSel=A.create([A.cursor(c,p)])}else this.newSel=A.single(d,c)}}}function qS(n,e,t,r){if(n.isComposite()){let i=-1,s=-1,o=-1,a=-1;for(let l=0,c=r,d=r;l<n.children.length;l++){let h=n.children[l],f=c+h.length;if(c<e&&f>t)return qS(h,e,t,c);if(f>=e&&i==-1&&(i=l,s=c),c>t&&h.dom.parentNode==n.dom){o=l,a=d;break}d=f,c=f+h.breakAfter}return{from:s,to:a<0?r+n.length:a,startDOM:(i?n.children[i-1].dom.nextSibling:null)||n.dom.firstChild,endDOM:o<n.children.length&&o>=0?n.children[o].dom:null}}else return n.isText()?{from:r,to:r+n.length,startDOM:n.dom,endDOM:n.dom.nextSibling}:null}function YS(n,e){let t,{newSel:r}=e,{state:i}=n,s=i.selection.main,o=n.inputState.lastKeyTime>Date.now()-100?n.inputState.lastKeyCode:-1;if(e.bounds){let{from:a,to:l}=e.bounds,c=s.from,d=null;(o===8||Z.android&&e.text.length<l-a)&&(c=s.to,d="end");let h=i.doc.sliceString(a,l,ks),f,p;!s.empty&&s.from>=a&&s.to<=l&&(e.typeOver||h!=e.text)&&h.slice(0,s.from-a)==e.text.slice(0,s.from-a)&&h.slice(s.to-a)==e.text.slice(f=e.text.length-(h.length-(s.to-a)))?t={from:s.from,to:s.to,insert:xe.of(e.text.slice(s.from-a,f).split(ks))}:(p=US(h,e.text,c-a,d))&&(Z.chrome&&o==13&&p.toB==p.from+2&&e.text.slice(p.from,p.toB)==ks+ks&&p.toB--,t={from:a+p.from,to:a+p.toA,insert:xe.of(e.text.slice(p.from,p.toB).split(ks))})}else r&&(!n.hasFocus&&i.facet(Mr)||Yf(r,s))&&(r=null);if(!t&&!r)return!1;if((Z.mac||Z.android)&&t&&t.from==t.to&&t.from==s.head-1&&/^\. ?$/.test(t.insert.toString())&&n.contentDOM.getAttribute("autocorrect")=="off"?(r&&t.insert.length==2&&(r=A.single(r.main.anchor-1,r.main.head-1)),t={from:t.from,to:t.to,insert:xe.of([t.insert.toString().replace("."," ")])}):i.doc.lineAt(s.from).to<s.to&&n.docView.lineHasWidget(s.to)&&n.inputState.insertingTextAt>Date.now()-50?t={from:s.from,to:s.to,insert:i.toText(n.inputState.insertingText)}:Z.chrome&&t&&t.from==t.to&&t.from==s.head&&t.insert.toString()==`
|
|
52
|
+
`&&n.lineWrapping&&(r&&(r=A.single(r.main.anchor-1,r.main.head-1)),t={from:s.from,to:s.to,insert:xe.of([" "])}),t)return Am(n,t,r,o);if(r&&!Yf(r,s)){let a=!1,l="select";return n.inputState.lastSelectionTime>Date.now()-50&&(n.inputState.lastSelectionOrigin=="select"&&(a=!0),l=n.inputState.lastSelectionOrigin,l=="select.pointer"&&(r=FS(i.facet(ll).map(c=>c(n)),r))),n.dispatch({selection:r,scrollIntoView:a,userEvent:l}),!0}else return!1}function Am(n,e,t,r=-1){if(Z.ios&&n.inputState.flushIOSKey(e))return!0;let i=n.state.selection.main;if(Z.android&&(e.to==i.to&&(e.from==i.from||e.from==i.from-1&&n.state.sliceDoc(e.from,i.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&Xs(n.contentDOM,"Enter",13)||(e.from==i.from-1&&e.to==i.to&&e.insert.length==0||r==8&&e.insert.length<e.to-e.from&&e.to>i.head)&&Xs(n.contentDOM,"Backspace",8)||e.from==i.from&&e.to==i.to+1&&e.insert.length==0&&Xs(n.contentDOM,"Delete",46)))return!0;let s=e.insert.toString();n.inputState.composing>=0&&n.inputState.composing++;let o,a=()=>o||(o=C3(n,e,t));return n.state.facet(NS).some(l=>l(n,e.from,e.to,s,a))||n.dispatch(a()),!0}function C3(n,e,t){let r,i=n.state,s=i.selection.main,o=-1;if(e.from==e.to&&e.from<s.from||e.from>s.to){let l=e.from<s.from?-1:1,c=l<0?s.from:s.to,d=ia(i.facet(ll).map(h=>h(n)),c,l);e.from==d&&(o=d)}if(o>-1)r={changes:e,selection:A.cursor(e.from+e.insert.length,-1)};else if(e.from>=s.from&&e.to<=s.to&&e.to-e.from>=(s.to-s.from)/3&&(!t||t.main.empty&&t.main.from==e.from+e.insert.length)&&n.inputState.composing<0){let l=s.from<e.from?i.sliceDoc(s.from,e.from):"",c=s.to>e.to?i.sliceDoc(e.to,s.to):"";r=i.replaceSelection(n.state.toText(l+e.insert.sliceString(0,void 0,n.state.lineBreak)+c))}else{let l=i.changes(e),c=t&&t.main.to<=l.newLength?t.main:void 0;if(i.selection.ranges.length>1&&(n.inputState.composing>=0||n.inputState.compositionPendingChange)&&e.to<=s.to+10&&e.to>=s.to-10){let d=n.state.sliceDoc(e.from,e.to),h,f=t&&VS(n,t.main.head);if(f){let m=e.insert.length-(e.to-e.from);h={from:f.from,to:f.to-m}}else h=n.state.doc.lineAt(s.head);let p=s.to-e.to;r=i.changeByRange(m=>{if(m.from==s.from&&m.to==s.to)return{changes:l,range:c||m.map(l)};let O=m.to-p,b=O-d.length;if(n.state.sliceDoc(b,O)!=d||O>=h.from&&b<=h.to)return{range:m};let y=i.changes({from:b,to:O,insert:e.insert}),k=m.to-s.to;return{changes:y,range:c?A.range(Math.max(0,c.anchor+k),Math.max(0,c.head+k)):m.map(y)}})}else r={changes:l,selection:c&&i.selection.replaceRange(c)}}let a="input.type";return(n.composing||n.inputState.compositionPendingChange&&n.inputState.compositionEndedAt>Date.now()-50)&&(n.inputState.compositionPendingChange=!1,a+=".compose",n.inputState.compositionFirstChange&&(a+=".start",n.inputState.compositionFirstChange=!1)),i.update(r,{userEvent:a,scrollIntoView:!0})}function US(n,e,t,r){let i=Math.min(n.length,e.length),s=0;for(;s<i&&n.charCodeAt(s)==e.charCodeAt(s);)s++;if(s==i&&n.length==e.length)return null;let o=n.length,a=e.length;for(;o>0&&a>0&&n.charCodeAt(o-1)==e.charCodeAt(a-1);)o--,a--;if(r=="end"){let l=Math.max(0,s-Math.min(o,a));t-=o+l-s}if(o<s&&n.length<e.length){let l=t<=s&&t>=o?s-t:0;s-=l,a=s+(a-o),o=s}else if(a<s){let l=t<=s&&t>=a?s-t:0;s-=l,o=s+(o-a),a=s}return{from:s,toA:o,toB:a}}function P3(n){let e=[];if(n.root.activeElement!=n.contentDOM)return e;let{anchorNode:t,anchorOffset:r,focusNode:i,focusOffset:s}=n.observer.selectionRange;return t&&(e.push(new f0(t,r)),(i!=t||s!=r)&&e.push(new f0(i,s))),e}function T3(n,e){if(n.length==0)return null;let t=n[0].pos,r=n.length==2?n[1].pos:t;return t<0||r<0?null:t==r?A.create([A.cursor(r+e,-1)]):A.single(t+e,r+e)}function Yf(n,e){return e.head==n.main.head&&e.anchor==n.main.anchor}let M3=class{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.touchActive=!1,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=0,this.pendingIOSKey=void 0,this.lastIOSMomentumScroll=0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,Z.safari&&e.contentDOM.addEventListener("input",()=>null),Z.gecko&&F3(e.contentDOM.ownerDocument)}handleEvent(e){!L3(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,t){let r=this.handlers[e];if(r){for(let i of r.observers)i(this.view,t);for(let i of r.handlers){if(t.defaultPrevented)break;if(i(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=R3(e),r=this.handlers,i=this.view.contentDOM;for(let s in t)if(s!="scroll"){let o=!t[s].handlers.length,a=r[s];a&&o!=!a.handlers.length&&(i.removeEventListener(s,this.handleEvent),a=null),a||i.addEventListener(s,this.handleEvent,{passive:o})}for(let s in r)s!="scroll"&&!t[s]&&i.removeEventListener(s,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&HS.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),Z.android&&Z.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;if(Z.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&(GS.some(t=>t.keyCode==e.keyCode)&&!e.ctrlKey||E3.indexOf(e.key)>-1&&e.ctrlKey)){let t={ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey,shiftKey:e.shiftKey};t.shiftKey&&Z.ios&&!/^(off|none)$/.test(this.view.contentDOM.autocapitalize)&&A3(this.view.win)&&(t.shiftKey=!1);let r=this.pendingIOSKey={key:e.key,keyCode:e.keyCode,mods:t};return setTimeout(()=>{this.pendingIOSKey==r&&this.flushIOSKey()},50),!0}return e.keyCode!=229&&this.view.observer.forceFlush(),!1}flushIOSKey(e){let t=this.pendingIOSKey;return!t||this.view.observer.pendingRecords().length||t.key=="Enter"&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString())?!1:(this.pendingIOSKey=void 0,Xs(this.view.contentDOM,t.key,t.keyCode,t.mods))}ignoreDuringComposition(e){return!/^key/.test(e.type)||e.synthetic?!1:this.composing>0?!0:Z.safari&&!Z.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}};function A3(n){return n.visualViewport?n.visualViewport.height*n.visualViewport.scale/n.document.documentElement.clientHeight<.85:!1}function p0(n,e){return(t,r)=>{try{return e.call(n,r,t)}catch(i){Kt(t.state,i)}}}function R3(n){let e=Object.create(null);function t(r){return e[r]||(e[r]={observers:[],handlers:[]})}for(let r of n){let i=r.spec,s=i&&i.plugin.domEventHandlers,o=i&&i.plugin.domEventObservers;if(s)for(let a in s){let l=s[a];l&&t(a).handlers.push(p0(r.value,l))}if(o)for(let a in o){let l=o[a];l&&t(a).observers.push(p0(r.value,l))}}for(let r in Wn)t(r).handlers.push(Wn[r]);for(let r in Vt)t(r).observers.push(Vt[r]);return e}const GS=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],E3="dthko",HS=[16,17,18,20,91,92,224,225],Dl=6;function jl(n){return Math.max(0,n)*.7+8}function N3(n,e){return Math.max(Math.abs(n.clientX-e.clientX),Math.abs(n.clientY-e.clientY))}class D3{constructor(e,t,r,i){this.view=e,this.startEvent=t,this.style=r,this.mustSelect=i,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParents=bS(e.contentDOM),this.atoms=e.state.facet(ll).map(o=>o(e));let s=e.contentDOM.ownerDocument;s.addEventListener("mousemove",this.move=this.move.bind(this)),s.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(Ge.allowMultipleSelections)&&j3(e,t),this.dragging=X3(e,t)&&ek(t)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&N3(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let t=0,r=0,i=0,s=0,o=this.view.win.innerWidth,a=this.view.win.innerHeight;this.scrollParents.x&&({left:i,right:o}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:s,bottom:a}=this.scrollParents.y.getBoundingClientRect());let l=Mm(this.view);e.clientX-l.left<=i+Dl?t=-jl(i-e.clientX):e.clientX+l.right>=o-Dl&&(t=jl(e.clientX-o)),e.clientY-l.top<=s+Dl?r=-jl(s-e.clientY):e.clientY+l.bottom>=a-Dl&&(r=jl(e.clientY-a)),this.setScrollSpeed(t,r)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:t}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),t&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=t,t=0),(e||t)&&this.view.win.scrollBy(e,t),this.dragging===!1&&this.select(this.lastEvent)}select(e){let{view:t}=this,r=FS(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!r.eq(t.state.selection,this.dragging===!1))&&this.view.dispatch({selection:r,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(t=>t.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function j3(n,e){let t=n.state.facet(MS);return t.length?t[0](e):Z.mac?e.metaKey:e.ctrlKey}function I3(n,e){let t=n.state.facet(AS);return t.length?t[0](e):Z.mac?!e.altKey:!e.ctrlKey}function X3(n,e){let{main:t}=n.state.selection;if(t.empty)return!1;let r=Na(n.root);if(!r||r.rangeCount==0)return!0;let i=r.getRangeAt(0).getClientRects();for(let s=0;s<i.length;s++){let o=i[s];if(o.left<=e.clientX&&o.right>=e.clientX&&o.top<=e.clientY&&o.bottom>=e.clientY)return!0}return!1}function L3(n,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target,r;t!=n.contentDOM;t=t.parentNode)if(!t||t.nodeType==11||(r=st.get(t))&&r.isWidget()&&!r.isHidden&&r.widget.ignoreEvent(e))return!1;return!0}const Wn=Object.create(null),Vt=Object.create(null),KS=Z.ie&&Z.ie_version<15||Z.ios&&Z.webkit_version<604;function _3(n){let e=n.dom.parentNode;if(!e)return;let t=e.appendChild(document.createElement("textarea"));t.style.cssText="position: fixed; left: -10000px; top: 10px",t.focus(),setTimeout(()=>{n.focus(),t.remove(),JS(n,t.value)},50)}function fd(n,e,t){for(let r of n.facet(e))t=r(t,n);return t}function JS(n,e){e=fd(n.state,$m,e);let{state:t}=n,r,i=1,s=t.toText(e),o=s.lines==t.selection.ranges.length;if(Uf!=null&&t.selection.ranges.every(l=>l.empty)&&Uf==s.toString()){let l=-1;r=t.changeByRange(c=>{let d=t.doc.lineAt(c.from);if(d.from==l)return{range:c};l=d.from;let h=t.toText((o?s.line(i++).text:e)+t.lineBreak);return{changes:{from:d.from,insert:h},range:A.cursor(c.from+h.length,-1)}})}else o?r=t.changeByRange(l=>{let c=s.line(i++);return{changes:{from:l.from,to:l.to,insert:c.text},range:A.cursor(l.from+c.length,-1)}}):r=t.replaceSelection(s);n.dispatch(r,{userEvent:"input.paste",scrollIntoView:!0})}Vt.scroll=n=>{let e=n.inputState;e.lastScrollTop=n.scrollDOM.scrollTop,e.lastScrollLeft=n.scrollDOM.scrollLeft,Z.ios&&!e.touchActive&&(e.lastIOSMomentumScroll=Date.now())};Vt.wheel=Vt.mousewheel=n=>{n.inputState.lastWheelEvent=Date.now()};Wn.keydown=(n,e)=>(n.inputState.setSelectionOrigin("select"),e.keyCode==27&&n.inputState.tabFocusMode!=0&&(n.inputState.tabFocusMode=Date.now()+2e3),!1);Vt.touchstart=(n,e)=>{let t=n.inputState,r=e.targetTouches[0];t.touchActive=!0,t.lastTouchTime=Date.now(),r&&(t.lastTouchX=r.clientX,t.lastTouchY=r.clientY),t.setSelectionOrigin("select.pointer")};Vt.touchmove=n=>{n.inputState.setSelectionOrigin("select.pointer")};Vt.touchend=(n,e)=>{n.inputState.touchActive=!1};Wn.mousedown=(n,e)=>{if(n.observer.flush(),n.inputState.lastTouchTime>Date.now()-2e3)return!1;let t=null;for(let r of n.state.facet(RS))if(t=r(n,e),t)break;if(!t&&e.button==0&&(t=Z3(n,e)),t){let r=!n.hasFocus;n.inputState.startMouseSelection(new D3(n,e,t,r)),r&&n.observer.ignore(()=>{SS(n.contentDOM);let s=n.root.activeElement;s&&!s.contains(n.contentDOM)&&s.blur()});let i=n.inputState.mouseSelection;if(i)return i.start(e),i.dragging===!1}else n.inputState.setSelectionOrigin("select.pointer");return!1};function m0(n,e,t,r){if(r==1)return A.cursor(e,t);if(r==2)return O3(n.state,e,t);{let i=n.docView.lineAt(e,t),s=n.state.doc.lineAt(i?i.posAtEnd:e),o=i?i.posAtStart:s.from,a=i?i.posAtEnd:s.to;return a<n.state.doc.length&&a==s.to&&a++,A.undirectionalRange(o,a)}}const B3=Z.ie&&Z.ie_version<=11;let g0=null,O0=0,b0=0;function ek(n){if(!B3)return n.detail;let e=g0,t=b0;return g0=n,b0=Date.now(),O0=!e||t>Date.now()-400&&Math.abs(e.clientX-n.clientX)<2&&Math.abs(e.clientY-n.clientY)<2?(O0+1)%3:1}function Z3(n,e){let t=n.posAndSideAtCoords({x:e.clientX,y:e.clientY},!1),r=ek(e),i=n.state.selection;return{update(s){s.docChanged&&(t.pos=s.changes.mapPos(t.pos),i=i.map(s.changes))},get(s,o,a){let l=n.posAndSideAtCoords({x:s.clientX,y:s.clientY},!1),c,d=m0(n,l.pos,l.assoc,r);if(t.pos!=l.pos&&!o){let h=m0(n,t.pos,t.assoc,r),f=Math.min(h.from,d.from),p=Math.max(h.to,d.to);d=f<d.from?A.range(f,p,d.assoc):A.range(p,f,d.assoc)}return o?i.replaceRange(i.main.extend(d.from,d.to,d.assoc)):a&&r==1&&i.ranges.length>1&&(c=W3(i,l.pos))?c:a?i.addRange(d):A.create([d])}}}function W3(n,e){for(let t=0;t<n.ranges.length;t++){let{from:r,to:i}=n.ranges[t];if(r<=e&&i>=e)return A.create(n.ranges.slice(0,t).concat(n.ranges.slice(t+1)),n.mainIndex==t?0:n.mainIndex-(n.mainIndex>t?1:0))}return null}Wn.dragstart=(n,e)=>{let{selection:{main:t}}=n.state;if(e.target.draggable){let i=n.docView.tile.nearest(e.target);if(i&&i.isWidget()){let s=i.posAtStart,o=s+i.length;(s>=t.to||o<=t.from)&&(t=A.undirectionalRange(s,o))}}let{inputState:r}=n;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=t,e.dataTransfer&&(e.dataTransfer.setData("Text",fd(n.state,Cm,n.state.sliceDoc(t.from,t.to))),e.dataTransfer.effectAllowed="copyMove"),!1};Wn.dragend=n=>(n.inputState.draggedContent=null,!1);function y0(n,e,t,r){if(t=fd(n.state,$m,t),!t)return;let i=n.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:s}=n.inputState,o=r&&s&&I3(n,e)?{from:s.from,to:s.to}:null,a={from:i,insert:t},l=n.state.changes(o?[o,a]:a);n.focus(),n.dispatch({changes:l,selection:{anchor:l.mapPos(i,-1),head:l.mapPos(i,1)},userEvent:o?"move.drop":"input.drop"}),n.inputState.draggedContent=null}Wn.drop=(n,e)=>{if(!e.dataTransfer)return!1;if(n.state.readOnly)return!0;let t=e.dataTransfer.files;if(t&&t.length){let r=Array(t.length),i=0,s=()=>{++i==t.length&&y0(n,e,r.filter(o=>o!=null).join(n.state.lineBreak),!1)};for(let o=0;o<t.length;o++){let a=new FileReader;a.onerror=s,a.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(a.result)||(r[o]=a.result),s()},a.readAsText(t[o])}return!0}else{let r=e.dataTransfer.getData("Text");if(r)return y0(n,e,r,!0),!0}return!1};Wn.paste=(n,e)=>{if(n.state.readOnly)return!0;n.observer.flush();let t=KS?null:e.clipboardData;return t?(JS(n,t.getData("text/plain")||t.getData("text/uri-list")),!0):(_3(n),!1)};function z3(n,e){let t=n.dom.parentNode;if(!t)return;let r=t.appendChild(document.createElement("textarea"));r.style.cssText="position: fixed; left: -10000px; top: 10px",r.value=e,r.focus(),r.selectionEnd=e.length,r.selectionStart=0,setTimeout(()=>{r.remove(),n.focus()},50)}function V3(n){let e=[],t=[],r=!1;for(let i of n.selection.ranges)i.empty||(e.push(n.sliceDoc(i.from,i.to)),t.push(i));if(!e.length){let i=-1;for(let{from:s}of n.selection.ranges){let o=n.doc.lineAt(s);o.number>i&&(e.push(o.text),t.push({from:o.from,to:Math.min(n.doc.length,o.to+1)})),i=o.number}r=!0}return{text:fd(n,Cm,e.join(n.lineBreak)),ranges:t,linewise:r}}let Uf=null;Wn.copy=Wn.cut=(n,e)=>{if(!ta(n.contentDOM,n.observer.selectionRange))return!1;let{text:t,ranges:r,linewise:i}=V3(n.state);if(!t&&!i)return!1;Uf=i?t:null,e.type=="cut"&&!n.state.readOnly&&n.dispatch({changes:r,scrollIntoView:!0,userEvent:"delete.cut"});let s=KS?null:e.clipboardData;return s?(s.clearData(),s.setData("text/plain",t),!0):(z3(n,t),!1)};const tk=Or.define();function nk(n,e){let t=[];for(let r of n.facet(DS)){let i=r(n,e);i&&t.push(i)}return t.length?n.update({effects:t,annotations:tk.of(!0)}):null}function rk(n){setTimeout(()=>{let e=n.hasFocus;if(e!=n.inputState.notifiedFocused){let t=nk(n.state,e);t?n.dispatch(t):n.update([])}},10)}Vt.focus=n=>{n.inputState.lastFocusTime=Date.now(),!n.scrollDOM.scrollTop&&(n.inputState.lastScrollTop||n.inputState.lastScrollLeft)&&(n.scrollDOM.scrollTop=n.inputState.lastScrollTop,n.scrollDOM.scrollLeft=n.inputState.lastScrollLeft),rk(n)};Vt.blur=n=>{n.observer.clearSelectionRange(),rk(n)};Vt.compositionstart=Vt.compositionupdate=(n,e)=>{if(!n.observer.editContext&&(n.inputState.compositionFirstChange==null&&(n.inputState.compositionFirstChange=!0),n.inputState.composing<0)){let{main:t}=n.state.selection;!t.empty&&n.lineBlockAt(t.from).from!=n.lineBlockAt(t.to).from&&!n.state.readOnly&&n.dispatch({changes:n.state.selection.ranges.filter(r=>!r.empty).map(r=>({from:r.from,to:r.to})),userEvent:"input"}),n.inputState.composing=0}};Vt.compositionend=n=>{n.observer.editContext||(n.inputState.composing=-1,n.inputState.compositionEndedAt=Date.now(),n.inputState.compositionPendingKey=!0,n.inputState.compositionPendingChange=n.observer.pendingRecords().length>0,n.inputState.compositionFirstChange=null,Z.chrome&&Z.android?n.observer.flushSoon():n.inputState.compositionPendingChange?Promise.resolve().then(()=>n.observer.flush()):setTimeout(()=>{n.inputState.composing<0&&n.docView.hasComposition&&n.update([])},50))};Vt.contextmenu=n=>{n.inputState.lastContextMenu=Date.now()};Wn.beforeinput=(n,e)=>{var t,r;if((e.inputType=="insertText"||e.inputType=="insertCompositionText")&&(n.inputState.insertingText=e.data,n.inputState.insertingTextAt=Date.now()),e.inputType=="insertReplacementText"&&n.observer.editContext){let s=(t=e.dataTransfer)===null||t===void 0?void 0:t.getData("text/plain"),o=e.getTargetRanges();if(s&&o.length){let a=o[0],l=n.posAtDOM(a.startContainer,a.startOffset),c=n.posAtDOM(a.endContainer,a.endOffset);return Am(n,{from:l,to:c,insert:n.state.toText(s)},null),!0}}let i;if(Z.chrome&&Z.android&&(i=GS.find(s=>s.inputType==e.inputType))&&(n.observer.delayAndroidKey(i.key,i.keyCode),i.key=="Backspace"||i.key=="Delete")){let s=((r=window.visualViewport)===null||r===void 0?void 0:r.height)||0;setTimeout(()=>{var o;(((o=window.visualViewport)===null||o===void 0?void 0:o.height)||0)>s+10&&n.hasFocus&&(n.contentDOM.blur(),n.focus())},100)}return Z.ios&&e.inputType=="deleteContentForward"&&n.observer.flushSoon(),Z.safari&&e.inputType=="insertText"&&n.inputState.composing>=0&&setTimeout(()=>Vt.compositionend(n,e),20),!1};const x0=new Set;function F3(n){x0.has(n)||(x0.add(n),n.addEventListener("copy",()=>{}),n.addEventListener("cut",()=>{}))}const S0=["pre-wrap","normal","pre-line","break-spaces"];let Ks=!1;function k0(){Ks=!1}class q3{constructor(e){this.lineWrapping=e,this.doc=xe.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,t){let r=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(r+=Math.max(0,Math.ceil((t-e-r*this.lineLength*.5)/this.lineLength))),this.lineHeight*r}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return S0.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let r=0;r<e.length;r++){let i=e[r];i<0?r++:this.heightSamples[Math.floor(i*10)]||(t=!0,this.heightSamples[Math.floor(i*10)]=!0)}return t}refresh(e,t,r,i,s,o){let a=S0.indexOf(e)>-1,l=Math.abs(t-this.lineHeight)>.3||this.lineWrapping!=a;if(this.lineWrapping=a,this.lineHeight=t,this.charWidth=r,this.textHeight=i,this.lineLength=s,l){this.heightSamples={};for(let c=0;c<o.length;c++){let d=o[c];d<0?c++:this.heightSamples[Math.floor(d*10)]=!0}}return l}}class Y3{constructor(e,t){this.from=e,this.heights=t,this.index=0}get more(){return this.index<this.heights.length}}class In{constructor(e,t,r,i,s){this.from=e,this.length=t,this.top=r,this.height=i,this._content=s}get type(){return typeof this._content=="number"?Tt.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof Ji?this._content.widget:null}get widgetLineBreaks(){return typeof this._content=="number"?this._content:0}join(e){let t=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(e._content)?e._content:[e]);return new In(this.from,this.length+e.length,this.top,this.height+e.height,t)}}var ze=(function(n){return n[n.ByPos=0]="ByPos",n[n.ByHeight=1]="ByHeight",n[n.ByPosNoHeight=2]="ByPosNoHeight",n})(ze||(ze={}));const vc=.001;class zt{constructor(e,t,r=2){this.length=e,this.height=t,this.flags=r}get outdated(){return(this.flags&2)>0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>vc&&(Ks=!0),this.height=e)}replace(e,t,r){return zt.of(r)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,r,i){let s=this,o=r.doc;for(let a=i.length-1;a>=0;a--){let{fromA:l,toA:c,fromB:d,toB:h}=i[a],f=s.lineAt(l,ze.ByPosNoHeight,r.setDoc(t),0,0),p=f.to>=c?f:s.lineAt(c,ze.ByPosNoHeight,r,0,0);for(h+=p.to-c,c=p.to;a>0&&f.from<=i[a-1].toA;)l=i[a-1].fromA,d=i[a-1].fromB,a--,l<f.from&&(f=s.lineAt(l,ze.ByPosNoHeight,r,0,0));d+=f.from-l,l=f.from;let m=Rm.build(r.setDoc(o),e,d,h);s=Jc(s,s.replace(l,c,m))}return s.updateHeight(r,0)}static empty(){return new dn(0,0,0)}static of(e){if(e.length==1)return e[0];let t=0,r=e.length,i=0,s=0;for(;;)if(t==r)if(i>s*2){let a=e[t-1];a.break?e.splice(--t,1,a.left,null,a.right):e.splice(--t,1,a.left,a.right),r+=1+a.break,i-=a.size}else if(s>i*2){let a=e[r];a.break?e.splice(r,1,a.left,null,a.right):e.splice(r,1,a.left,a.right),r+=2+a.break,s-=a.size}else break;else if(i<s){let a=e[t++];a&&(i+=a.size)}else{let a=e[--r];a&&(s+=a.size)}let o=!1;return e[t-1]==null?(o=!0,t--):e[t]==null&&(o=!0,r++),new G3(zt.of(e.slice(0,t)),o,zt.of(e.slice(r)))}}function Jc(n,e){return n==e?n:(n.constructor!=e.constructor&&(Ks=!0),e)}zt.prototype.size=1;const U3=G.replace({});class ik extends zt{constructor(e,t,r){super(e,t),this.deco=r,this.spaceAbove=0}mainBlock(e,t){return new In(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.deco||0)}blockAt(e,t,r,i){return this.spaceAbove&&e<r+this.spaceAbove?new In(i,0,r,this.spaceAbove,U3):this.mainBlock(r,i)}lineAt(e,t,r,i,s){let o=this.mainBlock(i,s);return this.spaceAbove?this.blockAt(0,r,i,s).join(o):o}forEachLine(e,t,r,i,s,o){e<=s+this.length&&t>=s&&o(this.lineAt(0,ze.ByPos,r,i,s))}setMeasuredHeight(e){let t=e.heights[e.index++];t<0?(this.spaceAbove=-t,t=e.heights[e.index++]):this.spaceAbove=0,this.setHeight(t)}updateHeight(e,t=0,r=!1,i){return i&&i.from<=t&&i.more&&this.setMeasuredHeight(i),this.outdated=!1,this}toString(){return`block(${this.length})`}}class dn extends ik{constructor(e,t,r){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=r}mainBlock(e,t){return new In(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(e,t,r){let i=r[0];return r.length==1&&(i instanceof dn||i instanceof wt&&i.flags&4)&&Math.abs(this.length-i.length)<10?(i instanceof wt?i=new dn(i.length,this.height,this.spaceAbove):i.height=this.height,this.outdated||(i.outdated=!1),i):zt.of(r)}updateHeight(e,t=0,r=!1,i){return i&&i.from<=t&&i.more?this.setMeasuredHeight(i):(r||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class wt extends zt{constructor(e){super(e,0)}heightMetrics(e,t){let r=e.doc.lineAt(t).number,i=e.doc.lineAt(t+this.length).number,s=i-r+1,o,a=0;if(e.lineWrapping){let l=Math.min(this.height,e.lineHeight*s);o=l/s,this.length>s+1&&(a=(this.height-l)/(this.length-s-1))}else o=this.height/s;return{firstLine:r,lastLine:i,perLine:o,perChar:a}}blockAt(e,t,r,i){let{firstLine:s,lastLine:o,perLine:a,perChar:l}=this.heightMetrics(t,i);if(t.lineWrapping){let c=i+(e<t.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-r)/this.height))*this.length)),d=t.doc.lineAt(c),h=a+d.length*l,f=Math.max(r,e-h/2);return new In(d.from,d.length,f,h,0)}else{let c=Math.max(0,Math.min(o-s,Math.floor((e-r)/a))),{from:d,length:h}=t.doc.line(s+c);return new In(d,h,r+a*c,a,0)}}lineAt(e,t,r,i,s){if(t==ze.ByHeight)return this.blockAt(e,r,i,s);if(t==ze.ByPosNoHeight){let{from:p,to:m}=r.doc.lineAt(e);return new In(p,m-p,0,0,0)}let{firstLine:o,perLine:a,perChar:l}=this.heightMetrics(r,s),c=r.doc.lineAt(e),d=a+c.length*l,h=c.number-o,f=i+a*h+l*(c.from-s-h);return new In(c.from,c.length,Math.max(i,Math.min(f,i+this.height-d)),d,0)}forEachLine(e,t,r,i,s,o){e=Math.max(e,s),t=Math.min(t,s+this.length);let{firstLine:a,perLine:l,perChar:c}=this.heightMetrics(r,s);for(let d=e,h=i;d<=t;){let f=r.doc.lineAt(d);if(d==e){let m=f.number-a;h+=l*m+c*(e-s-m)}let p=l+c*f.length;o(new In(f.from,f.length,h,p,0)),h+=p,d=f.to+1}}replace(e,t,r){let i=this.length-t;if(i>0){let s=r[r.length-1];s instanceof wt?r[r.length-1]=new wt(s.length+i):r.push(null,new wt(i-1))}if(e>0){let s=r[0];s instanceof wt?r[0]=new wt(e+s.length):r.unshift(new wt(e-1),null)}return zt.of(r)}decomposeLeft(e,t){t.push(new wt(e-1),null)}decomposeRight(e,t){t.push(null,new wt(this.length-e-1))}updateHeight(e,t=0,r=!1,i){let s=t+this.length;if(i&&i.from<=t+this.length&&i.more){let o=[],a=Math.max(t,i.from),l=-1;for(i.from>t&&o.push(new wt(i.from-t-1).updateHeight(e,t));a<=s&&i.more;){let d=e.doc.lineAt(a).length;o.length&&o.push(null);let h=i.heights[i.index++],f=0;h<0&&(f=-h,h=i.heights[i.index++]),l==-1?l=h:Math.abs(h-l)>=vc&&(l=-2);let p=new dn(d,h,f);p.outdated=!1,o.push(p),a+=d+1}a<=s&&o.push(null,new wt(s-a).updateHeight(e,a));let c=zt.of(o);return(l<0||Math.abs(c.height-this.height)>=vc||Math.abs(l-this.heightMetrics(e,t).perLine)>=vc)&&(Ks=!0),Jc(this,c)}else(r||this.outdated)&&(this.setHeight(e.heightForGap(t,t+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class G3 extends zt{constructor(e,t,r){super(e.length+(t?1:0)+r.length,e.height+r.height,(t?1:0)|(e.outdated||r.outdated?2:0)),this.left=e,this.right=r,this.size=e.size+r.size}get break(){return this.flags&1}blockAt(e,t,r,i){let s=r+this.left.height;return e<s?this.left.blockAt(e,t,r,i):this.right.blockAt(e,t,s,i+this.left.length+this.break)}lineAt(e,t,r,i,s){let o=i+this.left.height,a=s+this.left.length+this.break,l=t==ze.ByHeight?e<o:e<a,c=l?this.left.lineAt(e,t,r,i,s):this.right.lineAt(e,t,r,o,a);if(this.break||(l?c.to<a:c.from>a))return c;let d=t==ze.ByPosNoHeight?ze.ByPosNoHeight:ze.ByPos;return l?c.join(this.right.lineAt(a,d,r,o,a)):this.left.lineAt(a,d,r,i,s).join(c)}forEachLine(e,t,r,i,s,o){let a=i+this.left.height,l=s+this.left.length+this.break;if(this.break)e<l&&this.left.forEachLine(e,t,r,i,s,o),t>=l&&this.right.forEachLine(e,t,r,a,l,o);else{let c=this.lineAt(l,ze.ByPos,r,i,s);e<c.from&&this.left.forEachLine(e,Math.min(t,c.from-1),r,i,s,o),c.to>=e&&c.from<=t&&o(c),t>c.to&&this.right.forEachLine(Math.max(e,c.to+1),t,r,a,l,o)}}replace(e,t,r){let i=this.left.length+this.break;if(t<i)return this.balanced(this.left.replace(e,t,r),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-i,t-i,r));let s=[];e>0&&this.decomposeLeft(e,s);let o=s.length;for(let a of r)s.push(a);if(e>0&&v0(s,o-1),t<this.length){let a=s.length;this.decomposeRight(t,s),v0(s,a)}return zt.of(s)}decomposeLeft(e,t){let r=this.left.length;if(e<=r)return this.left.decomposeLeft(e,t);t.push(this.left),this.break&&(r++,e>=r&&t.push(null)),e>r&&this.right.decomposeLeft(e-r,t)}decomposeRight(e,t){let r=this.left.length,i=r+this.break;if(e>=i)return this.right.decomposeRight(e-i,t);e<r&&this.left.decomposeRight(e,t),this.break&&e<i&&t.push(null),t.push(this.right)}balanced(e,t){return e.size>2*t.size||t.size>2*e.size?zt.of(this.break?[e,null,t]:[e,t]):(this.left=Jc(this.left,e),this.right=Jc(this.right,t),this.setHeight(e.height+t.height),this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,r=!1,i){let{left:s,right:o}=this,a=t+s.length+this.break,l=null;return i&&i.from<=t+s.length&&i.more?l=s=s.updateHeight(e,t,r,i):s.updateHeight(e,t,r),i&&i.from<=a+o.length&&i.more?l=o=o.updateHeight(e,a,r,i):o.updateHeight(e,a,r),l?this.balanced(s,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function v0(n,e){let t,r;n[e]==null&&(t=n[e-1])instanceof wt&&(r=n[e+1])instanceof wt&&n.splice(e-1,3,new wt(t.length+1+r.length))}const H3=5;class Rm{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let r=Math.min(t,this.lineEnd),i=this.nodes[this.nodes.length-1];i instanceof dn?i.length+=r-this.pos:(r>this.pos||!this.isCovered)&&this.nodes.push(new dn(r-this.pos,-1,0)),this.writtenTo=r,t>r&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,r){if(e<t||r.heightRelevant){let i=r.widget?r.widget.estimatedHeight:0,s=r.widget?r.widget.lineBreaks:0;i<0&&(i=this.oracle.lineHeight);let o=t-e;r.block?this.addBlock(new ik(o,i,r)):(o||s||i>=H3)&&this.addLineDeco(i,s,o)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenTo<e&&((this.writtenTo<e-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new dn(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,t){let r=new wt(t-e);return this.oracle.doc.lineAt(e).to==t&&(r.flags|=4),r}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof dn)return e;let t=new dn(0,-1,0);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,r){let i=this.ensureLine();i.length+=r,i.collapsed+=r,i.widgetHeight=Math.max(i.widgetHeight,e),i.breaks+=t,this.writtenTo=this.pos=this.pos+r}finish(e){let t=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(t instanceof dn)&&!this.isCovered?this.nodes.push(new dn(0,-1,0)):(this.writtenTo<this.pos||t==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let r=e;for(let i of this.nodes)i instanceof dn&&i.updateHeight(this.oracle,r),r+=i?i.length:1;return this.nodes}static build(e,t,r,i){let s=new Rm(r,e);return me.spans(t,r,i,s,0),s.finish(r)}}function K3(n,e,t){let r=new J3;return me.compare(n,e,t,r,0),r.changes}class J3{constructor(){this.changes=[]}compareRange(){}comparePoint(e,t,r,i){(e<t||r&&r.heightRelevant||i&&i.heightRelevant)&&Is(e,t,this.changes,5)}}function eA(n,e){let t=n.getBoundingClientRect(),r=n.ownerDocument,i=r.defaultView||window,s=Math.max(0,t.left),o=Math.min(i.innerWidth,t.right),a=Math.max(0,t.top),l=Math.min(i.innerHeight,t.bottom);for(let c=n.parentNode;c&&c!=r.body;)if(yt(c)){let d=window.getComputedStyle(c);if((c.scrollHeight>c.clientHeight||c.scrollWidth>c.clientWidth)&&d.overflow!="visible"){let h=c.getBoundingClientRect();s=Math.max(s,h.left),o=Math.min(o,h.right),a=Math.max(a,h.top),l=Math.min(c==n.parentNode?i.innerHeight:l,h.bottom)}c=d.position=="absolute"||d.position=="fixed"?c.offsetParent:c.parentNode}else if(c.nodeType==11)c=c.host;else break;return{left:s-t.left,right:Math.max(s,o)-t.left,top:a-(t.top+e),bottom:Math.max(a,l)-(t.top+e)}}function tA(n){let e=n.getBoundingClientRect(),t=n.ownerDocument.defaultView||window;return e.left<t.innerWidth&&e.right>0&&e.top<t.innerHeight&&e.bottom>0}function nA(n,e){let t=n.getBoundingClientRect();return{left:0,right:t.right-t.left,top:e,bottom:t.bottom-(t.top+e)}}class lh{constructor(e,t,r,i){this.from=e,this.to=t,this.size=r,this.displaySize=i}static same(e,t){if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++){let i=e[r],s=t[r];if(i.from!=s.from||i.to!=s.to||i.size!=s.size)return!1}return!0}draw(e,t){return G.replace({widget:new rA(this.displaySize*(t?e.scaleY:e.scaleX),t)}).range(this.from,this.to)}}class rA extends zn{constructor(e,t){super(),this.size=e,this.vertical=t}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement("div");return this.vertical?e.style.height=this.size+"px":(e.style.width=this.size+"px",e.style.height="2px",e.style.display="inline-block"),e}get estimatedHeight(){return this.vertical?this.size:-1}}class w0{constructor(e,t){this.view=e,this.state=t,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scaleX=1,this.scaleY=1,this.scrollOffset=0,this.scrolledToBottom=!1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=Q0,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=Re.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let r=t.facet(Pm).some(i=>typeof i!="function"&&i.class=="cm-lineWrapping");this.heightOracle=new q3(r),this.stateDeco=$0(t),this.heightMap=zt.empty().applyChanges(this.stateDeco,xe.empty,this.heightOracle.setDoc(t.doc),[new Cn(0,0,0,t.doc.length)]);for(let i=0;i<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());i++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=G.set(this.lineGaps.map(i=>i.draw(this,!1))),this.scrollParent=e.scrollDOM,this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let r=0;r<=1;r++){let i=r?t.head:t.anchor;if(!e.some(({from:s,to:o})=>i>=s&&i<=o)){let{from:s,to:o}=this.lineBlockAt(i);e.push(new Il(s,o))}}return this.viewports=e.sort((r,i)=>r.from-i.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?Q0:new Em(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(Wo(e,this.scaler))})}update(e,t=null){this.state=e.state;let r=this.stateDeco;this.stateDeco=$0(this.state);let i=e.changedRanges,s=Cn.extendWithRanges(i,K3(r,this.stateDeco,e?e.changes:ft.empty(this.state.doc.length))),o=this.heightMap.height,a=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);k0(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),s),(this.heightMap.height!=o||Ks)&&(e.flags|=2),a?(this.scrollAnchorPos=e.changes.mapPos(a.from,-1),this.scrollAnchorHeight=a.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=o);let l=s.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.head<l.from||t.range.head>l.to)||!this.viewportIsAppropriate(l))&&(l=this.getViewport(0,t));let c=l.from!=this.viewport.from||l.to!=this.viewport.to;this.viewport=l,e.flags|=this.updateForViewport(),(c||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&(e.selectionSet||e.focusChanged)&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(IS)&&(this.mustEnforceCursorAssoc=!0)}measure(){let{view:e}=this,t=e.contentDOM,r=window.getComputedStyle(t),i=this.heightOracle,s=r.whiteSpace;this.defaultTextDirection=r.direction=="rtl"?Re.RTL:Re.LTR;let o=this.heightOracle.mustRefreshForWrapping(s)||this.mustMeasureContent==="refresh",a=t.getBoundingClientRect(),l=o||this.mustMeasureContent||this.contentDOMHeight!=a.height;this.contentDOMHeight=a.height,this.mustMeasureContent=!1;let c=0,d=0;if(a.width&&a.height){let{scaleX:v,scaleY:w}=OS(t,a);(v>.005&&Math.abs(this.scaleX-v)>.005||w>.005&&Math.abs(this.scaleY-w)>.005)&&(this.scaleX=v,this.scaleY=w,c|=16,o=l=!0)}let h=(parseInt(r.paddingTop)||0)*this.scaleY,f=(parseInt(r.paddingBottom)||0)*this.scaleY;(this.paddingTop!=h||this.paddingBottom!=f)&&(this.paddingTop=h,this.paddingBottom=f,c|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(i.lineWrapping&&(l=!0),this.editorWidth=e.scrollDOM.clientWidth,c|=16);let p=bS(this.view.contentDOM,!1).y;p!=this.scrollParent&&(this.scrollParent=p,this.scrollAnchorHeight=-1,this.scrollOffset=0);let m=this.getScrollOffset();this.scrollOffset!=m&&(this.scrollAnchorHeight=-1,this.scrollOffset=m),this.scrolledToBottom=kS(this.scrollParent||e.win);let O=(this.printing?nA:eA)(t,this.paddingTop),b=O.top-this.pixelViewport.top,y=O.bottom-this.pixelViewport.bottom;this.pixelViewport=O;let k=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(k!=this.inView&&(this.inView=k,k&&(l=!0)),!this.inView&&!this.scrollTarget&&!tA(e.dom))return 0;let x=a.width;if((this.contentDOMWidth!=x||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=a.width,this.editorHeight=e.scrollDOM.clientHeight,c|=16),l){let v=e.docView.measureVisibleLineHeights(this.viewport);if(i.mustRefreshForHeights(v)&&(o=!0),o||i.lineWrapping&&Math.abs(x-this.contentDOMWidth)>i.charWidth){let{lineHeight:w,charWidth:Q,textHeight:P}=e.docView.measureTextSize();o=w>0&&i.refresh(s,w,Q,P,Math.max(5,x/Q),v),o&&(e.docView.minWidth=0,c|=16)}b>0&&y>0?d=Math.max(b,y):b<0&&y<0&&(d=Math.min(b,y)),k0();for(let w of this.viewports){let Q=w.from==this.viewport.from?v:e.docView.measureVisibleLineHeights(w);this.heightMap=(o?zt.empty().applyChanges(this.stateDeco,xe.empty,this.heightOracle,[new Cn(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(i,0,o,new Y3(w.from,Q))}Ks&&(c|=2)}let S=!this.viewportIsAppropriate(this.viewport,d)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return S&&(c&2&&(c|=this.updateScaler()),this.viewport=this.getViewport(d,this.scrollTarget),c|=this.updateForViewport()),(c&2||S)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,e)),c|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),c}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let r=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),i=this.heightMap,s=this.heightOracle,{visibleTop:o,visibleBottom:a}=this,l=new Il(i.lineAt(o-r*1e3,ze.ByHeight,s,0,0).from,i.lineAt(a+(1-r)*1e3,ze.ByHeight,s,0,0).to);if(t){let{head:c}=t.range;if(c<l.from||c>l.to){let d=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),h=i.lineAt(c,ze.ByPos,s,0,0),f;t.y=="center"?f=(h.top+h.bottom)/2-d/2:t.y=="start"||t.y=="nearest"&&c<l.from?f=h.top:f=h.bottom-d,l=new Il(i.lineAt(f-1e3/2,ze.ByHeight,s,0,0).from,i.lineAt(f+d+1e3/2,ze.ByHeight,s,0,0).to)}}return l}mapViewport(e,t){let r=t.mapPos(e.from,-1),i=t.mapPos(e.to,1);return new Il(this.heightMap.lineAt(r,ze.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(i,ze.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:t},r=0){if(!this.inView)return!0;let{top:i}=this.heightMap.lineAt(e,ze.ByPos,this.heightOracle,0,0),{bottom:s}=this.heightMap.lineAt(t,ze.ByPos,this.heightOracle,0,0),{visibleTop:o,visibleBottom:a}=this;return(e==0||i<=o-Math.max(10,Math.min(-r,250)))&&(t==this.state.doc.length||s>=a+Math.max(10,Math.min(r,250)))&&i>o-2*1e3&&s<a+2*1e3}mapLineGaps(e,t){if(!e.length||t.empty)return e;let r=[];for(let i of e)t.touchesRange(i.from,i.to)||r.push(new lh(t.mapPos(i.from),t.mapPos(i.to),i.size,i.displaySize));return r}ensureLineGaps(e,t){let r=this.heightOracle.lineWrapping,i=r?1e4:2e3,s=i>>1,o=i<<1;if(this.defaultTextDirection!=Re.LTR&&!r)return[];let a=[],l=(d,h,f,p)=>{if(h-d<s)return;let m=this.state.selection.main,O=[m.from];m.empty||O.push(m.to);for(let y of O)if(y>d&&y<h){l(d,y-10,f,p),l(y+10,h,f,p);return}let b=sA(e,y=>y.from>=f.from&&y.to<=f.to&&Math.abs(y.from-d)<s&&Math.abs(y.to-h)<s&&!O.some(k=>y.from<k&&y.to>k));if(!b){if(h<f.to&&t&&r&&t.visibleRanges.some(x=>x.from<=h&&x.to>=h)){let x=t.moveToLineBoundary(A.cursor(h),!1,!0).head;x>d&&(h=x)}let y=this.gapSize(f,d,h,p),k=r||y<2e6?y:2e6;b=new lh(d,h,y,k)}a.push(b)},c=d=>{if(d.length<o||d.type!=Tt.Text)return;let h=iA(d.from,d.to,this.stateDeco);if(h.total<o)return;let f=this.scrollTarget?this.scrollTarget.range.head:null,p,m;if(r){let O=i/this.heightOracle.lineLength*this.heightOracle.lineHeight,b,y;if(f!=null){let k=Ll(h,f),x=((this.visibleBottom-this.visibleTop)/2+O)/d.height;b=k-x,y=k+x}else b=(this.visibleTop-d.top-O)/d.height,y=(this.visibleBottom-d.top+O)/d.height;p=Xl(h,b),m=Xl(h,y)}else{let O=h.total*this.heightOracle.charWidth,b=i*this.heightOracle.charWidth,y=0;if(O>2e6)for(let w of e)w.from>=d.from&&w.from<d.to&&w.size!=w.displaySize&&w.from*this.heightOracle.charWidth+y<this.pixelViewport.left&&(y=w.size-w.displaySize);let k=this.pixelViewport.left+y,x=this.pixelViewport.right+y,S,v;if(f!=null){let w=Ll(h,f),Q=((x-k)/2+b)/O;S=w-Q,v=w+Q}else S=(k-b)/O,v=(x+b)/O;p=Xl(h,S),m=Xl(h,v)}p>d.from&&l(d.from,p,d,h),m<d.to&&l(m,d.to,d,h)};for(let d of this.viewportLines)Array.isArray(d.type)?d.type.forEach(c):c(d);return a}gapSize(e,t,r,i){let s=Ll(i,r)-Ll(i,t);return this.heightOracle.lineWrapping?e.height*s:i.total*this.heightOracle.charWidth*s}updateLineGaps(e){lh.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=G.set(e.map(t=>t.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let t=this.stateDeco;this.lineGaps.length&&(t=t.concat(this.lineGapDeco));let r=[];me.spans(t,this.viewport.from,this.viewport.to,{span(s,o){r.push({from:s,to:o})},point(){}},20);let i=0;if(r.length!=this.visibleRanges.length)i=12;else for(let s=0;s<r.length&&!(i&8);s++){let o=this.visibleRanges[s],a=r[s];(o.from!=a.from||o.to!=a.to)&&(i|=4,e&&e.mapPos(o.from,-1)==a.from&&e.mapPos(o.to,1)==a.to||(i|=8))}return this.visibleRanges=r,i}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||Wo(this.heightMap.lineAt(e,ze.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(t=>t.top<=e&&t.bottom>=e)||Wo(this.heightMap.lineAt(this.scaler.fromDOM(e),ze.ByHeight,this.heightOracle,0,0),this.scaler)}getScrollOffset(){return this.scrollParent==this.view.scrollDOM?this.scrollParent.scrollTop*this.scaleY:(this.scrollParent?this.scrollParent.getBoundingClientRect().top:0)-this.view.contentDOM.getBoundingClientRect().top}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return Wo(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class Il{constructor(e,t){this.from=e,this.to=t}}function iA(n,e,t){let r=[],i=n,s=0;return me.spans(t,n,e,{span(){},point(o,a){o>i&&(r.push({from:i,to:o}),s+=o-i),i=a}},20),i<e&&(r.push({from:i,to:e}),s+=e-i),{total:s,ranges:r}}function Xl({total:n,ranges:e},t){if(t<=0)return e[0].from;if(t>=1)return e[e.length-1].to;let r=Math.floor(n*t);for(let i=0;;i++){let{from:s,to:o}=e[i],a=o-s;if(r<=a)return s+r;r-=a}}function Ll(n,e){let t=0;for(let{from:r,to:i}of n.ranges){if(e<=i){t+=e-r;break}t+=i-r}return t/n.total}function sA(n,e){for(let t of n)if(e(t))return t}const Q0={toDOM(n){return n},fromDOM(n){return n},scale:1,eq(n){return n==this}};function $0(n){let e=n.facet(ud).filter(r=>typeof r!="function"),t=n.facet(Tm).filter(r=>typeof r!="function");return t.length&&e.push(me.join(t)),e}class Em{constructor(e,t,r){let i=0,s=0,o=0;this.viewports=r.map(({from:a,to:l})=>{let c=t.lineAt(a,ze.ByPos,e,0,0).top,d=t.lineAt(l,ze.ByPos,e,0,0).bottom;return i+=d-c,{from:a,to:l,top:c,bottom:d,domTop:0,domBottom:0}}),this.scale=(7e6-i)/(t.height-i);for(let a of this.viewports)a.domTop=o+(a.top-s)*this.scale,o=a.domBottom=a.domTop+(a.bottom-a.top),s=a.bottom}toDOM(e){for(let t=0,r=0,i=0;;t++){let s=t<this.viewports.length?this.viewports[t]:null;if(!s||e<s.top)return i+(e-r)*this.scale;if(e<=s.bottom)return s.domTop+(e-s.top);r=s.bottom,i=s.domBottom}}fromDOM(e){for(let t=0,r=0,i=0;;t++){let s=t<this.viewports.length?this.viewports[t]:null;if(!s||e<s.domTop)return r+(e-i)/this.scale;if(e<=s.domBottom)return s.top+(e-s.domTop);r=s.bottom,i=s.domBottom}}eq(e){return e instanceof Em?this.scale==e.scale&&this.viewports.length==e.viewports.length&&this.viewports.every((t,r)=>t.from==e.viewports[r].from&&t.to==e.viewports[r].to):!1}}function Wo(n,e){if(e.scale==1)return n;let t=e.toDOM(n.top),r=e.toDOM(n.bottom);return new In(n.from,n.length,t,r-t,Array.isArray(n._content)?n._content.map(i=>Wo(i,e)):n._content)}const _l=W.define({combine:n=>n.join(" ")}),Gf=W.define({combine:n=>n.indexOf(!0)>-1}),Hf=bi.newName(),sk=bi.newName(),ok=bi.newName(),ak={"&light":"."+sk,"&dark":"."+ok};function Kf(n,e,t){return new bi(e,{finish(r){return/&/.test(r)?r.replace(/&\w*/,i=>{if(i=="&")return n;if(!t||!t[i])throw new RangeError(`Unsupported selector: ${i}`);return t[i]}):n+" "+r}})}const oA=Kf("."+Hf,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{userSelect:"none",position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-selectionHandle":{backgroundColor:"currentColor",width:"1.5px"},".cm-selectionHandle-start::before, .cm-selectionHandle-end::before":{content:'""',backgroundColor:"inherit",borderRadius:"50%",width:"8px",height:"8px",position:"absolute",left:"-3.25px"},".cm-selectionHandle-start::before":{top:"-8px"},".cm-selectionHandle-end::before":{bottom:"-8px"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},".cm-panels-top":{top:"0"},".cm-panels-bottom":{bottom:"0"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"baseline",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{background:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 0) no-repeat",backgroundSize:".4em",backgroundPosition:"calc(min(50%, 0px)) center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},ak),aA={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},ch=Z.ie&&Z.ie_version<=11;let lA=class{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new IM,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let r of t)this.queue.push(r);(Z.ie&&Z.ie_version<=11||Z.ios&&e.composing)&&t.some(r=>r.type=="childList"&&r.removedNodes.length||r.type=="characterData"&&r.oldValue.length>r.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&Z.android&&e.constructor.EDIT_CONTEXT!==!1&&!(Z.chrome&&Z.chrome_version<126)&&(this.editContext=new uA(e),e.state.facet(Mr)&&(e.contentDOM.editContext=this.editContext.editContext)),ch&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var t;((t=this.view.docView)===null||t===void 0?void 0:t.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver=="function"&&(this.intersection=new IntersectionObserver(t=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),t.length>0&&t[t.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(t=>{t.length>0&&t[t.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type=="change"||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,r)=>t!=e[r]))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:r}=this,i=this.selectionRange;if(r.state.facet(Mr)?r.root.activeElement!=this.dom:!ta(this.dom,i))return;let s=i.anchorNode&&r.docView.tile.nearest(i.anchorNode);if(s&&s.isWidget()&&s.widget.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(Z.ie&&Z.ie_version<=11||Z.android&&Z.chrome)&&!r.state.selection.main.empty&&i.focusNode&&ra(i.focusNode,i.focusOffset,i.anchorNode,i.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=Na(e.root);if(!t)return!1;let r=Z.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&cA(this.view,t)||t;if(!r||this.selectionRange.eq(r))return!1;let i=ta(this.dom,r);return i&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&LM(this.dom,r)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(r),i&&(this.selectionChanged=!0),!0)}setSelectionRange(e,t){this.selectionRange.set(e.node,e.offset,t.node,t.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,t=null;for(let r=this.dom;r;)if(yt(r))!t&&e<this.scrollTargets.length&&this.scrollTargets[e]==r?e++:t||(t=this.scrollTargets.slice(0,e)),t&&t.push(r),r=r.assignedSlot||r.parentNode;else if(r.nodeType==11)r=r.host;else break;if(e<this.scrollTargets.length&&!t&&(t=this.scrollTargets.slice(0,e)),t){for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);for(let r of this.scrollTargets=t)r.addEventListener("scroll",this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,aA),ch&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),ch&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,t){var r;if(!this.delayedAndroidKey){let i=()=>{let s=this.delayedAndroidKey;s&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=s.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&s.force&&Xs(this.dom,s.key,s.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(i)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange<Date.now()-50||!!(!((r=this.delayedAndroidKey)===null||r===void 0)&&r.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,r=-1,i=!1;for(let s of e){let o=this.readMutation(s);o&&(o.typeOver&&(i=!0),t==-1?{from:t,to:r}=o:(t=Math.min(o.from,t),r=Math.max(o.to,r)))}return{from:t,to:r,typeOver:i}}readChange(){let{from:e,to:t,typeOver:r}=this.processRecords(),i=this.selectionChanged&&ta(this.dom,this.selectionRange);if(e<0&&!i)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let s=new $3(this.view,e,t,r);return this.view.docView.domChanged={newSel:s.newSel?s.newSel.main:null},s}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.selectionChanged,r=this.readChange();if(!r)return this.view.requestMeasure(),!1;let i=this.view.state,s=YS(this.view,r);return this.view.state==i&&(r.domChanged||t)&&this.view.update([]),s}readMutation(e){let t=this.view.docView.tile.nearest(e.target);if(!t||t.isWidget())return null;if(t.markDirty(e.type=="attributes"),e.type=="childList"){let r=C0(t,e.previousSibling||e.target.previousSibling,-1),i=C0(t,e.nextSibling||e.target.nextSibling,1);return{from:r?t.posAfter(r):t.posAtStart,to:i?t.posBefore(i):t.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(Mr)!=e.state.facet(Mr)&&(e.view.contentDOM.editContext=e.state.facet(Mr)?this.editContext.editContext:null))}destroy(){var e,t,r;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(t=this.gapIntersection)===null||t===void 0||t.disconnect(),(r=this.resizeScroll)===null||r===void 0||r.disconnect();for(let i of this.scrollTargets)i.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}};function C0(n,e,t){for(;e;){let r=st.get(e);if(r&&r.parent==n)return r;let i=e.parentNode;e=i!=n.dom?i:t>0?e.nextSibling:e.previousSibling}return null}function P0(n,e){let t=e.startContainer,r=e.startOffset,i=e.endContainer,s=e.endOffset,o=n.docView.domAtPos(n.state.selection.main.anchor,1);return ra(o.node,o.offset,i,s)&&([t,r,i,s]=[i,s,t,r]),{anchorNode:t,anchorOffset:r,focusNode:i,focusOffset:s}}function cA(n,e){if(e.getComposedRanges){let i=e.getComposedRanges(n.root)[0];if(i)return P0(n,i)}let t=null;function r(i){i.preventDefault(),i.stopImmediatePropagation(),t=i.getTargetRanges()[0]}return n.contentDOM.addEventListener("beforeinput",r,!0),n.dom.ownerDocument.execCommand("indent"),n.contentDOM.removeEventListener("beforeinput",r,!0),t?P0(n,t):null}class uA{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let t=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=r=>{let i=e.state.selection.main,{anchor:s,head:o}=i,a=this.toEditorPos(r.updateRangeStart),l=this.toEditorPos(r.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:r.updateRangeStart,editorBase:a,drifted:!1});let c=l-a>r.text.length;a==this.from&&s<this.from?a=s:l==this.to&&s>this.to&&(l=s);let d=US(e.state.sliceDoc(a,l),r.text,(c?i.from:i.to)-a,c?"end":null);if(!d){let f=A.single(this.toEditorPos(r.selectionStart),this.toEditorPos(r.selectionEnd));Yf(f,i)||e.dispatch({selection:f,userEvent:"select"});return}let h={from:d.from+a,to:d.toA+a,insert:xe.of(r.text.slice(d.from,d.toB).split(`
|
|
53
|
+
`))};if((Z.mac||Z.android)&&h.from==o-1&&/^\. ?$/.test(r.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(h={from:a,to:l,insert:xe.of([r.text.replace("."," ")])}),this.pendingContextChange=h,!e.state.readOnly){let f=this.to-this.from+(h.to-h.from+h.insert.length);Am(e,h,A.single(this.toEditorPos(r.selectionStart,f),this.toEditorPos(r.selectionEnd,f)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),h.from<h.to&&!h.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(t.text.slice(Math.max(0,r.updateRangeStart-1),Math.min(t.text.length,r.updateRangeStart+1)))&&this.handlers.compositionend(r)},this.handlers.characterboundsupdate=r=>{let i=[],s=null;for(let o=this.toEditorPos(r.rangeStart),a=this.toEditorPos(r.rangeEnd);o<a;o++){let l=e.coordsForChar(o);s=l&&new DOMRect(l.left,l.top,l.right-l.left,l.bottom-l.top)||s||new DOMRect,i.push(s)}t.updateCharacterBounds(r.rangeStart,i)},this.handlers.textformatupdate=r=>{let i=[];for(let s of r.getTextFormats()){let o=s.underlineStyle,a=s.underlineThickness;if(!/none/i.test(o)&&!/none/i.test(a)){let l=this.toEditorPos(s.rangeStart),c=this.toEditorPos(s.rangeEnd);if(l<c){let d=`text-decoration: underline ${/^[a-z]/.test(o)?o+" ":o=="Dashed"?"dashed ":o=="Squiggle"?"wavy ":""}${/thin/i.test(a)?1:2}px`;i.push(G.mark({attributes:{style:d}}).range(l,c))}}}e.dispatch({effects:LS.of(G.set(i))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:r}=this.composing;this.composing=null,r&&this.reset(e.state)}};for(let r in this.handlers)t.addEventListener(r,this.handlers[r]);this.measureReq={read:r=>{let i=Na(r.root);i&&i.rangeCount&&this.editContext.updateSelectionBounds(i.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,r=!1,i=this.pendingContextChange;return e.changes.iterChanges((s,o,a,l,c)=>{if(r)return;let d=c.length-(o-s);if(i&&o>=i.to)if(i.from==s&&i.to==o&&i.insert.eq(c)){i=this.pendingContextChange=null,t+=d,this.to+=d;return}else i=null,this.revertPending(e.state);if(s+=t,o+=t,o<=this.from)this.from+=d,this.to+=d;else if(s<this.to){if(s<this.from||o>this.to||this.to-this.from+c.length>3e4){r=!0;return}this.editContext.updateText(this.toContextPos(s),this.toContextPos(o),c.toString()),this.to+=d}t+=d}),i&&!r&&this.revertPending(e.state),!r}update(e){let t=this.pendingContextChange,r=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(r.from,r.to)&&e.transactions.some(i=>!i.isUserEvent("input.type")&&i.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,r=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),i=this.toContextPos(t.head);(this.editContext.selectionStart!=r||this.editContext.selectionEnd!=i)&&this.editContext.updateSelection(r,i)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to<e.doc.length&&this.to-t<500||this.to-this.from>1e4*3)}toEditorPos(e,t=this.to-this.from){e=Math.min(e,t);let r=this.composing;return r&&r.drifted?r.editorBase+(e-r.contextBase):e+this.from}toContextPos(e){let t=this.composing;return t&&t.drifted?t.contextBase+(e-t.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}let X=class wc{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var t;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.clearAnnouncement=-1,this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:r}=e;this.dispatchTransactions=e.dispatchTransactions||r&&(i=>i.forEach(s=>r(s,this)))||(i=>this.update(i)),this.dispatch=this.dispatch.bind(this),this._root=e.root||XM(e.parent)||document,this.viewState=new w0(this,e.state||Ge.create(e)),e.scrollTo&&e.scrollTo.is(Nl)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Ms).map(i=>new rh(i));for(let i of this.plugins)i.update(this);this.observer=new lA(this),this.inputState=new M3(this),this.inputState.ensureHandlers(this.plugins),this.docView=new d0(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((t=document.fonts)===null||t===void 0)&&t.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent="refresh",this.requestMeasure()})}dispatch(...e){let t=e.length==1&&e[0]instanceof Wt?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t=!1,r=!1,i,s=this.state;for(let f of e){if(f.startState!=s)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");s=f.state}if(this.destroyed){this.viewState.state=s;return}let o=this.hasFocus,a=0,l=null;e.some(f=>f.annotation(tk))?(this.inputState.notifiedFocused=o,a=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,l=nk(s,o),l||(a=1));let c=this.observer.delayedAndroidKey,d=null;if(c?(this.observer.clearDelayedAndroidKey(),d=this.observer.readChange(),(d&&!this.state.doc.eq(s.doc)||!this.state.selection.eq(s.selection))&&(d=null)):this.observer.clear(),s.facet(Ge.phrases)!=this.state.facet(Ge.phrases))return this.setState(s);i=Gc.create(this,s,e),i.flags|=a;let h=this.viewState.scrollTarget;try{this.updateState=2;for(let f of e){if(h&&(h=h.map(f.changes)),f.scrollIntoView){let{main:p}=f.state.selection,{x:m,y:O}=this.state.facet(wc.cursorScrollMargin);h=new Ls(p.empty?p:A.cursor(p.head,p.head>p.anchor?-1:1),"nearest","nearest",O,m)}for(let p of f.effects)p.is(Nl)&&(h=p.value.clip(this.state))}this.viewState.update(i,h),this.bidiCache=eu.update(this.bidiCache,i.changes),i.empty||(this.updatePlugins(i),this.inputState.update(i)),t=this.docView.update(i),this.state.facet(Zo)!=this.styleModules&&this.mountStyles(),r=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(f=>f.isUserEvent("select.pointer")))}finally{this.updateState=0}if(i.startState.facet(_l)!=i.state.facet(_l)&&(this.viewState.mustMeasureContent=!0),(t||r||h||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),t&&this.docViewUpdate(),!i.empty)for(let f of this.state.facet(zf))try{f(i)}catch(p){Kt(this.state,p,"update listener")}(l||d)&&Promise.resolve().then(()=>{l&&this.state==l.startState&&this.dispatch(l),d&&!YS(this,d)&&c.force&&Xs(this.contentDOM,c.key,c.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let t=this.hasFocus;try{for(let r of this.plugins)r.destroy(this);this.viewState=new w0(this,e),this.plugins=e.facet(Ms).map(r=>new rh(r)),this.pluginMap.clear();for(let r of this.plugins)r.update(this);this.docView.destroy(),this.docView=new d0(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(Ms),r=e.state.facet(Ms);if(t!=r){let i=[];for(let s of r){let o=t.indexOf(s);if(o<0)i.push(new rh(s));else{let a=this.plugins[o];a.mustUpdate=e,i.push(a)}}for(let s of this.plugins)s.mustUpdate!=e&&s.destroy(this);this.plugins=i,this.pluginMap.clear()}else for(let i of this.plugins)i.mustUpdate=e;for(let i=0;i<this.plugins.length;i++)this.plugins[i].update(this);t!=r&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let t=e.value;if(t&&t.docViewUpdate)try{t.docViewUpdate(this)}catch(r){Kt(this.state,r,"doc view update listener")}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,r=this.viewState.scrollParent,i=this.viewState.getScrollOffset(),{scrollAnchorPos:s,scrollAnchorHeight:o,scaleY:a}=this.viewState;Math.abs(i-this.viewState.scrollOffset)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let l=0;;l++){if(o<0){if(kS(r||this.win))s=-1,o=this.viewState.heightMap.height/this.viewState.scaleY;else{let m=this.viewState.scrollAnchorAt(i);s=m.from,o=m.top}a=this.viewState.scaleY}this.updateState=1;let c=this.viewState.measure();if(!c&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(l>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let d=[];c&4||([this.measureRequests,d]=[d,this.measureRequests]);let h=d.map(m=>{try{return m.read(this)}catch(O){return Kt(this.state,O),T0}}),f=Gc.create(this,this.state,[]),p=!1;f.flags|=c,t?t.flags|=c:t=f,this.updateState=2,f.empty||(this.updatePlugins(f),this.inputState.update(f),this.updateAttrs(),p=this.docView.update(f),p&&this.docViewUpdate());for(let m=0;m<d.length;m++)if(h[m]!=T0)try{let O=d[m];O.write&&O.write(h[m],this)}catch(O){Kt(this.state,O)}if(p&&this.docView.updateSelection(!0),!f.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,o=-1;continue}else{let O=(s<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(s).top)/this.viewState.scaleY-o/a;if((O>1||O<-1)&&!(Z.ios&&this.inputState.lastIOSMomentumScroll>Date.now()-100)&&(r==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){i=i+O,r?s<0?r.scrollTop=r.scrollHeight:r.scrollTop+=O:this.win.scrollBy(0,O),o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let l of this.state.facet(zf))l(t)}get themeClasses(){return Hf+" "+(this.state.facet(Gf)?ok:sk)+" "+this.state.facet(_l)}updateAttrs(){let e=M0(this,_S,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(Mr)?"true":"false",class:"cm-content",style:`${Z.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),M0(this,Pm,t);let r=this.observer.ignore(()=>{let i=s0(this.contentDOM,this.contentAttrs,t),s=s0(this.dom,this.editorAttrs,e);return i||s});return this.editorAttrs=e,this.contentAttrs=t,r}showAnnouncements(e){let t=!0;for(let r of e)for(let i of r.effects)if(i.is(wc.announce)){t&&(this.announceDOM.textContent="",this.win.clearTimeout(this.clearAnnouncement),this.clearAnnouncement=this.win.setTimeout(()=>{this.announceDOM.textContent=" "},200),t=!1);let s=this.announceDOM.appendChild(document.createElement("div"));s.textContent=i.value}}mountStyles(){this.styleModules=this.state.facet(Zo);let e=this.state.facet(wc.cspNonce);bi.mount(this.root,this.styleModules.concat(oA).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let t=0;t<this.measureRequests.length;t++)if(this.measureRequests[t].key===e.key){this.measureRequests[t]=e;return}}this.measureRequests.push(e)}}plugin(e){let t=this.pluginMap.get(e);return(t===void 0||t&&t.plugin!=e)&&this.pluginMap.set(e,t=this.plugins.find(r=>r.plugin==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,r){return ah(this,e,h0(this,e,t,r))}moveByGroup(e,t){return ah(this,e,h0(this,e,t,r=>x3(this,e.head,r)))}visualLineSide(e,t){return t?A.cursor(e.to,1):A.cursor(e.from,-1)}moveToLineBoundary(e,t,r=!0){return y3(this,e,t,r)}moveVertically(e,t,r){return ah(this,e,S3(this,e,t,r))}domAtPos(e,t=1){return this.docView.domAtPos(e,t)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){this.readMeasured();let r=qf(this,e,t);return r&&r.pos}posAndSideAtCoords(e,t=!0){return this.readMeasured(),qf(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let r=this.state.doc.lineAt(e),i=this.bidiSpans(r),s=i[ar.find(i,e-r.from,-1,t)];return r.length&&(e==r.from&&t<0||e==r.to&&t>0)&&s.dir!=this.textDirectionAt(r.from)&&(e==r.to?(e=r.from+s.from,t=1):(e=r.from+s.to,t=-1)),this.docView.coordsAt(e,t,s.dir==Re.RTL)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(jS)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>dA)return PS(e.length);let t=this.textDirectionAt(e.from),r;for(let s of this.bidiCache)if(s.from==e.from&&s.dir==t&&(s.fresh||CS(s.isolates,r=l0(this,e))))return s.order;r||(r=l0(this,e));let i=FM(e.text,t,r);return this.bidiCache.push(new eu(e.from,e.to,t,r,!0,i)),i}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||Z.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{SS(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.win.clearTimeout(this.clearAnnouncement),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){var r,i,s,o;return Nl.of(new Ls(typeof e=="number"?A.cursor(e):e,(r=t.y)!==null&&r!==void 0?r:"nearest",(i=t.x)!==null&&i!==void 0?i:"nearest",(s=t.yMargin)!==null&&s!==void 0?s:5,(o=t.xMargin)!==null&&o!==void 0?o:5))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,r=this.viewState.scrollAnchorAt(e);return Nl.of(new Ls(A.cursor(r.from),"start","start",r.top-e,t,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return ot.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return ot.define(()=>({}),{eventObservers:e})}static theme(e,t){let r=bi.newName(),i=[_l.of(r),Zo.of(Kf(`.${r}`,e))];return t&&t.dark&&i.push(Gf.of(!0)),i}static baseTheme(e){return Qi.lowest(Zo.of(Kf("."+Hf,e,ak)))}static findFromDOM(e){var t;let r=e.querySelector(".cm-content"),i=r&&st.get(r)||st.get(e);return((t=i?.root)===null||t===void 0?void 0:t.view)||null}};X.styleModule=Zo;X.inputHandler=NS;X.clipboardInputFilter=$m;X.clipboardOutputFilter=Cm;X.scrollHandler=XS;X.focusChangeEffect=DS;X.perLineTextDirection=jS;X.exceptionSink=ES;X.updateListener=zf;X.editable=Mr;X.mouseSelectionStyle=RS;X.dragMovesSelection=AS;X.clickAddsSelectionRange=MS;X.decorations=ud;X.blockWrappers=BS;X.outerDecorations=Tm;X.atomicRanges=ll;X.bidiIsolatedRanges=ZS;X.cursorScrollMargin=W.define({combine:n=>{let e=5,t=5;for(let r of n)typeof r=="number"?e=t=r:{x:e,y:t}=r;return{x:e,y:t}}});X.scrollMargins=WS;X.darkTheme=Gf;X.cspNonce=W.define({combine:n=>n.length?n[0]:""});X.contentAttributes=Pm;X.editorAttributes=_S;X.lineWrapping=X.contentAttributes.of({class:"cm-lineWrapping"});X.announce=oe.define();const dA=4096,T0={};class eu{constructor(e,t,r,i,s,o){this.from=e,this.to=t,this.dir=r,this.isolates=i,this.fresh=s,this.order=o}static update(e,t){if(t.empty&&!e.some(s=>s.fresh))return e;let r=[],i=e.length?e[e.length-1].dir:Re.LTR;for(let s=Math.max(0,e.length-10);s<e.length;s++){let o=e[s];o.dir==i&&!t.touchesRange(o.from,o.to)&&r.push(new eu(t.mapPos(o.from,1),t.mapPos(o.to,-1),o.dir,o.isolates,!1,o.order))}return r}}function M0(n,e,t){for(let r=n.state.facet(e),i=r.length-1;i>=0;i--){let s=r[i],o=typeof s=="function"?s(n):s;o&&vm(o,t)}return t}const hA=Z.mac?"mac":Z.windows?"win":Z.linux?"linux":"key";function fA(n,e){const t=n.split(/-(?!$)/);let r=t[t.length-1];r=="Space"&&(r=" ");let i,s,o,a;for(let l=0;l<t.length-1;++l){const c=t[l];if(/^(cmd|meta|m)$/i.test(c))a=!0;else if(/^a(lt)?$/i.test(c))i=!0;else if(/^(c|ctrl|control)$/i.test(c))s=!0;else if(/^s(hift)?$/i.test(c))o=!0;else if(/^mod$/i.test(c))e=="mac"?a=!0:s=!0;else throw new Error("Unrecognized modifier name: "+c)}return i&&(r="Alt-"+r),s&&(r="Ctrl-"+r),a&&(r="Meta-"+r),o&&(r="Shift-"+r),r}function Bl(n,e,t){return e.altKey&&(n="Alt-"+n),e.ctrlKey&&(n="Ctrl-"+n),e.metaKey&&(n="Meta-"+n),t!==!1&&e.shiftKey&&(n="Shift-"+n),n}const pA=Qi.default(X.domEventHandlers({keydown(n,e){return ck(lk(e.state),n,e,"editor")}})),cl=W.define({enables:pA}),A0=new WeakMap;function lk(n){let e=n.facet(cl),t=A0.get(e);return t||A0.set(e,t=OA(e.reduce((r,i)=>r.concat(i),[]))),t}function mA(n,e,t){return ck(lk(n.state),e,n,t)}let ni=null;const gA=4e3;function OA(n,e=hA){let t=Object.create(null),r=Object.create(null),i=(o,a)=>{let l=r[o];if(l==null)r[o]=a;else if(l!=a)throw new Error("Key binding "+o+" is used both as a regular binding and as a multi-stroke prefix")},s=(o,a,l,c,d)=>{var h,f;let p=t[o]||(t[o]=Object.create(null)),m=a.split(/ (?!$)/).map(y=>fA(y,e));for(let y=1;y<m.length;y++){let k=m.slice(0,y).join(" ");i(k,!0),p[k]||(p[k]={preventDefault:!0,stopPropagation:!1,run:[x=>{let S=ni={view:x,prefix:k,scope:o};return setTimeout(()=>{ni==S&&(ni=null)},gA),!0}]})}let O=m.join(" ");i(O,!1);let b=p[O]||(p[O]={preventDefault:!1,stopPropagation:!1,run:((f=(h=p._any)===null||h===void 0?void 0:h.run)===null||f===void 0?void 0:f.slice())||[]});l&&b.run.push(l),c&&(b.preventDefault=!0),d&&(b.stopPropagation=!0)};for(let o of n){let a=o.scope?o.scope.split(" "):["editor"];if(o.any)for(let c of a){let d=t[c]||(t[c]=Object.create(null));d._any||(d._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:h}=o;for(let f in d)d[f].run.push(p=>h(p,Jf))}let l=o[e]||o.key;if(l)for(let c of a)s(c,l,o.run,o.preventDefault,o.stopPropagation),o.shift&&s(c,"Shift-"+l,o.shift,o.preventDefault,o.stopPropagation)}return t}let Jf=null;function ck(n,e,t,r){Jf=e;let i=fS(e),s=Yt(i,0),o=ir(s)==i.length&&i!=" ",a="",l=!1,c=!1,d=!1;ni&&ni.view==t&&ni.scope==r&&(a=ni.prefix+" ",HS.indexOf(e.keyCode)<0&&(c=!0,ni=null));let h=new Set,f=b=>{if(b){for(let y of b.run)if(!h.has(y)&&(h.add(y),y(t)))return b.stopPropagation&&(d=!0),!0;b.preventDefault&&(b.stopPropagation&&(d=!0),c=!0)}return!1},p=n[r],m,O;return p&&(f(p[a+Bl(i,e,!o)])?l=!0:o&&(e.altKey||e.metaKey||e.ctrlKey)&&!(Z.windows&&e.ctrlKey&&e.altKey)&&!(Z.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(m=Zr[e.keyCode])&&m!=i?(f(p[a+Bl(m,e,!0)])||e.shiftKey&&(O=Ra[e.keyCode])!=i&&O!=m&&f(p[a+Bl(O,e,!1)]))&&(l=!0):o&&e.shiftKey&&f(p[a+Bl(i,e,!0)])&&(l=!0),!l&&f(p._any)&&(l=!0)),c&&(l=!0),l&&d&&e.stopPropagation(),Jf=null,l}class Vi{constructor(e,t,r,i,s){this.className=e,this.left=t,this.top=r,this.width=i,this.height=s}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,t){return t.className!=this.className?!1:(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width!=null&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,t,r){if(r.empty){let i=e.coordsAtPos(r.head,r.assoc||1);if(!i)return[];let s=uk(e);return[new Vi(t,i.left-s.left,i.top-s.top,null,i.bottom-i.top)]}else return bA(e,t,r)}}function uk(n){let e=n.scrollDOM.getBoundingClientRect();return{left:(n.textDirection==Re.LTR?e.left:e.right-n.scrollDOM.clientWidth*n.scaleX)-n.scrollDOM.scrollLeft*n.scaleX,top:e.top-n.scrollDOM.scrollTop*n.scaleY}}function R0(n,e,t,r){let i=n.coordsAtPos(e,t*2);if(!i)return r;let s=n.dom.getBoundingClientRect(),o=(i.top+i.bottom)/2,a=n.posAtCoords({x:s.left+1,y:o}),l=n.posAtCoords({x:s.right-1,y:o});return a==null||l==null?r:{from:Math.max(r.from,Math.min(a,l)),to:Math.min(r.to,Math.max(a,l))}}function bA(n,e,t){if(t.to<=n.viewport.from||t.from>=n.viewport.to)return[];let r=Math.max(t.from,n.viewport.from),i=Math.min(t.to,n.viewport.to),s=n.textDirection==Re.LTR,o=n.contentDOM,a=o.getBoundingClientRect(),l=uk(n),c=o.querySelector(".cm-line"),d=c&&window.getComputedStyle(c),h=a.left+(d?parseInt(d.paddingLeft)+Math.min(0,parseInt(d.textIndent)):0),f=a.right-(d?parseInt(d.paddingRight):0),p=Ff(n,r,1),m=Ff(n,i,-1),O=p.type==Tt.Text?p:null,b=m.type==Tt.Text?m:null;if(O&&(n.lineWrapping||p.widgetLineBreaks)&&(O=R0(n,r,1,O)),b&&(n.lineWrapping||m.widgetLineBreaks)&&(b=R0(n,i,-1,b)),O&&b&&O.from==b.from&&O.to==b.to)return k(x(t.from,t.to,O));{let v=O?x(t.from,null,O):S(p,!1),w=b?x(null,t.to,b):S(m,!0),Q=[];return(O||p).to<(b||m).from-(O&&b?1:0)||p.widgetLineBreaks>1&&v.bottom+n.defaultLineHeight/2<w.top?Q.push(y(h,v.bottom,f,w.top)):v.bottom<w.top&&n.elementAtHeight((v.bottom+w.top)/2).type==Tt.Text&&(v.bottom=w.top=(v.bottom+w.top)/2),k(v).concat(Q).concat(k(w))}function y(v,w,Q,P){return new Vi(e,v-l.left,w-l.top,Math.max(0,Q-v),P-w)}function k({top:v,bottom:w,horizontal:Q}){let P=[];for(let T=0;T<Q.length;T+=2)P.push(y(Q[T],v,Q[T+1],w));return P}function x(v,w,Q){let P=1e9,T=-1e9,C=[];function R(N,I,L,te,le){let _=n.coordsAtPos(N,N==Q.to?-2:2),re=n.coordsAtPos(L,L==Q.from?2:-2);!_||!re||(P=Math.min(_.top,re.top,P),T=Math.max(_.bottom,re.bottom,T),le==Re.LTR?C.push(s&&I?h:_.left,s&&te?f:re.right):C.push(!s&&te?h:re.left,!s&&I?f:_.right))}let M=v??Q.from,j=w??Q.to;for(let N of n.visibleRanges)if(N.to>M&&N.from<j)for(let I=Math.max(N.from,M),L=Math.min(N.to,j);;){let te=n.state.doc.lineAt(I);for(let le of n.bidiSpans(te)){let _=le.from+te.from,re=le.to+te.from;if(_>=L)break;re>I&&R(Math.max(_,I),v==null&&_<=M,Math.min(re,L),w==null&&re>=j,le.dir)}if(I=te.to+1,I>=L)break}return C.length==0&&R(M,v==null,j,w==null,n.textDirection),{top:P,bottom:T,horizontal:C}}function S(v,w){let Q=a.top+(w?v.top:v.bottom);return{top:Q,bottom:Q,horizontal:[]}}}function yA(n,e){return n.constructor==e.constructor&&n.eq(e)}class xA{constructor(e,t){this.view=e,this.layer=t,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),t.above&&this.dom.classList.add("cm-layer-above"),t.class&&this.dom.classList.add(t.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),t.mount&&t.mount(this.dom,e)}update(e){e.startState.facet(Qc)!=e.state.facet(Qc)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){this.layer.updateOnDocViewUpdate!==!1&&e.requestMeasure(this.measureReq)}setOrder(e){let t=0,r=e.facet(Qc);for(;t<r.length&&r[t]!=this.layer;)t++;this.dom.style.zIndex=String((this.layer.above?150:-1)-t)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:e,scaleY:t}=this.view;(e!=this.scaleX||t!=this.scaleY)&&(this.scaleX=e,this.scaleY=t,this.dom.style.transform=`scale(${1/e}, ${1/t})`)}draw(e){if(e.length!=this.drawn.length||e.some((t,r)=>!yA(t,this.drawn[r]))){let t=this.dom.firstChild,r=0;for(let i of e)i.update&&t&&i.constructor&&this.drawn[r].constructor&&i.update(t,this.drawn[r])?(t=t.nextSibling,r++):this.dom.insertBefore(i.draw(),t);for(;t;){let i=t.nextSibling;t.remove(),t=i}this.drawn=e,Z.webkit&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const Qc=W.define();function dk(n){return[ot.define(e=>new xA(e,n)),Qc.of(n)]}const ep=!Z.ios,Js=W.define({combine(n){return br(n,{cursorBlinkRate:1200,drawRangeCursor:!0,iosSelectionHandles:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})}});function SA(n={}){return[Js.of(n),kA,vA,QA,IS.of(!0)]}function hk(n){return n.startState.facet(Js)!=n.state.facet(Js)}const kA=dk({above:!0,markers(n){let{state:e}=n,t=e.facet(Js),r=[];for(let i of e.selection.ranges){let s=i==e.selection.main;if(i.empty||t.drawRangeCursor&&!(s&&Z.ios&&t.iosSelectionHandles)){let o=s?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",a=i.empty?i:A.cursor(i.head,i.assoc);for(let l of Vi.forRange(n,o,a))r.push(l)}}return r},update(n,e){n.transactions.some(r=>r.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let t=hk(n);return t&&E0(n.state,e),n.docChanged||n.selectionSet||t},mount(n,e){E0(e.state,n)},class:"cm-cursorLayer"});function E0(n,e){e.style.animationDuration=n.facet(Js).cursorBlinkRate+"ms"}const vA=dk({above:!1,markers(n){let e=[],{main:t,ranges:r}=n.state.selection;for(let i of r)if(!i.empty&&(ep||i!=t))for(let s of Vi.forRange(n,"cm-selectionBackground",i))e.push(s);if(Z.ios&&!t.empty&&n.state.facet(Js).iosSelectionHandles){for(let i of Vi.forRange(n,"cm-selectionHandle cm-selectionHandle-start",A.cursor(t.from,1)))e.push(i);for(let i of Vi.forRange(n,"cm-selectionHandle cm-selectionHandle-end",A.cursor(t.to,1)))e.push(i)}return e},update(n,e){return n.docChanged||n.selectionSet||n.viewportChanged||hk(n)},class:"cm-selectionLayer"}),wA=Z.gecko&&Z.gecko_version==153?"#ffffff01":"transparent",QA=Qi.highest(X.theme({".cm-line":{...ep?{"& ::selection, &::selection":{backgroundColor:`${wA} !important`}}:{},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important",...ep?{"&::selection, & ::selection":{backgroundColor:"Highlight !important"}}:{}}}})),fk=oe.define({map(n,e){return n==null?null:e.mapPos(n)}}),zo=Mt.define({create(){return null},update(n,e){return n!=null&&(n=e.changes.mapPos(n)),e.effects.reduce((t,r)=>r.is(fk)?r.value:t,n)}}),$A=ot.fromClass(class{constructor(n){this.view=n,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(n){var e;let t=n.state.field(zo);t==null?this.cursor!=null&&((e=this.cursor)===null||e===void 0||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(n.startState.field(zo)!=t||n.docChanged||n.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:n}=this,e=n.state.field(zo),t=e!=null&&n.coordsAtPos(e);if(!t)return null;let r=n.scrollDOM.getBoundingClientRect();return{left:t.left-r.left+n.scrollDOM.scrollLeft*n.scaleX,top:t.top-r.top+n.scrollDOM.scrollTop*n.scaleY,height:t.bottom-t.top}}drawCursor(n){if(this.cursor){let{scaleX:e,scaleY:t}=this.view;n?(this.cursor.style.left=n.left/e+"px",this.cursor.style.top=n.top/t+"px",this.cursor.style.height=n.height/t+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(n){this.view.state.field(zo)!=n&&this.view.dispatch({effects:fk.of(n)})}},{eventObservers:{dragover(n){this.setDropPos(this.view.posAtCoords({x:n.clientX,y:n.clientY}))},dragleave(n){(n.target==this.view.contentDOM||!this.view.contentDOM.contains(n.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function CA(){return[zo,$A]}function N0(n,e,t,r,i){e.lastIndex=0;for(let s=n.iterRange(t,r),o=t,a;!s.next().done;o+=s.value.length)if(!s.lineBreak)for(;a=e.exec(s.value);)i(o+a.index,a)}function PA(n,e){let t=n.visibleRanges;if(t.length==1&&t[0].from==n.viewport.from&&t[0].to==n.viewport.to)return t;let r=[];for(let{from:i,to:s}of t)i=Math.max(n.state.doc.lineAt(i).from,i-e),s=Math.min(n.state.doc.lineAt(s).to,s+e),r.length&&r[r.length-1].to>=i?r[r.length-1].to=s:r.push({from:i,to:s});return r}class TA{constructor(e){const{regexp:t,decoration:r,decorate:i,boundary:s,maxLength:o=1e3}=e;if(!t.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=t,i)this.addMatch=(a,l,c,d)=>i(d,c,c+a[0].length,a,l);else if(typeof r=="function")this.addMatch=(a,l,c,d)=>{let h=r(a,l,c);h&&d(c,c+a[0].length,h)};else if(r)this.addMatch=(a,l,c,d)=>d(c,c+a[0].length,r);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=s,this.maxLength=o}createDeco(e){let t=new Br,r=t.add.bind(t);for(let{from:i,to:s}of PA(e,this.maxLength))N0(e.state.doc,this.regexp,i,s,(o,a)=>this.addMatch(a,e,o,r));return t.finish()}updateDeco(e,t){let r=1e9,i=-1;return e.docChanged&&e.changes.iterChanges((s,o,a,l)=>{l>=e.view.viewport.from&&a<=e.view.viewport.to&&(r=Math.min(a,r),i=Math.max(l,i))}),e.viewportMoved||i-r>1e3?this.createDeco(e.view):i>-1?this.updateRange(e.view,t.map(e.changes),r,i):t}updateRange(e,t,r,i){for(let s of e.visibleRanges){let o=Math.max(s.from,r),a=Math.min(s.to,i);if(a>=o){let l=e.state.doc.lineAt(o),c=l.to<a?e.state.doc.lineAt(a):l,d=Math.max(s.from,l.from),h=Math.min(s.to,c.to);if(this.boundary){for(;o>l.from;o--)if(this.boundary.test(l.text[o-1-l.from])){d=o;break}for(;a<c.to;a++)if(this.boundary.test(c.text[a-c.from])){h=a;break}}let f=[],p,m=(O,b,y)=>f.push(y.range(O,b));if(l==c)for(this.regexp.lastIndex=d-l.from;(p=this.regexp.exec(l.text))&&p.index<h-l.from;)this.addMatch(p,e,p.index+l.from,m);else N0(e.state.doc,this.regexp,d,h,(O,b)=>this.addMatch(b,e,O,m));t=t.update({filterFrom:d,filterTo:h,filter:(O,b)=>O<d||b>h,add:f})}}return t}}const tp=/x/.unicode!=null?"gu":"g",MA=new RegExp(`[\0-\b
|
|
54
|
+
--\u2028\u2029\uFEFF-]`,tp),AA={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let uh=null;function RA(){var n;if(uh==null&&typeof document<"u"&&document.body){let e=document.body.style;uh=((n=e.tabSize)!==null&&n!==void 0?n:e.MozTabSize)!=null}return uh||!1}const $c=W.define({combine(n){let e=br(n,{render:null,specialChars:MA,addSpecialChars:null});return(e.replaceTabs=!RA())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,tp)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,tp)),e}});function EA(n={}){return[$c.of(n),NA()]}let D0=null;function NA(){return D0||(D0=ot.fromClass(class{constructor(n){this.view=n,this.decorations=G.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(n.state.facet($c)),this.decorations=this.decorator.createDeco(n)}makeDecorator(n){return new TA({regexp:n.specialChars,decoration:(e,t,r)=>{let{doc:i}=t.state,s=Yt(e[0],0);if(s==9){let o=i.lineAt(r),a=t.state.tabSize,l=po(o.text,a,r-o.from);return G.replace({widget:new XA((a-l%a)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[s]||(this.decorationCache[s]=G.replace({widget:new IA(n,s)}))},boundary:n.replaceTabs?void 0:/[^]/})}update(n){let e=n.state.facet($c);n.startState.facet($c)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(n.view)):this.decorations=this.decorator.updateDeco(n,this.decorations)}},{decorations:n=>n.decorations}))}const DA="•";function jA(n){return n>=32?DA:n==10?"":String.fromCharCode(9216+n)}class IA extends zn{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=jA(this.code),r=e.state.phrase("Control character")+" "+(AA[this.code]||"0x"+this.code.toString(16)),i=this.options.render&&this.options.render(this.code,r,t);if(i)return i;let s=document.createElement("span");return s.textContent=t,s.title=r,s.setAttribute("aria-label",r),s.className="cm-specialChar",s}ignoreEvent(){return!1}}class XA extends zn{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}function LA(){return BA}const _A=G.line({class:"cm-activeLine"}),BA=ot.fromClass(class{constructor(n){this.decorations=this.getDeco(n)}update(n){(n.docChanged||n.selectionSet)&&(this.decorations=this.getDeco(n.view))}getDeco(n){let e=-1,t=[];for(let r of n.state.selection.ranges){let i=n.lineBlockAt(r.head);i.from>e&&(t.push(_A.range(i.from)),e=i.from)}return G.set(t)}},{decorations:n=>n.decorations});let ZA=class extends zn{constructor(e){super(),this.content=e}toDOM(e){let t=document.createElement("span");return t.className="cm-placeholder",t.style.pointerEvents="none",t.appendChild(typeof this.content=="string"?document.createTextNode(this.content):typeof this.content=="function"?this.content(e):this.content.cloneNode(!0)),t.setAttribute("aria-hidden","true"),t}coordsAt(e){let t=e.firstChild?na(e.firstChild):[];if(!t.length)return null;let r=window.getComputedStyle(e.parentNode),i=Da(t[0],r.direction!="rtl"),s=parseInt(r.lineHeight);return i.bottom-i.top>s*1.5?{left:i.left,right:i.right,top:i.top,bottom:i.top+s}:i}ignoreEvent(){return!1}};function WA(n){let e=ot.fromClass(class{constructor(t){this.view=t,this.placeholder=n?G.set([G.widget({widget:new ZA(n),side:1}).range(0)]):G.none}get decorations(){return this.view.state.doc.length?G.none:this.placeholder}},{decorations:t=>t.decorations});return typeof n=="string"?[e,X.contentAttributes.of({"aria-placeholder":n})]:e}const np=2e3;function zA(n,e,t){let r=Math.min(e.line,t.line),i=Math.max(e.line,t.line),s=[];if(e.off>np||t.off>np||e.col<0||t.col<0){let o=Math.min(e.off,t.off),a=Math.max(e.off,t.off);for(let l=r;l<=i;l++){let c=n.doc.line(l);c.length<=a&&s.push(A.range(c.from+o,c.to+a))}}else{let o=Math.min(e.col,t.col),a=Math.max(e.col,t.col);for(let l=r;l<=i;l++){let c=n.doc.line(l),d=Ef(c.text,o,n.tabSize,!0);if(d<0)s.push(A.cursor(c.to));else{let h=Ef(c.text,a,n.tabSize);s.push(A.range(c.from+d,c.from+h))}}}return s}function VA(n,e){let t=n.coordsAtPos(n.viewport.from);return t?Math.round(Math.abs((t.left-e)/n.defaultCharacterWidth)):-1}function j0(n,e){let t=n.posAtCoords({x:e.clientX,y:e.clientY},!1),r=n.state.doc.lineAt(t),i=t-r.from,s=i>np?-1:i==r.length?VA(n,e.clientX):po(r.text,n.state.tabSize,t-r.from);return{line:r.number,col:s,off:i}}function FA(n,e){let t=j0(n,e),r=n.state.selection;return t?{update(i){if(i.docChanged){let s=i.changes.mapPos(i.startState.doc.line(t.line).from),o=i.state.doc.lineAt(s);t={line:o.number,col:t.col,off:Math.min(t.off,o.length)},r=r.map(i.changes)}},get(i,s,o){let a=j0(n,i);if(!a)return r;let l=zA(n.state,t,a);return l.length?o?A.create(l.concat(r.ranges)):A.create(l):r}}:null}function qA(n){let e=(t=>t.altKey&&t.button==0);return X.mouseSelectionStyle.of((t,r)=>e(r)?FA(t,r):null)}const YA={Alt:[18,n=>!!n.altKey],Control:[17,n=>!!n.ctrlKey],Shift:[16,n=>!!n.shiftKey],Meta:[91,n=>!!n.metaKey]},UA={style:"cursor: crosshair"};function GA(n={}){let[e,t]=YA[n.key||"Alt"],r=ot.fromClass(class{constructor(i){this.view=i,this.isDown=!1}set(i){this.isDown!=i&&(this.isDown=i,this.view.update([]))}},{eventObservers:{keydown(i){this.set(i.keyCode==e||t(i))},keyup(i){(i.keyCode==e||!t(i))&&this.set(!1)},mousemove(i){this.set(t(i))}}});return[r,X.contentAttributes.of(i=>{var s;return!((s=i.plugin(r))===null||s===void 0)&&s.isDown?UA:null})]}const Zl="-10000px";class pk{constructor(e,t,r,i){this.facet=t,this.createTooltipView=r,this.removeTooltipView=i,this.input=e.state.facet(t),this.tooltips=this.input.filter(o=>o);let s=null;this.tooltipViews=this.tooltips.map(o=>s=r(o,s))}update(e,t){var r;let i=e.state.facet(this.facet),s=i.filter(l=>l);if(i===this.input){for(let l of this.tooltipViews)l.update&&l.update(e);return!1}let o=[],a=t?[]:null;for(let l=0;l<s.length;l++){let c=s[l],d=-1;if(c){for(let h=0;h<this.tooltips.length;h++){let f=this.tooltips[h];f&&f.create==c.create&&(d=h)}if(d<0)o[l]=this.createTooltipView(c,l?o[l-1]:null),a&&(a[l]=!!c.above);else{let h=o[l]=this.tooltipViews[d];a&&(a[l]=t[d]),h.update&&h.update(e)}}}for(let l of this.tooltipViews)o.indexOf(l)<0&&(this.removeTooltipView(l),(r=l.destroy)===null||r===void 0||r.call(l));return t&&(a.forEach((l,c)=>t[c]=l),t.length=a.length),this.input=i,this.tooltips=s,this.tooltipViews=o,!0}}function mk(n){let e=n.dom.ownerDocument.documentElement,t=e.clientWidth,r=getComputedStyle(e);if(!/stable/.test(r.scrollbarGutter||""))return{left:0,right:t};let i=e.getBoundingClientRect(),s=n.win.scrollX;return{left:Math.max(0,i.left+s-parseFloat(r.marginLeft)),right:Math.min(t,i.right+s+parseFloat(r.marginRight))}}function HA(n){let{left:e,right:t}=mk(n);return{top:0,left:e,right:t,bottom:n.dom.ownerDocument.documentElement.clientHeight}}const dh=W.define({combine:n=>{var e,t,r;return{position:Z.ios?"absolute":((e=n.find(i=>i.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((t=n.find(i=>i.parent))===null||t===void 0?void 0:t.parent)||null,tooltipSpace:((r=n.find(i=>i.tooltipSpace))===null||r===void 0?void 0:r.tooltipSpace)||HA}}}),I0=new WeakMap,Nm=ot.fromClass(class{constructor(n){this.view=n,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=n.state.facet(dh);this.position=e.position,this.parent=e.parent,this.classes=n.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new pk(n,Dm,(t,r)=>this.createTooltip(t,r),t=>{this.resizeObserver&&this.resizeObserver.unobserve(t.dom),t.dom.remove()}),this.above=this.manager.tooltips.map(t=>!!t.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(t=>{Date.now()>this.lastTransaction-50&&t.length>0&&t[t.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),n.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let n of this.manager.tooltipViews)this.intersectionObserver.observe(n.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(n){n.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(n,this.above);e&&this.observeIntersection();let t=e||n.geometryChanged,r=n.state.facet(dh);if(r.position!=this.position&&!this.madeAbsolute){this.position=r.position;for(let i of this.manager.tooltipViews)i.dom.style.position=this.position;t=!0}if(r.parent!=this.parent){this.parent&&this.container.remove(),this.parent=r.parent,this.createContainer();for(let i of this.manager.tooltipViews)this.container.appendChild(i.dom);t=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);t&&this.maybeMeasure()}createTooltip(n,e){let t=n.create(this.view),r=e?e.dom:null;if(t.dom.classList.add("cm-tooltip"),n.arrow&&!t.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let i=document.createElement("div");i.className="cm-tooltip-arrow",t.dom.appendChild(i)}return t.dom.style.position=this.position,t.dom.style.top=Zl,t.dom.style.left="0px",this.container.insertBefore(t.dom,r),t.mount&&t.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(t.dom),t}destroy(){var n,e,t;this.view.win.removeEventListener("resize",this.measureSoon);for(let r of this.manager.tooltipViews)r.dom.remove(),(n=r.destroy)===null||n===void 0||n.call(r);this.parent&&this.container.remove(),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),(t=this.intersectionObserver)===null||t===void 0||t.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let n=1,e=1,t=!1,r=0;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:o}=this.manager.tooltipViews[0];if(Z.safari){let a=o.getBoundingClientRect();t=Math.abs(a.top+1e4)>1||Math.abs(a.left)>1}else t=!!o.offsetParent&&o.offsetParent!=this.container.ownerDocument.body}if(t||this.position=="absolute")if(this.parent){let o=this.parent.getBoundingClientRect();o.width&&o.height&&(n=o.width/this.parent.offsetWidth,e=o.height/this.parent.offsetHeight)}else({scaleX:n,scaleY:e}=this.view.viewState);else r=mk(this.view).left;let i=this.view.scrollDOM.getBoundingClientRect(),s=Mm(this.view);return{visible:{left:i.left+s.left,top:i.top+s.top,right:i.right-s.right,bottom:i.bottom-s.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((o,a)=>{let l=this.manager.tooltipViews[a];return l.getCoords?l.getCoords(o.pos):this.view.coordsAtPos(o.pos)}),size:this.manager.tooltipViews.map(({dom:o})=>o.getBoundingClientRect()),space:this.view.state.facet(dh).tooltipSpace(this.view),scaleX:n,scaleY:e,makeAbsolute:t,fixedLeft:r}}writeMeasure(n){var e;if(n.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let a of this.manager.tooltipViews)a.dom.style.position="absolute"}let{visible:t,space:r,scaleX:i,scaleY:s}=n,o=[];for(let a=0;a<this.manager.tooltips.length;a++){let l=this.manager.tooltips[a],c=this.manager.tooltipViews[a],{dom:d}=c,h=n.pos[a],f=n.size[a];if(!h||l.clip!==!1&&(h.bottom<=Math.max(t.top,r.top)||h.top>=Math.min(t.bottom,r.bottom)||h.right<Math.max(t.left,r.left)-.1||h.left>Math.min(t.right,r.right)+.1)){d.style.top=Zl;continue}let p=l.arrow?c.dom.querySelector(".cm-tooltip-arrow"):null,m=p?7:0,O=f.right-f.left,b=(e=I0.get(c))!==null&&e!==void 0?e:f.bottom-f.top,y=c.offset||JA,k=this.view.textDirection==Re.LTR,x=f.width>r.right-r.left?k?r.left:r.right-f.width:k?Math.max(r.left,Math.min(h.left-(p?14:0)+y.x,r.right-O)):Math.min(Math.max(r.left,h.left-O+(p?14:0)-y.x),r.right-O),S=this.above[a];!l.strictSide&&(S?h.top-b-m-y.y<r.top:h.bottom+b+m+y.y>r.bottom)&&S==r.bottom-h.bottom>h.top-r.top&&(S=this.above[a]=!S);let v=(S?h.top-r.top:r.bottom-h.bottom)-m;if(v<b&&c.resize!==!1){if(v<this.view.defaultLineHeight){d.style.top=Zl;continue}I0.set(c,b),d.style.height=(b=v)/s+"px"}else d.style.height&&(d.style.height="");let w=S?h.top-b-m-y.y:h.bottom+m+y.y,Q=x+O;if(c.overlap!==!0)for(let P of o)P.left<Q&&P.right>x&&P.top<w+b&&P.bottom>w&&(w=S?P.top-b-2-m:P.bottom+m+2);if(this.position=="absolute"?(d.style.top=(w-n.parent.top)/s+"px",X0(d,(x-n.parent.left)/i)):(d.style.top=w/s+"px",X0(d,(x-n.fixedLeft)/i)),p){let P=h.left+(k?y.x:-y.x)-(x+14-7);p.style.left=P/i+"px"}c.overlap!==!0&&o.push({left:x,top:w,right:Q,bottom:w+b}),d.classList.toggle("cm-tooltip-above",S),d.classList.toggle("cm-tooltip-below",!S),c.positioned&&c.positioned(n.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let n of this.manager.tooltipViews)n.dom.style.top=Zl}},{eventObservers:{scroll(){this.maybeMeasure()}}});function X0(n,e){let t=parseInt(n.style.left,10);(isNaN(t)||Math.abs(e-t)>1)&&(n.style.left=e+"px")}const KA=X.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:"14px",position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),JA={x:0,y:0},Dm=W.define({enables:[Nm,KA]}),tu=W.define({combine:n=>n.reduce((e,t)=>e.concat(t),[])});class pd{static create(e){return new pd(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new pk(e,tu,(t,r)=>this.createHostedView(t,r),t=>t.dom.remove())}createHostedView(e,t){let r=e.create(this.view);return r.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(r.dom,t?t.dom.nextSibling:this.dom.firstChild),this.mounted&&r.mount&&r.mount(this.view),r}mount(e){for(let t of this.manager.tooltipViews)t.mount&&t.mount(e);this.mounted=!0}positioned(e){for(let t of this.manager.tooltipViews)t.positioned&&t.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let t of this.manager.tooltipViews)(e=t.destroy)===null||e===void 0||e.call(t)}passProp(e){let t;for(let r of this.manager.tooltipViews){let i=r[e];if(i!==void 0){if(t===void 0)t=i;else if(t!==i)return}}return t}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const eR=Dm.compute([tu],n=>{let e=n.facet(tu);return e.length===0?null:{pos:Math.min(...e.map(t=>t.pos)),end:Math.max(...e.map(t=>{var r;return(r=t.end)!==null&&r!==void 0?r:t.pos})),create:pd.create,above:e[0].above,arrow:e.some(t=>t.arrow)}}),gk=W.define();class tR{constructor(e,t,r,i,s,o){this.view=e,this.source=t,this.field=r,this.locked=i,this.setHover=s,this.hoverTime=o,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(e){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let e=Date.now()-this.lastMove.time;e<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-e):this.startHover()}startHover(){clearTimeout(this.restartTimeout);let{view:e,lastMove:t}=this,r=e.docView.tile.nearest(t.target);if(!r)return;let i,s=1;if(r.isWidget())i=r.posAtStart;else{if(i=e.posAtCoords(t),i==null)return;let o=e.coordsAtPos(i);if(!o||t.y<o.top||t.y>o.bottom||t.x<o.left-e.defaultCharacterWidth||t.x>o.right+e.defaultCharacterWidth)return;let a=e.bidiSpans(e.state.doc.lineAt(i)).find(c=>c.from<=i&&c.to>=i),l=a&&a.dir==Re.RTL?-1:1;s=t.x<o.left?-l:l}this.activateHover(e,i,s)}activateHover(e,t,r,i){let s=this.source(e,t,r),o=a=>{if(a&&!(Array.isArray(a)&&!a.length)){let l=Array.isArray(a)?a:[a];i&&this.locked.set(l,i),e.dispatch({effects:this.setHover.of(l)})}};if(s&&"then"in s){let a=this.pending={pos:t};s.then(l=>{this.pending==a&&(this.pending=null,o(l))},l=>Kt(e.state,l,"hover tooltip"))}else o(s)}get tooltip(){let e=this.view.plugin(Nm),t=e?e.manager.tooltips.findIndex(r=>r.create==pd.create):-1;return t>-1?e.manager.tooltipViews[t]:null}mousemove(e){var t,r;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:i,tooltip:s}=this;if(i.length&&!this.locked.has(i)&&s&&!nR(s.dom,e)||this.pending){let{pos:o}=i[0]||this.pending,a=(r=(t=i[0])===null||t===void 0?void 0:t.end)!==null&&r!==void 0?r:o;(o==a?this.view.posAtCoords(this.lastMove)!=o:!rR(this.view,o,a,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:t}=this;if(t.length&&!this.locked.has(t)){let{tooltip:r}=this;r&&r.dom.contains(e.relatedTarget)?this.watchTooltipLeave(r.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let t=r=>{e.removeEventListener("mouseleave",t);let{active:i}=this;i.length&&!this.locked.has(i)&&!this.view.dom.contains(r.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener("mouseleave",t)}destroy(){clearTimeout(this.hoverTimeout),clearTimeout(this.restartTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const Wl=4;function nR(n,e){let{left:t,right:r,top:i,bottom:s}=n.getBoundingClientRect(),o;if(o=n.querySelector(".cm-tooltip-arrow")){let a=o.getBoundingClientRect();i=Math.min(a.top,i),s=Math.max(a.bottom,s)}return e.clientX>=t-Wl&&e.clientX<=r+Wl&&e.clientY>=i-Wl&&e.clientY<=s+Wl}function rR(n,e,t,r,i,s){let o=n.scrollDOM.getBoundingClientRect(),a=n.documentTop+n.documentPadding.top+n.contentHeight;if(o.left>r||o.right<r||o.top>i||Math.min(o.bottom,a)<i)return!1;let l=n.posAtCoords({x:r,y:i},!1);return l>=e&&l<=t}function iR(n,e={}){let t=oe.define(),r=new WeakMap,i=Mt.define({create(){return[]},update(o,a){let l=r.get(o);if(o.length&&(e.hideOnChange&&(a.docChanged||a.selection)?o=[]:l&&l(a)?o=[]:e.hideOn&&(o=o.filter(c=>!e.hideOn(a,c)))),a.docChanged&&o.length){let c=[];for(let d of o){let h=a.changes.mapPos(d.pos,-1,Ct.TrackDel);if(h!=null){let f=Object.assign(Object.create(null),d);f.pos=h,f.end!=null&&(f.end=a.changes.mapPos(f.end)),c.push(f)}}o=c}for(let c of a.effects)c.is(t)&&(o=c.value,l=void 0),(c.is(oR)&&!c.value||c.value==i)&&(o=[]);return o.length&&l&&r.set(o,l),o},provide:o=>tu.from(o)});const s=ot.define(o=>new tR(o,n,i,r,t,e.hoverTime||300));return{active:i,extension:[i,s,gk.of(s),eR]}}function sR(n,e,t,r={}){var i;let s=n.state.facet(gk).map(o=>n.plugin(o)).filter(o=>!!o);if(r.tooltip&&r.tooltip.active){let o=s.find(a=>a.field==r.tooltip.active);o&&(s=[o])}for(let o of s)o.activateHover(n,e,t,(i=r.until)!==null&&i!==void 0?i:(()=>!1))}function Ok(n,e){let t=n.plugin(Nm);if(!t)return null;let r=t.manager.tooltips.indexOf(e);return r<0?null:t.manager.tooltipViews[r]}const oR=oe.define(),L0=W.define({combine(n){let e,t;for(let r of n)e=e||r.topContainer,t=t||r.bottomContainer;return{topContainer:e,bottomContainer:t}}});function md(n,e){let t=n.plugin(bk),r=t?t.specs.indexOf(e):-1;return r>-1?t.panels[r]:null}const bk=ot.fromClass(class{constructor(n){this.input=n.state.facet(Ia),this.specs=this.input.filter(t=>t),this.panels=this.specs.map(t=>t(n));let e=n.state.facet(L0);this.top=new zl(n,!0,e.topContainer),this.bottom=new zl(n,!1,e.bottomContainer),this.top.sync(this.panels.filter(t=>t.top)),this.bottom.sync(this.panels.filter(t=>!t.top));for(let t of this.panels)t.dom.classList.add("cm-panel"),t.mount&&t.mount()}update(n){let e=n.state.facet(L0);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new zl(n.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new zl(n.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let t=n.state.facet(Ia);if(t!=this.input){let r=t.filter(l=>l),i=[],s=[],o=[],a=[];for(let l of r){let c=this.specs.indexOf(l),d;c<0?(d=l(n.view),a.push(d)):(d=this.panels[c],d.update&&d.update(n)),i.push(d),(d.top?s:o).push(d)}this.specs=r,this.panels=i,this.top.sync(s),this.bottom.sync(o);for(let l of a)l.dom.classList.add("cm-panel"),l.mount&&l.mount()}else for(let r of this.panels)r.update&&r.update(n)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:n=>X.scrollMargins.of(e=>{let t=e.plugin(n);return t&&{top:t.top.scrollMargin(),bottom:t.bottom.scrollMargin()}})});class zl{constructor(e,t,r){this.view=e,this.top=t,this.container=r,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom";let t=this.container||this.view.dom;t.insertBefore(this.dom,this.top?t.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=_0(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=_0(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function _0(n){let e=n.nextSibling;return n.remove(),e}const Ia=W.define({enables:bk});function aR(n,e){let t,r=new Promise(o=>t=o),i=o=>cR(o,e,t);n.state.field(Cc,!1)?n.dispatch({effects:yk.of(i)}):n.dispatch({effects:oe.appendConfig.of(Cc.init(()=>[i]))});let s=xk.of(i);return{close:s,result:r.then(o=>((n.win.queueMicrotask||(l=>n.win.setTimeout(l,10)))(()=>{n.state.field(Cc).indexOf(i)>-1&&n.dispatch({effects:s})}),o))}}function lR(n,e){let t=n.state.field(Cc,!1)||[];for(let r of t){let i=md(n,r);if(i&&i.dom.classList.contains(e))return i}return null}const Cc=Mt.define({create(){return[]},update(n,e){for(let t of e.effects)t.is(yk)?n=[t.value].concat(n):t.is(xk)&&(n=n.filter(r=>r!=t.value));return n},provide:n=>Ia.computeN([n],e=>e.field(n))}),yk=oe.define(),xk=oe.define();function cR(n,e,t){let r=e.content?e.content(n,()=>o(null)):null;if(!r){if(r=Ce("form"),e.input){let a=Ce("input",e.input);/^(text|password|number|email|tel|url)$/.test(a.type)&&a.classList.add("cm-textfield"),a.name||(a.name="input"),r.appendChild(Ce("label",(e.label||"")+": ",a))}else r.appendChild(document.createTextNode(e.label||""));r.appendChild(document.createTextNode(" ")),r.appendChild(Ce("button",{class:"cm-button",type:"submit"},e.submitLabel||"OK"))}let i=r.nodeName=="FORM"?[r]:r.querySelectorAll("form");for(let a=0;a<i.length;a++){let l=i[a];l.addEventListener("keydown",c=>{c.keyCode==27?(c.preventDefault(),o(null)):c.keyCode==13&&(c.preventDefault(),o(l))}),l.addEventListener("submit",c=>{c.preventDefault(),o(l)})}let s=Ce("div",r,Ce("button",{onclick:()=>o(null),"aria-label":n.state.phrase("close"),class:"cm-dialog-close",type:"button"},["×"]));e.class&&(s.className=e.class),s.classList.add("cm-dialog");function o(a){s.contains(s.ownerDocument.activeElement)&&n.focus(),t(a)}return{dom:s,top:e.top,mount:()=>{if(e.focus){let a;typeof e.focus=="string"?a=r.querySelector(e.focus):a=r.querySelector("input")||r.querySelector("button"),a&&"select"in a?a.select():a&&"focus"in a&&a.focus()}}}}class zr extends Oi{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}zr.prototype.elementClass="";zr.prototype.toDOM=void 0;zr.prototype.mapMode=Ct.TrackBefore;zr.prototype.startSide=zr.prototype.endSide=-1;zr.prototype.point=!0;const Pc=W.define(),uR=W.define(),dR={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>me.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},sa=W.define();function hR(n){return[Sk(),sa.of({...dR,...n})]}const B0=W.define({combine:n=>n.some(e=>e)});function Sk(n){return[fR]}const fR=ot.fromClass(class{constructor(n){this.view=n,this.domAfter=null,this.prevViewport=n.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=n.state.facet(sa).map(e=>new W0(n,e)),this.fixed=!n.state.facet(B0);for(let e of this.gutters)e.config.side=="after"?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),n.scrollDOM.insertBefore(this.dom,n.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(n){if(this.updateGutters(n)){let e=this.prevViewport,t=n.view.viewport,r=Math.min(e.to,t.to)-Math.max(e.from,t.from);this.syncGutters(r<(t.to-t.from)*.8)}if(n.geometryChanged){let e=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=e,this.domAfter&&(this.domAfter.style.minHeight=e)}this.view.state.facet(B0)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=n.view.viewport}syncGutters(n){let e=this.dom.nextSibling;n&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let t=me.iter(this.view.state.facet(Pc),this.view.viewport.from),r=[],i=this.gutters.map(s=>new pR(s,this.view.viewport,-this.view.documentPadding.top));for(let s of this.view.viewportLineBlocks)if(r.length&&(r=[]),Array.isArray(s.type)){let o=!0;for(let a of s.type)if(a.type==Tt.Text&&o){rp(t,r,a.from);for(let l of i)l.line(this.view,a,r);o=!1}else if(a.widget)for(let l of i)l.widget(this.view,a)}else if(s.type==Tt.Text){rp(t,r,s.from);for(let o of i)o.line(this.view,s,r)}else if(s.widget)for(let o of i)o.widget(this.view,s);for(let s of i)s.finish();n&&(this.view.scrollDOM.insertBefore(this.dom,e),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(n){let e=n.startState.facet(sa),t=n.state.facet(sa),r=n.docChanged||n.heightChanged||n.viewportChanged||!me.eq(n.startState.facet(Pc),n.state.facet(Pc),n.view.viewport.from,n.view.viewport.to);if(e==t)for(let i of this.gutters)i.update(n)&&(r=!0);else{r=!0;let i=[];for(let s of t){let o=e.indexOf(s);o<0?i.push(new W0(this.view,s)):(this.gutters[o].update(n),i.push(this.gutters[o]))}for(let s of this.gutters)s.dom.remove(),i.indexOf(s)<0&&s.destroy();for(let s of i)s.config.side=="after"?this.getDOMAfter().appendChild(s.dom):this.dom.appendChild(s.dom);this.gutters=i}return r}destroy(){for(let n of this.gutters)n.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:n=>X.scrollMargins.of(e=>{let t=e.plugin(n);if(!t||t.gutters.length==0||!t.fixed)return null;let r=t.dom.offsetWidth*e.scaleX,i=t.domAfter?t.domAfter.offsetWidth*e.scaleX:0;return e.textDirection==Re.LTR?{left:r,right:i}:{right:r,left:i}})});function Z0(n){return Array.isArray(n)?n:[n]}function rp(n,e,t){for(;n.value&&n.from<=t;)n.from==t&&e.push(n.value),n.next()}class pR{constructor(e,t,r){this.gutter=e,this.height=r,this.i=0,this.cursor=me.iter(e.markers,t.from)}addElement(e,t,r){let{gutter:i}=this,s=(t.top-this.height)/e.scaleY,o=t.height/e.scaleY;if(this.i==i.elements.length){let a=new kk(e,o,s,r);i.elements.push(a),i.dom.appendChild(a.dom)}else i.elements[this.i].update(e,o,s,r);this.height=t.bottom,this.i++}line(e,t,r){let i=[];rp(this.cursor,i,t.from),r.length&&(i=i.concat(r));let s=this.gutter.config.lineMarker(e,t,i);s&&i.unshift(s);let o=this.gutter;i.length==0&&!o.config.renderEmptyElements||this.addElement(e,t,i)}widget(e,t){let r=this.gutter.config.widgetMarker(e,t.widget,t),i=r?[r]:null;for(let s of e.state.facet(uR)){let o=s(e,t.widget,t);o&&(i||(i=[])).push(o)}i&&this.addElement(e,t,i)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}}class W0{constructor(e,t){this.view=e,this.config=t,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let r in t.domEventHandlers)this.dom.addEventListener(r,i=>{let s=i.target,o;if(s!=this.dom&&this.dom.contains(s)){for(;s.parentNode!=this.dom;)s=s.parentNode;let l=s.getBoundingClientRect();o=(l.top+l.bottom)/2}else o=i.clientY;let a=e.lineBlockAtHeight(o-e.documentTop);t.domEventHandlers[r](e,a,i)&&i.preventDefault()});this.markers=Z0(t.markers(e)),t.initialSpacer&&(this.spacer=new kk(e,0,0,[t.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let t=this.markers;if(this.markers=Z0(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let i=this.config.updateSpacer(this.spacer.markers[0],e);i!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[i])}let r=e.view.viewport;return!me.eq(this.markers,t,r.from,r.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class kk{constructor(e,t,r,i){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,t,r,i)}update(e,t,r,i){this.height!=t&&(this.height=t,this.dom.style.height=t+"px"),this.above!=r&&(this.dom.style.marginTop=(this.above=r)?r+"px":""),mR(this.markers,i)||this.setMarkers(e,i)}setMarkers(e,t){let r="cm-gutterElement",i=this.dom.firstChild;for(let s=0,o=0;;){let a=o,l=s<t.length?t[s++]:null,c=!1;if(l){let d=l.elementClass;d&&(r+=" "+d);for(let h=o;h<this.markers.length;h++)if(this.markers[h].compare(l)){a=h,c=!0;break}}else a=this.markers.length;for(;o<a;){let d=this.markers[o++];if(d.toDOM){d.destroy(i);let h=i.nextSibling;i.remove(),i=h}}if(!l)break;l.toDOM&&(c?i=i.nextSibling:this.dom.insertBefore(l.toDOM(e),i)),c&&o++}this.dom.className=r,this.markers=t}destroy(){this.setMarkers(null,[])}}function mR(n,e){if(n.length!=e.length)return!1;for(let t=0;t<n.length;t++)if(!n[t].compare(e[t]))return!1;return!0}const gR=W.define(),OR=W.define(),As=W.define({combine(n){return br(n,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,t){let r=Object.assign({},e);for(let i in t){let s=r[i],o=t[i];r[i]=s?(a,l,c)=>s(a,l,c)||o(a,l,c):o}return r}})}});class hh extends zr{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function fh(n,e){return n.state.facet(As).formatNumber(e,n.state)}const bR=sa.compute([As],n=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(gR)},lineMarker(e,t,r){return r.some(i=>i.toDOM)?null:new hh(fh(e,e.state.doc.lineAt(t.from).number))},widgetMarker:(e,t,r)=>{for(let i of e.state.facet(OR)){let s=i(e,t,r);if(s)return s}return null},lineMarkerChange:e=>e.startState.facet(As)!=e.state.facet(As),initialSpacer(e){return new hh(fh(e,z0(e.state.doc.lines)))},updateSpacer(e,t){let r=fh(t.view,z0(t.view.state.doc.lines));return r==e.number?e:new hh(r)},domEventHandlers:n.facet(As).domEventHandlers,side:"before"}));function yR(n={}){return[As.of(n),Sk(),bR]}function z0(n){let e=9;for(;e<n;)e=e*10+9;return e}const xR=new class extends zr{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},SR=Pc.compute(["selection"],n=>{let e=[],t=-1;for(let r of n.selection.ranges){let i=n.doc.lineAt(r.head).from;i>t&&(t=i,e.push(xR.range(i)))}return me.of(e)});function kR(){return SR}var ph;const Rs=new he;function vk(n){return W.define({combine:n?e=>e.concat(n):void 0})}const jm=new he;class _n{constructor(e,t,r=[],i=""){this.data=e,this.name=i,Ge.prototype.hasOwnProperty("tree")||Object.defineProperty(Ge.prototype,"tree",{get(){return Je(this)}}),this.parser=t,this.extension=[xi.of(this),Ge.languageData.of((s,o,a)=>{let l=V0(s,o,a),c=l.type.prop(Rs);if(!c)return[];let d=s.facet(c),h=l.type.prop(jm);if(h){let f=l.resolve(o-l.from,a);for(let p of h)if(p.test(f,s)){let m=s.facet(p.facet);return p.type=="replace"?m:m.concat(d)}}return d})].concat(r)}isActiveAt(e,t,r=-1){return V0(e,t,r).type.prop(Rs)==this.data}findRegions(e){let t=e.facet(xi);if(t?.data==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let r=[],i=(s,o)=>{if(s.prop(Rs)==this.data){r.push({from:o,to:o+s.length});return}let a=s.prop(he.mounted);if(a){if(a.tree.prop(Rs)==this.data){if(a.overlay)for(let l of a.overlay)r.push({from:l.from+o,to:l.to+o});else r.push({from:o,to:o+s.length});return}else if(a.overlay){let l=r.length;if(i(a.tree,a.overlay[0].from+o),r.length>l)return}}for(let l=0;l<s.children.length;l++){let c=s.children[l];c instanceof He&&i(c,s.positions[l]+o)}};return i(Je(e),0),r}get allowsNesting(){return!0}}_n.setState=oe.define();function V0(n,e,t){let r=n.facet(xi),i=Je(n).topNode;if(!r||r.allowsNesting)for(let s=i;s;s=s.enter(e,t,be.ExcludeBuffers|be.EnterBracketed))s.type.isTop&&(i=s);return i}class ns extends _n{constructor(e,t,r){super(e,t,[],r),this.parser=t}static define(e){let t=vk(e.languageData);return new ns(t,e.parser.configure({props:[Rs.add(r=>r.isTop?t:void 0)]}),e.name)}configure(e,t){return new ns(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function Je(n){let e=n.field(_n.state,!1);return e?e.tree:He.empty}class vR{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let r=this.cursorPos-this.string.length;return e<r||t>=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-r,t-r)}}let Co=null,wR=class ip{constructor(e,t,r=[],i,s,o,a,l){this.parser=e,this.state=t,this.fragments=r,this.tree=i,this.treeLen=s,this.viewport=o,this.skipped=a,this.scheduleOn=l,this.parse=null,this.tempSkipped=[]}static create(e,t,r){return new ip(e,t,[],He.empty,0,r,[],null)}startParse(){return this.parser.startParse(new vR(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=He.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var r;if(typeof e=="number"){let i=Date.now()+e;e=()=>Date.now()>i}for(this.parse||(this.parse=this.startParse()),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t<this.state.doc.length&&this.parse.stopAt(t);;){let i=this.parse.advance();if(i)if(this.fragments=this.withoutTempSkipped(Ir.addTree(i,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(r=this.parse.stoppedAt)!==null&&r!==void 0?r:this.state.doc.length,this.tree=i,this.parse=null,this.treeLen<(t??this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,t;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(Ir.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=Co;Co=this;try{return e()}finally{Co=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=F0(e,t.from,t.to);return e}changes(e,t){let{fragments:r,tree:i,treeLen:s,viewport:o,skipped:a}=this;if(this.takeTree(),!e.empty){let l=[];if(e.iterChangedRanges((c,d,h,f)=>l.push({fromA:c,toA:d,fromB:h,toB:f})),r=Ir.applyChanges(r,l),i=He.empty,s=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length){a=[];for(let c of this.skipped){let d=e.mapPos(c.from,1),h=e.mapPos(c.to,-1);d<h&&a.push({from:d,to:h})}}}return new ip(this.parser,t,r,i,s,o,a,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let t=this.skipped.length;for(let r=0;r<this.skipped.length;r++){let{from:i,to:s}=this.skipped[r];i<e.to&&s>e.from&&(this.fragments=F0(this.fragments,i,s),this.skipped.splice(r--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends Lx{createParse(t,r,i){let s=i[0].from,o=i[i.length-1].to;return{parsedPos:s,advance(){let l=Co;if(l){for(let c of i)l.tempSkipped.push(c);e&&(l.scheduleOn=l.scheduleOn?Promise.all([l.scheduleOn,e]):e)}return this.parsedPos=o,new He(gn.none,[],[],o-s)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return Co}};function F0(n,e,t){return Ir.applyChanges(n,[{fromA:e,toA:t,fromB:e,toB:t}])}class eo{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),r=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,r)||t.takeTree(),new eo(t)}static init(e){let t=Math.min(3e3,e.doc.length),r=wR.create(e.facet(xi).parser,e,{from:0,to:t});return r.work(20,t)||r.takeTree(),new eo(r)}}_n.state=Mt.define({create:eo.init,update(n,e){for(let t of e.effects)if(t.is(_n.setState))return t.value;return e.startState.facet(xi)!=e.state.facet(xi)?eo.init(e.state):n.apply(e)}});let wk=n=>{let e=setTimeout(()=>n(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(wk=n=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(n,{timeout:400})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});const mh=typeof navigator<"u"&&(!((ph=navigator.scheduling)===null||ph===void 0)&&ph.isInputPending)?()=>navigator.scheduling.isInputPending():null,QR=ot.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(_n.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(_n.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=wk(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnd<t&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=t+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:r,viewport:{to:i}}=this.view,s=r.field(_n.state);if(s.tree==s.context.tree&&s.context.isDone(i+1e5))return;let o=Date.now()+Math.min(this.chunkBudget,100,e&&!mh?Math.max(25,e.timeRemaining()-5):1e9),a=s.context.treeLen<i&&r.doc.length>i+1e3,l=s.context.work(()=>mh&&mh()||Date.now()>o,i+(a?0:1e5));this.chunkBudget-=Date.now()-t,(l||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:_n.setState.of(new eo(s.context))})),this.chunkBudget>0&&!(l&&!a)&&this.scheduleWork(),this.checkAsyncSchedule(s.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(t=>Kt(this.view.state,t)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),xi=W.define({combine(n){return n.length?n[0]:null},enables:n=>[_n.state,QR,X.contentAttributes.compute([n],e=>{let t=e.facet(n);return t&&t.name?{"data-language":t.name}:{}})]});class gd{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}const $R=W.define(),ul=W.define({combine:n=>{if(!n.length)return" ";let e=n[0];if(!e||/\S/.test(e)||Array.from(e).some(t=>t!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(n[0]));return e}});function nu(n){let e=n.facet(ul);return e.charCodeAt(0)==9?n.tabSize*e.length:e.length}function Xa(n,e){let t="",r=n.tabSize,i=n.facet(ul)[0];if(i==" "){for(;e>=r;)t+=" ",e-=r;i=" "}for(let s=0;s<e;s++)t+=i;return t}function Im(n,e){n instanceof Ge&&(n=new Od(n));for(let r of n.state.facet($R)){let i=r(n,e);if(i!==void 0)return i}let t=Je(n.state);return t.length>=e?CR(n,t,e):null}class Od{constructor(e,t={}){this.state=e,this.options=t,this.unit=nu(e)}lineAt(e,t=1){let r=this.state.doc.lineAt(e),{simulateBreak:i,simulateDoubleBreak:s}=this.options;return i!=null&&i>=r.from&&i<=r.to?s&&i==e?{text:"",from:e}:(t<0?i<e:i<=e)?{text:r.text.slice(i-r.from),from:i}:{text:r.text.slice(0,i-r.from),from:r.from}:r}textAfterPos(e,t=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:r,from:i}=this.lineAt(e,t);return r.slice(e-i,Math.min(r.length,e+100-i))}column(e,t=1){let{text:r,from:i}=this.lineAt(e,t),s=this.countColumn(r,e-i),o=this.options.overrideIndentation?this.options.overrideIndentation(i):-1;return o>-1&&(s+=o-this.countColumn(r,r.search(/\S|$/))),s}countColumn(e,t=e.length){return po(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:r,from:i}=this.lineAt(e,t),s=this.options.overrideIndentation;if(s){let o=s(i);if(o>-1)return o}return this.countColumn(r,r.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const dl=new he;function CR(n,e,t){let r=e.resolveStack(t),i=e.resolveInner(t,-1).resolve(t,0).enterUnfinishedNodesBefore(t);if(i!=r.node){let s=[];for(let o=i;o&&!(o.from<r.node.from||o.to>r.node.to||o.from==r.node.from&&o.type==r.node.type);o=o.parent)s.push(o);for(let o=s.length-1;o>=0;o--)r={node:s[o],next:r}}return Qk(r,n,t)}function Qk(n,e,t){for(let r=n;r;r=r.next){let i=TR(r.node);if(i)return i(Xm.create(e,t,r))}return 0}function PR(n){return n.pos==n.options.simulateBreak&&n.options.simulateDoubleBreak}function TR(n){let e=n.type.prop(dl);if(e)return e;let t=n.firstChild,r;if(t&&(r=t.type.prop(he.closedBy))){let i=n.lastChild,s=i&&r.indexOf(i.name)>-1;return o=>Ck(o,!0,1,void 0,s&&!PR(o)?i.from:void 0)}return n.parent==null?MR:null}function MR(){return 0}class Xm extends Od{constructor(e,t,r){super(e.state,e.options),this.base=e,this.pos=t,this.context=r}get node(){return this.context.node}static create(e,t,r){return new Xm(e,t,r)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let r=e.resolve(t.from);for(;r.parent&&r.parent.from==r.from;)r=r.parent;if(AR(r,e))break;t=this.state.doc.lineAt(r.from)}return this.lineIndent(t.from)}continue(){return Qk(this.context.next,this.base,this.pos)}}function AR(n,e){for(let t=e;t;t=t.parent)if(n==t)return!0;return!1}function RR(n){let e=n.node,t=e.childAfter(e.from),r=e.lastChild;if(!t)return null;let i=n.options.simulateBreak,s=n.state.doc.lineAt(t.from),o=i==null||i<=s.from?s.to:Math.min(s.to,i);for(let a=t.to;;){let l=e.childAfter(a);if(!l||l==r)return null;if(!l.type.isSkipped){if(l.from>=o)return null;let c=/^ */.exec(s.text.slice(t.to-s.from))[0].length;return{from:t.from,to:t.to+c}}a=l.to}}function $k({closing:n,align:e=!0,units:t=1}){return r=>Ck(r,e,t,n)}function Ck(n,e,t,r,i){let s=n.textAfter,o=s.match(/^\s*/)[0].length,a=r&&s.slice(o,o+r.length)==r||i==n.pos+o,l=e?RR(n):null;return l?a?n.column(l.from):n.column(l.to):n.baseIndent+(a?0:n.unit*t)}const Pk=n=>n.baseIndent;function _s({except:n,units:e=1}={}){return t=>{let r=n&&n.test(t.textAfter);return t.baseIndent+(r?0:e*t.unit)}}const ER=200;function NR(){return Ge.transactionFilter.of(n=>{if(!n.docChanged||!n.isUserEvent("input.type")&&!n.isUserEvent("input.complete"))return n;let e=n.startState.languageDataAt("indentOnInput",n.startState.selection.main.head);if(!e.length)return n;let t=n.newDoc,{head:r}=n.newSelection.main,i=t.lineAt(r);if(r>i.from+ER)return n;let s=t.sliceString(i.from,r);if(!e.some(c=>c.test(s)))return n;let{state:o}=n,a=-1,l=[];for(let{head:c}of o.selection.ranges){let d=o.doc.lineAt(c);if(d.from==a)continue;a=d.from;let h=Im(o,d.from);if(h==null)continue;let f=/^\s*/.exec(d.text)[0],p=Xa(o,h);f!=p&&l.push({from:d.from,to:d.from+f.length,insert:p})}return l.length?[n,{changes:l,sequential:!0}]:n})}const DR=W.define(),hl=new he;function Lm(n){let e=n.firstChild,t=n.lastChild;return e&&e.to<t.from?{from:e.to,to:t.type.isError?n.to:t.from}:null}function jR(n,e,t){let r=Je(n);if(r.length<t)return null;let i=r.resolveStack(t,1),s=null;for(let o=i;o;o=o.next){let a=o.node;if(a.to<=t||a.from>t)continue;if(s&&a.from<e)break;let l=a.type.prop(hl);if(l&&(a.to<r.length-50||r.length==n.doc.length||!IR(a))){let c=l(a,n);c&&c.from<=t&&c.from>=e&&c.to>t&&(s=c)}}return s}function IR(n){let e=n.lastChild;return e&&e.to==n.to&&e.type.isError}function ru(n,e,t){for(let r of n.facet(DR)){let i=r(n,e,t);if(i)return i}return jR(n,e,t)}function Tk(n,e){let t=e.mapPos(n.from,1),r=e.mapPos(n.to,-1);return t>=r?void 0:{from:t,to:r}}const bd=oe.define({map:Tk}),fl=oe.define({map:Tk});function Mk(n){let e=[];for(let{head:t}of n.state.selection.ranges)e.some(r=>r.from<=t&&r.to>=t)||e.push(n.lineBlockAt(t));return e}const rs=Mt.define({create(){return G.none},update(n,e){e.isUserEvent("delete")&&e.changes.iterChangedRanges((r,i)=>n=q0(n,r,i)),n=n.map(e.changes);let t=[];for(let r of e.effects)r.is(bd)&&!XR(n,r.value.from,r.value.to)?t.push(r.value):r.is(fl)&&(n=n.update({filter:(i,s)=>r.value.from!=i||r.value.to!=s,filterFrom:r.value.from,filterTo:r.value.to}));if(t.length){let{preparePlaceholder:r}=e.state.facet(Ek),i=t.map(s=>(r?G.replace({widget:new VR(r(e.state,s))}):Y0).range(s.from,s.to));n=n.update({add:i})}return e.selection&&(n=q0(n,e.selection.main.head)),n},provide:n=>X.decorations.from(n),toJSON(n,e){let t=[];return n.between(0,e.doc.length,(r,i)=>{t.push(r,i)}),t},fromJSON(n){if(!Array.isArray(n)||n.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let t=0;t<n.length;){let r=n[t++],i=n[t++];if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid JSON for fold state");e.push(Y0.range(r,i))}return G.set(e,!0)}});function q0(n,e,t=e){let r=!1;return n.between(e,t,(i,s)=>{i<t&&s>e&&(r=!0)}),r?n.update({filterFrom:e,filterTo:t,filter:(i,s)=>i>=t||s<=e}):n}function iu(n,e,t){var r;let i=null;return(r=n.field(rs,!1))===null||r===void 0||r.between(e,t,(s,o)=>{(!i||i.from>s)&&(i={from:s,to:o})}),i}function XR(n,e,t){let r=!1;return n.between(e,e,(i,s)=>{i==e&&s==t&&(r=!0)}),r}function Ak(n,e){return n.field(rs,!1)?e:e.concat(oe.appendConfig.of(Nk()))}const LR=n=>{for(let e of Mk(n)){let t=ru(n.state,e.from,e.to);if(t)return n.dispatch({effects:Ak(n.state,[bd.of(t),Rk(n,t)])}),!0}return!1},_R=n=>{if(!n.state.field(rs,!1))return!1;let e=[];for(let t of Mk(n)){let r=iu(n.state,t.from,t.to);r&&e.push(fl.of(r),Rk(n,r,!1))}return e.length&&n.dispatch({effects:e}),e.length>0};function Rk(n,e,t=!0){let r=n.state.doc.lineAt(e.from).number,i=n.state.doc.lineAt(e.to).number;return X.announce.of(`${n.state.phrase(t?"Folded lines":"Unfolded lines")} ${r} ${n.state.phrase("to")} ${i}.`)}const BR=n=>{let{state:e}=n,t=[];for(let r=0;r<e.doc.length;){let i=n.lineBlockAt(r),s=ru(e,i.from,i.to);s&&t.push(bd.of(s)),r=(s?n.lineBlockAt(s.to):i).to+1}return t.length&&n.dispatch({effects:Ak(n.state,t)}),!!t.length},ZR=n=>{let e=n.state.field(rs,!1);if(!e||!e.size)return!1;let t=[];return e.between(0,n.state.doc.length,(r,i)=>{t.push(fl.of({from:r,to:i}))}),n.dispatch({effects:t}),!0},WR=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:LR},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:_R},{key:"Ctrl-Alt-[",run:BR},{key:"Ctrl-Alt-]",run:ZR}],zR={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},Ek=W.define({combine(n){return br(n,zR)}});function Nk(n){return[rs,YR]}function Dk(n,e){let{state:t}=n,r=t.facet(Ek),i=o=>{let a=n.lineBlockAt(n.posAtDOM(o.target)),l=iu(n.state,a.from,a.to);l&&n.dispatch({effects:fl.of(l)}),o.preventDefault()};if(r.placeholderDOM)return r.placeholderDOM(n,i,e);let s=document.createElement("span");return s.textContent=r.placeholderText,s.setAttribute("aria-label",t.phrase("folded code")),s.title=t.phrase("unfold"),s.className="cm-foldPlaceholder",s.onclick=i,s}const Y0=G.replace({widget:new class extends zn{toDOM(n){return Dk(n,null)}}});class VR extends zn{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return Dk(e,this.value)}}const FR={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class gh extends zr{constructor(e,t){super(),this.config=e,this.open=t}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let t=document.createElement("span");return t.textContent=this.open?this.config.openText:this.config.closedText,t.title=e.state.phrase(this.open?"Fold line":"Unfold line"),t}}function qR(n={}){let e={...FR,...n},t=new gh(e,!0),r=new gh(e,!1),i=ot.fromClass(class{constructor(o){this.from=o.viewport.from,this.markers=this.buildMarkers(o)}update(o){(o.docChanged||o.viewportChanged||o.startState.facet(xi)!=o.state.facet(xi)||o.startState.field(rs,!1)!=o.state.field(rs,!1)||Je(o.startState)!=Je(o.state)||e.foldingChanged(o))&&(this.markers=this.buildMarkers(o.view))}buildMarkers(o){let a=new Br;for(let l of o.viewportLineBlocks){let c=iu(o.state,l.from,l.to)?r:ru(o.state,l.from,l.to)?t:null;c&&a.add(l.from,l.from,c)}return a.finish()}}),{domEventHandlers:s}=e;return[i,hR({class:"cm-foldGutter",markers(o){var a;return((a=o.plugin(i))===null||a===void 0?void 0:a.markers)||me.empty},initialSpacer(){return new gh(e,!1)},domEventHandlers:{...s,click:(o,a,l)=>{if(s.click&&s.click(o,a,l))return!0;let c=iu(o.state,a.from,a.to);if(c)return o.dispatch({effects:fl.of(c)}),!0;let d=ru(o.state,a.from,a.to);return d?(o.dispatch({effects:bd.of(d)}),!0):!1}}}),Nk()]}const YR=X.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class mo{constructor(e,t){this.specs=e;let r;function i(a){let l=bi.newName();return(r||(r=Object.create(null)))["."+l]=a,l}const s=typeof t.all=="string"?t.all:t.all?i(t.all):void 0,o=t.scope;this.scope=o instanceof _n?a=>a.prop(Rs)==o.data:o?a=>a==o:void 0,this.style=Zx(e.map(a=>({tag:a.tag,class:a.class||i(Object.assign({},a,{tag:null}))})),{all:s}).style,this.module=r?new bi(r):null,this.themeType=t.themeType}static define(e,t){return new mo(e,t||{})}}const sp=W.define(),jk=W.define({combine(n){return n.length?[n[0]]:null}});function Oh(n){let e=n.facet(sp);return e.length?e:n.facet(jk)}function _m(n,e){let t=[GR],r;return n instanceof mo&&(n.module&&t.push(X.styleModule.of(n.module)),r=n.themeType),e?.fallback?t.push(jk.of(n)):r?t.push(sp.computeN([X.darkTheme],i=>i.facet(X.darkTheme)==(r=="dark")?[n]:[])):t.push(sp.of(n)),t}class UR{constructor(e){this.markCache=Object.create(null),this.tree=Je(e.state),this.decorations=this.buildDeco(e,Oh(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=Je(e.state),r=Oh(e.state),i=r!=Oh(e.startState),{viewport:s}=e.view,o=e.changes.mapPos(this.decoratedTo,1);t.length<s.to&&!i&&t.type==this.tree.type&&o>=s.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=o):(t!=this.tree||e.viewportChanged||i)&&(this.tree=t,this.decorations=this.buildDeco(e.view,r),this.decoratedTo=s.to)}buildDeco(e,t){if(!t||!this.tree.length)return G.none;let r=new Br;for(let{from:i,to:s}of e.visibleRanges)E5(this.tree,t,(o,a,l)=>{r.add(o,a,this.markCache[l]||(this.markCache[l]=G.mark({class:l})))},i,s);return r.finish()}}const GR=Qi.high(ot.fromClass(UR,{decorations:n=>n.decorations})),HR=mo.define([{tag:u.meta,color:"#404740"},{tag:u.link,textDecoration:"underline"},{tag:u.heading,textDecoration:"underline",fontWeight:"bold"},{tag:u.emphasis,fontStyle:"italic"},{tag:u.strong,fontWeight:"bold"},{tag:u.strikethrough,textDecoration:"line-through"},{tag:u.keyword,color:"#708"},{tag:[u.atom,u.bool,u.url,u.contentSeparator,u.labelName],color:"#219"},{tag:[u.literal,u.inserted],color:"#164"},{tag:[u.string,u.deleted],color:"#a11"},{tag:[u.regexp,u.escape,u.special(u.string)],color:"#e40"},{tag:u.definition(u.variableName),color:"#00f"},{tag:u.local(u.variableName),color:"#30a"},{tag:[u.typeName,u.namespace],color:"#085"},{tag:u.className,color:"#167"},{tag:[u.special(u.variableName),u.macroName],color:"#256"},{tag:u.definition(u.propertyName),color:"#00c"},{tag:u.comment,color:"#940"},{tag:u.invalid,color:"#f00"}]),KR=X.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),Ik=1e4,Xk="()[]{}",Lk=W.define({combine(n){return br(n,{afterCursor:!0,brackets:Xk,maxScanDistance:Ik,renderMatch:tE})}}),JR=G.mark({class:"cm-matchingBracket"}),eE=G.mark({class:"cm-nonmatchingBracket"});function tE(n){let e=[],t=n.matched?JR:eE;return e.push(t.range(n.start.from,n.start.to)),n.end&&e.push(t.range(n.end.from,n.end.to)),e}function U0(n){let e=[],t=n.facet(Lk);for(let r of n.selection.ranges){if(!r.empty)continue;let i=lr(n,r.head,-1,t)||r.head>0&&lr(n,r.head-1,1,t)||t.afterCursor&&(lr(n,r.head,1,t)||r.head<n.doc.length&&lr(n,r.head+1,-1,t));i&&(e=e.concat(t.renderMatch(i,n)))}return G.set(e,!0)}const nE=ot.fromClass(class{constructor(n){this.paused=!1,this.decorations=U0(n.state)}update(n){(n.docChanged||n.selectionSet||this.paused)&&(n.view.composing?(this.decorations=this.decorations.map(n.changes),this.paused=!0):(this.decorations=U0(n.state),this.paused=!1))}},{decorations:n=>n.decorations}),rE=[nE,KR];function iE(n={}){return[Lk.of(n),rE]}const _k=new he;function op(n,e,t){let r=n.prop(e<0?he.openedBy:he.closedBy);if(r)return r;if(n.name.length==1){let i=t.indexOf(n.name);if(i>-1&&i%2==(e<0?1:0))return[t[i+e]]}return null}function ap(n){let e=n.type.prop(_k);return e?e(n.node):n}function lr(n,e,t,r={}){let i=r.maxScanDistance||Ik,s=r.brackets||Xk,o=Je(n),a=o.resolveInner(e,t);for(let l=a;l;l=l.parent){let c=op(l.type,t,s);if(c&&l.from<l.to){let d=ap(l);if(d&&(t>0?e>=d.from&&e<d.to:e>d.from&&e<=d.to))return sE(n,e,t,l,d,c,s)}}return oE(n,e,t,o,a.type,i,s)}function sE(n,e,t,r,i,s,o){let a=r.parent,l={from:i.from,to:i.to},c=0,d=a?.cursor();if(d&&(t<0?d.childBefore(r.from):d.childAfter(r.to)))do if(t<0?d.to<=r.from:d.from>=r.to){if(c==0&&s.indexOf(d.type.name)>-1&&d.from<d.to){let h=ap(d);return{start:l,end:h?{from:h.from,to:h.to}:void 0,matched:!0}}else if(op(d.type,t,o))c++;else if(op(d.type,-t,o)){if(c==0){let h=ap(d);return{start:l,end:h&&h.from<h.to?{from:h.from,to:h.to}:void 0,matched:!1}}c--}}while(t<0?d.prevSibling():d.nextSibling());return{start:l,matched:!1}}function oE(n,e,t,r,i,s,o){if(t<0?!e:e==n.doc.length)return null;let a=t<0?n.sliceDoc(e-1,e):n.sliceDoc(e,e+1),l=o.indexOf(a);if(l<0||l%2==0!=t>0)return null;let c={from:t<0?e-1:e,to:t>0?e+1:e},d=n.doc.iterRange(e,t>0?n.doc.length:0),h=0;for(let f=0;!d.next().done&&f<=s;){let p=d.value;t<0&&(f+=p.length);let m=e+f*t;for(let O=t>0?0:p.length-1,b=t>0?p.length:-1;O!=b;O+=t){let y=o.indexOf(p[O]);if(!(y<0||r.resolveInner(m+O,1).type!=i))if(y%2==0==t>0)h++;else{if(h==1)return{start:c,end:{from:m+O,to:m+O+1},matched:y>>1==l>>1};h--}}t>0&&(f+=p.length)}return d.done?{start:c,matched:!1}:null}const aE=Object.create(null),G0=[gn.none],H0=[],K0=Object.create(null),lE=Object.create(null);for(let[n,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])lE[n]=cE(aE,e);function bh(n,e){H0.indexOf(n)>-1||(H0.push(n),console.warn(e))}function cE(n,e){let t=[];for(let a of e.split(" ")){let l=[];for(let c of a.split(".")){let d=n[c]||u[c];d?typeof d=="function"?l.length?l=l.map(d):bh(c,`Modifier ${c} used at start of tag`):l.length?bh(c,`Tag ${c} used as modifier`):l=Array.isArray(d)?d:[d]:bh(c,`Unknown highlighting tag ${c}`)}for(let c of l)t.push(c)}if(!t.length)return 0;let r=e.replace(/ /g,"_"),i=r+" "+t.map(a=>a.id),s=K0[i];if(s)return s.id;let o=K0[i]=gn.define({id:G0.length,name:r,props:[sl({[r]:t})]});return G0.push(o),o.id}Re.RTL,Re.LTR;let yh=null;function xh(){if(!yh&&typeof document=="object"&&document.body){let{style:n}=document.body,e=[],t=new Set;for(let r in n)r!="cssText"&&r!="cssFloat"&&typeof n[r]=="string"&&(/[A-Z]/.test(r)&&(r=r.replace(/[A-Z]/g,i=>"-"+i.toLowerCase())),t.has(r)||(e.push(r),t.add(r)));yh=e.sort().map(r=>({type:"property",label:r,apply:r+": "}))}return yh||[]}const J0=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(n=>({type:"class",label:n})),e1=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(n=>({type:"keyword",label:n})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(n=>({type:"constant",label:n}))),uE=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(n=>({type:"type",label:n})),dE=["@charset","@color-profile","@container","@counter-style","@font-face","@font-feature-values","@font-palette-values","@import","@keyframes","@layer","@media","@namespace","@page","@position-try","@property","@scope","@starting-style","@supports","@view-transition"].map(n=>({type:"keyword",label:n})),xr=/^(\w[\w-]*|-\w[\w-]*|)$/,hE=/^-(-[\w-]*)?$/;function fE(n,e){var t;if((n.name=="("||n.type.isError)&&(n=n.parent||n),n.name!="ArgList")return!1;let r=(t=n.parent)===null||t===void 0?void 0:t.firstChild;return r?.name!="Callee"?!1:e.sliceString(r.from,r.to)=="var"}const t1=new mm,pE=["Declaration"];function mE(n){for(let e=n;;){if(e.type.isTop)return e;if(!(e=e.parent))return n}}function Bk(n,e,t){if(e.to-e.from>4096){let r=t1.get(e);if(r)return r;let i=[],s=new Set,o=e.cursor(be.IncludeAnonymous);if(o.firstChild())do for(let a of Bk(n,o.node,t))s.has(a.label)||(s.add(a.label),i.push(a));while(o.nextSibling());return t1.set(e,i),i}else{let r=[],i=new Set;return e.cursor().iterate(s=>{var o;if(t(s)&&s.matchContext(pE)&&((o=s.node.nextSibling)===null||o===void 0?void 0:o.name)==":"){let a=n.sliceString(s.from,s.to);i.has(a)||(i.add(a),r.push({label:a,type:"variable"}))}}),r}}const gE=n=>e=>{let{state:t,pos:r}=e,i=Je(t).resolveInner(r,-1),s=i.type.isError&&i.from==i.to-1&&t.doc.sliceString(i.from,i.to)=="-";if(i.name=="PropertyName"||(s||i.name=="TagName")&&/^(Block|Styles)$/.test(i.resolve(i.to).name))return{from:i.from,options:xh(),validFor:xr};if(i.name=="ValueName")return{from:i.from,options:e1,validFor:xr};if(i.name=="PseudoClassName")return{from:i.from,options:J0,validFor:xr};if(n(i)||(e.explicit||s)&&fE(i,t.doc))return{from:n(i)||s?i.from:r,options:Bk(t.doc,mE(i),n),validFor:hE};if(i.name=="TagName"){for(let{parent:l}=i;l;l=l.parent)if(l.name=="Block")return{from:i.from,options:xh(),validFor:xr};return{from:i.from,options:uE,validFor:xr}}if(i.name=="AtKeyword")return{from:i.from,options:dE,validFor:xr};if(!e.explicit)return null;let o=i.resolve(r),a=o.childBefore(r);return a&&a.name==":"&&o.name=="PseudoClassSelector"?{from:r,options:J0,validFor:xr}:a&&a.name==":"&&o.name=="Declaration"||o.name=="ArgList"?{from:r,options:e1,validFor:xr}:o.name=="Block"||o.name=="Styles"?{from:r,options:xh(),validFor:xr}:null},OE=gE(n=>n.name=="VariableName"),su=ns.define({name:"css",parser:cM.configure({props:[dl.add({Declaration:_s()}),hl.add({"Block KeyframeList":Lm})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function Zk(){return new gd(su,su.data.of({autocomplete:OE}))}const bE=177,yE=179,xE=184,SE=12,kE=13,vE=17,wE=20,QE=25,$E=53,CE=95,PE=142,TE=144,ME=145,AE=148,RE=10,EE=13,NE=32,DE=9,n1=47,jE=41,IE=125,XE=new rn((n,e)=>{for(let t=0,r=n.next;(e.context&&(r<0||r==RE||r==EE||r==n1&&n.peek(t+1)==n1)||r==jE||r==IE)&&n.acceptToken(bE),!(r!=NE&&r!=DE);)r=n.peek(++t)},{contextual:!0});let LE=new Set([CE,xE,wE,SE,vE,TE,ME,PE,AE,kE,$E,QE]);const _E=new gm({start:!1,shift:(n,e)=>e==yE?n:LE.has(e)}),BE=sl({"func interface struct chan map const type var":u.definitionKeyword,"import package":u.moduleKeyword,"switch for go select return break continue goto fallthrough case if else defer":u.controlKeyword,range:u.keyword,Bool:u.bool,String:u.string,Rune:u.character,Number:u.number,Nil:u.null,VariableName:u.variableName,DefName:u.definition(u.variableName),TypeName:u.typeName,LabelName:u.labelName,FieldName:u.propertyName,"FunctionDecl/DefName":u.function(u.definition(u.variableName)),"TypeSpec/DefName":u.definition(u.typeName),"CallExpr/VariableName":u.function(u.variableName),LineComment:u.lineComment,BlockComment:u.blockComment,LogicOp:u.logicOperator,ArithOp:u.arithmeticOperator,BitOp:u.bitwiseOperator,"DerefOp .":u.derefOperator,"UpdateOp IncDecOp":u.updateOperator,CompareOp:u.compareOperator,"= :=":u.definitionOperator,"<-":u.operator,'~ "*"':u.modifier,"; ,":u.separator,"... :":u.punctuation,"( )":u.paren,"[ ]":u.squareBracket,"{ }":u.brace}),ZE={__proto__:null,package:10,import:18,true:380,false:380,nil:383,struct:48,func:68,interface:78,chan:94,map:118,make:157,new:159,const:204,type:212,var:224,if:236,else:238,switch:242,case:248,default:250,for:260,range:266,go:270,select:274,return:284,break:288,continue:290,goto:292,fallthrough:296,defer:300},WE=Ki.deserialize({version:14,states:"!=xO#{QQOOP$SOQOOO&UQTO'#CbO&]QRO'#FlO]QQOOOOQP'#Cn'#CnOOQP'#Co'#CoO&eQQO'#C|O(kQQO'#C{O)]QRO'#GiO+tQQO'#D_OOQP'#Ge'#GeO+{QQO'#GeO.aQTO'#GaO.hQQO'#D`OOQP'#Gm'#GmO.mQRO'#GdO/hQQO'#DgOOQP'#Gd'#GdO/uQQO'#DrO2bQQO'#DsO4QQTO'#GqO,^QTO'#GaO4XQQO'#DxO4^QQO'#D{OOQO'#EQ'#EQOOQO'#ER'#EROOQO'#ES'#ESOOQO'#ET'#ETO4cQQO'#EPO5}QQO'#EPOOQP'#Ga'#GaO6UQQO'#E`O6^QQO'#EcOOQP'#G`'#G`O6cQQO'#EsOOQP'#G_'#G_O&]QRO'#FnOOQO'#Fn'#FnO9QQQO'#G^QOQQOOO&]QROOO9XQQO'#C`O9^QSO'#CdO9lQQO'#C}O9tQQO'#DSO9yQQO'#D[O:kQQO'#CsO:pQQO'#DhO:uQQO'#EeO:}QQO'#EiO;VQQO'#EoO;_QQO'#EuO<uQQO'#ExO<|QQ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i)l)s)|*Q*`*h*k*l*n*o*p*r*w+R+g+j+l+|+},Q,R,S,T,U,V,W,X,Y,Z,[,],^,_,`,a,b,c,h,{,|,}-O-P-Q-U-V-W-X-Y-Z-[-]-^-_-dS&_#}&dW(S&S*S*|+^Q(e&bQ(o&lR*x*PS%U!t*`R+q+jR%S!qQ#PcQ(}&|Q)Z'YR+n+ghpOScw!U!V#O#k#n&|'Y+gQ$d!WQ$n!ZQ%g#VU%p#i'T,bU%q#j'U,cQ(j&gQ(u&sQ)Q'PQ)_']Q)y'wQ*_(kQ*a(tV-R'W)W*kT(U&S&l",nodeNames:"⚠ LineComment BlockComment SourceFile PackageClause package DefName ; ImportDecl import ImportSpec . String ) ( SpecList ExprStatement Number Bool Nil Rune VariableName TypedLiteral StructType struct } { StructBody FieldDecl FieldName , PointerType * FunctionType func Parameters Parameter ... InterfaceType interface InterfaceBody MethodElem UnderlyingType ~ TypeElem LogicOp ChannelType chan <- ParenthesizedType QualifiedType TypeName ParameterizedType ] [ TypeArgs ArrayType SliceType MapType map LiteralValue Element Key : Element Key ParenthesizedExpr FunctionLiteral Block Conversion SelectorExpr IndexExpr SliceExpr TypeAssertion CallExpr ParameterizedExpr Arguments CallExpr make new Arguments UnaryExp ArithOp LogicOp BitOp DerefOp BinaryExp ArithOp BitOp BitOp CompareOp LogicOp LogicOp SendStatement IncDecStatement IncDecOp Assignment = UpdateOp VarDecl := ConstDecl const ConstSpec SpecList TypeDecl type TypeSpec TypeParams TypeParam SpecList VarDecl var VarSpec SpecList LabeledStatement LabelName IfStatement if else SwitchStatement switch SwitchBlock Case case default TypeSwitchStatement SwitchBlock Case ForStatement for ForClause RangeClause range GoStatement go SelectStatement select SelectBlock Case ReceiveStatement ReturnStatement return GotoStatement break continue goto FallthroughStatement fallthrough DeferStatement defer FunctionDecl MethodDecl",maxTerm:218,context:_E,nodeProps:[["isolate",-3,2,12,20,""],["group",-18,12,17,18,19,20,21,22,66,67,69,70,71,72,73,74,77,81,86,"Expr",-20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}3x#R#S8P#T#]3x#]#^8k#^#o3x$g;'S3x;'S;=`4d<%lO3x~8UV%O~!Q![7]!c!}3x#R#S3x#T#o3x$g;'S3x;'S;=`4d<%lO3x~8rVaQ%O~!Q![3x!c!}3x#R#S3x#T#o3x$g;'S3x;'S;=`4d<%lO3x~9[TO#S9X#S#T$v#T;'S9X;'S;=`9k<%lO9X~9nP;=`<%l9X~9vOj~~9{Q%`~!_!`&X#p#q:R~:WO%q~~:]Oi~~:bO{~",tokenizers:[XE,1,2,new $a("j~RQYZXz{^~^O$|~~aP!P!Qd~iO$}~~",25,181)],topRules:{SourceFile:[0,3]},dynamicPrecedences:{19:1,51:-1,55:2,69:-1,108:-1},specialized:[{term:184,get:n=>ZE[n]||-1}],tokenPrec:5451});class Wk{constructor(e,t,r,i){this.state=e,this.pos=t,this.explicit=r,this.view=i,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let t=Je(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),r=Math.max(t.from,this.pos-250),i=t.text.slice(r-t.from,this.pos-t.from),s=i.search(Vk(e,!1));return s<0?null:{from:r+s,to:this.pos,text:i.slice(s)}}get aborted(){return this.abortListeners==null}addEventListener(e,t,r){e=="abort"&&this.abortListeners&&(this.abortListeners.push(t),r&&r.onDocChange&&(this.abortOnDocChange=!0))}}function r1(n){let e=Object.keys(n).join(""),t=/\w/.test(e);return t&&(e=e.replace(/\w/g,"")),`[${t?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function zE(n){let e=Object.create(null),t=Object.create(null);for(let{label:i}of n){e[i[0]]=!0;for(let s=1;s<i.length;s++)t[i[s]]=!0}let r=r1(e)+r1(t)+"*$";return[new RegExp("^"+r),new RegExp(r)]}function Bm(n){let e=n.map(i=>typeof i=="string"?{label:i}:i),[t,r]=e.every(i=>/^\w+$/.test(i.label))?[/\w*$/,/\w+$/]:zE(e);return i=>{let s=i.matchBefore(r);return s||i.explicit?{from:s?s.from:i.pos,options:e,validFor:t}:null}}function zk(n,e){return t=>{for(let r=Je(t.state).resolveInner(t.pos,-1);r;r=r.parent){if(n.indexOf(r.name)>-1)return null;if(r.type.isTop)break}return e(t)}}class i1{constructor(e,t,r,i){this.completion=e,this.source=t,this.match=r,this.score=i}}function Fi(n){return n.selection.main.from}function Vk(n,e){var t;let{source:r}=n,i=e&&r[0]!="^",s=r[r.length-1]!="$";return!i&&!s?n:new RegExp(`${i?"^":""}(?:${r})${s?"$":""}`,(t=n.flags)!==null&&t!==void 0?t:n.ignoreCase?"i":"")}const Zm=Or.define();function VE(n,e,t,r){let{main:i}=n.selection,s=t-i.from,o=r-i.from;return{...n.changeByRange(a=>{if(a!=i&&t!=r&&n.sliceDoc(a.from+s,a.from+o)!=n.sliceDoc(t,r))return{range:a};let l=n.toText(e);return{changes:{from:a.from+s,to:r==i.from?a.to:a.from+o,insert:l},range:A.cursor(a.from+s+l.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}const s1=new WeakMap;function FE(n){if(!Array.isArray(n))return n;let e=s1.get(n);return e||s1.set(n,e=Bm(n)),e}const ou=oe.define(),La=oe.define();class qE{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t<e.length;){let r=Yt(e,t),i=ir(r);this.chars.push(r);let s=e.slice(t,t+i),o=s.toUpperCase();this.folded.push(Yt(o==s?s.toLowerCase():o,0)),t+=i}this.astral=e.length!=this.chars.length}ret(e,t){return this.score=e,this.matched=t,this}match(e){if(this.pattern.length==0)return this.ret(-100,[]);if(e.length<this.pattern.length)return null;let{chars:t,folded:r,any:i,precise:s,byWord:o}=this;if(t.length==1){let k=Yt(e,0),x=ir(k),S=x==e.length?0:-100;if(k!=t[0])if(k==r[0])S+=-200;else return null;return this.ret(S,[0,x])}let a=e.indexOf(this.pattern);if(a==0)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let l=t.length,c=0;if(a<0){for(let k=0,x=Math.min(e.length,200);k<x&&c<l;){let S=Yt(e,k);(S==t[c]||S==r[c])&&(i[c++]=k),k+=ir(S)}if(c<l)return null}let d=0,h=0,f=!1,p=0,m=-1,O=-1,b=/[a-z]/.test(e),y=!0;for(let k=0,x=Math.min(e.length,200),S=0;k<x&&h<l;){let v=Yt(e,k);a<0&&(d<l&&v==t[d]&&(s[d++]=k),p<l&&(v==t[p]||v==r[p]?(p==0&&(m=k),O=k+1,p++):p=0));let w,Q=v<255?v>=48&&v<=57||v>=97&&v<=122?2:v>=65&&v<=90?1:0:(w=bm(v))!=w.toLowerCase()?1:w!=w.toUpperCase()?2:0;(!k||Q==1&&b||S==0&&Q!=0)&&(t[h]==v||r[h]==v&&(f=!0)?o[h++]=k:o.length&&(y=!1)),S=Q,k+=ir(v)}return h==l&&o[0]==0&&y?this.result(-100+(f?-200:0),o,e):p==l&&m==0?this.ret(-200-e.length+(O==e.length?0:-100),[0,O]):a>-1?this.ret(-700-e.length,[a,a+this.pattern.length]):p==l?this.ret(-900-e.length,[m,O]):h==l?this.result(-100+(f?-200:0)+-700+(y?0:-1100),o,e):t.length==2?null:this.result((i[0]?-700:0)+-200+-1100,i,e)}result(e,t,r){let i=[],s=0;for(let o of t){let a=o+(this.astral?ir(Yt(r,o)):1);s&&i[s-1]==o?i[s-1]=a:(i[s++]=o,i[s++]=a)}return this.ret(e-r.length,i)}}class YE{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length<this.pattern.length)return null;let t=e.slice(0,this.pattern.length),r=t==this.pattern?0:t.toLowerCase()==this.folded?-200:null;return r==null?null:(this.matched=[0,t.length],this.score=r+(e.length==this.pattern.length?0:-100),this)}}const Ot=W.define({combine(n){return br(n,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:UE,filterStrict:!1,compareCompletions:(e,t)=>(e.sortText||e.label).localeCompare(t.sortText||t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>r=>o1(e(r),t(r)),optionClass:(e,t)=>r=>o1(e(r),t(r)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})}});function o1(n,e){return n?e?n+" "+e:n:e}function UE(n,e,t,r,i,s){let o=n.textDirection==Re.RTL,a=o,l=!1,c="top",d,h,f=e.left-i.left,p=i.right-e.right,m=r.right-r.left,O=r.bottom-r.top;if(a&&f<Math.min(m,p)?a=!1:!a&&p<Math.min(m,f)&&(a=!0),m<=(a?f:p))d=Math.max(i.top,Math.min(t.top,i.bottom-O))-e.top,h=Math.min(400,a?f:p);else{l=!0,h=Math.min(400,(o?e.right:i.right-e.left)-30);let k=i.bottom-e.bottom;k>=O||k>e.top?d=t.bottom-e.top:(c="bottom",d=e.bottom-t.top)}let b=(e.bottom-e.top)/s.offsetHeight,y=(e.right-e.left)/s.offsetWidth;return{style:`${c}: ${d/b}px; max-width: ${h/y}px`,class:"cm-completionInfo-"+(l?o?"left-narrow":"right-narrow":a?"left":"right")}}const Wm=oe.define();function GE(n){let e=n.addToOptions.slice();return n.icons&&e.push({render(t){let r=document.createElement("div");return r.classList.add("cm-completionIcon"),t.type&&r.classList.add(...t.type.split(/\s+/g).map(i=>"cm-completionIcon-"+i)),r.setAttribute("aria-hidden","true"),r},position:20}),e.push({render(t,r,i,s){let o=document.createElement("span");o.className="cm-completionLabel";let a=t.displayLabel||t.label,l=0;for(let c=0;c<s.length;){let d=s[c++],h=s[c++];d>l&&o.appendChild(document.createTextNode(a.slice(l,d)));let f=o.appendChild(document.createElement("span"));f.appendChild(document.createTextNode(a.slice(d,h))),f.className="cm-completionMatchedText",l=h}return l<a.length&&o.appendChild(document.createTextNode(a.slice(l))),o},position:50},{render(t){if(!t.detail)return null;let r=document.createElement("span");return r.className="cm-completionDetail",r.textContent=t.detail,r},position:80}),e.sort((t,r)=>t.position-r.position).map(t=>t.render)}function Sh(n,e,t){if(n<=t)return{from:0,to:n};if(e<0&&(e=0),e<=n>>1){let i=Math.floor(e/t);return{from:i*t,to:(i+1)*t}}let r=Math.ceil((n-e)/t);return{from:n-r*t,to:n-(r-1)*t}}class HE{constructor(e,t,r){this.view=e,this.stateField=t,this.applyCompletion=r,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:l=>this.placeInfo(l),key:this},this.space=null,this.currentClass="";let i=e.state.field(t),{options:s,selected:o}=i.open,a=e.state.facet(Ot);this.optionContent=GE(a),this.optionClass=a.optionClass,this.tooltipClass=a.tooltipClass,this.range=Sh(s.length,o,a.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",l=>{let{options:c}=e.state.field(t).open;for(let d=l.target,h;d&&d!=this.dom;d=d.parentNode)if(d.nodeName=="LI"&&(h=/-(\d+)$/.exec(d.id))&&+h[1]<c.length){this.applyCompletion(e,c[+h[1]]),l.preventDefault();return}if(l.target==this.list){let d=this.list.classList.contains("cm-completionListIncompleteTop")&&l.clientY<this.list.firstChild.getBoundingClientRect().top?this.range.from-1:this.list.classList.contains("cm-completionListIncompleteBottom")&&l.clientY>this.list.lastChild.getBoundingClientRect().bottom?this.range.to:null;d!=null&&(e.dispatch({effects:Wm.of(d)}),l.preventDefault())}}),this.dom.addEventListener("focusout",l=>{let c=e.state.field(this.stateField,!1);c&&c.tooltip&&e.state.facet(Ot).closeOnBlur&&l.relatedTarget!=e.contentDOM&&e.dispatch({effects:La.of(null)})}),this.showOptions(s,i.id)}mount(){this.updateSel()}showOptions(e,t){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,t,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var t;let r=e.state.field(this.stateField),i=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),r!=i){let{options:s,selected:o,disabled:a}=r.open;(!i.open||i.open.options!=s)&&(this.range=Sh(s.length,o,e.state.facet(Ot).maxRenderedOptions),this.showOptions(s,r.id)),this.updateSel(),a!=((t=i.open)===null||t===void 0?void 0:t.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!a)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let r of this.currentClass.split(" "))r&&this.dom.classList.remove(r);for(let r of t.split(" "))r&&this.dom.classList.add(r);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;(t.selected>-1&&t.selected<this.range.from||t.selected>=this.range.to)&&(this.range=Sh(t.options.length,t.selected,this.view.state.facet(Ot).maxRenderedOptions),this.showOptions(t.options,e.id));let r=this.updateSelectedOption(t.selected);if(r){this.destroyInfo();let{completion:i}=t.options[t.selected],{info:s}=i;if(!s)return;let o=typeof s=="string"?document.createTextNode(s):s(i);if(!o)return;"then"in o?o.then(a=>{a&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(a,i)}).catch(a=>Kt(this.view.state,a,"completion info")):(this.addInfoPane(o,i),r.setAttribute("aria-describedby",this.info.id))}}addInfoPane(e,t){this.destroyInfo();let r=this.info=document.createElement("div");if(r.className="cm-tooltip cm-completionInfo",r.id="cm-completionInfo-"+Math.floor(Math.random()*65535).toString(16),e.nodeType!=null)r.appendChild(e),this.infoDestroy=null;else{let{dom:i,destroy:s}=e;r.appendChild(i),this.infoDestroy=s||null}this.dom.appendChild(r),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let r=this.list.firstChild,i=this.range.from;r;r=r.nextSibling,i++)r.nodeName!="LI"||!r.id?i--:i==e?r.hasAttribute("aria-selected")||(r.setAttribute("aria-selected","true"),t=r):r.hasAttribute("aria-selected")&&(r.removeAttribute("aria-selected"),r.removeAttribute("aria-describedby"));return t&&JE(this.list,t),t}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),r=this.info.getBoundingClientRect(),i=e.getBoundingClientRect(),s=this.space;if(!s){let o=this.dom.ownerDocument.documentElement;s={left:0,top:0,right:o.clientWidth,bottom:o.clientHeight}}return i.top>Math.min(s.bottom,t.bottom)-10||i.bottom<Math.max(s.top,t.top)+10?null:this.view.state.facet(Ot).positionInfo(this.view,t,i,r,s,this.dom)}placeInfo(e){this.info&&(e?(e.style&&(this.info.style.cssText=e.style),this.info.className="cm-tooltip cm-completionInfo "+(e.class||"")):this.info.style.cssText="top: -1e6px")}createListBox(e,t,r){const i=document.createElement("ul");i.id=t,i.setAttribute("role","listbox"),i.setAttribute("aria-expanded","true"),i.setAttribute("aria-label",this.view.state.phrase("Completions")),i.addEventListener("mousedown",o=>{o.target==i&&o.preventDefault()});let s=null;for(let o=r.from;o<r.to;o++){let{completion:a,match:l}=e[o],{section:c}=a;if(c){let f=typeof c=="string"?c:c.name;if(f!=s&&(o>r.from||r.from==0))if(s=f,typeof c!="string"&&c.header)i.appendChild(c.header(c));else{let p=i.appendChild(document.createElement("completion-section"));p.textContent=f}}const d=i.appendChild(document.createElement("li"));d.id=t+"-"+o,d.setAttribute("role","option");let h=this.optionClass(a);h&&(d.className=h);for(let f of this.optionContent){let p=f(a,this.view.state,this.view,l);p&&d.appendChild(p)}}return r.from&&i.classList.add("cm-completionListIncompleteTop"),r.to<e.length&&i.classList.add("cm-completionListIncompleteBottom"),i}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}}function KE(n,e){return t=>new HE(t,n,e)}function JE(n,e){let t=n.getBoundingClientRect(),r=e.getBoundingClientRect(),i=t.height/n.offsetHeight;r.top<t.top?n.scrollTop-=(t.top-r.top)/i:r.bottom>t.bottom&&(n.scrollTop+=(r.bottom-t.bottom)/i)}function a1(n){return(n.boost||0)*100+(n.apply?10:0)+(n.info?5:0)+(n.type?1:0)}function eN(n,e){let t=[],r=null,i=null,s=d=>{t.push(d);let{section:h}=d.completion;if(h){r||(r=[]);let f=typeof h=="string"?h:h.name;r.some(p=>p.name==f)||r.push(typeof h=="string"?{name:f}:h)}},o=e.facet(Ot);for(let d of n)if(d.hasResult()){let h=d.result.getMatch;if(d.result.filter===!1)for(let f of d.result.options)s(new i1(f,d.source,h?h(f):[],1e9-t.length));else{let f=e.sliceDoc(d.from,d.to),p,m=o.filterStrict?new YE(f):new qE(f);for(let O of d.result.options)if(p=m.match(O.label)){let b=O.displayLabel?h?h(O,p.matched):[]:p.matched,y=p.score+(O.boost||0);if(s(new i1(O,d.source,b,y)),typeof O.section=="object"&&O.section.rank==="dynamic"){let{name:k}=O.section;i||(i=Object.create(null)),i[k]=Math.max(y,i[k]||-1e9)}}}}if(r){let d=Object.create(null),h=0,f=(p,m)=>(p.rank==="dynamic"&&m.rank==="dynamic"?i[m.name]-i[p.name]:0)||(typeof p.rank=="number"?p.rank:1e9)-(typeof m.rank=="number"?m.rank:1e9)||(p.name<m.name?-1:1);for(let p of r.sort(f))h-=1e5,d[p.name]=h;for(let p of t){let{section:m}=p.completion;m&&(p.score+=d[typeof m=="string"?m:m.name])}}let a=[],l=null,c=o.compareCompletions;for(let d of t.sort((h,f)=>f.score-h.score||c(h.completion,f.completion))){let h=d.completion;!l||l.label!=h.label||l.detail!=h.detail||l.type!=null&&h.type!=null&&l.type!=h.type||l.apply!=h.apply||l.boost!=h.boost?a.push(d):a1(d.completion)>a1(l)&&(a[a.length-1]=d),l=d.completion}return a}class Es{constructor(e,t,r,i,s,o){this.options=e,this.attrs=t,this.tooltip=r,this.timestamp=i,this.selected=s,this.disabled=o}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new Es(this.options,l1(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,r,i,s,o){if(i&&!o&&e.some(c=>c.isPending))return i.setDisabled();let a=eN(e,t);if(!a.length)return i&&e.some(c=>c.isPending)?i.setDisabled():null;let l=t.facet(Ot).selectOnOpen?0:-1;if(i&&i.selected!=l&&i.selected!=-1){let c=i.options[i.selected].completion;for(let d=0;d<a.length;d++)if(a[d].completion==c){l=d;break}}return new Es(a,l1(r,l),{pos:e.reduce((c,d)=>d.hasResult()?Math.min(c,d.from):c,1e8),create:oN,above:s.aboveCursor},i?i.timestamp:Date.now(),l,!1)}map(e){return new Es(this.options,this.attrs,{...this.tooltip,pos:e.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new Es(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class au{constructor(e,t,r){this.active=e,this.id=t,this.open=r}static start(){return new au(iN,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:t}=e,r=t.facet(Ot),s=(r.override||t.languageDataAt("autocomplete",Fi(t)).map(FE)).map(l=>(this.active.find(d=>d.source==l)||new Pn(l,this.active.some(d=>d.state!=0)?1:0)).update(e,r));s.length==this.active.length&&s.every((l,c)=>l==this.active[c])&&(s=this.active);let o=this.open,a=e.effects.some(l=>l.is(zm));o&&e.docChanged&&(o=o.map(e.changes)),e.selection||s.some(l=>l.hasResult()&&e.changes.touchesRange(l.from,l.to))||!tN(s,this.active)||a?o=Es.build(s,t,this.id,o,r,a):o&&o.disabled&&!s.some(l=>l.isPending)&&(o=null),!o&&s.every(l=>!l.isPending)&&s.some(l=>l.hasResult())&&(s=s.map(l=>l.hasResult()?new Pn(l.source,0):l));for(let l of e.effects)l.is(Wm)&&(o=o&&o.setSelected(l.value,this.id));return s==this.active&&o==this.open?this:new au(s,this.id,o)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?nN:rN}}function tN(n,e){if(n==e)return!0;for(let t=0,r=0;;){for(;t<n.length&&!n[t].hasResult();)t++;for(;r<e.length&&!e[r].hasResult();)r++;let i=t==n.length,s=r==e.length;if(i||s)return i==s;if(n[t++].result!=e[r++].result)return!1}}const nN={"aria-autocomplete":"list"},rN={};function l1(n,e){let t={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":n};return e>-1&&(t["aria-activedescendant"]=n+"-"+e),t}const iN=[];function Fk(n,e){if(n.isUserEvent("input.complete")){let r=n.annotation(Zm);if(r&&e.activateOnCompletion(r))return 12}let t=n.isUserEvent("input.type");return t&&e.activateOnTyping?5:t?1:n.isUserEvent("delete.backward")?2:n.selection?8:n.docChanged?16:0}class Pn{constructor(e,t,r=!1){this.source=e,this.state=t,this.explicit=r}hasResult(){return!1}get isPending(){return this.state==1}update(e,t){let r=Fk(e,t),i=this;(r&8||r&16&&this.touches(e))&&(i=new Pn(i.source,0)),r&4&&i.state==0&&(i=new Pn(this.source,1)),i=i.updateFor(e,r);for(let s of e.effects)if(s.is(ou))i=new Pn(i.source,1,s.value);else if(s.is(La))i=new Pn(i.source,0);else if(s.is(zm))for(let o of s.value)o.source==i.source&&(i=o);return i}updateFor(e,t){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(Fi(e.state))}}class Bs extends Pn{constructor(e,t,r,i,s,o){super(e,3,t),this.limit=r,this.result=i,this.from=s,this.to=o}hasResult(){return!0}updateFor(e,t){var r;if(!(t&3))return this.map(e.changes);let i=this.result;i.map&&!e.changes.empty&&(i=i.map(i,e.changes));let s=e.changes.mapPos(this.from),o=e.changes.mapPos(this.to,1),a=Fi(e.state);if(a>o||!i||t&2&&(Fi(e.startState)==this.from||a<this.limit))return new Pn(this.source,t&4?1:0);let l=e.changes.mapPos(this.limit);return sN(i.validFor,e.state,s,o)?new Bs(this.source,this.explicit,l,i,s,o):i.update&&(i=i.update(i,s,o,new Wk(e.state,a,!1)))?new Bs(this.source,this.explicit,l,i,i.from,(r=i.to)!==null&&r!==void 0?r:Fi(e.state)):new Pn(this.source,1,this.explicit)}map(e){if(e.empty)return this;let t=this.result.map?this.result.map(this.result,e):this.result;return t?new Bs(this.source,this.explicit,e.mapPos(this.limit),t,e.mapPos(this.from),e.mapPos(this.to,1)):new Pn(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}}function sN(n,e,t,r){if(!n)return!1;let i=e.sliceDoc(t,r);return typeof n=="function"?n(i,t,r,e):Vk(n,!0).test(i)}const zm=oe.define({map(n,e){return n.map(t=>t.map(e))}}),Ut=Mt.define({create(){return au.start()},update(n,e){return n.update(e)},provide:n=>[Dm.from(n,e=>e.tooltip),X.contentAttributes.from(n,e=>e.attrs)]});function Vm(n,e){const t=e.completion.apply||e.completion.label;let r=n.state.field(Ut).active.find(i=>i.source==e.source);return r instanceof Bs?(typeof t=="string"?n.dispatch({...VE(n.state,t,r.from,r.to),annotations:Zm.of(e.completion)}):t(n,e.completion,r.from,r.to),!0):!1}const oN=KE(Ut,Vm);function Vl(n,e="option"){return t=>{let r=t.state.field(Ut,!1);if(!r||!r.open||r.open.disabled||Date.now()-r.open.timestamp<t.state.facet(Ot).interactionDelay)return!1;let i=1,s;e=="page"&&(s=Ok(t,r.open.tooltip))&&(i=Math.max(2,Math.floor(s.dom.offsetHeight/s.dom.querySelector("li").offsetHeight)-1));let{length:o}=r.open.options,a=r.open.selected>-1?r.open.selected+i*(n?1:-1):n?0:o-1;return a<0?a=e=="page"?0:o-1:a>=o&&(a=e=="page"?o-1:0),t.dispatch({effects:Wm.of(a)}),!0}}const aN=n=>{let e=n.state.field(Ut,!1);return n.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestamp<n.state.facet(Ot).interactionDelay?!1:Vm(n,e.open.options[e.open.selected])},kh=n=>n.state.field(Ut,!1)?(n.dispatch({effects:ou.of(!0)}),!0):!1,lN=n=>{let e=n.state.field(Ut,!1);return!e||!e.active.some(t=>t.state!=0)?!1:(n.dispatch({effects:La.of(null)}),!0)};class cN{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}const uN=50,dN=1e3,hN=ot.fromClass(class{constructor(n){this.view=n,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let e of n.state.field(Ut).active)e.isPending&&this.startQuery(e)}update(n){let e=n.state.field(Ut),t=n.state.facet(Ot);if(!n.selectionSet&&!n.docChanged&&n.startState.field(Ut)==e)return;let r=n.transactions.some(s=>{let o=Fk(s,t);return o&8||(s.selection||s.docChanged)&&!(o&3)});for(let s=0;s<this.running.length;s++){let o=this.running[s];if(r||o.context.abortOnDocChange&&n.docChanged||o.updates.length+n.transactions.length>uN&&Date.now()-o.time>dN){for(let a of o.context.abortListeners)try{a()}catch(l){Kt(this.view.state,l)}o.context.abortListeners=null,this.running.splice(s--,1)}else o.updates.push(...n.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),n.transactions.some(s=>s.effects.some(o=>o.is(ou)))&&(this.pendingStart=!0);let i=this.pendingStart?50:t.activateOnTypingDelay;if(this.debounceUpdate=e.active.some(s=>s.isPending&&!this.running.some(o=>o.active.source==s.source))?setTimeout(()=>this.startUpdate(),i):-1,this.composing!=0)for(let s of n.transactions)s.isUserEvent("input.type")?this.composing=2:this.composing==2&&s.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:n}=this.view,e=n.field(Ut);for(let t of e.active)t.isPending&&!this.running.some(r=>r.active.source==t.source)&&this.startQuery(t);this.running.length&&e.open&&e.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Ot).updateSyncTime))}startQuery(n){let{state:e}=this.view,t=Fi(e),r=new Wk(e,t,n.explicit,this.view),i=new cN(n,r);this.running.push(i),Promise.resolve(n.source(r)).then(s=>{i.context.aborted||(i.done=s||null,this.scheduleAccept())},s=>{this.view.dispatch({effects:La.of(null)}),Kt(this.view.state,s)})}scheduleAccept(){this.running.every(n=>n.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Ot).updateSyncTime))}accept(){var n;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],t=this.view.state.facet(Ot),r=this.view.state.field(Ut);for(let i=0;i<this.running.length;i++){let s=this.running[i];if(s.done===void 0)continue;if(this.running.splice(i--,1),s.done){let a=Fi(s.updates.length?s.updates[0].startState:this.view.state),l=Math.min(a,s.done.from+(s.active.explicit?0:1)),c=new Bs(s.active.source,s.active.explicit,l,s.done,s.done.from,(n=s.done.to)!==null&&n!==void 0?n:a);for(let d of s.updates)c=c.update(d,t);if(c.hasResult()){e.push(c);continue}}let o=r.active.find(a=>a.source==s.active.source);if(o&&o.isPending)if(s.done==null){let a=new Pn(s.active.source,0);for(let l of s.updates)a=a.update(l,t);a.isPending||e.push(a)}else this.startQuery(o)}(e.length||r.open&&r.open.disabled)&&this.view.dispatch({effects:zm.of(e)})}},{eventHandlers:{blur(n){let e=this.view.state.field(Ut,!1);if(e&&e.tooltip&&this.view.state.facet(Ot).closeOnBlur){let t=e.open&&Ok(this.view,e.open.tooltip);(!t||!t.dom.contains(n.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:La.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:ou.of(!1)}),20),this.composing=0}}}),fN=typeof navigator=="object"&&/Win/.test(navigator.platform),pN=Qi.highest(X.domEventHandlers({keydown(n,e){let t=e.state.field(Ut,!1);if(!t||!t.open||t.open.disabled||t.open.selected<0||n.key.length>1||n.ctrlKey&&!(fN&&n.altKey)||n.metaKey)return!1;let r=t.open.options[t.open.selected],i=t.active.find(o=>o.source==r.source),s=r.completion.commitCharacters||i.result.commitCharacters;return s&&s.indexOf(n.key)>-1&&Vm(e,r),!1}})),qk=X.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center",cursor:"pointer"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class mN{constructor(e,t,r,i){this.field=e,this.line=t,this.from=r,this.to=i}}class Fm{constructor(e,t,r){this.field=e,this.from=t,this.to=r}map(e){let t=e.mapPos(this.from,-1,Ct.TrackDel),r=e.mapPos(this.to,1,Ct.TrackDel);return t==null||r==null?null:new Fm(this.field,t,r)}}class qm{constructor(e,t){this.lines=e,this.fieldPositions=t}instantiate(e,t){let r=[],i=[t],s=e.doc.lineAt(t),o=/^\s*/.exec(s.text)[0];for(let l of this.lines){if(r.length){let c=o,d=/^\t*/.exec(l)[0].length;for(let h=0;h<d;h++)c+=e.facet(ul);i.push(t+c.length-d),l=c+l.slice(d)}r.push(l),t+=l.length+1}let a=this.fieldPositions.map(l=>new Fm(l.field,i[l.line]+l.from,i[l.line]+l.to));return{text:r,ranges:a}}static parse(e){let t=[],r=[],i=[],s;for(let o of e.split(/\r\n?|\n/)){for(;s=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(o);){let a=s[1]?+s[1]:null,l=s[2]||s[3]||"",c=-1;a===0&&(a=1e9);let d=l.replace(/\\[{}]/g,h=>h[1]);for(let h=0;h<t.length;h++)(a!=null?t[h].seq==a:d&&t[h].name==d)&&(c=h);if(c<0){let h=0;for(;h<t.length&&(a==null||t[h].seq!=null&&t[h].seq<a);)h++;t.splice(h,0,{seq:a,name:d}),c=h;for(let f of i)f.field>=c&&f.field++}for(let h of i)if(h.line==r.length&&h.from>s.index){let f=s[2]?3+(s[1]||"").length:2;h.from-=f,h.to-=f}i.push(new mN(c,r.length,s.index,s.index+d.length)),o=o.slice(0,s.index)+l+o.slice(s.index+s[0].length)}o=o.replace(/\\([{}])/g,(a,l,c)=>{for(let d of i)d.line==r.length&&d.from>c&&(d.from--,d.to--);return l}),r.push(o)}return new qm(r,i)}}let gN=G.widget({widget:new class extends zn{toDOM(){let n=document.createElement("span");return n.className="cm-snippetFieldPosition",n}ignoreEvent(){return!1}}}),ON=G.mark({class:"cm-snippetField"});class go{constructor(e,t){this.ranges=e,this.active=t,this.deco=G.set(e.map(r=>(r.from==r.to?gN:ON).range(r.from,r.to)),!0)}map(e){let t=[];for(let r of this.ranges){let i=r.map(e);if(!i)return null;t.push(i)}return new go(t,this.active)}selectionInsideField(e){return e.ranges.every(t=>this.ranges.some(r=>r.field==this.active&&r.from<=t.from&&r.to>=t.to))}}const pl=oe.define({map(n,e){return n&&n.map(e)}}),bN=oe.define(),_a=Mt.define({create(){return null},update(n,e){for(let t of e.effects){if(t.is(pl))return t.value;if(t.is(bN)&&n)return new go(n.ranges,t.value)}return n&&e.docChanged&&(n=n.map(e.changes)),n&&e.selection&&!n.selectionInsideField(e.selection)&&(n=null),n},provide:n=>X.decorations.from(n,e=>e?e.deco:G.none)});function Ym(n,e){return A.create(n.filter(t=>t.field==e).map(t=>A.range(t.from,t.to)))}function yN(n){let e=qm.parse(n);return(t,r,i,s)=>{let{text:o,ranges:a}=e.instantiate(t.state,i),{main:l}=t.state.selection,c={changes:{from:i,to:s==l.from?l.to:s,insert:xe.of(o)},scrollIntoView:!0,annotations:r?[Zm.of(r),Wt.userEvent.of("input.complete")]:void 0};if(a.length&&(c.selection=Ym(a,0)),a.some(d=>d.field>0)){let d=new go(a,0),h=c.effects=[pl.of(d)];t.state.field(_a,!1)===void 0&&h.push(oe.appendConfig.of([_a,wN,QN,qk]))}t.dispatch(t.state.update(c))}}function Yk(n){return({state:e,dispatch:t})=>{let r=e.field(_a,!1);if(!r||n<0&&r.active==0)return!1;let i=r.active+n,s=n>0&&!r.ranges.some(o=>o.field==i+n);return t(e.update({selection:Ym(r.ranges,i),effects:pl.of(s?null:new go(r.ranges,i)),scrollIntoView:!0})),!0}}const xN=({state:n,dispatch:e})=>n.field(_a,!1)?(e(n.update({effects:pl.of(null)})),!0):!1,SN=Yk(1),kN=Yk(-1),vN=[{key:"Tab",run:SN,shift:kN},{key:"Escape",run:xN}],c1=W.define({combine(n){return n.length?n[0]:vN}}),wN=Qi.highest(cl.compute([c1],n=>n.facet(c1)));function we(n,e){return{...e,apply:yN(n)}}const QN=X.domEventHandlers({mousedown(n,e){let t=e.state.field(_a,!1),r;if(!t||(r=e.posAtCoords({x:n.clientX,y:n.clientY}))==null)return!1;let i=t.ranges.find(s=>s.from<=r&&s.to>=r);return!i||i.field==t.active?!1:(e.dispatch({selection:Ym(t.ranges,i.field),effects:pl.of(t.ranges.some(s=>s.field>i.field)?new go(t.ranges,i.field):null),scrollIntoView:!0}),!0)}}),Ba={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},Ii=oe.define({map(n,e){let t=e.mapPos(n,-1,Ct.TrackAfter);return t??void 0}}),Um=new class extends Oi{};Um.startSide=1;Um.endSide=-1;const Uk=Mt.define({create(){return me.empty},update(n,e){if(n=n.map(e.changes),e.selection){let t=e.state.doc.lineAt(e.selection.main.head);n=n.update({filter:r=>r>=t.from&&r<=t.to})}for(let t of e.effects)t.is(Ii)&&(n=n.update({add:[Um.range(t.value,t.value+1)]}));return n}});function $N(){return[PN,Uk]}const vh="()[]{}<>«»»«[]{}";function Gk(n){for(let e=0;e<vh.length;e+=2)if(vh.charCodeAt(e)==n)return vh.charAt(e+1);return bm(n<128?n:n+1)}function Hk(n,e){return n.languageDataAt("closeBrackets",e)[0]||Ba}const CN=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),PN=X.inputHandler.of((n,e,t,r)=>{if((CN?n.composing:n.compositionStarted)||n.state.readOnly)return!1;let i=n.state.selection.main;if(r.length>2||r.length==2&&ir(Yt(r,0))==1||e!=i.from||t!=i.to)return!1;let s=AN(n.state,r);return s?(n.dispatch(s),!0):!1}),TN=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let r=Hk(n,n.selection.main.head).brackets||Ba.brackets,i=null,s=n.changeByRange(o=>{if(o.empty){let a=RN(n.doc,o.head);for(let l of r)if(l==a&&yd(n.doc,o.head)==Gk(Yt(l,0)))return{changes:{from:o.head-l.length,to:o.head+l.length},range:A.cursor(o.head-l.length)}}return{range:i=o}});return i||e(n.update(s,{scrollIntoView:!0,userEvent:"delete.backward"})),!i},MN=[{key:"Backspace",run:TN}];function AN(n,e){let t=Hk(n,n.selection.main.head),r=t.brackets||Ba.brackets;for(let i of r){let s=Gk(Yt(i,0));if(e==i)return s==i?DN(n,i,r.indexOf(i+i+i)>-1,t):EN(n,i,s,t.before||Ba.before);if(e==s&&Kk(n,n.selection.main.from))return NN(n,i,s)}return null}function Kk(n,e){let t=!1;return n.field(Uk).between(0,n.doc.length,r=>{r==e&&(t=!0)}),t}function yd(n,e){let t=n.sliceString(e,e+2);return t.slice(0,ir(Yt(t,0)))}function RN(n,e){let t=n.sliceString(e-2,e);return ir(Yt(t,0))==t.length?t:t.slice(1)}function EN(n,e,t,r){let i=null,s=n.changeByRange(o=>{if(!o.empty)return{changes:[{insert:e,from:o.from},{insert:t,from:o.to}],effects:Ii.of(o.to+e.length),range:A.range(o.anchor+e.length,o.head+e.length)};let a=yd(n.doc,o.head);return!a||/\s/.test(a)||r.indexOf(a)>-1?{changes:{insert:e+t,from:o.head},effects:Ii.of(o.head+e.length),range:A.cursor(o.head+e.length)}:{range:i=o}});return i?null:n.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function NN(n,e,t){let r=null,i=n.changeByRange(s=>s.empty&&yd(n.doc,s.head)==t?{changes:{from:s.head,to:s.head+t.length,insert:t},range:A.cursor(s.head+t.length)}:r={range:s});return r?null:n.update(i,{scrollIntoView:!0,userEvent:"input.type"})}function DN(n,e,t,r){let i=r.stringPrefixes||Ba.stringPrefixes,s=null,o=n.changeByRange(a=>{if(!a.empty)return{changes:[{insert:e,from:a.from},{insert:e,from:a.to}],effects:Ii.of(a.to+e.length),range:A.range(a.anchor+e.length,a.head+e.length)};let l=a.head,c=yd(n.doc,l),d;if(c==e){if(u1(n,l))return{changes:{insert:e+e,from:l},effects:Ii.of(l+e.length),range:A.cursor(l+e.length)};if(Kk(n,l)){let f=t&&n.sliceDoc(l,l+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:l,to:l+f.length,insert:f},range:A.cursor(l+f.length)}}}else{if(t&&n.sliceDoc(l-2*e.length,l)==e+e&&(d=d1(n,l-2*e.length,i))>-1&&u1(n,d))return{changes:{insert:e+e+e+e,from:l},effects:Ii.of(l+e.length),range:A.cursor(l+e.length)};if(n.charCategorizer(l)(c)!=Ue.Word&&d1(n,l,i)>-1&&!jN(n,l,e,i))return{changes:{insert:e+e,from:l},effects:Ii.of(l+e.length),range:A.cursor(l+e.length)}}return{range:s=a}});return s?null:n.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function u1(n,e){let t=Je(n).resolveInner(e+1);return t.parent&&t.from==e}function jN(n,e,t,r){let i=Je(n).resolveInner(e,-1),s=r.reduce((o,a)=>Math.max(o,a.length),0);for(let o=0;o<5;o++){let a=n.sliceDoc(i.from,Math.min(i.to,i.from+t.length+s)),l=a.indexOf(t);if(!l||l>-1&&r.indexOf(a.slice(0,l))>-1){let d=i.firstChild;for(;d&&d.from==i.from&&d.to-d.from>t.length+l;){if(n.sliceDoc(d.to-t.length,d.to)==t)return!1;d=d.firstChild}return!0}let c=i.to==e&&i.parent;if(!c)break;i=c}return!1}function d1(n,e,t){let r=n.charCategorizer(e);if(r(n.sliceDoc(e-1,e))!=Ue.Word)return e;for(let i of t){let s=e-i.length;if(n.sliceDoc(s,e)==i&&r(n.sliceDoc(s-1,s))!=Ue.Word)return s}return-1}function IN(n={}){return[pN,Ut,Ot.of(n),hN,XN,qk]}const Jk=[{key:"Ctrl-Space",run:kh},{mac:"Alt-`",run:kh},{mac:"Alt-i",run:kh},{key:"Escape",run:lN},{key:"ArrowDown",run:Vl(!0)},{key:"ArrowUp",run:Vl(!1)},{key:"PageDown",run:Vl(!0,"page")},{key:"PageUp",run:Vl(!1,"page")},{key:"Enter",run:aN}],XN=Qi.highest(cl.computeN([Ot],n=>n.facet(Ot).defaultKeymap?[Jk]:[])),LN=[we("func ${name}(${params}) ${type} {\n ${}\n}",{label:"func",detail:"declaration",type:"keyword"}),we("func (${receiver}) ${name}(${params}) ${type} {\n ${}\n}",{label:"func",detail:"method declaration",type:"keyword"}),we("var ${name} = ${value}",{label:"var",detail:"declaration",type:"keyword"}),we("type ${name} ${type}",{label:"type",detail:"declaration",type:"keyword"}),we("const ${name} = ${value}",{label:"const",detail:"declaration",type:"keyword"}),we("type ${name} = ${type}",{label:"type",detail:"alias declaration",type:"keyword"}),we("for ${init}; ${test}; ${update} {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),we("for ${i} := range ${value} {\n ${}\n}",{label:"for",detail:"range",type:"keyword"}),we(`select {
|
|
55
|
+
\${}
|
|
56
|
+
}`,{label:"select",detail:"statement",type:"keyword"}),we("case ${}:\n${}",{label:"case",type:"keyword"}),we("switch ${} {\n ${}\n}",{label:"switch",detail:"statement",type:"keyword"}),we("switch ${}.(${type}) {\n ${}\n}",{label:"switch",detail:"type statement",type:"keyword"}),we("if ${} {\n ${}\n}",{label:"if",detail:"block",type:"keyword"}),we(`if \${} {
|
|
57
|
+
\${}
|
|
58
|
+
} else {
|
|
59
|
+
\${}
|
|
60
|
+
}`,{label:"if",detail:"/ else block",type:"keyword"}),we('import ${name} "${module}"\n${}',{label:"import",detail:"declaration",type:"keyword"})],h1=new mm,ev=new Set(["SourceFile","Block","FunctionDecl","MethodDecl","FunctionLiteral","ForStatement","SwitchStatement","TypeSwitchStatement","IfStatement"]);function ms(n,e){return(t,r)=>{e:for(let i=t.node.firstChild,s=0,o=null;;){for(;!i;){if(!s)break e;s--,i=o.nextSibling,o=o.parent}e&&i.name==e||i.name=="SpecList"?(s++,o=i,i=i.firstChild):(i.name=="DefName"&&r(i,n),i=i.nextSibling)}return!0}}const _N={FunctionDecl:ms("function"),VarDecl:ms("var","VarSpec"),ConstDecl:ms("constant","ConstSpec"),TypeDecl:ms("type","TypeSpec"),ImportDecl:ms("constant","ImportSpec"),Parameter:ms("var"),__proto__:null};function tv(n,e){let t=h1.get(e);if(t)return t;let r=[],i=!0;function s(o,a){let l=n.sliceString(o.from,o.to);r.push({label:l,type:a})}return e.cursor(be.IncludeAnonymous).iterate(o=>{if(i)i=!1;else if(o.name){let a=_N[o.name];if(a&&a(o,s)||ev.has(o.name))return!1}else if(o.to-o.from>8192){for(let a of tv(n,o.node))r.push(a);return!1}}),h1.set(e,r),r}const f1=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,nv=["String","LineComment","BlockComment","DefName","LabelName","FieldName",".","?."],BN=n=>{let e=Je(n.state).resolveInner(n.pos,-1);if(nv.indexOf(e.name)>-1)return null;let t=e.name=="VariableName"||e.to-e.from<20&&f1.test(n.state.sliceDoc(e.from,e.to));if(!t&&!n.explicit)return null;let r=[];for(let i=e;i;i=i.parent)ev.has(i.name)&&(r=r.concat(tv(n.state.doc,i)));return{options:r,from:t?e.from:n.pos,validFor:f1}},wh=ns.define({name:"go",parser:WE.configure({props:[dl.add({IfStatement:_s({except:/^\s*({|else\b)/}),LabeledStatement:Pk,"SwitchBlock SelectBlock":n=>{let e=n.textAfter,t=/^\s*\}/.test(e),r=/^\s*(case|default)\b/.test(e);return n.baseIndent+(t||r?0:n.unit)},Block:$k({closing:"}"}),BlockComment:()=>null,Statement:_s({except:/^{/})}),hl.add({"Block SwitchBlock SelectBlock LiteralValue InterfaceType StructType SpecList":Lm,BlockComment(n){return{from:n.from+2,to:n.to-2}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case\b|default\b|\})$/}});let ZN=n=>({label:n,type:"keyword"});const WN="interface struct chan map package go return break continue goto fallthrough else defer range true false nil".split(" ").map(ZN);function zN(){let n=LN.concat(WN);return new gd(wh,[wh.data.of({autocomplete:zk(nv,Bm(n))}),wh.data.of({autocomplete:BN})])}const VN=55,FN=1,qN=56,YN=2,UN=57,GN=3,p1=4,HN=5,Gm=6,rv=7,iv=8,sv=9,ov=10,KN=11,JN=12,e4=13,Qh=58,t4=14,n4=15,m1=59,av=21,r4=23,lv=24,i4=25,lp=27,cv=28,s4=29,o4=32,a4=35,l4=37,c4=38,u4=0,d4=1,h4={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},f4={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},g1={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function p4(n){return n==45||n==46||n==58||n>=65&&n<=90||n==95||n>=97&&n<=122||n>=161}let O1=null,b1=null,y1=0;function cp(n,e){let t=n.pos+e;if(y1==t&&b1==n)return O1;let r=n.peek(e),i="";for(;p4(r);)i+=String.fromCharCode(r),r=n.peek(++e);return b1=n,y1=t,O1=i?i.toLowerCase():r==m4||r==g4?void 0:null}const uv=60,lu=62,Hm=47,m4=63,g4=33,O4=45;function x1(n,e){this.name=n,this.parent=e}const b4=[Gm,ov,rv,iv,sv],y4=new gm({start:null,shift(n,e,t,r){return b4.indexOf(e)>-1?new x1(cp(r,1)||"",n):n},reduce(n,e){return e==av&&n?n.parent:n},reuse(n,e,t,r){let i=e.type.id;return i==Gm||i==l4?new x1(cp(r,1)||"",n):n},strict:!1}),x4=new rn((n,e)=>{if(n.next!=uv){n.next<0&&e.context&&n.acceptToken(Qh);return}n.advance();let t=n.next==Hm;t&&n.advance();let r=cp(n,0);if(r===void 0)return;if(!r)return n.acceptToken(t?n4:t4);let i=e.context?e.context.name:null;if(t){if(r==i)return n.acceptToken(KN);if(i&&f4[i])return n.acceptToken(Qh,-2);if(e.dialectEnabled(u4))return n.acceptToken(JN);for(let s=e.context;s;s=s.parent)if(s.name==r)return;n.acceptToken(e4)}else{if(r=="script")return n.acceptToken(rv);if(r=="style")return n.acceptToken(iv);if(r=="textarea")return n.acceptToken(sv);if(h4.hasOwnProperty(r))return n.acceptToken(ov);i&&g1[i]&&g1[i][r]?n.acceptToken(Qh,-1):n.acceptToken(Gm)}},{contextual:!0}),S4=new rn(n=>{for(let e=0,t=0;;t++){if(n.next<0){t&&n.acceptToken(m1);break}if(n.next==O4)e++;else if(n.next==lu&&e>=2){t>=3&&n.acceptToken(m1,-2);break}else e=0;n.advance()}});function k4(n){for(;n;n=n.parent)if(n.name=="svg"||n.name=="math")return!0;return!1}const v4=new rn((n,e)=>{if(n.next==Hm&&n.peek(1)==lu){let t=e.dialectEnabled(d4)||k4(e.context);n.acceptToken(t?HN:p1,2)}else n.next==lu&&n.acceptToken(p1,1)});function Km(n,e,t){let r=2+n.length;return new rn(i=>{for(let s=0,o=0,a=0;;a++){if(i.next<0){a&&i.acceptToken(e);break}if(s==0&&i.next==uv||s==1&&i.next==Hm||s>=2&&s<r&&i.next==n.charCodeAt(s-2))s++,o++;else if(s==r&&i.next==lu){a>o?i.acceptToken(e,-o):i.acceptToken(t,-(o-2));break}else if((i.next==10||i.next==13)&&a){i.acceptToken(e,1);break}else s=o=0;i.advance()}})}const w4=Km("script",VN,FN),Q4=Km("style",qN,YN),$4=Km("textarea",UN,GN),C4=sl({"Text RawText IncompleteTag IncompleteCloseTag":u.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":u.angleBracket,TagName:u.tagName,"MismatchedCloseTag/TagName":[u.tagName,u.invalid],AttributeName:u.attributeName,"AttributeValue UnquotedAttributeValue":u.attributeValue,Is:u.definitionOperator,"EntityReference CharacterReference":u.character,Comment:u.blockComment,ProcessingInst:u.processingInstruction,DoctypeDecl:u.documentMeta}),P4=Ki.deserialize({version:14,states:",xOVO!rOOO!ZQ#tO'#CrO!`Q#tO'#C{O!eQ#tO'#DOO!jQ#tO'#DRO!oQ#tO'#DTO!tOaO'#CqO#PObO'#CqO#[OdO'#CqO$kO!rO'#CqOOO`'#Cq'#CqO$rO$fO'#DUO$zQ#tO'#DWO%PQ#tO'#DXOOO`'#Dl'#DlOOO`'#DZ'#DZQVO!rOOO%UQ&rO,59^O%aQ&rO,59gO%lQ&rO,59jO%wQ&rO,59mO&SQ&rO,59oOOOa'#D_'#D_O&_OaO'#CyO&jOaO,59]OOOb'#D`'#D`O&rObO'#C|O&}ObO,59]OOOd'#Da'#DaO'VOdO'#DPO'bOdO,59]OOO`'#Db'#DbO'jO!rO,59]O'qQ#tO'#DSOOO`,59],59]OOOp'#Dc'#DcO'vO$fO,59pOOO`,59p,59pO(OQ#|O,59rO(TQ#|O,59sOOO`-E7X-E7XO(YQ&rO'#CtOOQW'#D['#D[O(hQ&rO1G.xOOOa1G.x1G.xOOO`1G/Z1G/ZO(sQ&rO1G/ROOOb1G/R1G/RO)OQ&rO1G/UOOOd1G/U1G/UO)ZQ&rO1G/XOOO`1G/X1G/XO)fQ&rO1G/ZOOOa-E7]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ob!xOc!xOd!xO!c!{O!d!xO~OT~cbd!ey|!e~",goto:"%q!aPPPPPPPPPPPPPPPPPPPPP!b!hP!nPP!zP!}#Q#T#Z#^#a#g#j#m#s#y!bP!b!bP$P$V$m$s$y%P%V%]%cPPPPPPPP%iX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:68,context:y4,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,22,31,34,37,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,30,33,36,38,"OpenTag"],["group",-10,14,15,18,19,20,21,40,41,42,43,"Entity",17,"Entity TextContent",-3,29,32,35,"TextContent Entity"],["isolate",-11,22,30,31,33,34,36,37,38,39,42,43,"ltr",-3,27,28,40,""]],propSources:[C4],skippedNodes:[0],repeatNodeCount:9,tokenData:"!<p!aR!YOX$qXY,QYZ,QZ[$q[]&X]^,Q^p$qpq,Qqr-_rs3_sv-_vw3}wxHYx}-_}!OH{!O!P-_!P!Q$q!Q![-_![!]Mz!]!^-_!^!_!$S!_!`!;x!`!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1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ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!b`!dpyPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!<TXjSaP!b`!dpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X",tokenizers:[w4,Q4,$4,v4,x4,S4,0,1,2,3,4,5],topRules:{Document:[0,16]},dialects:{noMatch:0,selfClosing:515},tokenPrec:517});function dv(n,e){let t=Object.create(null);for(let r of n.getChildren(lv)){let i=r.getChild(i4),s=r.getChild(lp)||r.getChild(cv);i&&(t[e.read(i.from,i.to)]=s?s.type.id==lp?e.read(s.from+1,s.to-1):e.read(s.from,s.to):"")}return t}function S1(n,e){let t=n.getChild(r4);return t?e.read(t.from,t.to):" "}function $h(n,e,t){let r;for(let i of t)if(!i.attrs||i.attrs(r||(r=dv(n.node.parent.firstChild,e))))return{parser:i.parser,bracketed:!0};return null}function hv(n=[],e=[]){let t=[],r=[],i=[],s=[];for(let a of n)(a.tag=="script"?t:a.tag=="style"?r:a.tag=="textarea"?i:s).push(a);let o=e.length?Object.create(null):null;for(let a of e)(o[a.name]||(o[a.name]=[])).push(a);return f5((a,l)=>{let c=a.type.id;if(c==s4)return $h(a,l,t);if(c==o4)return $h(a,l,r);if(c==a4)return $h(a,l,i);if(c==av&&s.length){let d=a.node,h=d.firstChild,f=h&&S1(h,l),p;if(f){for(let m of s)if(m.tag==f&&(!m.attrs||m.attrs(p||(p=dv(h,l))))){let O=d.lastChild,b=O.type.id==c4?O.from:d.to;if(b>h.to)return{parser:m.parser,overlay:[{from:h.to,to:b}]}}}}if(o&&c==lv){let d=a.node,h;if(h=d.firstChild){let f=o[l.read(h.from,h.to)];if(f)for(let p of f){if(p.tagName&&p.tagName!=S1(d.parent,l))continue;let m=d.lastChild;if(m.type.id==lp){let O=m.from+1,b=m.lastChild,y=m.to-(b&&b.isError?0:1);if(y>O)return{parser:p.parser,overlay:[{from:O,to:y}],bracketed:!0}}else if(m.type.id==cv)return{parser:p.parser,overlay:[{from:m.from,to:m.to}]}}}}return null})}const T4=317,M4=318,k1=1,A4=2,R4=3,E4=4,N4=319,D4=321,j4=322,I4=5,X4=6,L4=0,up=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],fv=125,_4=59,dp=47,B4=42,Z4=43,W4=45,z4=60,V4=44,F4=63,q4=46,Y4=91,U4=new gm({start:!1,shift(n,e){return e==I4||e==X4||e==D4?n:e==j4},strict:!1}),G4=new rn((n,e)=>{let{next:t}=n;(t==fv||t==-1||e.context)&&n.acceptToken(N4)},{contextual:!0,fallback:!0}),H4=new rn((n,e)=>{let{next:t}=n,r;up.indexOf(t)>-1||t==dp&&((r=n.peek(1))==dp||r==B4)||t!=fv&&t!=_4&&t!=-1&&!e.context&&n.acceptToken(T4)},{contextual:!0}),K4=new rn((n,e)=>{n.next==Y4&&!e.context&&n.acceptToken(M4)},{contextual:!0}),J4=new rn((n,e)=>{let{next:t}=n;if(t==Z4||t==W4){if(n.advance(),t==n.next){n.advance();let r=!e.context&&e.canShift(k1);n.acceptToken(r?k1:A4)}}else t==F4&&n.peek(1)==q4&&(n.advance(),n.advance(),(n.next<48||n.next>57)&&n.acceptToken(R4))},{contextual:!0});function Ch(n,e){return n>=65&&n<=90||n>=97&&n<=122||n==95||n>=192||!e&&n>=48&&n<=57}const eD=new rn((n,e)=>{if(n.next!=z4||!e.dialectEnabled(L4)||(n.advance(),n.next==dp))return;let t=0;for(;up.indexOf(n.next)>-1;)n.advance(),t++;if(Ch(n.next,!0)){for(n.advance(),t++;Ch(n.next,!1);)n.advance(),t++;for(;up.indexOf(n.next)>-1;)n.advance(),t++;if(n.next==V4)return;for(let r=0;;r++){if(r==7){if(!Ch(n.next,!0))return;break}if(n.next!="extends".charCodeAt(r))break;n.advance(),t++}}n.acceptToken(E4,-t)}),tD=sl({"get set async static":u.modifier,"for while do if else switch try catch finally return throw break continue default case defer":u.controlKeyword,"in of await yield void typeof delete instanceof as satisfies":u.operatorKeyword,"let var const using function class extends":u.definitionKeyword,"import export from":u.moduleKeyword,"with debugger new":u.keyword,TemplateString:u.special(u.string),super:u.atom,BooleanLiteral:u.bool,this:u.self,null:u.null,Star:u.modifier,VariableName:u.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":u.function(u.variableName),VariableDefinition:u.definition(u.variableName),Label:u.labelName,PropertyName:u.propertyName,PrivatePropertyName:u.special(u.propertyName),"CallExpression/MemberExpression/PropertyName":u.function(u.propertyName),"FunctionDeclaration/VariableDefinition":u.function(u.definition(u.variableName)),"ClassDeclaration/VariableDefinition":u.definition(u.className),"NewExpression/VariableName":u.className,PropertyDefinition:u.definition(u.propertyName),PrivatePropertyDefinition:u.definition(u.special(u.propertyName)),UpdateOp:u.updateOperator,"LineComment Hashbang":u.lineComment,BlockComment:u.blockComment,Number:u.number,String:u.string,Escape:u.escape,ArithOp:u.arithmeticOperator,LogicOp:u.logicOperator,BitOp:u.bitwiseOperator,CompareOp:u.compareOperator,RegExp:u.regexp,Equals:u.definitionOperator,Arrow:u.function(u.punctuation),": Spread":u.punctuation,"( )":u.paren,"[ ]":u.squareBracket,"{ }":u.brace,"InterpolationStart InterpolationEnd":u.special(u.brace),".":u.derefOperator,", ;":u.separator,"@":u.meta,TypeName:u.typeName,TypeDefinition:u.definition(u.typeName),"type enum interface implements namespace module declare":u.definitionKeyword,"abstract global Privacy readonly override":u.modifier,"is keyof unique infer asserts":u.operatorKeyword,JSXAttributeValue:u.attributeValue,JSXText:u.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":u.angleBracket,"JSXIdentifier JSXNameSpacedName":u.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":u.attributeName,"JSXBuiltin/JSXIdentifier":u.standard(u.tagName)}),nD={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,in:52,out:55,const:56,extends:60,this:64,true:72,false:72,null:84,void:88,typeof:92,super:108,new:142,delete:154,yield:163,await:167,class:172,public:237,private:237,protected:237,readonly:239,instanceof:258,satisfies:261,import:294,keyof:351,unique:355,infer:361,asserts:397,is:399,abstract:419,implements:421,type:423,let:426,var:428,using:431,interface:437,enum:441,namespace:447,module:449,declare:453,global:457,defer:473,for:478,of:487,while:490,with:494,do:498,if:502,else:504,switch:508,case:514,try:520,catch:524,finally:528,return:532,throw:536,break:540,continue:544,debugger:548},rD={__proto__:null,async:129,get:131,set:133,declare:195,public:197,private:197,protected:197,static:199,abstract:201,override:203,readonly:209,accessor:211,new:403},iD={__proto__:null,"<":193},sD=Ki.deserialize({version:14,states:"$GSQ%TQlOOO%[QlOOO'_QpOOP(lO`OOO*zQ!0MxO'#CiO+RO#tO'#CjO+aO&jO'#CjO+oO#@ItO'#DaO.QQlO'#DgO.bQlO'#DrO%[QlO'#DzO0fQlO'#ESOOQ!0Lf'#E['#E[O1PQ`O'#EXOOQO'#Ep'#EpOOQO'#Im'#ImO1XQ`O'#GtO1dQ`O'#EoO1iQ`O'#EoO3hQ!0MxO'#JsO6[Q!0MxO'#JtO6uQ`O'#F^O6zQ,UO'#FuOOQ!0Lf'#Fg'#FgO7VO7dO'#FgO9XQMhO'#F}O9`Q`O'#F|OOQ!0Lf'#Jt'#JtOOQ!0Lb'#Js'#JsO9eQ`O'#GxOOQ['#K`'#K`O9pQ`O'#IZO9uQ!0LrO'#I[OOQ['#Ja'#JaOOQ['#I`'#I`Q`QlOOQ`QlOOO9}Q!L^O'#DvO:UQlO'#EOO:]QlO'#EQO9kQ`O'#GtO:dQMhO'#CoO:rQ`O'#EnO:}Q`O'#EzO;hQMhO'#FfO;xQ`O'#GtOOQO'#Ka'#KaO;}Q`O'#KaO<]Q`O'#G|O<]Q`O'#G}O<]Q`O'#HPO9kQ`O'#HSO=SQ`O'#HVO>kQ`O'#CeO>{Q`O'#HdO?TQ`O'#HjO?TQ`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%ba[%baa%baj%bar%ba!S%ba!l%ba!p%ba#R%ba#o%ba#p%ba#q%ba#r%ba#s%ba#t%ba#u%ba#v%ba#w%ba#y%ba#{%ba#|%ba'{%ba(b%ba(s%ba!k%ba!Y%ba'x%bav%ba!_%ba%j%ba!g%ba~P#L{O#l%daP%daR%da[%daa%daj%dar%da!S%da!l%da!p%da#R%da#o%da#p%da#q%da#r%da#s%da#t%da#u%da#v%da#w%da#y%da#{%da#|%da'{%da(b%da(s%da!k%da!Y%da'x%dav%da!_%da%j%da!g%da~P#MnO#l%baP%baR%ba[%baa%baj%bar%ba!S%ba!]%ba!l%ba!p%ba#R%ba#o%ba#p%ba#q%ba#r%ba#s%ba#t%ba#u%ba#v%ba#w%ba#y%ba#{%ba#|%ba'{%ba(b%ba(s%ba!k%ba!Y%ba'x%ba#`%bav%ba!_%ba%j%ba!g%ba~P#/sO#l%daP%daR%da[%daa%daj%dar%da!S%da!]%da!l%da!p%da#R%da#o%da#p%da#q%da#r%da#s%da#t%da#u%da#v%da#w%da#y%da#{%da#|%da'{%da(b%da(s%da!k%da!Y%da'x%da#`%dav%da!_%da%j%da!g%da~P#/sO#l}aP}a[}aa}aj}ar}a!l}a!p}a#R}a#o}a#p}a#q}a#r}a#s}a#t}a#u}a#v}a#w}a#y}a#{}a#|}a'{}a(b}a(s}a!k}a!Y}a'x}av}a!_}a%j}a!g}a~P$(cO#l$taP$taR$ta[$taa$taj$tar$ta!S$ta!l$ta!p$ta#R$ta#o$ta#p$ta#q$ta#r$ta#s$ta#t$ta#u$ta#v$ta#w$ta#y$ta#{$ta#|$ta'{$ta(b$ta(s$ta!k$ta!Y$ta'x$tav$ta!_$ta%j$ta!g$ta~P$)_O#l$vaP$vaR$va[$vaa$vaj$var$va!S$va!l$va!p$va#R$va#o$va#p$va#q$va#r$va#s$va#t$va#u$va#v$va#w$va#y$va#{$va#|$va'{$va(b$va(s$va!k$va!Y$va'x$vav$va!_$va%j$va!g$va~P$*QO#l%UaP%UaR%Ua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&U|S,P&V&WR1`,QR+u&PT&p!W&sT&q!W&sT2`,z2a",nodeNames:"⚠ ArithOp ArithOp ?. JSXStartTag LineComment BlockComment Script Hashbang ExportDeclaration export Star as VariableName String Escape from ; default FunctionDeclaration async function VariableDefinition > < TypeParamList in out const TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty VariableDefinition Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast < ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate asserts is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration defer ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:381,context:U4,nodeProps:[["isolate",-8,5,6,14,37,39,51,53,55,""],["group",-26,9,17,19,68,208,212,216,217,219,222,225,235,238,244,246,248,250,253,259,265,267,269,271,273,275,276,"Statement",-34,13,14,32,35,36,42,51,54,55,57,62,70,72,76,80,82,84,85,110,111,121,122,137,140,142,143,144,145,146,148,149,168,170,172,"Expression",-23,31,33,37,41,43,45,174,176,178,179,181,182,183,185,186,187,189,190,191,202,204,206,207,"Type",-3,88,103,109,"ClassItem"],["openedBy",23,"<",38,"InterpolationStart",56,"[",60,"{",73,"(",161,"JSXStartCloseTag"],["closedBy",-2,24,169,">",40,"InterpolationEnd",50,"]",61,"}",74,")",166,"JSXEndTag"]],propSources:[tD],skippedNodes:[0,5,6,279],repeatNodeCount:37,tokenData:"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8b#o#p$<r#p#q$=h#q#r$>x#r#s$@U#s$f%Z$f$g+g$g#BYEr#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(O0/l$^#t(U,2j(f$I[OY%ZYZ&cZr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr",tokenizers:[H4,K4,J4,eD,2,3,4,5,6,7,8,9,10,11,12,13,14,G4,new $a("$S~RRtu[#O#Pg#S#T#|~_P#o#pb~gOx~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!U~~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(d~~",141,341),new $a("j~RQYZXz{^~^O(R~~aP!P!Qd~iO(S~~",25,324)],topRules:{Script:[0,7],SingleExpression:[1,277],SingleClassItem:[2,278]},dialects:{jsx:0,ts:15179},dynamicPrecedences:{80:1,82:1,94:1,170:1,200:1},specialized:[{term:328,get:n=>nD[n]||-1},{term:344,get:n=>rD[n]||-1},{term:95,get:n=>iD[n]||-1}],tokenPrec:15205}),pv=[we("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),we("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),we("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),we("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),we("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),we(`try {
|
|
61
|
+
\${}
|
|
62
|
+
} catch (\${error}) {
|
|
63
|
+
\${}
|
|
64
|
+
}`,{label:"try",detail:"/ catch block",type:"keyword"}),we("if (${}) {\n ${}\n}",{label:"if",detail:"block",type:"keyword"}),we(`if (\${}) {
|
|
65
|
+
\${}
|
|
66
|
+
} else {
|
|
67
|
+
\${}
|
|
68
|
+
}`,{label:"if",detail:"/ else block",type:"keyword"}),we(`class \${name} {
|
|
69
|
+
constructor(\${params}) {
|
|
70
|
+
\${}
|
|
71
|
+
}
|
|
72
|
+
}`,{label:"class",detail:"definition",type:"keyword"}),we('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),we('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],oD=pv.concat([we("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),we("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),we("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),v1=new mm,mv=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function Po(n){return(e,t)=>{let r=e.node.getChild("VariableDefinition");return r&&t(r,n),!0}}const aD=["FunctionDeclaration"],lD={FunctionDeclaration:Po("function"),ClassDeclaration:Po("class"),ClassExpression:()=>!0,EnumDeclaration:Po("constant"),TypeAliasDeclaration:Po("type"),NamespaceDeclaration:Po("namespace"),VariableDefinition(n,e){n.matchContext(aD)||e(n,"variable")},TypeDefinition(n,e){e(n,"type")},__proto__:null};function gv(n,e){let t=v1.get(e);if(t)return t;let r=[],i=!0;function s(o,a){let l=n.sliceString(o.from,o.to);r.push({label:l,type:a})}return e.cursor(be.IncludeAnonymous).iterate(o=>{if(i)i=!1;else if(o.name){let a=lD[o.name];if(a&&a(o,s)||mv.has(o.name))return!1}else if(o.to-o.from>8192){for(let a of gv(n,o.node))r.push(a);return!1}}),v1.set(e,r),r}const w1=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,Ov=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function cD(n){let e=Je(n.state).resolveInner(n.pos,-1);if(Ov.indexOf(e.name)>-1)return null;let t=e.name=="VariableName"||e.to-e.from<20&&w1.test(n.state.sliceDoc(e.from,e.to));if(!t&&!n.explicit)return null;let r=[];for(let i=e;i;i=i.parent)mv.has(i.name)&&(r=r.concat(gv(n.state.doc,i)));return{options:r,from:t?e.from:n.pos,validFor:w1}}const ur=ns.define({name:"javascript",parser:sD.configure({props:[dl.add({IfStatement:_s({except:/^\s*({|else\b)/}),TryStatement:_s({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:Pk,SwitchBody:n=>{let e=n.textAfter,t=/^\s*\}/.test(e),r=/^\s*(case|default)\b/.test(e);return n.baseIndent+(t?0:r?1:2)*n.unit},Block:$k({closing:"}"}),ArrowFunction:n=>n.baseIndent+n.unit,"TemplateString BlockComment":()=>null,"Statement Property":_s({except:/^\s*{/}),JSXElement(n){let e=/^\s*<\//.test(n.textAfter);return n.lineIndent(n.node.from)+(e?0:n.unit)},JSXEscape(n){let e=/\s*\}/.test(n.textAfter);return n.lineIndent(n.node.from)+(e?0:n.unit)},"JSXOpenTag JSXSelfClosingTag"(n){return n.column(n.node.from)+n.unit}}),hl.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":Lm,BlockComment(n){return{from:n.from+2,to:n.to-2}},JSXElement(n){let e=n.firstChild;if(!e||e.name=="JSXSelfClosingTag")return null;let t=n.lastChild;return{from:e.to,to:t.type.isError?n.to:t.from}},"JSXSelfClosingTag JSXOpenTag"(n){var e;let t=(e=n.firstChild)===null||e===void 0?void 0:e.nextSibling,r=n.lastChild;return!t||t.type.isError?null:{from:t.to,to:r.type.isError?n.to:r.from}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),bv={test:n=>/^JSX/.test(n.name),facet:vk({commentTokens:{block:{open:"{/*",close:"*/}"}}})},yv=ur.configure({dialect:"ts"},"typescript"),xv=ur.configure({dialect:"jsx",props:[jm.add(n=>n.isTop?[bv]:void 0)]}),Sv=ur.configure({dialect:"jsx ts",props:[jm.add(n=>n.isTop?[bv]:void 0)]},"typescript");let kv=n=>({label:n,type:"keyword"});const vv="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(kv),uD=vv.concat(["declare","implements","private","protected","public"].map(kv));function dD(n={}){let e=n.jsx?n.typescript?Sv:xv:n.typescript?yv:ur,t=n.typescript?oD.concat(uD):pv.concat(vv);return new gd(e,[ur.data.of({autocomplete:zk(Ov,Bm(t))}),ur.data.of({autocomplete:cD}),n.jsx?pD:[]])}function hD(n){for(;;){if(n.name=="JSXOpenTag"||n.name=="JSXSelfClosingTag"||n.name=="JSXFragmentTag")return n;if(n.name=="JSXEscape"||!n.parent)return null;n=n.parent}}function Q1(n,e,t=n.length){for(let r=e?.firstChild;r;r=r.nextSibling)if(r.name=="JSXIdentifier"||r.name=="JSXBuiltin"||r.name=="JSXNamespacedName"||r.name=="JSXMemberExpression")return n.sliceString(r.from,Math.min(r.to,t));return""}const fD=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),pD=X.inputHandler.of((n,e,t,r,i)=>{if((fD?n.composing:n.compositionStarted)||n.state.readOnly||e!=t||r!=">"&&r!="/"||!ur.isActiveAt(n.state,e,-1))return!1;let s=i(),{state:o}=s,a=o.changeByRange(l=>{var c;let{head:d}=l,h=Je(o).resolveInner(d-1,-1),f;if(h.name=="JSXStartTag"&&(h=h.parent),!(o.doc.sliceString(d-1,d)!=r||h.name=="JSXAttributeValue"&&h.to>d)){if(r==">"&&h.name=="JSXFragmentTag")return{range:l,changes:{from:d,insert:"</>"}};if(r=="/"&&h.name=="JSXStartCloseTag"){let p=h.parent,m=p.parent;if(m&&p.from==d-2&&((f=Q1(o.doc,m.firstChild,d))||((c=m.firstChild)===null||c===void 0?void 0:c.name)=="JSXFragmentTag")){let O=`${f}>`;return{range:A.cursor(d+O.length,-1),changes:{from:d,insert:O}}}}else if(r==">"){let p=hD(h);if(p&&p.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(o.doc.sliceString(d,d+2))&&(f=Q1(o.doc,p,d)))return{range:l,changes:{from:d,insert:`</${f}>`}}}}return{range:l}});return a.changes.empty?!1:(n.dispatch([s,o.update(a,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),To=["_blank","_self","_top","_parent"],Ph=["ascii","utf-8","utf-16","latin1","latin1"],Th=["get","post","put","delete"],Mh=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],ln=["true","false"],q={},mD={a:{attrs:{href:null,ping:null,type:null,media:null,target:To,hreflang:null}},abbr:q,address:q,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:q,aside:q,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:q,base:{attrs:{href:null,target:To}},bdi:q,bdo:q,blockquote:{attrs:{cite:null}},body:q,br:q,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:Mh,formmethod:Th,formnovalidate:["novalidate"],formtarget:To,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:q,center:q,cite:q,code:q,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:q,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:q,div:q,dl:q,dt:q,em:q,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:q,figure:q,footer:q,form:{attrs:{action:null,name:null,"accept-charset":Ph,autocomplete:["on","off"],enctype:Mh,method:Th,novalidate:["novalidate"],target:To}},h1:q,h2:q,h3:q,h4:q,h5:q,h6:q,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:q,hgroup:q,hr:q,html:{attrs:{manifest:null}},i:q,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:Mh,formmethod:Th,formnovalidate:["novalidate"],formtarget:To,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:q,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:q,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:q,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:Ph,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:q,noscript:q,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:q,param:{attrs:{name:null,value:null}},pre:q,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:q,rt:q,ruby:q,samp:q,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:Ph}},section:q,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:q,source:{attrs:{src:null,type:null,media:null}},span:q,strong:q,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:q,summary:q,sup:q,table:q,tbody:q,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:q,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:q,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:q,time:{attrs:{datetime:null}},title:q,tr:q,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:q,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:q},wv={accesskey:null,class:null,contenteditable:ln,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:ln,autocorrect:ln,autocapitalize:ln,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":ln,"aria-autocomplete":["inline","list","both","none"],"aria-busy":ln,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":ln,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":ln,"aria-hidden":ln,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":ln,"aria-multiselectable":ln,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":ln,"aria-relevant":null,"aria-required":ln,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},Qv="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(n=>"on"+n);for(let n of Qv)wv[n]=null;let cu=class{constructor(e,t){this.tags={...mD,...e},this.globalAttrs={...wv,...t},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}};cu.default=new cu;function is(n,e,t=n.length){if(!e)return"";let r=e.firstChild,i=r&&r.getChild("TagName");return i?n.sliceString(i.from,Math.min(i.to,t)):""}function to(n,e=!1){for(;n;n=n.parent)if(n.name=="Element")if(e)e=!1;else return n;return null}function $v(n,e,t){let r=t.tags[is(n,to(e))];return r?.children||t.allTags}function Jm(n,e){let t=[];for(let r=to(e);r&&!r.type.isTop;r=to(r.parent)){let i=is(n,r);if(i&&r.lastChild.name=="CloseTag")break;i&&t.indexOf(i)<0&&(e.name=="EndTag"||e.from>=r.firstChild.to)&&t.push(i)}return t}const Cv=/^[:\-\.\w\u00b7-\uffff]*$/;function $1(n,e,t,r,i){let s=/\s*>/.test(n.sliceDoc(i,i+5))?"":">",o=to(t,t.name=="StartTag"||t.name=="TagName");return{from:r,to:i,options:$v(n.doc,o,e).map(a=>({label:a,type:"type"})).concat(Jm(n.doc,t).map((a,l)=>({label:"/"+a,apply:"/"+a+s,type:"type",boost:99-l}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function C1(n,e,t,r){let i=/\s*>/.test(n.sliceDoc(r,r+5))?"":">";return{from:t,to:r,options:Jm(n.doc,e).map((s,o)=>({label:s,apply:s+i,type:"type",boost:99-o})),validFor:Cv}}function gD(n,e,t,r){let i=[],s=0;for(let o of $v(n.doc,t,e))i.push({label:"<"+o,type:"type"});for(let o of Jm(n.doc,t))i.push({label:"</"+o+">",type:"type",boost:99-s++});return{from:r,to:r,options:i,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function OD(n,e,t,r,i){let s=to(t),o=s?e.tags[is(n.doc,s)]:null,a=o&&o.attrs?Object.keys(o.attrs):[],l=o&&o.globalAttrs===!1?a:a.length?a.concat(e.globalAttrNames):e.globalAttrNames;return{from:r,to:i,options:l.map(c=>({label:c,type:"property"})),validFor:Cv}}function bD(n,e,t,r,i){var s;let o=(s=t.parent)===null||s===void 0?void 0:s.getChild("AttributeName"),a=[],l;if(o){let c=n.sliceDoc(o.from,o.to),d=e.globalAttrs[c];if(!d){let h=to(t),f=h?e.tags[is(n.doc,h)]:null;d=f?.attrs&&f.attrs[c]}if(d){let h=n.sliceDoc(r,i).toLowerCase(),f='"',p='"';/^['"]/.test(h)?(l=h[0]=='"'?/^[^"]*$/:/^[^']*$/,f="",p=n.sliceDoc(i,i+1)==h[0]?"":h[0],h=h.slice(1),r++):l=/^[^\s<>='"]*$/;for(let m of d)a.push({label:m,apply:f+m+p,type:"constant"})}}return{from:r,to:i,options:a,validFor:l}}function yD(n,e){let{state:t,pos:r}=e,i=Je(t).resolveInner(r,-1),s=i.resolve(r);for(let o=r,a;s==i&&(a=i.childBefore(o));){let l=a.lastChild;if(!l||!l.type.isError||l.from<l.to)break;s=i=a,o=l.from}return i.name=="TagName"?i.parent&&/CloseTag$/.test(i.parent.name)?C1(t,i,i.from,r):$1(t,n,i,i.from,r):i.name=="StartTag"||i.name=="IncompleteTag"?$1(t,n,i,r,r):i.name=="StartCloseTag"||i.name=="IncompleteCloseTag"?C1(t,i,r,r):i.name=="OpenTag"||i.name=="SelfClosingTag"||i.name=="AttributeName"?OD(t,n,i,i.name=="AttributeName"?i.from:r,r):i.name=="Is"||i.name=="AttributeValue"||i.name=="UnquotedAttributeValue"?bD(t,n,i,i.name=="Is"?r:i.from,r):e.explicit&&(s.name=="Element"||s.name=="Text"||s.name=="Document")?gD(t,n,i,r):null}function xD(n){let{extraTags:e,extraGlobalAttributes:t}=n,r=t||e?new cu(e,t):cu.default;return i=>yD(r,i)}const SD=ur.parser.configure({top:"SingleExpression"}),Pv=[{tag:"script",attrs:n=>n.type=="text/typescript"||n.lang=="ts",parser:yv.parser},{tag:"script",attrs:n=>n.type=="text/babel"||n.type=="text/jsx",parser:xv.parser},{tag:"script",attrs:n=>n.type=="text/typescript-jsx",parser:Sv.parser},{tag:"script",attrs(n){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(n.type)},parser:SD},{tag:"script",attrs(n){return!n.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(n.type)},parser:ur.parser},{tag:"style",attrs(n){return(!n.lang||n.lang=="css")&&(!n.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(n.type))},parser:su.parser}],Tv=[{name:"style",parser:su.parser.configure({top:"Styles"})}].concat(Qv.map(n=>({name:n,parser:ur.parser}))),Mv=ns.define({name:"html",parser:P4.configure({props:[dl.add({Element(n){let e=/^(\s*)(<\/)?/.exec(n.textAfter);return n.node.to<=n.pos+e[0].length?n.continue():n.lineIndent(n.node.from)+(e[2]?0:n.unit)},"OpenTag CloseTag SelfClosingTag"(n){return n.column(n.node.from)+n.unit},Document(n){if(n.pos+/\s*/.exec(n.textAfter)[0].length<n.node.to)return n.continue();let e=null,t;for(let r=n.node;;){let i=r.lastChild;if(!i||i.name!="Element"||i.to!=r.to)break;e=r=i}return e&&!((t=e.lastChild)&&(t.name=="CloseTag"||t.name=="SelfClosingTag"))?n.lineIndent(e.from)+n.unit:null}}),hl.add({Element(n){let e=n.firstChild,t=n.lastChild;return!e||e.name!="OpenTag"?null:{from:e.to,to:t.name=="CloseTag"?t.from:n.to}}}),_k.add({"OpenTag CloseTag":n=>n.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"<!--",close:"-->"}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),Tc=Mv.configure({wrap:hv(Pv,Tv)});function kD(n={}){let e="",t;n.matchClosingTags===!1&&(e="noMatch"),n.selfClosingTags===!0&&(e=(e?e+" ":"")+"selfClosing"),(n.nestedLanguages&&n.nestedLanguages.length||n.nestedAttributes&&n.nestedAttributes.length)&&(t=hv((n.nestedLanguages||[]).concat(Pv),(n.nestedAttributes||[]).concat(Tv)));let r=t?Mv.configure({wrap:t,dialect:e}):e?Tc.configure({dialect:e}):Tc;return new gd(r,[Tc.data.of({autocomplete:xD(n)}),n.autoCloseTags!==!1?wD:[],dD().support,Zk().support])}const P1=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" "));function vD(n,e,t){for(var r;;){if(((r=e.lastChild)===null||r===void 0?void 0:r.name)!="CloseTag")return!1;let i=e.parent;if(!i||is(n,i)!=t)return!0;e=i}}const wD=X.inputHandler.of((n,e,t,r,i)=>{if(n.composing||n.state.readOnly||e!=t||r!=">"&&r!="/"||!Tc.isActiveAt(n.state,e,-1))return!1;let s=i(),{state:o}=s,a=o.changeByRange(l=>{var c;let d=o.doc.sliceString(l.from-1,l.to)==r,{head:h}=l,f=Je(o).resolveInner(h,-1),p;if(d&&r==">"&&f.name=="EndTag"){let m=f.parent;if((p=is(o.doc,m.parent,h))&&!P1.has(p)&&!vD(o.doc,m.parent,p)){let O=h+(o.doc.sliceString(h,h+1)===">"?1:0),b=`</${p}>`;return{range:l,changes:{from:h,to:O,insert:b}}}}else if(d&&r=="/"&&f.name=="IncompleteCloseTag"){let m=f.parent;if(f.from==h-2&&((c=m.lastChild)===null||c===void 0?void 0:c.name)!="CloseTag"&&(p=is(o.doc,m,h))&&!P1.has(p)){let O=h+(o.doc.sliceString(h,h+1)===">"?1:0),b=`${p}>`;return{range:A.cursor(h+b.length,-1),changes:{from:h,to:O,insert:b}}}}return{range:l}});return a.changes.empty?!1:(n.dispatch([s,o.update(a,{userEvent:"input.complete",scrollIntoView:!0})]),!0)});var ae=n=>{var e=n.theme,t=n.settings,r=t===void 0?{}:t,i=n.styles,s=i===void 0?[]:i,o={".cm-gutters":{}},a={};r.background&&(a.backgroundColor=r.background),r.backgroundImage&&(a.backgroundImage=r.backgroundImage),r.foreground&&(a.color=r.foreground),r.fontSize&&(a.fontSize=r.fontSize),(r.background||r.foreground)&&(o["&"]=a),r.fontFamily&&(o["&.cm-editor .cm-scroller"]={fontFamily:r.fontFamily}),r.gutterBackground&&(o[".cm-gutters"].backgroundColor=r.gutterBackground),r.gutterForeground&&(o[".cm-gutters"].color=r.gutterForeground),r.gutterBorder&&(o[".cm-gutters"].borderRightColor=r.gutterBorder),r.caret&&(o[".cm-content"]={caretColor:r.caret},o[".cm-cursor, .cm-dropCursor"]={borderLeftColor:r.caret});var l={};r.gutterActiveForeground&&(l.color=r.gutterActiveForeground),r.lineHighlight&&(o[".cm-activeLine"]={backgroundColor:r.lineHighlight},l.backgroundColor=r.lineHighlight),o[".cm-activeLineGutter"]=l,r.selection&&(o["&.cm-focused .cm-selectionBackground, & .cm-line::selection, & .cm-selectionLayer .cm-selectionBackground, .cm-content ::selection"]={background:r.selection+" !important"}),r.selectionMatch&&(o["& .cm-selectionMatch"]={backgroundColor:r.selectionMatch});var c=X.theme(o,{dark:e==="dark"}),d=mo.define(s),h=[c,_m(d)];return h},QD={background:"#0f0f0f",foreground:"#defdef",caret:"#00FF00",selection:"#515151",selectionMatch:"#515151",gutterBackground:"#555",gutterForeground:"#FFFFFF",lineHighlight:"#0a6bcb3d"},$D=[{tag:u.keyword,color:"darkgoldenrod",fontWeight:"bold"},{tag:u.atom,color:"#77F"},{tag:u.comment,color:"#7a7b7c",fontStyle:"italic"},{tag:u.number,color:"violet"},{tag:u.definition(u.variableName),color:"#fffabc"},{tag:u.variableName,color:"#abcdef"},{tag:u.function(u.variableName),color:"#fffabc"},{tag:u.typeName,color:"#FFDD44"},{tag:u.tagName,color:"#def"},{tag:u.string,color:"#2b4"},{tag:u.meta,color:"#C9F"},{tag:u.bracket,color:"#8a8a8a"},{tag:u.attributeName,color:"#DDFF00"},{tag:u.heading,color:"aquamarine",fontWeight:"bold"},{tag:u.link,color:"blueviolet",fontWeight:"bold"}],CD=n=>{var e={},t=e.theme,r=t===void 0?"dark":t,i=e.settings,s=i===void 0?{}:i,o=e.styles,a=o===void 0?[]:o;return ae({theme:r,settings:se({},QD,s),styles:[...$D,...a]})};CD();var De={background:"#000c18",foreground:"#6688cc",selection:"#770811",selectionMatch:"#770811",cursor:"#ddbb88",activeLine:"#0055ff30",keyword:"#225588",variable:"#2277ff",function:"#9966b8",string:"#22aa44",constant:"#f280d0",type:"#9966b8",class:"#ddbb88",number:"#f280d0",comment:"#384887",heading:"#6688cc",invalid:"#A22D44",regexp:"#22aa44",tag:"#225588"},PD={background:De.background,foreground:De.foreground,caret:De.cursor,selection:De.selection,selectionMatch:De.selectionMatch,gutterBackground:De.background,gutterForeground:De.foreground,lineHighlight:De.activeLine},TD=[{tag:u.keyword,color:De.keyword},{tag:[u.name,u.deleted,u.character,u.macroName],color:De.variable},{tag:[u.propertyName],color:De.function},{tag:[u.processingInstruction,u.string,u.inserted,u.special(u.string)],color:De.string},{tag:[u.function(u.variableName),u.labelName],color:De.function},{tag:[u.color,u.constant(u.name),u.standard(u.name)],color:De.constant},{tag:[u.definition(u.name),u.separator],color:De.variable},{tag:[u.className],color:De.class},{tag:[u.number,u.changed,u.annotation,u.modifier,u.self,u.namespace],color:De.number},{tag:[u.typeName],color:De.type,fontStyle:De.type},{tag:[u.operator,u.operatorKeyword],color:De.keyword},{tag:[u.url,u.escape,u.regexp,u.link],color:De.regexp},{tag:[u.meta,u.comment],color:De.comment},{tag:u.tagName,color:De.tag},{tag:u.strong,fontWeight:"bold"},{tag:u.emphasis,fontStyle:"italic"},{tag:u.link,textDecoration:"underline"},{tag:u.heading,fontWeight:"bold",color:De.heading},{tag:[u.atom,u.bool,u.special(u.variableName)],color:De.variable},{tag:u.invalid,color:De.invalid},{tag:u.strikethrough,textDecoration:"line-through"}],MD=n=>{var e={},t=e.theme,r=t===void 0?"dark":t,i=e.settings,s=i===void 0?{}:i,o=e.styles,a=o===void 0?[]:o;return ae({theme:r,settings:se({},PD,s),styles:[...TD,...a]})};MD();var AD={background:"#282b2e",foreground:"#a9b7c6",caret:"#00FF00",selection:"#4e5254",selectionMatch:"#4e5254",lineHighlight:"#7f85891f"},RD=[{tag:[u.keyword,u.deleted,u.className],color:"#cc7832"},{tag:[u.number,u.literal,u.derefOperator],color:"#6897bb"},{tag:[u.link,u.variableName],color:"#629755"},{tag:[u.comment,u.quote],color:"grey"},{tag:[u.meta,u.documentMeta],color:"#bbb529"},{tag:[u.string,u.propertyName,u.attributeValue],color:"#6a8759"},{tag:[u.heading,u.typeName],color:"#ffc66d"},{tag:[u.attributeName],color:"#a9b7c6"},{tag:[u.emphasis],fontStyle:"italic"}],ED=n=>{var e={},t=e.theme,r=t===void 0?"dark":t,i=e.settings,s=i===void 0?{}:i,o=e.styles,a=o===void 0?[]:o;return ae({theme:r,settings:se({},AD,s),styles:[...RD,...a]})};ED();var Pe={background:"#23262E",foreground:"#D5CED9",selection:"#db45a280",selectionMatch:"#db45a280",cursor:"#FFF",activeLine:"#596a992e",keyword:"#c74ded",variable:"#00e8c6",function:"#FFE66D",string:"#96E072",constant:"#ee5d43",type:"#FFE66D",class:"#FFE66D",number:"#ee5d43",comment:"#A0A1A7cc",heading:"#ff00aa",invalid:null,regexp:"#96E072",tag:"#f92672"},ND={background:Pe.background,foreground:Pe.foreground,caret:Pe.cursor,selection:Pe.selection,selectionMatch:Pe.selectionMatch,gutterBackground:Pe.background,gutterForeground:Pe.foreground,lineHighlight:Pe.activeLine},DD=[{tag:u.keyword,color:Pe.keyword},{tag:[u.name,u.deleted,u.character,u.macroName],color:Pe.variable},{tag:[u.propertyName],color:Pe.function},{tag:[u.processingInstruction,u.string,u.inserted,u.special(u.string)],color:Pe.string},{tag:[u.function(u.variableName),u.labelName],color:Pe.function},{tag:[u.color,u.constant(u.name),u.standard(u.name)],color:Pe.constant},{tag:[u.definition(u.name),u.separator],color:Pe.variable},{tag:[u.className],color:Pe.class},{tag:[u.number,u.changed,u.annotation,u.modifier,u.self,u.namespace],color:Pe.number},{tag:[u.typeName],color:Pe.type,fontStyle:Pe.type},{tag:[u.operator],color:Pe.keyword},{tag:[u.url,u.escape,u.regexp,u.link],color:Pe.regexp},{tag:[u.meta,u.comment],color:Pe.comment},{tag:u.tagName,color:Pe.tag},{tag:u.strong,fontWeight:"bold"},{tag:u.emphasis,fontStyle:"italic"},{tag:u.link,textDecoration:"underline"},{tag:u.heading,fontWeight:"bold",color:Pe.heading},{tag:[u.atom,u.special(u.variableName)],color:Pe.variable},{tag:u.invalid,color:Pe.invalid},{tag:u.strikethrough,textDecoration:"line-through"},{tag:[u.operatorKeyword,u.bool,u.null,u.variableName],color:Pe.constant}],jD=n=>{var e={},t=e.theme,r=t===void 0?"dark":t,i=e.settings,s=i===void 0?{}:i,o=e.styles,a=o===void 0?[]:o;return ae({theme:r,settings:se({},ND,s),styles:[...DD,...a]})};jD();var ID={background:"#272C35",foreground:"#9d9b97",caret:"#797977",selection:"#3d4c64",selectionMatch:"#3d4c64",gutterBackground:"#272C35",gutterForeground:"#465063",gutterBorder:"transparent",lineHighlight:"#2e3f5940"},XD=[{tag:[u.function(u.variableName),u.function(u.propertyName),u.url,u.processingInstruction],color:"hsl(207, 82%, 66%)"},{tag:[u.tagName,u.heading],color:"#e06c75"},{tag:u.comment,color:"#54636D"},{tag:[u.propertyName],color:"hsl(220, 14%, 71%)"},{tag:[u.attributeName,u.number],color:"hsl( 29, 54%, 61%)"},{tag:u.className,color:"hsl( 39, 67%, 69%)"},{tag:u.keyword,color:"hsl(286, 60%, 67%)"},{tag:[u.string,u.regexp,u.special(u.propertyName)],color:"#98c379"}],LD=n=>{var e={},t=e.theme,r=t===void 0?"dark":t,i=e.settings,s=i===void 0?{}:i,o=e.styles,a=o===void 0?[]:o;return ae({theme:r,settings:se({},ID,s),styles:[...XD,...a]})};LD();var _D={background:"#21202e",foreground:"#edecee",caret:"#a277ff",selection:"#5a51898f",selectionMatch:"#5a51898f",gutterBackground:"#21202e",gutterForeground:"#edecee",gutterBorder:"transparent",lineHighlight:"#a394f033"},BD=[{tag:u.keyword,color:"#a277ff"},{tag:[u.name,u.deleted,u.character,u.macroName],color:"#edecee"},{tag:[u.propertyName],color:"#ffca85"},{tag:[u.processingInstruction,u.string,u.inserted,u.special(u.string)],color:"#61ffca"},{tag:[u.function(u.variableName),u.labelName],color:"#ffca85"},{tag:[u.color,u.constant(u.name),u.standard(u.name)],color:"#61ffca"},{tag:[u.definition(u.name),u.separator],color:"#edecee"},{tag:[u.className],color:"#82e2ff"},{tag:[u.number,u.changed,u.annotation,u.modifier,u.self,u.namespace],color:"#61ffca"},{tag:[u.typeName],color:"#82e2ff"},{tag:[u.operator,u.operatorKeyword],color:"#a277ff"},{tag:[u.url,u.escape,u.regexp,u.link],color:"#61ffca"},{tag:[u.meta,u.comment],color:"#6d6d6d"},{tag:u.strong,fontWeight:"bold"},{tag:u.emphasis,fontStyle:"italic"},{tag:u.link,textDecoration:"underline"},{tag:u.heading,fontWeight:"bold",color:"#a277ff"},{tag:[u.atom,u.bool,u.special(u.variableName)],color:"#edecee"},{tag:u.invalid,color:"#ff6767"},{tag:u.strikethrough,textDecoration:"line-through"}],ZD=n=>{var e={},t=e.theme,r=t===void 0?"dark":t,i=e.settings,s=i===void 0?{}:i,o=e.styles,a=o===void 0?[]:o;return ae({theme:r,settings:se({},_D,s),styles:[...BD,...a]})};ZD();var WD={background:"#2E3235",foreground:"#DDDDDD",caret:"#DDDDDD",selection:"#202325",selectionMatch:"#202325",gutterBackground:"#292d30",gutterForeground:"#808080",gutterBorder:"1px solid #ffffff10",lineHighlight:"#B9D2FF30"},zD=[{tag:u.keyword,color:"#fda331"},{tag:[u.name,u.deleted,u.character,u.propertyName,u.macroName],color:"#b5bd68"},{tag:[u.variableName],color:"#6fb3d2"},{tag:[u.function(u.variableName)],color:"#fda331"},{tag:[u.labelName],color:"#fc6d24"},{tag:[u.color,u.constant(u.name),u.standard(u.name)],color:"#fda331"},{tag:[u.definition(u.name),u.separator],color:"#cc99cc"},{tag:[u.brace],color:"#cc99cc"},{tag:[u.annotation],color:"#fc6d24"},{tag:[u.number,u.changed,u.annotation,u.modifier,u.self,u.namespace],color:"#fda331"},{tag:[u.typeName,u.className],color:"#6fb3d2"},{tag:[u.operator,u.operatorKeyword],color:"#cc99cc"},{tag:[u.tagName],color:"#fda331"},{tag:[u.squareBracket],color:"#cc99cc"},{tag:[u.angleBracket],color:"#cc99cc"},{tag:[u.attributeName],color:"#6fb3d2"},{tag:[u.regexp],color:"#fda331"},{tag:[u.quote],color:"#DDDDDD"},{tag:[u.string],color:"#b5bd68"},{tag:u.link,color:"#6987AF",textDecoration:"underline",textUnderlinePosition:"under"},{tag:[u.url,u.escape,u.special(u.string)],color:"#8abeb7"},{tag:[u.meta],color:"#A54543"},{tag:[u.comment],color:"#808080",fontStyle:"italic"},{tag:u.monospace,color:"#DDDDDD"},{tag:u.strong,fontWeight:"bold",color:"#fda331"},{tag:u.emphasis,fontStyle:"italic",color:"#6fb3d2"},{tag:u.strikethrough,textDecoration:"line-through"},{tag:u.heading,fontWeight:"bold",color:"#DDDDDD"},{tag:u.special(u.heading1),fontWeight:"bold",color:"#DDDDDD"},{tag:u.heading1,fontWeight:"bold",color:"#DDDDDD"},{tag:[u.heading2,u.heading3,u.heading4],fontWeight:"bold",color:"#DDDDDD"},{tag:[u.heading5,u.heading6],color:"#DDDDDD"},{tag:[u.atom,u.bool,u.special(u.variableName)],color:"#8abeb7"},{tag:[u.processingInstruction,u.inserted],color:"#8abeb7"},{tag:[u.contentSeparator],color:"#6fb3d2"},{tag:u.invalid,color:"#B9D2FF",borderBottom:"1px dotted #fc6d24"}],VD=n=>{var e={},t=e.theme,r=t===void 0?"dark":t,i=e.settings,s=i===void 0?{}:i,o=e.styles,a=o===void 0?[]:o;return ae({theme:r,settings:se({},WD,s),styles:[...zD,...a]})};VD();var FD={background:"#ffffff",foreground:"#2e3440",caret:"#3b4252",selection:"#eceff4",selectionMatch:"#e5e9f0",gutterBackground:"#eceff4",gutterForeground:"#2e3440",gutterBorder:"none",lineHighlight:"#02255f11"},qD=[{tag:u.keyword,color:"#5e81ac"},{tag:[u.name,u.deleted,u.character,u.propertyName,u.macroName],color:"#d08770"},{tag:[u.variableName],color:"#d08770"},{tag:[u.function(u.variableName)],color:"#5e81ac"},{tag:[u.labelName],color:"#81a1c1"},{tag:[u.color,u.constant(u.name),u.standard(u.name)],color:"#5e81ac"},{tag:[u.definition(u.name),u.separator],color:"#a3be8c"},{tag:[u.brace],color:"#8fbcbb"},{tag:[u.annotation],color:"#d30102"},{tag:[u.number,u.changed,u.annotation,u.modifier,u.self,u.namespace],color:"#88c0d0"},{tag:[u.typeName,u.className],color:"#ebcb8b"},{tag:[u.operator,u.operatorKeyword],color:"#a3be8c"},{tag:[u.tagName],color:"#b48ead"},{tag:[u.squareBracket],color:"#bf616a"},{tag:[u.angleBracket],color:"#d08770"},{tag:[u.attributeName],color:"#ebcb8b"},{tag:[u.regexp],color:"#5e81ac"},{tag:[u.quote],color:"#3b4252"},{tag:[u.string],color:"#d08770"},{tag:u.link,color:"#8fbcbb",textDecoration:"underline",textUnderlinePosition:"under"},{tag:[u.url,u.escape,u.special(u.string)],color:"#d08770"},{tag:[u.meta],color:"#88c0d0"},{tag:[u.comment],color:"#434c5e",fontStyle:"italic"},{tag:u.strong,fontWeight:"bold",color:"#5e81ac"},{tag:u.emphasis,fontStyle:"italic",color:"#5e81ac"},{tag:u.strikethrough,textDecoration:"line-through"},{tag:u.heading,fontWeight:"bold",color:"#5e81ac"},{tag:u.special(u.heading1),fontWeight:"bold",color:"#5e81ac"},{tag:u.heading1,fontWeight:"bold",color:"#5e81ac"},{tag:[u.heading2,u.heading3,u.heading4],fontWeight:"bold",color:"#5e81ac"},{tag:[u.heading5,u.heading6],color:"#5e81ac"},{tag:[u.atom,u.bool,u.special(u.variableName)],color:"#d08770"},{tag:[u.processingInstruction,u.inserted],color:"#8fbcbb"},{tag:[u.contentSeparator],color:"#ebcb8b"},{tag:u.invalid,color:"#434c5e",borderBottom:"1px dotted #d30102"}],YD=n=>{var e={},t=e.theme,r=t===void 0?"light":t,i=e.settings,s=i===void 0?{}:i,o=e.styles,a=o===void 0?[]:o;return ae({theme:r,settings:se({},FD,s),styles:[...qD,...a]})};YD();var UD={background:"#FFFFFF",foreground:"#000000",caret:"#FBAC52",selection:"#FFD420",selectionMatch:"#FFD420",gutterBackground:"#f5f5f5",gutterForeground:"#4D4D4C",gutterBorder:"transparent",lineHighlight:"#00000012"},GD=[{tag:[u.meta,u.comment],color:"#804000"},{tag:[u.keyword,u.strong],color:"#0000FF"},{tag:[u.number],color:"#FF0080"},{tag:[u.string],color:"#FF0080"},{tag:[u.variableName],color:"#006600"},{tag:[u.escape],color:"#33CC33"},{tag:[u.tagName],color:"#1C02FF"},{tag:[u.heading],color:"#0C07FF"},{tag:[u.quote],color:"#000000"},{tag:[u.list],color:"#B90690"},{tag:[u.documentMeta],color:"#888888"},{tag:[u.function(u.variableName)],color:"#0000A2"},{tag:[u.definition(u.typeName),u.typeName],color:"#6D79DE"}],HD=n=>{var e={},t=e.theme,r=t===void 0?"light":t,i=e.settings,s=i===void 0?{}:i,o=e.styles,a=o===void 0?[]:o;return ae({theme:r,settings:se({},UD,s),styles:[...GD,...a]})};HD();var KD={background:"#28211c",foreground:"#9d9b97",caret:"#797977",selection:"#4f382b",selectionMatch:"#4f382b",gutterBackground:"#28211c",gutterForeground:"#666666",lineHighlight:"#ffffff1a"},JD=[{tag:[u.atom,u.number,u.link,u.bool],color:"#9b859d"},{tag:u.comment,color:"#937121"},{tag:[u.keyword,u.tagName],color:"#cf6a4c"},{tag:u.string,color:"#f9ee98"},{tag:u.bracket,color:"#9d9b97"},{tag:[u.variableName],color:"#5ea6ea"},{tag:u.definition(u.variableName),color:"#cf7d34"},{tag:[u.function(u.variableName),u.className],color:"#cf7d34"},{tag:[u.propertyName,u.attributeName],color:"#54be0d"}],e9=n=>{var e={},t=e.theme,r=t===void 0?"dark":t,i=e.settings,s=i===void 0?{}:i,o=e.styles,a=o===void 0?[]:o;return ae({theme:r,settings:se({},KD,s),styles:[...JD,...a]})};e9();var t9={background:"#000",foreground:"#fff",caret:"#fff",selection:"#5c6c9b",selectionMatch:"#2a3967",gutterBackground:"#000",gutterForeground:"#ada9a9",gutterActiveForeground:"#fff",lineHighlight:"#82828275"},n9=n=>{var e={},t=e.theme,r=t===void 0?"dark":t,i=e.settings,s=i===void 0?{}:i,o=e.styles,a=o===void 0?[]:o;return ae({theme:r,settings:se({},t9,s),styles:[...a]})};n9();var r9={background:"#fff",foreground:"#000",caret:"#000",selection:"#c2d2ff",selectionMatch:"#b1c1ef",gutterBackground:"#fff",gutterForeground:"#ada9a9",gutterActiveForeground:"#000",lineHighlight:"#c7c5c575"},i9=n=>{var e={},t=e.theme,r=t===void 0?"light":t,i=e.settings,s=i===void 0?{}:i,o=e.styles,a=o===void 0?[]:o;return ae({theme:r,settings:se({},r9,s),styles:[...a]})};i9();var Te={background:"#232a2f",foreground:"#939da5",selection:"#204062",selectionMatch:"#204062",cursor:"#939da5",activeLine:"#4469832b",keyword:"#ba8ef7",variable:"#939da5",function:"#ffea6b",string:"#5bec95",constant:"#939da5",type:"#89ddff",class:"#ffea6b",number:"#89ddff",comment:"#707a84",heading:"#5bec95",invalid:"#ff6a80",regexp:"#56adb7",tag:"#ff6a80"},s9={background:Te.background,foreground:Te.foreground,caret:Te.cursor,selection:Te.selection,selectionMatch:Te.selectionMatch,gutterBackground:Te.background,gutterForeground:Te.foreground,lineHighlight:Te.activeLine},o9=[{tag:u.keyword,color:Te.keyword},{tag:[u.name,u.deleted,u.character,u.macroName],color:Te.variable},{tag:[u.propertyName],color:Te.function},{tag:[u.processingInstruction,u.string,u.inserted,u.special(u.string)],color:Te.string},{tag:[u.function(u.variableName),u.labelName],color:Te.function},{tag:[u.color,u.constant(u.name),u.standard(u.name)],color:Te.constant},{tag:[u.definition(u.name),u.separator],color:Te.variable},{tag:[u.className],color:Te.class},{tag:[u.number,u.changed,u.annotation,u.modifier,u.self,u.namespace],color:Te.number},{tag:[u.typeName],color:Te.type,fontStyle:Te.type},{tag:[u.operator],color:Te.keyword},{tag:[u.url,u.escape,u.regexp,u.link],color:Te.regexp},{tag:[u.meta,u.comment],color:Te.comment},{tag:u.tagName,color:Te.tag},{tag:u.strong,fontWeight:"bold"},{tag:u.emphasis,fontStyle:"italic"},{tag:u.link,textDecoration:"underline"},{tag:u.heading,fontWeight:"bold",color:Te.heading},{tag:[u.atom,u.special(u.variableName)],color:Te.variable},{tag:u.invalid,color:Te.invalid},{tag:u.strikethrough,textDecoration:"line-through"},{tag:[u.operatorKeyword,u.bool,u.null,u.variableName],color:Te.constant}],a9=n=>{var e={},t=e.theme,r=t===void 0?"dark":t,i=e.settings,s=i===void 0?{}:i,o=e.styles,a=o===void 0?[]:o;return ae({theme:r,settings:se({},s9,s),styles:[...o9,...a]})};a9();var l9={background:"#2B2B2B",foreground:"#f8f8f2",caret:"#FFFFFF",selection:"rgba(255, 255, 255, 0.1)",selectionMatch:"rgba(255, 255, 255, 0.2)",gutterBackground:"rgba(255, 255, 255, 0.1)",gutterForeground:"#999",gutterBorder:"transparent",lineHighlight:"rgba(255, 255, 255, 0.1)"},c9=[{tag:[u.atom,u.number],color:"#bd93f9"},{tag:[u.comment],color:"#61A151"},{tag:[u.string],color:"#6A8759"},{tag:[u.variableName,u.operator],color:"#A9B7C6"},{tag:[u.meta,u.className],color:"#A9B7C6"},{tag:[u.propertyName],color:"#FFC66D"},{tag:[u.keyword],color:"#CC7832"},{tag:[u.tagName],color:"#ff79c6"},{tag:[u.typeName],color:"#ffb86c"}],u9=n=>{var e={},t=e.theme,r=t===void 0?"dark":t,i=e.settings,s=i===void 0?{}:i,o=e.styles,a=o===void 0?[]:o;return ae({theme:r,settings:se({},l9,s),styles:[...c9,...a]})};u9();var d9={background:"#282a36",foreground:"#f8f8f2",caret:"#f8f8f0",selection:"rgba(255, 255, 255, 0.1)",selectionMatch:"rgba(255, 255, 255, 0.2)",gutterBackground:"#282a36",gutterForeground:"#6D8A88",gutterBorder:"transparent",lineHighlight:"rgba(255, 255, 255, 0.1)"},h9=[{tag:u.comment,color:"#6272a4"},{tag:u.string,color:"#f1fa8c"},{tag:u.atom,color:"#bd93f9"},{tag:u.meta,color:"#f8f8f2"},{tag:[u.keyword,u.operator,u.tagName],color:"#ff79c6"},{tag:[u.function(u.propertyName),u.propertyName],color:"#66d9ef"},{tag:[u.definition(u.variableName),u.function(u.variableName),u.className,u.attributeName],color:"#50fa7b"},{tag:u.atom,color:"#bd93f9"}],f9=n=>{var e={},t=e.theme,r=t===void 0?"dark":t,i=e.settings,s=i===void 0?{}:i,o=e.styles,a=o===void 0?[]:o;return ae({theme:r,settings:se({},d9,s),styles:[...h9,...a]})};f9();var p9={background:"#faf8f5",foreground:"#b29762",caret:"#93abdc",selection:"#e3dcce",selectionMatch:"#e3dcce",gutterBackground:"#faf8f5",gutterForeground:"#cdc4b1",gutterBorder:"transparent",lineHighlight:"#ddceb154"},m9=[{tag:[u.comment,u.bracket],color:"#b6ad9a"},{tag:[u.atom,u.number,u.keyword,u.link,u.attributeName,u.quote],color:"#063289"},{tag:[u.emphasis,u.heading,u.tagName,u.propertyName,u.variableName],color:"#2d2006"},{tag:[u.typeName,u.url,u.string],color:"#896724"},{tag:[u.operator,u.string],color:"#1659df"},{tag:[u.propertyName],color:"#b29762"},{tag:[u.unit,u.punctuation],color:"#063289"}],g9=n=>{var e={},t=e.theme,r=t===void 0?"light":t,i=e.settings,s=i===void 0?{}:i,o=e.styles,a=o===void 0?[]:o;return ae({theme:r,settings:se({},p9,s),styles:[...m9,...a]})};g9();var O9={background:"#2a2734",foreground:"#6c6783",caret:"#ffad5c",selection:"#91ff6c26",selectionMatch:"#91ff6c26",gutterBackground:"#2a2734",gutterForeground:"#545167",lineHighlight:"#36334280"},b9=[{tag:[u.comment,u.bracket],color:"#6c6783"},{tag:[u.atom,u.number,u.keyword,u.link,u.attributeName,u.quote],color:"#ffcc99"},{tag:[u.emphasis,u.heading,u.tagName,u.propertyName,u.className,u.variableName],color:"#eeebff"},{tag:[u.typeName,u.url],color:"#7a63ee"},{tag:u.operator,color:"#ffad5c"},{tag:u.string,color:"#ffb870"},{tag:[u.propertyName],color:"#9a86fd"},{tag:[u.unit,u.punctuation],color:"#e09142"}],y9=n=>{var e={},t=e.theme,r=t===void 0?"dark":t,i=e.settings,s=i===void 0?{}:i,o=e.styles,a=o===void 0?[]:o;return ae({theme:r,settings:se({},O9,s),styles:[...b9,...a]})};y9();var x9={background:"#fff",foreground:"#000",caret:"#FFFFFF",selection:"#d7d4f0",selectionMatch:"#d7d4f0",gutterBackground:"#f7f7f7",gutterForeground:"#999",lineHighlight:"#006fff1c",gutterBorder:"transparent"},S9=[{tag:[u.comment],color:"#3F7F5F"},{tag:[u.documentMeta],color:"#FF1717"},{tag:u.keyword,color:"#7F0055",fontWeight:"bold"},{tag:u.atom,color:"#00f"},{tag:u.number,color:"#164"},{tag:u.propertyName,color:"#164"},{tag:[u.variableName,u.definition(u.variableName)],color:"#0000C0"},{tag:u.function(u.variableName),color:"#0000C0"},{tag:u.string,color:"#2A00FF"},{tag:u.operator,color:"black"},{tag:u.tagName,color:"#170"},{tag:u.attributeName,color:"#00c"},{tag:u.link,color:"#219"}],k9=n=>{var e={},t=e.theme,r=t===void 0?"light":t,i=e.settings,s=i===void 0?{}:i,o=e.styles,a=o===void 0?[]:o;return ae({theme:r,settings:se({},x9,s),styles:[...S9,...a]})};k9();var v9={background:"#fff",foreground:"#24292e",selection:"#BBDFFF",selectionMatch:"#BBDFFF",gutterBackground:"#fff",gutterForeground:"#6e7781"},w9=[{tag:[u.standard(u.tagName),u.tagName],color:"#116329"},{tag:[u.comment,u.bracket],color:"#6a737d"},{tag:[u.className,u.propertyName],color:"#6f42c1"},{tag:[u.variableName,u.attributeName,u.number,u.operator],color:"#005cc5"},{tag:[u.keyword,u.typeName,u.typeOperator,u.typeName],color:"#d73a49"},{tag:[u.string,u.meta,u.regexp],color:"#032f62"},{tag:[u.name,u.quote],color:"#22863a"},{tag:[u.heading,u.strong],color:"#24292e",fontWeight:"bold"},{tag:[u.emphasis],color:"#24292e",fontStyle:"italic"},{tag:[u.deleted],color:"#b31d28",backgroundColor:"ffeef0"},{tag:[u.atom,u.bool,u.special(u.variableName)],color:"#e36209"},{tag:[u.url,u.escape,u.regexp,u.link],color:"#032f62"},{tag:u.link,textDecoration:"underline"},{tag:u.strikethrough,textDecoration:"line-through"},{tag:u.invalid,color:"#cb2431"}],Q9=n=>{var e={},t=e.theme,r=t===void 0?"light":t,i=e.settings,s=i===void 0?{}:i,o=e.styles,a=o===void 0?[]:o;return ae({theme:r,settings:se({},v9,s),styles:[...w9,...a]})};Q9();var $9={background:"#0d1117",foreground:"#c9d1d9",caret:"#c9d1d9",selection:"#003d73",selectionMatch:"#003d73",lineHighlight:"#36334280"},C9=[{tag:[u.standard(u.tagName),u.tagName],color:"#7ee787"},{tag:[u.comment,u.bracket],color:"#8b949e"},{tag:[u.className,u.propertyName],color:"#d2a8ff"},{tag:[u.variableName,u.attributeName,u.number,u.operator],color:"#79c0ff"},{tag:[u.keyword,u.typeName,u.typeOperator,u.typeName],color:"#ff7b72"},{tag:[u.string,u.meta,u.regexp],color:"#a5d6ff"},{tag:[u.name,u.quote],color:"#7ee787"},{tag:[u.heading,u.strong],color:"#d2a8ff",fontWeight:"bold"},{tag:[u.emphasis],color:"#d2a8ff",fontStyle:"italic"},{tag:[u.deleted],color:"#ffdcd7",backgroundColor:"ffeef0"},{tag:[u.atom,u.bool,u.special(u.variableName)],color:"#ffab70"},{tag:u.link,textDecoration:"underline"},{tag:u.strikethrough,textDecoration:"line-through"},{tag:u.invalid,color:"#f97583"}],P9=n=>{var e={},t=e.theme,r=t===void 0?"dark":t,i=e.settings,s=i===void 0?{}:i,o=e.styles,a=o===void 0?[]:o;return ae({theme:r,settings:se({},$9,s),styles:[...C9,...a]})};P9();var T9={background:"#282828",foreground:"#ebdbb2",caret:"#ebdbb2",selection:"#b99d555c",selectionMatch:"#b99d555c",lineHighlight:"#baa1602b",gutterBackground:"#282828",gutterForeground:"#7c6f64"},M9=[{tag:u.keyword,color:"#fb4934"},{tag:[u.name,u.deleted,u.character,u.propertyName,u.macroName],color:"#8ec07c"},{tag:[u.variableName],color:"#83a598"},{tag:[u.function(u.variableName)],color:"#b8bb26",fontStyle:"bold"},{tag:[u.labelName],color:"#ebdbb2"},{tag:[u.color,u.constant(u.name),u.standard(u.name)],color:"#d3869b"},{tag:[u.definition(u.name),u.separator],color:"#ebdbb2"},{tag:[u.brace],color:"#ebdbb2"},{tag:[u.annotation],color:"#fb4934d"},{tag:[u.number,u.changed,u.annotation,u.modifier,u.self,u.namespace],color:"#d3869b"},{tag:[u.typeName,u.className],color:"#fabd2f"},{tag:[u.operator,u.operatorKeyword],color:"#fb4934"},{tag:[u.tagName],color:"#8ec07c",fontStyle:"bold"},{tag:[u.squareBracket],color:"#fe8019"},{tag:[u.angleBracket],color:"#83a598"},{tag:[u.attributeName],color:"#8ec07c"},{tag:[u.regexp],color:"#8ec07c"},{tag:[u.quote],color:"#928374"},{tag:[u.string],color:"#ebdbb2"},{tag:u.link,color:"#a89984",textDecoration:"underline",textUnderlinePosition:"under"},{tag:[u.url,u.escape,u.special(u.string)],color:"#d3869b"},{tag:[u.meta],color:"#fabd2f"},{tag:[u.comment],color:"#928374",fontStyle:"italic"},{tag:u.strong,fontWeight:"bold",color:"#fe8019"},{tag:u.emphasis,fontStyle:"italic",color:"#b8bb26"},{tag:u.strikethrough,textDecoration:"line-through"},{tag:u.heading,fontWeight:"bold",color:"#b8bb26"},{tag:[u.heading1,u.heading2],fontWeight:"bold",color:"#b8bb26"},{tag:[u.heading3,u.heading4],fontWeight:"bold",color:"#fabd2f"},{tag:[u.heading5,u.heading6],color:"#fabd2f"},{tag:[u.atom,u.bool,u.special(u.variableName)],color:"#d3869b"},{tag:[u.processingInstruction,u.inserted],color:"#83a598"},{tag:[u.contentSeparator],color:"#fb4934"},{tag:u.invalid,color:"#fe8019",borderBottom:"1px dotted #fb4934d"}],A9=n=>{var e={},t=e.theme,r=t===void 0?"dark":t,i=e.settings,s=i===void 0?{}:i,o=e.styles,a=o===void 0?[]:o;return ae({theme:r,settings:se({},T9,s),styles:[...M9,...a]})};A9();var R9={background:"#fbf1c7",foreground:"#3c3836",caret:"#af3a03",selection:"#bdae9391",selectionMatch:"#bdae9391",lineHighlight:"#a37f2238",gutterBackground:"#ebdbb2",gutterForeground:"#665c54",gutterBorder:"transparent"},E9=n=>{var e={},t=e.theme,r=t===void 0?"light":t,i=e.settings,s=i===void 0?{}:i,o=e.styles,a=o===void 0?[]:o;return ae({theme:r,settings:se({},R9,s),styles:[{tag:u.keyword,color:"#9d0006"},{tag:[u.name,u.deleted,u.character,u.propertyName,u.macroName],color:"#427b58"},{tag:[u.variableName],color:"#076678"},{tag:[u.function(u.variableName)],color:"#79740e",fontStyle:"bold"},{tag:[u.labelName],color:"#3c3836"},{tag:[u.color,u.constant(u.name),u.standard(u.name)],color:"#8f3f71"},{tag:[u.definition(u.name),u.separator],color:"#3c3836"},{tag:[u.brace],color:"#3c3836"},{tag:[u.annotation],color:"#9d0006"},{tag:[u.number,u.changed,u.annotation,u.modifier,u.self,u.namespace],color:"#8f3f71"},{tag:[u.typeName,u.className],color:"#b57614"},{tag:[u.operator,u.operatorKeyword],color:"#9d0006"},{tag:[u.tagName],color:"#427b58",fontStyle:"bold"},{tag:[u.squareBracket],color:"#af3a03"},{tag:[u.angleBracket],color:"#076678"},{tag:[u.attributeName],color:"#427b58"},{tag:[u.regexp],color:"#427b58"},{tag:[u.quote],color:"#928374"},{tag:[u.string],color:"#3c3836"},{tag:u.link,color:"#7c6f64",textDecoration:"underline",textUnderlinePosition:"under"},{tag:[u.url,u.escape,u.special(u.string)],color:"#8f3f71"},{tag:[u.meta],color:"#b57614"},{tag:[u.comment],color:"#928374",fontStyle:"italic"},{tag:u.strong,fontWeight:"bold",color:"#af3a03"},{tag:u.emphasis,fontStyle:"italic",color:"#79740e"},{tag:u.strikethrough,textDecoration:"line-through"},{tag:u.heading,fontWeight:"bold",color:"#79740e"},{tag:[u.heading1,u.heading2],fontWeight:"bold",color:"#79740e"},{tag:[u.heading3,u.heading4],fontWeight:"bold",color:"#b57614"},{tag:[u.heading5,u.heading6],color:"#b57614"},{tag:[u.atom,u.bool,u.special(u.variableName)],color:"#8f3f71"},{tag:[u.processingInstruction,u.inserted],color:"#076678"},{tag:[u.contentSeparator],color:"#9d0006"},{tag:u.invalid,color:"#af3a03",borderBottom:"1px dotted #9d0006"},...a]})};E9();var je={background:"#221a0f",foreground:"#d3af86",selection:"#84613daa",cursor:"#d3af86",activeLine:"#5e452b52",keyword:"#98676a",variable:"#dc3958",function:"#7e602c",string:"#889b4a",constant:"#f79a32",type:"#f06431",class:"#f06431",number:"#f79a32",comment:"#a57a4c",heading:"#8ab1b0",invalid:"#dc3958",regexp:"#7e602c",tag:"#dc3958"},N9={background:je.background,foreground:je.foreground,caret:je.cursor,selection:je.selection,selectionMatch:je.selection,gutterBackground:je.background,gutterForeground:je.foreground,lineHighlight:je.activeLine},D9=[{tag:u.keyword,color:je.keyword},{tag:[u.name,u.deleted,u.character,u.macroName],color:je.variable},{tag:[u.propertyName],color:je.function},{tag:[u.processingInstruction,u.string,u.inserted,u.special(u.string)],color:je.string},{tag:[u.function(u.variableName),u.labelName],color:je.function},{tag:[u.color,u.constant(u.name),u.standard(u.name)],color:je.constant},{tag:[u.definition(u.name),u.separator],color:je.variable},{tag:[u.className],color:je.class},{tag:[u.number,u.changed,u.annotation,u.modifier,u.self,u.namespace],color:je.number},{tag:[u.typeName],color:je.type,fontStyle:je.type},{tag:[u.operator,u.operatorKeyword],color:je.keyword},{tag:[u.url,u.escape,u.regexp,u.link],color:je.regexp},{tag:[u.meta,u.comment],color:je.comment},{tag:u.tagName,color:je.tag},{tag:u.strong,fontWeight:"bold"},{tag:u.emphasis,fontStyle:"italic"},{tag:u.link,textDecoration:"underline"},{tag:u.heading,fontWeight:"bold",color:je.heading},{tag:[u.atom,u.bool,u.special(u.variableName)],color:je.variable},{tag:u.invalid,color:je.invalid},{tag:u.strikethrough,textDecoration:"line-through"}],j9=n=>{var e={},t=e.theme,r=t===void 0?"dark":t,i=e.settings,s=i===void 0?{}:i,o=e.styles,a=o===void 0?[]:o;return ae({theme:r,settings:se({},N9,s),styles:[...D9,...a]})};j9();var I9={background:"#2e3235",foreground:"#bdbdbd",caret:"#a0a4ae",selection:"#d7d4f063",selectionMatch:"#d7d4f063",gutterBackground:"#2e3235",gutterForeground:"#999",gutterActiveForeground:"#4f5b66",lineHighlight:"#545b6130"},X9=[{tag:u.keyword,color:"#cf6edf"},{tag:[u.name,u.deleted,u.character,u.macroName],color:"#56c8d8"},{tag:[u.propertyName],color:"#facf4e"},{tag:[u.variableName],color:"#bdbdbd"},{tag:[u.function(u.variableName)],color:"#56c8d8"},{tag:[u.labelName],color:"#cf6edf"},{tag:[u.color,u.constant(u.name),u.standard(u.name)],color:"#facf4e"},{tag:[u.definition(u.name),u.separator],color:"#fa5788"},{tag:[u.brace],color:"#cf6edf"},{tag:[u.annotation],color:"#ff5f52"},{tag:[u.number,u.changed,u.annotation,u.modifier,u.self,u.namespace],color:"#ffad42"},{tag:[u.typeName,u.className],color:"#ffad42"},{tag:[u.operator,u.operatorKeyword],color:"#7186f0"},{tag:[u.tagName],color:"#99d066"},{tag:[u.squareBracket],color:"#ff5f52"},{tag:[u.angleBracket],color:"#606f7a"},{tag:[u.attributeName],color:"#bdbdbd"},{tag:[u.regexp],color:"#ff5f52"},{tag:[u.quote],color:"#6abf69"},{tag:[u.string],color:"#99d066"},{tag:u.link,color:"#56c8d8",textDecoration:"underline",textUnderlinePosition:"under"},{tag:[u.url,u.escape,u.special(u.string)],color:"#facf4e"},{tag:[u.meta],color:"#707d8b"},{tag:[u.comment],color:"#707d8b",fontStyle:"italic"},{tag:u.monospace,color:"#bdbdbd"},{tag:u.strong,fontWeight:"bold",color:"#ff5f52"},{tag:u.emphasis,fontStyle:"italic",color:"#99d066"},{tag:u.strikethrough,textDecoration:"line-through"},{tag:u.heading,fontWeight:"bold",color:"#facf4e"},{tag:u.heading1,fontWeight:"bold",color:"#facf4e"},{tag:[u.heading2,u.heading3,u.heading4],fontWeight:"bold",color:"#facf4e"},{tag:[u.heading5,u.heading6],color:"#facf4e"},{tag:[u.atom,u.bool,u.special(u.variableName)],color:"#56c8d8"},{tag:[u.processingInstruction,u.inserted],color:"#ff5f52"},{tag:[u.contentSeparator],color:"#56c8d8"},{tag:u.invalid,color:"#606f7a",borderBottom:"1px dotted #ff5f52"}],Av=n=>{var e=n||{},t=e.theme,r=t===void 0?"dark":t,i=e.settings,s=i===void 0?{}:i,o=e.styles,a=o===void 0?[]:o;return ae({theme:r,settings:se({},I9,s),styles:[...X9,...a]})};Av();Av();var L9={background:"#FAFAFA",foreground:"#90A4AE",caret:"#272727",selection:"#80CBC440",selectionMatch:"#80CBC440",gutterBackground:"#FAFAFA",gutterForeground:"#90A4AE",gutterBorder:"transparent",lineHighlight:"#CCD7DA50"},_9=[{tag:u.keyword,color:"#39ADB5"},{tag:[u.name,u.deleted,u.character,u.macroName],color:"#90A4AE"},{tag:[u.propertyName],color:"#6182B8"},{tag:[u.processingInstruction,u.string,u.inserted,u.special(u.string)],color:"#91B859"},{tag:[u.function(u.variableName),u.labelName],color:"#6182B8"},{tag:[u.color,u.constant(u.name),u.standard(u.name)],color:"#39ADB5"},{tag:[u.definition(u.name),u.separator],color:"#90A4AE"},{tag:[u.className],color:"#E2931D"},{tag:[u.number,u.changed,u.annotation,u.modifier,u.self,u.namespace],color:"#F76D47"},{tag:[u.typeName],color:"#E2931D",fontStyle:"#E2931D"},{tag:[u.operator,u.operatorKeyword],color:"#39ADB5"},{tag:[u.url,u.escape,u.regexp,u.link],color:"#91B859"},{tag:[u.meta,u.comment],color:"#90A4AE"},{tag:u.strong,fontWeight:"bold"},{tag:u.emphasis,fontStyle:"italic"},{tag:u.link,textDecoration:"underline"},{tag:u.heading,fontWeight:"bold",color:"#39ADB5"},{tag:[u.atom,u.bool,u.special(u.variableName)],color:"#90A4AE"},{tag:u.invalid,color:"#E5393570"},{tag:u.strikethrough,textDecoration:"line-through"}],B9=n=>{var e={},t=e.theme,r=t===void 0?"light":t,i=e.settings,s=i===void 0?{}:i,o=e.styles,a=o===void 0?[]:o;return ae({theme:r,settings:se({},L9,s),styles:[..._9,...a]})};B9();var Ie={background:"#272822",foreground:"#f8f8f2",selection:"#4a4a76",cursor:"#f8f8f0",activeLine:"#3e3d3257",keyword:"#F92672",variable:"#FD971F",function:"#66D9EF",string:"#E6DB74",constant:"#AE81FF",type:"#66D9EF",class:"#A6E22E",number:"#AE81FF",comment:"#88846f",heading:"#A6E22E",invalid:"#F44747",regexp:"#E6DB74",tag:"#F92672"},Z9={background:Ie.background,foreground:Ie.foreground,caret:Ie.cursor,selection:Ie.selection,selectionMatch:Ie.selection,gutterBackground:Ie.background,gutterForeground:Ie.foreground,lineHighlight:Ie.activeLine},W9=[{tag:u.keyword,color:Ie.keyword},{tag:[u.name,u.deleted,u.character,u.macroName],color:Ie.variable},{tag:[u.propertyName],color:Ie.function},{tag:[u.processingInstruction,u.string,u.inserted,u.special(u.string)],color:Ie.string},{tag:[u.function(u.variableName),u.labelName],color:Ie.function},{tag:[u.color,u.constant(u.name),u.standard(u.name)],color:Ie.constant},{tag:[u.definition(u.name),u.separator],color:Ie.variable},{tag:[u.className],color:Ie.class},{tag:[u.number,u.changed,u.annotation,u.modifier,u.self,u.namespace],color:Ie.number},{tag:[u.typeName],color:Ie.type,fontStyle:Ie.type},{tag:[u.operator,u.operatorKeyword],color:Ie.keyword},{tag:[u.url,u.escape,u.regexp,u.link],color:Ie.regexp},{tag:[u.meta,u.comment],color:Ie.comment},{tag:u.tagName,color:Ie.tag},{tag:u.strong,fontWeight:"bold"},{tag:u.emphasis,fontStyle:"italic"},{tag:u.link,textDecoration:"underline"},{tag:u.heading,fontWeight:"bold",color:Ie.heading},{tag:[u.atom,u.bool,u.special(u.variableName)],color:Ie.variable},{tag:u.invalid,color:Ie.invalid},{tag:u.strikethrough,textDecoration:"line-through"}],z9=n=>{var e={},t=e.theme,r=t===void 0?"dark":t,i=e.settings,s=i===void 0?{}:i,o=e.styles,a=o===void 0?[]:o;return ae({theme:r,settings:se({},Z9,s),styles:[...W9,...a]})};z9();var Xe={background:"#1e1e1e",foreground:"#c5c8c6",selection:"#4747a1",cursor:"#c07020",activeLine:"#30303078",keyword:"#676867",variable:"#c7444a",function:"#9872A2",string:"#D08442",constant:"#8080FF",type:"#9B0000",class:"#CE6700",number:"#6089B4",comment:"#9A9B99",heading:"#D0B344",invalid:"#FF0B00",regexp:"#D08442",tag:"#6089B4"},V9={background:Xe.background,foreground:Xe.foreground,caret:Xe.cursor,selection:Xe.selection,selectionMatch:Xe.selection,gutterBackground:Xe.background,gutterForeground:Xe.foreground,lineHighlight:Xe.activeLine},F9=[{tag:u.keyword,color:Xe.keyword},{tag:[u.name,u.deleted,u.character,u.macroName],color:Xe.variable},{tag:[u.propertyName],color:Xe.function},{tag:[u.processingInstruction,u.string,u.inserted,u.special(u.string)],color:Xe.string},{tag:[u.function(u.variableName),u.labelName],color:Xe.function},{tag:[u.color,u.constant(u.name),u.standard(u.name)],color:Xe.constant},{tag:[u.definition(u.name),u.separator],color:Xe.variable},{tag:[u.className],color:Xe.class},{tag:[u.number,u.changed,u.annotation,u.modifier,u.self,u.namespace],color:Xe.number},{tag:[u.typeName],color:Xe.type,fontStyle:Xe.type},{tag:[u.operator,u.operatorKeyword],color:Xe.keyword},{tag:[u.url,u.escape,u.regexp,u.link],color:Xe.regexp},{tag:[u.meta,u.comment],color:Xe.comment},{tag:u.tagName,color:Xe.tag},{tag:u.strong,fontWeight:"bold"},{tag:u.emphasis,fontStyle:"italic"},{tag:u.link,textDecoration:"underline"},{tag:u.heading,fontWeight:"bold",color:Xe.heading},{tag:[u.atom,u.bool,u.special(u.variableName)],color:Xe.variable},{tag:u.invalid,color:Xe.invalid},{tag:u.strikethrough,textDecoration:"line-through"}],q9=n=>{var e={},t=e.theme,r=t===void 0?"dark":t,i=e.settings,s=i===void 0?{}:i,o=e.styles,a=o===void 0?[]:o;return ae({theme:r,settings:se({},V9,s),styles:[...F9,...a]})};q9();var Y9={background:"#f2f1f8",foreground:"#0c006b",caret:"#5c49e9",selection:"#d5d1f2",selectionMatch:"#d5d1f2",gutterBackground:"#f2f1f8",gutterForeground:"#0c006b70",lineHighlight:"#16067911"},U9=[{tag:u.comment,color:"#9995b7"},{tag:u.keyword,color:"#ff5792",fontWeight:"bold"},{tag:[u.definitionKeyword,u.modifier],color:"#ff5792"},{tag:[u.className,u.tagName,u.definition(u.typeName)],color:"#0094f0"},{tag:[u.number,u.bool,u.null,u.special(u.brace)],color:"#5842ff"},{tag:[u.definition(u.propertyName),u.function(u.variableName)],color:"#0095a8"},{tag:u.typeName,color:"#b3694d"},{tag:[u.propertyName,u.variableName],color:"#fa8900"},{tag:u.operator,color:"#ff5792"},{tag:u.self,color:"#e64100"},{tag:[u.string,u.regexp],color:"#00b368"},{tag:[u.paren,u.bracket],color:"#0431fa"},{tag:u.labelName,color:"#00bdd6"},{tag:u.attributeName,color:"#e64100"},{tag:u.angleBracket,color:"#9995b7"}],G9=n=>{var e={},t=e.theme,r=t===void 0?"light":t,i=e.settings,s=i===void 0?{}:i,o=e.styles,a=o===void 0?[]:o;return ae({theme:r,settings:se({},Y9,s),styles:[...U9,...a]})};G9();var H9={background:"#2e3440",foreground:"#FFFFFF",caret:"#FFFFFF",selection:"#00000073",selectionMatch:"#00000073",gutterBackground:"#2e3440",gutterForeground:"#4c566a",gutterActiveForeground:"#d8dee9",lineHighlight:"#4c566a29"},K9=[{tag:u.keyword,color:"#5e81ac"},{tag:[u.name,u.deleted,u.character,u.propertyName,u.macroName],color:"#88c0d0"},{tag:[u.variableName],color:"#8fbcbb"},{tag:[u.function(u.variableName)],color:"#8fbcbb"},{tag:[u.labelName],color:"#81a1c1"},{tag:[u.color,u.constant(u.name),u.standard(u.name)],color:"#5e81ac"},{tag:[u.definition(u.name),u.separator],color:"#a3be8c"},{tag:[u.brace],color:"#8fbcbb"},{tag:[u.annotation],color:"#d30102"},{tag:[u.number,u.changed,u.annotation,u.modifier,u.self,u.namespace],color:"#b48ead"},{tag:[u.typeName,u.className],color:"#ebcb8b"},{tag:[u.operator,u.operatorKeyword],color:"#a3be8c"},{tag:[u.tagName],color:"#b48ead"},{tag:[u.squareBracket],color:"#bf616a"},{tag:[u.angleBracket],color:"#d08770"},{tag:[u.attributeName],color:"#ebcb8b"},{tag:[u.regexp],color:"#5e81ac"},{tag:[u.quote],color:"#b48ead"},{tag:[u.string],color:"#a3be8c"},{tag:u.link,color:"#a3be8c",textDecoration:"underline",textUnderlinePosition:"under"},{tag:[u.url,u.escape,u.special(u.string)],color:"#8fbcbb"},{tag:[u.meta],color:"#88c0d0"},{tag:[u.monospace],color:"#d8dee9",fontStyle:"italic"},{tag:[u.comment],color:"#4c566a",fontStyle:"italic"},{tag:u.strong,fontWeight:"bold",color:"#5e81ac"},{tag:u.emphasis,fontStyle:"italic",color:"#5e81ac"},{tag:u.strikethrough,textDecoration:"line-through"},{tag:u.heading,fontWeight:"bold",color:"#5e81ac"},{tag:u.special(u.heading1),fontWeight:"bold",color:"#5e81ac"},{tag:u.heading1,fontWeight:"bold",color:"#5e81ac"},{tag:[u.heading2,u.heading3,u.heading4],fontWeight:"bold",color:"#5e81ac"},{tag:[u.heading5,u.heading6],color:"#5e81ac"},{tag:[u.atom,u.bool,u.special(u.variableName)],color:"#d08770"},{tag:[u.processingInstruction,u.inserted],color:"#8fbcbb"},{tag:[u.contentSeparator],color:"#ebcb8b"},{tag:u.invalid,color:"#434c5e",borderBottom:"1px dotted #d30102"}],J9=n=>{var e={},t=e.theme,r=t===void 0?"dark":t,i=e.settings,s=i===void 0?{}:i,o=e.styles,a=o===void 0?[]:o;return ae({theme:r,settings:se({},H9,s),styles:[...K9,...a]})};J9();var ej={background:"#272822",foreground:"#FFFFFF",caret:"#FFFFFF",selection:"#49483E",selectionMatch:"#49483E",gutterBackground:"#272822",gutterForeground:"#FFFFFF70",lineHighlight:"#0000003b"},tj=[{tag:[u.comment,u.documentMeta],color:"#8292a2"},{tag:[u.number,u.bool,u.null,u.atom],color:"#ae81ff"},{tag:[u.attributeValue,u.className,u.name],color:"#e6db74"},{tag:[u.propertyName,u.attributeName],color:"#a6e22e"},{tag:[u.variableName],color:"#9effff"},{tag:[u.squareBracket],color:"#bababa"},{tag:[u.string,u.special(u.brace)],color:"#e6db74"},{tag:[u.regexp,u.className,u.typeName,u.definition(u.typeName)],color:"#66d9ef"},{tag:[u.definition(u.variableName),u.definition(u.propertyName),u.function(u.variableName)],color:"#fd971f"},{tag:[u.keyword,u.definitionKeyword,u.modifier,u.tagName,u.angleBracket],color:"#f92672"}],nj=n=>{var e={},t=e.theme,r=t===void 0?"dark":t,i=e.settings,s=i===void 0?{}:i,o=e.styles,a=o===void 0?[]:o;return ae({theme:r,settings:se({},ej,s),styles:[...tj,...a]})};nj();var Le={background:"#F5F5F5",foreground:"#333333",selection:"#C9D0D9",cursor:"#54494B",activeLine:"#79ff002b",keyword:"#4B69C6",variable:"#7A3E9D",function:"#AA3731",string:"#448C27",constant:"#9C5D27",type:"#7A3E9D",class:"#AA3731",number:"#9C5D27",comment:"#AAAAAA",heading:"#AA3731",invalid:"#cd3131",regexp:"#4B69C6",tag:"#4B69C6"},rj={background:Le.background,foreground:Le.foreground,caret:Le.cursor,selection:Le.selection,selectionMatch:Le.selection,gutterBackground:Le.background,gutterForeground:Le.foreground,gutterBorder:"transparent",lineHighlight:Le.activeLine},ij=[{tag:u.keyword,color:Le.keyword},{tag:[u.name,u.deleted,u.character,u.macroName],color:Le.variable},{tag:[u.propertyName],color:Le.function},{tag:[u.processingInstruction,u.string,u.inserted,u.special(u.string)],color:Le.string},{tag:[u.function(u.variableName),u.labelName],color:Le.function},{tag:[u.color,u.constant(u.name),u.standard(u.name)],color:Le.constant},{tag:[u.definition(u.name),u.separator],color:Le.variable},{tag:[u.className],color:Le.class},{tag:[u.number,u.changed,u.annotation,u.modifier,u.self,u.namespace],color:Le.number},{tag:[u.typeName],color:Le.type,fontStyle:Le.type},{tag:[u.operator,u.operatorKeyword],color:Le.keyword},{tag:[u.url,u.escape,u.regexp,u.link],color:Le.regexp},{tag:[u.meta,u.comment],color:Le.comment},{tag:u.tagName,color:Le.tag},{tag:u.strong,fontWeight:"bold"},{tag:u.emphasis,fontStyle:"italic"},{tag:u.link,textDecoration:"underline"},{tag:u.heading,fontWeight:"bold",color:Le.heading},{tag:[u.atom,u.bool,u.special(u.variableName)],color:Le.variable},{tag:u.invalid,color:Le.invalid},{tag:u.strikethrough,textDecoration:"line-through"}],sj=n=>{var e={},t=e.theme,r=t===void 0?"light":t,i=e.settings,s=i===void 0?{}:i,o=e.styles,a=o===void 0?[]:o;return ae({theme:r,settings:se({},rj,s),styles:[...ij,...a]})};sj();var _e={background:"#390000",foreground:"#F8F8F8",selection:"#750000",cursor:"#970000",activeLine:"#ff000033",keyword:"#f12727ff",variable:"#edef7dff",function:"#ffb454ff",string:"#edef7dff",constant:"#ec0d1e",type:"#9df39fff",class:"#fec758ff",number:"#994646ff",comment:"#e7c0c0ff",heading:"#fec758ff",invalid:"#ffffffff",regexp:"#edef7dff",tag:"#aa5507ff"},oj={background:_e.background,foreground:_e.foreground,caret:_e.cursor,selection:_e.selection,selectionMatch:_e.selection,gutterBackground:_e.background,gutterForeground:_e.foreground,lineHighlight:_e.activeLine},aj=[{tag:u.keyword,color:_e.keyword},{tag:[u.name,u.deleted,u.character,u.macroName],color:_e.variable},{tag:[u.propertyName],color:_e.function},{tag:[u.processingInstruction,u.string,u.inserted,u.special(u.string)],color:_e.string},{tag:[u.function(u.variableName),u.labelName],color:_e.function},{tag:[u.color,u.constant(u.name),u.standard(u.name)],color:_e.constant},{tag:[u.definition(u.name),u.separator],color:_e.variable},{tag:[u.className],color:_e.class},{tag:[u.number,u.changed,u.annotation,u.modifier,u.self,u.namespace],color:_e.number},{tag:[u.typeName],color:_e.type,fontStyle:_e.type},{tag:[u.operator,u.operatorKeyword],color:_e.keyword},{tag:[u.url,u.escape,u.regexp,u.link],color:_e.regexp},{tag:[u.meta,u.comment],color:_e.comment},{tag:u.tagName,color:_e.tag},{tag:u.strong,fontWeight:"bold"},{tag:u.emphasis,fontStyle:"italic"},{tag:u.link,textDecoration:"underline"},{tag:u.heading,fontWeight:"bold",color:_e.heading},{tag:[u.atom,u.bool,u.special(u.variableName)],color:_e.variable},{tag:u.invalid,color:_e.invalid},{tag:u.strikethrough,textDecoration:"line-through"}],lj=n=>{var e={},t=e.theme,r=t===void 0?"dark":t,i=e.settings,s=i===void 0?{}:i,o=e.styles,a=o===void 0?[]:o;return ae({theme:r,settings:se({},oj,s),styles:[...aj,...a]})};lj();var Be={background:"#002B36",foreground:"#839496",selection:"#004454AA",cursor:"#D30102",activeLine:"#00cafe11",keyword:"#859900",variable:"#268BD2",function:"#268BD2",string:"#2AA198",constant:"#CB4B16",type:"#859900",class:"#268BD2",number:"#D33682",comment:"#586E75",heading:"#268BD2",invalid:"#DC322F",regexp:"#DC322F",tag:"#268BD2"},cj={background:Be.background,foreground:Be.foreground,caret:Be.cursor,selection:Be.selection,selectionMatch:Be.selection,gutterBackground:Be.background,gutterForeground:Be.foreground,gutterBorder:"transparent",lineHighlight:Be.activeLine},uj=[{tag:u.keyword,color:Be.keyword},{tag:[u.name,u.deleted,u.character,u.macroName],color:Be.variable},{tag:[u.propertyName],color:Be.function},{tag:[u.processingInstruction,u.string,u.inserted,u.special(u.string)],color:Be.string},{tag:[u.function(u.variableName),u.labelName],color:Be.function},{tag:[u.color,u.constant(u.name),u.standard(u.name)],color:Be.constant},{tag:[u.definition(u.name),u.separator],color:Be.variable},{tag:[u.className],color:Be.class},{tag:[u.number,u.changed,u.annotation,u.modifier,u.self,u.namespace],color:Be.number},{tag:[u.typeName],color:Be.type,fontStyle:Be.type},{tag:[u.operator,u.operatorKeyword],color:Be.keyword},{tag:[u.url,u.escape,u.regexp,u.link],color:Be.regexp},{tag:[u.meta,u.comment],color:Be.comment},{tag:u.tagName,color:Be.tag},{tag:u.strong,fontWeight:"bold"},{tag:u.emphasis,fontStyle:"italic"},{tag:u.link,textDecoration:"underline"},{tag:u.heading,fontWeight:"bold",color:Be.heading},{tag:[u.atom,u.bool,u.special(u.variableName)],color:Be.variable},{tag:u.invalid,color:Be.invalid},{tag:u.strikethrough,textDecoration:"line-through"}],dj=n=>{var e={},t=e.theme,r=t===void 0?"dark":t,i=e.settings,s=i===void 0?{}:i,o=e.styles,a=o===void 0?[]:o;return ae({theme:r,settings:se({},cj,s),styles:[...uj,...a]})};dj();var Ze={background:"#FDF6E3",foreground:"#657B83",selection:"#EEE8D5",selectionMatch:"#EEE8D5",cursor:"#657B83",activeLine:"#3d392d11",keyword:"#859900",variable:"#268BD2",function:"#268BD2",string:"#2AA198",constant:"#CB4B16",type:"#859900",class:"#268BD2",number:"#D33682",comment:"#93A1A1",heading:"#268BD2",invalid:"#DC322F",regexp:"#DC322F",tag:"#268BD2"},hj={background:Ze.background,foreground:Ze.foreground,caret:Ze.cursor,selection:Ze.selection,selectionMatch:Ze.selectionMatch,gutterBackground:Ze.background,gutterForeground:Ze.foreground,gutterBorder:"transparent",lineHighlight:Ze.activeLine},fj=[{tag:u.keyword,color:Ze.keyword},{tag:[u.name,u.deleted,u.character,u.macroName],color:Ze.variable},{tag:[u.propertyName],color:Ze.function},{tag:[u.processingInstruction,u.string,u.inserted,u.special(u.string)],color:Ze.string},{tag:[u.function(u.variableName),u.labelName],color:Ze.function},{tag:[u.color,u.constant(u.name),u.standard(u.name)],color:Ze.constant},{tag:[u.definition(u.name),u.separator],color:Ze.variable},{tag:[u.className],color:Ze.class},{tag:[u.number,u.changed,u.annotation,u.modifier,u.self,u.namespace],color:Ze.number},{tag:[u.typeName],color:Ze.type,fontStyle:Ze.type},{tag:[u.operator,u.operatorKeyword],color:Ze.keyword},{tag:[u.url,u.escape,u.regexp,u.link],color:Ze.regexp},{tag:[u.meta,u.comment],color:Ze.comment},{tag:u.tagName,color:Ze.tag},{tag:u.strong,fontWeight:"bold"},{tag:u.emphasis,fontStyle:"italic"},{tag:u.link,textDecoration:"underline"},{tag:u.heading,fontWeight:"bold",color:Ze.heading},{tag:[u.atom,u.bool,u.special(u.variableName)],color:Ze.variable},{tag:u.invalid,color:Ze.invalid},{tag:u.strikethrough,textDecoration:"line-through"}],pj=n=>{var e={},t=e.theme,r=t===void 0?"light":t,i=e.settings,s=i===void 0?{}:i,o=e.styles,a=o===void 0?[]:o;return ae({theme:r,settings:se({},hj,s),styles:[...fj,...a]})};pj();var mj={background:"#303841",foreground:"#FFFFFF",caret:"#FBAC52",selection:"#4C5964",selectionMatch:"#3A546E",gutterBackground:"#303841",gutterForeground:"#FFFFFF70",lineHighlight:"#00000059"},gj=[{tag:[u.meta,u.comment],color:"#A2A9B5"},{tag:[u.attributeName,u.keyword],color:"#B78FBA"},{tag:u.function(u.variableName),color:"#5AB0B0"},{tag:[u.string,u.regexp,u.attributeValue],color:"#99C592"},{tag:u.operator,color:"#f47954"},{tag:[u.tagName,u.modifier],color:"#E35F63"},{tag:[u.number,u.definition(u.tagName),u.className,u.definition(u.variableName)],color:"#fbac52"},{tag:[u.atom,u.bool,u.special(u.variableName)],color:"#E35F63"},{tag:u.variableName,color:"#539ac4"},{tag:[u.propertyName,u.typeName],color:"#629ccd"},{tag:u.propertyName,color:"#36b7b5"}];function Oj(n){var e={},t=e.theme,r=t===void 0?"dark":t,i=e.settings,s=i===void 0?{}:i,o=e.styles,a=o===void 0?[]:o;return ae({theme:r,settings:se({},mj,s),styles:[...gj,...a]})}Oj();var bj={background:"#1a1b26",foreground:"#787c99",caret:"#c0caf5",selection:"#515c7e40",selectionMatch:"#16161e",gutterBackground:"#1a1b26",gutterForeground:"#787c99",gutterBorder:"transparent",lineHighlight:"#474b6611"},yj=[{tag:u.keyword,color:"#bb9af7"},{tag:[u.name,u.deleted,u.character,u.macroName],color:"#c0caf5"},{tag:[u.propertyName],color:"#7aa2f7"},{tag:[u.processingInstruction,u.string,u.inserted,u.special(u.string)],color:"#9ece6a"},{tag:[u.function(u.variableName),u.labelName],color:"#7aa2f7"},{tag:[u.color,u.constant(u.name),u.standard(u.name)],color:"#bb9af7"},{tag:[u.definition(u.name),u.separator],color:"#c0caf5"},{tag:[u.className],color:"#c0caf5"},{tag:[u.number,u.changed,u.annotation,u.modifier,u.self,u.namespace],color:"#ff9e64"},{tag:[u.typeName],color:"#0db9d7"},{tag:[u.operator,u.operatorKeyword],color:"#bb9af7"},{tag:[u.url,u.escape,u.regexp,u.link],color:"#b4f9f8"},{tag:[u.meta,u.comment],color:"#444b6a"},{tag:u.strong,fontWeight:"bold"},{tag:u.emphasis,fontStyle:"italic"},{tag:u.link,textDecoration:"underline"},{tag:u.heading,fontWeight:"bold",color:"#89ddff"},{tag:[u.atom,u.bool,u.special(u.variableName)],color:"#c0caf5"},{tag:u.invalid,color:"#ff5370"},{tag:u.strikethrough,textDecoration:"line-through"}],xj=n=>{var e={},t=e.theme,r=t===void 0?"dark":t,i=e.settings,s=i===void 0?{}:i,o=e.styles,a=o===void 0?[]:o;return ae({theme:r,settings:se({},bj,s),styles:[...yj,...a]})};xj();var Sj={background:"#24283b",foreground:"#7982a9",caret:"#c0caf5",selection:"#6f7bb630",selectionMatch:"#343b5f",gutterBackground:"#24283b",gutterForeground:"#7982a9",gutterBorder:"transparent",lineHighlight:"#292e427a"},kj=[{tag:u.keyword,color:"#bb9af7"},{tag:[u.name,u.deleted,u.character,u.macroName],color:"#c0caf5"},{tag:[u.propertyName],color:"#7aa2f7"},{tag:[u.processingInstruction,u.string,u.inserted,u.special(u.string)],color:"#9ece6a"},{tag:[u.function(u.variableName),u.labelName],color:"#7aa2f7"},{tag:[u.color,u.constant(u.name),u.standard(u.name)],color:"#bb9af7"},{tag:[u.definition(u.name),u.separator],color:"#c0caf5"},{tag:[u.className],color:"#c0caf5"},{tag:[u.number,u.changed,u.annotation,u.modifier,u.self,u.namespace],color:"#ff9e64"},{tag:[u.typeName],color:"#2ac3de",fontStyle:"#2ac3de"},{tag:[u.operator,u.operatorKeyword],color:"#bb9af7"},{tag:[u.url,u.escape,u.regexp,u.link],color:"#b4f9f8"},{tag:[u.meta,u.comment],color:"#565f89"},{tag:u.strong,fontWeight:"bold"},{tag:u.emphasis,fontStyle:"italic"},{tag:u.link,textDecoration:"underline"},{tag:u.heading,fontWeight:"bold",color:"#89ddff"},{tag:[u.atom,u.bool,u.special(u.variableName)],color:"#c0caf5"},{tag:u.invalid,color:"#ff5370"},{tag:u.strikethrough,textDecoration:"line-through"}],vj=n=>{var e={},t=e.theme,r=t===void 0?"dark":t,i=e.settings,s=i===void 0?{}:i,o=e.styles,a=o===void 0?[]:o;return ae({theme:r,settings:se({},Sj,s),styles:[...kj,...a]})};vj();var wj={background:"#e1e2e7",foreground:"#3760bf",caret:"#3760bf",selection:"#99a7df",selectionMatch:"#99a7df",gutterBackground:"#e1e2e7",gutterForeground:"#3760bf",gutterBorder:"transparent",lineHighlight:"#5f5faf11"},Qj=[{tag:u.keyword,color:"#007197"},{tag:[u.name,u.deleted,u.character,u.macroName],color:"#3760bf"},{tag:[u.propertyName],color:"#3760bf"},{tag:[u.processingInstruction,u.string,u.inserted,u.special(u.string)],color:"#587539"},{tag:[u.function(u.variableName),u.labelName],color:"#3760bf"},{tag:[u.color,u.constant(u.name),u.standard(u.name)],color:"#3760bf"},{tag:[u.definition(u.name),u.separator],color:"#3760bf"},{tag:[u.className],color:"#3760bf"},{tag:[u.number,u.changed,u.annotation,u.modifier,u.self,u.namespace],color:"#b15c00"},{tag:[u.typeName],color:"#007197",fontStyle:"#007197"},{tag:[u.operator,u.operatorKeyword],color:"#007197"},{tag:[u.url,u.escape,u.regexp,u.link],color:"#587539"},{tag:[u.meta,u.comment],color:"#848cb5"},{tag:u.strong,fontWeight:"bold"},{tag:u.emphasis,fontStyle:"italic"},{tag:u.link,textDecoration:"underline"},{tag:u.heading,fontWeight:"bold",color:"#b15c00"},{tag:[u.atom,u.bool,u.special(u.variableName)],color:"#3760bf"},{tag:u.invalid,color:"#f52a65"},{tag:u.strikethrough,textDecoration:"line-through"}],$j=n=>{var e={},t=e.theme,r=t===void 0?"light":t,i=e.settings,s=i===void 0?{}:i,o=e.styles,a=o===void 0?[]:o;return ae({theme:r,settings:se({},wj,s),styles:[...Qj,...a]})};$j();var We={background:"#002451",foreground:"#ffffff",selection:"#003f8e",cursor:"#ffffff",activeLine:"#00346e7a",keyword:"#EBBBFF",variable:"#FFC58F",function:"#BBDAFF",string:"#D1F1A9",constant:"#FFC58F",type:"#FFEEAD",class:"#BBDAFF",number:"#FFC58F",comment:"#7285B7",heading:"#D1F1A9",invalid:"#a92049",regexp:"#D1F1A9",tag:"#FF9DA4"},Cj={background:We.background,foreground:We.foreground,caret:We.cursor,selection:We.selection,selectionMatch:We.selection,gutterBackground:We.background,gutterForeground:We.foreground,lineHighlight:We.activeLine},Pj=[{tag:u.keyword,color:We.keyword},{tag:[u.name,u.deleted,u.character,u.macroName],color:We.variable},{tag:[u.propertyName],color:We.function},{tag:[u.processingInstruction,u.string,u.inserted,u.special(u.string)],color:We.string},{tag:[u.function(u.variableName),u.labelName],color:We.function},{tag:[u.color,u.constant(u.name),u.standard(u.name)],color:We.constant},{tag:[u.definition(u.name),u.separator],color:We.variable},{tag:[u.className],color:We.class},{tag:[u.number,u.changed,u.annotation,u.modifier,u.self,u.namespace],color:We.number},{tag:[u.typeName],color:We.type,fontStyle:We.type},{tag:[u.operator,u.operatorKeyword],color:We.keyword},{tag:[u.url,u.escape,u.regexp,u.link],color:We.regexp},{tag:[u.meta,u.comment],color:We.comment},{tag:u.tagName,color:We.tag},{tag:u.strong,fontWeight:"bold"},{tag:u.emphasis,fontStyle:"italic"},{tag:u.link,textDecoration:"underline"},{tag:u.heading,fontWeight:"bold",color:We.heading},{tag:[u.atom,u.bool,u.special(u.variableName)],color:We.variable},{tag:u.invalid,color:We.invalid},{tag:u.strikethrough,textDecoration:"line-through"}],Tj=n=>{var e={},t=e.theme,r=t===void 0?"dark":t,i=e.settings,s=i===void 0?{}:i,o=e.styles,a=o===void 0?[]:o;return ae({theme:r,settings:se({},Cj,s),styles:[...Pj,...a]})};Tj();var Mj={background:"#ffffff",foreground:"#383a42",caret:"#000",selection:"#add6ff",selectionMatch:"#a8ac94",lineHighlight:"#99999926",gutterBackground:"#fff",gutterForeground:"#237893",gutterActiveForeground:"#0b216f",fontFamily:'Menlo, Monaco, Consolas, "Andale Mono", "Ubuntu Mono", "Courier New", monospace'},Aj=[{tag:[u.keyword,u.operatorKeyword,u.modifier,u.color,u.constant(u.name),u.standard(u.name),u.standard(u.tagName),u.special(u.brace),u.atom,u.bool,u.special(u.variableName)],color:"#0000ff"},{tag:[u.moduleKeyword,u.controlKeyword],color:"#af00db"},{tag:[u.name,u.deleted,u.character,u.macroName,u.propertyName,u.variableName,u.labelName,u.definition(u.name)],color:"#0070c1"},{tag:u.heading,fontWeight:"bold",color:"#0070c1"},{tag:[u.typeName,u.className,u.tagName,u.number,u.changed,u.annotation,u.self,u.namespace],color:"#267f99"},{tag:[u.function(u.variableName),u.function(u.propertyName)],color:"#795e26"},{tag:[u.number],color:"#098658"},{tag:[u.operator,u.punctuation,u.separator,u.url,u.escape,u.regexp],color:"#383a42"},{tag:[u.regexp],color:"#af00db"},{tag:[u.special(u.string),u.processingInstruction,u.string,u.inserted],color:"#a31515"},{tag:[u.angleBracket],color:"#383a42"},{tag:u.strong,fontWeight:"bold"},{tag:u.emphasis,fontStyle:"italic"},{tag:u.strikethrough,textDecoration:"line-through"},{tag:[u.meta,u.comment],color:"#008000"},{tag:u.link,color:"#4078f2",textDecoration:"underline"},{tag:u.invalid,color:"#e45649"}];function Rj(n){var e={},t=e.theme,r=t===void 0?"light":t,i=e.settings,s=i===void 0?{}:i,o=e.styles,a=o===void 0?[]:o;return ae({theme:r,settings:se({},Mj,s),styles:[...Aj,...a]})}Rj();var Ej={background:"#1e1e1e",foreground:"#9cdcfe",caret:"#c6c6c6",selection:"#6199ff2f",selectionMatch:"#72a1ff59",lineHighlight:"#ffffff0f",gutterBackground:"#1e1e1e",gutterForeground:"#838383",gutterActiveForeground:"#fff",fontFamily:'Menlo, Monaco, Consolas, "Andale Mono", "Ubuntu Mono", "Courier New", monospace'},Nj=[{tag:[u.keyword,u.operatorKeyword,u.modifier,u.color,u.constant(u.name),u.standard(u.name),u.standard(u.tagName),u.special(u.brace),u.atom,u.bool,u.special(u.variableName)],color:"#569cd6"},{tag:[u.controlKeyword,u.moduleKeyword],color:"#c586c0"},{tag:[u.name,u.deleted,u.character,u.macroName,u.propertyName,u.variableName,u.labelName,u.definition(u.name)],color:"#9cdcfe"},{tag:u.heading,fontWeight:"bold",color:"#9cdcfe"},{tag:[u.typeName,u.className,u.tagName,u.number,u.changed,u.annotation,u.self,u.namespace],color:"#4ec9b0"},{tag:[u.function(u.variableName),u.function(u.propertyName)],color:"#dcdcaa"},{tag:[u.number],color:"#b5cea8"},{tag:[u.operator,u.punctuation,u.separator,u.url,u.escape,u.regexp],color:"#d4d4d4"},{tag:[u.regexp],color:"#d16969"},{tag:[u.special(u.string),u.processingInstruction,u.string,u.inserted],color:"#ce9178"},{tag:[u.angleBracket],color:"#808080"},{tag:u.strong,fontWeight:"bold"},{tag:u.emphasis,fontStyle:"italic"},{tag:u.strikethrough,textDecoration:"line-through"},{tag:[u.meta,u.comment],color:"#6a9955"},{tag:u.link,color:"#6a9955",textDecoration:"underline"},{tag:u.invalid,color:"#ff0000"}];function Dj(n){var e={},t=e.theme,r=t===void 0?"dark":t,i=e.settings,s=i===void 0?{}:i,o=e.styles,a=o===void 0?[]:o;return ae({theme:r,settings:se({},Ej,s),styles:[...Nj,...a]})}var jj=Dj(),Ve={background:"#000",foreground:"#fff",selection:"#7d46fc3f",selectionMatch:"#7d46fc7f",cursor:"#7d46fc",activeLine:"#00346eb0",keyword:null,variable:null,function:null,string:"#a8a8b1",constant:null,type:null,class:null,comment:"#2e2e37",heading:null,invalid:null,regexp:"#a8a8b1",tag:null},Ij={background:Ve.background,foreground:Ve.foreground,caret:Ve.cursor,selection:Ve.selection,selectionMatch:Ve.selectionMatch,gutterBackground:Ve.background,gutterForeground:Ve.foreground,lineHighlight:Ve.activeLine},Xj=[{tag:u.keyword,color:Ve.keyword,fontWeight:"bold"},{tag:[u.name,u.deleted,u.character,u.macroName],color:Ve.variable},{tag:[u.propertyName],color:Ve.function},{tag:[u.processingInstruction,u.string,u.inserted,u.special(u.string)],color:Ve.string},{tag:[u.function(u.variableName),u.labelName],color:Ve.function},{tag:[u.color,u.constant(u.name),u.standard(u.name)],color:Ve.constant},{tag:[u.definition(u.name),u.separator],color:Ve.variable},{tag:[u.className],color:Ve.class},{tag:[u.typeName],color:Ve.type,fontStyle:Ve.type},{tag:[u.url,u.escape,u.regexp,u.link],color:Ve.regexp},{tag:[u.meta,u.comment],color:Ve.comment},{tag:u.tagName,color:Ve.tag},{tag:u.strong,fontWeight:"bold"},{tag:u.emphasis,fontStyle:"italic"},{tag:u.link,textDecoration:"underline"},{tag:u.heading,fontWeight:"bold",color:Ve.heading},{tag:[u.atom,u.special(u.variableName)],color:Ve.variable},{tag:u.invalid,color:Ve.invalid},{tag:u.strikethrough,textDecoration:"line-through"},{tag:[u.operatorKeyword,u.bool,u.null,u.variableName],color:Ve.constant},{tag:[u.operator],color:"#bb9af7"},{tag:[u.number],color:"#a8a8b1"},{tag:[u.bracket],color:"#bb9af7"}],Lj=n=>{var e={},t=e.theme,r=t===void 0?"dark":t,i=e.settings,s=i===void 0?{}:i,o=e.styles,a=o===void 0?[]:o;return ae({theme:r,settings:se({},Ij,s),styles:[...Xj,...a]})};Lj();var Fe={background:"#fff",foreground:"#000",selection:"#0064ff26",selectionMatch:"#0064ff4c",cursor:"#004bff",activeLine:"#0064ff0c",keyword:null,variable:null,function:null,string:"#6b7a88",constant:null,type:null,class:null,comment:"#bec9d3",heading:null,invalid:null,regexp:"#6b7a88",tag:null},_j={background:Fe.background,foreground:Fe.foreground,caret:Fe.cursor,selection:Fe.selection,selectionMatch:Fe.selectionMatch,gutterBackground:Fe.background,gutterForeground:Fe.foreground,lineHighlight:Fe.activeLine},Bj=[{tag:u.keyword,color:Fe.keyword,fontWeight:"bold"},{tag:[u.name,u.deleted,u.character,u.macroName],color:Fe.variable},{tag:[u.propertyName],color:Fe.function},{tag:[u.processingInstruction,u.string,u.inserted,u.special(u.string)],color:Fe.string},{tag:[u.function(u.variableName),u.labelName],color:Fe.function},{tag:[u.color,u.constant(u.name),u.standard(u.name)],color:Fe.constant},{tag:[u.definition(u.name),u.separator],color:Fe.variable},{tag:[u.className],color:Fe.class},{tag:[u.typeName],color:Fe.type,fontStyle:Fe.type},{tag:[u.url,u.escape,u.regexp,u.link],color:Fe.regexp},{tag:[u.meta,u.comment],color:Fe.comment},{tag:u.tagName,color:Fe.tag},{tag:u.strong,fontWeight:"bold"},{tag:u.emphasis,fontStyle:"italic"},{tag:u.link,textDecoration:"underline"},{tag:u.heading,fontWeight:"bold",color:Fe.heading},{tag:[u.atom,u.special(u.variableName)],color:Fe.variable},{tag:u.invalid,color:Fe.invalid},{tag:u.strikethrough,textDecoration:"line-through"},{tag:[u.operatorKeyword,u.bool,u.null,u.variableName],color:Fe.constant},{tag:[u.operator],color:"#0431fa"},{tag:[u.number],color:"#a8a8b1"},{tag:[u.bracket],color:"#0431fa"}],Zj=n=>{var e={},t=e.theme,r=t===void 0?"light":t,i=e.settings,s=i===void 0?{}:i,o=e.styles,a=o===void 0?[]:o;return ae({theme:r,settings:se({},_j,s),styles:[...Bj,...a]})};Zj();var Wj={background:"#fff",foreground:"#3D3D3D",selection:"#BBDFFF",selectionMatch:"#BBDFFF",gutterBackground:"#fff",gutterForeground:"#AFAFAF",lineHighlight:"#d5e6ff69"},zj=[{tag:[u.comment,u.quote],color:"#707F8D"},{tag:[u.typeName,u.typeOperator],color:"#aa0d91"},{tag:[u.keyword],color:"#aa0d91",fontWeight:"bold"},{tag:[u.string,u.meta],color:"#D23423"},{tag:[u.name],color:"#032f62"},{tag:[u.typeName],color:"#522BB2"},{tag:[u.variableName],color:"#23575C"},{tag:[u.definition(u.variableName)],color:"#327A9E"},{tag:[u.regexp,u.link],color:"#0e0eff"}];function Vj(n){var e={},t=e.theme,r=t===void 0?"light":t,i=e.settings,s=i===void 0?{}:i,o=e.styles,a=o===void 0?[]:o;return ae({theme:r,settings:se({},Wj,s),styles:[...zj,...a]})}Vj();var Fj={background:"#292A30",foreground:"#CECFD0",caret:"#fff",selection:"#727377",selectionMatch:"#727377",lineHighlight:"#ffffff0f"},qj=[{tag:[u.comment,u.quote],color:"#7F8C98"},{tag:[u.keyword],color:"#FF7AB2",fontWeight:"bold"},{tag:[u.string,u.meta],color:"#FF8170"},{tag:[u.typeName],color:"#DABAFF"},{tag:[u.definition(u.variableName)],color:"#6BDFFF"},{tag:[u.name],color:"#6BAA9F"},{tag:[u.variableName],color:"#ACF2E4"},{tag:[u.regexp,u.link],color:"#FF8170"}],Yj=n=>{var e={},t=e.theme,r=t===void 0?"dark":t,i=e.settings,s=i===void 0?{}:i,o=e.styles,a=o===void 0?[]:o;return ae({theme:r,settings:se({},Fj,s),styles:[...qj,...a]})};Yj();const Uj=n=>{let{state:e}=n,t=e.doc.lineAt(e.selection.main.from),r=tg(n.state,t.from);return r.line?Gj(n):r.block?Kj(n):!1};function eg(n,e){return({state:t,dispatch:r})=>{if(t.readOnly)return!1;let i=n(e,t);return i?(r(t.update(i)),!0):!1}}const Gj=eg(t6,0),Hj=eg(Rv,0),Kj=eg((n,e)=>Rv(n,e,e6(e)),0);function tg(n,e){let t=n.languageDataAt("commentTokens",e,1);return t.length?t[0]:{}}const Mo=50;function Jj(n,{open:e,close:t},r,i){let s=n.sliceDoc(r-Mo,r),o=n.sliceDoc(i,i+Mo),a=/\s*$/.exec(s)[0].length,l=/^\s*/.exec(o)[0].length,c=s.length-a;if(s.slice(c-e.length,c)==e&&o.slice(l,l+t.length)==t)return{open:{pos:r-a,margin:a&&1},close:{pos:i+l,margin:l&&1}};let d,h;i-r<=2*Mo?d=h=n.sliceDoc(r,i):(d=n.sliceDoc(r,r+Mo),h=n.sliceDoc(i-Mo,i));let f=/^\s*/.exec(d)[0].length,p=/\s*$/.exec(h)[0].length,m=h.length-p-t.length;return d.slice(f,f+e.length)==e&&h.slice(m,m+t.length)==t?{open:{pos:r+f+e.length,margin:/\s/.test(d.charAt(f+e.length))?1:0},close:{pos:i-p-t.length,margin:/\s/.test(h.charAt(m-1))?1:0}}:null}function e6(n){let e=[];for(let t of n.selection.ranges){let r=n.doc.lineAt(t.from),i=t.to<=r.to?r:n.doc.lineAt(t.to);i.from>r.from&&i.from==t.to&&(i=t.to==r.to+1?r:n.doc.lineAt(t.to-1));let s=e.length-1;s>=0&&e[s].to>r.from?e[s].to=i.to:e.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return e}function Rv(n,e,t=e.selection.ranges){let r=t.map(s=>tg(e,s.from).block);if(!r.every(s=>s))return null;let i=t.map((s,o)=>Jj(e,r[o],s.from,s.to));if(n!=2&&!i.every(s=>s))return{changes:e.changes(t.map((s,o)=>i[o]?[]:[{from:s.from,insert:r[o].open+" "},{from:s.to,insert:" "+r[o].close}]))};if(n!=1&&i.some(s=>s)){let s=[];for(let o=0,a;o<i.length;o++)if(a=i[o]){let l=r[o],{open:c,close:d}=a;s.push({from:c.pos-l.open.length,to:c.pos+c.margin},{from:d.pos-d.margin,to:d.pos+l.close.length})}return{changes:s}}return null}function t6(n,e,t=e.selection.ranges){let r=[],i=-1;e:for(let{from:s,to:o}of t){let a=r.length,l=1e9,c;for(let d=s;d<=o;){let h=e.doc.lineAt(d);if(c==null&&(c=tg(e,h.from).line,!c))continue e;if(h.from>i&&(s==o||o>h.from)){i=h.from;let f=/^\s*/.exec(h.text)[0].length,p=f==h.length,m=h.text.slice(f,f+c.length)==c?f:-1;f<h.text.length&&f<l&&(l=f),r.push({line:h,comment:m,token:c,indent:f,empty:p,single:!1})}d=h.to+1}if(l<1e9)for(let d=a;d<r.length;d++)r[d].indent<r[d].line.text.length&&(r[d].indent=l);r.length==a+1&&(r[a].single=!0)}if(n!=2&&r.some(s=>s.comment<0&&(!s.empty||s.single))){let s=[];for(let{line:a,token:l,indent:c,empty:d,single:h}of r)(h||!d)&&s.push({from:a.from+c,insert:l+" "});let o=e.changes(s);return{changes:o,selection:e.selection.map(o,1)}}else if(n!=1&&r.some(s=>s.comment>=0)){let s=[];for(let{line:o,comment:a,token:l}of r)if(a>=0){let c=o.from+a,d=c+l.length;o.text[d-o.from]==" "&&d++,s.push({from:c,to:d})}return{changes:s}}return null}const hp=Or.define(),n6=Or.define(),r6=W.define(),Ev=W.define({combine(n){return br(n,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(r,i)=>e(r,i)||t(r,i)})}}),Nv=Mt.define({create(){return oa.empty},update(n,e){let t=e.state.facet(Ev),r=e.annotation(hp);if(r){let l=Jt.fromTransaction(e,r.selection),c=r.side,d=c==0?n.undone:n.done;return l?d=uu(d,d.length,t.minDepth,l):d=Iv(d,e.startState.selection),new oa(c==0?r.rest:d,c==0?d:r.rest)}let i=e.annotation(n6);if((i=="full"||i=="before")&&(n=n.isolate()),e.annotation(Wt.addToHistory)===!1)return e.changes.empty?n:n.addMapping(e.changes.desc);let s=Jt.fromTransaction(e),o=e.annotation(Wt.time),a=e.annotation(Wt.userEvent);return s?n=n.addChanges(s,o,a,t,e):e.selection&&(n=n.addSelection(e.startState.selection,o,a,t.newGroupDelay)),(i=="full"||i=="after")&&(n=n.isolate()),n},toJSON(n){return{done:n.done.map(e=>e.toJSON()),undone:n.undone.map(e=>e.toJSON())}},fromJSON(n){return new oa(n.done.map(Jt.fromJSON),n.undone.map(Jt.fromJSON))}});function i6(n={}){return[Nv,Ev.of(n),X.domEventHandlers({beforeinput(e,t){let r=e.inputType=="historyUndo"?Dv:e.inputType=="historyRedo"?fp:null;return r?(e.preventDefault(),r(t)):!1}})]}function xd(n,e){return function({state:t,dispatch:r}){if(!e&&t.readOnly)return!1;let i=t.field(Nv,!1);if(!i)return!1;let s=i.pop(n,t,e);return s?(r(s),!0):!1}}const Dv=xd(0,!1),fp=xd(1,!1),s6=xd(0,!0),o6=xd(1,!0);class Jt{constructor(e,t,r,i,s){this.changes=e,this.effects=t,this.mapped=r,this.startSelection=i,this.selectionsAfter=s}setSelAfter(e){return new Jt(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,r;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(t=this.mapped)===null||t===void 0?void 0:t.toJSON(),startSelection:(r=this.startSelection)===null||r===void 0?void 0:r.toJSON(),selectionsAfter:this.selectionsAfter.map(i=>i.toJSON())}}static fromJSON(e){return new Jt(e.changes&&ft.fromJSON(e.changes),[],e.mapped&&cr.fromJSON(e.mapped),e.startSelection&&A.fromJSON(e.startSelection),e.selectionsAfter.map(A.fromJSON))}static fromTransaction(e,t){let r=Tn;for(let i of e.startState.facet(r6)){let s=i(e);s.length&&(r=r.concat(s))}return!r.length&&e.changes.empty?null:new Jt(e.changes.invert(e.startState.doc),r,void 0,t||e.startState.selection,Tn)}static selection(e){return new Jt(void 0,Tn,void 0,void 0,e)}}function uu(n,e,t,r){let i=e+1>t+20?e-t-1:0,s=n.slice(i,e);return s.push(r),s}function a6(n,e){let t=[],r=!1;return n.iterChangedRanges((i,s)=>t.push(i,s)),e.iterChangedRanges((i,s,o,a)=>{for(let l=0;l<t.length;){let c=t[l++],d=t[l++];a>=c&&o<=d&&(r=!0)}}),r}function l6(n,e){return n.ranges.length==e.ranges.length&&n.ranges.filter((t,r)=>t.empty!=e.ranges[r].empty).length===0}function jv(n,e){return n.length?e.length?n.concat(e):n:e}const Tn=[],c6=200;function Iv(n,e){if(n.length){let t=n[n.length-1],r=t.selectionsAfter.slice(Math.max(0,t.selectionsAfter.length-c6));return r.length&&r[r.length-1].eq(e)?n:(r.push(e),uu(n,n.length-1,1e9,t.setSelAfter(r)))}else return[Jt.selection([e])]}function u6(n){let e=n[n.length-1],t=n.slice();return t[n.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),t}function Ah(n,e){if(!n.length)return n;let t=n.length,r=Tn;for(;t;){let i=d6(n[t-1],e,r);if(i.changes&&!i.changes.empty||i.effects.length){let s=n.slice(0,t);return s[t-1]=i,s}else e=i.mapped,t--,r=i.selectionsAfter}return r.length?[Jt.selection(r)]:Tn}function d6(n,e,t){let r=jv(n.selectionsAfter.length?n.selectionsAfter.map(a=>a.map(e)):Tn,t);if(!n.changes)return Jt.selection(r);let i=n.changes.map(e),s=e.mapDesc(n.changes,!0),o=n.mapped?n.mapped.composeDesc(s):s;return new Jt(i,oe.mapEffects(n.effects,e),o,n.startSelection.map(s),r)}const h6=/^(input\.type|delete)($|\.)/;let oa=class Vo{constructor(e,t,r=0,i=void 0){this.done=e,this.undone=t,this.prevTime=r,this.prevUserEvent=i}isolate(){return this.prevTime?new Vo(this.done,this.undone):this}addChanges(e,t,r,i,s){let o=this.done,a=o[o.length-1];return a&&a.changes&&!a.changes.empty&&e.changes&&(!r||h6.test(r))&&(!a.selectionsAfter.length&&t-this.prevTime<i.newGroupDelay&&i.joinToEvent(s,a6(a.changes,e.changes))||r=="input.type.compose")?o=uu(o,o.length-1,i.minDepth,new Jt(e.changes.compose(a.changes),jv(oe.mapEffects(e.effects,a.changes),a.effects),a.mapped,a.startSelection,Tn)):o=uu(o,o.length,i.minDepth,e),new Vo(o,Tn,t,r)}addSelection(e,t,r,i){let s=this.done.length?this.done[this.done.length-1].selectionsAfter:Tn;return s.length>0&&t-this.prevTime<i&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&l6(s[s.length-1],e)?this:new Vo(Iv(this.done,e),this.undone,t,r)}addMapping(e){return new Vo(Ah(this.done,e),Ah(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,t,r){let i=e==0?this.done:this.undone;if(i.length==0)return null;let s=i[i.length-1],o=s.selectionsAfter[0]||(s.startSelection?s.startSelection.map(s.changes.invertedDesc,1):t.selection);if(r&&s.selectionsAfter.length)return t.update({selection:s.selectionsAfter[s.selectionsAfter.length-1],annotations:hp.of({side:e,rest:u6(i),selection:o}),userEvent:e==0?"select.undo":"select.redo",scrollIntoView:!0});if(s.changes){let a=i.length==1?Tn:i.slice(0,i.length-1);return s.mapped&&(a=Ah(a,s.mapped)),t.update({changes:s.changes,selection:s.startSelection,effects:s.effects,annotations:hp.of({side:e,rest:a,selection:o}),filter:!1,userEvent:e==0?"undo":"redo",scrollIntoView:!0})}else return null}};oa.empty=new oa(Tn,Tn);const f6=[{key:"Mod-z",run:Dv,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:fp,preventDefault:!0},{linux:"Ctrl-Shift-z",run:fp,preventDefault:!0},{key:"Mod-u",run:s6,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:o6,preventDefault:!0}];function Oo(n,e){return A.create(n.ranges.map(e),n.mainIndex)}function Vn(n,e){return n.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function Fn({state:n,dispatch:e},t){let r=Oo(n.selection,t);return r.eq(n.selection,!0)?!1:(e(Vn(n,r)),!0)}function Sd(n,e){return A.cursor(e?n.to:n.from)}function Xv(n,e){return Fn(n,t=>t.empty?n.moveByChar(t,e):Sd(t,e))}function Lt(n){return n.textDirectionAt(n.state.selection.main.head)==Re.LTR}const Lv=n=>Xv(n,!Lt(n)),_v=n=>Xv(n,Lt(n));function Bv(n,e){return Fn(n,t=>t.empty?n.moveByGroup(t,e):Sd(t,e))}const p6=n=>Bv(n,!Lt(n)),m6=n=>Bv(n,Lt(n));function g6(n,e,t){if(e.type.prop(t))return!0;let r=e.to-e.from;return r&&(r>2||/[^\s,.;:]/.test(n.sliceDoc(e.from,e.to)))||e.firstChild}function kd(n,e,t){let r=Je(n).resolveInner(e.head),i=t?he.closedBy:he.openedBy;for(let l=e.head;;){let c=t?r.childAfter(l):r.childBefore(l);if(!c)break;g6(n,c,i)?r=c:l=t?c.to:c.from}let s=r.type.prop(i),o,a;return s&&(o=t?lr(n,r.from,1):lr(n,r.to,-1))&&o.matched?a=t?o.end.to:o.end.from:a=t?r.to:r.from,A.cursor(a,t?-1:1)}const O6=n=>Fn(n,e=>kd(n.state,e,!Lt(n))),b6=n=>Fn(n,e=>kd(n.state,e,Lt(n)));function Zv(n,e){return Fn(n,t=>{if(!t.empty)return Sd(t,e);let r=n.moveVertically(t,e);return r.head!=t.head?r:n.moveToLineBoundary(t,e)})}const Wv=n=>Zv(n,!1),zv=n=>Zv(n,!0);function Vv(n){let e=n.scrollDOM.clientHeight<n.scrollDOM.scrollHeight-2,t=0,r=0,i;if(e){for(let s of n.state.facet(X.scrollMargins)){let o=s(n);o?.top&&(t=Math.max(o?.top,t)),o?.bottom&&(r=Math.max(o?.bottom,r))}i=n.scrollDOM.clientHeight-t-r}else i=(n.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:t,marginBottom:r,selfScroll:e,height:Math.max(n.defaultLineHeight,i-5)}}function Fv(n,e){let t=Vv(n),{state:r}=n,i=Oo(r.selection,o=>o.empty?n.moveVertically(o,e,t.height):Sd(o,e));if(i.eq(r.selection))return!1;let s;if(t.selfScroll){let o=n.coordsAtPos(r.selection.main.head),a=n.scrollDOM.getBoundingClientRect(),l=a.top+t.marginTop,c=a.bottom-t.marginBottom;o&&o.top>l&&o.bottom<c&&(s=X.scrollIntoView(i.main.head,{y:"start",yMargin:o.top-l}))}return n.dispatch(Vn(r,i),{effects:s}),!0}const T1=n=>Fv(n,!1),pp=n=>Fv(n,!0);function $i(n,e,t){let r=n.lineBlockAt(e.head),i=n.moveToLineBoundary(e,t);if(i.head==e.head&&i.head!=(t?r.to:r.from)&&(i=n.moveToLineBoundary(e,t,!1)),!t&&i.head==r.from&&r.length){let s=/^\s*/.exec(n.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;s&&e.head!=r.from+s&&(i=A.cursor(r.from+s))}return i}const y6=n=>Fn(n,e=>$i(n,e,!0)),x6=n=>Fn(n,e=>$i(n,e,!1)),S6=n=>Fn(n,e=>$i(n,e,!Lt(n))),k6=n=>Fn(n,e=>$i(n,e,Lt(n))),v6=n=>Fn(n,e=>n.moveToLineBoundary(e,!1,!1)),w6=n=>Fn(n,e=>n.moveToLineBoundary(e,!0,!1));function Q6(n,e,t){let r=!1,i=Oo(n.selection,s=>{let o=lr(n,s.head,-1)||lr(n,s.head,1)||s.head>0&&lr(n,s.head-1,1)||s.head<n.doc.length&&lr(n,s.head+1,-1);if(!o||!o.end)return s;r=!0;let a=o.start.from==s.head?o.end.to:o.end.from;return A.cursor(a)});return r?(e(Vn(n,i)),!0):!1}const $6=({state:n,dispatch:e})=>Q6(n,e);function Rn(n,e,t){let r=Oo(n.state.selection,i=>{i.undirectional&&i.head>=i.anchor!=e&&(i=A.range(i.head,i.anchor));let s=t(i);return A.range(i.anchor,s.head,s.goalColumn,s.bidiLevel||void 0,s.assoc)});return r.eq(n.state.selection)?!1:(n.dispatch(Vn(n.state,r)),!0)}function qv(n,e){return Rn(n,e,t=>n.moveByChar(t,e))}const Yv=n=>qv(n,!Lt(n)),Uv=n=>qv(n,Lt(n));function Gv(n,e){return Rn(n,e,t=>n.moveByGroup(t,e))}const C6=n=>Gv(n,!Lt(n)),P6=n=>Gv(n,Lt(n)),T6=n=>{let e=!Lt(n);return Rn(n,e,t=>kd(n.state,t,e))},M6=n=>{let e=Lt(n);return Rn(n,e,t=>kd(n.state,t,e))};function Hv(n,e){return Rn(n,e,t=>n.moveVertically(t,e))}const Kv=n=>Hv(n,!1),Jv=n=>Hv(n,!0);function ew(n,e){return Rn(n,e,t=>n.moveVertically(t,e,Vv(n).height))}const M1=n=>ew(n,!1),A1=n=>ew(n,!0),A6=n=>Rn(n,!0,e=>$i(n,e,!0)),R6=n=>Rn(n,!1,e=>$i(n,e,!1)),E6=n=>{let e=!Lt(n);return Rn(n,e,t=>$i(n,t,e))},N6=n=>{let e=Lt(n);return Rn(n,e,t=>$i(n,t,e))},D6=n=>Rn(n,!1,e=>A.cursor(n.lineBlockAt(e.head).from)),j6=n=>Rn(n,!0,e=>A.cursor(n.lineBlockAt(e.head).to)),R1=({state:n,dispatch:e})=>(e(Vn(n,{anchor:0})),!0),E1=({state:n,dispatch:e})=>(e(Vn(n,{anchor:n.doc.length})),!0),N1=({state:n,dispatch:e})=>(e(Vn(n,{anchor:n.selection.main.anchor,head:0})),!0),D1=({state:n,dispatch:e})=>(e(Vn(n,{anchor:n.selection.main.anchor,head:n.doc.length})),!0),I6=({state:n,dispatch:e})=>(e(n.update({selection:{anchor:0,head:n.doc.length},userEvent:"select"})),!0),X6=({state:n,dispatch:e})=>{let t=vd(n).map(({from:r,to:i})=>A.undirectionalRange(r,Math.min(i+1,n.doc.length)));return e(n.update({selection:A.create(t),userEvent:"select"})),!0},L6=({state:n,dispatch:e})=>{let t=Oo(n.selection,r=>{let i=Je(n),s=i.resolveStack(r.from,1);if(r.empty){let o=i.resolveStack(r.from,-1);o.node.from>=s.node.from&&o.node.to<=s.node.to&&(s=o)}for(let o=s;o;o=o.next){let{node:a}=o;if((a.from<r.from&&a.to>=r.to||a.to>r.to&&a.from<=r.from)&&o.next)return A.undirectionalRange(a.from,a.to)}return r});return t.eq(n.selection)?!1:(e(Vn(n,t)),!0)};function tw(n,e){let{state:t}=n,r=t.selection,i=t.selection.ranges.slice();for(let s of t.selection.ranges){let o=t.doc.lineAt(s.head);if(e?o.to<n.state.doc.length:o.from>0)for(let a=s;;){let l=n.moveVertically(a,e);if(l.head<o.from||l.head>o.to){i.some(c=>c.head==l.head)||i.push(l);break}else{if(l.head==a.head)break;a=l}}}return i.length==r.ranges.length?!1:(n.dispatch(Vn(t,A.create(i,i.length-1))),!0)}const _6=n=>tw(n,!1),B6=n=>tw(n,!0),Z6=({state:n,dispatch:e})=>{let t=n.selection,r=null;return t.ranges.length>1?r=A.create([t.main]):t.main.empty||(r=A.create([A.cursor(t.main.head)])),r?(e(Vn(n,r)),!0):!1};function ml(n,e){if(n.state.readOnly)return!1;let t="delete.selection",{state:r}=n,i=r.changeByRange(s=>{let{from:o,to:a}=s;if(o==a){let l=e(s);l<o?(t="delete.backward",l=Fl(n,l,!1)):l>o&&(t="delete.forward",l=Fl(n,l,!0)),o=Math.min(o,l),a=Math.max(a,l)}else o=Fl(n,o,!1),a=Fl(n,a,!0);return o==a?{range:s}:{changes:{from:o,to:a},range:A.cursor(o,o<s.head?-1:1)}});return i.changes.empty?!1:(n.dispatch(r.update(i,{scrollIntoView:!0,userEvent:t,effects:t=="delete.selection"?X.announce.of(r.phrase("Selection deleted")):void 0})),!0)}function Fl(n,e,t){if(n instanceof X)for(let r of n.state.facet(X.atomicRanges).map(i=>i(n)))r.between(e,e,(i,s)=>{i<e&&s>e&&(e=t?s:i)});return e}const nw=(n,e,t)=>ml(n,r=>{let i=r.from,{state:s}=n,o=s.doc.lineAt(i),a,l;if(t&&!e&&i>o.from&&i<o.from+200&&!/[^ \t]/.test(a=o.text.slice(0,i-o.from))){if(a[a.length-1]==" ")return i-1;let c=po(a,s.tabSize),d=c%nu(s)||nu(s);for(let h=0;h<d&&a[a.length-1-h]==" ";h++)i--;l=i}else l=bt(o.text,i-o.from,e,e)+o.from,l==i&&o.number!=(e?s.doc.lines:1)?l+=e?1:-1:!e&&/[\ufe00-\ufe0f]/.test(o.text.slice(l-o.from,i-o.from))&&(l=bt(o.text,l-o.from,!1,!1)+o.from);return l}),mp=n=>nw(n,!1,!0),rw=n=>nw(n,!0,!1),iw=(n,e)=>ml(n,t=>{let r=t.head,{state:i}=n,s=i.doc.lineAt(r),o=i.charCategorizer(r);for(let a=null;;){if(r==(e?s.to:s.from)){r==t.head&&s.number!=(e?i.doc.lines:1)&&(r+=e?1:-1);break}let l=bt(s.text,r-s.from,e)+s.from,c=s.text.slice(Math.min(r,l)-s.from,Math.max(r,l)-s.from),d=o(c);if(a!=null&&d!=a)break;(c!=" "||r!=t.head)&&(a=d),r=l}return r}),sw=n=>iw(n,!1),W6=n=>iw(n,!0),z6=n=>ml(n,e=>{let t=n.lineBlockAt(e.head).to;return e.head<t?t:Math.min(n.state.doc.length,e.head+1)}),V6=n=>ml(n,e=>{let t=n.moveToLineBoundary(e,!1).head;return e.head>t?t:Math.max(0,e.head-1)}),F6=n=>ml(n,e=>{let t=n.moveToLineBoundary(e,!0).head;return e.head<t?t:Math.min(n.state.doc.length,e.head+1)}),q6=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=n.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:xe.of(["",""])},range:A.cursor(r.from)}));return e(n.update(t,{scrollIntoView:!0,userEvent:"input"})),!0},Y6=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=n.changeByRange(r=>{if(!r.empty||r.from==0||r.from==n.doc.length)return{range:r};let i=r.from,s=n.doc.lineAt(i),o=i==s.from?i-1:bt(s.text,i-s.from,!1)+s.from,a=i==s.to?i+1:bt(s.text,i-s.from,!0)+s.from;return{changes:{from:o,to:a,insert:n.doc.slice(i,a).append(n.doc.slice(o,i))},range:A.cursor(a)}});return t.changes.empty?!1:(e(n.update(t,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function vd(n){let e=[],t=-1;for(let r of n.selection.ranges){let i=n.doc.lineAt(r.from),s=n.doc.lineAt(r.to);if(!r.empty&&r.to==s.from&&(s=n.doc.lineAt(r.to-1)),t>=i.number){let o=e[e.length-1];o.to=s.to,o.ranges.push(r)}else e.push({from:i.from,to:s.to,ranges:[r]});t=s.number+1}return e}function ow(n,e,t){if(n.readOnly)return!1;let r=[],i=[];for(let s of vd(n)){if(t?s.to==n.doc.length:s.from==0)continue;let o=n.doc.lineAt(t?s.to+1:s.from-1),a=o.length+1;if(t){r.push({from:s.to,to:o.to},{from:s.from,insert:o.text+n.lineBreak});for(let l of s.ranges)i.push(A.range(Math.min(n.doc.length,l.anchor+a),Math.min(n.doc.length,l.head+a)))}else{r.push({from:o.from,to:s.from},{from:s.to,insert:n.lineBreak+o.text});for(let l of s.ranges)i.push(A.range(l.anchor-a,l.head-a))}}return r.length?(e(n.update({changes:r,scrollIntoView:!0,selection:A.create(i,n.selection.mainIndex),userEvent:"move.line"})),!0):!1}const U6=({state:n,dispatch:e})=>ow(n,e,!1),G6=({state:n,dispatch:e})=>ow(n,e,!0);function aw(n,e,t){if(n.readOnly)return!1;let r=[];for(let s of vd(n))t?r.push({from:s.from,insert:n.doc.slice(s.from,s.to)+n.lineBreak}):r.push({from:s.to,insert:n.lineBreak+n.doc.slice(s.from,s.to)});let i=n.changes(r);return e(n.update({changes:i,selection:n.selection.map(i,t?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const H6=({state:n,dispatch:e})=>aw(n,e,!1),K6=({state:n,dispatch:e})=>aw(n,e,!0),J6=n=>{if(n.state.readOnly)return!1;let{state:e}=n,t=e.changes(vd(e).map(({from:i,to:s})=>(i>0?i--:s<e.doc.length&&s++,{from:i,to:s}))),r=Oo(e.selection,i=>{let s;if(n.lineWrapping){let o=n.lineBlockAt(i.head),a=n.coordsAtPos(i.head,i.assoc||1);a&&(s=o.bottom+n.documentTop-a.bottom+n.defaultLineHeight/2)}return n.moveVertically(i,!0,s)}).map(t);return n.dispatch({changes:t,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0};function eI(n,e){if(/\(\)|\[\]|\{\}/.test(n.sliceDoc(e-1,e+1)))return{from:e,to:e};let t=Je(n).resolveInner(e),r=t.childBefore(e),i=t.childAfter(e),s;return r&&i&&r.to<=e&&i.from>=e&&(s=r.type.prop(he.closedBy))&&s.indexOf(i.name)>-1&&n.doc.lineAt(r.to).from==n.doc.lineAt(i.from).from&&!/\S/.test(n.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}const j1=lw(!1),tI=lw(!0);function lw(n){return({state:e,dispatch:t})=>{if(e.readOnly)return!1;let r=e.changeByRange(i=>{let{from:s,to:o}=i,a=e.doc.lineAt(s),l=!n&&s==o&&eI(e,s);n&&(s=o=(o<=a.to?a:e.doc.lineAt(o)).to);let c=new Od(e,{simulateBreak:s,simulateDoubleBreak:!!l}),d=Im(c,s);for(d==null&&(d=po(/^\s*/.exec(e.doc.lineAt(s).text)[0],e.tabSize));o<a.to&&/\s/.test(a.text[o-a.from]);)o++;l?{from:s,to:o}=l:s>a.from&&s<a.from+100&&!/\S/.test(a.text.slice(0,s))&&(s=a.from);let h=["",Xa(e,d)];return l&&h.push(Xa(e,c.lineIndent(a.from,-1))),{changes:{from:s,to:o,insert:xe.of(h)},range:A.cursor(s+1+h[1].length)}});return t(e.update(r,{scrollIntoView:!0,userEvent:"input"})),!0}}function ng(n,e){let t=-1;return n.changeByRange(r=>{let i=[];for(let o=r.from;o<=r.to;){let a=n.doc.lineAt(o);a.number>t&&(r.empty||r.to>a.from)&&(e(a,i,r),t=a.number),o=a.to+1}let s=n.changes(i);return{changes:i,range:A.range(s.mapPos(r.anchor,1),s.mapPos(r.head,1))}})}const nI=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=Object.create(null),r=new Od(n,{overrideIndentation:s=>{let o=t[s];return o??-1}}),i=ng(n,(s,o,a)=>{let l=Im(r,s.from);if(l==null)return;/\S/.test(s.text)||(l=0);let c=/^\s*/.exec(s.text)[0],d=Xa(n,l);(c!=d||a.from<s.from+c.length)&&(t[s.from]=l,o.push({from:s.from,to:s.from+c.length,insert:d}))});return i.changes.empty||e(n.update(i,{userEvent:"indent"})),!0},cw=({state:n,dispatch:e})=>n.readOnly?!1:(e(n.update(ng(n,(t,r)=>{r.push({from:t.from,insert:n.facet(ul)})}),{userEvent:"input.indent"})),!0),uw=({state:n,dispatch:e})=>n.readOnly?!1:(e(n.update(ng(n,(t,r)=>{let i=/^\s*/.exec(t.text)[0];if(!i)return;let s=po(i,n.tabSize),o=0,a=Xa(n,Math.max(0,s-nu(n)));for(;o<i.length&&o<a.length&&i.charCodeAt(o)==a.charCodeAt(o);)o++;r.push({from:t.from+o,to:t.from+i.length,insert:a.slice(o)})}),{userEvent:"delete.dedent"})),!0),rI=n=>(n.setTabFocusMode(),!0),iI=[{key:"Ctrl-b",run:Lv,shift:Yv,preventDefault:!0},{key:"Ctrl-f",run:_v,shift:Uv},{key:"Ctrl-p",run:Wv,shift:Kv},{key:"Ctrl-n",run:zv,shift:Jv},{key:"Ctrl-a",run:v6,shift:D6},{key:"Ctrl-e",run:w6,shift:j6},{key:"Ctrl-d",run:rw},{key:"Ctrl-h",run:mp},{key:"Ctrl-k",run:z6},{key:"Ctrl-Alt-h",run:sw},{key:"Ctrl-o",run:q6},{key:"Ctrl-t",run:Y6},{key:"Ctrl-v",run:pp}],sI=[{key:"ArrowLeft",run:Lv,shift:Yv,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:p6,shift:C6,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:S6,shift:E6,preventDefault:!0},{key:"ArrowRight",run:_v,shift:Uv,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:m6,shift:P6,preventDefault:!0},{mac:"Cmd-ArrowRight",run:k6,shift:N6,preventDefault:!0},{key:"ArrowUp",run:Wv,shift:Kv,preventDefault:!0},{mac:"Cmd-ArrowUp",run:R1,shift:N1},{mac:"Ctrl-ArrowUp",run:T1,shift:M1},{key:"ArrowDown",run:zv,shift:Jv,preventDefault:!0},{mac:"Cmd-ArrowDown",run:E1,shift:D1},{mac:"Ctrl-ArrowDown",run:pp,shift:A1},{key:"PageUp",run:T1,shift:M1},{key:"PageDown",run:pp,shift:A1},{key:"Home",run:x6,shift:R6,preventDefault:!0},{key:"Mod-Home",run:R1,shift:N1},{key:"End",run:y6,shift:A6,preventDefault:!0},{key:"Mod-End",run:E1,shift:D1},{key:"Enter",run:j1,shift:j1},{key:"Mod-a",run:I6},{key:"Backspace",run:mp,shift:mp,preventDefault:!0},{key:"Delete",run:rw,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:sw,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:W6,preventDefault:!0},{mac:"Mod-Backspace",run:V6,preventDefault:!0},{mac:"Mod-Delete",run:F6,preventDefault:!0}].concat(iI.map(n=>({mac:n.key,run:n.run,shift:n.shift}))),oI=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:O6,shift:T6},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:b6,shift:M6},{key:"Alt-ArrowUp",run:U6},{key:"Shift-Alt-ArrowUp",run:H6},{key:"Alt-ArrowDown",run:G6},{key:"Shift-Alt-ArrowDown",run:K6},{key:"Mod-Alt-ArrowUp",run:_6},{key:"Mod-Alt-ArrowDown",run:B6},{key:"Escape",run:Z6},{key:"Mod-Enter",run:tI},{key:"Alt-l",mac:"Ctrl-l",run:X6},{key:"Mod-i",run:L6,preventDefault:!0},{key:"Mod-[",run:uw},{key:"Mod-]",run:cw},{key:"Mod-Alt-\\",run:nI},{key:"Shift-Mod-k",run:J6},{key:"Shift-Mod-\\",run:$6},{key:"Mod-/",run:Uj},{key:"Alt-A",mac:"Ctrl-A",run:Hj},{key:"Ctrl-m",mac:"Shift-Alt-m",run:rI}].concat(sI),aI={key:"Tab",run:cw,shift:uw},I1=typeof String.prototype.normalize=="function"?n=>n.normalize("NFKD"):n=>n;class no{constructor(e,t,r=0,i=e.length,s,o){this.test=o,this.value={from:0,to:0,precise:!1},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(r,i),this.bufferStart=r,this.normalize=s?a=>s(I1(a)):I1,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 Yt(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=bm(e),r=this.bufferStart+this.bufferPos;this.bufferPos+=ir(e);let i=this.normalize(t);if(i.length)for(let s=0,o=r,a=!0;;s++){let l=i.charCodeAt(s),c=this.match(l,o,a,this.bufferPos+this.bufferStart,s==i.length-1);if(c)return this.value=c,this;if(s==i.length-1)break;a&&s<t.length&&t.charCodeAt(s)==l?o++:a=!1}}}match(e,t,r,i,s){let o=null;for(let a=0;a<this.matches.length;){let l=this.matches[a],c=!1;this.query.charCodeAt(l.index)==e&&(l.index==this.query.length-1?o={from:l.from,to:i,precise:s&&l.precise}:(l.index++,c=!0)),c?a++:this.matches.splice(a,1)}return this.query.charCodeAt(0)==e&&(this.query.length==1?o={from:t,to:i,precise:r&&s}:this.matches.push({from:t,index:1,precise:r})),o&&this.test&&!this.test(o.from,o.to,this.buffer,this.bufferStart)&&(o=null),o}}typeof Symbol<"u"&&(no.prototype[Symbol.iterator]=function(){return this});const dw={from:-1,to:-1,match:/.*/.exec(""),precise:!0},rg="gm"+(/x/.unicode==null?"":"u");class hw{constructor(e,t,r,i=0,s=e.length){if(this.text=e,this.to=s,this.curLine="",this.done=!1,this.value=dw,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new fw(e,t,r,i,s);this.re=new RegExp(t,rg+(r?.ignoreCase?"i":"")),this.test=r?.test,this.iter=e.iter();let o=e.lineAt(i);this.curLineStart=o.from,this.matchPos=du(e,i),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 r=this.curLineStart+t.index,i=r+t[0].length;if(this.matchPos=du(this.text,i+(r==i?1:0)),r==this.curLineStart+this.curLine.length&&this.nextLine(),(r<i||r>this.value.to)&&(!this.test||this.test(r,i,t)))return this.value={from:r,to:i,precise:!0,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}}}const Rh=new WeakMap;class Zs{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(e,t,r){let i=Rh.get(e);if(!i||i.from>=r||i.to<=t){let a=new Zs(t,e.sliceString(t,r));return Rh.set(e,a),a}if(i.from==t&&i.to==r)return i;let{text:s,from:o}=i;return o>t&&(s=e.sliceString(t,o)+s,o=t),i.to<r&&(s+=e.sliceString(i.to,r)),Rh.set(e,new Zs(o,s)),new Zs(t,s.slice(t-o,r-o))}}class fw{constructor(e,t,r,i,s){this.text=e,this.to=s,this.done=!1,this.value=dw,this.matchPos=du(e,i),this.re=new RegExp(t,rg+(r?.ignoreCase?"i":"")),this.test=r?.test,this.flat=Zs.get(e,i,this.chunkEnd(i+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 r=this.flat.from+t.index,i=r+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(r,i,t)))return this.value={from:r,to:i,precise:!0,match:t},this.matchPos=du(this.text,i+(r==i?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Zs.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(hw.prototype[Symbol.iterator]=fw.prototype[Symbol.iterator]=function(){return this});function lI(n){try{return new RegExp(n,rg),!0}catch{return!1}}function du(n,e){if(e>=n.length)return e;let t=n.lineAt(e),r;for(;e<t.to&&(r=t.text.charCodeAt(e-t.from))>=56320&&r<57344;)e++;return e}const cI=n=>{let e=lR(n,"cm-goto-line");if(e){let o=e.dom.querySelector("input[type=text]");return o&&o.select(),!0}let{state:t}=n,r=String(t.doc.lineAt(n.state.selection.main.head).number),{close:i,result:s}=aR(n,{class:"cm-goto-line",label:t.phrase("Go to line"),input:{type:"text",name:"line",value:r},focus:!0,submitLabel:t.phrase("go")});return s.then(o=>{let a=o&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(o.elements.line.value);if(!a){n.dispatch({effects:i});return}let l=t.doc.lineAt(t.selection.main.head),[,c,d,h,f]=a,p=h?+h.slice(1):0,m=d?+d:l.number;if(d&&f){let y=m/100;c&&(y=y*(c=="-"?-1:1)+l.number/t.doc.lines),m=Math.round(t.doc.lines*y)}else d&&c&&(m=m*(c=="-"?-1:1)+l.number);let O=t.doc.line(Math.max(1,Math.min(t.doc.lines,m))),b=A.cursor(O.from+Math.max(0,Math.min(p,O.length)));n.dispatch({effects:[i,X.scrollIntoView(b.from,{y:"center"})],selection:b})}),!0},uI={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},dI=W.define({combine(n){return br(n,uI,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function hI(n){return[OI,gI]}const fI=G.mark({class:"cm-selectionMatch"}),pI=G.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function X1(n,e,t,r){return(t==0||n(e.sliceDoc(t-1,t))!=Ue.Word)&&(r==e.doc.length||n(e.sliceDoc(r,r+1))!=Ue.Word)}function mI(n,e,t,r){return n(e.sliceDoc(t,t+1))==Ue.Word&&n(e.sliceDoc(r-1,r))==Ue.Word}const gI=ot.fromClass(class{constructor(n){this.decorations=this.getDeco(n)}update(n){(n.selectionSet||n.docChanged||n.viewportChanged)&&(this.decorations=this.getDeco(n.view))}getDeco(n){let e=n.state.facet(dI),{state:t}=n,r=t.selection;if(r.ranges.length>1)return G.none;let i=r.main,s,o=null;if(i.empty){if(!e.highlightWordAroundCursor)return G.none;let l=t.wordAt(i.head);if(!l)return G.none;o=t.charCategorizer(i.head),s=t.sliceDoc(l.from,l.to)}else{let l=i.to-i.from;if(l<e.minSelectionLength||l>200)return G.none;if(e.wholeWords){if(s=t.sliceDoc(i.from,i.to),o=t.charCategorizer(i.head),!(X1(o,t,i.from,i.to)&&mI(o,t,i.from,i.to)))return G.none}else if(s=t.sliceDoc(i.from,i.to),!s)return G.none}let a=[];for(let l of n.visibleRanges){let c=new no(t.doc,s,l.from,l.to);for(;!c.next().done;){let{from:d,to:h}=c.value;if((!o||X1(o,t,d,h))&&(i.empty&&d<=i.from&&h>=i.to?a.push(pI.range(d,h)):(d>=i.to||h<=i.from)&&a.push(fI.range(d,h)),a.length>e.maxMatches))return G.none}}return G.set(a)}},{decorations:n=>n.decorations}),OI=X.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),bI=({state:n,dispatch:e})=>{let{selection:t}=n,r=A.create(t.ranges.map(i=>n.wordAt(i.head)||A.cursor(i.head)),t.mainIndex);return r.eq(t)?!1:(e(n.update({selection:r})),!0)};function yI(n,e){let{main:t,ranges:r}=n.selection,i=n.wordAt(t.head),s=i&&i.from==t.from&&i.to==t.to;for(let o=!1,a=new no(n.doc,e,r[r.length-1].to);;)if(a.next(),a.done){if(o)return null;a=new no(n.doc,e,0,Math.max(0,r[r.length-1].from-1)),o=!0}else{if(o&&r.some(l=>l.from==a.value.from))continue;if(s){let l=n.wordAt(a.value.from);if(!l||l.from!=a.value.from||l.to!=a.value.to)continue}return a.value}}const xI=({state:n,dispatch:e})=>{let{ranges:t}=n.selection;if(t.some(s=>s.from===s.to))return bI({state:n,dispatch:e});let r=n.sliceDoc(t[0].from,t[0].to);if(n.selection.ranges.some(s=>n.sliceDoc(s.from,s.to)!=r))return!1;let i=yI(n,r);return i?(e(n.update({selection:n.selection.addRange(A.range(i.from,i.to),!1),effects:X.scrollIntoView(i.to)})),!0):!1},bo=W.define({combine(n){return br(n,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new NI(e),scrollToMatch:e=>X.scrollIntoView(e)})}});class pw{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||lI(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,(t,r)=>r=="n"?`
|
|
73
|
+
`:r=="r"?"\r":r=="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 $I(this):new vI(this)}getCursor(e,t=0,r){let i=e.doc?e:Ge.create({doc:e});return r==null&&(r=i.doc.length),this.regexp?ws(this,i,t,r):vs(this,i,t,r)}}class mw{constructor(e){this.spec=e}}function SI(n,e,t){return(r,i,s,o)=>{if(t&&!t(r,i,s,o))return!1;let a=r>=o&&i<=o+s.length?s.slice(r-o,i-o):e.doc.sliceString(r,i);return n(a,e,r,i)}}function vs(n,e,t,r){let i;return n.wholeWord&&(i=kI(e.doc,e.charCategorizer(e.selection.main.head))),n.test&&(i=SI(n.test,e,i)),new no(e.doc,n.unquoted,t,r,n.caseSensitive?void 0:s=>s.toLowerCase(),i)}function kI(n,e){return(t,r,i,s)=>((s>t||s+i.length<r)&&(s=Math.max(0,t-2),i=n.sliceString(s,Math.min(n.length,r+2))),(e(hu(i,t-s))!=Ue.Word||e(fu(i,t-s))!=Ue.Word)&&(e(fu(i,r-s))!=Ue.Word||e(hu(i,r-s))!=Ue.Word))}class vI extends mw{constructor(e){super(e)}nextMatch(e,t,r){let i=vs(this.spec,e,r,e.doc.length).nextOverlapping();if(i.done){let s=Math.min(e.doc.length,t+this.spec.unquoted.length);i=vs(this.spec,e,0,s).nextOverlapping()}return i.done||i.value.from==t&&i.value.to==r?null:i.value}prevMatchInRange(e,t,r){for(let i=r;;){let s=Math.max(t,i-1e4-this.spec.unquoted.length),o=vs(this.spec,e,s,i),a=null;for(;!o.nextOverlapping().done;)a=o.value;if(a)return a;if(s==t)return null;i-=1e4}}prevMatch(e,t,r){let i=this.prevMatchInRange(e,0,t);return i||(i=this.prevMatchInRange(e,Math.max(0,r-this.spec.unquoted.length),e.doc.length)),i&&(i.from!=t||i.to!=r)?i:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let r=vs(this.spec,e,0,e.doc.length),i=[];for(;!r.next().done;){if(i.length>=t)return null;i.push(r.value)}return i}highlight(e,t,r,i){let s=vs(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(r+this.spec.unquoted.length,e.doc.length));for(;!s.next().done;)i(s.value.from,s.value.to)}}function wI(n,e,t){return(r,i,s)=>(!t||t(r,i,s))&&n(s[0],e,r,i)}function ws(n,e,t,r){let i;return n.wholeWord&&(i=QI(e.charCategorizer(e.selection.main.head))),n.test&&(i=wI(n.test,e,i)),new hw(e.doc,n.search,{ignoreCase:!n.caseSensitive,test:i},t,r)}function hu(n,e){return n.slice(bt(n,e,!1),e)}function fu(n,e){return n.slice(e,bt(n,e))}function QI(n){return(e,t,r)=>!r[0].length||(n(hu(r.input,r.index))!=Ue.Word||n(fu(r.input,r.index))!=Ue.Word)&&(n(fu(r.input,r.index+r[0].length))!=Ue.Word||n(hu(r.input,r.index+r[0].length))!=Ue.Word)}class $I extends mw{nextMatch(e,t,r){let i=ws(this.spec,e,r,e.doc.length).next();return i.done&&(i=ws(this.spec,e,0,t).next()),i.done?null:i.value}prevMatchInRange(e,t,r){for(let i=1;;i++){let s=Math.max(t,r-i*1e4),o=ws(this.spec,e,s,r),a=null;for(;!o.next().done;)a=o.value;if(a&&(s==t||a.from>s+10))return a;if(s==t)return null}}prevMatch(e,t,r){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,r,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,r)=>{if(r=="&")return e.match[0];if(r=="$")return"$";for(let i=r.length;i>0;i--){let s=+r.slice(0,i);if(s>0&&s<e.match.length)return e.match[s]+r.slice(i)}return t})}matchAll(e,t){let r=ws(this.spec,e,0,e.doc.length),i=[];for(;!r.next().done;){if(i.length>=t)return null;i.push(r.value)}return i}highlight(e,t,r,i){let s=ws(this.spec,e,Math.max(0,t-250),Math.min(r+250,e.doc.length));for(;!s.next().done;)i(s.value.from,s.value.to)}}const Za=oe.define(),ig=oe.define(),ai=Mt.define({create(n){return new Eh(gp(n).create(),null)},update(n,e){for(let t of e.effects)t.is(Za)?n=new Eh(t.value.create(),n.panel):t.is(ig)&&(n=new Eh(n.query,t.value?sg:null));return n},provide:n=>Ia.from(n,e=>e.panel)});class Eh{constructor(e,t){this.query=e,this.panel=t}}const CI=G.mark({class:"cm-searchMatch"}),PI=G.mark({class:"cm-searchMatch cm-searchMatch-selected"}),TI=ot.fromClass(class{constructor(n){this.view=n,this.decorations=this.highlight(n.state.field(ai))}update(n){let e=n.state.field(ai);(e!=n.startState.field(ai)||n.docChanged||n.selectionSet||n.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:n,panel:e}){if(!e||!n.spec.valid)return G.none;let{view:t}=this,r=new Br;for(let i=0,s=t.visibleRanges,o=s.length;i<o;i++){let{from:a,to:l}=s[i];for(;i<o-1&&l>s[i+1].from-500;)l=s[++i].to;n.highlight(t.state,a,l,(c,d)=>{let h=t.state.selection.ranges.some(f=>f.from==c&&f.to==d);r.add(c,d,h?PI:CI)})}return r.finish()}},{decorations:n=>n.decorations});function gl(n){return e=>{let t=e.state.field(ai,!1);return t&&t.query.spec.valid?n(e,t):bw(e)}}const pu=gl((n,{query:e})=>{let{to:t}=n.state.selection.main,r=e.nextMatch(n.state,t,t);if(!r)return!1;let i=A.single(r.from,r.to),s=n.state.facet(bo);return n.dispatch({selection:i,effects:[og(n,r),s.scrollToMatch(i.main,n)],userEvent:"select.search"}),Ow(n),!0}),mu=gl((n,{query:e})=>{let{state:t}=n,{from:r}=t.selection.main,i=e.prevMatch(t,r,r);if(!i)return!1;let s=A.single(i.from,i.to),o=n.state.facet(bo);return n.dispatch({selection:s,effects:[og(n,i),o.scrollToMatch(s.main,n)],userEvent:"select.search"}),Ow(n),!0}),MI=gl((n,{query:e})=>{let t=e.matchAll(n.state,1e3);return!t||!t.length?!1:(n.dispatch({selection:A.create(t.map(r=>A.range(r.from,r.to))),userEvent:"select.search.matches"}),!0)}),AI=({state:n,dispatch:e})=>{let t=n.selection;if(t.ranges.length>1||t.main.empty)return!1;let{from:r,to:i}=t.main,s=[],o=0;for(let a=new no(n.doc,n.sliceDoc(r,i));!a.next().done;){if(s.length>1e3)return!1;a.value.from==r&&(o=s.length),s.push(A.range(a.value.from,a.value.to))}return e(n.update({selection:A.create(s,o),userEvent:"select.search.matches"})),!0},L1=gl((n,{query:e})=>{let{state:t}=n,{from:r,to:i}=t.selection.main;if(t.readOnly)return!1;let s=e.nextMatch(t,r,r);if(!s)return!1;let o=s,a=[],l,c,d=[];o.precise?o.from==r&&o.to==i&&(c=t.toText(e.getReplacement(o)),a.push({from:o.from,to:o.to,insert:c}),o=e.nextMatch(t,o.from,o.to),d.push(X.announce.of(t.phrase("replaced match on line $",t.doc.lineAt(r).number)+"."))):o=e.nextMatch(t,o.from,o.to);let h=n.state.changes(a);return o&&(l=A.single(o.from,o.to).map(h),d.push(og(n,o)),d.push(t.facet(bo).scrollToMatch(l.main,n))),n.dispatch({changes:h,selection:l,effects:d,userEvent:"input.replace"}),!0}),RI=gl((n,{query:e})=>{if(n.state.readOnly)return!1;let t=[];for(let i of e.matchAll(n.state,1e9)){let{from:s,to:o,precise:a}=i;a&&t.push({from:s,to:o,insert:e.getReplacement(i)})}if(!t.length)return!1;let r=n.state.phrase("replaced $ matches",t.length)+".";return n.dispatch({changes:t,effects:X.announce.of(r),userEvent:"input.replace.all"}),!0});function sg(n){return n.state.facet(bo).createPanel(n)}function gp(n,e){var t,r,i,s,o;let a=n.selection.main,l=a.empty||a.to>a.from+100?"":n.sliceDoc(a.from,a.to);if(e&&!l)return e;let c=n.facet(bo);return new pw({search:((t=e?.literal)!==null&&t!==void 0?t:c.literal)?l:l.replace(/\n/g,"\\n"),caseSensitive:(r=e?.caseSensitive)!==null&&r!==void 0?r:c.caseSensitive,literal:(i=e?.literal)!==null&&i!==void 0?i:c.literal,regexp:(s=e?.regexp)!==null&&s!==void 0?s:c.regexp,wholeWord:(o=e?.wholeWord)!==null&&o!==void 0?o:c.wholeWord})}function gw(n){let e=md(n,sg);return e&&e.dom.querySelector("[main-field]")}function Ow(n){let e=gw(n);e&&e==n.root.activeElement&&e.select()}const bw=n=>{let e=n.state.field(ai,!1);if(e&&e.panel){let t=gw(n);if(t&&t!=n.root.activeElement){let r=gp(n.state,e.query.spec);r.valid&&n.dispatch({effects:Za.of(r)}),t.focus(),t.select()}}else n.dispatch({effects:[ig.of(!0),e?Za.of(gp(n.state,e.query.spec)):oe.appendConfig.of(jI)]});return!0},yw=n=>{let e=n.state.field(ai,!1);if(!e||!e.panel)return!1;let t=md(n,sg);return t&&t.dom.contains(n.root.activeElement)&&n.focus(),n.dispatch({effects:ig.of(!1)}),!0},EI=[{key:"Mod-f",run:bw,scope:"editor search-panel"},{key:"F3",run:pu,shift:mu,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:pu,shift:mu,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:yw,scope:"editor search-panel"},{key:"Mod-Shift-l",run:AI},{key:"Mod-Alt-g",run:cI},{key:"Mod-d",run:xI,preventDefault:!0}];class NI{constructor(e){this.view=e;let t=this.query=e.state.field(ai).query.spec;this.commit=this.commit.bind(this),this.searchField=Ce("input",{value:t.search,placeholder:cn(e,"Find"),"aria-label":cn(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=Ce("input",{value:t.replace,placeholder:cn(e,"Replace"),"aria-label":cn(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=Ce("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=Ce("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=Ce("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit});function r(i,s,o){return Ce("button",{class:"cm-button",name:i,onclick:s,type:"button"},o)}this.dom=Ce("div",{onkeydown:i=>this.keydown(i),class:"cm-search"},[this.searchField,r("next",()=>pu(e),[cn(e,"next")]),r("prev",()=>mu(e),[cn(e,"previous")]),r("select",()=>MI(e),[cn(e,"all")]),Ce("label",null,[this.caseField,cn(e,"match case")]),Ce("label",null,[this.reField,cn(e,"regexp")]),Ce("label",null,[this.wordField,cn(e,"by word")]),...e.state.readOnly?[]:[Ce("br"),this.replaceField,r("replace",()=>L1(e),[cn(e,"replace")]),r("replaceAll",()=>RI(e),[cn(e,"replace all")])],Ce("button",{name:"close",onclick:()=>yw(e),"aria-label":cn(e,"close"),type:"button"},["×"])])}commit(){let e=new pw({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:Za.of(e)}))}keydown(e){mA(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?mu:pu)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),L1(this.view))}update(e){for(let t of e.transactions)for(let r of t.effects)r.is(Za)&&!r.value.eq(this.query)&&this.setQuery(r.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(bo).top}}function cn(n,e){return n.state.phrase(e)}const ql=30,Yl=/[\s\.,:;?!]/;function og(n,{from:e,to:t}){let r=n.state.doc.lineAt(e),i=n.state.doc.lineAt(t).to,s=Math.max(r.from,e-ql),o=Math.min(i,t+ql),a=n.state.sliceDoc(s,o);if(s!=r.from){for(let l=0;l<ql;l++)if(!Yl.test(a[l+1])&&Yl.test(a[l])){a=a.slice(l);break}}if(o!=i){for(let l=a.length-1;l>a.length-ql;l--)if(!Yl.test(a[l-1])&&Yl.test(a[l])){a=a.slice(0,l);break}}return X.announce.of(`${n.state.phrase("current match")}. ${a} ${n.state.phrase("on line")} ${r.number}.`)}const DI=X.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"}}),jI=[ai,Qi.low(TI),DI];class _1{constructor(e,t,r){this.from=e,this.to=t,this.diagnostic=r}}class Ni{constructor(e,t,r){this.diagnostics=e,this.panel=t,this.selected=r}static init(e,t,r){let i=r.facet(Wa).markerFilter;i&&(e=i(e,r));let s=e.slice().sort((p,m)=>p.from-m.from||p.to-m.to),o=new Br,a=[],l=0,c=r.doc.iter(),d=0,h=r.doc.length;for(let p=0;;){let m=p==s.length?null:s[p];if(!m&&!a.length)break;let O,b;if(a.length)O=l,b=a.reduce((x,S)=>Math.min(x,S.to),m&&m.from>O?m.from:1e8);else{if(O=m.from,O>h)break;b=m.to,a.push(m),p++}for(;p<s.length;){let x=s[p];if(x.from==O&&(x.to>x.from||x.to==O))a.push(x),p++,b=Math.min(x.to,b);else{b=Math.min(x.from,b);break}}b=Math.min(b,h);let y=!1;if(a.some(x=>x.from==O&&(x.to==b||b==h))&&(y=O==b,!y&&b-O<10)){let x=O-(d+c.value.length);x>0&&(c.next(x),d=O);for(let S=O;;){if(S>=b){y=!0;break}if(!c.lineBreak&&d+c.value.length>S)break;S=d+c.value.length,d+=c.value.length,c.next()}}let k=UI(a);if(y)o.add(O,O,G.widget({widget:new VI(k),diagnostics:a.slice()}));else{let x=a.reduce((S,v)=>v.markClass?S+" "+v.markClass:S,"");o.add(O,b,G.mark({class:"cm-lintRange cm-lintRange-"+k+x,diagnostics:a.slice(),inclusiveEnd:a.some(S=>S.to>b)}))}if(l=b,l==h)break;for(let x=0;x<a.length;x++)a[x].to<=l&&a.splice(x--,1)}let f=o.finish();return new Ni(f,t,Si(f))}}function Si(n,e=null,t=0){let r=null;return n.between(t,1e9,(i,s,{spec:o})=>{if(!(e&&o.diagnostics.indexOf(e)<0))if(!r)r=new _1(i,s,e||o.diagnostics[0]);else{if(o.diagnostics.indexOf(r.diagnostic)<0)return!1;r=new _1(r.from,s,r.diagnostic)}}),r}function II(n,e){let t=e.pos,r=e.end||t,i=n.state.facet(Wa).hideOn(n,t,r);if(i!=null)return i;let s=n.startState.doc.lineAt(e.pos);return!!(n.effects.some(o=>o.is(xw))||n.changes.touchesRange(s.from,Math.max(s.to,r)))}function XI(n,e){return n.field(fn,!1)?e:e.concat(oe.appendConfig.of(GI))}const xw=oe.define(),ag=oe.define(),Sw=oe.define(),fn=Mt.define({create(){return new Ni(G.none,null,null)},update(n,e){if(e.docChanged&&n.diagnostics.size){let t=n.diagnostics.map(e.changes),r=null,i=n.panel;if(n.selected){let s=e.changes.mapPos(n.selected.from,1);r=Si(t,n.selected.diagnostic,s)||Si(t,null,s)}!t.size&&i&&e.state.facet(Wa).autoPanel&&(i=null),n=new Ni(t,i,r)}for(let t of e.effects)if(t.is(xw)){let r=e.state.facet(Wa).autoPanel?t.value.length?za.open:null:n.panel;n=Ni.init(t.value,r,e.state)}else t.is(ag)?n=new Ni(n.diagnostics,t.value?za.open:null,n.selected):t.is(Sw)&&(n=new Ni(n.diagnostics,n.panel,t.value));return n},provide:n=>[Ia.from(n,e=>e.panel),X.decorations.from(n,e=>e.diagnostics)]}),LI=G.mark({class:"cm-lintRange cm-lintRange-active"});function _I(n,e,t){let{diagnostics:r}=n.state.field(fn),i,s=-1,o=-1;r.between(e-(t<0?1:0),e+(t>0?1:0),(l,c,{spec:d})=>{if(e>=l&&e<=c&&(l==c||(e>l||t>0)&&(e<c||t<0)))return i=d.diagnostics,s=l,o=c,!1});let a=n.state.facet(Wa).tooltipFilter;return i&&a&&(i=a(i,n.state)),i?{pos:s,end:o,above:!0,create(){return{dom:BI(n,i)}}}:null}function BI(n,e){return Ce("ul",{class:"cm-tooltip-lint"},e.map(t=>vw(n,t,!1)))}const ZI=n=>{let e=n.state.field(fn,!1);(!e||!e.panel)&&n.dispatch({effects:XI(n.state,[ag.of(!0)])});let t=md(n,za.open);return t&&t.dom.querySelector(".cm-panel-lint ul").focus(),!0},B1=n=>{let e=n.state.field(fn,!1);return!e||!e.panel?!1:(n.dispatch({effects:ag.of(!1)}),!0)},WI=n=>{let e=n.state.field(fn,!1);if(!e)return!1;let t=n.state.selection.main,r=Si(e.diagnostics,null,t.to+1);return!r&&(r=Si(e.diagnostics,null,0),!r||r.from==t.from&&r.to==t.to)?!1:(n.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),sR(n,r.from,1,{tooltip:ww,until:i=>i.docChanged||i.newSelection.main.head<r.from||i.newSelection.main.head>r.to}),!0)},zI=[{key:"Mod-Shift-m",run:ZI,preventDefault:!0},{key:"F8",run:WI}],Wa=W.define({combine(n){return{sources:n.map(e=>e.source).filter(e=>e!=null),...br(n.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:Z1,tooltipFilter:Z1,needsRefresh:(e,t)=>e?t?r=>e(r)||t(r):e:t,hideOn:(e,t)=>e?t?(r,i,s)=>e(r,i,s)||t(r,i,s):e:t,autoPanel:(e,t)=>e||t})}}});function Z1(n,e){return n?e?(t,r)=>e(n(t,r),r):n:e}function kw(n){let e=[];if(n)e:for(let{name:t}of n){for(let r=0;r<t.length;r++){let i=t[r];if(/[a-zA-Z]/.test(i)&&!e.some(s=>s.toLowerCase()==i.toLowerCase())){e.push(i);continue e}}e.push("")}return e}function vw(n,e,t){var r;let i=t?kw(e.actions):[];return Ce("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},Ce("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage(n):e.message),(r=e.actions)===null||r===void 0?void 0:r.map((s,o)=>{let a=!1,l=p=>{if(p.preventDefault(),a)return;a=!0;let m=Si(n.state.field(fn).diagnostics,e);m&&s.apply(n,m.from,m.to)},{name:c}=s,d=i[o]?c.indexOf(i[o]):-1,h=d<0?c:[c.slice(0,d),Ce("u",c.slice(d,d+1)),c.slice(d+1)],f=s.markClass?" "+s.markClass:"";return Ce("button",{type:"button",class:"cm-diagnosticAction"+f,onclick:l,onmousedown:l,"aria-label":` Action: ${c}${d<0?"":` (access key "${i[o]})"`}.`},h)}),e.source&&Ce("div",{class:"cm-diagnosticSource"},e.source))}class VI extends zn{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return Ce("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class W1{constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=vw(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class za{constructor(e){this.view=e,this.items=[];let t=i=>{if(!(i.ctrlKey||i.altKey||i.metaKey)){if(i.keyCode==27)B1(this.view),this.view.focus();else if(i.keyCode==38||i.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(i.keyCode==40||i.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(i.keyCode==36)this.moveSelection(0);else if(i.keyCode==35)this.moveSelection(this.items.length-1);else if(i.keyCode==13)this.view.focus();else if(i.keyCode>=65&&i.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:s}=this.items[this.selectedIndex],o=kw(s.actions);for(let a=0;a<o.length;a++)if(o[a].toUpperCase().charCodeAt(0)==i.keyCode){let l=Si(this.view.state.field(fn).diagnostics,s);l&&s.actions[a].apply(e,l.from,l.to)}}else return;i.preventDefault()}},r=i=>{for(let s=0;s<this.items.length;s++)this.items[s].dom.contains(i.target)&&this.moveSelection(s)};this.list=Ce("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:t,onclick:r}),this.dom=Ce("div",{class:"cm-panel-lint"},this.list,Ce("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>B1(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(fn).selected;if(!e)return-1;for(let t=0;t<this.items.length;t++)if(this.items[t].diagnostic==e.diagnostic)return t;return-1}update(){let{diagnostics:e,selected:t}=this.view.state.field(fn),r=0,i=!1,s=null,o=new Set;for(e.between(0,this.view.state.doc.length,(a,l,{spec:c})=>{for(let d of c.diagnostics){if(o.has(d))continue;o.add(d);let h=-1,f;for(let p=r;p<this.items.length;p++)if(this.items[p].diagnostic==d){h=p;break}h<0?(f=new W1(this.view,d),this.items.splice(r,0,f),i=!0):(f=this.items[h],h>r&&(this.items.splice(r,h-r),i=!0)),t&&f.diagnostic==t.diagnostic?f.dom.hasAttribute("aria-selected")||(f.dom.setAttribute("aria-selected","true"),s=f):f.dom.hasAttribute("aria-selected")&&f.dom.removeAttribute("aria-selected"),r++}});r<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)i=!0,this.items.pop();this.items.length==0&&(this.items.push(new W1(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),i=!0),s?(this.list.setAttribute("aria-activedescendant",s.id),this.view.requestMeasure({key:this,read:()=>({sel:s.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:a,panel:l})=>{let c=l.height/this.list.offsetHeight;a.top<l.top?this.list.scrollTop-=(l.top-a.top)/c:a.bottom>l.bottom&&(this.list.scrollTop+=(a.bottom-l.bottom)/c)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),i&&this.sync()}sync(){let e=this.list.firstChild;function t(){let r=e;e=r.nextSibling,r.remove()}for(let r of this.items)if(r.dom.parentNode==this.list){for(;e!=r.dom;)t();e=r.dom.nextSibling}else this.list.insertBefore(r.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=this.view.state.field(fn),r=Si(t.diagnostics,this.items[e].diagnostic);r&&this.view.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0,effects:Sw.of(r)})}static open(e){return new za(e)}}function FI(n,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${e}>${encodeURIComponent(n)}</svg>')`}function Ul(n){return FI(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${n}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}const qI=X.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:Ul("#f11")},".cm-lintRange-warning":{backgroundImage:Ul("orange")},".cm-lintRange-info":{backgroundImage:Ul("#999")},".cm-lintRange-hint":{backgroundImage:Ul("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}},"&dark .cm-lintRange-active":{backgroundColor:"#86714a80"},"&dark .cm-panel.cm-panel-lint ul":{"& [aria-selected]":{backgroundColor:"#2e343e"}}});function YI(n){return n=="error"?4:n=="warning"?3:n=="info"?2:1}function UI(n){let e="hint",t=1;for(let r of n){let i=YI(r.severity);i>t&&(t=i,e=r.severity)}return e}const ww=iR(_I,{hideOn:II}),GI=[fn,X.decorations.compute([fn],n=>{let{selected:e,panel:t}=n.field(fn);return!e||!t||e.from==e.to?G.none:G.set([LI.range(e.from,e.to)])}),ww,qI];var z1=function(e){e===void 0&&(e={});var t=e,r=t.crosshairCursor,i=r===void 0?!1:r,s=[];e.closeBracketsKeymap!==!1&&(s=s.concat(MN)),e.defaultKeymap!==!1&&(s=s.concat(oI)),e.searchKeymap!==!1&&(s=s.concat(EI)),e.historyKeymap!==!1&&(s=s.concat(f6)),e.foldKeymap!==!1&&(s=s.concat(WR)),e.completionKeymap!==!1&&(s=s.concat(Jk)),e.lintKeymap!==!1&&(s=s.concat(zI));var o=[];return e.lineNumbers!==!1&&o.push(yR()),e.highlightActiveLineGutter!==!1&&o.push(kR()),e.highlightSpecialChars!==!1&&o.push(EA()),e.history!==!1&&o.push(i6()),e.foldGutter!==!1&&o.push(qR()),e.drawSelection!==!1&&o.push(SA()),e.dropCursor!==!1&&o.push(CA()),e.allowMultipleSelections!==!1&&o.push(Ge.allowMultipleSelections.of(!0)),e.indentOnInput!==!1&&o.push(NR()),e.syntaxHighlighting!==!1&&o.push(_m(HR,{fallback:!0})),e.bracketMatching!==!1&&o.push(iE()),e.closeBrackets!==!1&&o.push($N()),e.autocompletion!==!1&&o.push(IN()),e.rectangularSelection!==!1&&o.push(qA()),i!==!1&&o.push(GA()),e.highlightActiveLine!==!1&&o.push(LA()),e.highlightSelectionMatches!==!1&&o.push(hI()),e.tabSize&&typeof e.tabSize=="number"&&o.push(ul.of(" ".repeat(e.tabSize))),o.concat([cl.of(s.flat())]).filter(Boolean)};const HI="#e5c07b",V1="#e06c75",KI="#56b6c2",JI="#ffffff",Mc="#abb2bf",Op="#7d8799",eX="#61afef",tX="#98c379",F1="#d19a66",nX="#c678dd",rX="#21252b",q1="#2c313a",Y1="#282c34",Nh="#353a42",iX="#3E4451",U1="#528bff",sX=X.theme({"&":{color:Mc,backgroundColor:Y1},".cm-content":{caretColor:U1},".cm-cursor, .cm-dropCursor":{borderLeftColor:U1},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:iX},".cm-panels":{backgroundColor:rX,color:Mc},".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:Y1,color:Op,border:"none"},".cm-activeLineGutter":{backgroundColor:q1},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:Nh},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:Nh,borderBottomColor:Nh},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:q1,color:Mc}}},{dark:!0}),oX=mo.define([{tag:u.keyword,color:nX},{tag:[u.name,u.deleted,u.character,u.propertyName,u.macroName],color:V1},{tag:[u.function(u.variableName),u.labelName],color:eX},{tag:[u.color,u.constant(u.name),u.standard(u.name)],color:F1},{tag:[u.definition(u.name),u.separator],color:Mc},{tag:[u.typeName,u.className,u.number,u.changed,u.annotation,u.modifier,u.self,u.namespace],color:HI},{tag:[u.operator,u.operatorKeyword,u.url,u.escape,u.regexp,u.link,u.special(u.string)],color:KI},{tag:[u.meta,u.comment],color:Op},{tag:u.strong,fontWeight:"bold"},{tag:u.emphasis,fontStyle:"italic"},{tag:u.strikethrough,textDecoration:"line-through"},{tag:u.link,color:Op,textDecoration:"underline"},{tag:u.heading,fontWeight:"bold",color:V1},{tag:[u.atom,u.bool,u.special(u.variableName)],color:F1},{tag:[u.processingInstruction,u.string,u.inserted],color:tX},{tag:u.invalid,color:JI}]),aX=[sX,_m(oX)];var lX=X.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),cX=function(e){e===void 0&&(e={});var t=e,r=t.indentWithTab,i=r===void 0?!0:r,s=t.editable,o=s===void 0?!0:s,a=t.readOnly,l=a===void 0?!1:a,c=t.theme,d=c===void 0?"light":c,h=t.placeholder,f=h===void 0?"":h,p=t.basicSetup,m=p===void 0?!0:p,O=[];switch(i&&O.unshift(cl.of([aI])),m&&(typeof m=="boolean"?O.unshift(z1()):O.unshift(z1(m))),f&&O.unshift(WA(f)),d){case"light":O.push(lX);break;case"dark":O.push(aX);break;case"none":break;default:O.push(d);break}return o===!1&&O.push(X.editable.of(!1)),l&&O.push(Ge.readOnly.of(!0)),[...O]},uX=n=>({line:n.state.doc.lineAt(n.state.selection.main.from),lineCount:n.state.doc.lines,lineBreak:n.state.lineBreak,length:n.state.doc.length,readOnly:n.state.readOnly,tabSize:n.state.tabSize,selection:n.state.selection,selectionAsSingle:n.state.selection.asSingle().main,ranges:n.state.selection.ranges,selectionCode:n.state.sliceDoc(n.state.selection.main.from,n.state.selection.main.to),selections:n.state.selection.ranges.map(e=>n.state.sliceDoc(e.from,e.to)),selectedText:n.state.selection.ranges.some(e=>!e.empty)});class dX{constructor(e,t){this.timeLeftMS=void 0,this.timeoutMS=void 0,this.isCancelled=!1,this.isTimeExhausted=!1,this.callbacks=[],this.timeLeftMS=t,this.timeoutMS=t,this.callbacks.push(e)}tick(){if(!this.isCancelled&&!this.isTimeExhausted&&(this.timeLeftMS--,this.timeLeftMS<=0)){this.isTimeExhausted=!0;var e=this.callbacks.slice();this.callbacks.length=0,e.forEach(t=>{try{t()}catch(r){console.error("TimeoutLatch callback error:",r)}})}}cancel(){this.isCancelled=!0,this.callbacks.length=0}reset(){this.timeLeftMS=this.timeoutMS,this.isCancelled=!1,this.isTimeExhausted=!1}get isDone(){return this.isCancelled||this.isTimeExhausted}}class G1{constructor(){this.interval=null,this.latches=new Set}add(e){this.latches.add(e),this.start()}remove(e){this.latches.delete(e),this.latches.size===0&&this.stop()}start(){this.interval===null&&(this.interval=setInterval(()=>{this.latches.forEach(e=>{e.tick(),e.isDone&&this.remove(e)})},1))}stop(){this.interval!==null&&(clearInterval(this.interval),this.interval=null)}}var Dh=null,hX=()=>typeof window>"u"?new G1:(Dh||(Dh=new G1),Dh),fX=X.theme({"& .cm-scroller":{height:"100% !important"}}),H1=null,jh=null;function pX(n,e,t,r,i,s){if(!n&&!e&&!t&&!r&&!i&&!s)return null;var o=JSON.stringify({height:n,minHeight:e,maxHeight:t,width:r,minWidth:i,maxWidth:s});return o===H1||(H1=o,jh=X.theme({"&":{height:n,minHeight:e,maxHeight:t,width:r,minWidth:i,maxWidth:s}})),jh}var K1=Or.define(),mX=200,gX=[];function OX(n){var e=n.value,t=n.selection,r=n.onChange,i=n.onStatistics,s=n.onCreateEditor,o=n.onUpdate,a=n.extensions,l=a===void 0?gX:a,c=n.autoFocus,d=n.theme,h=d===void 0?"light":d,f=n.height,p=f===void 0?null:f,m=n.minHeight,O=m===void 0?null:m,b=n.maxHeight,y=b===void 0?null:b,k=n.width,x=k===void 0?null:k,S=n.minWidth,v=S===void 0?null:S,w=n.maxWidth,Q=w===void 0?null:w,P=n.placeholder,T=P===void 0?"":P,C=n.editable,R=C===void 0?!0:C,M=n.readOnly,j=M===void 0?!1:M,N=n.indentWithTab,I=N===void 0?!0:N,L=n.basicSetup,te=L===void 0?!0:L,le=n.root,_=n.initialState,re=$.useState(),ie=re[0],pe=re[1],Oe=$.useState(),U=Oe[0],de=Oe[1],Ye=$.useState(),ut=Ye[0],bn=Ye[1],gt=$.useState(()=>({current:null}))[0],En=$.useState(()=>({current:null}))[0],yr=pX(p,O,y,x,v,Q),Nn=X.updateListener.of(dt=>{if(dt.docChanged&&typeof r=="function"&&!dt.transactions.some(V=>V.annotation(K1))){gt.current?gt.current.reset():(gt.current=new dX(()=>{if(En.current){var V=En.current;En.current=null,V()}gt.current=null},mX),hX().add(gt.current));var qn=dt.state.doc,Yn=qn.toString();r(Yn,dt)}i&&i(uX(dt))}),Se=cX({theme:h,editable:R,readOnly:j,placeholder:T,indentWithTab:I,basicSetup:te}),Ne=[Nn,...yr?[yr]:[],fX,...Se];return o&&typeof o=="function"&&Ne.push(X.updateListener.of(o)),Ne=Ne.concat(l),$.useLayoutEffect(()=>{if(ie&&!ut){var dt={doc:e,selection:t,extensions:Ne},qn=_?Ge.fromJSON(_.json,dt,_.fields):Ge.create(dt);if(bn(qn),!U){var Yn=new X({state:qn,parent:ie,root:le});de(Yn),s&&s(Yn,qn)}}return()=>{U&&(bn(void 0),de(void 0))}},[ie,ut]),$.useEffect(()=>{n.container&&pe(n.container)},[n.container]),$.useEffect(()=>()=>{U&&(U.destroy(),de(void 0)),gt.current&&(gt.current.cancel(),gt.current=null)},[U]),$.useEffect(()=>{c&&U&&U.focus()},[c,U]),$.useEffect(()=>{U&&U.dispatch({effects:oe.reconfigure.of(Ne)})},[h,l,p,O,y,x,v,Q,T,R,j,I,te,r,o]),$.useEffect(()=>{if(e!==void 0){var dt=U?U.state.doc.toString():"";if(U&&e!==dt){var qn=gt.current&&!gt.current.isDone,Yn=()=>{U&&e!==U.state.doc.toString()&&U.dispatch({changes:{from:0,to:U.state.doc.toString().length,insert:e||""},annotations:[K1.of(!0)]})};qn?En.current=Yn:Yn()}}},[e,U]),{state:ut,setState:bn,view:U,setView:de,container:ie,setContainer:pe}}var bX=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],Qw=$.forwardRef((n,e)=>{var t=n.className,r=n.value,i=r===void 0?"":r,s=n.selection,o=n.extensions,a=o===void 0?[]:o,l=n.onChange,c=n.onStatistics,d=n.onCreateEditor,h=n.onUpdate,f=n.autoFocus,p=n.theme,m=p===void 0?"light":p,O=n.height,b=n.minHeight,y=n.maxHeight,k=n.width,x=n.minWidth,S=n.maxWidth,v=n.basicSetup,w=n.placeholder,Q=n.indentWithTab,P=n.editable,T=n.readOnly,C=n.root,R=n.initialState,M=bx(n,bX),j=$.useRef(null),N=OX({root:C,value:i,autoFocus:f,theme:m,height:O,minHeight:b,maxHeight:y,width:k,minWidth:x,maxWidth:S,basicSetup:v,placeholder:w,indentWithTab:Q,editable:P,readOnly:T,selection:s,onChange:l,onStatistics:c,onCreateEditor:d,onUpdate:h,extensions:a,initialState:R}),I=N.state,L=N.view,te=N.container,le=N.setContainer;$.useImperativeHandle(e,()=>({editor:j.current,state:I,view:L}),[j,te,I,L]);var _=$.useCallback(ie=>{j.current=ie,le(ie)},[le]);if(typeof i!="string")throw new Error("value must be typeof string but got "+typeof i);var re=typeof m=="string"?"cm-theme-"+m:"cm-theme";return g.jsx("div",se({ref:_,className:""+re+(t?" "+t:"")},M))});Qw.displayName="CodeMirror";const yX=X.theme({"&":{backgroundColor:"#1E2533"},".cm-scroller":{backgroundColor:"#1E2533"},".cm-gutters":{backgroundColor:"#141925",borderRight:"1px solid #2A3242",fontFamily:"'Fira Code', monospace"},".cm-gutterElement":{display:"flex",alignItems:"center",justifyContent:"end"},".cm-activeLineGutter":{backgroundColor:"#1E2533"}}),xX=X.theme({".cm-content ":{fontFamily:"'Fira Code', monospace",padding:"0",lineHeight:"1.6"}}),SX=[zN(),Zk(),kD(),yX,jj,xX];function lg({className:n,fontSize:e,lineHeight:t,disableWordWrap:r=!1,...i}){const s=$.useMemo(()=>{const o=[...SX,r?null:X.lineWrapping,X.theme({".cm-content ":{fontSize:e?.toString()?`${e}px !important`:"",lineHeight:t?.toString()?`${t} !important`:""}})];return mi(o)},[r,e,t]);return g.jsx(Qw,{theme:"none",width:"100%",onKeyDown:o=>o.stopPropagation(),extensions:s,...i,className:F("cursor-text text-[14px]",n)})}const $w=$.createContext("default");function qU({theme:n,children:e}){return g.jsx($w.Provider,{value:n,children:e})}function kX(){return $.useContext($w)}function vX(){const n=kX()==="modal";return{input:F("text-foreground w-full text-sm",n?"h-[56px] rounded-[16px] border border-[#2A3242] bg-transparent px-6 focus:outline-none":"border-stock h-[3.5rem] rounded-[1rem] border bg-white px-4"),textarea:F("text-foreground field-sizing-fixed w-full min-w-0 p-4 resize-none text-sm leading-normal break-words",n?"min-h-[6.75rem] rounded-[16px] border border-[#2A3242] bg-transparent focus:outline-none":"border-stock h-[6.75rem] rounded-[1rem] border bg-white"),select:F("text-foreground w-full text-sm [&[data-placeholder]]:text-muted-foreground",n?"h-[56px]! rounded-[16px] border border-[#2A3242] bg-transparent px-6 focus:outline-none":"border-stock [&[data-placeholder]]:text-paragraph !h-[3.5rem] rounded-[1rem] border bg-white px-4"),surface:F("text-foreground w-full",n?"min-h-14 rounded-[16px] border border-[#2A3242] bg-transparent px-4 py-3":"border-stock min-h-14 rounded-[1rem] border bg-white px-4 py-3"),surfaceRow:F(n?"flex h-14 items-center gap-2 rounded-[16px] border border-[#2A3242] bg-transparent px-4 py-3":"flex h-14 items-center gap-2 rounded-[1rem] bg-white px-4 py-3"),surfaceWrap:F(n?"flex min-h-14 flex-wrap items-center gap-4 rounded-[16px] border border-[#2A3242] bg-transparent px-4 py-3":"flex min-h-14 flex-wrap items-center gap-4 rounded-[1rem] bg-white px-4 py-3"),uploadZone:F("flex h-[8.75rem] w-full flex-col items-center justify-center gap-4 p-6",n?"rounded-[16px] border-2 border-dashed border-[#2A3242] bg-transparent":"border-primary/20 rounded-2xl border-2 border-dashed bg-white"),colorInput:F("text-foreground w-full text-sm uppercase outline-none transition-all focus:ring-[3px] focus:ring-ring/50",n?"h-[56px] rounded-[16px] border border-[#2A3242] bg-transparent px-4 pl-11 ring-0":"ring-ring/50 h-[3.5rem] rounded-[1rem] border-none bg-white px-4 pl-11 ring-0"),slider:F("flex h-14 items-center gap-3 px-4",n?"rounded-[16px] border border-[#2A3242] bg-transparent":"rounded-[1rem] bg-white"),dateButton:F("text-foreground h-[3.5rem] w-full justify-between px-4 text-sm font-normal",n?"rounded-[16px] border border-[#2A3242] bg-transparent hover:bg-transparent":"border-stock rounded-[1rem] border bg-white"),dateRangeButton:F("text-foreground h-auto min-h-14 w-full justify-between px-4 font-normal sm:text-sm",n?"rounded-[16px] border border-[#2A3242] bg-transparent hover:bg-transparent":"border-stock rounded-[1rem] border bg-white"),codeEditorWrapper:F("w-full overflow-hidden",n?"rounded-[16px] border border-[#2A3242] bg-transparent":"border-stock rounded-[0.75rem] border bg-white"),fieldLabel:F("mb-2 block text-sm",n?"font-normal text-muted-foreground/70":"text-foreground mb-3 font-medium capitalize"),fieldValue:F(n?"text-foreground font-medium":"")}}var Ar=(n=>(n.TextInput="Text Input",n.URLInput="URL Input",n.NumberInput="Number Input",n.TextBox="Text Editor",n.DatePicker="Date Picker",n.DropdownSelect="Dropdown",n.MultiSelect="Multi Select",n.BooleanToggle="Boolean Toggle",n.LinkOrFileUpload="Link or File Upload",n.RichTextEditor="Rich Text Editor",n.CodeEditor="Code Editor",n.KeyValueList="Key-Value List",n.TagInput="Tag Input",n.DateRangePicker="Date Range Picker",n.ColorPicker="Color Picker",n.Slider="Slider",n.FileUpload="File Upload",n.SearchSelect="Search Select",n.CheckboxGroup="Checkbox Group",n))(Ar||{});const wX=$.lazy(()=>aC(()=>import("./editor-F9o4zoeB.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42])).then(n=>({default:n.QuillRichTextEditor})));function YU(n){return g.jsx($.Suspense,{children:g.jsx(wX,{...n})})}function UU({value:n,height:e="10rem",readonly:t=!1,setValue:r}){const i=vX();return g.jsx("div",{className:i.codeEditorWrapper,children:g.jsx(lg,{height:e,value:n??"",onChange:r,readOnly:t})})}function Ih(n){if(!(!n?.type||n.type==="none"))return n.type===Wi.Arrow||n.type===Wi.ArrowClosed?{color:"context-stroke",strokeWidth:1.5,...n}:n.type}function GU(n){if(n)return typeof n=="string"?{type:n}:n}function Ws(){return crypto.randomUUID()}function HU(n){return mr({attr:{viewBox:"0 0 15 15",fill:"none"},child:[{tag:"path",attr:{d:"M11.5793 2.05685C11.5826 2.05744 11.5858 2.05815 11.5891 2.05881L11.591 2.05978C11.5963 2.06087 11.6014 2.06242 11.6066 2.06369C11.6243 2.06801 11.6416 2.07297 11.6584 2.07932C11.6711 2.08411 11.6833 2.09003 11.6955 2.09592C11.705 2.10052 11.7147 2.10436 11.7238 2.10959L11.7336 2.11545C11.739 2.11873 11.744 2.12269 11.7492 2.12619C11.7837 2.14933 11.8151 2.17666 11.842 2.20822C11.9093 2.28675 11.9504 2.38867 11.9504 2.50021V4.50021C11.9503 4.74857 11.7485 4.95031 11.5002 4.95041C11.2517 4.95041 11.0501 4.74863 11.05 4.50021V2.95041H8.04999V12.05H9.25409C9.50262 12.05 9.70428 12.2517 9.70428 12.5002C9.7042 12.7175 9.54981 12.8986 9.34491 12.9406L9.25409 12.9504H5.75409L5.66327 12.9406C5.45848 12.8985 5.30398 12.7174 5.30389 12.5002C5.30389 12.2829 5.45845 12.1019 5.66327 12.0598L5.75409 12.05H6.95038V2.95041H3.95038V4.50021C3.95025 4.74857 3.74854 4.9503 3.50018 4.95041C3.25173 4.95041 3.05011 4.74863 3.04999 4.50021V2.50021C3.04999 2.4456 3.06047 2.39339 3.07831 2.34494C3.07994 2.3405 3.08045 2.33564 3.08221 2.33127C3.08731 2.31866 3.09459 2.30714 3.10077 2.29514C3.10725 2.2825 3.11368 2.26993 3.12128 2.25803C3.12798 2.24757 3.13524 2.2376 3.14276 2.22775C3.14853 2.22018 3.15411 2.21248 3.16034 2.20529L3.18182 2.18185C3.18639 2.17728 3.19171 2.17353 3.19647 2.16916C3.20838 2.15819 3.22054 2.14755 3.23358 2.13791C3.24267 2.13121 3.25231 2.12537 3.2619 2.11935C3.27449 2.11144 3.28758 2.10453 3.30096 2.09787C3.31229 2.09225 3.3233 2.08594 3.33514 2.08127C3.3506 2.07516 3.36675 2.07101 3.383 2.06662C3.3934 2.06382 3.40356 2.05989 3.41425 2.05783C3.44199 2.05247 3.47087 2.05002 3.50018 2.05002H11.5002L11.5793 2.05685Z",fill:"currentColor"},child:[]}]})(n)}function QX(n){return mr({attr:{viewBox:"0 0 15 15",fill:"none"},child:[{tag:"path",attr:{d:"M12.6533 1.00781C13.4097 1.08461 14 1.72334 14 2.5V12.5L13.9922 12.6533C13.9205 13.3593 13.3593 13.9205 12.6533 13.9922L12.5 14H2.5L2.34668 13.9922C1.64069 13.9205 1.07949 13.3593 1.00781 12.6533L1 12.5V2.5C1 1.72334 1.59028 1.08461 2.34668 1.00781L2.5 1H12.5L12.6533 1.00781ZM2 12.5C2 12.7761 2.22386 13 2.5 13H7V10H2V12.5ZM8 13H12.5C12.7761 13 13 12.7761 13 12.5V10H8V13ZM2 6V9H7V6H2ZM8 6V9H13V6H8ZM2.5 2C2.22386 2 2 2.22386 2 2.5V5H7V2H2.5ZM8 5H13V2.5C13 2.22386 12.7761 2 12.5 2H8V5Z",fill:"currentColor"},child:[]}]})(n)}function KU(n){return mr({attr:{viewBox:"0 0 15 15",fill:"none"},child:[{tag:"path",attr:{d:"M1.44995 10.95C1.72609 10.95 1.94995 11.1738 1.94995 11.45V12.95H3.44995C3.72609 12.95 3.94995 13.1738 3.94995 13.45C3.94995 13.7261 3.72609 13.95 3.44995 13.95H1.44995C1.17381 13.95 0.949951 13.7261 0.949951 13.45V11.45C0.949951 11.1738 1.17381 10.95 1.44995 10.95ZM8.94995 12.95C9.22609 12.95 9.44995 13.1738 9.44995 13.45C9.44995 13.7261 9.22609 13.95 8.94995 13.95H5.94995C5.67381 13.95 5.44995 13.7261 5.44995 13.45C5.44995 13.1738 5.67381 12.95 5.94995 12.95H8.94995ZM13.45 10.95C13.7261 10.95 13.95 11.1738 13.95 11.45V13.45C13.9499 13.7261 13.7261 13.9499 13.45 13.95H11.45C11.1738 13.95 10.95 13.7261 10.95 13.45C10.95 13.1738 11.1738 12.95 11.45 12.95H12.949L12.95 11.45C12.95 11.1738 13.1738 10.95 13.45 10.95ZM1.44995 5.44995C1.72609 5.44995 1.94995 5.67381 1.94995 5.94995V8.94995C1.94995 9.22609 1.72609 9.44995 1.44995 9.44995C1.17381 9.44995 0.949951 9.22609 0.949951 8.94995V5.94995C0.949951 5.67381 1.17381 5.44995 1.44995 5.44995ZM13.45 5.44995C13.7261 5.44995 13.95 5.67381 13.95 5.94995V8.94995C13.95 9.22609 13.7261 9.44995 13.45 9.44995C13.1738 9.44995 12.95 9.22609 12.95 8.94995V5.94995C12.95 5.67381 13.1738 5.44995 13.45 5.44995ZM3.44995 0.949951C3.72609 0.949951 3.94995 1.17381 3.94995 1.44995C3.94995 1.72609 3.72609 1.94995 3.44995 1.94995H1.94995V3.44995C1.94995 3.72609 1.72609 3.94995 1.44995 3.94995C1.17382 3.94994 0.949953 3.72609 0.949951 3.44995V1.44995C0.949951 1.31734 1.00267 1.1902 1.09644 1.09644C1.1902 1.00267 1.31734 0.949951 1.44995 0.949951H3.44995ZM13.449 0.949951C13.7251 0.949951 13.95 1.17381 13.95 1.44995V3.44995C13.95 3.72609 13.7261 3.94994 13.45 3.94995C13.1738 3.94995 12.95 3.72609 12.95 3.44995V1.94995H11.45C11.1738 1.94995 10.95 1.72609 10.95 1.44995C10.95 1.17381 11.1738 0.949951 11.45 0.949951H13.449ZM8.94995 0.949951C9.22609 0.949951 9.44995 1.17381 9.44995 1.44995C9.44995 1.72609 9.22609 1.94995 8.94995 1.94995H5.94995C5.67381 1.94995 5.44995 1.72609 5.44995 1.44995C5.44995 1.17381 5.67381 0.949951 5.94995 0.949951H8.94995Z",fill:"currentColor"},child:[]}]})(n)}function JU(n){return mr({attr:{viewBox:"0 0 15 15",fill:"none"},child:[{tag:"path",attr:{d:"M13.8779 2.00684C14.5082 2.07092 15 2.60285 15 3.25V10.75C15 11.4404 14.4404 12 13.75 12H9.92676L10.1699 13.2988L10.1797 13.4238C10.1678 13.7104 9.93104 13.95 9.62988 13.9502H5.37012C5.02598 13.95 4.76674 13.6371 4.83008 13.2988L5.07324 12H1.25C0.559644 12 2.14752e-08 11.4404 0 10.75V3.25C1.34221e-09 2.55964 0.559644 2 1.25 2H13.75L13.8779 2.00684ZM5.98926 12L5.79297 13.0498H9.20703L9.01074 12H5.98926ZM1.25 3C1.11193 3 1 3.11193 1 3.25V10.75C1 10.8881 1.11193 11 1.25 11H13.75C13.8881 11 14 10.8881 14 10.75V3.25C14 3.12931 13.9145 3.02833 13.8008 3.00488L13.75 3H1.25Z",fill:"currentColor"},child:[]}]})(n)}function eG(n){return mr({attr:{viewBox:"0 0 15 15",fill:"none"},child:[{tag:"path",attr:{d:"M11.5 12C11.7761 12 12 11.7761 12 11.5C12 11.2239 11.7761 11 11.5 11H9.90039C8.77204 11 7.9554 10.9997 7.31348 10.9473C6.67741 10.8953 6.25672 10.7942 5.91113 10.6182C5.25262 10.2826 4.71738 9.74738 4.38184 9.08887C4.20575 8.74328 4.10471 8.32259 4.05273 7.68652C4.00029 7.0446 4 6.22796 4 5.09961V3.5C4 3.22386 3.77614 3 3.5 3C3.22386 3 3 3.22386 3 3.5V5.09961C3 6.21131 3.00012 7.07553 3.05664 7.76758C3.11366 8.46547 3.23038 9.03293 3.49023 9.54297C3.92166 10.3897 4.6103 11.0783 5.45703 11.5098C5.96707 11.7696 6.53453 11.8863 7.23242 11.9434C7.92447 11.9999 8.78869 12 9.90039 12H11.5Z",fill:"currentColor"},child:[]}]})(n)}const ro=new Set;function $X(){for(const n of ro)n.remove();ro.clear()}typeof document<"u"&&document.addEventListener("dragend",$X);function CX(n,e){const t=document.createElement("div");t.style.cssText=["position: fixed","top: -1000px","left: -1000px","display: block","width: 140px","overflow: hidden","border-radius: 10px","border: 1px solid #2A3242","background: #141925","box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45)","pointer-events: none","z-index: 9999"].join(";");const r=document.createElement("img");if(r.src=e,r.style.cssText=["display: block","width: 100%","height: auto"].join(";"),t.appendChild(r),document.body.appendChild(t),ro.add(t),!n.dataTransfer){t.remove(),ro.delete(t);return}const{width:i,height:s}=t.getBoundingClientRect();n.dataTransfer.setDragImage(t,i/2,s/2)}function PX(n,e){const t=document.createElement("div");if(t.style.cssText=["position: fixed","top: -1000px","left: -1000px","display: inline-flex","align-items: center","gap: 8px","padding: 8px 12px","border-radius: 8px","border: 1px solid #2A3242","background: #141925","color: #F4F7FC","font-size: 14px","font-weight: 500","font-family: system-ui, -apple-system, sans-serif","box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35)","pointer-events: none","white-space: nowrap","z-index: 9999"].join(";"),t.textContent=e,document.body.appendChild(t),ro.add(t),!n.dataTransfer){t.remove(),ro.delete(t);return}n.dataTransfer.setDragImage(t,16,20)}function tG(n,e,t,r,i,s){const o=n.dataTransfer,a={type:e,id:Ws(),data:{...t},...r};if(o.setData("application/react-flow",JSON.stringify(a)),o.effectAllowed="move",s){CX(n.nativeEvent,s);return}PX(n.nativeEvent,i??TX(t))}function TX(n){if(typeof n.componentName=="string"&&n.componentName)return n.componentName;if(typeof n.name=="string"&&n.name)return n.name;const r=n.componentFields?.find(i=>i.label==="Name")?.data?.[0]?.value;return r||"Component"}function MX(n){const e=n.getData("application/react-flow");if(!e)return null;const t=JSON.parse(e);return{id:Ws(),...t,data:{...t.data,componentFields:t?.data?.componentFields??[]}}}const J1=fo(`
|
|
74
|
+
query Comments($orgId: ID!, $resourceId: ID!) {
|
|
75
|
+
comments(orgId: $orgId, resourceId: $resourceId) {
|
|
76
|
+
id
|
|
77
|
+
resourceId
|
|
78
|
+
parentCommentId
|
|
79
|
+
text
|
|
80
|
+
createdBy
|
|
81
|
+
createdAt
|
|
82
|
+
createdByActor {
|
|
83
|
+
id
|
|
84
|
+
name
|
|
85
|
+
avatarUrl
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
`),AX=fo(`
|
|
90
|
+
mutation CreateComment($orgId: ID!, $input: CreateCommentInput!) {
|
|
91
|
+
createComment(orgId: $orgId, input: $input) {
|
|
92
|
+
id
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
`),RX=fo(`
|
|
96
|
+
mutation UpdateComment($orgId: ID!, $id: ID!, $input: UpdateCommentInput!) {
|
|
97
|
+
updateComment(orgId: $orgId, id: $id, input: $input) {
|
|
98
|
+
id
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
`),EX=fo(`
|
|
102
|
+
mutation DeleteComment($orgId: ID!, $id: ID!) {
|
|
103
|
+
deleteComment(orgId: $orgId, id: $id)
|
|
104
|
+
}
|
|
105
|
+
`);function vt(n){this.content=n}vt.prototype={constructor:vt,find:function(n){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===n)return e;return-1},get:function(n){var e=this.find(n);return e==-1?void 0:this.content[e+1]},update:function(n,e,t){var r=t&&t!=n?this.remove(t):this,i=r.find(n),s=r.content.slice();return i==-1?s.push(t||n,e):(s[i+1]=e,t&&(s[i]=t)),new vt(s)},remove:function(n){var e=this.find(n);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new vt(t)},addToStart:function(n,e){return new vt([n,e].concat(this.remove(n).content))},addToEnd:function(n,e){var t=this.remove(n).content.slice();return t.push(n,e),new vt(t)},addBefore:function(n,e,t){var r=this.remove(e),i=r.content.slice(),s=r.find(n);return i.splice(s==-1?i.length:s,0,e,t),new vt(i)},forEach:function(n){for(var e=0;e<this.content.length;e+=2)n(this.content[e],this.content[e+1])},prepend:function(n){return n=vt.from(n),n.size?new vt(n.content.concat(this.subtract(n).content)):this},append:function(n){return n=vt.from(n),n.size?new vt(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var e=this;n=vt.from(n);for(var t=0;t<n.content.length;t+=2)e=e.remove(n.content[t]);return e},toObject:function(){var n={};return this.forEach(function(e,t){n[e]=t}),n},get size(){return this.content.length>>1}};vt.from=function(n){if(n instanceof vt)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new vt(e)};function Cw(n,e,t){for(let r=0;;r++){if(r==n.childCount||r==e.childCount)return n.childCount==e.childCount?null:t;let i=n.child(r),s=e.child(r);if(i==s){t+=i.nodeSize;continue}if(!i.sameMarkup(s))return t;if(i.isText&&i.text!=s.text){let o=i.text,a=s.text,l=0;for(;o[l]==a[l];l++)t++;return l&&l<o.length&&l<a.length&&Mw(o.charCodeAt(l-1))&&Tw(o.charCodeAt(l))&&t--,t}if(i.content.size||s.content.size){let o=Cw(i.content,s.content,t+1);if(o!=null)return o}t+=i.nodeSize}}function Pw(n,e,t,r){for(let i=n.childCount,s=e.childCount;;){if(i==0||s==0)return i==s?null:{a:t,b:r};let o=n.child(--i),a=e.child(--s),l=o.nodeSize;if(o==a){t-=l,r-=l;continue}if(!o.sameMarkup(a))return{a:t,b:r};if(o.isText&&o.text!=a.text){let c=o.text,d=a.text,h=c.length,f=d.length;for(;h>0&&f>0&&c[h-1]==d[f-1];)h--,f--,t--,r--;return h&&f&&h<c.length&&Mw(c.charCodeAt(h-1))&&Tw(c.charCodeAt(h))&&(t++,r++),{a:t,b:r}}if(o.content.size||a.content.size){let c=Pw(o.content,a.content,t-1,r-1);if(c)return c}t-=l,r-=l}}function Tw(n){return n>=56320&&n<57344}function Mw(n){return n>=55296&&n<56320}class E{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,t,r,i=0,s){for(let o=0,a=0;a<t;o++){let l=this.content[o],c=a+l.nodeSize;if(c>e&&r(l,i+a,s||null,o)!==!1&&l.content.size){let d=a+1;l.nodesBetween(Math.max(0,e-d),Math.min(l.content.size,t-d),r,i+d)}a=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,i){let s="",o=!0;return this.nodesBetween(e,t,(a,l)=>{let c=a.isText?a.text.slice(Math.max(e,l)-l,t-l):a.isLeaf?i?typeof i=="function"?i(a):i:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&c||a.isTextblock)&&r&&(o?o=!1:s+=r),s+=c},0),s}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,i=this.content.slice(),s=0;for(t.isText&&t.sameMarkup(r)&&(i[i.length-1]=t.withText(t.text+r.text),s=1);s<e.content.length;s++)i.push(e.content[s]);return new E(i,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let r=[],i=0;if(t>e)for(let s=0,o=0;o<t;s++){let a=this.content[s],l=o+a.nodeSize;l>e&&((o<e||l>t)&&(a.isText?a=a.cut(Math.max(0,e-o),Math.min(a.text.length,t-o)):a=a.cut(Math.max(0,e-o-1),Math.min(a.content.size,t-o-1))),r.push(a),i+=a.nodeSize),o=l}return new E(r,i)}cutByIndex(e,t){return e==t?E.empty:e==0&&t==this.content.length?this:new E(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let i=this.content.slice(),s=this.size+t.nodeSize-r.nodeSize;return i[e]=t,new E(i,s)}addToStart(e){return new E([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new E(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,r=0;t<this.content.length;t++){let i=this.content[t];e(i,r,t),r+=i.nodeSize}}findDiffStart(e,t=0){return Cw(this,e,t)}findDiffEnd(e,t=this.size,r=e.size){return Pw(this,e,t,r)}findIndex(e){if(e==0)return Gl(0,e);if(e==this.size)return Gl(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,r=0;;t++){let i=this.child(t),s=r+i.nodeSize;if(s>=e)return s==e?Gl(t+1,s):Gl(t,r);r=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return E.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return E.fromArray(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return E.empty;let t,r=0;for(let i=0;i<e.length;i++){let s=e[i];r+=s.nodeSize,i&&s.isText&&e[i-1].sameMarkup(s)?(t||(t=e.slice(0,i)),t[t.length-1]=s.withText(t[t.length-1].text+s.text)):t&&t.push(s)}return new E(t||e,r)}static from(e){if(!e)return E.empty;if(e instanceof E)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new E([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}E.empty=new E([],0);const Xh={index:0,offset:0};function Gl(n,e){return Xh.index=n,Xh.offset=e,Xh}function gu(n,e){if(n===e)return!0;if(!(n&&typeof n=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(n);if(Array.isArray(e)!=t)return!1;if(t){if(n.length!=e.length)return!1;for(let r=0;r<n.length;r++)if(!gu(n[r],e[r]))return!1}else{for(let r in n)if(!(r in e)||!gu(n[r],e[r]))return!1;for(let r in e)if(!(r in n))return!1}return!0}let Ae=class bp{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,r=!1;for(let i=0;i<e.length;i++){let s=e[i];if(this.eq(s))return e;if(this.type.excludes(s.type))t||(t=e.slice(0,i));else{if(s.type.excludes(this.type))return e;!r&&s.type.rank>this.type.rank&&(t||(t=e.slice(0,i)),t.push(this),r=!0),t&&t.push(s)}}return t||(t=e.slice()),r||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&gu(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[t.type];if(!r)throw new RangeError(`There is no mark type ${t.type} in this schema`);return r.create(t.attrs)}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(t[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return bp.none;if(e instanceof bp)return[e];let t=e.slice();return t.sort((r,i)=>r.type.rank-i.type.rank),t}};Ae.none=[];class Va extends Error{}class z{constructor(e,t,r){this.content=e,this.openStart=t,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let r=Rw(this.content,e+this.openStart,t,this.openStart+1,this.openEnd+1);return r&&new z(r,this.openStart,this.openEnd)}removeBetween(e,t){return new z(Aw(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return z.empty;let r=t.openStart||0,i=t.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new z(E.fromJSON(e,t.content),r,i)}static maxOpen(e,t=!0){let r=0,i=0;for(let s=e.firstChild;s&&!s.isLeaf&&(t||!s.type.spec.isolating);s=s.firstChild)r++;for(let s=e.lastChild;s&&!s.isLeaf&&(t||!s.type.spec.isolating);s=s.lastChild)i++;return new z(e,r,i)}}z.empty=new z(E.empty,0,0);function Aw(n,e,t){let{index:r,offset:i}=n.findIndex(e),s=n.maybeChild(r),{index:o,offset:a}=n.findIndex(t);if(i==e||s.isText){if(a!=t&&!n.child(o).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(r!=o)throw new RangeError("Removing non-flat range");return n.replaceChild(r,s.copy(Aw(s.content,e-i-1,t-i-1)))}function Rw(n,e,t,r,i,s){let{index:o,offset:a}=n.findIndex(e),l=n.maybeChild(o);if(a==e||l.isText)return s&&r<=0&&i<=0&&!s.canReplace(o,o,t)?null:n.cut(0,e).append(t).append(n.cut(e));let c=Rw(l.content,e-a-1,t,o==0?r-1:0,o==n.childCount-1?i-1:0,l);return c&&n.replaceChild(o,l.copy(c))}function NX(n,e,t){if(t.openStart>n.depth)throw new Va("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new Va("Inconsistent open depths");return Ew(n,e,t,0)}function Ew(n,e,t,r){let i=n.index(r),s=n.node(r);if(i==e.index(r)&&r<n.depth-t.openStart){let o=Ew(n,e,t,r+1);return s.copy(s.content.replaceChild(i,o))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&n.depth==r&&e.depth==r){let o=n.parent,a=o.content;return Yi(o,a.cut(0,n.parentOffset).append(t.content).append(a.cut(e.parentOffset)))}else{let{start:o,end:a}=DX(t,n);return Yi(s,Dw(n,o,a,e,r))}else return Yi(s,Ou(n,e,r))}function Nw(n,e){if(!e.type.compatibleContent(n.type))throw new Va("Cannot join "+e.type.name+" onto "+n.type.name)}function yp(n,e,t){let r=n.node(t);return Nw(r,e.node(t)),r}function qi(n,e){let t=e.length-1;t>=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function aa(n,e,t,r){let i=(e||n).node(t),s=0,o=e?e.index(t):i.childCount;n&&(s=n.index(t),n.depth>t?s++:n.textOffset&&(qi(n.nodeAfter,r),s++));for(let a=s;a<o;a++)qi(i.child(a),r);e&&e.depth==t&&e.textOffset&&qi(e.nodeBefore,r)}function Yi(n,e){if(!n.type.validContent(e))throw new Va("Invalid content for node "+n.type.name);return n.copy(e)}function Dw(n,e,t,r,i){let s=n.depth>i&&yp(n,e,i+1),o=r.depth>i&&yp(t,r,i+1),a=[];return aa(null,n,i,a),s&&o&&e.index(i)==t.index(i)?(Nw(s,o),qi(Yi(s,Dw(n,e,t,r,i+1)),a)):(s&&qi(Yi(s,Ou(n,e,i+1)),a),aa(e,t,i,a),o&&qi(Yi(o,Ou(t,r,i+1)),a)),aa(r,null,i,a),new E(a)}function Ou(n,e,t){let r=[];if(aa(null,n,t,r),n.depth>t){let i=yp(n,e,t+1);qi(Yi(i,Ou(n,e,t+1)),r)}return aa(e,null,t,r),new E(r)}function DX(n,e){let t=e.depth-n.openStart,i=e.node(t).copy(n.content);for(let s=t-1;s>=0;s--)i=e.node(s).copy(E.from(i));return{start:i.resolveNoCache(n.openStart+t),end:i.resolveNoCache(i.content.size-n.openEnd-t)}}class Fa{constructor(e,t,r){this.pos=e,this.path=t,this.parentOffset=r,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(t);return r?e.child(t).cut(r):i}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let r=this.path[t*3],i=t==0?0:this.path[t*3-1]+1;for(let s=0;s<e;s++)i+=r.child(s).nodeSize;return i}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return Ae.none;if(this.textOffset)return e.child(t).marks;let r=e.maybeChild(t-1),i=e.maybeChild(t);if(!r){let a=r;r=i,i=a}let s=r.marks;for(var o=0;o<s.length;o++)s[o].type.spec.inclusive===!1&&(!i||!s[o].isInSet(i.marks))&&(s=s[o--].removeFromSet(s));return s}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let r=t.marks,i=e.parent.maybeChild(e.index());for(var s=0;s<r.length;s++)r[s].type.spec.inclusive===!1&&(!i||!r[s].isInSet(i.marks))&&(r=r[s--].removeFromSet(r));return r}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!t||t(this.node(r))))return new bu(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let r=[],i=0,s=t;for(let o=e;;){let{index:a,offset:l}=o.content.findIndex(s),c=s-l;if(r.push(o,a,i+l),!c||(o=o.child(a),o.isText))break;s=c-1,i+=l+1}return new Fa(t,r,s)}static resolveCached(e,t){let r=eb.get(e);if(r)for(let s=0;s<r.elts.length;s++){let o=r.elts[s];if(o.pos==t)return o}else eb.set(e,r=new jX);let i=r.elts[r.i]=Fa.resolve(e,t);return r.i=(r.i+1)%IX,i}}class jX{constructor(){this.elts=[],this.i=0}}const IX=12,eb=new WeakMap;class bu{constructor(e,t,r){this.$from=e,this.$to=t,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const XX=Object.create(null);let li=class xp{constructor(e,t,r,i=Ae.none){this.type=e,this.attrs=t,this.marks=i,this.content=r||E.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,r,i=0){this.content.nodesBetween(e,t,r,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,r,i){return this.content.textBetween(e,t,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,r){return this.type==e&&gu(this.attrs,t||e.defaultAttrs||XX)&&Ae.sameSet(this.marks,r||Ae.none)}copy(e=null){return e==this.content?this:new xp(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new xp(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,r=!1){if(e==t)return z.empty;let i=this.resolve(e),s=this.resolve(t),o=r?0:i.sharedDepth(t),a=i.start(o),c=i.node(o).content.cut(i.pos-a,s.pos-a);return new z(c,i.depth-o,s.depth-o)}replace(e,t,r){return NX(this.resolve(e),this.resolve(t),r)}nodeAt(e){for(let t=this;;){let{index:r,offset:i}=t.content.findIndex(e);if(t=t.maybeChild(r),!t)return null;if(i==e||t.isText)return t;e-=i+1}}childAfter(e){let{index:t,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(t),index:t,offset:r};let i=this.content.child(t-1);return{node:i,index:t-1,offset:r-i.nodeSize}}resolve(e){return Fa.resolveCached(this,e)}resolveNoCache(e){return Fa.resolve(this,e)}rangeHasMark(e,t,r){let i=!1;return t>e&&this.nodesBetween(e,t,s=>(r.isInSet(s.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),jw(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,r=E.empty,i=0,s=r.childCount){let o=this.contentMatchAt(e).matchFragment(r,i,s),a=o&&o.matchFragment(this.content,t);if(!a||!a.validEnd)return!1;for(let l=i;l<s;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(e,t,r,i){if(i&&!this.type.allowsMarks(i))return!1;let s=this.contentMatchAt(e).matchType(r),o=s&&s.matchFragment(this.content,t);return o?o.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),tb(this.type.attrs,this.attrs,"node",this.type.name);let e=Ae.none;for(let t=0;t<this.marks.length;t++){let r=this.marks[t];tb(r.type.attrs,r.attrs,"mark",r.type.name),e=r.addToSet(e)}if(!Ae.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let r;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,r)}let i=E.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,i,r)}};li.prototype.text=void 0;let LX=class Sp extends li{constructor(e,t,r,i){if(super(e,t,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):jw(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Sp(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Sp(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function jw(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}function tb(n,e,t,r){for(let i in e)if(!(i in n))throw new RangeError(`Unsupported attribute ${i} for ${t} of type ${r}`);for(let i in n)n[i].validate&&n[i].validate(e[i])}class ss{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new _X(e,t);if(r.next==null)return ss.empty;let i=Iw(r);r.next&&r.err("Unexpected trailing text");let s=qX(FX(i));return YX(s,r),s}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,r=e.childCount){let i=this;for(let s=t;i&&s<r;s++)i=i.matchType(e.child(s).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let r=0;r<e.next.length;r++)if(this.next[t].type==e.next[r].type)return!0;return!1}fillBefore(e,t=!1,r=0){let i=[this];function s(o,a){let l=o.matchFragment(e,r);if(l&&(!t||l.validEnd))return E.from(a.map(c=>c.createAndFill()));for(let c=0;c<o.next.length;c++){let{type:d,next:h}=o.next[c];if(!(d.isText||d.hasRequiredAttrs())&&i.indexOf(h)==-1){i.push(h);let f=s(h,a.concat(d));if(f)return f}}return null}return s(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),s=i.match;if(s.matchType(e)){let o=[];for(let a=i;a.type;a=a.via)o.push(a.type);return o.reverse()}for(let o=0;o<s.next.length;o++){let{type:a,next:l}=s.next[o];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in t)&&(!i.type||l.validEnd)&&(r.push({match:a.contentMatch,type:a,via:i}),t[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(r){e.push(r);for(let i=0;i<r.next.length;i++)e.indexOf(r.next[i].next)==-1&&t(r.next[i].next)}return t(this),e.map((r,i)=>{let s=i+(r.validEnd?"*":" ")+" ";for(let o=0;o<r.next.length;o++)s+=(o?", ":"")+r.next[o].type.name+"->"+e.indexOf(r.next[o].next);return s}).join(`
|
|
106
|
+
`)}}ss.empty=new ss(!0);class _X{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function Iw(n){let e=[];do e.push(BX(n));while(n.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function BX(n){let e=[];do e.push(ZX(n));while(n.next&&n.next!=")"&&n.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function ZX(n){let e=VX(n);for(;;)if(n.eat("+"))e={type:"plus",expr:e};else if(n.eat("*"))e={type:"star",expr:e};else if(n.eat("?"))e={type:"opt",expr:e};else if(n.eat("{"))e=WX(n,e);else break;return e}function nb(n){/\D/.test(n.next)&&n.err("Expected number, got '"+n.next+"'");let e=Number(n.next);return n.pos++,e}function WX(n,e){let t=nb(n),r=t;return n.eat(",")&&(n.next!="}"?r=nb(n):r=-1),n.eat("}")||n.err("Unclosed braced range"),{type:"range",min:t,max:r,expr:e}}function zX(n,e){let t=n.nodeTypes,r=t[e];if(r)return[r];let i=[];for(let s in t){let o=t[s];o.isInGroup(e)&&i.push(o)}return i.length==0&&n.err("No node type or group '"+e+"' found"),i}function VX(n){if(n.eat("(")){let e=Iw(n);return n.eat(")")||n.err("Missing closing paren"),e}else if(/\W/.test(n.next))n.err("Unexpected token '"+n.next+"'");else{let e=zX(n,n.next).map(t=>(n.inline==null?n.inline=t.isInline:n.inline!=t.isInline&&n.err("Mixing inline and block content"),{type:"name",value:t}));return n.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function FX(n){let e=[[]];return i(s(n,0),t()),e;function t(){return e.push([])-1}function r(o,a,l){let c={term:l,to:a};return e[o].push(c),c}function i(o,a){o.forEach(l=>l.to=a)}function s(o,a){if(o.type=="choice")return o.exprs.reduce((l,c)=>l.concat(s(c,a)),[]);if(o.type=="seq")for(let l=0;;l++){let c=s(o.exprs[l],a);if(l==o.exprs.length-1)return c;i(c,a=t())}else if(o.type=="star"){let l=t();return r(a,l),i(s(o.expr,l),l),[r(l)]}else if(o.type=="plus"){let l=t();return i(s(o.expr,a),l),i(s(o.expr,l),l),[r(l)]}else{if(o.type=="opt")return[r(a)].concat(s(o.expr,a));if(o.type=="range"){let l=a;for(let c=0;c<o.min;c++){let d=t();i(s(o.expr,l),d),l=d}if(o.max==-1)i(s(o.expr,l),l);else for(let c=o.min;c<o.max;c++){let d=t();r(l,d),i(s(o.expr,l),d),l=d}return[r(l)]}else{if(o.type=="name")return[r(a,void 0,o.value)];throw new Error("Unknown expr type")}}}}function Xw(n,e){return e-n}function rb(n,e){let t=[];return r(e),t.sort(Xw);function r(i){let s=n[i];if(s.length==1&&!s[0].term)return r(s[0].to);t.push(i);for(let o=0;o<s.length;o++){let{term:a,to:l}=s[o];!a&&t.indexOf(l)==-1&&r(l)}}}function qX(n){let e=Object.create(null);return t(rb(n,0));function t(r){let i=[];r.forEach(o=>{n[o].forEach(({term:a,to:l})=>{if(!a)return;let c;for(let d=0;d<i.length;d++)i[d][0]==a&&(c=i[d][1]);rb(n,l).forEach(d=>{c||i.push([a,c=[]]),c.indexOf(d)==-1&&c.push(d)})})});let s=e[r.join(",")]=new ss(r.indexOf(n.length-1)>-1);for(let o=0;o<i.length;o++){let a=i[o][1].sort(Xw);s.next.push({type:i[o][0],next:e[a.join(",")]||t(a)})}return s}}function YX(n,e){for(let t=0,r=[n];t<r.length;t++){let i=r[t],s=!i.validEnd,o=[];for(let a=0;a<i.next.length;a++){let{type:l,next:c}=i.next[a];o.push(l.name),s&&!(l.isText||l.hasRequiredAttrs())&&(s=!1),r.indexOf(c)==-1&&r.push(c)}s&&e.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function Lw(n){let e=Object.create(null);for(let t in n){let r=n[t];if(!r.hasDefault)return null;e[t]=r.default}return e}function _w(n,e){let t=Object.create(null);for(let r in n){let i=n[r],s=e&&e[r];if(s===void 0)if(i.hasDefault)s=i.default;else throw new RangeError("No value supplied for attribute "+r);else i.validate&&i.validate(s);t[r]=s}return t}function Bw(n,e){let t=Object.create(null);if(e)for(let r in e)t[r]=new GX(n,r,e[r]);return t}let ib=class Zw{constructor(e,t,r){this.name=e,this.schema=t,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=Bw(e,r.attrs),this.defaultAttrs=Lw(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==ss.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:_w(this.attrs,e)}create(e=null,t,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new li(this,this.computeAttrs(e),E.from(t),Ae.setFrom(r))}createChecked(e=null,t,r){return t=E.from(t),this.checkContent(t),new li(this,this.computeAttrs(e),t,Ae.setFrom(r))}createAndFill(e=null,t,r){if(e=this.computeAttrs(e),t=E.from(t),t.size){let o=this.contentMatch.fillBefore(t);if(!o)return null;t=o.append(t)}let i=this.contentMatch.matchFragment(t),s=i&&i.fillBefore(E.empty,!0);return s?new li(this,e,t.append(s),Ae.setFrom(r)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?t&&t.push(e[r]):t||(t=e.slice(0,r));return t?t.length?t:Ae.none:e}static compile(e,t){let r=Object.create(null);e.forEach((s,o)=>r[s]=new Zw(s,t,o));let i=t.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let s in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function UX(n,e,t){let r=t.split("|");return i=>{let s=i===null?"null":typeof i;if(r.indexOf(s)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${n}, got ${s}`)}}class GX{constructor(e,t,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?UX(e,t,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class wd{constructor(e,t,r,i){this.name=e,this.rank=t,this.schema=r,this.spec=i,this.attrs=Bw(e,i.attrs),this.excluded=null;let s=Lw(this.attrs);this.instance=s?new Ae(this,s):null}create(e=null){return!e&&this.instance?this.instance:new Ae(this,_w(this.attrs,e))}static compile(e,t){let r=Object.create(null),i=0;return e.forEach((s,o)=>r[s]=new wd(s,i++,t,o)),r}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}excludes(e){return this.excluded.indexOf(e)>-1}}class Ac{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let i in e)t[i]=e[i];t.nodes=vt.from(e.nodes),t.marks=vt.from(e.marks||{}),this.nodes=ib.compile(this.spec.nodes,this),this.marks=wd.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let s=this.nodes[i],o=s.spec.content||"",a=s.spec.marks;if(s.contentMatch=r[o]||(r[o]=ss.parse(o,this.nodes)),s.inlineContent=s.contentMatch.inlineContent,s.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!s.isInline||!s.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=s}s.markSet=a=="_"?null:a?sb(this,a.split(" ")):a==""||!s.inlineContent?[]:null}for(let i in this.marks){let s=this.marks[i],o=s.spec.excludes;s.excluded=o==null?[s]:o==""?[]:sb(this,o.split(" "))}this.nodeFromJSON=i=>li.fromJSON(this,i),this.markFromJSON=i=>Ae.fromJSON(this,i),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof ib){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(t,r,i)}text(e,t){let r=this.nodes.text;return new LX(r,r.defaultAttrs,e,Ae.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function sb(n,e){let t=[];for(let r=0;r<e.length;r++){let i=e[r],s=n.marks[i],o=s;if(s)t.push(s);else for(let a in n.marks){let l=n.marks[a];(i=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(i)>-1)&&t.push(o=l)}if(!o)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return t}function HX(n){return n.tag!=null}function KX(n){return n.style!=null}class ci{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let r=this.matchedStyles=[];t.forEach(i=>{if(HX(i))this.tags.push(i);else if(KX(i)){let s=/[^=]*/.exec(i.style)[0];r.indexOf(s)<0&&r.push(s),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let s=e.nodes[i.node];return s.contentMatch.matchType(s)})}parse(e,t={}){let r=new ab(this,t,!1);return r.addAll(e,Ae.none,t.from,t.to),r.finish()}parseSlice(e,t={}){let r=new ab(this,t,!0);return r.addAll(e,Ae.none,t.from,t.to),z.maxOpen(r.finish())}matchTag(e,t,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let s=this.tags[i];if(t7(e,s.tag)&&(s.namespace===void 0||e.namespaceURI==s.namespace)&&(!s.context||t.matchesContext(s.context))){if(s.getAttrs){let o=s.getAttrs(e);if(o===!1)continue;s.attrs=o||void 0}return s}}}matchStyle(e,t,r,i){for(let s=i?this.styles.indexOf(i)+1:0;s<this.styles.length;s++){let o=this.styles[s],a=o.style;if(!(a.indexOf(e)!=0||o.context&&!r.matchesContext(o.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=t))){if(o.getAttrs){let l=o.getAttrs(t);if(l===!1)continue;o.attrs=l||void 0}return o}}}static schemaRules(e){let t=[];function r(i){let s=i.priority==null?50:i.priority,o=0;for(;o<t.length;o++){let a=t[o];if((a.priority==null?50:a.priority)<s)break}t.splice(o,0,i)}for(let i in e.marks){let s=e.marks[i].spec.parseDOM;s&&s.forEach(o=>{r(o=lb(o)),o.mark||o.ignore||o.clearMark||(o.mark=i)})}for(let i in e.nodes){let s=e.nodes[i].spec.parseDOM;s&&s.forEach(o=>{r(o=lb(o)),o.node||o.ignore||o.mark||(o.node=i)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new ci(e,ci.schemaRules(e)))}}const Ww={address:!0,article:!0,aside:!0,blockquote:!0,body:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},JX={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},zw={ol:!0,ul:!0},qa=1,kp=2,la=4;function ob(n,e,t){return e!=null?(e?qa:0)|(e==="full"?kp:0):n&&n.whitespace=="pre"?qa|kp:t&~la}class Hl{constructor(e,t,r,i,s,o){this.type=e,this.attrs=t,this.marks=r,this.solid=i,this.options=o,this.content=[],this.activeMarks=Ae.none,this.match=s||(o&la?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(E.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&qa)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let s=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=s.withText(s.text.slice(0,s.text.length-i[0].length))}}let t=E.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(E.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Ww.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class ab{constructor(e,t,r){this.parser=e,this.options=t,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let i=t.topNode,s,o=ob(null,t.preserveWhitespace,0)|(r?la:0);i?s=new Hl(i.type,i.attrs,Ae.none,!0,t.topMatch||i.type.contentMatch,o):r?s=new Hl(null,null,Ae.none,!0,null,o):s=new Hl(e.schema.topNodeType,null,Ae.none,!0,null,o),this.nodes=[s],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let r=e.nodeValue,i=this.top,s=i.options&kp?"full":this.localPreserveWS||(i.options&qa)>0,{schema:o}=this.parser;if(s==="full"||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(s)if(s==="full")r=r.replace(/\r\n?/g,`
|
|
107
|
+
`);else if(o.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(o.linebreakReplacement.create())){let a=r.split(/\r?\n|\r/);for(let l=0;l<a.length;l++)l&&this.insertNode(o.linebreakReplacement.create(),t,!0),a[l]&&this.insertNode(o.text(a[l]),t,!/\S/.test(a[l]));r=""}else r=r.replace(/\r?\n|\r/g," ");else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let a=i.content[i.content.length-1],l=e.previousSibling;(!a||l&&l.nodeName=="BR"||a.isText&&/[ \t\r\n\u000c]$/.test(a.text))&&(r=r.slice(1))}r&&this.insertNode(o.text(r),t,!/\S/.test(r)),this.findInText(e)}else this.findInside(e)}addElement(e,t,r){let i=this.localPreserveWS,s=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let o=e.nodeName.toLowerCase(),a;zw.hasOwnProperty(o)&&this.parser.normalizeLists&&e7(e);let l=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(a=this.parser.matchTag(e,this,r));e:if(l?l.ignore:JX.hasOwnProperty(o))this.findInside(e),this.ignoreFallback(e,t);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(e=l.skip);let c,d=this.needsBlock;if(Ww.hasOwnProperty(o))s.content.length&&s.content[0].isInline&&this.open&&(this.open--,s=this.top),c=!0,s.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break e}let h=l&&l.skip?t:this.readStyles(e,t);h&&this.addAll(e,h),c&&this.sync(s),this.needsBlock=d}else{let c=this.readStyles(e,t);c&&this.addElementByRule(e,l,c,l.consuming===!1?a:void 0)}this.localPreserveWS=i}leafFallback(e,t){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
|
|
108
|
+
`),t)}ignoreFallback(e,t){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),t,!0)}readStyles(e,t){let r=e.style;if(r&&r.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let s=this.parser.matchedStyles[i],o=r.getPropertyValue(s);if(o)for(let a=void 0;;){let l=this.parser.matchStyle(s,o,this,a);if(!l)break;if(l.ignore)return null;if(l.clearMark?t=t.filter(c=>!l.clearMark(c)):t=t.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)a=l;else break}}return t}addElementByRule(e,t,r,i){let s,o;if(t.node)if(o=this.parser.schema.nodes[t.node],o.isLeaf)this.insertNode(o.create(t.attrs),r,e.nodeName=="BR")||this.leafFallback(e,r);else{let l=this.enter(o,t.attrs||null,r,t.preserveWhitespace);l&&(s=!0,r=l)}else{let l=this.parser.schema.marks[t.mark];r=r.concat(l.create(t.attrs))}let a=this.top;if(o&&o.isLeaf)this.findInside(e);else if(i)this.addElement(e,r,i);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l,r,!1));else{let l=e;typeof t.contentElement=="string"?l=e.querySelector(t.contentElement):typeof t.contentElement=="function"?l=t.contentElement(e):t.contentElement&&(l=t.contentElement),this.findAround(e,l,!0),this.addAll(l,r),this.findAround(e,l,!1)}s&&this.sync(a)&&this.open--}addAll(e,t,r,i){let s=r||0;for(let o=r?e.childNodes[r]:e.firstChild,a=i==null?null:e.childNodes[i];o!=a;o=o.nextSibling,++s)this.findAtPoint(e,s),this.addDOM(o,t);this.findAtPoint(e,s)}findPlace(e,t,r){let i,s;for(let o=this.open,a=0;o>=0;o--){let l=this.nodes[o],c=l.findWrapping(e);if(c&&(!i||i.length>c.length+a)&&(i=c,s=l,!c.length))break;if(l.solid){if(r)break;a+=2}}if(!i)return null;this.sync(s);for(let o=0;o<i.length;o++)t=this.enterInner(i[o],null,t,!1);return t}insertNode(e,t,r){if(e.isInline&&this.needsBlock&&!this.top.type){let s=this.textblockFromContext();s&&(t=this.enterInner(s,null,t))}let i=this.findPlace(e,t,r);if(i){this.closeExtra();let s=this.top;s.match&&(s.match=s.match.matchType(e.type));let o=Ae.none;for(let a of i.concat(e.marks))(s.type?s.type.allowsMarkType(a.type):cb(a.type,e.type))&&(o=a.addToSet(o));return s.content.push(e.mark(o)),!0}return!1}enter(e,t,r,i){let s=this.findPlace(e.create(t),r,!1);return s&&(s=this.enterInner(e,t,r,!0,i)),s}enterInner(e,t,r,i=!1,s){this.closeExtra();let o=this.top;o.match=o.match&&o.match.matchType(e);let a=ob(e,s,o.options);o.options&la&&o.content.length==0&&(a|=la);let l=Ae.none;return r=r.filter(c=>(o.type?o.type.allowsMarkType(c.type):cb(c.type,e))?(l=c.addToSet(l),!1):!0),this.nodes.push(new Hl(e,t,l,i,null,a)),this.open++,r}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--){if(this.nodes[t]==e)return this.open=t,!0;this.localPreserveWS&&(this.nodes[t].options|=qa)}return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let r=this.nodes[t].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==t&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,r){if(e!=t&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&t.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),s=-(r?r.depth+1:0)+(i?0:1),o=(a,l)=>{for(;a>=0;a--){let c=t[a];if(c==""){if(a==t.length-1||a==0)continue;for(;l>=s;l--)if(o(a-1,l))return!0;return!1}else{let d=l>0||l==0&&i?this.nodes[l].type:r&&l>=s?r.node(l-s).type:null;if(!d||d.name!=c&&!d.isInGroup(c))return!1;l--}}return!0};return o(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let r=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let t in this.parser.schema.nodes){let r=this.parser.schema.nodes[t];if(r.isTextblock&&r.defaultAttrs)return r}}}function e7(n){for(let e=n.firstChild,t=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&zw.hasOwnProperty(r)&&t?(t.appendChild(e),e=t):r=="li"?t=e:r&&(t=null)}}function t7(n,e){return(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,e)}function lb(n){let e={};for(let t in n)e[t]=n[t];return e}function cb(n,e){let t=e.schema.nodes;for(let r in t){let i=t[r];if(!i.allowsMarkType(n))continue;let s=[],o=a=>{s.push(a);for(let l=0;l<a.edgeCount;l++){let{type:c,next:d}=a.edge(l);if(c==e||s.indexOf(d)<0&&o(d))return!0}};if(o(i.contentMatch))return!0}}class ds{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},r){r||(r=Kl(t).createDocumentFragment());let i=r,s=[];return e.forEach(o=>{if(s.length||o.marks.length){let a=0,l=0;for(;a<s.length&&l<o.marks.length;){let c=o.marks[l];if(!this.marks[c.type.name]){l++;continue}if(!c.eq(s[a][0])||c.type.spec.spanning===!1)break;a++,l++}for(;a<s.length;)i=s.pop()[1];for(;l<o.marks.length;){let c=o.marks[l++],d=this.serializeMark(c,o.isInline,t);d&&(s.push([c,i]),i.appendChild(d.dom),i=d.contentDOM||d.dom)}}i.appendChild(this.serializeNodeInner(o,t))}),r}serializeNodeInner(e,t){if(e.isText)return Kl(t).createTextNode(e.text);let{dom:r,contentDOM:i}=Rc(Kl(t),this.nodes[e.type.name](e),null,e.attrs);if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,i)}return r}serializeNode(e,t={}){let r=this.serializeNodeInner(e,t);for(let i=e.marks.length-1;i>=0;i--){let s=this.serializeMark(e.marks[i],e.isInline,t);s&&((s.contentDOM||s.dom).appendChild(r),r=s.dom)}return r}serializeMark(e,t,r={}){let i=this.marks[e.type.name];return i&&Rc(Kl(r),i(e,t),null,e.attrs)}static renderSpec(e,t,r=null,i){return typeof t=="string"?{dom:e.createTextNode(t)}:Rc(e,t,r,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new ds(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=ub(e.nodes);return t.text||(t.text=r=>r.text),t}static marksFromSchema(e){return ub(e.marks)}}function ub(n){let e={};for(let t in n){let r=n[t].spec.toDOM;r&&(e[t]=r)}return e}function Kl(n){return n.document||window.document}const db=new WeakMap;function n7(n){let e=db.get(n);return e===void 0&&db.set(n,e=r7(n)),e}function r7(n){let e=null;function t(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let i=0;i<r.length;i++)t(r[i]);else for(let i in r)t(r[i])}return t(n),e}function Rc(n,e,t,r){if(e.nodeType==1)return{dom:e};if(e.dom&&e.dom.nodeType==1)return e;let i=e[0],s;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(s=n7(r))&&s.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let o=i.indexOf(" ");o>0&&(t=i.slice(0,o),i=i.slice(o+1));let a,l=t?n.createElementNS(t,i):n.createElement(i),c=e[1],d=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){d=2;for(let h in c)if(c[h]!=null){let f=h.indexOf(" ");f>0?l.setAttributeNS(h.slice(0,f),h.slice(f+1),c[h]):h=="style"&&l.style?l.style.cssText=c[h]:l.setAttribute(h,c[h])}}for(let h=d;h<e.length;h++){let f=e[h];if(f===0){if(h<e.length-1||h>d)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else if(typeof f=="string")l.appendChild(n.createTextNode(f));else{let{dom:p,contentDOM:m}=Rc(n,f,t,r);if(l.appendChild(p),m){if(a)throw new RangeError("Multiple content holes");a=m}}}return{dom:l,contentDOM:a}}const Vw=65535,Fw=Math.pow(2,16);function i7(n,e){return n+e*Fw}function hb(n){return n&Vw}function s7(n){return(n-(n&Vw))/Fw}const qw=1,Yw=2,Ec=4,Uw=8;class vp{constructor(e,t,r){this.pos=e,this.delInfo=t,this.recover=r}get deleted(){return(this.delInfo&Uw)>0}get deletedBefore(){return(this.delInfo&(qw|Ec))>0}get deletedAfter(){return(this.delInfo&(Yw|Ec))>0}get deletedAcross(){return(this.delInfo&Ec)>0}}class hn{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&hn.empty)return hn.empty}recover(e){let t=0,r=hb(e);if(!this.inverted)for(let i=0;i<r;i++)t+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+t+s7(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,r){let i=0,s=this.inverted?2:1,o=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?i:0);if(l>e)break;let c=this.ranges[a+s],d=this.ranges[a+o],h=l+c;if(e<=h){let f=c?e==l?-1:e==h?1:t:t,p=l+i+(f<0?0:d);if(r)return p;let m=e==(t<0?l:h)?null:i7(a/3,e-l),O=0;return c&&(O|=e==l?Yw:e==h?qw:Ec,(t<0?e!=l:e!=h)&&(O|=Uw)),new vp(p,O,m)}i+=d-c}return r?e+i:new vp(e+i,0,null)}touches(e,t){let r=0,i=hb(t),s=this.inverted?2:1,o=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?r:0);if(l>e)break;let c=this.ranges[a+s],d=l+c;if(e<=d&&a==i*3)return!0;r+=this.ranges[a+o]-c}return!1}forEach(e){let t=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,s=0;i<this.ranges.length;i+=3){let o=this.ranges[i],a=o-(this.inverted?s:0),l=o+(this.inverted?0:s),c=this.ranges[i+t],d=this.ranges[i+r];e(a,a+c,l,l+d),s+=d-c}}invert(){return new hn(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?hn.empty:new hn(e<0?[0,-e,0]:[0,0,e])}}hn.empty=new hn([]);class Ya{constructor(e,t,r=0,i=e?e.length:0){this.mirror=t,this.from=r,this.to=i,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(e=0,t=this.maps.length){return new Ya(this._maps,this.mirror,e,t)}appendMap(e,t){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),t!=null&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,r=this._maps.length;t<e._maps.length;t++){let i=e.getMirror(t);this.appendMap(e._maps[t],i!=null&&i<t?r+i:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,r=this._maps.length+e._maps.length;t>=0;t--){let i=e.getMirror(t);this.appendMap(e._maps[t].invert(),i!=null&&i>t?r-i-1:void 0)}}invert(){let e=new Ya;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let r=this.from;r<this.to;r++)e=this._maps[r].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,r){let i=0;for(let s=this.from;s<this.to;s++){let o=this._maps[s],a=o.mapResult(e,t);if(a.recover!=null){let l=this.getMirror(s);if(l!=null&&l>s&&l<this.to){s=l,e=this._maps[l].recover(a.recover);continue}}i|=a.delInfo,e=a.pos}return r?e:new vp(e,i,null)}}const Lh=Object.create(null);class _t{getMap(){return hn.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=Lh[t.stepType];if(!r)throw new RangeError(`No step type ${t.stepType} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in Lh)throw new RangeError("Duplicate use of step JSON ID "+e);return Lh[e]=t,t.prototype.jsonID=e,t}}class ct{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new ct(e,null)}static fail(e){return new ct(null,e)}static fromReplace(e,t,r,i){try{return ct.ok(e.replace(t,r,i))}catch(s){if(s instanceof Va)return ct.fail(s.message);throw s}}}function cg(n,e,t){let r=[];for(let i=0;i<n.childCount;i++){let s=n.child(i);s.content.size&&(s=s.copy(cg(s.content,e,s))),s.isInline&&(s=e(s,t,i)),r.push(s)}return E.fromArray(r)}class si extends _t{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=e.resolve(this.from),i=r.node(r.sharedDepth(this.to)),s=new z(cg(t.content,(o,a)=>!o.isAtom||!a.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),i),t.openStart,t.openEnd);return ct.fromReplace(e,this.from,this.to,s)}invert(){return new Bn(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new si(t.pos,r.pos,this.mark)}merge(e){return e instanceof si&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new si(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new si(t.from,t.to,e.markFromJSON(t.mark))}}_t.jsonID("addMark",si);class Bn extends _t{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=new z(cg(t.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),t.openStart,t.openEnd);return ct.fromReplace(e,this.from,this.to,r)}invert(){return new si(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new Bn(t.pos,r.pos,this.mark)}merge(e){return e instanceof Bn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Bn(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Bn(t.from,t.to,e.markFromJSON(t.mark))}}_t.jsonID("removeMark",Bn);class oi extends _t{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return ct.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return ct.fromReplace(e,this.pos,this.pos+1,new z(E.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let r=this.mark.addToSet(t.marks);if(r.length==t.marks.length){for(let i=0;i<t.marks.length;i++)if(!t.marks[i].isInSet(r))return new oi(this.pos,t.marks[i]);return new oi(this.pos,this.mark)}}return new as(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new oi(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new oi(t.pos,e.markFromJSON(t.mark))}}_t.jsonID("addNodeMark",oi);class as extends _t{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return ct.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return ct.fromReplace(e,this.pos,this.pos+1,new z(E.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new oi(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new as(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new as(t.pos,e.markFromJSON(t.mark))}}_t.jsonID("removeNodeMark",as);class rt extends _t{constructor(e,t,r,i=!1){super(),this.from=e,this.to=t,this.slice=r,this.structure=i}apply(e){return this.structure&&wp(e,this.from,this.to)?ct.fail("Structure replace would overwrite content"):ct.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new hn([this.from,this.to-this.from,this.slice.size])}invert(e){return new rt(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.to,-1),r=this.from==this.to&&rt.MAP_BIAS<0?t:e.mapResult(this.from,1);return r.deletedAcross&&t.deletedAcross?null:new rt(r.pos,Math.max(r.pos,t.pos),this.slice,this.structure)}merge(e){if(!(e instanceof rt)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let t=this.slice.size+e.slice.size==0?z.empty:new z(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new rt(this.from,this.to+(e.to-e.from),t,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let t=this.slice.size+e.slice.size==0?z.empty:new z(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new rt(e.from,this.to,t,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new rt(t.from,t.to,z.fromJSON(e,t.slice),!!t.structure)}}rt.MAP_BIAS=1;_t.jsonID("replace",rt);class xt extends _t{constructor(e,t,r,i,s,o,a=!1){super(),this.from=e,this.to=t,this.gapFrom=r,this.gapTo=i,this.slice=s,this.insert=o,this.structure=a}apply(e){if(this.structure&&(wp(e,this.from,this.gapFrom)||wp(e,this.gapTo,this.to)))return ct.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return ct.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,t.content);return r?ct.fromReplace(e,this.from,this.to,r):ct.fail("Content does not fit in gap")}getMap(){return new hn([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new xt(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),i=this.from==this.gapFrom?t.pos:e.map(this.gapFrom,-1),s=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return t.deletedAcross&&r.deletedAcross||i<t.pos||s>r.pos?null:new xt(t.pos,r.pos,i,s,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new xt(t.from,t.to,t.gapFrom,t.gapTo,z.fromJSON(e,t.slice),t.insert,!!t.structure)}}_t.jsonID("replaceAround",xt);function wp(n,e,t){let r=n.resolve(e),i=t-e,s=r.depth;for(;i>0&&s>0&&r.indexAfter(s)==r.node(s).childCount;)s--,i--;if(i>0){let o=r.node(s).maybeChild(r.indexAfter(s));for(;i>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,i--}}return!1}function o7(n,e,t,r){let i=[],s=[],o,a;n.doc.nodesBetween(e,t,(l,c,d)=>{if(!l.isInline)return;let h=l.marks;if(!r.isInSet(h)&&d.type.allowsMarkType(r.type)){let f=Math.max(c,e),p=Math.min(c+l.nodeSize,t),m=r.addToSet(h);for(let O=0;O<h.length;O++)h[O].isInSet(m)||(o&&o.to==f&&o.mark.eq(h[O])?o.to=p:i.push(o=new Bn(f,p,h[O])));a&&a.to==f?a.to=p:s.push(a=new si(f,p,r))}}),i.forEach(l=>n.step(l)),s.forEach(l=>n.step(l))}function a7(n,e,t,r){let i=[],s=0;n.doc.nodesBetween(e,t,(o,a)=>{if(!o.isInline)return;s++;let l=null;if(r instanceof wd){let c=o.marks,d;for(;d=r.isInSet(c);)(l||(l=[])).push(d),c=d.removeFromSet(c)}else r?r.isInSet(o.marks)&&(l=[r]):l=o.marks;if(l&&l.length){let c=Math.min(a+o.nodeSize,t);for(let d=0;d<l.length;d++){let h=l[d],f;for(let p=0;p<i.length;p++){let m=i[p];m.step==s-1&&h.eq(i[p].style)&&(f=m)}f?(f.to=c,f.step=s):i.push({style:h,from:Math.max(a,e),to:c,step:s})}}}),i.forEach(o=>n.step(new Bn(o.from,o.to,o.style)))}function ug(n,e,t,r=t.contentMatch,i=!0){let s=n.doc.nodeAt(e),o=[],a=e+1;for(let l=0;l<s.childCount;l++){let c=s.child(l),d=a+c.nodeSize,h=r.matchType(c.type);if(!h)o.push(new rt(a,d,z.empty));else{r=h;for(let f=0;f<c.marks.length;f++)t.allowsMarkType(c.marks[f].type)||n.step(new Bn(a,d,c.marks[f]));if(i&&c.isText&&t.whitespace!="pre"){let f,p=/\r?\n|\r/g,m;for(;f=p.exec(c.text);)m||(m=new z(E.from(t.schema.text(" ",t.allowedMarks(c.marks))),0,0)),o.push(new rt(a+f.index,a+f.index+f[0].length,m))}}a=d}if(!r.validEnd){let l=r.fillBefore(E.empty,!0);n.replace(a,a,new z(l,0,0))}for(let l=o.length-1;l>=0;l--)n.step(o[l])}function l7(n,e,t){return(e==0||n.canReplace(e,n.childCount))&&(t==n.childCount||n.canReplace(0,t))}function yo(n){let t=n.parent.content.cutByIndex(n.startIndex,n.endIndex);for(let r=n.depth,i=0,s=0;;--r){let o=n.$from.node(r),a=n.$from.index(r)+i,l=n.$to.indexAfter(r)-s;if(r<n.depth&&o.canReplace(a,l,t))return r;if(r==0||o.type.spec.isolating||!l7(o,a,l))break;a&&(i=1),l<o.childCount&&(s=1)}return null}function c7(n,e,t){let{$from:r,$to:i,depth:s}=e,o=r.before(s+1),a=i.after(s+1),l=o,c=a,d=E.empty,h=0;for(let m=s,O=!1;m>t;m--)O||r.index(m)>0?(O=!0,d=E.from(r.node(m).copy(d)),h++):l--;let f=E.empty,p=0;for(let m=s,O=!1;m>t;m--)O||i.after(m+1)<i.end(m)?(O=!0,f=E.from(i.node(m).copy(f)),p++):c++;n.step(new xt(l,c,o,a,new z(d.append(f),h,p),d.size-h,!0))}function dg(n,e,t=null,r=n){let i=u7(n,e),s=i&&d7(r,e);return s?i.map(fb).concat({type:e,attrs:t}).concat(s.map(fb)):null}function fb(n){return{type:n,attrs:null}}function u7(n,e){let{parent:t,startIndex:r,endIndex:i}=n,s=t.contentMatchAt(r).findWrapping(e);if(!s)return null;let o=s.length?s[0]:e;return t.canReplaceWith(r,i,o)?s:null}function d7(n,e){let{parent:t,startIndex:r,endIndex:i}=n,s=t.child(r),o=e.contentMatch.findWrapping(s.type);if(!o)return null;let l=(o.length?o[o.length-1]:e).contentMatch;for(let c=r;l&&c<i;c++)l=l.matchType(t.child(c).type);return!l||!l.validEnd?null:o}function h7(n,e,t){let r=E.empty;for(let o=t.length-1;o>=0;o--){if(r.size){let a=t[o].type.contentMatch.matchFragment(r);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=E.from(t[o].type.create(t[o].attrs,r))}let i=e.start,s=e.end;n.step(new xt(i,s,i,s,new z(r,0,0),t.length,!0))}function f7(n,e,t,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=n.steps.length;n.doc.nodesBetween(e,t,(o,a)=>{let l=typeof i=="function"?i(o):i;if(o.isTextblock&&!o.hasMarkup(r,l)&&p7(n.doc,n.mapping.slice(s).map(a),r)){let c=null;if(r.schema.linebreakReplacement){let p=r.whitespace=="pre",m=!!r.contentMatch.matchType(r.schema.linebreakReplacement);p&&!m?c=!1:!p&&m&&(c=!0)}c===!1&&Hw(n,o,a,s),ug(n,n.mapping.slice(s).map(a,1),r,void 0,c===null);let d=n.mapping.slice(s),h=d.map(a,1),f=d.map(a+o.nodeSize,1);return n.step(new xt(h,f,h+1,f-1,new z(E.from(r.create(l,null,o.marks)),0,0),1,!0)),c===!0&&Gw(n,o,a,s),!1}})}function Gw(n,e,t,r){e.forEach((i,s)=>{if(i.isText){let o,a=/\r?\n|\r/g;for(;o=a.exec(i.text);){let l=n.mapping.slice(r).map(t+1+s+o.index);n.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function Hw(n,e,t,r){e.forEach((i,s)=>{if(i.type==i.type.schema.linebreakReplacement){let o=n.mapping.slice(r).map(t+1+s);n.replaceWith(o,o+1,e.type.schema.text(`
|
|
109
|
+
`))}})}function p7(n,e,t){let r=n.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,t)}function m7(n,e,t,r,i){let s=n.doc.nodeAt(e);if(!s)throw new RangeError("No node at given position");t||(t=s.type);let o=t.create(r,null,i||s.marks);if(s.isLeaf)return n.replaceWith(e,e+s.nodeSize,o);if(!t.validContent(s.content))throw new RangeError("Invalid content for node type "+t.name);n.step(new xt(e,e+s.nodeSize,e+1,e+s.nodeSize-1,new z(E.from(o),0,0),1,!0))}function Lr(n,e,t=1,r){let i=n.resolve(e),s=i.depth-t,o=r&&r[r.length-1]||i.parent;if(s<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!o.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let c=i.depth-1,d=t-2;c>s;c--,d--){let h=i.node(c),f=i.index(c);if(h.type.spec.isolating)return!1;let p=h.content.cutByIndex(f,h.childCount),m=r&&r[d+1];m&&(p=p.replaceChild(0,m.type.create(m.attrs)));let O=r&&r[d]||h;if(!h.canReplace(f+1,h.childCount)||!O.type.validContent(p))return!1}let a=i.indexAfter(s),l=r&&r[0];return i.node(s).canReplaceWith(a,a,l?l.type:i.node(s+1).type)}function g7(n,e,t=1,r){let i=n.doc.resolve(e),s=E.empty,o=E.empty;for(let a=i.depth,l=i.depth-t,c=t-1;a>l;a--,c--){s=E.from(i.node(a).copy(s));let d=r&&r[c];o=E.from(d?d.type.create(d.attrs,o):i.node(a).copy(o))}n.step(new rt(e,e,new z(s.append(o),t,t),!0))}function Ci(n,e){let t=n.resolve(e),r=t.index();return Kw(t.nodeBefore,t.nodeAfter)&&t.parent.canReplace(r,r+1)}function O7(n,e){e.content.size||n.type.compatibleContent(e.type);let t=n.contentMatchAt(n.childCount),{linebreakReplacement:r}=n.type.schema;for(let i=0;i<e.childCount;i++){let s=e.child(i),o=s.type==r?n.type.schema.nodes.text:s.type;if(t=t.matchType(o),!t||!n.type.allowsMarks(s.marks))return!1}return t.validEnd}function Kw(n,e){return!!(n&&e&&!n.isLeaf&&O7(n,e))}function Qd(n,e,t=-1){let r=n.resolve(e);for(let i=r.depth;;i--){let s,o,a=r.index(i);if(i==r.depth?(s=r.nodeBefore,o=r.nodeAfter):t>0?(s=r.node(i+1),a++,o=r.node(i).maybeChild(a)):(s=r.node(i).maybeChild(a-1),o=r.node(i+1)),s&&!s.isTextblock&&Kw(s,o)&&r.node(i).canReplace(a,a+1))return e;if(i==0)break;e=t<0?r.before(i):r.after(i)}}function b7(n,e,t){let r=null,{linebreakReplacement:i}=n.doc.type.schema,s=n.doc.resolve(e-t),o=s.node().type;if(i&&o.inlineContent){let d=o.whitespace=="pre",h=!!o.contentMatch.matchType(i);d&&!h?r=!1:!d&&h&&(r=!0)}let a=n.steps.length;if(r===!1){let d=n.doc.resolve(e+t);Hw(n,d.node(),d.before(),a)}o.inlineContent&&ug(n,e+t-1,o,s.node().contentMatchAt(s.index()),r==null);let l=n.mapping.slice(a),c=l.map(e-t);if(n.step(new rt(c,l.map(e+t,-1),z.empty,!0)),r===!0){let d=n.doc.resolve(c);Gw(n,d.node(),d.before(),n.steps.length)}return n}function y7(n,e,t){let r=n.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),t))return e;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let s=r.index(i);if(r.node(i).canReplaceWith(s,s,t))return r.before(i+1);if(s>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let s=r.indexAfter(i);if(r.node(i).canReplaceWith(s,s,t))return r.after(i+1);if(s<r.node(i).childCount)return null}return null}function Jw(n,e,t){let r=n.resolve(e);if(!t.content.size)return e;let i=t.content;for(let s=0;s<t.openStart;s++)i=i.firstChild.content;for(let s=1;s<=(t.openStart==0&&t.size?2:1);s++)for(let o=r.depth;o>=0;o--){let a=o==r.depth?0:r.pos<=(r.start(o+1)+r.end(o+1))/2?-1:1,l=r.index(o)+(a>0?1:0),c=r.node(o),d=!1;if(s==1)d=c.canReplace(l,l,i);else{let h=c.contentMatchAt(l).findWrapping(i.firstChild.type);d=h&&c.canReplaceWith(l,l,h[0])}if(d)return a==0?r.pos:a<0?r.before(o+1):r.after(o+1)}return null}function $d(n,e,t=e,r=z.empty){if(e==t&&!r.size)return null;let i=n.resolve(e),s=n.resolve(t);return e2(i,s,r)?new rt(e,t,r):new x7(i,s,r).fit()}function e2(n,e,t){return!t.openStart&&!t.openEnd&&n.start()==e.start()&&n.parent.canReplace(n.index(),e.index(),t.content)}class x7{constructor(e,t,r){this.$from=e,this.$to=t,this.unplaced=r,this.frontier=[],this.placed=E.empty;for(let i=0;i<=e.depth;i++){let s=e.node(i);this.frontier.push({type:s.type,match:s.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=E.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;let s=this.placed,o=r.depth,a=i.depth;for(;o&&a&&s.childCount==1;)s=s.firstChild.content,o--,a--;let l=new z(s,o,a);return e>-1?new xt(r.pos,e,this.$to.pos,this.$to.end(),l,t):l.size||r.pos!=this.$to.pos?new rt(r.pos,i.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,r=0,i=this.unplaced.openEnd;r<e;r++){let s=t.firstChild;if(t.childCount>1&&(i=0),s.type.spec.isolating&&i<=r){e=r;break}t=s.content}for(let t=1;t<=2;t++)for(let r=t==1?e:this.unplaced.openStart;r>=0;r--){let i,s=null;r?(s=pb(this.unplaced.content,r-1).firstChild,i=s.content):i=this.unplaced.content;let o=i.firstChild;for(let a=this.depth;a>=0;a--){let{type:l,match:c}=this.frontier[a],d,h=null;if(t==1&&(o?c.matchType(o.type)||(h=c.fillBefore(E.from(o),!1)):s&&l.compatibleContent(s.type)))return{sliceDepth:r,frontierDepth:a,parent:s,inject:h};if(t==2&&o&&(d=c.findWrapping(o.type)))return{sliceDepth:r,frontierDepth:a,parent:s,wrap:d};if(s&&c.matchType(s.type))break}}}openMore(){let{content:e,openStart:t,openEnd:r}=this.unplaced;return mb(e,-1)<=t?!1:(this.unplaced.size>1&&mb(e,1)>r&&r++,this.unplaced=new z(e,t+1,r),!0)}dropNode(){let{content:e,openStart:t,openEnd:r}=this.unplaced,i=pb(e,t);if(i.childCount<=1&&t>0){let s=e.size-t<=t+i.size;this.unplaced=new z(Fo(e,t-1,1),t-1,s?t-1:r)}else this.unplaced=new z(Fo(e,t,1),t,r)}placeNodes({sliceDepth:e,frontierDepth:t,parent:r,inject:i,wrap:s}){for(;this.depth>t;)this.closeFrontierNode();if(s)for(let O=0;O<s.length;O++)this.openFrontierNode(s[O]);let o=this.unplaced,a=r?r.content:o.content,l=o.openStart-e,c=0,d=[],{match:h,type:f}=this.frontier[t];if(i){for(let O=0;O<i.childCount;O++)d.push(i.child(O));h=h.matchFragment(i)}let p=a.size+e-(o.content.size-o.openEnd);for(;c<a.childCount;){let O=a.child(c),b=h.matchType(O.type);if(!b)break;c++,(c>1||l==0||O.content.size)&&(h=b,d.push(t2(O.mark(f.allowedMarks(O.marks)),c==1?l:0,c==a.childCount?p:-1)))}let m=c==a.childCount;m||(p=-1),this.placed=qo(this.placed,t,E.from(d)),this.frontier[t].match=h,m&&p<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let O=0,b=a;O<p;O++){let y=b.lastChild;this.frontier.push({type:y.type,match:y.contentMatchAt(y.childCount)}),b=y.content}this.unplaced=m?e==0?z.empty:new z(Fo(o.content,e-1,1),e-1,p<0?o.openEnd:e-1):new z(Fo(o.content,e,c),o.openStart,o.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!_h(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return-1;let{depth:r}=this.$to,i=this.$to.after(r);for(;r>1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:r,type:i}=this.frontier[t],s=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),o=_h(e,t,i,r,s);if(o){for(let a=t-1;a>=0;a--){let{match:l,type:c}=this.frontier[a],d=_h(e,a,c,l,!0);if(!d||d.childCount)continue e}return{depth:t,fit:o,move:s?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=qo(this.placed,t.depth,t.fit)),e=t.move;for(let r=t.depth+1;r<=e.depth;r++){let i=e.node(r),s=i.type.contentMatch.fillBefore(i.content,!0,e.index(r));this.openFrontierNode(i.type,i.attrs,s)}return e}openFrontierNode(e,t=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=qo(this.placed,this.depth,E.from(e.create(t,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(E.empty,!0);t.childCount&&(this.placed=qo(this.placed,this.frontier.length,t))}}function Fo(n,e,t){return e==0?n.cutByIndex(t,n.childCount):n.replaceChild(0,n.firstChild.copy(Fo(n.firstChild.content,e-1,t)))}function qo(n,e,t){return e==0?n.append(t):n.replaceChild(n.childCount-1,n.lastChild.copy(qo(n.lastChild.content,e-1,t)))}function pb(n,e){for(let t=0;t<e;t++)n=n.firstChild.content;return n}function t2(n,e,t){if(e<=0)return n;let r=n.content;return e>1&&(r=r.replaceChild(0,t2(r.firstChild,e-1,r.childCount==1?t-1:0))),e>0&&(r=n.type.contentMatch.fillBefore(r).append(r),t<=0&&(r=r.append(n.type.contentMatch.matchFragment(r).fillBefore(E.empty,!0)))),n.copy(r)}function _h(n,e,t,r,i){let s=n.node(e),o=i?n.indexAfter(e):n.index(e);if(o==s.childCount&&!t.compatibleContent(s.type))return null;let a=r.fillBefore(s.content,!0,o);return a&&!S7(t,s.content,o)?a:null}function S7(n,e,t){for(let r=t;r<e.childCount;r++)if(!n.allowsMarks(e.child(r).marks))return!0;return!1}function k7(n){return n.spec.defining||n.spec.definingForContent}function mb(n,e){for(let t=0;;t++){let r=e<0?n.firstChild:n.lastChild;if(!r||r.isAtom)return t;n=r.content}}function v7(n,e,t,r){if(!r.size)return n.deleteRange(e,t);let i=n.doc.resolve(e),s=n.doc.resolve(t);if(e2(i,s,r))return n.step(new rt(e,t,r));let o=r2(i,s);o[o.length-1]==0&&o.pop();let a=-(i.depth+1);o.unshift(a);for(let f=i.depth,p=i.pos-1;f>0;f--,p--){let m=i.node(f).type.spec;if(m.defining||m.definingAsContext||m.isolating)break;o.indexOf(f)>-1?a=f:i.before(f)==p&&o.splice(1,0,-f)}let l=o.indexOf(a),c=[],d=r.openStart;for(let f=r.content,p=0;;p++){let m=f.firstChild;if(c.push(m),p==r.openStart)break;f=m.content}for(let f=d-1;f>=0;f--){let p=c[f],m=k7(p.type);if(m&&!p.sameMarkup(i.node(Math.abs(a)-1)))d=f;else if(m||!p.type.isTextblock)break}for(let f=r.openStart;f>=0;f--){let p=(f+d+1)%(r.openStart+1),m=c[p];if(m)for(let O=0;O<o.length;O++){let b=o[(O+l)%o.length],y=!0;b<0&&(y=!1,b=-b);let k=i.node(b-1),x=i.index(b-1);if(k.canReplaceWith(x,x,m.type,m.marks))return n.replace(i.before(b),y?s.after(b):t,new z(n2(r.content,0,r.openStart,p),p,r.openEnd))}}let h=n.steps.length;for(let f=o.length-1;f>=0&&(n.replace(e,t,r),!(n.steps.length>h));f--){let p=o[f];p<0||(e=i.before(p),t=s.after(p))}}function n2(n,e,t,r,i){if(e<t){let s=n.firstChild;n=n.replaceChild(0,s.copy(n2(s.content,e+1,t,r,s)))}if(e>r){let s=i.contentMatchAt(0),o=s.fillBefore(n).append(n);n=o.append(s.matchFragment(o).fillBefore(E.empty,!0))}return n}function w7(n,e,t,r){if(!r.isInline&&e==t&&n.doc.resolve(e).parent.content.size){let i=y7(n.doc,e,r.type);i!=null&&(e=t=i)}n.replaceRange(e,t,new z(E.from(r),0,0))}function Q7(n,e,t){let r=n.doc.resolve(e),i=n.doc.resolve(t);if(r.parent.isTextblock&&i.parent.isTextblock&&r.start()!=i.start()&&r.parentOffset==0&&i.parentOffset==0){let o=r.sharedDepth(t),a=!1;for(let l=r.depth;l>o;l--)r.node(l).type.spec.isolating&&(a=!0);for(let l=i.depth;l>o;l--)i.node(l).type.spec.isolating&&(a=!0);if(!a){for(let l=r.depth;l>0&&e==r.start(l);l--)e=r.before(l);for(let l=i.depth;l>0&&t==i.start(l);l--)t=i.before(l);r=n.doc.resolve(e),i=n.doc.resolve(t)}}let s=r2(r,i);for(let o=0;o<s.length;o++){let a=s[o],l=o==s.length-1;if(l&&a==0||r.node(a).type.contentMatch.validEnd)return n.delete(r.start(a),i.end(a));if(a>0&&(l||r.node(a-1).canReplace(r.index(a-1),i.indexAfter(a-1))))return n.delete(r.before(a),i.after(a))}for(let o=1;o<=r.depth&&o<=i.depth;o++)if(e-r.start(o)==r.depth-o&&t>r.end(o)&&i.end(o)-t!=i.depth-o&&r.start(o-1)==i.start(o-1)&&r.node(o-1).canReplace(r.index(o-1),i.index(o-1)))return n.delete(r.before(o),t);n.delete(e,t)}function r2(n,e){let t=[],r=Math.min(n.depth,e.depth);for(let i=r;i>=0;i--){let s=n.start(i);if(s<n.pos-(n.depth-i)||e.end(i)>e.pos+(e.depth-i)||n.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(s==e.start(i)||i==n.depth&&i==e.depth&&n.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==s-1)&&t.push(i)}return t}class zs extends _t{constructor(e,t,r){super(),this.pos=e,this.attr=t,this.value=r}apply(e){let t=e.nodeAt(this.pos);if(!t)return ct.fail("No node at attribute step's position");let r=Object.create(null);for(let s in t.attrs)r[s]=t.attrs[s];r[this.attr]=this.value;let i=t.type.create(r,null,t.marks);return ct.fromReplace(e,this.pos,this.pos+1,new z(E.from(i),0,t.isLeaf?0:1))}getMap(){return hn.empty}invert(e){return new zs(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new zs(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.pos!="number"||typeof t.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new zs(t.pos,t.attr,t.value)}}_t.jsonID("attr",zs);class Ua extends _t{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let i in e.attrs)t[i]=e.attrs[i];t[this.attr]=this.value;let r=e.type.create(t,e.content,e.marks);return ct.ok(r)}getMap(){return hn.empty}invert(e){return new Ua(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Ua(t.attr,t.value)}}_t.jsonID("docAttr",Ua);let io=class extends Error{};io=function n(e){let t=Error.call(this,e);return t.__proto__=n.prototype,t};io.prototype=Object.create(Error.prototype);io.prototype.constructor=io;io.prototype.name="TransformError";class i2{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Ya}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new io(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}changedRange(){let e=1e9,t=-1e9;for(let r=0;r<this.mapping.maps.length;r++){let i=this.mapping.maps[r];r&&(e=i.map(e,1),t=i.map(t,-1)),i.forEach((s,o,a,l)=>{e=Math.min(e,a),t=Math.max(t,l)})}return e==1e9?null:{from:e,to:t}}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,r=z.empty){let i=$d(this.doc,e,t,r);return i&&this.step(i),this}replaceWith(e,t,r){return this.replace(e,t,new z(E.from(r),0,0))}delete(e,t){return this.replace(e,t,z.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,r){return v7(this,e,t,r),this}replaceRangeWith(e,t,r){return w7(this,e,t,r),this}deleteRange(e,t){return Q7(this,e,t),this}lift(e,t){return c7(this,e,t),this}join(e,t=1){return b7(this,e,t),this}wrap(e,t){return h7(this,e,t),this}setBlockType(e,t=e,r,i=null){return f7(this,e,t,r,i),this}setNodeMarkup(e,t,r=null,i){return m7(this,e,t,r,i),this}setNodeAttribute(e,t,r){return this.step(new zs(e,t,r)),this}setDocAttribute(e,t){return this.step(new Ua(e,t)),this}addNodeMark(e,t){return this.step(new oi(e,t)),this}removeNodeMark(e,t){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(t instanceof Ae)t.isInSet(r.marks)&&this.step(new as(e,t));else{let i=r.marks,s,o=[];for(;s=t.isInSet(i);)o.push(new as(e,s)),i=s.removeFromSet(i);for(let a=o.length-1;a>=0;a--)this.step(o[a])}return this}split(e,t=1,r){return g7(this,e,t,r),this}addMark(e,t,r){return o7(this,e,t,r),this}removeMark(e,t,r){return a7(this,e,t,r),this}clearIncompatible(e,t,r){return ug(this,e,t,r),this}}const Bh=Object.create(null);class ue{constructor(e,t,r){this.$anchor=e,this.$head=t,this.ranges=r||[new $7(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=z.empty){let r=t.content.lastChild,i=null;for(let a=0;a<t.openEnd;a++)i=r,r=r.lastChild;let s=e.steps.length,o=this.ranges;for(let a=0;a<o.length;a++){let{$from:l,$to:c}=o[a],d=e.mapping.slice(s);e.replaceRange(d.map(l.pos),d.map(c.pos),a?z.empty:t),a==0&&bb(e,s,(r?r.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(e,t){let r=e.steps.length,i=this.ranges;for(let s=0;s<i.length;s++){let{$from:o,$to:a}=i[s],l=e.mapping.slice(r),c=l.map(o.pos),d=l.map(a.pos);s?e.deleteRange(c,d):(e.replaceRangeWith(c,d,t),bb(e,r,t.isInline?-1:1))}}static findFrom(e,t,r=!1){let i=e.parent.inlineContent?new J(e):Qs(e.node(0),e.parent,e.pos,e.index(),t,r);if(i)return i;for(let s=e.depth-1;s>=0;s--){let o=t<0?Qs(e.node(0),e.node(s),e.before(s+1),e.index(s),t,r):Qs(e.node(0),e.node(s),e.after(s+1),e.index(s)+1,t,r);if(o)return o}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new pn(e.node(0))}static atStart(e){return Qs(e,e,0,0,1)||new pn(e)}static atEnd(e){return Qs(e,e,e.content.size,e.childCount,-1)||new pn(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=Bh[t.type];if(!r)throw new RangeError(`No selection type ${t.type} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in Bh)throw new RangeError("Duplicate use of selection JSON ID "+e);return Bh[e]=t,t.prototype.jsonID=e,t}getBookmark(){return J.between(this.$anchor,this.$head).getBookmark()}}ue.prototype.visible=!0;class $7{constructor(e,t){this.$from=e,this.$to=t}}let gb=!1;function Ob(n){!gb&&!n.parent.inlineContent&&(gb=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+n.parent.type.name+")"))}class J extends ue{constructor(e,t=e){Ob(e),Ob(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let r=e.resolve(t.map(this.head));if(!r.parent.inlineContent)return ue.near(r);let i=e.resolve(t.map(this.anchor));return new J(i.parent.inlineContent?i:r,r)}replace(e,t=z.empty){if(super.replace(e,t),t==z.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof J&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Cd(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if(typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new J(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,r=t){let i=e.resolve(t);return new this(i,r==t?i:e.resolve(r))}static between(e,t,r){let i=e.pos-t.pos;if((!r||i)&&(r=i>=0?1:-1),!t.parent.inlineContent){let s=ue.findFrom(t,r,!0)||ue.findFrom(t,-r,!0);if(s)t=s.$head;else return ue.near(t,r)}return e.parent.inlineContent||(i==0?e=t:(e=(ue.findFrom(e,-r,!0)||ue.findFrom(e,r,!0)).$anchor,e.pos<t.pos!=i<0&&(e=t))),new J(e,t)}}ue.jsonID("text",J);class Cd{constructor(e,t){this.anchor=e,this.head=t}map(e){return new Cd(e.map(this.anchor),e.map(this.head))}resolve(e){return J.between(e.resolve(this.anchor),e.resolve(this.head))}}class ee extends ue{constructor(e){let t=e.nodeAfter,r=e.node(0).resolve(e.pos+t.nodeSize);super(e,r),this.node=t}map(e,t){let{deleted:r,pos:i}=t.mapResult(this.anchor),s=e.resolve(i);return r?ue.near(s):new ee(s)}content(){return new z(E.from(this.node),0,0)}eq(e){return e instanceof ee&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new hg(this.anchor)}static fromJSON(e,t){if(typeof t.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new ee(e.resolve(t.anchor))}static create(e,t){return new ee(e.resolve(t))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}ee.prototype.visible=!1;ue.jsonID("node",ee);class hg{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:r}=e.mapResult(this.anchor);return t?new Cd(r,r):new hg(r)}resolve(e){let t=e.resolve(this.anchor),r=t.nodeAfter;return r&&ee.isSelectable(r)?new ee(t):ue.near(t)}}class pn extends ue{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=z.empty){if(t==z.empty){e.delete(0,e.doc.content.size);let r=ue.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new pn(e)}map(e){return new pn(e)}eq(e){return e instanceof pn}getBookmark(){return C7}}ue.jsonID("all",pn);const C7={map(){return this},resolve(n){return new pn(n)}};function Qs(n,e,t,r,i,s=!1){if(e.inlineContent)return J.create(n,t);for(let o=r-(i>0?0:1);i>0?o<e.childCount:o>=0;o+=i){let a=e.child(o);if(a.isAtom){if(!s&&ee.isSelectable(a))return ee.create(n,t-(i<0?a.nodeSize:0))}else{let l=Qs(n,a,t+i,i<0?a.childCount:0,i,s);if(l)return l}t+=a.nodeSize*i}return null}function bb(n,e,t){let r=n.steps.length-1;if(r<e)return;let i=n.steps[r];if(!(i instanceof rt||i instanceof xt))return;let s=n.mapping.maps[r],o;s.forEach((a,l,c,d)=>{o==null&&(o=d)}),n.setSelection(ue.near(n.doc.resolve(o),t))}const yb=1,Jl=2,xb=4;class P7 extends i2{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|yb)&~Jl,this.storedMarks=null,this}get selectionSet(){return(this.updated&yb)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Jl,this}ensureMarks(e){return Ae.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&Jl)>0}addStep(e,t){super.addStep(e,t),this.updated=this.updated&~Jl,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let r=this.selection;return t&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||Ae.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,r){let i=this.doc.type.schema;if(t==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(r==null&&(r=t),!e)return this.deleteRange(t,r);let s=this.storedMarks;if(!s){let o=this.doc.resolve(t);s=r==t?o.marks():o.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(t,r,i.text(e,s)),!this.selection.empty&&this.selection.to==t+e.length&&this.setSelection(ue.near(this.selection.$to)),this}}setMeta(e,t){return this.meta[typeof e=="string"?e:e.key]=t,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=xb,this}get scrolledIntoView(){return(this.updated&xb)>0}}function Sb(n,e){return!e||!n?n:n.bind(e)}class Yo{constructor(e,t,r){this.name=e,this.init=Sb(t.init,r),this.apply=Sb(t.apply,r)}}const T7=[new Yo("doc",{init(n){return n.doc||n.schema.topNodeType.createAndFill()},apply(n){return n.doc}}),new Yo("selection",{init(n,e){return n.selection||ue.atStart(e.doc)},apply(n){return n.selection}}),new Yo("storedMarks",{init(n){return n.storedMarks||null},apply(n,e,t,r){return r.selection.$cursor?n.storedMarks:null}}),new Yo("scrollToSelection",{init(){return 0},apply(n,e){return n.scrolledIntoView?e+1:e}})];class Zh{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=T7.slice(),t&&t.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new Yo(r.key,r.spec.state,r))})}}class Er{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=t){let i=this.config.plugins[r];if(i.spec.filterTransaction&&!i.spec.filterTransaction.call(i,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],r=this.applyInner(e),i=null;for(;;){let s=!1;for(let o=0;o<this.config.plugins.length;o++){let a=this.config.plugins[o];if(a.spec.appendTransaction){let l=i?i[o].n:0,c=i?i[o].state:this,d=l<t.length&&a.spec.appendTransaction.call(a,l?t.slice(l):t,c,r);if(d&&r.filterTransaction(d,o)){if(d.setMeta("appendedTransaction",e),!i){i=[];for(let h=0;h<this.config.plugins.length;h++)i.push(h<o?{state:r,n:t.length}:{state:this,n:0})}t.push(d),r=r.applyInner(d),s=!0}i&&(i[o]={state:r,n:t.length})}}if(!s)return{state:r,transactions:t}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let t=new Er(this.config),r=this.config.fields;for(let i=0;i<r.length;i++){let s=r[i];t[s.name]=s.apply(e,this[s.name],this,t)}return t}get tr(){return new P7(this)}static create(e){let t=new Zh(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new Er(t);for(let i=0;i<t.fields.length;i++)r[t.fields[i].name]=t.fields[i].init(e,r);return r}reconfigure(e){let t=new Zh(this.schema,e.plugins),r=t.fields,i=new Er(t);for(let s=0;s<r.length;s++){let o=r[s].name;i[o]=this.hasOwnProperty(o)?this[o]:r[s].init(e,i)}return i}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map(r=>r.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[r],s=i.spec.state;s&&s.toJSON&&(t[r]=s.toJSON.call(i,this[i.key]))}return t}static fromJSON(e,t,r){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new Zh(e.schema,e.plugins),s=new Er(i);return i.fields.forEach(o=>{if(o.name=="doc")s.doc=li.fromJSON(e.schema,t.doc);else if(o.name=="selection")s.selection=ue.fromJSON(s.doc,t.selection);else if(o.name=="storedMarks")t.storedMarks&&(s.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let a in r){let l=r[a],c=l.spec.state;if(l.key==o.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(t,a)){s[o.name]=c.fromJSON.call(l,e,t[a],s);return}}s[o.name]=o.init(e,s)}}),s}}function s2(n,e,t){for(let r in n){let i=n[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=s2(i,e,{})),t[r]=i}return t}class Ee{constructor(e){this.spec=e,this.props={},e.props&&s2(e.props,this,this.props),this.key=e.key?e.key.key:o2("plugin")}getState(e){return e[this.key]}}const Wh=Object.create(null);function o2(n){return n in Wh?n+"$"+ ++Wh[n]:(Wh[n]=0,n+"$")}class et{constructor(e="key"){this.key=o2(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}var a2=CC(),kb=Object.defineProperty,M7=(n,e)=>{let t={};for(var r in n)kb(t,r,{get:n[r],enumerable:!0});return kb(t,Symbol.toStringTag,{value:"Module"}),t};const l2=(n,e)=>n.selection.empty?!1:(e&&e(n.tr.deleteSelection().scrollIntoView()),!0);function c2(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("backward",n):t.parentOffset>0)?null:t}const u2=(n,e,t)=>{let r=c2(n,t);if(!r)return!1;let i=fg(r);if(!i){let o=r.blockRange(),a=o&&yo(o);return a==null?!1:(e&&e(n.tr.lift(o,a).scrollIntoView()),!0)}let s=i.nodeBefore;if(y2(n,i,e,-1))return!0;if(r.parent.content.size==0&&(so(s,"end")||ee.isSelectable(s)))for(let o=r.depth;;o--){let a=$d(n.doc,r.before(o),r.after(o),z.empty);if(a&&a.slice.size<a.to-a.from){if(e){let l=n.tr.step(a);l.setSelection(so(s,"end")?ue.findFrom(l.doc.resolve(l.mapping.map(i.pos,-1)),-1):ee.create(l.doc,i.pos-s.nodeSize)),e(l.scrollIntoView())}return!0}if(o==1||r.node(o-1).childCount>1)break}return s.isAtom&&i.depth==r.depth-1?(e&&e(n.tr.delete(i.pos-s.nodeSize,i.pos).scrollIntoView()),!0):!1},A7=(n,e,t)=>{let r=c2(n,t);if(!r)return!1;let i=fg(r);return i?d2(n,i,e):!1},R7=(n,e,t)=>{let r=f2(n,t);if(!r)return!1;let i=pg(r);return i?d2(n,i,e):!1};function d2(n,e,t){let r=e.nodeBefore,i=r,s=e.pos-1;for(;!i.isTextblock;s--){if(i.type.spec.isolating)return!1;let d=i.lastChild;if(!d)return!1;i=d}let o=e.nodeAfter,a=o,l=e.pos+1;for(;!a.isTextblock;l++){if(a.type.spec.isolating)return!1;let d=a.firstChild;if(!d)return!1;a=d}let c=$d(n.doc,s,l,z.empty);if(!c||c.from!=s||c instanceof rt&&c.slice.size>=l-s)return!1;if(t){let d=n.tr.step(c);d.setSelection(J.create(d.doc,s)),t(d.scrollIntoView())}return!0}function so(n,e,t=!1){for(let r=n;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(t&&r.childCount!=1)return!1}return!1}const h2=(n,e,t)=>{let{$head:r,empty:i}=n.selection,s=r;if(!i)return!1;if(r.parent.isTextblock){if(t?!t.endOfTextblock("backward",n):r.parentOffset>0)return!1;s=fg(r)}let o=s&&s.nodeBefore;return!o||!ee.isSelectable(o)?!1:(e&&e(n.tr.setSelection(ee.create(n.doc,s.pos-o.nodeSize)).scrollIntoView()),!0)};function fg(n){if(!n.parent.type.spec.isolating)for(let e=n.depth-1;e>=0;e--){if(n.index(e)>0)return n.doc.resolve(n.before(e+1));if(n.node(e).type.spec.isolating)break}return null}function f2(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("forward",n):t.parentOffset<t.parent.content.size)?null:t}const p2=(n,e,t)=>{let r=f2(n,t);if(!r)return!1;let i=pg(r);if(!i)return!1;let s=i.nodeAfter;if(y2(n,i,e,1))return!0;if(r.parent.content.size==0&&(so(s,"start")||ee.isSelectable(s))){let o=$d(n.doc,r.before(),r.after(),z.empty);if(o&&o.slice.size<o.to-o.from){if(e){let a=n.tr.step(o);a.setSelection(so(s,"start")?ue.findFrom(a.doc.resolve(a.mapping.map(i.pos)),1):ee.create(a.doc,a.mapping.map(i.pos))),e(a.scrollIntoView())}return!0}}return s.isAtom&&i.depth==r.depth-1?(e&&e(n.tr.delete(i.pos,i.pos+s.nodeSize).scrollIntoView()),!0):!1},m2=(n,e,t)=>{let{$head:r,empty:i}=n.selection,s=r;if(!i)return!1;if(r.parent.isTextblock){if(t?!t.endOfTextblock("forward",n):r.parentOffset<r.parent.content.size)return!1;s=pg(r)}let o=s&&s.nodeAfter;return!o||!ee.isSelectable(o)?!1:(e&&e(n.tr.setSelection(ee.create(n.doc,s.pos)).scrollIntoView()),!0)};function pg(n){if(!n.parent.type.spec.isolating)for(let e=n.depth-1;e>=0;e--){let t=n.node(e);if(n.index(e)+1<t.childCount)return n.doc.resolve(n.after(e+1));if(t.type.spec.isolating)break}return null}const E7=(n,e)=>{let t=n.selection,r=t instanceof ee,i;if(r){if(t.node.isTextblock||!Ci(n.doc,t.from))return!1;i=t.from}else if(i=Qd(n.doc,t.from,-1),i==null)return!1;if(e){let s=n.tr.join(i);r&&s.setSelection(ee.create(s.doc,i-n.doc.resolve(i).nodeBefore.nodeSize)),e(s.scrollIntoView())}return!0},N7=(n,e)=>{let t=n.selection,r;if(t instanceof ee){if(t.node.isTextblock||!Ci(n.doc,t.to))return!1;r=t.to}else if(r=Qd(n.doc,t.to,1),r==null)return!1;return e&&e(n.tr.join(r).scrollIntoView()),!0},D7=(n,e)=>{let{$from:t,$to:r}=n.selection,i=t.blockRange(r),s=i&&yo(i);return s==null?!1:(e&&e(n.tr.lift(i,s).scrollIntoView()),!0)},g2=(n,e)=>{let{$head:t,$anchor:r}=n.selection;return!t.parent.type.spec.code||!t.sameParent(r)?!1:(e&&e(n.tr.insertText(`
|
|
110
|
+
`).scrollIntoView()),!0)};function mg(n){for(let e=0;e<n.edgeCount;e++){let{type:t}=n.edge(e);if(t.isTextblock&&!t.hasRequiredAttrs())return t}return null}const j7=(n,e)=>{let{$head:t,$anchor:r}=n.selection;if(!t.parent.type.spec.code||!t.sameParent(r))return!1;let i=t.node(-1),s=t.indexAfter(-1),o=mg(i.contentMatchAt(s));if(!o||!i.canReplaceWith(s,s,o))return!1;if(e){let a=t.after(),l=n.tr.replaceWith(a,a,o.createAndFill());l.setSelection(ue.near(l.doc.resolve(a),1)),e(l.scrollIntoView())}return!0},O2=(n,e)=>{let t=n.selection,{$from:r,$to:i}=t;if(t instanceof pn||r.parent.inlineContent||i.parent.inlineContent)return!1;let s=mg(i.parent.contentMatchAt(i.indexAfter()));if(!s||!s.isTextblock)return!1;if(e){let o=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,a=n.tr.insert(o,s.createAndFill());a.setSelection(J.create(a.doc,o+1)),e(a.scrollIntoView())}return!0},b2=(n,e)=>{let{$cursor:t}=n.selection;if(!t||t.parent.content.size)return!1;if(t.depth>1&&t.after()!=t.end(-1)){let s=t.before();if(Lr(n.doc,s))return e&&e(n.tr.split(s).scrollIntoView()),!0}let r=t.blockRange(),i=r&&yo(r);return i==null?!1:(e&&e(n.tr.lift(r,i).scrollIntoView()),!0)};function I7(n){return(e,t)=>{if(e.selection instanceof ee&&e.selection.node.isBlock){let{$from:p}=e.selection;return!p.parentOffset||!Lr(e.doc,p.pos)?!1:(t&&t(e.tr.split(p.pos).scrollIntoView()),!0)}if(!e.selection.$from.depth)return!1;let r=e.tr;!e.selection.empty&&(e.selection instanceof J||e.selection instanceof pn)&&r.deleteSelection();let{$from:i}=r.selection,s=r.steps.length,o=[],a,l,c=!1,d=!1;for(let p=i.depth;;p--)if(i.node(p).isBlock){c=i.end(p)==i.pos+(i.depth-p),d=i.start(p)==i.pos-(i.depth-p),l=mg(i.node(p-1).contentMatchAt(i.indexAfter(p-1))),o.unshift(c&&l?{type:l}:null),a=p;break}else{if(p==1)return!1;o.unshift(null)}let h=i.pos,f=Lr(r.doc,h,o.length,o);if(f||(o[0]=l?{type:l}:null,f=Lr(r.doc,h,o.length,o)),!f)return!1;if(r.split(h,o.length,o),!c&&d&&i.node(a).type!=l){let p=r.mapping.slice(s),m=p.map(i.before(a)),O=r.doc.resolve(m);l&&i.node(a-1).canReplaceWith(O.index(),O.index()+1,l)&&r.setNodeMarkup(p.map(i.before(a)),l)}return t&&t(r.scrollIntoView()),!0}}const X7=I7(),L7=(n,e)=>{let{$from:t,to:r}=n.selection,i,s=t.sharedDepth(r);return s==0?!1:(i=t.before(s),e&&e(n.tr.setSelection(ee.create(n.doc,i))),!0)};function _7(n,e,t){let r=e.nodeBefore,i=e.nodeAfter,s=e.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&e.parent.canReplace(s-1,s)?(t&&t(n.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(s,s+1)||!(i.isTextblock||Ci(n.doc,e.pos))?!1:(t&&t(n.tr.join(e.pos).scrollIntoView()),!0)}function y2(n,e,t,r){let i=e.nodeBefore,s=e.nodeAfter,o,a,l=i.type.spec.isolating||s.type.spec.isolating;if(!l&&_7(n,e,t))return!0;let c=!l&&e.parent.canReplace(e.index(),e.index()+1);if(c&&(o=(a=i.contentMatchAt(i.childCount)).findWrapping(s.type))&&a.matchType(o[0]||s.type).validEnd){if(t){let p=e.pos+s.nodeSize,m=E.empty;for(let y=o.length-1;y>=0;y--)m=E.from(o[y].create(null,m));m=E.from(i.copy(m));let O=n.tr.step(new xt(e.pos-1,p,e.pos,p,new z(m,1,0),o.length,!0)),b=O.doc.resolve(p+2*o.length);b.nodeAfter&&b.nodeAfter.type==i.type&&Ci(O.doc,b.pos)&&O.join(b.pos),t(O.scrollIntoView())}return!0}let d=s.type.spec.isolating||r>0&&l?null:ue.findFrom(e,1),h=d&&d.$from.blockRange(d.$to),f=h&&yo(h);if(f!=null&&f>=e.depth)return t&&t(n.tr.lift(h,f).scrollIntoView()),!0;if(c&&so(s,"start",!0)&&so(i,"end")){let p=i,m=[];for(;m.push(p),!p.isTextblock;)p=p.lastChild;let O=s,b=1;for(;!O.isTextblock;O=O.firstChild)b++;if(p.canReplace(p.childCount,p.childCount,O.content)){if(t){let y=E.empty;for(let x=m.length-1;x>=0;x--)y=E.from(m[x].copy(y));let k=n.tr.step(new xt(e.pos-m.length,e.pos+s.nodeSize,e.pos+b,e.pos+s.nodeSize-b,new z(y,m.length,0),0,!0));t(k.scrollIntoView())}return!0}}return!1}function x2(n){return function(e,t){let r=e.selection,i=n<0?r.$from:r.$to,s=i.depth;for(;i.node(s).isInline;){if(!s)return!1;s--}return i.node(s).isTextblock?(t&&t(e.tr.setSelection(J.create(e.doc,n<0?i.start(s):i.end(s)))),!0):!1}}const B7=x2(-1),Z7=x2(1);function W7(n,e=null){return function(t,r){let{$from:i,$to:s}=t.selection,o=i.blockRange(s),a=o&&dg(o,n,e);return a?(r&&r(t.tr.wrap(o,a).scrollIntoView()),!0):!1}}function vb(n,e=null){return function(t,r){let i=!1;for(let s=0;s<t.selection.ranges.length&&!i;s++){let{$from:{pos:o},$to:{pos:a}}=t.selection.ranges[s];t.doc.nodesBetween(o,a,(l,c)=>{if(i)return!1;if(!(!l.isTextblock||l.hasMarkup(n,e)))if(l.type==n)i=!0;else{let d=t.doc.resolve(c),h=d.index();i=d.parent.canReplaceWith(h,h+1,n)}})}if(!i)return!1;if(r){let s=t.tr;for(let o=0;o<t.selection.ranges.length;o++){let{$from:{pos:a},$to:{pos:l}}=t.selection.ranges[o];s.setBlockType(a,l,n,e)}r(s.scrollIntoView())}return!0}}function gg(...n){return function(e,t,r){for(let i=0;i<n.length;i++)if(n[i](e,t,r))return!0;return!1}}gg(l2,u2,h2);gg(l2,p2,m2);gg(g2,O2,b2,X7);typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function z7(n,e=null){return function(t,r){let{$from:i,$to:s}=t.selection,o=i.blockRange(s);if(!o)return!1;let a=r?t.tr:null;return V7(a,o,n,e)?(r&&r(a.scrollIntoView()),!0):!1}}function V7(n,e,t,r=null){let i=!1,s=e,o=e.$from.doc;if(e.depth>=2&&e.$from.node(e.depth-1).type.compatibleContent(t)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let l=o.resolve(e.start-2);s=new bu(l,l,e.depth),e.endIndex<e.parent.childCount&&(e=new bu(e.$from,o.resolve(e.$to.end(e.depth)),e.depth)),i=!0}let a=dg(s,t,r,e);return a?(n&&F7(n,e,a,i,t),!0):!1}function F7(n,e,t,r,i){let s=E.empty;for(let d=t.length-1;d>=0;d--)s=E.from(t[d].type.create(t[d].attrs,s));n.step(new xt(e.start-(r?2:0),e.end,e.start,e.end,new z(s,0,0),t.length,!0));let o=0;for(let d=0;d<t.length;d++)t[d].type==i&&(o=d+1);let a=t.length-o,l=e.start+t.length-(r?2:0),c=e.parent;for(let d=e.startIndex,h=e.endIndex,f=!0;d<h;d++,f=!1)!f&&Lr(n.doc,l,a)&&(n.split(l,a),l+=2*a),l+=c.child(d).nodeSize;return n}function q7(n){return function(e,t){let{$from:r,$to:i}=e.selection,s=r.blockRange(i,o=>o.childCount>0&&o.firstChild.type==n);return s?t?r.node(s.depth-1).type==n?Y7(e,t,n,s):U7(e,t,s):!0:!1}}function Y7(n,e,t,r){let i=n.tr,s=r.end,o=r.$to.end(r.depth);s<o&&(i.step(new xt(s-1,o,s,o,new z(E.from(t.create(null,r.parent.copy())),1,0),1,!0)),r=new bu(i.doc.resolve(r.$from.pos),i.doc.resolve(o),r.depth));const a=yo(r);if(a==null)return!1;i.lift(r,a);let l=i.doc.resolve(i.mapping.map(s,-1)-1);return Ci(i.doc,l.pos)&&l.nodeBefore.type==l.nodeAfter.type&&i.join(l.pos),e(i.scrollIntoView()),!0}function U7(n,e,t){let r=n.tr,i=t.parent;for(let p=t.end,m=t.endIndex-1,O=t.startIndex;m>O;m--)p-=i.child(m).nodeSize,r.delete(p-1,p+1);let s=r.doc.resolve(t.start),o=s.nodeAfter;if(r.mapping.map(t.end)!=t.start+s.nodeAfter.nodeSize)return!1;let a=t.startIndex==0,l=t.endIndex==i.childCount,c=s.node(-1),d=s.index(-1);if(!c.canReplace(d+(a?0:1),d+1,o.content.append(l?E.empty:E.from(i))))return!1;let h=s.pos,f=h+o.nodeSize;return r.step(new xt(h-(a?1:0),f+(l?1:0),h+1,f-1,new z((a?E.empty:E.from(i.copy(E.empty))).append(l?E.empty:E.from(i.copy(E.empty))),a?0:1,l?0:1),a?0:1)),e(r.scrollIntoView()),!0}function G7(n){return function(e,t){let{$from:r,$to:i}=e.selection,s=r.blockRange(i,c=>c.childCount>0&&c.firstChild.type==n);if(!s)return!1;let o=s.startIndex;if(o==0)return!1;let a=s.parent,l=a.child(o-1);if(l.type!=n)return!1;if(t){let c=l.lastChild&&l.lastChild.type==a.type,d=E.from(c?n.create():null),h=new z(E.from(n.create(null,E.from(a.type.create(null,d)))),c?3:1,0),f=s.start,p=s.end;t(e.tr.step(new xt(f-(c?3:1),p,f,p,h,1,!0)).scrollIntoView())}return!0}}const $t=function(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e},oo=function(n){let e=n.assignedSlot||n.parentNode;return e&&e.nodeType==11?e.host:e};let Qp=null;const $r=function(n,e,t){let r=Qp||(Qp=document.createRange());return r.setEnd(n,t??n.nodeValue.length),r.setStart(n,e||0),r},H7=function(){Qp=null},ls=function(n,e,t,r){return t&&(wb(n,e,t,r,-1)||wb(n,e,t,r,1))},K7=/^(img|br|input|textarea|hr)$/i;function wb(n,e,t,r,i){for(var s;;){if(n==t&&e==r)return!0;if(e==(i<0?0:Nt(n))){let o=n.parentNode;if(!o||!K(o)||Ol(n)||K7.test(n.nodeName)||n.contentEditable=="false")return!1;e=$t(n)+(i<0?0:1),n=o}else if(K(n)){let o=n.childNodes[e+(i<0?-1:0)];if(K(o)&&o.contentEditable=="false")if(!((s=o.pmViewDesc)===null||s===void 0)&&s.ignoreForSelection)e+=i;else return!1;else n=o,e=i<0?Nt(n):0}else return!1}}function Nt(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function K(n){return n.nodeType==1}function pt(n){return n.nodeType==3}function cs(n,e){return e?n.contains(K(e)?e:e.parentNode):!1}function J7(n,e){for(;;){if(pt(n)&&e)return n;if(K(n)&&e>0){if(n.contentEditable=="false")return null;n=n.childNodes[e-1],e=Nt(n)}else if(n.parentNode&&!Ol(n))e=$t(n),n=n.parentNode;else return null}}function eL(n,e){for(;;){if(pt(n)&&e<n.nodeValue.length)return n;if(K(n)&&e<n.childNodes.length){if(n.contentEditable=="false")return null;n=n.childNodes[e],e=0}else if(n.parentNode&&!Ol(n))e=$t(n)+1,n=n.parentNode;else return null}}function tL(n,e,t){for(let r=e==0,i=e==Nt(n);r||i;){if(n==t)return!0;let s=$t(n);if(n=n.parentNode,!n)return!1;r=r&&s==0,i=i&&s==Nt(n)}}function Ol(n){let e;for(let t=n;t&&!(e=t.pmViewDesc);t=t.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==n||e.contentDOM==n)}const Pd=function(n){return n.focusNode&&ls(n.focusNode,n.focusOffset,n.anchorNode,n.anchorOffset)};function Di(n,e){let t=document.createEvent("Event");return t.initEvent("keydown",!0,!0),t.keyCode=n,t.key=t.code=e,t}function nL(n){let e=n.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function rL(n,e,t){if(n.caretPositionFromPoint)try{let r=n.caretPositionFromPoint(e,t);if(r)return{node:r.offsetNode,offset:Math.min(Nt(r.offsetNode),r.offset)}}catch{}if(n.caretRangeFromPoint){let r=n.caretRangeFromPoint(e,t);if(r)return{node:r.startContainer,offset:Math.min(Nt(r.startContainer),r.startOffset)}}}const fr=typeof navigator<"u"?navigator:null,Qb=typeof document<"u"?document:null,Pi=fr&&fr.userAgent||"",$p=/Edge\/(\d+)/.exec(Pi),S2=/MSIE \d/.exec(Pi),Cp=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Pi),en=!!(S2||Cp||$p),ui=S2?document.documentMode:Cp?+Cp[1]:$p?+$p[1]:0,mn=!en&&/gecko\/(\d+)/i.test(Pi);mn&&+(/Firefox\/(\d+)/.exec(Pi)||[0,0])[1];const Pp=!en&&/Chrome\/(\d+)/.exec(Pi),Pt=!!Pp,k2=Pp?+Pp[1]:0,Xt=!en&&!!fr&&/Apple Computer/.test(fr.vendor),ao=Xt&&(/Mobile\/\w+/.test(Pi)||!!fr&&fr.maxTouchPoints>2),vn=ao||(fr?/Mac/.test(fr.platform):!1),v2=fr?/Win/.test(fr.platform):!1,Nr=/Android \d/.test(Pi),Td=!!Qb&&"webkitFontSmoothing"in Qb.documentElement.style,iL=Td?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function sL(n){let e=n.defaultView&&n.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:n.documentElement.clientWidth,top:0,bottom:n.documentElement.clientHeight}}function Sr(n,e){return typeof n=="number"?n:n[e]}function oL(n){let e=n.getBoundingClientRect(),t=e.width/n.offsetWidth||1,r=e.height/n.offsetHeight||1;return{left:e.left,right:e.left+n.clientWidth*t,top:e.top,bottom:e.top+n.clientHeight*r}}function $b(n,e,t){if(!Tp(e)&&e.left==0)return;let r=n.someProp("scrollThreshold")||0,i=n.someProp("scrollMargin")||5,s=n.dom.ownerDocument;for(let o=t||n.dom;o;){if(!K(o)){o=oo(o);continue}let a=o==s.body,l=a?sL(s):oL(o),c=0,d=0;if(e.top<l.top+Sr(r,"top")?d=-(l.top-e.top+Sr(i,"top")):e.bottom>l.bottom-Sr(r,"bottom")&&(d=e.bottom-e.top>l.bottom-l.top?e.top+Sr(i,"top")-l.top:e.bottom-l.bottom+Sr(i,"bottom")),e.left<l.left+Sr(r,"left")?c=-(l.left-e.left+Sr(i,"left")):e.right>l.right-Sr(r,"right")&&(c=e.right-l.right+Sr(i,"right")),c||d)if(a)s.defaultView.scrollBy(c,d);else{let f=o.scrollLeft,p=o.scrollTop;d&&(o.scrollTop+=d),c&&(o.scrollLeft+=c);let m=o.scrollLeft-f,O=o.scrollTop-p;e={left:e.left-m,top:e.top-O,right:e.right-m,bottom:e.bottom-O}}let h=a?"fixed":getComputedStyle(o).position;if(/^(fixed|sticky)$/.test(h))break;o=h=="absolute"?o.offsetParent:oo(o)}}function aL(n){let e=n.dom.getBoundingClientRect(),t=Math.max(0,e.top),r,i;for(let s=(e.left+e.right)/2,o=t+1;o<Math.min(innerHeight,e.bottom);o+=5){let a=n.root.elementFromPoint(s,o);if(!a||a==n.dom||!n.dom.contains(a))continue;let l=a.getBoundingClientRect();if(l.top>=t-20){r=a,i=l.top;break}}return{refDOM:r,refTop:i,stack:w2(n.dom)}}function w2(n){let e=[],t=n.ownerDocument;for(let r=n;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),n!=t);r=oo(r));return e}function lL({refDOM:n,refTop:e,stack:t}){let r=n?n.getBoundingClientRect().top:0;Q2(t,r==0?0:r-e)}function Q2(n,e){for(let t=0;t<n.length;t++){let{dom:r,top:i,left:s}=n[t];r.scrollTop!=i+e&&(r.scrollTop=i+e),r.scrollLeft!=s&&(r.scrollLeft=s)}}let gs=null;function cL(n){if(n.setActive)return n.setActive();if(gs)return n.focus(gs);let e=w2(n);n.focus(gs==null?{get preventScroll(){return gs={preventScroll:!0},!0}}:void 0),gs||(gs=!1,Q2(e,0))}function $2(n,e){let t,r=2e8,i,s=0,o=e.top,a=e.top,l,c;for(let d=n.firstChild,h=0;d;d=d.nextSibling,h++){let f;if(K(d))f=d.getClientRects();else if(pt(d))f=$r(d).getClientRects();else continue;for(let p=0;p<f.length;p++){let m=f[p];if(m.top<=o&&m.bottom>=a){o=Math.max(m.bottom,o),a=Math.min(m.top,a);let O=m.left>e.left?m.left-e.left:m.right<e.left?e.left-m.right:0;if(O<r){t=d,r=O,i=O&&pt(t)?{left:m.right<e.left?m.right:m.left,top:e.top}:e,K(d)&&O&&(s=h+(e.left>=(m.left+m.right)/2?1:0));continue}}else m.top>e.top&&!l&&m.left<=e.left&&m.right>=e.left&&(l=d,c={left:Math.max(m.left,Math.min(m.right,e.left)),top:m.top});!t&&(e.left>=m.right&&e.top>=m.top||e.left>=m.left&&e.top>=m.bottom)&&(s=h+1)}}return!t&&l&&(t=l,i=c,r=0),t&&pt(t)?uL(t,i):!t||r?{node:n,offset:s}:$2(t,i)}function uL(n,e){let t=n.nodeValue.length,r=document.createRange(),i;for(let s=0;s<t;s++){r.setEnd(n,s+1),r.setStart(n,s);let o=Gr(r,1);if(o.top!=o.bottom&&Og(e,o)){i={node:n,offset:s+(e.left>=(o.left+o.right)/2?1:0)};break}}return r.detach(),i||{node:n,offset:0}}function Og(n,e){return n.left>=e.left-1&&n.left<=e.right+1&&n.top>=e.top-1&&n.top<=e.bottom+1}function dL(n,e){let t=n.parentNode;return t&&/^li$/i.test(t.nodeName)&&e.left<n.getBoundingClientRect().left?t:n}function hL(n,e,t){let{node:r,offset:i}=$2(e,t),s=-1;if(K(r)&&!r.firstChild){let o=r.getBoundingClientRect();s=o.left!=o.right&&t.left>(o.left+o.right)/2?1:-1}return n.docView.posFromDOM(r,i,s)}function fL(n,e,t,r){let i=-1;for(let s=e,o=!1;s!=n.dom;){let a=n.docView.nearestDesc(s,!0),l;if(!a)return null;if(K(a.dom)&&(a.node.isBlock&&a.parent||!a.contentDOM)&&((l=a.dom.getBoundingClientRect()).width||l.height)&&(a.node.isBlock&&a.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(a.dom.nodeName)&&(!o&&l.left>r.left||l.top>r.top?i=a.posBefore:(!o&&l.right<r.left||l.bottom<r.top)&&(i=a.posAfter),o=!0),!a.contentDOM&&i<0&&!a.node.isText))return(a.node.isBlock?r.top<(l.top+l.bottom)/2:r.left<(l.left+l.right)/2)?a.posBefore:a.posAfter;s=a.dom.parentNode}return i>-1?i:n.docView.posFromDOM(e,t,-1)}function C2(n,e,t){let r=n.childNodes.length;if(r&&t.top<t.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-t.top)/(t.bottom-t.top))-2)),s=i;;){let o=n.childNodes[s];if(K(o)){let a=o.getClientRects();for(let l=0;l<a.length;l++){let c=a[l];if(Og(e,c))return C2(o,e,c)}}if((s=(s+1)%r)==i)break}return n}function pL(n,e){let t=n.dom.ownerDocument,r,i=0,s=rL(t,e.left,e.top);s&&({node:r,offset:i}=s);let o=(n.root.elementFromPoint?n.root:t).elementFromPoint(e.left,e.top),a;if(!o||!n.dom.contains(o)){let c=n.dom.getBoundingClientRect();if(!Og(e,c)||(o=C2(n.dom,e,c),!o))return null}if(Xt)for(let c=o;r&&c;c=oo(c))c.draggable&&(r=void 0);if(o=dL(o,e),r){if(mn&&K(r)&&(i=Math.min(i,r.childNodes.length),i<r.childNodes.length)){let d=r.childNodes[i],h;d.nodeName=="IMG"&&(h=d.getBoundingClientRect()).right<=e.left&&h.bottom>e.top&&i++}let c;Td&&i&&K(r)&&K(c=r.childNodes[i-1])&&c.contentEditable=="false"&&c.getBoundingClientRect().top>=e.top&&i--,r==n.dom&&i==r.childNodes.length-1&&K(r.lastChild)&&e.top>r.lastChild.getBoundingClientRect().bottom?a=n.state.doc.content.size:(i==0||!K(r)||r.childNodes[i-1].nodeName!="BR")&&(a=fL(n,r,i,e))}a==null&&(a=hL(n,o,e));let l=n.docView.nearestDesc(o,!0);return{pos:a,inside:l?l.posAtStart-l.border:-1}}function Tp(n){return n.top<n.bottom||n.left<n.right}function Gr(n,e){let t=n.getClientRects();if(t.length){let r=t[e<0?0:t.length-1];if(Tp(r))return r}return Array.prototype.find.call(t,Tp)||n.getBoundingClientRect()}const mL=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function P2(n,e,t){let{node:r,offset:i,atom:s}=n.docView.domFromPos(e,t<0?-1:1),o=Td||mn;if(pt(r))if(o&&(mL.test(r.nodeValue)||(t<0?!i:i==r.nodeValue.length))){let l=Gr($r(r,i,i),t);if(mn&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let c=Gr($r(r,i-1,i-1),-1);if(c.top==l.top){let d=Gr($r(r,i,i+1),-1);if(d.top!=l.top)return Ao(d,d.left<c.left)}}return l}else{let l=i,c=i,d=t<0?1:-1;return t<0&&!i?(c++,d=-1):t>=0&&i==r.nodeValue.length?(l--,d=1):t<0?l--:c++,Ao(Gr($r(r,l,c),d),d<0)}if(!n.state.doc.resolve(e-(s||0)).parent.inlineContent){if(s==null&&i&&(t<0||i==Nt(r))){let l=r.childNodes[i-1];if(K(l))return zh(l.getBoundingClientRect(),!1)}if(s==null&&i<Nt(r)){let l=r.childNodes[i];if(K(l))return zh(l.getBoundingClientRect(),!0)}return zh(r.getBoundingClientRect(),t>=0)}if(s==null&&i&&(t<0||i==Nt(r))){let l=r.childNodes[i-1],c=pt(l)?$r(l,Nt(l)-(o?0:1)):K(l)&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(c)return Ao(Gr(c,1),!1)}if(s==null&&i<Nt(r)){let l=r.childNodes[i];for(;l.pmViewDesc&&l.pmViewDesc.ignoreForCoords;)l=l.nextSibling;let c=l?pt(l)?$r(l,0,o?0:1):K(l)?l:null:null;if(c)return Ao(Gr(c,-1),!0)}return Ao(Gr(pt(r)?$r(r):r,-t),t>=0)}function Ao(n,e){if(n.width==0)return n;let t=e?n.left:n.right;return{top:n.top,bottom:n.bottom,left:t,right:t}}function zh(n,e){if(n.height==0)return n;let t=e?n.top:n.bottom;return{top:t,bottom:t,left:n.left,right:n.right}}function T2(n,e,t){let r=n.state,i=n.root.activeElement;r!=e&&n.updateState(e),i!=n.dom&&n.focus();try{return t()}finally{r!=e&&n.updateState(r),i!=n.dom&&i&&i.focus()}}function gL(n,e,t){let r=e.selection,i=t=="up"?r.$from:r.$to;return T2(n,e,()=>{let{node:s}=n.docView.domFromPos(i.pos,t=="up"?-1:1);for(;;){let a=n.docView.nearestDesc(s,!0);if(!a)break;if(a.node.isBlock){s=a.contentDOM||a.dom;break}s=a.dom.parentNode}let o=P2(n,i.pos,1);for(let a=s.firstChild;a;a=a.nextSibling){let l;if(K(a))l=a.getClientRects();else if(pt(a))l=$r(a,0,a.nodeValue.length).getClientRects();else continue;for(let c=0;c<l.length;c++){let d=l[c];if(d.bottom>d.top+1&&(t=="up"?o.top-d.top>(d.bottom-o.top)*2:d.bottom-o.bottom>(o.bottom-d.top)*2))return!1}}return!0})}const OL=/[\u0590-\u08ac]/;function bL(n,e,t){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,s=!i,o=i==r.parent.content.size,a=n.domSelection();return a?!OL.test(r.parent.textContent)||!a.modify?t=="left"||t=="backward"?s:o:T2(n,e,()=>{let{focusNode:l,focusOffset:c,anchorNode:d,anchorOffset:h}=n.domSelectionRange(),f=a.caretBidiLevel;a.modify("move",t,"character");let p=r.depth?n.docView.domAfterPos(r.before()):n.dom,{focusNode:m,focusOffset:O}=n.domSelectionRange(),b=m&&!cs(p,m)||l==m&&c==O;try{a.collapse(d,h),l&&(l!=d||c!=h)&&a.extend&&a.extend(l,c)}catch{}return f!=null&&(a.caretBidiLevel=f),b}):r.pos==r.start()||r.pos==r.end()}let Cb=null,Pb=null,Tb=!1;function yL(n,e,t){return Cb==e&&Pb==t?Tb:(Cb=e,Pb=t,Tb=t=="up"||t=="down"?gL(n,e,t):bL(n,e,t))}const An=0,Mb=1,Xi=2,Zn=3;class bl{constructor(e,t,r,i){this.parent=e,this.children=t,this.dom=r,this.contentDOM=i,this.dirty=An,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,r){return!1}matchesHack(e){return!1}parseRule(e){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let t=0,r=this.posAtStart;;t++){let i=this.children[t];if(i==e)return r;r+=i.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,t,r){if(this.contentDOM&&cs(this.contentDOM,e))if(r<0){let s,o;if(e==this.contentDOM)s=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;s=e.previousSibling}for(;s&&!((o=s.pmViewDesc)&&o.parent==this);)s=s.previousSibling;return s?this.posBeforeChild(o)+o.size:this.posAtStart}else{let s,o;if(e==this.contentDOM)s=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;s=e.nextSibling}for(;s&&!((o=s.pmViewDesc)&&o.parent==this);)s=s.nextSibling;return s?this.posBeforeChild(o):this.posAtEnd}let i;if(e==this.dom&&this.contentDOM)i=t>$t(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=!!(e.compareDocumentPosition(this.contentDOM)&4);else if(this.dom.firstChild){if(t==0)for(let s=e;;s=s.parentNode){if(s==this.dom){i=!1;break}if(s.previousSibling)break}if(i==null&&t==e.childNodes.length)for(let s=e;;s=s.parentNode){if(s==this.dom){i=!0;break}if(s.nextSibling)break}}return i??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let r=!0,i=e;i;i=i.parentNode){let s=this.getDesc(i),o;if(s&&(!t||s.node))if(r&&(o=s.nodeDOM)&&!(K(o)?cs(o,e):o==e))r=!1;else return s}}getDesc(e){let t=e.pmViewDesc;for(let r=t;r;r=r.parent)if(r==this)return t}posFromDOM(e,t,r){for(let i=e;i;i=i.parentNode){let s=this.getDesc(i);if(s)return s.localPosFromDOM(e,t,r)}return-1}descAt(e){for(let t=0,r=0;t<this.children.length;t++){let i=this.children[t],s=r+i.size;if(r==e&&s!=r){for(;!i.border&&i.children.length;)for(let o=0;o<i.children.length;o++){let a=i.children[o];if(a.size){i=a;break}}return i}if(e<s)return i.descAt(e-r-i.border);r=s}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let r=0,i=0;for(let s=0;r<this.children.length;r++){let o=this.children[r],a=s+o.size;if(a>e){i=e-s;break}s=a}if(i)return this.children[r].domFromPos(i-this.children[r].border,t);for(;r>0;r--){let s=this.children[r-1];if(s.size||!(s instanceof A2||s instanceof M2&&s.side>=0))break}if(t<=0){let s,o=!0;for(;s=r?this.children[r-1]:null,!(!s||s.dom.parentNode==this.contentDOM);r--,o=!1);return s&&t&&o&&!s.border&&!s.domAtom?s.domFromPos(s.size,t):{node:this.contentDOM,offset:s?$t(s.dom)+1:0}}else{let s,o=!0;for(;s=r<this.children.length?this.children[r]:null,!(!s||s.dom.parentNode==this.contentDOM);r++,o=!1);return s&&o&&!s.border&&!s.domAtom?s.domFromPos(0,t):{node:this.contentDOM,offset:s?$t(s.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,r=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let i=-1,s=-1;for(let o=r,a=0;;a++){let l=this.children[a],c=o+l.size;if(i==-1&&e<=c){let d=o+l.border;if(e>=d&&t<=c-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(e,t,d);e=o;for(let h=a;h>0;h--){let f=this.children[h-1];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(1)){i=$t(f.dom)+1;break}e-=f.size}i==-1&&(i=0)}if(i>-1&&(c>t||a==this.children.length-1)){t=c;for(let d=a+1;d<this.children.length;d++){let h=this.children[d];if(h.size&&h.dom.parentNode==this.contentDOM&&!h.emptyChildAt(-1)){s=$t(h.dom);break}t+=h.size}s==-1&&(s=this.contentDOM.childNodes.length);break}o=c}return{node:this.contentDOM,from:e,to:t,fromOffset:i,toOffset:s}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return t.size==0||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:r}=this.domFromPos(e,0);if(!K(t)||r==t.childNodes.length)throw new RangeError("No node after pos "+e);return t.childNodes[r]}setSelection(e,t,r,i=!1){let s=Math.min(e,t),o=Math.max(e,t);for(let p=0,m=0;p<this.children.length;p++){let O=this.children[p],b=m+O.size;if(s>m&&o<b)return O.setSelection(e-m-O.border,t-m-O.border,r,i);m=b}let a=this.domFromPos(e,e?-1:1),l=t==e?a:this.domFromPos(t,t?-1:1),c=r.root.getSelection(),d=r.domSelectionRange(),h=!1;if((mn||Xt)&&e==t){let{node:p,offset:m}=a;if(pt(p)){if(h=!!(m&&p.nodeValue[m-1]==`
|
|
111
|
+
`),h&&m==p.nodeValue.length)for(let O=p,b;O;O=O.parentNode){if(b=O.nextSibling){b.nodeName=="BR"&&(a=l={node:b.parentNode,offset:$t(b)+1});break}let y=O.pmViewDesc;if(y&&y.node&&y.node.isBlock)break}}else{let O=p.childNodes[m-1];h=O&&(O.nodeName=="BR"||O.contentEditable=="false")}}if(mn&&d.focusNode&&d.focusNode!=l.node&&K(d.focusNode)){let p=d.focusNode.childNodes[d.focusOffset];p&&p.contentEditable=="false"&&(i=!0)}if(!(i||h&&Xt)&&ls(a.node,a.offset,d.anchorNode,d.anchorOffset)&&ls(l.node,l.offset,d.focusNode,d.focusOffset))return;let f=!1;if((c.extend||e==t)&&!(h&&mn)){c.collapse(a.node,a.offset);try{e!=t&&c.extend(l.node,l.offset),f=!0}catch{}}if(!f){if(e>t){let m=a;a=l,l=m}let p=document.createRange();p.setEnd(l.node,l.offset),p.setStart(a.node,a.offset),c.removeAllRanges(),c.addRange(p)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let r=0,i=0;i<this.children.length;i++){let s=this.children[i],o=r+s.size;if(r==o?e<=o&&t>=r:e<o&&t>r){let a=r+s.border,l=o-s.border;if(e>=a&&t<=l){this.dirty=e==r||t==o?Xi:Mb,e==a&&t==l&&(s.contentLost||s.dom.parentNode!=this.contentDOM)?s.dirty=Zn:s.markDirty(e-a,t-a);return}else s.dirty=s.dom==s.contentDOM&&s.dom.parentNode==this.contentDOM&&!s.children.length?Xi:Zn}r=o}this.dirty=Xi}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let r=e==1?Xi:Mb;t.dirty<r&&(t.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}}class M2 extends bl{constructor(e,t,r,i){let s,o=t.type.toDOM;if(typeof o=="function"&&(o=o(r,()=>{if(!s)return i;if(s.parent)return s.parent.posBeforeChild(s)})),!t.type.spec.raw){let a=K(o)?o:document.createElement("span");a!=o&&a.appendChild(o),a.hasAttribute("contenteditable")||(a.contentEditable="false"),a.classList.add("ProseMirror-widget")}super(e,[],o,null),this.widget=t,this.widget=t,s=this}matchesWidget(e){return this.dirty==An&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return t?t(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class xL extends bl{constructor(e,t,r,i){super(e,[],t,null),this.textDOM=r,this.text=i}get size(){return this.text.length}localPosFromDOM(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class di extends bl{constructor(e,t,r,i,s){super(e,[],r,i),this.mark=t,this.spec=s}static create(e,t,r,i){let s=i.nodeViews[t.type.name],o=s&&s(t,i,r);return(!o||!o.dom)&&(o=ds.renderSpec(document,t.type.spec.toDOM(t,r),null,t.attrs)),new di(e,t,o.dom,o.contentDOM||o.dom,o)}parseRule(){return this.dirty&Zn||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=Zn&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=An){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=An}}slice(e,t,r){let i=di.create(this.parent,this.mark,!0,r),s=this.children,o=this.size;t<o&&(s=Ap(s,t,o,r)),e>0&&(s=Ap(s,0,e,r));for(let a=0;a<s.length;a++)s[a].parent=i;return i.children=s,i}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class hi extends bl{constructor(e,t,r,i,s,o,a){super(e,[],s,o),this.node=t,this.outerDeco=r,this.innerDeco=i,this.nodeDOM=a}static create(e,t,r,i,s,o){let a=s.nodeViews[t.type.name],l,c=a&&a(t,s,()=>{if(!l)return o;if(l.parent)return l.parent.posBeforeChild(l)},r,i),d=c&&c.dom,h=c&&c.contentDOM;if(t.isText){if(!d)d=document.createTextNode(t.text);else if(!pt(d))throw new RangeError("Text must be rendered as a DOM text node")}else d||({dom:d,contentDOM:h}=ds.renderSpec(document,t.type.spec.toDOM(t),null,t.attrs));!h&&!t.isText&&d.nodeName!="BR"&&(d.hasAttribute("contenteditable")||(d.contentEditable="false"),t.type.spec.draggable&&(d.draggable=!0));let f=d;return d=N2(d,r,t),c?l=new SL(e,t,r,i,d,h||null,f,c):t.isText?new Md(e,t,r,i,d,f):new hi(e,t,r,i,d,h||null,f)}parseRule(e){if(this.node.type.spec.reparseInView)return null;let t={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(t.preserveWhitespace="full"),!this.contentDOM)t.getContent=()=>this.node.content;else if(!this.contentLost)t.contentElement=this.contentDOM;else{for(let r=this.children.length-1;r>=0;r--){let i=this.children[r];if(this.dom.contains(i.dom.parentNode)){t.contentElement=i.dom.parentNode;break}}if(!t.contentElement){let r=e&&e.find(i=>K(i)&&e.indexOf(i.parentNode)<0&&this.dom.contains(i));r?t.contentElement=r:t.getContent=()=>E.empty}}return t}matchesNode(e,t,r){return this.dirty==An&&e.eq(this.node)&&yu(t,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,t){let r=this.node.inlineContent,i=t,s=e.composing?this.localCompositionInfo(e,t):null,o=s&&s.pos>-1?s:null,a=s&&s.pos<0,l=new vL(this,o&&o.node,e),c=this.node.inlineContent,d=c&&this.node.isBlock;$L(this.node,this.innerDeco,(h,f,p)=>{h.spec.marks?l.syncToMarks(h.spec.marks,r,e,f):h.type.side>=0&&!p&&l.syncToMarks(f==this.node.childCount?Ae.none:this.node.child(f).marks,r,e,f),l.placeWidget(h,e,i)},(h,f,p,m)=>{l.syncToMarks(h.marks,r,e,m),d&&h.isAtom&&!h.isText&&l.addHackNode("IMG",l.top);let O;l.findNodeMatch(h,f,p,m)||a&&e.state.selection.from>i&&e.state.selection.to<i+h.nodeSize&&(O=l.findIndexWithChild(s.node))>-1&&l.updateNodeAt(h,f,p,O,e)||l.updateNextNode(h,f,p,e,m,i)||l.addNode(h,f,p,e,i),i+=h.nodeSize,c&&(d=h.isAtom&&!h.isText)}),l.syncToMarks([],r,e,0),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==Xi)&&(o&&this.protectLocalComposition(e,o),R2(this.contentDOM,this.children,e),ao&&CL(this.dom))}localCompositionInfo(e,t){let{from:r,to:i}=e.state.selection;if(!(e.state.selection instanceof J)||r<t||i>t+this.node.content.size)return null;let s=e.input.compositionNode;if(!s||!this.dom.contains(s.parentNode))return null;if(this.node.inlineContent){let o=s.nodeValue,a=PL(this.node.content,o,r-t,i-t);return a<0?null:{node:s,pos:a,text:o}}else return{node:s,pos:-1,text:""}}protectLocalComposition(e,{node:t,pos:r,text:i}){if(this.getDesc(t))return;let s=t;for(;s.parentNode!=this.contentDOM;s=s.parentNode){for(;s.previousSibling;)s.parentNode.removeChild(s.previousSibling);for(;s.nextSibling;)s.parentNode.removeChild(s.nextSibling);s.pmViewDesc&&(s.pmViewDesc=void 0)}let o=new xL(this,s,t,i);e.input.compositionNodes.push(o),this.children=Ap(this.children,r,r+i.length,e,o)}update(e,t,r,i){return this.dirty==Zn||!e.sameMarkup(this.node)?!1:(this.updateInner(e,t,r,i),!0)}updateInner(e,t,r,i){this.updateOuterDeco(t),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=An}updateOuterDeco(e){if(yu(e,this.outerDeco))return;let t=!K(this.nodeDOM),r=this.dom;this.dom=E2(this.dom,this.nodeDOM,Mp(this.outerDeco,this.node,t),Mp(e,this.node,t)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){K(this.nodeDOM)&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){K(this.nodeDOM)&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function Ab(n,e,t,r,i){N2(r,e,n);let s=new hi(void 0,n,e,t,r,r,r);return s.contentDOM&&s.updateChildren(i,0),s}class Md extends hi{constructor(e,t,r,i,s,o){super(e,t,r,i,s,null,o)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,r,i){return this.dirty==Zn||this.dirty!=An&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(t),(this.dirty!=An||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=An,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,r){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,t,r){let i=this.node.cut(e,t),s=document.createTextNode(i.text);return new Md(this.parent,i,this.outerDeco,this.innerDeco,s,s)}markDirty(e,t){super.markDirty(e,t),this.dom!=this.nodeDOM&&(e==0||t==this.nodeDOM.nodeValue.length)&&(this.dirty=Zn)}get domAtom(){return!1}isText(e){return this.node.text==e}}class A2 extends bl{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==An&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class SL extends hi{constructor(e,t,r,i,s,o,a,l){super(e,t,r,i,s,o,a),this.spec=l}update(e,t,r,i){if(this.dirty==Zn)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let s=this.spec.update(e,t,r);return s&&this.updateInner(e,t,r,i),s}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,t,r,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,r,i){this.spec.setSelection?this.spec.setSelection(e,t,r.root):super.setSelection(e,t,r,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function R2(n,e,t){let r=n.firstChild,i=!1;for(let s=0;s<e.length;s++){let o=e[s],a=o.dom;if(a.parentNode==n){for(;a!=r;)r=Rb(r),i=!0;r=r.nextSibling}else i=!0,n.insertBefore(a,r);if(o instanceof di){let l=r?r.previousSibling:n.lastChild;R2(o.contentDOM,o.children,t),r=l?l.nextSibling:n.firstChild}}for(;r;)r=Rb(r),i=!0;i&&t.trackWrites==n&&(t.trackWrites=null)}const ca=function(n){n&&(this.nodeName=n)};ca.prototype=Object.create(null);const Li=[new ca];function Mp(n,e,t){if(n.length==0)return Li;let r=t?Li[0]:new ca,i=[r];for(let s=0;s<n.length;s++){let o=n[s].type.attrs;if(o){o.nodeName&&i.push(r=new ca(o.nodeName));for(let a in o){let l=o[a];l!=null&&(t&&i.length==1&&i.push(r=new ca(e.isInline?"span":"div")),a=="class"?r.class=(r.class?r.class+" ":"")+l:a=="style"?r.style=(r.style?r.style+";":"")+l:a!="nodeName"&&(r[a]=l))}}}return i}function E2(n,e,t,r){if(t==Li&&r==Li)return e;let i=e;for(let s=0;s<r.length;s++){let o=r[s],a=t[s];if(s){let l;a&&a.nodeName==o.nodeName&&i!=n&&(l=i.parentNode)&&l.nodeName.toLowerCase()==o.nodeName||(l=document.createElement(o.nodeName),l.pmIsDeco=!0,l.appendChild(i),a=Li[0]),i=l}kL(i,a||Li[0],o)}return i}function kL(n,e,t){for(let r in e)r!="class"&&r!="style"&&r!="nodeName"&&!(r in t)&&n.removeAttribute(r);for(let r in t)r!="class"&&r!="style"&&r!="nodeName"&&t[r]!=e[r]&&n.setAttribute(r,t[r]);if(e.class!=t.class){let r=e.class?e.class.split(" ").filter(Boolean):[],i=t.class?t.class.split(" ").filter(Boolean):[];for(let s=0;s<r.length;s++)i.indexOf(r[s])==-1&&n.classList.remove(r[s]);for(let s=0;s<i.length;s++)r.indexOf(i[s])==-1&&n.classList.add(i[s]);n.classList.length==0&&n.removeAttribute("class")}if(e.style!=t.style){if(e.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,i;for(;i=r.exec(e.style);)n.style.removeProperty(i[1])}t.style&&(n.style.cssText+=t.style)}}function N2(n,e,t){return E2(n,n,Li,Mp(e,t,!K(n)))}function yu(n,e){if(n.length!=e.length)return!1;for(let t=0;t<n.length;t++)if(!n[t].type.eq(e[t].type))return!1;return!0}function Rb(n){let e=n.nextSibling;return n.parentNode.removeChild(n),e}class vL{constructor(e,t,r){this.lock=t,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=wL(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let r=e;r<t;r++)this.top.children[r].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,r,i){let s=0,o=this.stack.length>>1,a=Math.min(o,e.length);for(;s<a&&(s==o-1?this.top:this.stack[s+1<<1]).matchesMark(e[s])&&e[s].type.spec.spanning!==!1;)s++;for(;s<o;)this.destroyRest(),this.top.dirty=An,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<e.length;){this.stack.push(this.top,this.index+1);let l=-1,c=this.top.children.length;i<this.preMatch.index&&(c=Math.min(this.index+3,c));for(let d=this.index;d<c;d++){let h=this.top.children[d];if(h.matchesMark(e[o])&&!this.isLocked(h.dom)){l=d;break}}if(l<0&&this.index<this.top.children.length){let d=this.top.children[this.index];d instanceof di&&d.dirty!=Zn&&d.mark.type==e[o].type&&d.spec.update&&!this.isLocked(d.dom)&&d.spec.update(e[o])&&(d.mark=e[o],l=this.index,this.changed=!0)}if(l>-1)l>this.index&&(this.changed=!0,this.destroyBetween(this.index,l)),this.top=this.top.children[this.index];else{let d=di.create(this.top,e[o],t,r);this.top.children.splice(this.index,0,d),this.top=d,this.changed=!0}this.index=0,o++}}findNodeMatch(e,t,r,i){let s=-1,o;if(i>=this.preMatch.index&&(o=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&o.matchesNode(e,t,r))s=this.top.children.indexOf(o,this.index);else for(let a=this.index,l=Math.min(this.top.children.length,a+5);a<l;a++){let c=this.top.children[a];if(c.matchesNode(e,t,r)&&!this.preMatch.matched.has(c)){s=a;break}}return s<0?!1:(this.destroyBetween(this.index,s),this.index++,!0)}updateNodeAt(e,t,r,i,s){let o=this.top.children[i];return o.dirty==Zn&&o.dom==o.contentDOM&&(o.dirty=Xi),o.update(e,t,r,s)?(this.destroyBetween(this.index,i),this.index++,!0):!1}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return-1;if(t==this.top.contentDOM){let r=e.pmViewDesc;if(r){for(let i=this.index;i<this.top.children.length;i++)if(this.top.children[i]==r)return i}return-1}e=t}}updateNextNode(e,t,r,i,s,o){for(let a=this.index;a<this.top.children.length;a++){let l=this.top.children[a];if(l instanceof hi){let c=this.preMatch.matched.get(l);if(c!=null&&c!=s)return!1;let d=l.dom,h,f=this.isLocked(d)&&!(e.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==e.text&&l.dirty!=Zn&&yu(t,l.outerDeco));if(!f&&l.update(e,t,r,i))return this.destroyBetween(this.index,a),l.dom!=d&&(this.changed=!0),this.index++,!0;if(!f&&(h=this.recreateWrapper(l,e,t,r,i,o)))return this.destroyBetween(this.index,a),this.top.children[this.index]=h,h.contentDOM&&(h.dirty=Xi,h.updateChildren(i,o+1),h.dirty=An),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,t,r,i,s,o){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content)||!yu(r,e.outerDeco)||!i.eq(e.innerDeco))return null;let a=hi.create(this.top,t,r,i,s,o);if(a.contentDOM){a.children=e.children,e.children=[];for(let l of a.children)l.parent=a}return e.destroy(),a}addNode(e,t,r,i,s){let o=hi.create(this.top,e,t,r,i,s);o.contentDOM&&o.updateChildren(i,s+1),this.top.children.splice(this.index++,0,o),this.changed=!0}placeWidget(e,t,r){let i=this.index<this.top.children.length?this.top.children[this.index]:null;if(i&&i.matchesWidget(e)&&(e==i.widget||!i.widget.type.toDOM.parentNode))this.index++;else{let s=new M2(this.top,e,t,r);this.top.children.splice(this.index++,0,s),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof di;)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof Md)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((Xt||Pt)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",t),this.addHackNode("BR",this.top))}addHackNode(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{let r=document.createElement(e);e=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),e=="BR"&&(r.className="ProseMirror-trailingBreak");let i=new A2(this.top,[],r,null);t!=this.top?t.children.push(i):t.children.splice(this.index++,0,i),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||K(e)&&e.contains(this.lock.parentNode))}}function wL(n,e){let t=e,r=t.children.length,i=n.childCount,s=new Map,o=[];e:for(;i>0;){let a;for(;;)if(r){let c=t.children[r-1];if(c instanceof di)t=c,r=c.children.length;else{a=c,r--;break}}else{if(t==e)break e;r=t.parent.children.indexOf(t),t=t.parent}let l=a.node;if(l){if(l!=n.child(i-1))break;--i,s.set(a,i),o.push(a)}}return{index:i,matched:s,matches:o.reverse()}}function QL(n,e){return n.type.side-e.type.side}function $L(n,e,t,r){let i=e.locals(n),s=0;if(i.length==0){for(let c=0;c<n.childCount;c++){let d=n.child(c);r(d,i,e.forChild(s,d),c),s+=d.nodeSize}return}let o=0,a=[],l=null;for(let c=0;;){let d,h;for(;o<i.length&&i[o].to==s;){let b=i[o++];b.widget&&(d?(h||(h=[d])).push(b):d=b)}if(d)if(h){h.sort(QL);for(let b=0;b<h.length;b++)t(h[b],c,!!l)}else t(d,c,!!l);let f,p;if(l)p=-1,f=l,l=null;else if(c<n.childCount)p=c,f=n.child(c++);else break;for(let b=0;b<a.length;b++)a[b].to<=s&&a.splice(b--,1);for(;o<i.length&&i[o].from<=s&&i[o].to>s;)a.push(i[o++]);let m=s+f.nodeSize;if(f.isText){let b=m;o<i.length&&i[o].from<b&&(b=i[o].from);for(let y=0;y<a.length;y++)a[y].to<b&&(b=a[y].to);b<m&&(l=f.cut(b-s),f=f.cut(0,b-s),m=b,p=-1)}else for(;o<i.length&&i[o].to<m;)o++;let O=f.isInline&&!f.isLeaf?a.filter(b=>!b.inline):a.slice();r(f,O,e.forChild(s,f),p),s=m}}function CL(n){if(n.nodeName=="UL"||n.nodeName=="OL"){let e=n.style.cssText;n.style.cssText=e+"; list-style: square !important",window.getComputedStyle(n).listStyle,n.style.cssText=e}}function PL(n,e,t,r){for(let i=0,s=0;i<n.childCount&&s<=r;){let o=n.child(i++),a=s;if(s+=o.nodeSize,!o.isText)continue;let l=o.text;for(;i<n.childCount;){let c=n.child(i++);if(s+=c.nodeSize,!c.isText)break;l+=c.text}if(s>=t){if(s>=r&&l.slice(r-e.length-a,r-a)==e)return r-e.length;let c=a<r?l.lastIndexOf(e,r-a-1):-1;if(c>=0&&c+e.length+a>=t)return a+c;if(t==r&&l.length>=r+e.length-a&&l.slice(r-a,r-a+e.length)==e)return r}}return-1}function Ap(n,e,t,r,i){let s=[];for(let o=0,a=0;o<n.length;o++){let l=n[o],c=a,d=a+=l.size;c>=t||d<=e?s.push(l):(c<e&&s.push(l.slice(0,e-c,r)),i&&(s.push(i),i=void 0),d>t&&s.push(l.slice(t-c,l.size,r)))}return s}function bg(n,e=null){let t=n.domSelectionRange(),r=n.state.doc;if(!t.focusNode)return null;let i=n.docView.nearestDesc(t.focusNode),s=i&&i.size==0,o=n.docView.posFromDOM(t.focusNode,t.focusOffset,1);if(o<0)return null;let a=r.resolve(o),l,c;if(Pd(t)){for(l=o;i&&!i.node;)i=i.parent;if(i&&i.node.isAtom&&ee.isSelectable(i.node)&&i.parent&&!(i.node.isInline&&tL(t.focusNode,t.focusOffset,i.dom))){let h=i.posBefore;c=new ee(o==h?a:r.resolve(h))}else if(mn&&e=="key"&&o>n.state.selection.to&&K(t.focusNode)&&t.focusOffset==t.focusNode.childNodes.length&&i&&i.posAtStart>n.state.selection.to)for(let h=t.focusNode;;h=h.parentNode){if(getComputedStyle(h).overflow!="visible"){c=ue.findFrom(r.resolve(i.posAtStart),1);break}if(h==i.dom||h.nextSibling||!h.parentNode||!K(h.parentNode))break}}else{if(t instanceof n.dom.ownerDocument.defaultView.Selection&&t.rangeCount>1){let h=o,f=o;for(let p=0;p<t.rangeCount;p++){let m=t.getRangeAt(p);h=Math.min(h,n.docView.posFromDOM(m.startContainer,m.startOffset,1)),f=Math.max(f,n.docView.posFromDOM(m.endContainer,m.endOffset,-1))}if(h<0)return null;[l,o]=f==n.state.selection.anchor?[f,h]:[h,f],a=r.resolve(o)}else l=n.docView.posFromDOM(t.anchorNode,t.anchorOffset,1);if(l<0)return null}let d=r.resolve(l);if(!c){let h=e=="pointer"||n.state.selection.head<a.pos&&!s?1:-1;c=yg(n,d,a,h)}return c}function D2(n){return n.editable?n.hasFocus():I2(n)&&document.activeElement&&document.activeElement.contains(n.dom)}function _r(n,e=!1){let t=n.state.selection;if(j2(n,t),!D2(n))return;let r=n.input.mouseDown;if(!e&&Pt&&r){let i=n.domSelectionRange(),s=n.domObserver.currentSelection;if(i.anchorNode&&s.anchorNode&&ls(i.anchorNode,i.anchorOffset,s.anchorNode,s.anchorOffset)&&r.delaySelUpdate()){n.domObserver.setCurSelection();return}}if(n.domObserver.disconnectSelection(),n.cursorWrapper)ML(n);else{let{anchor:i,head:s}=t,o,a;Eb&&!(t instanceof J)&&(t.$from.parent.inlineContent||(o=Nb(n,t.from)),!t.empty&&!t.$from.parent.inlineContent&&(a=Nb(n,t.to))),n.docView.setSelection(i,s,n,e),Eb&&(o&&Db(o),a&&Db(a)),t.visible?n.dom.classList.remove("ProseMirror-hideselection"):(n.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&TL(n))}n.domObserver.setCurSelection(),n.domObserver.connectSelection()}const Eb=Xt||Pt&&k2<63;function Nb(n,e){let{node:t,offset:r}=n.docView.domFromPos(e,0),i=r<t.childNodes.length?t.childNodes[r]:null,s=r?t.childNodes[r-1]:null;if(Xt&&i&&i.contentEditable=="false")return Vh(i);if((!i||i.contentEditable=="false")&&(!s||s.contentEditable=="false")){if(i)return Vh(i);if(s)return Vh(s)}}function Vh(n){return n.contentEditable="true",Xt&&n.draggable&&(n.draggable=!1,n.wasDraggable=!0),n}function Db(n){n.contentEditable="false",n.wasDraggable&&(n.draggable=!0,n.wasDraggable=null)}function TL(n){let e=n.dom.ownerDocument;e.removeEventListener("selectionchange",n.input.hideSelectionGuard);let t=n.domSelectionRange(),r=t.anchorNode,i=t.anchorOffset;e.addEventListener("selectionchange",n.input.hideSelectionGuard=()=>{(t.anchorNode!=r||t.anchorOffset!=i)&&(e.removeEventListener("selectionchange",n.input.hideSelectionGuard),setTimeout(()=>{(!D2(n)||n.state.selection.visible)&&n.dom.classList.remove("ProseMirror-hideselection")},20))})}function ML(n){let e=n.domSelection();if(!e)return;let t=n.cursorWrapper.dom,r=t.nodeName=="IMG";r?e.collapse(t.parentNode,$t(t)+1):e.collapse(t,0),!r&&!n.state.selection.visible&&en&&ui<=11&&(t.disabled=!0,t.disabled=!1)}function j2(n,e){if(e instanceof ee){let t=n.docView.descAt(e.from);t!=n.lastSelectedViewDesc&&(jb(n),t&&t.selectNode(),n.lastSelectedViewDesc=t)}else jb(n)}function jb(n){n.lastSelectedViewDesc&&(n.lastSelectedViewDesc.parent&&n.lastSelectedViewDesc.deselectNode(),n.lastSelectedViewDesc=void 0)}function yg(n,e,t,r){return n.someProp("createSelectionBetween",i=>i(n,e,t))||J.between(e,t,r)}function Ib(n){return n.editable&&!n.hasFocus()?!1:I2(n)}function I2(n){let e=n.domSelectionRange();if(!e.anchorNode)return!1;try{return cs(n.dom,e.anchorNode)&&(n.editable||cs(n.dom,e.focusNode))}catch{return!1}}function AL(n){let e=n.docView.domFromPos(n.state.selection.anchor,0),t=n.domSelectionRange();return ls(e.node,e.offset,t.anchorNode,t.anchorOffset)}function Rp(n,e){let{$anchor:t,$head:r}=n.selection,i=e>0?t.max(r):t.min(r),s=i.parent.inlineContent?i.depth?n.doc.resolve(e>0?i.after():i.before()):null:i;return s&&ue.findFrom(s,e)}function Jr(n,e){return n.dispatch(n.state.tr.setSelection(e).scrollIntoView()),!0}function Xb(n,e,t){let r=n.state.selection;if(r instanceof J)if(t.indexOf("s")>-1){let{$head:i}=r,s=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!s||s.isText||!s.isLeaf)return!1;let o=n.state.doc.resolve(i.pos+s.nodeSize*(e<0?-1:1));return Jr(n,new J(r.$anchor,o))}else if(r.empty){if(n.endOfTextblock(e>0?"forward":"backward")){let i=Rp(n.state,e);return i&&i instanceof ee?Jr(n,i):!1}else if(!(vn&&t.indexOf("m")>-1)){let i=r.$head,s=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,o;if(!s||s.isText)return!1;let a=e<0?i.pos-s.nodeSize:i.pos;return s.isAtom||(o=n.docView.descAt(a))&&!o.contentDOM?ee.isSelectable(s)?Jr(n,new ee(e<0?n.state.doc.resolve(i.pos-s.nodeSize):i)):Jr(n,new J(n.state.doc.resolve(e<0?a:a+s.nodeSize))):!1}}else return!1;else{if(r instanceof ee&&r.node.isInline)return Jr(n,new J(e>0?r.$to:r.$from));{let i=Rp(n.state,e);return i?Jr(n,i):!1}}}function ua(n,e){let t=n.pmViewDesc;return t?t.size==0&&(e<0||n.nextSibling||n.nodeName!="BR"):K(n)&&n.contentEditable=="false"}function Os(n,e){return e<0?RL(n):EL(n)}function RL(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let i,s,o=!1;for(mn&&K(t)&&r<Nt(t)&&ua(t.childNodes[r],-1)&&(o=!0);;)if(r>0){if(!K(t))break;let a=t.childNodes[r-1];if(ua(a,-1))i=t,s=--r;else if(pt(a))t=a,r=t.nodeValue.length;else break}else{if(X2(t))break;{let a=t.previousSibling;for(;a&&ua(a,-1);)i=t.parentNode,s=$t(a),a=a.previousSibling;if(a)t=a,r=Nt(t);else{if(t=t.parentNode,t==n.dom)break;r=0}}}o?Ep(n,t,r):i&&Ep(n,i,s)}function EL(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let i=Nt(t),s,o;for(;;)if(r<i){if(!K(t))break;let a=t.childNodes[r];if(ua(a,1))s=t,o=++r;else break}else{if(X2(t))break;{let a=t.nextSibling;for(;a&&ua(a,1);)s=a.parentNode,o=$t(a)+1,a=a.nextSibling;if(a)t=a,r=0,i=Nt(t);else{if(t=t.parentNode,t==n.dom)break;r=i=0}}}s&&Ep(n,s,o)}function X2(n){let e=n.pmViewDesc;return e&&e.node&&e.node.isBlock}function NL(n,e){for(;n&&e==n.childNodes.length&&!Ol(n);)e=$t(n)+1,n=n.parentNode;for(;n&&e<n.childNodes.length;){let t=n.childNodes[e];if(pt(t))return t;if(K(t)&&t.contentEditable=="false")break;n=t,e=0}}function DL(n,e){for(;n&&!e&&!Ol(n);)e=$t(n),n=n.parentNode;for(;n&&e;){let t=n.childNodes[e-1];if(pt(t))return t;if(K(t)&&t.contentEditable=="false")break;n=t,e=n.childNodes.length}}function Ep(n,e,t){if(!pt(e)){let s,o;(o=NL(e,t))?(e=o,t=0):(s=DL(e,t))&&(e=s,t=s.nodeValue.length)}let r=n.domSelection();if(!r)return;if(Pd(r)){let s=document.createRange();s.setEnd(e,t),s.setStart(e,t),r.removeAllRanges(),r.addRange(s)}else r.extend&&r.extend(e,t);n.domObserver.setCurSelection();let{state:i}=n;setTimeout(()=>{n.state==i&&_r(n)},50)}function Lb(n,e){let t=n.state.doc.resolve(e);if(!(Pt||v2)&&t.parent.inlineContent){let i=n.coordsAtPos(e);if(e>t.start()){let s=n.coordsAtPos(e-1),o=(s.top+s.bottom)/2;if(o>i.top&&o<i.bottom&&Math.abs(s.left-i.left)>1)return s.left<i.left?"ltr":"rtl"}if(e<t.end()){let s=n.coordsAtPos(e+1),o=(s.top+s.bottom)/2;if(o>i.top&&o<i.bottom&&Math.abs(s.left-i.left)>1)return s.left>i.left?"ltr":"rtl"}}return getComputedStyle(n.dom).direction=="rtl"?"rtl":"ltr"}function _b(n,e,t){let r=n.state.selection;if(r instanceof J&&!r.empty||t.indexOf("s")>-1||vn&&t.indexOf("m")>-1)return!1;let{$from:i,$to:s}=r;if(!i.parent.inlineContent||n.endOfTextblock(e<0?"up":"down")){let o=Rp(n.state,e);if(o&&o instanceof ee)return Jr(n,o)}if(!i.parent.inlineContent){let o=e<0?i:s,a=r instanceof pn?ue.near(o,e):ue.findFrom(o,e);return a?Jr(n,a):!1}return!1}function Bb(n,e){if(!(n.state.selection instanceof J))return!0;let{$head:t,$anchor:r,empty:i}=n.state.selection;if(!t.sameParent(r))return!0;if(!i)return!1;if(n.endOfTextblock(e>0?"forward":"backward"))return!0;let s=!t.textOffset&&(e<0?t.nodeBefore:t.nodeAfter);if(s&&!s.isText){let o=n.state.tr;return e<0?o.delete(t.pos-s.nodeSize,t.pos):o.delete(t.pos,t.pos+s.nodeSize),n.dispatch(o),!0}return!1}function Zb(n,e,t){n.domObserver.stop(),e.contentEditable=t,n.domObserver.start()}function jL(n){if(!Xt||n.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:t}=n.domSelectionRange();if(e&&K(e)&&t==0&&e.firstChild&&K(e.firstChild)&&e.firstChild.contentEditable=="false"){let r=e.firstChild;Zb(n,r,"true"),setTimeout(()=>Zb(n,r,"false"),20)}return!1}function IL(n){let e="";return n.ctrlKey&&(e+="c"),n.metaKey&&(e+="m"),n.altKey&&(e+="a"),n.shiftKey&&(e+="s"),e}function XL(n,e){let t=e.keyCode,r=IL(e);if(t==8||vn&&t==72&&r=="c")return Bb(n,-1)||Os(n,-1);if(t==46&&!e.shiftKey||vn&&t==68&&r=="c")return Bb(n,1)||Os(n,1);if(t==13||t==27)return!0;if(t==37||vn&&t==66&&r=="c"){let i=t==37?Lb(n,n.state.selection.from)=="ltr"?-1:1:-1;return Xb(n,i,r)||Os(n,i)}else if(t==39||vn&&t==70&&r=="c"){let i=t==39?Lb(n,n.state.selection.from)=="ltr"?1:-1:1;return Xb(n,i,r)||Os(n,i)}else{if(t==38||vn&&t==80&&r=="c")return _b(n,-1,r)||Os(n,-1);if(t==40||vn&&t==78&&r=="c")return jL(n)||_b(n,1,r)||Os(n,1);if(r==(vn?"m":"c")&&(t==66||t==73||t==89||t==90))return!0}return!1}function xg(n,e){n.someProp("transformCopied",p=>{e=p(e,n)});let t=[],{content:r,openStart:i,openEnd:s}=e;for(;i>1&&s>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,s--;let p=r.firstChild;t.push(p.type.name,p.attrs!=p.type.defaultAttrs?p.attrs:null),r=p.content}let o=n.someProp("clipboardSerializer")||ds.fromSchema(n.state.schema),a=z2(),l=a.createElement("div");l.appendChild(o.serializeFragment(r,{document:a}));let c=l.firstChild,d,h=0;for(;c&&K(c)&&(d=W2[c.nodeName.toLowerCase()]);){for(let p=d.length-1;p>=0;p--){let m=a.createElement(d[p]);for(;l.firstChild;)m.appendChild(l.firstChild);l.appendChild(m),h++}c=l.firstChild}c&&K(c)&&c.setAttribute("data-pm-slice",`${i} ${s}${h?` -${h}`:""} ${JSON.stringify(t)}`);let f=n.someProp("clipboardTextSerializer",p=>p(e,n))||e.content.textBetween(0,e.content.size,`
|
|
112
|
+
|
|
113
|
+
`);return{dom:l,text:f,slice:e}}function L2(n,e,t,r,i){let s=i.parent.type.spec.code,o,a;if(!t&&!e)return null;let l=!!e&&(r||s||!t);if(l){if(n.someProp("transformPastedText",f=>{e=f(e,s||r,n)}),s)return a=new z(E.from(n.state.schema.text(e.replace(/\r\n?/g,`
|
|
114
|
+
`))),0,0),n.someProp("transformPasted",f=>{a=f(a,n,!0)}),a;let h=n.someProp("clipboardTextParser",f=>f(e,i,r,n));if(h)a=h;else{let f=i.marks(),{schema:p}=n.state,m=ds.fromSchema(p);o=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(O=>{let b=o.appendChild(document.createElement("p"));O&&b.appendChild(m.serializeNode(p.text(O,f)))})}}else n.someProp("transformPastedHTML",h=>{t=h(t,n)}),o=ZL(t),Td&&WL(o);let c=o&&o.querySelector("[data-pm-slice]"),d=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(d&&d[3])for(let h=+d[3];h>0;h--){let f=o.firstChild;for(;f&&!K(f);)f=f.nextSibling;if(!f)break;o=f}if(a||(a=(n.someProp("clipboardParser")||n.someProp("domParser")||ci.fromSchema(n.state.schema)).parseSlice(o,{preserveWhitespace:!!(l||d),context:i,ruleFromNode(f){return f.nodeName=="BR"&&!f.nextSibling&&f.parentNode&&!LL.test(f.parentNode.nodeName)?{ignore:!0}:null}})),d)a=zL(Wb(a,+d[1],+d[2]),d[4]);else if(a=z.maxOpen(_L(a.content,i),!0),a.openStart||a.openEnd){let h=0,f=0;for(let p=a.content.firstChild;h<a.openStart&&!p.type.spec.isolating;h++,p=p.firstChild);for(let p=a.content.lastChild;f<a.openEnd&&!p.type.spec.isolating;f++,p=p.lastChild);a=Wb(a,h,f)}return n.someProp("transformPasted",h=>{a=h(a,n,l)}),a}const LL=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function _L(n,e){if(n.childCount<2)return n;for(let t=e.depth;t>=0;t--){let i=e.node(t).contentMatchAt(e.index(t)),s,o=[];if(n.forEach(a=>{if(!o)return;let l=i.findWrapping(a.type),c;if(!l)return o=null;if(c=o.length&&s.length&&B2(l,s,a,o[o.length-1],0))o[o.length-1]=c;else{o.length&&(o[o.length-1]=Z2(o[o.length-1],s.length));let d=_2(a,l);o.push(d),i=i.matchType(d.type),s=l}}),o)return E.from(o)}return n}function _2(n,e,t=0){for(let r=e.length-1;r>=t;r--)n=e[r].create(null,E.from(n));return n}function B2(n,e,t,r,i){if(i<n.length&&i<e.length&&n[i]==e[i]){let s=B2(n,e,t,r.lastChild,i+1);if(s)return r.copy(r.content.replaceChild(r.childCount-1,s));if(r.contentMatchAt(r.childCount).matchType(i==n.length-1?t.type:n[i+1]))return r.copy(r.content.append(E.from(_2(t,n,i+1))))}}function Z2(n,e){if(e==0)return n;let t=n.content.replaceChild(n.childCount-1,Z2(n.lastChild,e-1)),r=n.contentMatchAt(n.childCount).fillBefore(E.empty,!0);return n.copy(t.append(r))}function Np(n,e,t,r,i,s){let o=e<0?n.firstChild:n.lastChild,a=o.content;return n.childCount>1&&(s=0),i<r-1&&(a=Np(a,e,t,r,i+1,s)),i>=t&&(a=e<0?o.contentMatchAt(0).fillBefore(a,s<=i).append(a):a.append(o.contentMatchAt(o.childCount).fillBefore(E.empty,!0))),n.replaceChild(e<0?0:n.childCount-1,o.copy(a))}function Wb(n,e,t){return e<n.openStart&&(n=new z(Np(n.content,-1,e,n.openStart,0,n.openEnd),e,n.openEnd)),t<n.openEnd&&(n=new z(Np(n.content,1,t,n.openEnd,0,0),n.openStart,t)),n}const W2={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};function z2(){return document.implementation.createHTMLDocument("title")}let Ro=null;function BL(n){let e=window.trustedTypes;if(!e)return n;if(!Ro){if(Ro=e.defaultPolicy)try{return Ro.createHTML(n)}catch{}Ro=e.createPolicy("ProseMirrorClipboard",{createHTML:t=>t})}return Ro.createHTML(n)}function ZL(n){let e=/^(\s*<meta [^>]*>)*/.exec(n);e&&(n=n.slice(e[0].length));let t=z2(),r=t.body,i=/<([a-z][^>\s]+)/i.exec(n),s;if((s=i&&W2[i[1].toLowerCase()])&&(n=s.map(o=>"<"+o+">").join("")+n+s.map(o=>"</"+o+">").reverse().join("")),r.innerHTML=BL(n),s)for(let o=0;o<s.length;o++)r=r.querySelector(s[o])||r;for(let o=0;o<t.styleSheets.length;o++){let a=t.styleSheets[o];for(let l=0;l<a.rules.length;l++){let c=a.rules[l];if(c instanceof CSSStyleRule){let d=r.querySelectorAll(c.selectorText);for(let h=0;h<d.length;h++)d[h].style.cssText+=c.style.cssText}}}return r}function WL(n){let e=n.querySelectorAll(Pt?"span:not([class]):not([style])":"span.Apple-converted-space");for(let t=0;t<e.length;t++){let r=e[t];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(n.ownerDocument.createTextNode(" "),r)}}function zL(n,e){if(!n.size)return n;let t=n.content.firstChild.type.schema,r;try{r=JSON.parse(e)}catch{return n}let{content:i,openStart:s,openEnd:o}=n;for(let a=r.length-2;a>=0;a-=2){let l=t.nodes[r[a]];if(!l||l.hasRequiredAttrs())break;try{i=E.from(l.create(r[a+1],i))}catch{break}s++,o++}return new z(i,s,o)}const Ft={},qt={},VL={touchstart:!0,touchmove:!0};class FL{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function qL(n){for(let e in Ft){let t=Ft[e];n.dom.addEventListener(e,n.input.eventHandlers[e]=r=>{UL(n,r)&&!Sg(n,r)&&(n.editable||!(r.type in qt))&&t(n,r)},VL[e]?{passive:!0}:void 0)}Xt&&n.dom.addEventListener("input",()=>null),Dp(n)}function Dr(n,e){n.input.lastSelectionOrigin=e,n.input.lastSelectionTime=Date.now()}function YL(n){n.input.mouseDown&&n.input.mouseDown.done(),n.domObserver.stop();for(let e in n.input.eventHandlers)n.dom.removeEventListener(e,n.input.eventHandlers[e]);clearTimeout(n.input.composingTimeout),clearTimeout(n.input.lastIOSEnterFallbackTimeout)}function Dp(n){n.someProp("handleDOMEvents",e=>{for(let t in e)n.input.eventHandlers[t]||n.dom.addEventListener(t,n.input.eventHandlers[t]=r=>Sg(n,r))})}function Sg(n,e){return n.someProp("handleDOMEvents",t=>{let r=t[e.type];return r?r(n,e)||e.defaultPrevented:!1})}function UL(n,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target;t!=n.dom;t=t.parentNode)if(!t||t.nodeType==11||t.pmViewDesc&&t.pmViewDesc.stopEvent(e))return!1;return!0}function GL(n,e){!Sg(n,e)&&Ft[e.type]&&(n.editable||!(e.type in qt))&&Ft[e.type](n,e)}qt.keydown=(n,e)=>{let t=e;if(n.input.shiftKey=t.keyCode==16||t.shiftKey,!Y2(n)&&(n.input.lastKeyCode=t.keyCode,n.input.lastKeyCodeTime=Date.now(),!(Nr&&Pt&&t.keyCode==13)))if(t.keyCode!=229&&n.domObserver.forceFlush(),ao&&t.keyCode==13&&!t.ctrlKey&&!t.altKey&&!t.metaKey){let r=Date.now();n.input.lastIOSEnter=r,n.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{n.input.lastIOSEnter==r&&(n.someProp("handleKeyDown",i=>i(n,Di(13,"Enter"))),n.input.lastIOSEnter=0)},200)}else n.someProp("handleKeyDown",r=>r(n,t))||XL(n,t)?t.preventDefault():Dr(n,"key")};qt.keyup=(n,e)=>{e.keyCode==16&&(n.input.shiftKey=!1)};qt.keypress=(n,e)=>{let t=e;if(Y2(n)||!t.charCode||t.ctrlKey&&!t.altKey||vn&&t.metaKey)return;if(n.someProp("handleKeyPress",i=>i(n,t))){t.preventDefault();return}let r=n.state.selection;if(!(r instanceof J)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(t.charCode),s=()=>n.state.tr.insertText(i).scrollIntoView();!/[\r\n]/.test(i)&&!n.someProp("handleTextInput",o=>o(n,r.$from.pos,r.$to.pos,i,s))&&n.dispatch(s()),t.preventDefault()}};function yl(n){return{left:n.clientX,top:n.clientY}}function HL(n,e){let t=e.x-n.clientX,r=e.y-n.clientY;return t*t+r*r<100}function kg(n,e,t,r,i){if(r==-1)return!1;let s=n.state.doc.resolve(r);for(let o=s.depth+1;o>0;o--)if(n.someProp(e,a=>o>s.depth?a(n,t,s.nodeAfter,s.before(o),i,!0):a(n,t,s.node(o),s.before(o),i,!1)))return!0;return!1}function xl(n,e,t){if(n.focused||n.focus(),n.state.selection.eq(e))return;let r=n.state.tr.setSelection(e);r.setMeta("pointer",!0),n.dispatch(r)}function KL(n,e){if(e==-1)return!1;let t=n.state.doc.resolve(e),r=t.nodeAfter;return r&&r.isAtom&&ee.isSelectable(r)?(xl(n,new ee(t)),!0):!1}function JL(n,e){if(e==-1)return!1;let t=n.state.selection,r,i;t instanceof ee&&(r=t.node);let s=n.state.doc.resolve(e);for(let o=s.depth+1;o>0;o--){let a=o>s.depth?s.nodeAfter:s.node(o);if(ee.isSelectable(a)){r&&t.$from.depth>0&&o>=t.$from.depth&&s.before(t.$from.depth+1)==t.$from.pos?i=s.before(t.$from.depth):i=s.before(o);break}}return i!=null?(xl(n,ee.create(n.state.doc,i)),!0):!1}function e8(n,e,t,r,i){return kg(n,"handleClickOn",e,t,r)||n.someProp("handleClick",s=>s(n,e,r))||(i?JL(n,t):KL(n,t))}function t8(n,e,t,r){return kg(n,"handleDoubleClickOn",e,t,r)||n.someProp("handleDoubleClick",i=>i(n,e,r))}function n8(n,e,t,r){return kg(n,"handleTripleClickOn",e,t,r)||n.someProp("handleTripleClick",i=>i(n,e,r))||r8(n,t,r)}function r8(n,e,t){if(t.button!=0)return!1;let r=V2(n,e,!0),i=n.state.doc;return r?(xl(n,r),r instanceof J&&i.eq(n.state.doc)&&(n.input.mouseDown=new s8(n,r)),!0):!1}function V2(n,e,t){let r=n.state.doc;if(e==-1)return r.inlineContent?J.create(r,0,r.content.size):null;let i=r.resolve(e);for(let s=i.depth+1;s>0;s--){let o=s>i.depth?i.nodeAfter:i.node(s),a=i.before(s);if(o.inlineContent)return J.create(r,a+1,a+1+o.content.size);if(t&&ee.isSelectable(o))return ee.create(r,a)}return null}function vg(n){return xu(n)}const F2=vn?"metaKey":"ctrlKey";Ft.mousedown=(n,e)=>{let t=e;n.input.shiftKey=t.shiftKey;let r=vg(n),i=Date.now(),s="singleClick";i-n.input.lastClick.time<500&&HL(t,n.input.lastClick)&&!t[F2]&&n.input.lastClick.button==t.button&&(n.input.lastClick.type=="singleClick"?s="doubleClick":n.input.lastClick.type=="doubleClick"&&(s="tripleClick")),n.input.lastClick={time:i,x:t.clientX,y:t.clientY,type:s,button:t.button},n.input.mouseDown&&n.input.mouseDown.done();let o=n.posAtCoords(yl(t));o&&(s=="singleClick"?n.input.mouseDown=new i8(n,o,t,!!r):(s=="doubleClick"?t8:n8)(n,o.pos,o.inside,t)?t.preventDefault():Dr(n,"pointer"))};class q2{constructor(e){this.view=e,this.mightDrag=null,e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this))}up(e){this.done()}move(e){e.buttons==0&&this.done()}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.view.input.mouseDown==this&&(this.view.input.mouseDown=null)}delaySelUpdate(){return!1}}class i8 extends q2{constructor(e,t,r,i){super(e),this.pos=t,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.startDoc=e.state.doc,this.selectNode=!!r[F2],this.allowDefault=r.shiftKey;let s,o;if(t.inside>-1)s=e.state.doc.nodeAt(t.inside),o=t.inside;else{let d=e.state.doc.resolve(t.pos);s=d.parent,o=d.depth?d.before():0}const a=i?null:r.target,l=a?e.docView.nearestDesc(a,!0):null;this.target=l&&K(l.nodeDOM)?l.nodeDOM:null;let{selection:c}=e.state;r.button==0&&(s.type.spec.draggable&&s.type.spec.selectable!==!1||c instanceof ee&&c.from<=o&&c.to>o)&&(this.mightDrag={node:s,pos:o,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&mn&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),Dr(e,"pointer")}done(){super.done(),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>{this.view.isDestroyed||_r(this.view)})}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(yl(e))),this.updateAllowDefault(e),this.allowDefault||!t?Dr(this.view,"pointer"):e8(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Xt&&this.mightDrag&&!this.mightDrag.node.isAtom||Pt&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(xl(this.view,ue.near(this.view.state.doc.resolve(t.pos))),e.preventDefault()):Dr(this.view,"pointer")}move(e){this.updateAllowDefault(e),Dr(this.view,"pointer"),super.move(e)}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}delaySelUpdate(){return this.allowDefault?(this.delayedSelectionSync=!0,!0):!1}}class s8 extends q2{constructor(e,t){super(e),this.startSelection=t,this.startDoc=e.state.doc}move(e){if(e.buttons==0||this.view.isDestroyed||!this.view.state.doc.eq(this.startDoc)){this.done();return}e.preventDefault(),Dr(this.view,"pointer");let t=this.view.posAtCoords(yl(e)),r=t&&V2(this.view,t.inside,!1);if(!r)return;let{doc:i}=this.view.state,s=this.startSelection,[o,a]=r.from<s.from?[s.to,r.from]:[s.from,r.to];xl(this.view,J.create(i,o,a))}}Ft.touchstart=n=>{n.input.lastTouch=Date.now(),vg(n),Dr(n,"pointer")};Ft.touchmove=n=>{n.input.lastTouch=Date.now(),Dr(n,"pointer")};Ft.contextmenu=n=>vg(n);function Y2(n,e){return n.composing?!0:Xt&&Math.abs(Date.now()-n.input.compositionEndedAt)<500?(n.input.compositionEndedAt=-2e8,!0):!1}const o8=Nr?5e3:-1;qt.compositionstart=qt.compositionupdate=n=>{if(!n.composing){n.domObserver.flush();let{state:e}=n,t=e.selection.$to;if(e.selection instanceof J&&e.selection.empty&&(e.storedMarks||!t.textOffset&&t.parentOffset&&t.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)||Pt&&v2&&a8(n)))n.markCursor=n.state.storedMarks||t.marks(),xu(n,!0),n.markCursor=null;else if(xu(n,!e.selection.empty),mn&&e.selection.empty&&t.parentOffset&&!t.textOffset&&t.nodeBefore.marks.length){let r=n.domSelectionRange();for(let i=r.focusNode,s=r.focusOffset;i&&K(i)&&s!=0;){let o=s<0?i.lastChild:i.childNodes[s-1];if(!o)break;if(pt(o)){let a=n.domSelection();a&&a.collapse(o,o.nodeValue.length);break}else i=o,s=-1}}n.input.composing=!0}U2(n,o8)};function a8(n){let{focusNode:e,focusOffset:t}=n.domSelectionRange();if(!e||!K(e)||t>=e.childNodes.length)return!1;let r=e.childNodes[t];return K(r)&&r.contentEditable=="false"}qt.compositionend=(n,e)=>{n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=Date.now(),n.input.compositionPendingChanges=n.domObserver.pendingRecords().length?n.input.compositionID:0,n.input.compositionNode=null,n.input.badSafariComposition?n.domObserver.forceFlush():n.input.compositionPendingChanges&&Promise.resolve().then(()=>n.domObserver.flush()),n.input.compositionID++,U2(n,20))};function U2(n,e){clearTimeout(n.input.composingTimeout),e>-1&&(n.input.composingTimeout=setTimeout(()=>xu(n),e))}function G2(n){for(n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=Date.now());n.input.compositionNodes.length>0;)n.input.compositionNodes.pop().markParentsDirty()}function l8(n){let e=n.domSelectionRange();if(!e.focusNode)return null;let t=J7(e.focusNode,e.focusOffset),r=eL(e.focusNode,e.focusOffset);if(t&&r&&t!=r){let i=r.pmViewDesc,s=n.domObserver.lastChangedTextNode;if(t==s||r==s)return s;if(!i||!i.isText(r.nodeValue))return r;if(n.input.compositionNode==r){let o=t.pmViewDesc;if(!(!o||!o.isText(t.nodeValue)))return r}}return t||r}function xu(n,e=!1){if(!(Nr&&n.domObserver.flushingSoon>=0)){if(n.domObserver.forceFlush(),G2(n),e||n.docView&&n.docView.dirty){let t=bg(n),r=n.state.selection;return t&&!t.eq(r)?n.dispatch(n.state.tr.setSelection(t)):(n.markCursor||e)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?n.dispatch(n.state.tr.deleteSelection()):n.updateState(n.state),!0}return!1}}function c8(n,e){if(!n.dom.parentNode)return;let t=n.dom.parentNode.appendChild(document.createElement("div"));t.appendChild(e),t.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(e),n.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{t.parentNode&&t.parentNode.removeChild(t),n.focus()},50)}const Ga=en&&ui<15||ao&&iL<604;Ft.copy=qt.cut=(n,e)=>{let t=e,r=n.state.selection,i=t.type=="cut";if(r.empty)return;let s=Ga?null:t.clipboardData,o=r.content(),{dom:a,text:l}=xg(n,o);s?(t.preventDefault(),s.clearData(),s.setData("text/html",a.innerHTML),s.setData("text/plain",l)):c8(n,a),i&&n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function u8(n){return n.openStart==0&&n.openEnd==0&&n.content.childCount==1?n.content.firstChild:null}function d8(n,e){if(!n.dom.parentNode)return;let t=n.input.shiftKey||n.state.selection.$from.parent.type.spec.code,r=n.dom.parentNode.appendChild(document.createElement(t?"textarea":"div"));t||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=n.input.shiftKey&&n.input.lastKeyCode!=45;setTimeout(()=>{n.focus(),r.parentNode&&r.parentNode.removeChild(r),t?Ha(n,r.value,null,i,e):Ha(n,r.textContent,r.innerHTML,i,e)},50)}function Ha(n,e,t,r,i){let s=L2(n,e,t,r,n.state.selection.$from);if(n.someProp("handlePaste",l=>l(n,i,s||z.empty)))return!0;if(!s)return!1;let o=u8(s),a=o?n.state.tr.replaceSelectionWith(o,r):n.state.tr.replaceSelection(s);return n.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function H2(n){let e=n.getData("text/plain")||n.getData("Text");if(e)return e;let t=n.getData("text/uri-list");return t?t.replace(/\r?\n/g," "):""}qt.paste=(n,e)=>{let t=e;if(n.composing&&!Nr)return;let r=Ga?null:t.clipboardData,i=n.input.shiftKey&&n.input.lastKeyCode!=45;r&&Ha(n,H2(r),r.getData("text/html"),i,t)?t.preventDefault():d8(n,t)};class K2{constructor(e,t,r){this.slice=e,this.move=t,this.node=r}}const h8=vn?"altKey":"ctrlKey";function J2(n,e){let t;return n.someProp("dragCopies",r=>{t=t||r(e)}),t!=null?!t:!e[h8]}Ft.dragstart=(n,e)=>{let t=e,r=n.input.mouseDown;if(r&&r.done(),!t.dataTransfer)return;let i=n.state.selection,s=i.empty?null:n.posAtCoords(yl(t)),o;if(!(s&&s.pos>=i.from&&s.pos<=(i instanceof ee?i.to-1:i.to))){if(r&&r.mightDrag)o=ee.create(n.state.doc,r.mightDrag.pos);else if(t.target&&K(t.target)){let h=n.docView.nearestDesc(t.target,!0);h&&h.node.type.spec.draggable&&h!=n.docView&&(o=ee.create(n.state.doc,h.posBefore))}}let a=(o||n.state.selection).content(),{dom:l,text:c,slice:d}=xg(n,a);(!t.dataTransfer.files.length||!Pt||k2>120)&&t.dataTransfer.clearData(),t.dataTransfer.setData(Ga?"Text":"text/html",l.innerHTML),t.dataTransfer.effectAllowed="copyMove",Ga||t.dataTransfer.setData("text/plain",c),n.dragging=new K2(d,J2(n,t),o)};Ft.dragend=n=>{let e=n.dragging;window.setTimeout(()=>{n.dragging==e&&(n.dragging=null)},50)};qt.dragover=qt.dragenter=(n,e)=>e.preventDefault();qt.drop=(n,e)=>{try{f8(n,e,n.dragging)}finally{n.dragging=null}};function f8(n,e,t){if(!e.dataTransfer)return;let r=n.posAtCoords(yl(e));if(!r)return;let i=n.state.doc.resolve(r.pos),s=t&&t.slice;s?n.someProp("transformPasted",p=>{s=p(s,n,!1)}):s=L2(n,H2(e.dataTransfer),Ga?null:e.dataTransfer.getData("text/html"),!1,i);let o=!!(t&&J2(n,e));if(n.someProp("handleDrop",p=>p(n,e,s||z.empty,o))){e.preventDefault();return}if(!s)return;e.preventDefault();let a=s?Jw(n.state.doc,i.pos,s):i.pos;a==null&&(a=i.pos);let l=n.state.tr;if(o){let{node:p}=t;p?p.replace(l):l.deleteSelection()}let c=l.mapping.map(a),d=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,h=l.doc;if(d?l.replaceRangeWith(c,c,s.content.firstChild):l.replaceRange(c,c,s),l.doc.eq(h))return;let f=l.doc.resolve(c);if(d&&ee.isSelectable(s.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(s.content.firstChild))l.setSelection(new ee(f));else{let p=l.mapping.map(a);l.mapping.maps[l.mapping.maps.length-1].forEach((m,O,b,y)=>p=y),l.setSelection(yg(n,f,l.doc.resolve(p)))}n.focus(),n.dispatch(l.setMeta("uiEvent","drop"))}Ft.focus=n=>{n.input.lastFocus=Date.now(),n.focused||(n.domObserver.stop(),n.dom.classList.add("ProseMirror-focused"),n.domObserver.start(),n.focused=!0,setTimeout(()=>{n.docView&&n.hasFocus()&&!n.domObserver.currentSelection.eq(n.domSelectionRange())&&_r(n)},20))};Ft.blur=(n,e)=>{let t=e;n.focused&&(n.domObserver.stop(),n.dom.classList.remove("ProseMirror-focused"),n.domObserver.start(),t.relatedTarget&&n.dom.contains(t.relatedTarget)&&n.domObserver.currentSelection.clear(),n.focused=!1)};Ft.beforeinput=(n,e)=>{if(Nr&&e.inputType=="deleteContentBackward"){n.domObserver.flushSoon();let{domChangeCount:r}=n.input;setTimeout(()=>{if(n.input.domChangeCount!=r||(n.dom.blur(),n.focus(),n.someProp("handleKeyDown",s=>s(n,Di(8,"Backspace")))))return;let{$cursor:i}=n.state.selection;i&&i.pos>0&&n.dispatch(n.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let n in qt)Ft[n]=qt[n];function Ka(n,e){if(n==e)return!0;for(let t in n)if(n[t]!==e[t])return!1;for(let t in e)if(!(t in n))return!1;return!0}class Su{constructor(e,t){this.toDOM=e,this.spec=t||Ui,this.side=this.spec.side||0}map(e,t,r,i){let{pos:s,deleted:o}=e.mapResult(t.from+i,this.side<0?-1:1);return o?null:new jt(s-r,s-r,this)}valid(){return!0}eq(e){return this==e||e instanceof Su&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Ka(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class fi{constructor(e,t){this.attrs=e,this.spec=t||Ui}map(e,t,r,i){let s=e.map(t.from+i,this.spec.inclusiveStart?-1:1)-r,o=e.map(t.to+i,this.spec.inclusiveEnd?1:-1)-r;return s>=o?null:new jt(s,o,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof fi&&Ka(this.attrs,e.attrs)&&Ka(this.spec,e.spec)}static is(e){return e.type instanceof fi}destroy(){}}class wg{constructor(e,t){this.attrs=e,this.spec=t||Ui}map(e,t,r,i){let s=e.mapResult(t.from+i,1);if(s.deleted)return null;let o=e.mapResult(t.to+i,-1);return o.deleted||o.pos<=s.pos?null:new jt(s.pos-r,o.pos-r,this)}valid(e,t){let{index:r,offset:i}=e.content.findIndex(t.from),s;return i==t.from&&!(s=e.child(r)).isText&&i+s.nodeSize==t.to}eq(e){return this==e||e instanceof wg&&Ka(this.attrs,e.attrs)&&Ka(this.spec,e.spec)}destroy(){}}class jt{constructor(e,t,r){this.from=e,this.to=t,this.type=r}copy(e,t){return new jt(e,t,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,r){return this.type.map(e,this,t,r)}static widget(e,t,r){return new jt(e,e,new Su(t,r))}static inline(e,t,r,i){return new jt(e,t,new fi(r,i))}static node(e,t,r,i){return new jt(e,t,new wg(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof fi}get widget(){return this.type instanceof Su}}const $s=[],Ui={};class ye{constructor(e,t){this.local=e.length?e:$s,this.children=t.length?t:$s}static create(e,t){return t.length?ku(t,e,0,Ui):At}find(e,t,r){let i=[];return this.findInner(e??0,t??1e9,i,0,r),i}findInner(e,t,r,i,s){for(let o=0;o<this.local.length;o++){let a=this.local[o];a.from<=t&&a.to>=e&&(!s||s(a.spec))&&r.push(a.copy(a.from+i,a.to+i))}for(let o=0;o<this.children.length;o+=3)if(this.children[o]<t&&this.children[o+1]>e){let a=this.children[o]+1;this.children[o+2].findInner(e-a,t-a,r,i+a,s)}}map(e,t,r){return this==At||e.maps.length==0?this:this.mapInner(e,t,0,0,r||Ui)}mapInner(e,t,r,i,s){let o;for(let a=0;a<this.local.length;a++){let l=this.local[a].map(e,r,i);l&&l.type.valid(t,l)?(o||(o=[])).push(l):s.onRemove&&s.onRemove(this.local[a].spec)}return this.children.length?p8(this.children,o||[],e,t,r,i,s):o?new ye(o.sort(Gi),$s):At}add(e,t){return t.length?this==At?ye.create(e,t):this.addInner(e,t,0):this}addInner(e,t,r){let i,s=0;e.forEach((a,l)=>{let c=l+r,d;if(d=tQ(t,a,c)){for(i||(i=this.children.slice());s<i.length&&i[s]<l;)s+=3;i[s]==l?i[s+2]=i[s+2].addInner(a,d,c+1):i.splice(s,0,l,l+a.nodeSize,ku(d,a,c+1,Ui)),s+=3}});let o=eQ(s?nQ(t):t,-r);for(let a=0;a<o.length;a++)o[a].type.valid(e,o[a])||o.splice(a--,1);return new ye(o.length?this.local.concat(o).sort(Gi):this.local,i||this.children)}remove(e){return e.length==0||this==At?this:this.removeInner(e,0)}removeInner(e,t){let r=this.children,i=this.local;for(let s=0;s<r.length;s+=3){let o,a=r[s]+t,l=r[s+1]+t;for(let d=0,h;d<e.length;d++)(h=e[d])&&h.from>a&&h.to<l&&(e[d]=null,(o||(o=[])).push(h));if(!o)continue;r==this.children&&(r=this.children.slice());let c=r[s+2].removeInner(o,a+1);c!=At?r[s+2]=c:(r.splice(s,3),s-=3)}if(i.length){for(let s=0,o;s<e.length;s++)if(o=e[s])for(let a=0;a<i.length;a++)i[a].eq(o,t)&&(i==this.local&&(i=this.local.slice()),i.splice(a--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new ye(i,r):At}forChild(e,t){if(this==At)return this;if(t.isLeaf)return ye.empty;let r,i;for(let a=0;a<this.children.length;a+=3)if(this.children[a]>=e){this.children[a]==e&&(r=this.children[a+2]);break}let s=e+1,o=s+t.content.size;for(let a=0;a<this.local.length;a++){let l=this.local[a];if(l.from<o&&l.to>s&&l.type instanceof fi){let c=Math.max(s,l.from)-s,d=Math.min(o,l.to)-s;c<d&&(i||(i=[])).push(l.copy(c,d))}}if(i){let a=new ye(i.sort(Gi),$s);return r?new ri([a,r]):a}return r||At}eq(e){if(this==e)return!0;if(!(e instanceof ye)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let t=0;t<this.local.length;t++)if(!this.local[t].eq(e.local[t]))return!1;for(let t=0;t<this.children.length;t+=3)if(this.children[t]!=e.children[t]||this.children[t+1]!=e.children[t+1]||!this.children[t+2].eq(e.children[t+2]))return!1;return!0}locals(e){return Qg(this.localsInner(e))}localsInner(e){if(this==At)return $s;if(e.inlineContent||!this.local.some(fi.is))return this.local;let t=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof fi||t.push(this.local[r]);return t}forEachSet(e){e(this)}}ye.empty=new ye([],[]);ye.removeOverlap=Qg;const At=ye.empty;class ri{constructor(e){this.members=e}map(e,t){const r=this.members.map(i=>i.map(e,t,Ui));return ri.from(r)}forChild(e,t){if(t.isLeaf)return ye.empty;let r=[];for(let i=0;i<this.members.length;i++){let s=this.members[i].forChild(e,t);s!=At&&(s instanceof ri?r=r.concat(s.members):r.push(s))}return ri.from(r)}eq(e){if(!(e instanceof ri)||e.members.length!=this.members.length)return!1;for(let t=0;t<this.members.length;t++)if(!this.members[t].eq(e.members[t]))return!1;return!0}locals(e){let t,r=!0;for(let i=0;i<this.members.length;i++){let s=this.members[i].localsInner(e);if(s.length)if(!t)t=s;else{r&&(t=t.slice(),r=!1);for(let o=0;o<s.length;o++)t.push(s[o])}}return t?Qg(r?t:t.sort(Gi)):$s}static from(e){switch(e.length){case 0:return At;case 1:return e[0];default:return new ri(e.every(t=>t instanceof ye)?e:e.reduce((t,r)=>t.concat(r instanceof ye?r:r.members),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}}function p8(n,e,t,r,i,s,o){let a=n.slice();for(let c=0,d=s;c<t.maps.length;c++){let h=0;t.maps[c].forEach((f,p,m,O)=>{let b=O-m-(p-f);for(let y=0;y<a.length;y+=3){let k=a[y+1];if(k<0||f>k+d-h)continue;let x=a[y]+d-h;p>=x?a[y+1]=f<=x?-2:-1:f>=d&&b&&(a[y]+=b,a[y+1]+=b)}h+=b}),d=t.maps[c].map(d,-1)}let l=!1;for(let c=0;c<a.length;c+=3)if(a[c+1]<0){if(a[c+1]==-2){l=!0,a[c+1]=-1;continue}let d=t.map(n[c]+s),h=d-i;if(h<0||h>=r.content.size){l=!0;continue}let f=t.map(n[c+1]+s,-1),p=f-i,{index:m,offset:O}=r.content.findIndex(h),b=r.maybeChild(m);if(b&&O==h&&O+b.nodeSize==p){let y=a[c+2].mapInner(t,b,d+1,n[c]+s+1,o);y!=At?(a[c]=h,a[c+1]=p,a[c+2]=y):(a[c+1]=-2,l=!0)}else l=!0}if(l){let c=m8(a,n,e,t,i,s,o),d=ku(c,r,0,o);e=d.local;for(let h=0;h<a.length;h+=3)a[h+1]<0&&(a.splice(h,3),h-=3);for(let h=0,f=0;h<d.children.length;h+=3){let p=d.children[h];for(;f<a.length&&a[f]<p;)f+=3;a.splice(f,0,d.children[h],d.children[h+1],d.children[h+2])}}return new ye(e.sort(Gi),a)}function eQ(n,e){if(!e||!n.length)return n;let t=[];for(let r=0;r<n.length;r++){let i=n[r];t.push(new jt(i.from+e,i.to+e,i.type))}return t}function m8(n,e,t,r,i,s,o){function a(l,c){for(let d=0;d<l.local.length;d++){let h=l.local[d].map(r,i,c);h?t.push(h):o.onRemove&&o.onRemove(l.local[d].spec)}for(let d=0;d<l.children.length;d+=3)a(l.children[d+2],l.children[d]+c+1)}for(let l=0;l<n.length;l+=3)n[l+1]==-1&&a(n[l+2],e[l]+s+1);return t}function tQ(n,e,t){if(e.isLeaf)return null;let r=t+e.nodeSize,i=null;for(let s=0,o;s<n.length;s++)(o=n[s])&&o.from>t&&o.to<r&&((i||(i=[])).push(o),n[s]=null);return i}function nQ(n){let e=[];for(let t=0;t<n.length;t++)n[t]!=null&&e.push(n[t]);return e}function ku(n,e,t,r){let i=[],s=!1;e.forEach((a,l)=>{let c=tQ(n,a,l+t);if(c){s=!0;let d=ku(c,a,t+l+1,r);d!=At&&i.push(l,l+a.nodeSize,d)}});let o=eQ(s?nQ(n):n,-t).sort(Gi);for(let a=0;a<o.length;a++)o[a].type.valid(e,o[a])||(r.onRemove&&r.onRemove(o[a].spec),o.splice(a--,1));return o.length||i.length?new ye(o,i):At}function Gi(n,e){return n.from-e.from||n.to-e.to}function Qg(n){let e=n;for(let t=0;t<e.length-1;t++){let r=e[t];if(r.from!=r.to)for(let i=t+1;i<e.length;i++){let s=e[i];if(s.from==r.from){s.to!=r.to&&(e==n&&(e=n.slice()),e[i]=s.copy(s.from,r.to),zb(e,i+1,s.copy(r.to,s.to)));continue}else{s.from<r.to&&(e==n&&(e=n.slice()),e[t]=r.copy(r.from,s.from),zb(e,i,r.copy(s.from,r.to)));break}}}return e}function zb(n,e,t){for(;e<n.length&&Gi(t,n[e])>0;)e++;n.splice(e,0,t)}function Fh(n){let e=[];return n.someProp("decorations",t=>{let r=t(n.state);r&&r!=At&&e.push(r)}),n.cursorWrapper&&e.push(ye.create(n.state.doc,[n.cursorWrapper.deco])),ri.from(e)}const g8={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},O8=en&&ui<=11;class b8{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class y8{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new b8,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let i=0;i<r.length;i++)this.queue.push(r[i]);en&&ui<=11&&r.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():Xt&&e.composing&&r.some(i=>i.type=="childList"&&i.target.nodeName=="TR")?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),O8&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,g8)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;t<e.length;t++)this.queue.push(e[t]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(Ib(this.view)){if(this.suppressingSelectionUpdates)return _r(this.view);if(en&&ui<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&ls(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t=new Set,r;for(let s=e.focusNode;s;s=oo(s))t.add(s);for(let s=e.anchorNode;s;s=oo(s))if(t.has(s)){r=s;break}let i=r&&this.view.docView.nearestDesc(r);if(i&&i.ignoreMutation({type:"selection",target:pt(r)?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.pendingRecords();t.length&&(this.queue=[]);let r=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&Ib(e)&&!this.ignoreSelectionChange(r),s=-1,o=-1,a=!1,l=[];if(e.editable)for(let d=0;d<t.length;d++){let h=this.registerMutation(t[d],l);h&&(s=s<0?h.from:Math.min(h.from,s),o=o<0?h.to:Math.max(h.to,o),h.typeOver&&(a=!0))}if(l.some(d=>d.nodeName=="BR")&&(e.input.lastKeyCode==8||e.input.lastKeyCode==46||Pt&&(e.composing||e.input.compositionEndedAt>Date.now()-50)&&t.some(d=>d.type=="childList"&&d.removedNodes.length))){for(let d of l)if(d.nodeName=="BR"&&d.parentNode){let h=d.nextSibling;for(;h&&K(h);){if(h.contentEditable=="false"){d.parentNode.removeChild(d);break}h=h.firstChild}}}else if(mn&&l.length){let d=l.filter(h=>h.nodeName=="BR");if(d.length==2){let[h,f]=d;h.parentNode&&h.parentNode.parentNode==f.parentNode?f.remove():h.remove()}else{let{focusNode:h}=this.currentSelection;for(let f of d){let p=f.parentNode;p&&p.nodeName=="LI"&&(!h||k8(e,h)!=p)&&f.remove()}}}let c=null;s<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&Pd(r)&&(c=bg(e))&&c.eq(ue.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,_r(e),this.currentSelection.set(r),e.scrollToSelection()):(s>-1||i)&&(s>-1&&(e.docView.markDirty(s,o),x8(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,v8(e,l)),this.handleDOMChange(s,o,a,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||_r(e),this.currentSelection.set(r))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let d=0;d<e.addedNodes.length;d++){let h=e.addedNodes[d];t.push(h),pt(h)&&(this.lastChangedTextNode=h)}if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(e.target))return{from:r.posBefore,to:r.posAfter};let i=e.previousSibling,s=e.nextSibling;if(en&&ui<=11&&e.addedNodes.length)for(let d=0;d<e.addedNodes.length;d++){let{previousSibling:h,nextSibling:f}=e.addedNodes[d];(!h||Array.prototype.indexOf.call(e.addedNodes,h)<0)&&(i=h),(!f||Array.prototype.indexOf.call(e.addedNodes,f)<0)&&(s=f)}let o=i&&i.parentNode==e.target?$t(i)+1:0,a=r.localPosFromDOM(e.target,o,-1),l=s&&s.parentNode==e.target?$t(s):e.target.childNodes.length,c=r.localPosFromDOM(e.target,l,1);return{from:a,to:c}}else return e.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:(this.lastChangedTextNode=e.target,{from:r.posAtStart,to:r.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let Vb=new WeakMap,Fb=!1;function x8(n){if(!Vb.has(n)&&(Vb.set(n,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(n.dom).whiteSpace)!==-1)){if(n.requiresGeckoHackNode=mn,Fb)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),Fb=!0}}function qb(n,e){let t=e.startContainer,r=e.startOffset,i=e.endContainer,s=e.endOffset,o=n.domAtPos(n.state.selection.anchor);return ls(o.node,o.offset,i,s)&&([t,r,i,s]=[i,s,t,r]),{anchorNode:t,anchorOffset:r,focusNode:i,focusOffset:s}}function S8(n,e){if(e.getComposedRanges){let i=e.getComposedRanges(n.root)[0];if(i)return qb(n,i)}let t;function r(i){i.preventDefault(),i.stopImmediatePropagation(),t=i.getTargetRanges()[0]}return n.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),n.dom.removeEventListener("beforeinput",r,!0),t?qb(n,t):null}function k8(n,e){for(let t=e.parentNode;t&&t!=n.dom;t=t.parentNode){let r=n.docView.nearestDesc(t,!0);if(r&&r.node.isBlock)return t}return null}function v8(n,e){var t;let{focusNode:r,focusOffset:i}=n.domSelectionRange();for(let s of e)if(((t=s.parentNode)===null||t===void 0?void 0:t.nodeName)=="TR"){let o=s.nextSibling;for(;o&&o.nodeName!="TD"&&o.nodeName!="TH";)o=o.nextSibling;if(o){let a=o;for(;;){let l=a.firstChild;if(!l||!K(l)||l.contentEditable=="false"||/^(BR|IMG)$/.test(l.nodeName))break;a=l}a.insertBefore(s,a.firstChild),r==s&&n.domSelection().collapse(s,i)}else s.parentNode.removeChild(s)}}function w8(n,e,t,r){let{node:i,fromOffset:s,toOffset:o,from:a,to:l}=n.docView.parseRange(e,t),c=n.domSelectionRange(),d,h=c.anchorNode;if(h&&cs(n.dom,h)&&(d=[{node:h,offset:c.anchorOffset}],Pd(c)||d.push({node:c.focusNode,offset:c.focusOffset})),Pt&&n.input.lastKeyCode===8)for(let y=o;y>s;y--){let k=i.childNodes[y-1],x=k.pmViewDesc;if(k.nodeName=="BR"&&!x){o=y;break}if(!x||x.size)break}let f=n.state.doc,p=n.someProp("domParser")||ci.fromSchema(n.state.schema),m=f.resolve(a),O=null,b=p.parse(i,{topNode:m.parent,topMatch:m.parent.contentMatchAt(m.index()),topOpen:!0,from:s,to:o,preserveWhitespace:m.parent.type.whitespace=="pre"?"full":!0,findPositions:d,ruleFromNode:Q8(r),context:m});if(d&&d[0].pos!=null){let y=d[0].pos,k=d[1]&&d[1].pos;k==null&&(k=y),O={anchor:y+a,head:k+a}}return{doc:b,sel:O,from:a,to:l}}const Q8=n=>e=>{let t=e.pmViewDesc;if(t)return t.parseRule(n);if(e.nodeName=="BR"&&e.parentNode){if(Xt&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let r=document.createElement("div");return r.appendChild(document.createElement("li")),{skip:r}}else if(e.parentNode.lastChild==e||Xt&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if(e.nodeName=="IMG"&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null},$8=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function C8(n,e,t,r,i){let s=n.input.compositionPendingChanges||(n.composing?n.input.compositionID:0);if(n.input.compositionPendingChanges=0,e<0){let Q=n.input.lastSelectionTime>Date.now()-50?n.input.lastSelectionOrigin:null,P=bg(n,Q);if(P&&!n.state.selection.eq(P)){if(Pt&&Nr&&n.input.lastKeyCode===13&&Date.now()-100<n.input.lastKeyCodeTime&&n.someProp("handleKeyDown",C=>C(n,Di(13,"Enter"))))return;let T=n.state.tr.setSelection(P);Q=="pointer"?T.setMeta("pointer",!0):Q=="key"&&T.scrollIntoView(),s&&T.setMeta("composition",s),n.dispatch(T)}return}let o=n.state.doc.resolve(e),a=o.sharedDepth(t);e=o.before(a+1),t=n.state.doc.resolve(t).after(a+1);let l=n.state.selection,c=w8(n,e,t,i),d=n.state.doc,h=d.slice(c.from,c.to),f,p;n.input.lastKeyCode===8&&Date.now()-100<n.input.lastKeyCodeTime?(f=n.state.selection.to,p="end"):(f=n.state.selection.from,p="start"),n.input.lastKeyCode=null;let m=A8(h.content,c.doc.content,c.from,f,p);if(m&&n.input.domChangeCount++,(ao&&n.input.lastIOSEnter>Date.now()-225||Nr)&&i.some(Q=>K(Q)&&!$8.test(Q.nodeName))&&(!m||m.endA>=m.endB)&&n.someProp("handleKeyDown",Q=>Q(n,Di(13,"Enter")))){n.input.lastIOSEnter=0;return}if(!m)if(r&&l instanceof J&&!l.empty&&l.$head.sameParent(l.$anchor)&&!n.composing&&!(c.sel&&c.sel.anchor!=c.sel.head))m={start:l.from,endA:l.to,endB:l.to};else{if(c.sel){let Q=Yb(n,n.state.doc,c.sel);if(Q&&!Q.eq(n.state.selection)){let P=n.state.tr.setSelection(Q);s&&P.setMeta("composition",s),n.dispatch(P)}}return}n.state.selection.from<n.state.selection.to&&m.start==m.endB&&n.state.selection instanceof J&&(m.start>n.state.selection.from&&m.start<=n.state.selection.from+2&&n.state.selection.from>=c.from?m.start=n.state.selection.from:m.endA<n.state.selection.to&&m.endA>=n.state.selection.to-2&&n.state.selection.to<=c.to&&(m.endB+=n.state.selection.to-m.endA,m.endA=n.state.selection.to)),en&&ui<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>c.from&&c.doc.textBetween(m.start-c.from-1,m.start-c.from+1)==" "&&(m.start--,m.endA--,m.endB--);let O=c.doc.resolveNoCache(m.start-c.from),b=c.doc.resolveNoCache(m.endB-c.from),y=d.resolve(m.start),k=O.sameParent(b)&&O.parent.inlineContent&&y.end()>=m.endA;if((ao&&n.input.lastIOSEnter>Date.now()-225&&(!k||i.some(Q=>Q.nodeName=="DIV"||Q.nodeName=="P"))||!k&&M8(c.doc,O.pos,b.pos))&&n.someProp("handleKeyDown",Q=>Q(n,Di(13,"Enter")))){n.input.lastIOSEnter=0;return}if(n.state.selection.anchor>m.start&&T8(d,m.start,m.endA,O,b)&&n.someProp("handleKeyDown",Q=>Q(n,Di(8,"Backspace")))){Nr&&Pt&&n.domObserver.suppressSelectionUpdates();return}Pt&&m.endB==m.start&&(n.input.lastChromeDelete=Date.now()),Nr&&!k&&O.start()!=b.start()&&b.parentOffset==0&&O.depth==b.depth&&c.sel&&c.sel.anchor==c.sel.head&&c.sel.head==m.endA&&(m.endB-=2,b=c.doc.resolveNoCache(m.endB-c.from),setTimeout(()=>{n.someProp("handleKeyDown",function(Q){return Q(n,Di(13,"Enter"))})},20));let x=m.start,S=m.endA,v=Q=>{let P=Q||n.state.tr.replace(x,S,c.doc.slice(m.start-c.from,m.endB-c.from));if(c.sel){let T=Yb(n,P.doc,c.sel);T&&!(Pt&&n.composing&&T.empty&&(m.start!=m.endB||n.input.lastChromeDelete<Date.now()-100)&&(T.head==x||T.head==P.mapping.map(S)-1)||en&&T.empty&&T.head==x)&&P.setSelection(T)}return s&&P.setMeta("composition",s),P.scrollIntoView()},w;if(k)if(O.pos==b.pos){en&&ui<=11&&O.parentOffset==0&&(n.domObserver.suppressSelectionUpdates(),setTimeout(()=>_r(n),20));let Q=v(n.state.tr.delete(x,S)),P=d.resolve(m.start).marksAcross(d.resolve(m.endA));P&&Q.ensureMarks(P),n.dispatch(Q)}else if(m.endA==m.endB&&(w=P8(O.parent.content.cut(O.parentOffset,b.parentOffset),y.parent.content.cut(y.parentOffset,m.endA-y.start())))){let Q=v(n.state.tr);w.type=="add"?Q.addMark(x,S,w.mark):Q.removeMark(x,S,w.mark),n.dispatch(Q)}else if(O.parent.child(O.index()).isText&&O.index()==b.index()-(b.textOffset?0:1)){let Q=O.parent.textBetween(O.parentOffset,b.parentOffset),P=()=>v(n.state.tr.insertText(Q,x,S));n.someProp("handleTextInput",T=>T(n,x,S,Q,P))||n.dispatch(P())}else n.dispatch(v());else n.dispatch(v())}function Yb(n,e,t){return Math.max(t.anchor,t.head)>e.content.size?null:yg(n,e.resolve(t.anchor),e.resolve(t.head))}function P8(n,e){let t=n.firstChild.marks,r=e.firstChild.marks,i=t,s=r,o,a,l;for(let d=0;d<r.length;d++)i=r[d].removeFromSet(i);for(let d=0;d<t.length;d++)s=t[d].removeFromSet(s);if(i.length==1&&s.length==0)a=i[0],o="add",l=d=>d.mark(a.addToSet(d.marks));else if(i.length==0&&s.length==1)a=s[0],o="remove",l=d=>d.mark(a.removeFromSet(d.marks));else return null;let c=[];for(let d=0;d<e.childCount;d++)c.push(l(e.child(d)));if(E.from(c).eq(n))return{mark:a,type:o}}function T8(n,e,t,r,i){if(t-e<=i.pos-r.pos||qh(r,!0,!1)<i.pos)return!1;let s=n.resolve(e);if(!r.parent.isTextblock){let a=s.nodeAfter;return a!=null&&t==e+a.nodeSize}if(s.parentOffset<s.parent.content.size||!s.parent.isTextblock)return!1;let o=n.resolve(qh(s,!0,!0));return!o.parent.isTextblock||o.pos>t||qh(o,!0,!1)<t?!1:r.parent.content.cut(r.parentOffset).eq(o.parent.content)}function M8(n,e,t){let r=0,i=0;return n.nodesBetween(e,t,(s,o)=>{s.isTextblock&&o>=e&&o<t?r++:(s.isText?/\S/.test(s.text.slice(Math.max(0,e-o),Math.min(s.nodeSize,t-o))):s.isLeaf)&&i++}),i==0&&r==1}function qh(n,e,t){let r=n.depth,i=e?n.end():n.pos;for(;r>0&&(e||n.indexAfter(r)==n.node(r).childCount);)r--,i++,e=!1;if(t){let s=n.node(r).maybeChild(n.indexAfter(r));for(;s&&!s.isLeaf;)s=s.firstChild,i++}return i}function A8(n,e,t,r,i){let s=n.findDiffStart(e,t),o=t+n.size,a=t+e.size;if(s==null)return null;let{a:l,b:c}=n.findDiffEnd(e,o,a);if(i=="end"){let d=Math.max(0,s-Math.min(l,c));r-=l+d-s}if(l<s&&o<a){let d=r<=s&&r>=l?s-r:0;s-=d,c=s+(c-l),l=s}else if(c<s){let d=r<=s&&r>=c?s-r:0;s-=d,l=s+(l-c),c=s}return{start:s,endA:l,endB:c}}class rQ{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new FL,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(Jb),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=Hb(this),Gb(this),this.nodeViews=Kb(this),this.docView=Ab(this.state.doc,Ub(this),Fh(this),this.dom,this),this.domObserver=new y8(this,(r,i,s,o)=>C8(this,r,i,s,o)),this.domObserver.start(),qL(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Dp(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Jb),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let r in this._props)t[r]=this._props[r];t.state=this.state;for(let r in e)t[r]=e[r];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){var r;let i=this.state,s=!1,o=!1;e.storedMarks&&this.composing&&(G2(this),o=!0),this.state=e;let a=i.plugins!=e.plugins||this._props.plugins!=t.plugins;if(a||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let p=Kb(this);E8(p,this.nodeViews)&&(this.nodeViews=p,s=!0)}(a||t.handleDOMEvents!=this._props.handleDOMEvents)&&Dp(this),this.editable=Hb(this),Gb(this);let l=Fh(this),c=Ub(this),d=i.plugins!=e.plugins&&!i.doc.eq(e.doc)?"reset":e.scrollToSelection>i.scrollToSelection?"to selection":"preserve",h=s||!this.docView.matchesNode(e.doc,c,l);(h||!e.selection.eq(i.selection))&&(o=!0);let f=d=="preserve"&&o&&this.dom.style.overflowAnchor==null&&aL(this);if(o){this.domObserver.stop();let p=h&&(en||Pt)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&R8(i.selection,e.selection);if(h){let O=Pt?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=l8(this)),(s||!this.docView.update(e.doc,c,l,this))&&(this.docView.updateOuterDeco(c),this.docView.destroy(),this.docView=Ab(e.doc,c,l,this.dom,this)),O&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(p=!0)}let m=this.input.mouseDown;p||!(m&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&AL(this)&&m.delaySelUpdate())?_r(this,p):(j2(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((r=this.dragging)===null||r===void 0)&&r.node&&!i.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,i),d=="reset"?this.dom.scrollTop=0:d=="to selection"?this.scrollToSelection():f&&lL(f)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!cs(this.dom,e))){if(!this.someProp("handleScrollToSelection",t=>t(this)))if(this.state.selection instanceof ee){let t=this.docView.domAfterPos(this.state.selection.from);K(t)&&$b(this,t.getBoundingClientRect(),e)}else $b(this,this.coordsAtPos(this.state.selection.head,1),e)}}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let t=0;t<this.directPlugins.length;t++){let r=this.directPlugins[t];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let t=0;t<this.state.plugins.length;t++){let r=this.state.plugins[t];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let t=0;t<this.pluginViews.length;t++){let r=this.pluginViews[t];r.update&&r.update(this,e)}}updateDraggedNode(e,t){let r=e.node,i=-1;if(r.from<this.state.doc.content.size&&this.state.doc.nodeAt(r.from)==r.node)i=r.from;else{let s=r.from+(this.state.doc.content.size-t.doc.content.size);(s>0&&s<this.state.doc.content.size&&this.state.doc.nodeAt(s))==r.node&&(i=s)}this.dragging=new K2(e.slice,e.move,i<0?void 0:ee.create(this.state.doc,i))}someProp(e,t){let r=this._props&&this._props[e],i;if(r!=null&&(i=t?t(r):r))return i;for(let o=0;o<this.directPlugins.length;o++){let a=this.directPlugins[o].props[e];if(a!=null&&(i=t?t(a):a))return i}let s=this.state.plugins;if(s)for(let o=0;o<s.length;o++){let a=s[o].props[e];if(a!=null&&(i=t?t(a):a))return i}}hasFocus(){if(en){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable=="false")return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&cL(this.dom),_r(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let t=this.dom.parentNode;t;t=t.parentNode)if(t.nodeType==9||t.nodeType==11&&t.host)return t.getSelection||(Object.getPrototypeOf(t).getSelection=()=>t.ownerDocument.getSelection()),this._root=t}return e||document}updateRoot(){this._root=null}posAtCoords(e){return pL(this,e)}coordsAtPos(e,t=1){return P2(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,r=-1){let i=this.docView.posFromDOM(e,t,r);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,t){return yL(this,t||this.state,e)}pasteHTML(e,t){return Ha(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return Ha(this,e,null,!0,t||new ClipboardEvent("paste"))}serializeForClipboard(e){return xg(this,e)}destroy(){this.docView&&(YL(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Fh(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,H7())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return GL(this,e)}domSelectionRange(){let e=this.dom.isConnected!==!1&&this.domSelection();return e?Xt&&this.root.nodeType===11&&nL(this.dom.ownerDocument)==this.dom&&S8(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}rQ.prototype.dispatch=function(n){let e=this._props.dispatchTransaction;e?e.call(this,n):this.updateState(this.state.apply(n))};function Ub(n){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(n.editable),n.someProp("attributes",t=>{if(typeof t=="function"&&(t=t(n.state)),t)for(let r in t)r=="class"?e.class+=" "+t[r]:r=="style"?e.style=(e.style?e.style+";":"")+t[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(t[r]))}),e.translate||(e.translate="no"),[jt.node(0,n.state.doc.content.size,e)]}function Gb(n){if(n.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),n.cursorWrapper={dom:e,deco:jt.widget(n.state.selection.from,e,{raw:!0,marks:n.markCursor})}}else n.cursorWrapper=null}function Hb(n){return!n.someProp("editable",e=>e(n.state)===!1)}function R8(n,e){let t=Math.min(n.$anchor.sharedDepth(n.head),e.$anchor.sharedDepth(e.head));return n.$anchor.start(t)!=e.$anchor.start(t)}function Kb(n){let e=Object.create(null);function t(r){for(let i in r)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=r[i])}return n.someProp("nodeViews",t),n.someProp("markViews",t),e}function E8(n,e){let t=0,r=0;for(let i in n){if(n[i]!=e[i])return!0;t++}for(let i in e)r++;return t!=r}function Jb(n){if(n.spec.state||n.spec.filterTransaction||n.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}const N8=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),D8=typeof navigator<"u"&&/Win/.test(navigator.platform);function j8(n){let e=n.split(/-(?!$)/),t=e[e.length-1];t=="Space"&&(t=" ");let r,i,s,o;for(let a=0;a<e.length-1;a++){let l=e[a];if(/^(cmd|meta|m)$/i.test(l))o=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))i=!0;else if(/^s(hift)?$/i.test(l))s=!0;else if(/^mod$/i.test(l))N8?o=!0:i=!0;else throw new Error("Unrecognized modifier name: "+l)}return r&&(t="Alt-"+t),i&&(t="Ctrl-"+t),o&&(t="Meta-"+t),s&&(t="Shift-"+t),t}function I8(n){let e=Object.create(null);for(let t in n)e[j8(t)]=n[t];return e}function Yh(n,e,t=!0){return e.altKey&&(n="Alt-"+n),e.ctrlKey&&(n="Ctrl-"+n),e.metaKey&&(n="Meta-"+n),t&&e.shiftKey&&(n="Shift-"+n),n}function X8(n){return new Ee({props:{handleKeyDown:iQ(n)}})}function iQ(n){let e=I8(n);return function(t,r){let i=fS(r),s,o=e[Yh(i,r)];if(o&&o(t.state,t.dispatch,t))return!0;if(i.length==1&&i!=" "){if(r.shiftKey){let a=e[Yh(i,r,!1)];if(a&&a(t.state,t.dispatch,t))return!0}if((r.altKey||r.metaKey||r.ctrlKey)&&!(D8&&r.ctrlKey&&r.altKey)&&(s=Zr[r.keyCode])&&s!=i){let a=e[Yh(s,r)];if(a&&a(t.state,t.dispatch,t))return!0}}return!1}}var vu=200,St=function(){};St.prototype.append=function(e){return e.length?(e=St.from(e),!this.length&&e||e.length<vu&&this.leafAppend(e)||this.length<vu&&e.leafPrepend(this)||this.appendInner(e)):this};St.prototype.prepend=function(e){return e.length?St.from(e).append(this):this};St.prototype.appendInner=function(e){return new L8(this,e)};St.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?St.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))};St.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};St.prototype.forEach=function(e,t,r){t===void 0&&(t=0),r===void 0&&(r=this.length),t<=r?this.forEachInner(e,t,r,0):this.forEachInvertedInner(e,t,r,0)};St.prototype.map=function(e,t,r){t===void 0&&(t=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(s,o){return i.push(e(s,o))},t,r),i};St.from=function(e){return e instanceof St?e:e&&e.length?new sQ(e):St.empty};var sQ=(function(n){function e(r){n.call(this),this.values=r}n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e;var t={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,s){return i==0&&s==this.length?this:new e(this.values.slice(i,s))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,s,o,a){for(var l=s;l<o;l++)if(i(this.values[l],a+l)===!1)return!1},e.prototype.forEachInvertedInner=function(i,s,o,a){for(var l=s-1;l>=o;l--)if(i(this.values[l],a+l)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=vu)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=vu)return new e(i.flatten().concat(this.values))},t.length.get=function(){return this.values.length},t.depth.get=function(){return 0},Object.defineProperties(e.prototype,t),e})(St);St.empty=new sQ([]);var L8=(function(n){function e(t,r){n.call(this),this.left=t,this.right=r,this.length=t.length+r.length,this.depth=Math.max(t.depth,r.depth)+1}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},e.prototype.forEachInner=function(r,i,s,o){var a=this.left.length;if(i<a&&this.left.forEachInner(r,i,Math.min(s,a),o)===!1||s>a&&this.right.forEachInner(r,Math.max(i-a,0),Math.min(this.length,s)-a,o+a)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,s,o){var a=this.left.length;if(i>a&&this.right.forEachInvertedInner(r,i-a,Math.max(s,a)-a,o+a)===!1||s<a&&this.left.forEachInvertedInner(r,Math.min(i,a),s,o)===!1)return!1},e.prototype.sliceInner=function(r,i){if(r==0&&i==this.length)return this;var s=this.left.length;return i<=s?this.left.slice(r,i):r>=s?this.right.slice(r-s,i-s):this.left.slice(r,s).append(this.right.slice(0,i-s))},e.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new e(i,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e})(St);const _8=500;class Xn{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,s;t&&(i=this.remapping(r,this.items.length),s=i.maps.length);let o=e.tr,a,l,c=[],d=[];return this.items.forEach((h,f)=>{if(!h.step){i||(i=this.remapping(r,f+1),s=i.maps.length),s--,d.push(h);return}if(i){d.push(new er(h.map));let p=h.step.map(i.slice(s)),m;p&&o.maybeStep(p).doc&&(m=o.mapping.maps[o.mapping.maps.length-1],c.push(new er(m,void 0,void 0,c.length+d.length))),s--,m&&i.appendMap(m,s)}else o.maybeStep(h.step);if(h.selection)return a=i?h.selection.map(i.slice(s)):h.selection,l=new Xn(this.items.slice(0,r).append(d.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:o,selection:a}}addTransform(e,t,r,i){let s=[],o=this.eventCount,a=this.items,l=!i&&a.length?a.get(a.length-1):null;for(let d=0;d<e.steps.length;d++){let h=e.steps[d].invert(e.docs[d]),f=new er(e.mapping.maps[d],h,t),p;(p=l&&l.merge(f))&&(f=p,d?s.pop():a=a.slice(0,a.length-1)),s.push(f),t&&(o++,t=void 0),i||(l=f)}let c=o-r.depth;return c>Z8&&(a=B8(a,c),o-=c),new Xn(a.append(s),o)}remapping(e,t){let r=new Ya;return this.items.forEach((i,s)=>{let o=i.mirrorOffset!=null&&s-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,o)},e,t),r}addMaps(e){return this.eventCount==0?this:new Xn(this.items.append(e.map(t=>new er(t))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;t=Math.min(this.items.length,t);let r=[],i=this.items.length-t,s=e.mapping,o=e.steps.length,a=this.eventCount;this.items.forEach(f=>{f.selection&&a--},i);let l=t;this.items.forEach(f=>{let p=s.getMirror(--l);if(p==null)return;o=Math.min(o,p);let m=s.maps[p];if(f.step){let O=e.steps[p].invert(e.docs[p]),b=f.selection&&f.selection.map(s.slice(l+1,p));b&&a++,r.push(new er(m,O,b))}else r.push(new er(m))},i);let c=[];for(let f=t;f<o;f++)c.push(new er(s.maps[f]));let d=this.items.slice(0,i).append(c).append(r),h=new Xn(d,a);return h.emptyItemCount()>_8&&(h=h.compress(this.items.length-r.length)),h}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),r=t.maps.length,i=[],s=0;return this.items.forEach((o,a)=>{if(a>=e)i.push(o),o.selection&&s++;else if(o.step){let l=o.step.map(t.slice(r)),c=l&&l.getMap();if(r--,c&&t.appendMap(c,r),l){let d=o.selection&&o.selection.map(t.slice(r));d&&s++;let h=new er(c.invert(),l,d),f,p=i.length-1;(f=i.length&&i[p].merge(h))?i[p]=f:i.push(h)}}else o.map&&r--},this.items.length,0),new Xn(St.from(i.reverse()),s)}}Xn.empty=new Xn(St.empty,0);function B8(n,e){let t;return n.forEach((r,i)=>{if(r.selection&&e--==0)return t=i,!1}),n.slice(t)}class er{constructor(e,t,r,i){this.map=e,this.step=t,this.selection=r,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new er(t.getMap().invert(),t,this.selection)}}}class ei{constructor(e,t,r,i,s){this.done=e,this.undone=t,this.prevRanges=r,this.prevTime=i,this.prevComposition=s}}const Z8=20;function W8(n,e,t,r){let i=t.getMeta(pi),s;if(i)return i.historyState;t.getMeta(oQ)&&(n=new ei(n.done,n.undone,null,0,-1));let o=t.getMeta("appendedTransaction");if(t.steps.length==0)return n;if(o&&o.getMeta(pi))return o.getMeta(pi).redo?new ei(n.done.addTransform(t,void 0,r,Nc(e)),n.undone,ey(t.mapping.maps),n.prevTime,n.prevComposition):new ei(n.done,n.undone.addTransform(t,void 0,r,Nc(e)),null,n.prevTime,n.prevComposition);if(t.getMeta("addToHistory")!==!1&&!(o&&o.getMeta("addToHistory")===!1)){let a=t.getMeta("composition"),l=n.prevTime==0||!o&&n.prevComposition!=a&&(n.prevTime<(t.time||0)-r.newGroupDelay||!z8(t,n.prevRanges)),c=o?Uh(n.prevRanges,t.mapping):ey(t.mapping.maps);return new ei(n.done.addTransform(t,l?e.selection.getBookmark():void 0,r,Nc(e)),Xn.empty,c,t.time,a??n.prevComposition)}else return(s=t.getMeta("rebased"))?new ei(n.done.rebased(t,s),n.undone.rebased(t,s),Uh(n.prevRanges,t.mapping),n.prevTime,n.prevComposition):new ei(n.done.addMaps(t.mapping.maps),n.undone.addMaps(t.mapping.maps),Uh(n.prevRanges,t.mapping),n.prevTime,n.prevComposition)}function z8(n,e){if(!e)return!1;if(!n.docChanged)return!0;let t=!1;return n.mapping.maps[0].forEach((r,i)=>{for(let s=0;s<e.length;s+=2)r<=e[s+1]&&i>=e[s]&&(t=!0)}),t}function ey(n){let e=[];for(let t=n.length-1;t>=0&&e.length==0;t--)n[t].forEach((r,i,s,o)=>e.push(s,o));return e}function Uh(n,e){if(!n)return null;let t=[];for(let r=0;r<n.length;r+=2){let i=e.map(n[r],1),s=e.map(n[r+1],-1);i<=s&&t.push(i,s)}return t}function V8(n,e,t){let r=Nc(e),i=pi.get(e).spec.config,s=(t?n.undone:n.done).popEvent(e,r);if(!s)return null;let o=s.selection.resolve(s.transform.doc),a=(t?n.done:n.undone).addTransform(s.transform,e.selection.getBookmark(),i,r),l=new ei(t?a:s.remaining,t?s.remaining:a,null,0,-1);return s.transform.setSelection(o).setMeta(pi,{redo:t,historyState:l})}let Gh=!1,ty=null;function Nc(n){let e=n.plugins;if(ty!=e){Gh=!1,ty=e;for(let t=0;t<e.length;t++)if(e[t].spec.historyPreserveItems){Gh=!0;break}}return Gh}function F8(n){return n.setMeta(oQ,!0)}const pi=new et("history"),oQ=new et("closeHistory");function q8(n={}){return n={depth:n.depth||100,newGroupDelay:n.newGroupDelay||500},new Ee({key:pi,state:{init(){return new ei(Xn.empty,Xn.empty,null,0,-1)},apply(e,t,r){return W8(t,r,e,n)}},config:n,props:{handleDOMEvents:{beforeinput(e,t){let r=t.inputType,i=r=="historyUndo"?lQ:r=="historyRedo"?cQ:null;return!i||!e.editable?!1:(t.preventDefault(),i(e.state,e.dispatch))}}}})}function aQ(n,e){return(t,r)=>{let i=pi.getState(t);if(!i||(n?i.undone:i.done).eventCount==0)return!1;if(r){let s=V8(i,t,n);s&&r(e?s.scrollIntoView():s)}return!0}}const lQ=aQ(!1,!0),cQ=aQ(!0,!0);function Y8(n){return n.getMeta(pi)!=null}function Ad(n){const{state:e,transaction:t}=n;let{selection:r}=t,{doc:i}=t,{storedMarks:s}=t;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return s},get selection(){return r},get doc(){return i},get tr(){return r=t.selection,i=t.doc,s=t.storedMarks,t}}}var Vs=class uQ{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:t,state:r}=this,{view:i}=t,{tr:s}=r,o=this.buildProps(s);return Object.fromEntries(Object.entries(e).map(([a,l])=>[a,(...d)=>{const h=l(...d)(o);return!s.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(s),h}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){const{rawCommands:r,editor:i,state:s}=this,{view:o}=i,a=[],l=!!e,c=e||s.tr,d=()=>(!l&&t&&!c.getMeta("preventDispatch")&&!this.hasCustomState&&o.dispatch(c),a.every(f=>f===!0)),h={...Object.fromEntries(Object.entries(r).map(([f,p])=>[f,(...O)=>{const b=this.buildProps(c,t),y=p(...O)(b);return a.push(y),h}])),run:d};return h}static createFakeChain(){const e=new Proxy({},{get:(t,r)=>{if(r!=="then")return r==="run"?()=>!1:()=>e}});return e}createCan(e){const{rawCommands:t,state:r}=this,i=!1,s=e||r.tr,o=this.buildProps(s,i);return{...Object.fromEntries(Object.entries(t).map(([a,l])=>[a,(...c)=>l(...c)({...o,dispatch:void 0})])),chain:()=>this.createChain(s,i)}}static createFallbackCan(){const e=uQ.createFakeChain();return new Proxy({chain:()=>e},{get:(t,r)=>{if(r!=="then")return r==="chain"?t.chain:()=>!1}})}buildProps(e,t=!0){const{rawCommands:r,editor:i,state:s}=this,{view:o}=i,a={tr:e,editor:i,view:o,state:Ad({state:s,transaction:e}),dispatch:t?()=>{}:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(r).map(([l,c])=>[l,(...d)=>c(...d)(a)]))}};return a}};const U8=()=>({editor:n,view:e})=>(requestAnimationFrame(()=>{if(!n.isDestroyed){var t;e.dom.blur(),(t=window)===null||t===void 0||(t=t.getSelection())===null||t===void 0||t.removeAllRanges()}}),!0),G8=(n=!0)=>({commands:e})=>e.setContent("",{emitUpdate:n}),H8=()=>({state:n,tr:e,dispatch:t})=>{const{selection:r}=e,{ranges:i}=r;return t&&i.forEach(({$from:s,$to:o})=>{n.doc.nodesBetween(s.pos,o.pos,(a,l)=>{if(a.type.isText)return;const{doc:c,mapping:d}=e,h=c.resolve(d.map(l)),f=c.resolve(d.map(l+a.nodeSize)),p=h.blockRange(f);if(!p)return;const m=yo(p);if(a.type.isTextblock){const{defaultType:O}=h.parent.contentMatchAt(h.index());e.setNodeMarkup(p.start,O)}(m||m===0)&&e.lift(p,m)})}),!0},K8=n=>e=>n(e),J8=()=>({state:n,dispatch:e})=>O2(n,e),e_=(n,e)=>({editor:t,tr:r})=>{const{state:i}=t,s=i.doc.slice(n.from,n.to);r.deleteRange(n.from,n.to);const o=r.mapping.map(e);return r.insert(o,s.content),r.setSelection(new J(r.doc.resolve(Math.max(o-1,0)))),!0},t_=()=>({tr:n,dispatch:e})=>{const{selection:t}=n,r=t.$anchor.node();if(r.content.size>0)return!1;const i=n.selection.$anchor;for(let s=i.depth;s>0;s-=1)if(i.node(s).type===r.type){if(e){const o=i.before(s),a=i.after(s);n.delete(o,a).scrollIntoView()}return!0}return!1};function mt(n,e){if(typeof n=="string"){if(!e.nodes[n])throw Error(`There is no node type named '${n}'. Maybe you forgot to add the extension?`);return e.nodes[n]}return n}const n_=n=>({tr:e,state:t,dispatch:r})=>{const i=mt(n,t.schema),s=e.selection.$anchor;for(let o=s.depth;o>0;o-=1)if(s.node(o).type===i){if(r){const a=s.before(o),l=s.after(o);e.delete(a,l).scrollIntoView()}return!0}return!1},r_=n=>({tr:e,dispatch:t})=>{const{from:r,to:i}=n;return t&&e.delete(r,i),!0},i_=n=>n.content?/^text(\*|\+)/.test(n.content):!1,ny=(n,e,t)=>{if(!n.parent.isInline||t==="left"&&n.pos>n.start()||t==="right"&&n.pos<n.end())return n.pos;const r=e.nodes[n.parent.type.name].spec;return i_(r)?t==="left"?n.start()-1:n.end()+1:n.pos},s_=(n,e,t)=>({from:ny(n,t,"left"),to:ny(e,t,"right")}),o_=()=>({state:n,dispatch:e})=>{if(n.selection.empty)return!1;if(e){const t=n.tr,{ranges:r}=n.selection,i=t.steps.length;r.forEach(s=>{const o=t.mapping.slice(i),a=t.doc.resolve(o.map(s.$from.pos)),l=t.doc.resolve(o.map(s.$to.pos)),{from:c,to:d}=s_(a,l,n.schema);t.deleteRange(c,d)}),t.selection.empty||t.setSelection(J.near(t.doc.resolve(t.selection.from))),t.scrollIntoView(),e(t)}return!0},a_=()=>({commands:n})=>n.keyboardShortcut("Enter"),l_=()=>({state:n,dispatch:e})=>j7(n,e);function $g(n){return Object.prototype.toString.call(n)==="[object RegExp]"}function wu(n,e,t={strict:!0}){const r=Object.keys(e);return r.length?r.every(i=>t.strict?e[i]===n[i]:$g(e[i])?e[i].test(n[i]):e[i]===n[i]):!0}function dQ(n,e,t={}){return n.find(r=>r.type===e&&wu(Object.fromEntries(Object.keys(t).map(i=>[i,r.attrs[i]])),t))}function ry(n,e,t={}){return!!dQ(n,e,t)}function Cg(n,e,t){if(!n||!e)return;let r=n.parent.childAfter(n.parentOffset);if((!r.node||!r.node.marks.some(l=>l.type===e))&&(r=n.parent.childBefore(n.parentOffset)),!r.node||!r.node.marks.some(l=>l.type===e))return;if(!t){const l=r.node.marks.find(c=>c.type===e);l&&(t=l.attrs)}if(!dQ([...r.node.marks],e,t))return;let i=r.index,s=n.start()+r.offset,o=i+1,a=s+r.node.nodeSize;for(;i>0&&ry([...n.parent.child(i-1).marks],e,t);)i-=1,s-=n.parent.child(i).nodeSize;for(;o<n.parent.childCount&&ry([...n.parent.child(o).marks],e,t);)a+=n.parent.child(o).nodeSize,o+=1;return{from:s,to:a}}function qr(n,e){if(typeof n=="string"){if(!e.marks[n])throw Error(`There is no mark type named '${n}'. Maybe you forgot to add the extension?`);return e.marks[n]}return n}const c_=(n,e)=>({tr:t,state:r,dispatch:i})=>{const s=qr(n,r.schema),{doc:o,selection:a}=t,{$from:l,from:c,to:d}=a;if(i){const h=Cg(l,s,e);if(h&&h.from<=c&&h.to>=d){const f=J.create(o,h.from,h.to);t.setSelection(f)}}return!0},u_=n=>e=>{const t=typeof n=="function"?n(e):n;for(let r=0;r<t.length;r+=1)if(t[r](e))return!0;return!1};function hQ(n){return n instanceof J}function _i(n=0,e=0,t=0){return Math.min(Math.max(n,e),t)}function jp(n,e=null){if(!e)return null;const t=ue.atStart(n),r=ue.atEnd(n);if(e==="start"||e===!0)return t;if(e==="end")return r;const i=t.from,s=r.to;return e==="all"?J.create(n,_i(0,i,s),_i(n.content.size,i,s)):J.create(n,_i(e,i,s),_i(e,i,s))}function Ip(){return["Android"].includes(navigator.platform)||/android/i.test(navigator.userAgent)}function Ja(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function d_(){return typeof navigator<"u"?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}const h_=(n=null,e={})=>({editor:t,view:r,tr:i,dispatch:s})=>{e={scrollIntoView:!0,...e};const o=()=>{(Ja()||Ip())&&r.dom.focus(),d_()&&!Ja()&&!Ip()&&r.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{t.isDestroyed||(r.focus(),e?.scrollIntoView&&t.commands.scrollIntoView())})};try{if(r.hasFocus()&&n===null||n===!1)return!0}catch{return!1}if(s&&n===null&&!hQ(t.state.selection))return o(),!0;const a=jp(i.doc,n)||t.state.selection,l=t.state.selection.eq(a);return s&&(l||i.setSelection(a),l&&i.storedMarks&&i.setStoredMarks(i.storedMarks),o()),!0},f_=(n,e)=>t=>n.every((r,i)=>e(r,{...t,index:i})),p_=(n,e)=>({tr:t,commands:r})=>r.insertContentAt({from:t.selection.from,to:t.selection.to},n,e),fQ=n=>{const e=n.childNodes;for(let t=e.length-1;t>=0;t-=1){const r=e[t];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?n.removeChild(r):r.nodeType===1&&fQ(r)}return n};function ec(n){if(typeof window>"u")throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");const e=`<body>${n}</body>`,t=new window.DOMParser().parseFromString(e,"text/html").body;return fQ(t)}function pQ(n){return typeof n?.nodesBetween=="function"}function lo(n,e,t){if(pQ(n))return n;const r=typeof n=="object"&&n!==null;t={slice:!0,parseOptions:{},...t};const i=typeof n=="string";if(r)try{if(Array.isArray(n)&&n.length>0)return E.fromArray(n.map(o=>e.nodeFromJSON(o)));const s=e.nodeFromJSON(n);return t.errorOnInvalidContent&&s.check(),s}catch(s){if(t.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:s});return console.warn("[tiptap warn]: Invalid content.","Passed value:",n,"Error:",s),lo("",e,t)}if(i){if(t.errorOnInvalidContent){let o=!1,a="";const l=new Ac({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:c=>(o=!0,a=typeof c=="string"?c:c.outerHTML,null)}]}})});if(t.slice?ci.fromSchema(l).parseSlice(ec(n),t.parseOptions):ci.fromSchema(l).parse(ec(n),t.parseOptions),t.errorOnInvalidContent&&o)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${a}`)})}const s=ci.fromSchema(e);return t.slice?s.parseSlice(ec(n),t.parseOptions).content:s.parse(ec(n),t.parseOptions)}return lo("",e,t)}function mQ(n){return!("type"in n)}function gQ(n,e,t){const r=n.steps.length-1;if(r<e)return;const i=n.steps[r];if(!(i instanceof rt||i instanceof xt))return;const s=n.mapping.maps[r];let o=0;s.forEach((a,l,c,d)=>{o===0&&(o=d)}),n.setSelection(ue.near(n.doc.resolve(o),t))}const m_=(n,e,t)=>({tr:r,dispatch:i,editor:s})=>{if(i){t={parseOptions:s.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...t};let a;const l=b=>{s.emit("contentError",{editor:s,error:b,disableCollaboration:()=>{"collaboration"in s.storage&&typeof s.storage.collaboration=="object"&&s.storage.collaboration&&(s.storage.collaboration.isDisabled=!0)}})},c={preserveWhitespace:"full",...t.parseOptions};if(!t.errorOnInvalidContent&&!s.options.enableContentCheck&&s.options.emitContentError)try{lo(e,s.schema,{parseOptions:c,errorOnInvalidContent:!0})}catch(b){l(b)}try{var o;a=lo(e,s.schema,{parseOptions:c,errorOnInvalidContent:(o=t.errorOnInvalidContent)!==null&&o!==void 0?o:s.options.enableContentCheck})}catch(b){return l(b),!1}let{from:d,to:h}=typeof n=="number"?{from:n,to:n}:{from:n.from,to:n.to},f=!0,p=!0;const m=mQ(a)?a.content:[a];if(m.forEach(b=>{b.check(),f=f?b.isText&&b.marks.length===0:!1,p=p?b.isBlock:!1}),d===h&&p){const{parent:b}=r.doc.resolve(d);b.isTextblock&&!b.type.spec.code&&!b.childCount&&(d-=1,h+=1)}let O;if(f)Array.isArray(e)?O=e.map(b=>b.text||"").join(""):pQ(e)?O=m.map(b=>{var y;return(y=b.text)!==null&&y!==void 0?y:""}).join(""):typeof e=="object"&&e&&e.text?O=e.text:O=e,r.insertText(O,d,h);else{O=E.from(m);const b=r.doc.resolve(d),y=b.node(),k=b.parentOffset===0,x=y.isText||y.isTextblock,S=y.content.size>0;k&&x&&S&&p&&(d=Math.max(0,d-1)),r.replaceWith(d,h,m)}t.updateSelection&&gQ(r,r.steps.length-1,-1),t.applyInputRules&&r.setMeta("applyInputRules",{from:d,text:O}),t.applyPasteRules&&r.setMeta("applyPasteRules",{from:d,text:O})}return!0};function OQ(n){for(let e=0;e<n.edgeCount;e+=1){const{type:t}=n.edge(e);if(t.isTextblock&&!t.hasRequiredAttrs())return t}return null}const g_=(n={})=>({tr:e,dispatch:t,editor:r})=>{const{pos:i,attrs:s,content:o,updateSelection:a=!0}=n;let l;typeof i=="number"?l=e.doc.resolve(i):i?l=i:l=e.selection.$from;const c=OQ(l.parent.contentMatchAt(l.index()));if(!c)return!1;const d=Object.keys(c.spec.attrs||{}),h=s?Object.fromEntries(Object.entries(s).filter(([p])=>d.includes(p))):{};let f;if(o){const p=lo(o,r.schema);f=c.createAndFill(h,p)}else f=c.createAndFill(h);return f?(t&&(e.insert(l.pos,f),a&&gQ(e,e.steps.length-1,-1)),!0):!1},O_=()=>({state:n,dispatch:e})=>E7(n,e),b_=()=>({state:n,dispatch:e})=>N7(n,e),y_=()=>({state:n,dispatch:e})=>u2(n,e),x_=()=>({state:n,dispatch:e})=>p2(n,e),bQ=(n,e)=>{const t=n.resolve(e),r=t.nodeBefore,i=t.nodeAfter;return!r||!i?!1:!r.type.spec.isolating&&!i.type.spec.isolating},S_=()=>({state:n,dispatch:e,tr:t})=>{try{const r=Qd(n.doc,n.selection.$from.pos,-1);return r==null||!bQ(n.doc,r)?!1:(t.join(r,2),e&&e(t),!0)}catch{return!1}},k_=()=>({state:n,dispatch:e,tr:t})=>{try{const r=Qd(n.doc,n.selection.$from.pos,1);return r==null||!bQ(n.doc,r)?!1:(t.join(r,2),e&&e(t),!0)}catch{return!1}},v_=()=>({state:n,dispatch:e})=>A7(n,e),w_=()=>({state:n,dispatch:e})=>R7(n,e);function yQ(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function Q_(n){const e=n.split(/-(?!$)/);let t=e[e.length-1];t==="Space"&&(t=" ");let r,i,s,o;for(let a=0;a<e.length-1;a+=1){const l=e[a];if(/^(cmd|meta|m)$/i.test(l))o=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))i=!0;else if(/^s(hift)?$/i.test(l))s=!0;else if(/^mod$/i.test(l))Ja()||yQ()?o=!0:i=!0;else throw new Error(`Unrecognized modifier name: ${l}`)}return r&&(t=`Alt-${t}`),i&&(t=`Ctrl-${t}`),o&&(t=`Meta-${t}`),s&&(t=`Shift-${t}`),t}const $_=n=>({editor:e,view:t,tr:r,dispatch:i})=>{const s=Q_(n).split(/-(?!$)/),o=s.find(c=>!["Alt","Ctrl","Meta","Shift"].includes(c)),a=new KeyboardEvent("keydown",{key:o==="Space"?" ":o,altKey:s.includes("Alt"),ctrlKey:s.includes("Ctrl"),metaKey:s.includes("Meta"),shiftKey:s.includes("Shift"),bubbles:!0,cancelable:!0}),l=e.captureTransaction(()=>{t.someProp("handleKeyDown",c=>c(t,a))});return l?.steps.forEach(c=>{const d=c.map(r.mapping);d&&i&&r.maybeStep(d)}),!0};function Vr(n,e,t={}){const{from:r,to:i,empty:s}=n.selection,o=e?mt(e,n.schema):null,a=[];n.doc.nodesBetween(r,i,(d,h)=>{if(d.isText)return;const f=Math.max(r,h),p=Math.min(i,h+d.nodeSize);a.push({node:d,from:f,to:p})});const l=i-r,c=a.filter(d=>o?o.name===d.node.type.name:!0).filter(d=>wu(d.node.attrs,t,{strict:!1}));return s?!!c.length:c.reduce((d,h)=>d+h.to-h.from,0)>=l}const C_=(n,e={})=>({state:t,dispatch:r})=>Vr(t,mt(n,t.schema),e)?D7(t,r):!1,P_=()=>({state:n,dispatch:e})=>b2(n,e),T_=n=>({state:e,dispatch:t})=>{const r=mt(n,e.schema);return q7(r)(e,t)},M_=()=>({state:n,dispatch:e})=>g2(n,e);function Rd(n,e){return e.nodes[n]?"node":e.marks[n]?"mark":null}function iy(n,e){const t=typeof e=="string"?[e]:e;return Object.keys(n).reduce((r,i)=>(t.includes(i)||(r[i]=n[i]),r),{})}const A_=(n,e)=>({tr:t,state:r,dispatch:i})=>{let s=null,o=null;const a=Rd(typeof n=="string"?n:n.name,r.schema);if(!a)return!1;a==="node"&&(s=mt(n,r.schema)),a==="mark"&&(o=qr(n,r.schema));let l=!1;return t.selection.ranges.forEach(c=>{r.doc.nodesBetween(c.$from.pos,c.$to.pos,(d,h)=>{s&&s===d.type&&(l=!0,i&&t.setNodeMarkup(h,void 0,iy(d.attrs,e))),o&&d.marks.length&&d.marks.forEach(f=>{o===f.type&&(l=!0,i&&t.addMark(h,h+d.nodeSize,o.create(iy(f.attrs,e))))})})}),l},R_=()=>({tr:n,dispatch:e})=>(e&&n.scrollIntoView(),!0),E_=()=>({tr:n,dispatch:e})=>{if(e){const t=new pn(n.doc);n.setSelection(t)}return!0},N_=()=>({state:n,dispatch:e})=>h2(n,e),D_=()=>({state:n,dispatch:e})=>m2(n,e),j_=()=>({state:n,dispatch:e})=>L7(n,e),I_=()=>({state:n,dispatch:e})=>Z7(n,e),X_=()=>({state:n,dispatch:e})=>B7(n,e);function Xp(n,e,t={},r={}){return lo(n,e,{slice:!1,parseOptions:t,errorOnInvalidContent:r.errorOnInvalidContent})}const L_=(n,{errorOnInvalidContent:e,emitUpdate:t=!0,parseOptions:r={}}={})=>({editor:i,tr:s,dispatch:o,commands:a})=>{const{doc:l}=s;if(r.preserveWhitespace!=="full"){const c=Xp(n,i.schema,r,{errorOnInvalidContent:e??i.options.enableContentCheck});if(o){const d=mQ(c)?c.content:[c];s.replaceWith(0,l.content.size,d).setMeta("preventUpdate",!t)}return!0}return o&&s.setMeta("preventUpdate",!t),a.insertContentAt({from:0,to:l.content.size},n,{parseOptions:r,errorOnInvalidContent:e??i.options.enableContentCheck})};function xQ(n,e){const t=qr(e,n.schema),{from:r,to:i,empty:s}=n.selection,o=[];s?(n.storedMarks&&o.push(...n.storedMarks),o.push(...n.selection.$head.marks())):n.doc.nodesBetween(r,i,l=>{o.push(...l.marks)});const a=o.find(l=>l.type.name===t.name);return a?{...a.attrs}:{}}function SQ(n,e){const t=new i2(n);return e.forEach(r=>{r.steps.forEach(i=>{t.step(i)})}),t}function __(n,e,t){const r=[];return n.nodesBetween(e.from,e.to,(i,s)=>{t(i)&&r.push({node:i,pos:s})}),r}function B_(n,e){for(let t=n.depth;t>0;t-=1){const r=n.node(t);if(e(r))return{pos:t>0?n.before(t):0,start:n.start(t),depth:t,node:r}}}function Ed(n){return e=>B_(e.$from,n)}function Y(n,e,t){return n.config[e]===void 0&&n.parent?Y(n.parent,e,t):typeof n.config[e]=="function"?n.config[e].bind({...t,parent:n.parent?Y(n.parent,e,t):null}):n.config[e]}function Pg(n){return n.map(e=>{const t=Y(e,"addExtensions",{name:e.name,options:e.options,storage:e.storage});return t?[e,...Pg(t())]:e}).flat(10)}function Tg(n,e){const t=ds.fromSchema(e).serializeFragment(n),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(t),r.innerHTML}function kQ(n,e){const t=new Map;for(const i of n){var r;const s=(r=t.get(i.type))!==null&&r!==void 0?r:new Map;s.set(i.name,i),t.set(i.type,s)}return[...Object.values(e.nodes),...Object.values(e.marks)].flatMap(i=>{var s;return Object.entries((s=i.spec.attrs)!==null&&s!==void 0?s:{}).map(([o,a])=>{var l;const c=(l=t.get(i.name))===null||l===void 0?void 0:l.get(o),d=Object.hasOwn(a,"default");return{type:i.name,name:o,attribute:{rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,...c?.attribute,default:a.default,isRequired:!d,validate:a.validate}}})})}const Z_={content:"string",marks:"string",group:"string",inline:"boolean",atom:"boolean",selectable:"boolean",draggable:"boolean",code:"boolean",whitespace:["pre","normal"],definingAsContext:"boolean",definingForContent:"boolean",defining:"boolean",isolating:"boolean",linebreakReplacement:"boolean"},W_={inclusive:"boolean",excludes:"string",group:"string",spanning:"boolean",code:"boolean"};function z_(n,e,t){return Object.fromEntries(Object.entries(e).flatMap(([r,i])=>{const s=n[r];if(s===void 0)return[];if(!(typeof i=="string"?typeof s===i:typeof s=="string"&&i.includes(s)))throw new RangeError(`Invalid schemaSpec field '${t}.${r}'`);return[[r,s]]}))}function sy(n,e,t,r){return{...Object.fromEntries(Object.entries(e).filter(([i])=>i!=="attrs"&&!Object.hasOwn(r,i))),...z_(t,r,n),attrs:t.attrs}}function oy(n,e,t){for(const r of Object.keys(e))if(!Object.hasOwn(n,r))throw new RangeError(`schemaSpec requires a local ${t} extension named '${r}'`);for(const r of Object.keys(n))if(!Object.hasOwn(e,r))throw new RangeError(`Local ${t} extension '${r}' is not in schemaSpec`)}function V_(n,e){oy(n.nodes,e.nodes,"node"),oy(n.marks,e.marks,"mark");let t=e.spec.nodes,r=e.spec.marks;return e.spec.nodes.forEach((i,s)=>{t=t.update(i,sy(i,n.nodes[i],s,Z_))}),e.spec.marks.forEach((i,s)=>{r=r.update(i,sy(i,n.marks[i],s,W_))}),{topNode:e.topNodeType.name,nodes:t,marks:r}}function vQ(n){const e=n.filter((t,r)=>n.indexOf(t)!==r);return Array.from(new Set(e))}function co(n){return{baseExtensions:n.filter(e=>e.type==="extension"),nodeExtensions:n.filter(e=>e.type==="node"),markExtensions:n.filter(e=>e.type==="mark")}}function Mg(n){const e=[],{nodeExtensions:t,markExtensions:r}=co(n),i=[...t,...r],s={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},o=t.filter(c=>c.name!=="text").map(c=>c.name),a=r.map(c=>c.name),l=[...o,...a];return n.forEach(c=>{const d=Y(c,"addGlobalAttributes",{name:c.name,options:c.options,storage:c.storage,extensions:i});d&&d().forEach(h=>{let f;Array.isArray(h.types)?f=h.types:h.types==="*"?f=l:h.types==="nodes"?f=o:h.types==="marks"?f=a:f=[],f.forEach(p=>{Object.entries(h.attributes).forEach(([m,O])=>{e.push({type:p,name:m,attribute:{...s,...O}})})})})}),i.forEach(c=>{const d=Y(c,"addAttributes",{name:c.name,options:c.options,storage:c.storage});if(!d)return;const h=d();Object.entries(h).forEach(([f,p])=>{const m={...s,...p};typeof m?.default=="function"&&(m.default=m.default()),m?.isRequired&&m?.default===void 0&&delete m.default,e.push({type:c.name,name:f,attribute:m})})}),e}function Lp(n){return typeof n=="function"}function ke(n,e=void 0,...t){return Lp(n)?e?n.bind(e)(...t):n(...t):n}function F_(n={}){return Object.keys(n).length===0&&n.constructor===Object}function q_(n){const e=[];let t="",r=!1,i=!1,s=0;const o=n.length;for(let a=0;a<o;a+=1){const l=n[a];if(l==="'"&&!i){r=!r,t+=l;continue}if(l==='"'&&!r){i=!i,t+=l;continue}if(!r&&!i){if(l==="("){s+=1,t+=l;continue}if(l===")"&&s>0){s-=1,t+=l;continue}if(l===";"&&s===0){e.push(t),t="";continue}}t+=l}return t&&e.push(t),e}function ay(n){const e=[],t=q_(n||""),r=t.length;for(let i=0;i<r;i+=1){const s=t[i],o=s.indexOf(":");if(o===-1)continue;const a=s.slice(0,o).trim(),l=s.slice(o+1).trim();a&&l&&e.push([a,l])}return e}function Ke(...n){return n.filter(e=>!!e).reduce((e,t)=>{const r={...e};return Object.entries(t).forEach(([i,s])=>{if(i==="__proto__"){Object.defineProperty(r,i,{configurable:!0,enumerable:!0,value:s,writable:!0});return}if(!r[i]){r[i]=s;return}if(i==="class"){const o=s?String(s).split(" "):[],a=r[i]?r[i].split(" "):[],l=o.filter(c=>!a.includes(c));r[i]=[...a,...l].join(" ")}else if(i==="style"){const o=new Map([...ay(r[i]),...ay(s)]);r[i]=Array.from(o.entries()).map(([a,l])=>`${a}: ${l}`).join("; ")}else r[i]=s}),r},{})}function el(n,e){return e.filter(t=>t.type===n.type.name).filter(t=>t.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(n.attrs)||{}:{[t.name]:n.attrs[t.name]}).reduce((t,r)=>Ke(t,r),{})}function Y_(n){return typeof n!="string"?n:n.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(n):n==="true"?!0:n==="false"?!1:n}function ly(n,e){return"style"in n?n:{...n,getAttrs:t=>{const r=n.getAttrs?n.getAttrs(t):n.attrs;if(r===!1)return!1;const i=e.reduce((s,o)=>{const a=o.attribute.parseHTML?o.attribute.parseHTML(t):Y_(t.getAttribute(o.name));return a==null?s:{...s,[o.name]:a}},{});return{...r,...i}}}}function cy(n){return Object.fromEntries(Object.entries(n).filter(([e,t])=>e==="attrs"&&F_(t)?!1:t!=null))}function uy(n){var e,t;const r={};return!(!(n==null||(e=n.attribute)===null||e===void 0)&&e.isRequired)&&"default"in(n?.attribute||{})&&(r.default=n.attribute.default),(n==null||(t=n.attribute)===null||t===void 0?void 0:t.validate)!==void 0&&(r.validate=n.attribute.validate),[n.name,r]}function dy(n,e,t=Mg(n)){var r;const{nodeExtensions:i,markExtensions:s}=co(n);return{topNode:(r=i.find(o=>Y(o,"topNode")))===null||r===void 0?void 0:r.name,nodes:Object.fromEntries(i.map(o=>{const a=t.filter(p=>p.type===o.name),l={name:o.name,options:o.options,storage:o.storage,editor:e},c=cy({...n.reduce((p,m)=>{const O=Y(m,"extendNodeSchema",l);return{...p,...O?O(o):{}}},{}),content:ke(Y(o,"content",l)),marks:ke(Y(o,"marks",l)),group:ke(Y(o,"group",l)),inline:ke(Y(o,"inline",l)),atom:ke(Y(o,"atom",l)),selectable:ke(Y(o,"selectable",l)),draggable:ke(Y(o,"draggable",l)),code:ke(Y(o,"code",l)),whitespace:ke(Y(o,"whitespace",l)),linebreakReplacement:ke(Y(o,"linebreakReplacement",l)),defining:ke(Y(o,"defining",l)),isolating:ke(Y(o,"isolating",l)),attrs:Object.fromEntries(a.map(uy))}),d=ke(Y(o,"parseHTML",l));d&&(c.parseDOM=d.map(p=>ly(p,a)));const h=Y(o,"renderHTML",l);h&&(c.toDOM=p=>h({node:p,HTMLAttributes:el(p,a)}));const f=Y(o,"renderText",l);return f&&(c.toText=f),[o.name,c]})),marks:Object.fromEntries(s.map(o=>{const a=t.filter(f=>f.type===o.name),l={name:o.name,options:o.options,storage:o.storage,editor:e},c=cy({...n.reduce((f,p)=>{const m=Y(p,"extendMarkSchema",l);return{...f,...m?m(o):{}}},{}),inclusive:ke(Y(o,"inclusive",l)),excludes:ke(Y(o,"excludes",l)),group:ke(Y(o,"group",l)),spanning:ke(Y(o,"spanning",l)),code:ke(Y(o,"code",l)),attrs:Object.fromEntries(a.map(uy))}),d=ke(Y(o,"parseHTML",l));d&&(c.parseDOM=d.map(f=>ly(f,a)));const h=Y(o,"renderHTML",l);return h&&(c.toDOM=f=>h({mark:f,HTMLAttributes:el(f,a)})),[o.name,c]}))}}function U_(n,e,t){if(t===void 0)return new Ac(dy(n,e));const r=vQ(n.filter(o=>o.type!=="extension").map(o=>o.name));if(r.length)throw new RangeError(`Duplicate local schema types: ${r.join(", ")}`);const i=new Ac(t),s=dy(n,e,kQ(Mg(n),i));return new Ac(V_(s,i))}function da(n){return n.sort((t,r)=>{const i=Y(t,"priority")||100,s=Y(r,"priority")||100;return i>s?-1:i<s?1:0})}function wQ(n){const e=da(Pg(n)),t=vQ(e.map(r=>r.name));return t.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${t.map(r=>`'${r}'`).join(", ")}]. This can lead to issues.`),e}function QQ(n,e,t){const{from:r,to:i}=e,{blockSeparator:s=`
|
|
115
|
+
|
|
116
|
+
`,textSerializers:o={}}=t||{};let a="";return n.nodesBetween(r,i,(l,c,d,h)=>{l.isBlock&&c>r&&(a+=s);const f=o?.[l.type.name];if(f)return d&&(a+=f({node:l,pos:c,parent:d,index:h,range:e})),!1;if(l.isText){var p;a+=l==null||(p=l.text)===null||p===void 0?void 0:p.slice(Math.max(r,c)-c,i-c)}}),a}function G_(n,e){return QQ(n,{from:0,to:n.content.size},e)}function $Q(n){return Object.fromEntries(Object.entries(n.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}function H_(n,e){const t=mt(e,n.schema),{from:r,to:i}=n.selection,s=[];n.doc.nodesBetween(r,i,a=>{s.push(a)});const o=s.reverse().find(a=>a.type.name===t.name);return o?{...o.attrs}:{}}function CQ(n,e){const t=Rd(typeof e=="string"?e:e.name,n.schema);return t==="node"?H_(n,e):t==="mark"?xQ(n,e):{}}function K_(n,e=JSON.stringify){const t={};return n.filter(r=>{const i=e(r);return Object.prototype.hasOwnProperty.call(t,i)?!1:t[i]=!0})}function J_(n){const e=K_(n);return e.length===1?e:e.filter((t,r)=>!e.filter((i,s)=>s!==r).some(i=>t.oldRange.from>=i.oldRange.from&&t.oldRange.to<=i.oldRange.to&&t.newRange.from>=i.newRange.from&&t.newRange.to<=i.newRange.to))}function Nd(n){const{mapping:e,steps:t}=n,r=[];return e.maps.forEach((i,s)=>{const o=[];if(i.ranges.length)i.forEach((a,l)=>{o.push({from:a,to:l})});else{const{from:a,to:l}=t[s];if(a===void 0||l===void 0)return;o.push({from:a,to:l})}o.forEach(({from:a,to:l})=>{const c=e.slice(s).map(a,-1),d=e.slice(s).map(l),h=e.invert().map(c,-1),f=e.invert().map(d);r.push({oldRange:{from:h,to:f},newRange:{from:c,to:d}})})}),J_(r)}function Dd(n,e,t){const r=[];return n===e?t.resolve(n).marks().forEach(i=>{const s=Cg(t.resolve(n),i.type);s&&r.push({mark:i,...s})}):t.nodesBetween(n,e,(i,s)=>{!i||i?.nodeSize===void 0||r.push(...i.marks.map(o=>({from:s,to:s+i.nodeSize,mark:o})))}),r}const eB=(n,e,t,r=20)=>{const i=n.doc.resolve(t);let s=r,o=null;for(;s>0&&o===null;){const a=i.node(s);a?.type.name===e?o=a:s-=1}return[o,s]},tB=n=>{const e=n.depth-1;if(e<0)return null;const t=n.index(e);return t===0?null:n.node(e).child(t-1)};function bs(n,e){return e.nodes[n]||e.marks[n]||null}function Dc(n,e,t){return Object.fromEntries(Object.entries(t).filter(([r])=>{const i=n.find(s=>s.type===e&&s.name===r);return i?i.attribute.keepOnSplit:!1}))}const nB=(n,e=500)=>{let t="";const r=n.parentOffset;return n.parent.nodesBetween(Math.max(0,r-e),r,(i,s,o,a)=>{var l,c;const d=((l=(c=i.type.spec).toText)===null||l===void 0?void 0:l.call(c,{node:i,pos:s,parent:o,index:a}))||i.textContent||"%leaf%";t+=i.isAtom&&!i.isText?d:d.slice(0,Math.max(0,r-s))}),t};function _p(n,e,t={}){const{empty:r,ranges:i}=n.selection,s=e?qr(e,n.schema):null;if(r)return!!(n.storedMarks||n.selection.$from.marks()).filter(d=>s?s.name===d.type.name:!0).find(d=>wu(d.attrs,t,{strict:!1}));let o=0;const a=[];if(i.forEach(({$from:d,$to:h})=>{const f=d.pos,p=h.pos;n.doc.nodesBetween(f,p,(m,O)=>{if(s&&m.inlineContent&&!m.type.allowsMarkType(s))return!1;if(!m.isText&&!m.marks.length)return;const b=Math.max(f,O),y=Math.min(p,O+m.nodeSize),k=y-b;o+=k,a.push(...m.marks.map(x=>({mark:x,from:b,to:y})))})}),o===0)return!1;const l=a.filter(d=>s?s.name===d.mark.type.name:!0).filter(d=>wu(d.mark.attrs,t,{strict:!1})).reduce((d,h)=>d+h.to-h.from,0),c=a.filter(d=>s?d.mark.type!==s&&d.mark.type.excludes(s):!0).reduce((d,h)=>d+h.to-h.from,0);return(l>0?l+c:l)>=o}function rB(n,e,t={}){if(!e)return Vr(n,null,t)||_p(n,null,t);const r=Rd(e,n.schema);return r==="node"?Vr(n,e,t):r==="mark"?_p(n,e,t):!1}const iB=(n,e)=>{const{$from:t,$to:r,$anchor:i}=n.selection;if(e){const s=Ed(a=>a.type.name===e)(n.selection);if(!s)return!1;const o=n.doc.resolve(s.pos+1);return i.pos+1===o.end()}return!(r.parentOffset<r.parent.nodeSize-2||t.pos!==r.pos)},sB=n=>{const{$from:e,$to:t}=n.selection;return!(e.parentOffset>0||e.pos!==t.pos)};function hy(n,e){return Array.isArray(e)?e.some(t=>(typeof t=="string"?t:t.name)===n.name):e}function Eo(n,e){const{nodeExtensions:t}=co(e),r=t.find(s=>s.name===n);if(!r)return!1;const i=ke(Y(r,"group",{name:r.name,options:r.options,storage:r.storage}));return typeof i!="string"?!1:i.split(" ").includes("list")}function Sl(n,{checkChildren:e=!0,ignoreWhitespace:t=!1}={}){if(t){if(n.type.name==="hardBreak")return!0;if(n.isText){var r;return!/\S/.test((r=n.text)!==null&&r!==void 0?r:"")}}if(n.isText)return!n.text;if(n.isAtom||n.isLeaf)return!1;if(n.content.childCount===0)return!0;if(e){let i=!0;return n.content.forEach(s=>{i!==!1&&(Sl(s,{ignoreWhitespace:t,checkChildren:e})||(i=!1))}),i}return!1}function PQ(n){return n instanceof ee}function oB(n){if(n===null||typeof n!="object")return!1;const e=n;return!(typeof e.apply!="function"||typeof e.getMap!="function"||typeof e.invert!="function"||typeof e.map!="function"||typeof e.merge!="function"||typeof e.toJSON!="function")}function aB(n){if(n===null||typeof n!="object")return!1;const e=n;if(!oB(e))return!1;const t=e.toJSON();return!(t===null||typeof t!="object"||t.stepType!=="replace")}var TQ=class MQ{constructor(e){this.position=e}static fromJSON(e){return new MQ(e.position)}toJSON(){return{position:this.position}}};function lB(n,e){const t=e.mapping.mapResult(n.position);return{position:new TQ(t.pos),mapResult:t}}function cB(n){return new TQ(n)}function uB(n,e,t){const{selection:r}=e;let i=null;if(hQ(r)&&(i=r.$cursor),i){var s;const a=(s=n.storedMarks)!==null&&s!==void 0?s:i.marks();return i.parent.type.allowsMarkType(t)&&(!!t.isInSet(a)||!a.some(l=>l.type.excludes(t)))}const{ranges:o}=r;return o.some(({$from:a,$to:l})=>{let c=a.depth===0?n.doc.inlineContent&&n.doc.type.allowsMarkType(t):!1;return n.doc.nodesBetween(a.pos,l.pos,(d,h,f)=>{if(c)return!1;if(d.isInline){const p=!f||f.type.allowsMarkType(t),m=!!t.isInSet(d.marks)||!d.marks.some(O=>O.type.excludes(t));c=p&&m}return!c}),c})}const dB=(n,e={})=>({tr:t,state:r,dispatch:i})=>{const{selection:s}=t,{empty:o,ranges:a}=s,l=qr(n,r.schema);if(i)if(o){const c=xQ(r,l);t.addStoredMark(l.create({...c,...e}))}else a.forEach(c=>{const d=c.$from.pos,h=c.$to.pos;r.doc.nodesBetween(d,h,(f,p)=>{const m=Math.max(p,d),O=Math.min(p+f.nodeSize,h);f.marks.find(b=>b.type===l)?f.marks.forEach(b=>{l===b.type&&t.addMark(m,O,l.create({...b.attrs,...e}))}):t.addMark(m,O,l.create(e))})});return uB(r,t,l)},hB=(n,e)=>({tr:t})=>(t.setMeta(n,e),!0),fB=(n,e={})=>({state:t,dispatch:r,chain:i})=>{const s=mt(n,t.schema);let o;return t.selection.$anchor.sameParent(t.selection.$head)&&(o=t.selection.$anchor.parent.attrs),s.isTextblock?i().command(({commands:a})=>vb(s,{...o,...e})(t)?!0:a.clearNodes()).command(({state:a})=>vb(s,{...o,...e})(a,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},pB=n=>({tr:e,dispatch:t})=>{if(t){const{doc:r}=e,i=_i(n,0,r.content.size),s=ee.create(r,i);e.setSelection(s)}return!0},mB=(n,e)=>({tr:t,state:r,dispatch:i})=>{const{selection:s}=r;let o,a;return typeof e=="number"?(o=e,a=e):e&&"from"in e&&"to"in e?(o=e.from,a=e.to):(o=s.from,a=s.to),i&&t.doc.nodesBetween(o,a,(l,c)=>{l.isText||t.setNodeMarkup(c,void 0,{...l.attrs,dir:n})}),!0},gB=n=>({tr:e,dispatch:t})=>{if(t){const{doc:r}=e,{from:i,to:s}=typeof n=="number"?{from:n,to:n}:n,o=J.atStart(r).from,a=J.atEnd(r).to,l=_i(i,o,a),c=_i(s,o,a),d=J.create(r,l,c);e.setSelection(d)}return!0},OB=n=>({state:e,dispatch:t})=>{const r=mt(n,e.schema);return G7(r)(e,t)};function fy(n,e){const t=n.storedMarks||n.selection.$to.parentOffset&&n.selection.$from.marks();if(t){const r=t.filter(i=>e?.includes(i.type.name));n.tr.ensureMarks(r)}}const bB=({keepMarks:n=!0}={})=>({tr:e,state:t,dispatch:r,editor:i})=>{const{selection:s,doc:o}=e,{$from:a,$to:l}=s,c=i.extensionManager.attributes,d=Dc(c,a.node().type.name,a.node().attrs);if(s instanceof ee&&s.node.isBlock)return!a.parentOffset||!Lr(o,a.pos)?!1:(r&&(n&&fy(t,i.extensionManager.splittableMarks),e.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;const h=l.parentOffset===l.parent.content.size,f=a.depth===0?void 0:OQ(a.node(-1).contentMatchAt(a.indexAfter(-1)));let p=h&&f?[{type:f,attrs:d}]:void 0;const m=s instanceof J&&!s.empty?Er.create({doc:e.doc,selection:s}).tr.deleteSelection():null,O=m?m.doc:e.doc,b=m?m.mapping.map(a.pos):a.pos;let y=Lr(O,b,1,p);if(!p&&!y&&Lr(O,b,1,f?[{type:f}]:void 0)&&(y=!0,p=f?[{type:f,attrs:d}]:void 0),r){if(y){const k=e.steps.length;if(s instanceof J&&e.deleteSelection(),e.split(e.mapping.slice(k).map(a.pos),1,p),f&&!h&&!a.parentOffset&&a.parent.type!==f){const x=e.mapping.slice(k).map(a.before()),S=e.doc.resolve(x);a.node(-1).canReplaceWith(S.index(),S.index()+1,f)&&e.setNodeMarkup(e.mapping.slice(k).map(a.before()),f)}}n&&fy(t,i.extensionManager.splittableMarks),e.scrollIntoView()}return y},yB=(n,e={})=>({tr:t,state:r,dispatch:i,editor:s})=>{const o=mt(n,r.schema),{$from:a,$to:l}=r.selection,c=r.selection.node;if(c&&c.isBlock||a.depth<2||!a.sameParent(l))return!1;const d=a.node(-1);if(d.type!==o)return!1;const h=s.extensionManager.attributes;if(a.parent.content.size===0&&a.node(-1).childCount===a.indexAfter(-1)){if(a.depth===2||a.node(-3).type!==o||a.index(-2)!==a.node(-2).childCount-1)return!1;if(i){var f;let S=E.empty;const v=a.index(-1)?1:a.index(-2)?2:3;for(let R=a.depth-v;R>=a.depth-3;R-=1)S=E.from(a.node(R).copy(S));const w=a.indexAfter(-1)<a.node(-2).childCount?1:a.indexAfter(-2)<a.node(-3).childCount?2:3,Q={...Dc(h,a.node().type.name,a.node().attrs),...e},P=((f=o.contentMatch.defaultType)===null||f===void 0?void 0:f.createAndFill(Q))||void 0;S=S.append(E.from(o.createAndFill(null,P)||void 0));const T=a.before(a.depth-(v-1));t.replace(T,a.after(-w),new z(S,4-v,0));let C=-1;t.doc.nodesBetween(T,t.doc.content.size,(R,M)=>{if(C>-1)return!1;R.isTextblock&&R.content.size===0&&(C=M+1)}),C>-1&&t.setSelection(J.near(t.doc.resolve(C))),t.scrollIntoView()}return!0}const p=l.pos===a.end()?d.contentMatchAt(0).defaultType:null,m={...Dc(h,d.type.name,d.attrs),...e},O={...Dc(h,a.node().type.name,a.node().attrs),...e},b=a.parentOffset===0&&a.index(-1)===0,y=a.before(-1);t.delete(a.pos,l.pos);const k=b?d.attrs:m,x=p?[{type:o,attrs:k},{type:p,attrs:O}]:[{type:o,attrs:k}];if(!Lr(t.doc,a.pos,2))return!1;if(i){const{selection:S,storedMarks:v}=r,{splittableMarks:w}=s.extensionManager,Q=v||S.$to.parentOffset&&S.$from.marks();if(t.split(a.pos,2,x).scrollIntoView(),b&&t.setNodeMarkup(y,void 0,m),!Q||!i)return!0;const P=Q.filter(T=>w.includes(T.type.name));t.ensureMarks(P)}return!0};function AQ(n,e,t){if(!n.validContent(e))return null;try{return n.create(t,e)}catch{return null}}function Ag(n,e){if(n.pendingContent.length===0)return!0;const t=AQ(e,E.from(n.pendingContent));return t?(n.items.push(t),n.pendingContent=[],!0):!1}function xB(n,e,t){return t.validContent(E.from([...e.pendingContent,n]))?(e.pendingContent.push(n),!0):!Ag(e,t)||!t.validContent(E.from(n))?!1:(e.pendingContent.push(n),!0)}function SB(n,e,t,r){const i=r(n,t);if(!i)return!1;const s=AQ(t.listType,E.from(i),n.attrs);return s?t.itemType.validContent(E.from([...e.pendingContent,s]))?(e.pendingContent.push(s),!0):Ag(e,t.itemType)?(e.items.push(...i),!0):!1:!1}function kB(n,e,t){const r={items:[],pendingContent:[]};for(let i=0;i<n.childCount;i+=1){const s=n.child(i);if(!(e.isListNode(s)?SB(s,r,e,t):xB(s,r,e.itemType)))return null}return Ag(r,e.itemType)?r.items:null}function RQ(n,e){const t=[];for(let r=0;r<n.childCount;r+=1){const i=kB(n.child(r),e,RQ);if(!i)return null;t.push(...i)}return t}function py(n,e){let t=null;return n.descendants((r,i)=>r!==e?!0:(t=i,!1)),t}function my(n){return!n||n==="1"?null:n}function EQ(n,e){return my(n)===my(e)}const tc=(n,e)=>{const t=Ed(s=>s.type===e)(n.selection);if(!t)return!0;const r=n.doc.resolve(Math.max(0,t.pos-1)).before(t.depth);if(r===void 0)return!0;const i=n.doc.nodeAt(r);return!(t.node.type===i?.type&&Ci(n.doc,t.pos))||!EQ(t.node.attrs.type,i?.attrs.type)||n.join(t.pos),!0},nc=(n,e)=>{const t=Ed(s=>s.type===e)(n.selection);if(!t)return!0;const r=n.doc.resolve(t.start).after(t.depth);if(r===void 0)return!0;const i=n.doc.nodeAt(r);return!(t.node.type===i?.type&&Ci(n.doc,r))||!EQ(t.node.attrs.type,i?.attrs.type)||n.join(r),!0};function vB(n){const e=n.doc,t=e.firstChild;if(!t)return null;const r=e.resolve(1),i=e.resolve(t.nodeSize-1);return J.between(r,i)}const wB=(n,e,t,r={})=>({editor:i,tr:s,state:o,dispatch:a,chain:l,commands:c,can:d})=>{const{extensions:h,splittableMarks:f}=i.extensionManager,p=mt(n,o.schema),m=mt(e,o.schema),{selection:O,storedMarks:b}=o,{$from:y,$to:k}=O,x=y.blockRange(k),S=b||O.$to.parentOffset&&O.$from.marks();if(!x)return!1;const v=Ed(N=>Eo(N.type.name,h))(O),w=O.from===0&&O.to===o.doc.content.size,Q=o.doc.content.content,P=Q.length===1?Q[0]:null,T=w&&P&&Eo(P.type.name,h)?{node:P,pos:0}:null,C=v??T,R=!!v&&x.depth>=1&&x.depth-v.depth<=1,M=!!T;if((R||M)&&C){if(C.node.type===p)return w&&M?l().command(({tr:N,dispatch:I})=>{const L=vB(N);return L?(N.setSelection(L),I&&I(N),!0):!1}).liftListItem(m).run():c.liftListItem(m);if(Eo(C.node.type.name,h)&&p.validContent(C.node.content))return l().command(()=>(s.setNodeMarkup(C.pos,p),!0)).command(()=>tc(s,p)).command(()=>nc(s,p)).run();if(Eo(C.node.type.name,h)){var j;const N=(j=C.node.firstChild)===null||j===void 0?void 0:j.type;if(N&&N!==m){const I=RQ(C.node,{listType:p,itemType:m,isListNode:te=>Eo(te.type.name,h)}),L=I?E.from(I):null;return!L||!p.validContent(L)?!1:l().command(()=>{const{$anchor:te,$head:le}=s.selection,_=te.parent,re=le.parent,ie=te.parentOffset,pe=le.parentOffset;let Oe;try{Oe=p.create(r,L)}catch{return!1}if(s.replaceWith(C.pos,C.pos+C.node.nodeSize,Oe),_.inlineContent&&re.inlineContent){const U=py(Oe,_),de=py(Oe,re);if(U!==null&&de!==null){const Ye=C.pos+U+2+ie,ut=C.pos+de+2+pe;s.setSelection(J.create(s.doc,Ye,ut))}}return!0}).command(()=>tc(s,p)).command(()=>nc(s,p)).run()}}}return!t||!S||!a?l().command(()=>d().wrapInList(p,r)?!0:c.clearNodes()).wrapInList(p,r).command(()=>tc(s,p)).command(()=>nc(s,p)).run():l().command(()=>{const N=d().wrapInList(p,r),I=S.filter(L=>f.includes(L.type.name));return s.ensureMarks(I),N?!0:c.clearNodes()}).wrapInList(p,r).command(()=>tc(s,p)).command(()=>nc(s,p)).run()},QB=(n,e={},t={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:s=!1}=t,o=qr(n,r.schema);return _p(r,o,e)?i.unsetMark(o,{extendEmptyMarkRange:s}):i.setMark(o,e)},$B=(n,e,t={})=>({state:r,commands:i})=>{const s=mt(n,r.schema),o=mt(e,r.schema),a=Vr(r,s,t);let l;return r.selection.$anchor.sameParent(r.selection.$head)&&(l=r.selection.$anchor.parent.attrs),a?i.setNode(o,l):i.setNode(s,{...l,...t})},CB=(n,e={})=>({state:t,commands:r})=>{const i=mt(n,t.schema);return Vr(t,i,e)?r.lift(i):r.wrapIn(i,e)},PB=()=>({state:n,dispatch:e})=>{const t=n.plugins;for(let r=0;r<t.length;r+=1){const i=t[r];let s;if(i.spec.isInputRules&&(s=i.getState(n))){if(e){const o=n.tr,a=s.transform;for(let l=a.steps.length-1;l>=0;l-=1)o.step(a.steps[l].invert(a.docs[l]));if(s.text){const l=o.doc.resolve(s.from).marks();o.replaceWith(s.from,s.to,n.schema.text(s.text,l))}else o.delete(s.from,s.to)}return!0}}return!1},TB=(n={})=>({tr:e,dispatch:t,editor:r})=>{const{ignoreClearable:i=!1}=n,{selection:s}=e,{empty:o,ranges:a}=s;if(o)return!0;const{nonClearableMarks:l}=r.extensionManager;if(t){const c=Object.values(r.schema.marks).filter(d=>i||!l.includes(d.name));a.forEach(d=>{for(const h of c)e.removeMark(d.$from.pos,d.$to.pos,h)})}return!0},MB=(n,e={})=>({tr:t,state:r,dispatch:i})=>{const{extendEmptyMarkRange:s=!1}=e,{selection:o}=t,a=qr(n,r.schema),{$from:l,empty:c,ranges:d}=o;if(!i)return!0;if(c&&s){var h;let{from:f,to:p}=o;const m=Cg(l,a,(h=l.marks().find(O=>O.type===a))===null||h===void 0?void 0:h.attrs);m&&(f=m.from,p=m.to),t.removeMark(f,p,a)}else d.forEach(f=>{t.removeMark(f.$from.pos,f.$to.pos,a)});return t.removeStoredMark(a),!0},AB=n=>({tr:e,state:t,dispatch:r})=>{const{selection:i}=t;let s,o;return typeof n=="number"?(s=n,o=n):n&&"from"in n&&"to"in n?(s=n.from,o=n.to):(s=i.from,o=i.to),r&&e.doc.nodesBetween(s,o,(a,l)=>{if(a.isText)return;const c={...a.attrs};delete c.dir,e.setNodeMarkup(l,void 0,c)}),!0},RB=(n,e={})=>({tr:t,state:r,dispatch:i})=>{let s=null,o=null;const a=Rd(typeof n=="string"?n:n.name,r.schema);if(!a)return!1;a==="node"&&(s=mt(n,r.schema)),a==="mark"&&(o=qr(n,r.schema));let l=!1;return t.selection.ranges.forEach(c=>{const d=c.$from.pos,h=c.$to.pos;let f,p,m,O;t.selection.empty?r.doc.nodesBetween(d,h,(b,y)=>{s&&s===b.type&&(l=!0,m=Math.max(y,d),O=Math.min(y+b.nodeSize,h),f=y,p=b)}):r.doc.nodesBetween(d,h,(b,y)=>{y<d&&s&&s===b.type&&(l=!0,m=Math.max(y,d),O=Math.min(y+b.nodeSize,h),f=y,p=b),y>=d&&y<=h&&(s&&s===b.type&&(l=!0,i&&t.setNodeMarkup(y,void 0,{...b.attrs,...e})),o&&b.marks.length&&b.marks.forEach(k=>{if(o===k.type&&(l=!0,i)){const x=Math.max(y,d),S=Math.min(y+b.nodeSize,h);t.addMark(x,S,o.create({...k.attrs,...e}))}}))}),p&&(f!==void 0&&i&&t.setNodeMarkup(f,void 0,{...p.attrs,...e}),o&&p.marks.length&&p.marks.forEach(b=>{o===b.type&&i&&t.addMark(m,O,o.create({...b.attrs,...e}))}))}),l},Cs=new et("__tiptap_decorations__"),EB=n=>({tr:e,dispatch:t})=>(t&&e.setMeta(Cs,{type:"force",name:n}),!0),NB=(n,e={})=>({state:t,dispatch:r})=>{const i=mt(n,t.schema);return W7(i,e)(t,r)},DB=(n,e={})=>({state:t,dispatch:r})=>{const i=mt(n,t.schema);return z7(i,e)(t,r)};var jB=M7({blur:()=>U8,clearContent:()=>G8,clearNodes:()=>H8,command:()=>K8,createParagraphNear:()=>J8,cut:()=>e_,deleteCurrentNode:()=>t_,deleteNode:()=>n_,deleteRange:()=>r_,deleteSelection:()=>o_,enter:()=>a_,exitCode:()=>l_,extendMarkRange:()=>c_,first:()=>u_,focus:()=>h_,forEach:()=>f_,insertContent:()=>p_,insertContentAt:()=>m_,insertDefaultBlock:()=>g_,joinBackward:()=>y_,joinDown:()=>b_,joinForward:()=>x_,joinItemBackward:()=>S_,joinItemForward:()=>k_,joinTextblockBackward:()=>v_,joinTextblockForward:()=>w_,joinUp:()=>O_,keyboardShortcut:()=>$_,lift:()=>C_,liftEmptyBlock:()=>P_,liftListItem:()=>T_,newlineInCode:()=>M_,resetAttributes:()=>A_,scrollIntoView:()=>R_,selectAll:()=>E_,selectNodeBackward:()=>N_,selectNodeForward:()=>D_,selectParentNode:()=>j_,selectTextblockEnd:()=>I_,selectTextblockStart:()=>X_,setContent:()=>L_,setMark:()=>dB,setMeta:()=>hB,setNode:()=>fB,setNodeSelection:()=>pB,setTextDirection:()=>mB,setTextSelection:()=>gB,sinkListItem:()=>OB,splitBlock:()=>bB,splitListItem:()=>yB,toggleList:()=>wB,toggleMark:()=>QB,toggleNode:()=>$B,toggleWrap:()=>CB,undoInputRule:()=>PB,unsetAllMarks:()=>TB,unsetMark:()=>MB,unsetTextDirection:()=>AB,updateAttributes:()=>RB,updateDecorations:()=>EB,wrapIn:()=>NB,wrapInList:()=>DB});const No=new WeakMap;function IB(n,e){var t;No.set(n,((t=No.get(n))!==null&&t!==void 0?t:0)+1);try{return e()}finally{var r;const i=((r=No.get(n))!==null&&r!==void 0?r:1)-1;i>0?No.set(n,i):No.delete(n)}}var XB=class{constructor(){this.callbacks={}}on(n,e){return this.callbacks[n]||(this.callbacks[n]=[]),this.callbacks[n].push(e),this}emit(n,...e){const t=this.callbacks[n];return t&&t.forEach(r=>r.apply(this,e)),this}off(n,e){const t=this.callbacks[n];return t&&(e?this.callbacks[n]=t.filter(r=>r!==e):delete this.callbacks[n]),this}once(n,e){const t=(...r)=>{this.off(n,t),e.apply(this,r)};return this.on(n,t)}removeAllListeners(){this.callbacks={}}};function LB(n){return n.kind==="widget"}function NQ(n,e){const t=[],r=new Set;for(const i of n)i.kind==="widget"&&LB(i)&&r.add(i.key),t.push(i.toPMDecoration(e));return{decorations:t,widgetKeys:r}}function _B(n,e,t){const{decorations:r,widgetKeys:i}=NQ(e,t);return{set:ye.create(n,r),widgetKeys:i}}function DQ({position:n,from:e,to:t,docSize:r}){return n<e?!1:n<t?!0:n===t&&t===r}function BB({decorations:n,from:e,to:t,docSize:r,extensionName:i,warnedExtensions:s}){return n.filter(o=>DQ({position:o.anchor,from:e,to:t,docSize:r})?!0:(o.anchor===t||s.has(i)||(s.add(i),console.warn(`[tiptap warn]: Extension "${i}" returned a decoration outside the requested range [${e}, ${t}). It was ignored.`)),!1))}function ZB(n){var e;const t=(e=n.spec)===null||e===void 0?void 0:e.key;return typeof t=="string"?t:void 0}function jQ(n){return n.jsonID==="attr"}function WB(n){let e=!1;if(n.getMap().forEach(()=>{e=!0}),e||jQ(n))return!0;const t=n;return typeof t.from=="number"&&typeof t.to=="number"}function zB(n,e){let t=null,r=0,i=0;for(let s=0;s<n.childCount&&!(i>e.to);s+=1){const o=i+n.child(s).nodeSize;o>=e.from&&(t===null&&(t=i),r=o),i=o}return t===null?null:{from:t,to:r}}function VB(n,e){if(n.steps.some(s=>!WB(s)))return{type:"full"};const t=Nd(n).map(({newRange:s})=>s);n.steps.forEach((s,o)=>{if(!jQ(s))return;const a=n.mapping.slice(o);t.push({from:a.map(s.pos,-1),to:a.map(s.pos+1)})});const r=[];for(const s of t){const o=zB(e,s);o&&r.push(o)}r.sort((s,o)=>s.from-o.from);const i=[];for(const s of r){const o=i[i.length-1];o&&s.from<=o.to?o.to=Math.max(o.to,s.to):i.push({...s})}return{type:"ranges",ranges:i}}function IQ(n,e,t,r){return n.map(e,t,{onRemove:i=>{const s=i?.key;typeof s=="string"&&r.delete(s)}})}function FB(n,e,t){var r,i;const s=(r=e.decorationSetsByExtension[n])!==null&&r!==void 0?r:ye.empty,o=new Set((i=e.widgetKeysByExtension[n])!==null&&i!==void 0?i:[]);return{set:IQ(s,t.mapping,t.doc,o),widgetKeys:o}}function gy(n,e){const t=Object.values(e).flatMap(r=>r.find());return ye.create(n,t)}function Oy(n){const e=new Set;for(const t of Object.values(n))for(const r of t)e.add(r);return e}function qB(n,e){var t;switch((t=e.update)!==null&&t!==void 0?t:"document"){case"document":if(e.createInRange)throw new Error(`[tiptap error]: Extension "${n}" provides createInRange() but does not use the "changedRanges" decoration update strategy.`);return;case"changedRanges":if(!e.createInRange)throw new Error(`[tiptap error]: Extension "${n}" uses the "changedRanges" decoration update strategy but does not provide createInRange().`);return;case"manual":if(e.createInRange)throw new Error(`[tiptap error]: Extension "${n}" uses the "manual" decoration update strategy, which is not compatible with createInRange(). createInRange() requires the "changedRanges" strategy.`);if(e.shouldUpdate)throw new Error(`[tiptap error]: Extension "${n}" cannot combine the "manual" decoration update strategy with shouldUpdate().`);return;default:throw new Error(`[tiptap error]: Extension "${n}" uses an unknown decoration update strategy. Expected "document", "changedRanges", or "manual".`)}}function YB(n,e,t){return t?!0:n.update==="manual"?!1:n.shouldUpdate?n.shouldUpdate(e):e.tr.docChanged}const UB=new Set;var GB=class{constructor(n){this.warnedWidgetKeys=new Set,this.warnedOutOfRangeExtensions=new Set,this.handleBeforeTransaction=({nextState:e})=>{const t=Cs.getState(e);t&&this.warnDuplicateWidgetKeys(t)},this.editor=n.editor,this.entries=this.resolveEntries(n.entries),this.entries.forEach(({name:e,spec:t})=>qB(e,t)),this.plugin=this.entries.length>0?this.createPlugin():null,this.editor.on("beforeTransaction",this.handleBeforeTransaction)}destroy(){this.editor.off("beforeTransaction",this.handleBeforeTransaction)}liveWidgetKeys(){var n,e;return(n=(e=Cs.getState(this.editor.state))===null||e===void 0?void 0:e.widgetKeys)!==null&&n!==void 0?n:UB}get mountedView(){return this.editor.isDestroyed?null:this.editor.view}resolveEntries(n){const e=[];for(const{name:t,addDecorations:r}of n){const i=r();i&&e.push({name:t,spec:i})}return e}createPlugin(){const{editor:n,entries:e}=this;return new Ee({key:Cs,state:{init:(t,r)=>{const i={},s={};for(const{name:a,spec:l}of e){const{set:c,widgetKeys:d}=this.buildFullSet(a,l,r);i[a]=c,s[a]=d}const o={decorationSetsByExtension:i,widgetKeysByExtension:s,mergedDecorationSet:this.buildMergedSet(r.doc,i),widgetKeys:Oy(s)};return this.warnDuplicateWidgetKeys(o),o},apply:(t,r,i,s)=>{const o=t.getMeta(Cs),a=o?.type==="force"&&!o.name,l=o?.type==="force"?o.name:void 0,c={},d={},h=new Set;return IB(n,()=>{for(const{name:f,spec:p}of e){const m=a||l===f;if(YB(p,{editor:n,tr:t,oldState:i,newState:s},m))if(p.update==="changedRanges"&&t.docChanged&&!m){const O=this.applyChangedRangesRecompute(f,p,r,t,s);c[f]=O.set,d[f]=O.widgetKeys,h.add(f)}else{const{set:O,widgetKeys:b}=this.buildFullSet(f,p,s);c[f]=O,d[f]=b,h.add(f)}else{const O=FB(f,r,t);c[f]=O.set,d[f]=O.widgetKeys}}}),h.size===0&&!t.docChanged?r:{decorationSetsByExtension:c,widgetKeysByExtension:d,mergedDecorationSet:this.mergeAfterApply({entries:e,previous:r,tr:t,decorationSetsByExtension:c,recomputedNames:h}),widgetKeys:Oy(d)}}},props:{decorations(t){var r,i;return(r=(i=Cs.getState(t))===null||i===void 0?void 0:i.mergedDecorationSet)!==null&&r!==void 0?r:ye.empty}}})}applyChangedRangesRecompute(n,e,t,r,i){const s=VB(r,i.doc);return s.type==="full"?this.buildFullSet(n,e,i):this.rebuildRanges(n,e,t,r,i,s.ranges)}rebuildRanges(n,e,t,r,i,s){var o,a;const l=(o=t.decorationSetsByExtension[n])!==null&&o!==void 0?o:ye.empty,c=new Set((a=t.widgetKeysByExtension[n])!==null&&a!==void 0?a:[]);let d=IQ(l,r.mapping,r.doc,c);const h=i.doc.content.size;for(const{from:f,to:p}of s){const m=d.find(f,p).filter(y=>DQ({position:y.from,from:f,to:p,docSize:h}));for(const y of m){const k=ZB(y);k&&c.delete(k)}d=d.remove(m);const{decorations:O,widgetKeys:b}=NQ(BB({decorations:this.runCreate(n,"createInRange",()=>e.createInRange({editor:this.editor,state:i,view:this.mountedView,from:f,to:p})),from:f,to:p,docSize:h,extensionName:n,warnedExtensions:this.warnedOutOfRangeExtensions}),n);d=d.add(i.doc,O);for(const y of b)c.add(y)}return{set:d,widgetKeys:c}}buildFullSet(n,e,t){const r=this.runCreate(n,"create",()=>e.create({editor:this.editor,state:t,view:this.mountedView}));return _B(t.doc,r,n)}runCreate(n,e,t){try{return t()}catch(r){return console.error(`[tiptap error]: Extension "${n}" threw in \`addDecorations().${e}()\`. Its decorations were dropped for this update.`,r),[]}}warnDuplicateWidgetKeys(n){}buildMergedSet(n,e){const t=Object.keys(e);return t.length===1?e[t[0]]:gy(n,e)}mergeAfterApply({entries:n,previous:e,tr:t,decorationSetsByExtension:r,recomputedNames:i}){return n.length===1?r[n[0].name]:i.size===0?e.mergedDecorationSet.map(t.mapping,t.doc):gy(t.doc,r)}};function HB(n,e){const{selection:t}=n,{$from:r}=t;if(t instanceof ee){const s=r.index();return r.parent.canReplaceWith(s,s+1,e)}let i=r.depth;for(;i>=0;){const s=r.index(i);if(r.node(i).contentMatchAt(s).matchType(e))return!0;i-=1}return!1}function KB(n,e,t){const r=document.querySelector("style[data-tiptap-style]");if(r!==null)return r;const i=document.createElement("style");return e&&i.setAttribute("nonce",e),i.setAttribute("data-tiptap-style",""),i.innerHTML=n,document.getElementsByTagName("head")[0].appendChild(i),i}function JB(n){return n.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function eZ(n){return typeof n=="number"}function tZ(n){return Object.prototype.toString.call(n).slice(8,-1)}function rc(n){return tZ(n)!=="Object"?!1:n.constructor===Object&&Object.getPrototypeOf(n)===Object.prototype}function Rg(n){return/\s/.test(n)}function XQ(n){return/^\w$/.test(n)}function nZ(n,e){for(;e<n.length&&Rg(n[e]);)e+=1;return e}function jd(n,e){for(;e<n.length&&!Rg(n[e]);)e+=1;return e}function rZ(n,e,t){for(;e<n.length&&(XQ(n[e])||t);)e+=1;return e}function iZ(n,e){const t=n.indexOf(n[e],e+1);return{nextIndex:jd(n,t===-1?e:t+1)}}function sZ(n,e,t,r){let i=t;if(n[i]!=="=")return;i=i+1;const s=n[i];if(s!=='"'&&s!=="'")return;const o=n.indexOf(s,i+1);if(o!==-1)return{token:{type:"keyValue",name:e,value:n.slice(i+1,o)},nextIndex:jd(n,o+1)}}function oZ(n,e,t){const r=t==="pandoc",i=rZ(n,e+1,r),s=n.slice(e,i),o=sZ(n,s,i);if(o)return o;const a=i===n.length||Rg(n[i]);return{token:r&&a?{type:"boolean",name:s}:void 0,nextIndex:t==="shortcode"?jd(n,i):i}}function aZ(n,e,t){const r=n[e];return r==='"'||r==="'"?iZ(n,e):XQ(r)?oZ(n,e,t):{nextIndex:jd(n,e)}}function lZ(n,e){const t=[];let r=0;for(;r<n.length&&(r=nZ(n,r),!(r>=n.length));){const i=aZ(n,r,e);i.token&&t.push(i.token),r=i.nextIndex}return t}function cZ(n){const e={};return lZ(n,"shortcode").forEach(t=>{t.type==="keyValue"&&(e[t.name]=t.value)}),e}function uZ(n){return Object.entries(n).filter(([,e])=>e!=null).map(([e,t])=>`${e}="${t}"`).join(" ")}function dZ(n){const{nodeName:e,name:t,getContent:r,parseAttributes:i=cZ,serializeAttributes:s=uZ,defaultAttributes:o={},selfClosing:a=!1,allowedAttributes:l}=n,c=t||e,d=f=>{if(!l)return f;const p={};return l.forEach(m=>{const O=typeof m=="string"?m:m.name,b=typeof m=="string"?void 0:m.skipIfDefault;if(O in f){const y=f[O];if(b!==void 0&&y===b)return;p[O]=y}}),p},h=c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:(f,p)=>{const m={...o,...f.attributes};if(a)return p.createNode(e,m);const O=r?r(f):f.content||"";return O?p.createNode(e,m,[p.createTextNode(O)]):p.createNode(e,m,[])},markdownTokenizer:{name:e,level:"inline",start(f){const p=a?new RegExp(`\\[${h}\\s*[^\\]]*\\]`):new RegExp(`\\[${h}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${h}\\]`),m=f.match(p),O=m?.index;return O!==void 0?O:-1},tokenize(f,p,m){const O=a?new RegExp(`^\\[${h}\\s*([^\\]]*)\\]`):new RegExp(`^\\[${h}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${h}\\]`),b=f.match(O);if(!b)return;let y="",k="";if(a){const[,S]=b;k=S}else{const[,S,v]=b;k=S,y=v||""}const x=i(k.trim());return{type:e,raw:b[0],content:y.trim(),attributes:x}}},renderMarkdown:f=>{let p="";r?p=r(f):f.content&&f.content.length>0&&(p=f.content.filter(y=>y.type==="text").map(y=>y.text).join(""));const m=d(f.attrs||{}),O=s(m),b=O?` ${O}`:"";return a?`[${c}${b}]`:`[${c}${b}]${p}[/${c}]`}}}function by(n,e,t){const r=n.split(`
|
|
117
|
+
`),i=[];let s="",o=0;const a=e.baseIndentSize||2;for(;o<r.length;){const d=r[o],h=d.match(e.itemPattern);if(!h){if(i.length>0)break;if(d.trim()===""){o+=1,s=`${s}${d}
|
|
118
|
+
`;continue}else return}const f=e.extractItemData(h),{indentLevel:p,mainContent:m}=f;s=`${s}${d}
|
|
119
|
+
`;const O=[m];for(o+=1;o<r.length;){var l;const x=r[o];if(x.trim()===""){var c;const S=r.slice(o+1).findIndex(v=>v.trim()!=="");if(S===-1)break;if((((c=r[o+1+S].match(/^(\s*)/))===null||c===void 0||(c=c[1])===null||c===void 0?void 0:c.length)||0)>p){O.push(x),s=`${s}${x}
|
|
120
|
+
`,o+=1;continue}else break}if((((l=x.match(/^(\s*)/))===null||l===void 0||(l=l[1])===null||l===void 0?void 0:l.length)||0)>p)O.push(x),s=`${s}${x}
|
|
121
|
+
`,o+=1;else break}let b;const y=O.slice(1);if(y.length>0){const x=y.map(S=>S.slice(p+a)).join(`
|
|
122
|
+
`);x.trim()&&(e.customNestedParser?b=e.customNestedParser(x):b=t.blockTokens(x))}const k=e.createToken(f,b);i.push(k)}if(i.length!==0)return{items:i,raw:s}}const yy=4;function xy(n){let e=0;for(const t of n)e=t===" "?e+yy-e%yy:e+1;return e}function LQ(n,e,t,r,i){if(!n||!Array.isArray(n.content))return"";const s=typeof t=="function"?t(r):t,[o,...a]=n.content;let l=`${s}${e.renderChildren([o])}`;return a&&a.length>0&&a.forEach((c,d)=>{var h,f;const p=(h=(f=e.renderChild)===null||f===void 0?void 0:f.call(e,c,d+1))!==null&&h!==void 0?h:e.renderChildren([c]);if(p!=null){const m=b=>{if(!i?.alignNestedToPrefix)return e.indent(b);const y=e.indent(""),k=xy(s);return(xy(y)>=k?y:" ".repeat(k))+b},O=p.split(`
|
|
123
|
+
`).map(b=>m(b||"")).join(`
|
|
124
|
+
`);l+=c.type==="paragraph"?`
|
|
125
|
+
|
|
126
|
+
${O}`:`
|
|
127
|
+
${O}`}}),l}function _Q(n,e){const t={...n};return rc(n)&&rc(e)&&Object.keys(e).forEach(r=>{rc(e[r])&&rc(n[r])?t[r]=_Q(n[r],e[r]):t[r]=e[r]}),t}function hZ(n,e,t={}){const{state:r}=e,{doc:i,tr:s}=r,o=n;i.descendants((a,l)=>{const c=s.mapping.map(l),d=s.mapping.map(l)+a.nodeSize;let h=null;if(a.marks.forEach(p=>{if(p!==o)return!1;h=p}),!h)return;let f=!1;if(Object.keys(t).forEach(p=>{t[p]!==h.attrs[p]&&(f=!0)}),f){const p=n.type.create({...n.attrs,...t});s.removeMark(c,d,n.type),s.addMark(c,d,p)}}),s.docChanged&&e.view.dispatch(s)}var kl=class{constructor(n){var e;this.find=n.find,this.handler=n.handler,this.undoable=(e=n.undoable)!==null&&e!==void 0?e:!0}};const fZ=(n,e)=>{if($g(e))return e.exec(n);const t=e(n);if(!t)return null;const r=[t.text];return r.index=t.index,r.input=n,r.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(t.replaceWith)),r};function pZ(n){const{editor:e,from:t,to:r,text:i,insertText:s}=n;if(!s)return{inputTransaction:null,tr:e.view.state.tr};const o=e.view.state.tr.insertText(i,t,r);return{inputTransaction:o,tr:Er.create({doc:o.doc,selection:o.selection,storedMarks:o.storedMarks}).tr}}function mZ(n){const{editor:e,from:t,to:r,text:i,rule:s,match:o,plugin:a,insertText:l}=n,{view:c}=e,{inputTransaction:d,tr:h}=pZ({editor:e,from:t,to:r,text:i,insertText:l}),f=d?t+i.length:r,p=Ad({state:c.state,transaction:h}),m={from:t-(o[0].length-i.length),to:f},{commands:O,chain:b,can:y}=new Vs({editor:e,state:p});return s.handler({state:p,range:m,match:o,commands:O,chain:b,can:y})===null||!h.steps.length?!1:(d&&(c.dispatch(d),!c.state.doc.eq(d.doc))||(F8(h),h.setMeta("inputRule",!0),s.undoable&&h.setMeta(a,{transform:h,from:t,to:f,text:i}),c.dispatch(h)),!0)}function gZ(n,e,t){const r=e[0].length-t.length;if(r<=0)return!0;const i=n.parentOffset-r;return i>=0&&n.parent.textBetween(i,n.parentOffset)===e[0].slice(0,r)}function ic(n){var e;const{editor:t,from:r,to:i,text:s,rules:o,plugin:a,insertText:l}=n,{view:c}=t;if(c.composing)return!1;const d=c.state.doc.resolve(r);if(d.parent.type.spec.code||!((e=d.nodeBefore||d.nodeAfter)===null||e===void 0)&&e.marks.find(f=>f.type.spec.code))return!1;const h=nB(d)+s;for(const f of o){const p=fZ(h,f.find);if(!(!p||!gZ(d,p,s))&&mZ({editor:t,from:r,to:i,text:s,rule:f,match:p,plugin:a,insertText:l}))return!0}return!1}function OZ(n){const{editor:e,rules:t}=n,r=new Ee({state:{init(){return null},apply(i,s,o){const a=i.getMeta(r);if(a)return a;const l=i.getMeta("applyInputRules");return l&&setTimeout(()=>{let{text:c}=l;typeof c=="string"?c=c:c=Tg(E.from(c),o.schema);const{from:d}=l,h=d+c.length;ic({editor:e,from:d,to:h,text:c,rules:t,plugin:r})}),i.selectionSet||i.docChanged?null:s}},props:{handleTextInput(i,s,o,a){return ic({editor:e,from:s,to:o,text:a,rules:t,plugin:r,insertText:!0})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:s}=i.state.selection;s&&ic({editor:e,from:s.pos,to:s.pos,text:"",rules:t,plugin:r})}),!1)},handleKeyDown(i,s){if(s.key!=="Enter")return!1;const{$cursor:o}=i.state.selection;return o?ic({editor:e,from:o.pos,to:o.pos,text:`
|
|
128
|
+
`,rules:t,plugin:r}):!1}},isInputRules:!0});return r}var Eg=class{constructor(n={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...n},this.name=this.config.name}get options(){return{...ke(Y(this,"addOptions",{name:this.name}))}}get storage(){return{...ke(Y(this,"addStorage",{name:this.name,options:this.options}))}}configure(n={}){const e=this.extend({...this.config,addOptions:()=>_Q(this.options,n)});return e.name=this.name,e.parent=this.parent,this.child=null,e}extend(n={}){const e=new this.constructor({...this.config,...n});return e.parent=this,this.child=e,e.name="name"in n?n.name:e.parent.name,e}},hs=class BQ extends Eg{constructor(...e){super(...e),this.type="mark"}static create(e={}){const t=typeof e=="function"?e():e;return new BQ(t)}static handleExit({editor:e,mark:t}){const{tr:r}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){const s=i.marks();if(!s.find(a=>a?.type.name===t.name))return!1;const o=s.find(a=>a?.type.name===t.name);return o&&r.removeStoredMark(o),r.insertText(" ",i.pos),e.view.dispatch(r),!0}return!1}configure(e){return super.configure(e)}extend(e){const t=typeof e=="function"?e():e;return super.extend(t)}},ZQ=class{constructor(n){this.find=n.find,this.handler=n.handler}};const bZ=(n,e,t)=>{if($g(e))return[...n.matchAll(e)];const r=e(n,t);return r?r.map(i=>{const s=[i.text];return s.index=i.index,s.input=n,s.data=i.data,i.replaceWith&&(i.text.includes(i.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),s.push(i.replaceWith)),s}):[]};function yZ(n){const{editor:e,state:t,from:r,to:i,rule:s,pasteEvent:o,dropEvent:a}=n,{commands:l,chain:c,can:d}=new Vs({editor:e,state:t}),h=[];return t.doc.nodesBetween(r,i,(f,p)=>{var m,O,b,y;if(!((m=f.type)===null||m===void 0||(m=m.spec)===null||m===void 0)&&m.code||!(f.isText||f.isTextblock||f.isInline))return;const k=(O=(b=(y=f.content)===null||y===void 0?void 0:y.size)!==null&&b!==void 0?b:f.nodeSize)!==null&&O!==void 0?O:0,x=Math.max(r,p),S=Math.min(i,p+k);if(x>=S)return;const v=f.isText?f.text||"":f.textBetween(x-p,S-p,void 0,"");bZ(v,s.find,o).forEach(w=>{if(w.index===void 0)return;const Q=x+w.index+1,P=Q+w[0].length,T={from:t.tr.mapping.map(Q),to:t.tr.mapping.map(P)},C=s.handler({state:t,range:T,match:w,commands:l,chain:c,can:d,pasteEvent:o,dropEvent:a});h.push(C)})}),h.every(f=>f!==null)}let ys=null;const xZ=n=>{var e;const t=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=t.clipboardData)===null||e===void 0||e.setData("text/html",n),t};function SZ(n){const{editor:e,rules:t}=n;let r=null,i=!1,s=!1,o=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,a;try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}const l=({state:c,from:d,to:h,rule:f,pasteEvt:p})=>{const m=c.tr,O=Ad({state:c,transaction:m});if(!(!yZ({editor:e,state:O,from:Math.max(d-1,0),to:h.b-1,rule:f,pasteEvent:p,dropEvent:a})||!m.steps.length)){try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}return o=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,m}};return e.on("destroy",()=>{ys===e&&(ys=null)}),t.map(c=>new Ee({view(d){const h=p=>{var m;r=!((m=d.dom.parentElement)===null||m===void 0)&&m.contains(p.target)?d.dom.parentElement:null,r&&(ys=e)},f=()=>{ys&&(ys=null)};return window.addEventListener("dragstart",h),window.addEventListener("dragend",f),{destroy(){window.removeEventListener("dragstart",h),window.removeEventListener("dragend",f)}}},props:{handleDOMEvents:{drop:(d,h)=>{if(s=r===d.dom.parentElement,a=h,!s){const f=ys;f?.isEditable&&setTimeout(()=>{if(f.isDestroyed)return;const p=f.state.selection;p&&f.commands.deleteRange({from:p.from,to:p.to})},10)}return!1},paste:(d,h)=>{var f;const p=(f=h.clipboardData)===null||f===void 0?void 0:f.getData("text/html");return o=h,i=!!p?.includes("data-pm-slice"),!1}}},appendTransaction:(d,h,f)=>{const p=d[0],m=p.getMeta("uiEvent")==="paste"&&!i,O=p.getMeta("uiEvent")==="drop"&&!s,b=p.getMeta("applyPasteRules"),y=!!b;if(!m&&!O&&!y)return;if(y){let{text:S}=b;typeof S=="string"?S=S:S=Tg(E.from(S),f.schema);const{from:v}=b,w=v+S.length,Q=xZ(S);return l({rule:c,state:f,from:v,to:{b:w},pasteEvt:Q})}const k=h.doc.content.findDiffStart(f.doc.content),x=h.doc.content.findDiffEnd(f.doc.content);if(!(!eZ(k)||!x||k===x.b))return l({rule:c,state:f,from:k,to:x,pasteEvt:o})}}))}var Id=class{constructor(n,e){this.splittableMarks=[],this.nonClearableMarks=[],this.decorationManager=null,this.editor=e,this.baseExtensions=n,this.extensions=wQ(n),this.hasSchemaSpec=e.options.schemaSpec!==void 0,this.schema=U_(this.extensions,e,e.options.schemaSpec),this.setupExtensions()}get commands(){return this.extensions.reduce((n,e)=>{const t=Y(e,"addCommands",{name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:bs(e.name,this.schema)});return t?{...n,...t()}:n},{})}get plugins(){const{editor:n}=this,e=da([...this.extensions].reverse()).flatMap(r=>{const i={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:n,type:bs(r.name,this.schema)},s=[],o=Y(r,"addKeyboardShortcuts",i);let a={};if(r.type==="mark"&&Y(r,"exitable",i)&&(a.ArrowRight=()=>hs.handleExit({editor:n,mark:r})),o){const f=Object.fromEntries(Object.entries(o()).map(([p,m])=>[p,()=>m({editor:n})]));a={...a,...f}}const l=X8(a);s.push(l);const c=Y(r,"addInputRules",i);if(hy(r,n.options.enableInputRules)&&c){const f=c();if(f&&f.length){const p=OZ({editor:n,rules:f}),m=Array.isArray(p)?p:[p];s.push(...m)}}const d=Y(r,"addPasteRules",i);if(hy(r,n.options.enablePasteRules)&&d){const f=d();if(f&&f.length){const p=SZ({editor:n,rules:f});s.push(...p)}}const h=Y(r,"addProseMirrorPlugins",i);if(h){const f=h();s.push(...f)}return s}),t=this.createDecorationPlugin();return t&&e.push(t),e}createDecorationPlugin(){var n;const{editor:e}=this;(n=this.decorationManager)===null||n===void 0||n.destroy();const t=[];return this.extensions.forEach(r=>{const i=Y(r,"addDecorations",{name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:e,type:bs(r.name,this.schema)});i&&t.push({name:r.name,addDecorations:i})}),this.decorationManager=new GB({editor:e,entries:t}),this.decorationManager.plugin}get attributes(){const n=Mg(this.extensions);return this.hasSchemaSpec?kQ(n,this.schema):n}get nodeViews(){const{editor:n}=this,{nodeExtensions:e}=co(this.extensions);return Object.fromEntries(e.filter(t=>!!Y(t,"addNodeView")).map(t=>{const r=this.attributes.filter(a=>a.type===t.name),i=Y(t,"addNodeView",{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:n,type:mt(t.name,this.schema)});if(!i)return[];const s=i();if(!s)return[];const o=(a,l,c,d,h)=>{const f=el(a,r);return s({node:a,view:l,getPos:c,decorations:d,innerDecorations:h,editor:n,extension:t,HTMLAttributes:f})};return[t.name,o]}))}dispatchTransaction(n){const{editor:e}=this;return da([...this.extensions].reverse()).reduceRight((t,r)=>{const i={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:e,type:bs(r.name,this.schema)},s=Y(r,"dispatchTransaction",i);return s?o=>{s.call(i,{transaction:o,next:t})}:t},n)}transformPastedHTML(n){const{editor:e}=this;return da([...this.extensions]).reduce((t,r)=>{const i={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:e,type:bs(r.name,this.schema)},s=Y(r,"transformPastedHTML",i);return s?(o,a)=>{const l=t(o,a);return s.call(i,l)}:t},n||(t=>t))}get markViews(){const{editor:n}=this,{markExtensions:e}=co(this.extensions);return Object.fromEntries(e.filter(t=>!!Y(t,"addMarkView")).map(t=>{const r=this.attributes.filter(o=>o.type===t.name),i=Y(t,"addMarkView",{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:n,type:qr(t.name,this.schema)});if(!i)return[];const s=(o,a,l)=>{const c=el(o,r);return i()({mark:o,view:a,inline:l,editor:n,extension:t,HTMLAttributes:c,updateAttributes:d=>{hZ(o,n,d)}})};return[t.name,s]}))}destroy(){var n;(n=this.decorationManager)===null||n===void 0||n.destroy(),this.extensions.forEach(e=>{let t=e;for(;t.parent;){const r=t.parent;r.child===t&&(r.child=null),t=r}}),this.extensions=[],this.baseExtensions=[],this.decorationManager=null,this.schema=null,this.editor=null}setupExtensions(){const n=this.extensions;this.editor.extensionStorage=Object.fromEntries(n.map(e=>[e.name,e.storage])),n.forEach(e=>{const t={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:bs(e.name,this.schema)};if(e.type==="mark"){var r,i;(!((r=ke(Y(e,"keepOnSplit",t)))!==null&&r!==void 0)||r)&&this.splittableMarks.push(e.name),!((i=ke(Y(e,"clearable",t)))!==null&&i!==void 0)||i||this.nonClearableMarks.push(e.name)}const s=Y(e,"onBeforeCreate",t),o=Y(e,"onCreate",t),a=Y(e,"onUpdate",t),l=Y(e,"onSelectionUpdate",t),c=Y(e,"onTransaction",t),d=Y(e,"onFocus",t),h=Y(e,"onBlur",t),f=Y(e,"onDestroy",t);s&&this.editor.on("beforeCreate",s),o&&this.editor.on("create",o),a&&this.editor.on("update",a),l&&this.editor.on("selectionUpdate",l),c&&this.editor.on("transaction",c),d&&this.editor.on("focus",d),h&&this.editor.on("blur",h),f&&this.editor.on("destroy",f)})}};Id.resolve=wQ;Id.sort=da;Id.flatten=Pg;var at=class WQ extends Eg{constructor(...e){super(...e),this.type="extension"}static create(e={}){const t=typeof e=="function"?e():e;return new WQ(t)}configure(e){return super.configure(e)}extend(e){const t=typeof e=="function"?e():e;return super.extend(t)}};const kZ=at.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new Ee({key:new et("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:n}=this,{state:e,schema:t}=n,{doc:r,selection:i}=e,s=$Q(t),{blockSeparator:o}=this.options,a={...o!==void 0?{blockSeparator:o}:{},textSerializers:s};return[...i.ranges].sort((l,c)=>l.$from.pos-c.$from.pos).map(({$from:l,$to:c})=>QQ(r,{from:l.pos,to:c.pos},a)).join(o??`
|
|
129
|
+
|
|
130
|
+
`)}}})]}}),vZ=at.create({name:"commands",addCommands(){return{...jB}}}),wZ=at.create({name:"delete",onUpdate({transaction:n,appendedTransactions:e}){var t,r;const i=()=>{var s,o,a;if((s=(o=this.editor.options.coreExtensionOptions)===null||o===void 0||(o=o.delete)===null||o===void 0||(a=o.filterTransaction)===null||a===void 0?void 0:a.call(o,n))!==null&&s!==void 0?s:n.getMeta("y-sync$"))return;const l=SQ(n.before,[n,...e]);Nd(l).forEach(d=>{l.mapping.mapResult(d.oldRange.from).deletedAfter&&l.mapping.mapResult(d.oldRange.to).deletedBefore&&l.before.nodesBetween(d.oldRange.from,d.oldRange.to,(h,f)=>{const p=f+h.nodeSize-2,m=d.oldRange.from<=f&&p<=d.oldRange.to;this.editor.emit("delete",{type:"node",node:h,from:f,to:p,newFrom:l.mapping.map(f),newTo:l.mapping.map(p),deletedRange:d.oldRange,newRange:d.newRange,partial:!m,editor:this.editor,transaction:n,combinedTransform:l})})});const c=l.mapping;l.steps.forEach((d,h)=>{if(d instanceof Bn){var f,p;const m=c.slice(h).map(d.from,-1),O=c.slice(h).map(d.to),b=c.invert().map(m,-1),y=c.invert().map(O),k=m>0?(f=l.doc.nodeAt(m-1))===null||f===void 0?void 0:f.marks.some(S=>S.eq(d.mark)):!1,x=(p=l.doc.nodeAt(O))===null||p===void 0?void 0:p.marks.some(S=>S.eq(d.mark));this.editor.emit("delete",{type:"mark",mark:d.mark,from:d.from,to:d.to,deletedRange:{from:b,to:y},newRange:{from:m,to:O},partial:!!(x||k),editor:this.editor,transaction:n,combinedTransform:l})}})};!((t=(r=this.editor.options.coreExtensionOptions)===null||r===void 0||(r=r.delete)===null||r===void 0?void 0:r.async)!==null&&t!==void 0)||t?setTimeout(i,0):i()}}),QZ=at.create({name:"drop",addProseMirrorPlugins(){return[new Ee({key:new et("tiptapDrop"),props:{handleDrop:(n,e,t,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:t,moved:r})}}})]}}),$Z=at.create({name:"editable",addProseMirrorPlugins(){return[new Ee({key:new et("editable"),props:{editable:()=>this.editor.options.editable}})]}}),CZ=new et("focusEvents"),PZ=at.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:n}=this;return[new Ee({key:CZ,props:{handleDOMEvents:{focus:(e,t)=>{n.isFocused=!0;const r=n.state.tr.setMeta("focus",{event:t}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,t)=>{n.isFocused=!1;const r=n.state.tr.setMeta("blur",{event:t}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),TZ=at.create({name:"keymap",addKeyboardShortcuts(){const n=()=>this.editor.commands.first(({commands:o})=>[()=>o.undoInputRule(),()=>o.command(({tr:a})=>{const{selection:l,doc:c}=a,{empty:d,$anchor:h}=l,{pos:f,parent:p}=h,m=h.parent.isTextblock&&f>0?a.doc.resolve(f-1):h,O=m.parent.type.spec.isolating,b=h.pos-h.parentOffset,y=O&&m.parent.childCount===1?b===h.pos:ue.atStart(c).from===f;return!d||!p.type.isTextblock||p.textContent.length||!y||y&&h.parent.type.name==="paragraph"?!1:o.clearNodes()}),()=>o.deleteSelection(),()=>o.joinBackward(),()=>o.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:o})=>[()=>o.deleteSelection(),()=>o.deleteCurrentNode(),()=>o.joinForward(),()=>o.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:o})=>[()=>o.newlineInCode(),()=>o.createParagraphNear(),()=>o.liftEmptyBlock(),()=>o.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:n,"Mod-Backspace":n,"Shift-Backspace":n,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},i={...r},s={...r,"Ctrl-h":n,"Alt-Backspace":n,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Ja()||yQ()?s:i},addProseMirrorPlugins(){return[new Ee({key:new et("clearDocument"),appendTransaction:(n,e,t)=>{if(n.some(p=>p.getMeta("composition")))return;const r=n.some(p=>p.docChanged)&&!e.doc.eq(t.doc),i=n.some(p=>p.getMeta("preventClearDocument"));if(!r||i)return;const{empty:s,from:o,to:a}=e.selection,l=ue.atStart(e.doc).from,c=ue.atEnd(e.doc).to;if(s||!(o===l&&a===c)||!Sl(t.doc))return;const d=t.tr,h=Ad({state:t,transaction:d}),{commands:f}=new Vs({editor:this.editor,state:h});if(f.clearNodes(),!!d.steps.length)return d}})]}}),MZ=at.create({name:"paste",addProseMirrorPlugins(){return[new Ee({key:new et("tiptapPaste"),props:{handlePaste:(n,e,t)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:t})}}})]}}),AZ=at.create({name:"tabindex",addOptions(){return{value:void 0}},addProseMirrorPlugins(){return[new Ee({key:new et("tabindex"),props:{attributes:()=>{var n;return!this.editor.isEditable&&this.options.value===void 0?{}:{tabindex:(n=this.options.value)!==null&&n!==void 0?n:"0"}}}})]}}),RZ=at.create({name:"textDirection",addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];const{nodeExtensions:n}=co(this.extensions);return[{types:n.filter(e=>e.name!=="text").map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{const t=e.getAttribute("dir");return t&&(t==="ltr"||t==="rtl"||t==="auto")?t:this.options.direction},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new Ee({key:new et("textDirection"),props:{attributes:()=>{const n=this.options.direction;return n?{dir:n}:{}}}})]}});let Sy=!1;function EZ(n){if(Sy)return;Sy=!0;let e;try{const t=rt.fromJSON(n,{from:0,to:0});if(!aB(t))return;e=t.slice.content}catch{return}e instanceof E||console.warn("[tiptap warn]: prosemirror-model is loaded more than once. Wrapping and splitting nodes will fail. Deduplicate it in your lock file, or alias it to a single copy in your bundler.")}var NZ=class Uo{get name(){return this.node.type.name}constructor(e,t,r=!1,i=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=e,this.editor=t,this.currentNode=i}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!==null&&e!==void 0?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let t=this.from,r=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}t=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:t,to:r},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const e=this.resolvedPos.start(this.resolvedPos.depth-1),t=this.resolvedPos.doc.resolve(e);return new Uo(t,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new Uo(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new Uo(e,this.editor)}get children(){const e=[];return this.node.content.forEach((t,r)=>{const i=t.isBlock&&!t.isTextblock,s=t.isAtom&&!t.isText,o=t.isInline,a=this.pos+r+(s?0:1);if(a<0||a>this.resolvedPos.doc.nodeSize-2)return;const l=this.resolvedPos.doc.resolve(a);if(!i&&!o&&l.depth<=this.depth)return;const c=new Uo(l,this.editor,i,i||o?t:null);i&&(c.actualDepth=this.depth+1),e.push(c)}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,t={}){let r=null,i=this.parent;for(;i&&!r;){if(i.node.type.name===e)if(Object.keys(t).length>0){const s=i.node.attrs,o=Object.keys(t);for(let a=0;a<o.length;a+=1){const l=o[a];if(s[l]!==t[l])break}}else r=i;i=i.parent}return r}querySelector(e,t={}){return this.querySelectorAll(e,t,!0)[0]||null}querySelectorAll(e,t={},r=!1){let i=[];if(!this.children||this.children.length===0)return i;const s=Object.keys(t);return this.children.forEach(o=>{r&&i.length>0||(o.node.type.name===e&&s.every(a=>t[a]===o.node.attrs[a])&&i.push(o),!(r&&i.length>0)&&(i=i.concat(o.querySelectorAll(e,t,r))))}),i}setAttribute(e){const{tr:t}=this.editor.state;t.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(t)}};const DZ=`.ProseMirror {
|
|
131
|
+
position: relative;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.ProseMirror {
|
|
135
|
+
word-wrap: break-word;
|
|
136
|
+
white-space: pre-wrap;
|
|
137
|
+
white-space: break-spaces;
|
|
138
|
+
-webkit-font-variant-ligatures: none;
|
|
139
|
+
font-variant-ligatures: none;
|
|
140
|
+
font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.ProseMirror [contenteditable="false"] {
|
|
144
|
+
white-space: normal;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.ProseMirror [contenteditable="false"] [contenteditable="true"] {
|
|
148
|
+
white-space: pre-wrap;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.ProseMirror pre {
|
|
152
|
+
white-space: pre-wrap;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
img.ProseMirror-separator {
|
|
156
|
+
display: inline !important;
|
|
157
|
+
border: none !important;
|
|
158
|
+
margin: 0 !important;
|
|
159
|
+
width: 0 !important;
|
|
160
|
+
height: 0 !important;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.ProseMirror-gapcursor {
|
|
164
|
+
display: none;
|
|
165
|
+
pointer-events: none;
|
|
166
|
+
position: absolute;
|
|
167
|
+
margin: 0;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.ProseMirror-gapcursor:after {
|
|
171
|
+
content: "";
|
|
172
|
+
display: block;
|
|
173
|
+
position: absolute;
|
|
174
|
+
top: -2px;
|
|
175
|
+
width: 20px;
|
|
176
|
+
border-top: 1px solid black;
|
|
177
|
+
animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
@keyframes ProseMirror-cursor-blink {
|
|
181
|
+
to {
|
|
182
|
+
visibility: hidden;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.ProseMirror-hideselection *::selection {
|
|
187
|
+
background: transparent;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.ProseMirror-hideselection *::-moz-selection {
|
|
191
|
+
background: transparent;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.ProseMirror-hideselection * {
|
|
195
|
+
caret-color: transparent;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
.ProseMirror-focused .ProseMirror-gapcursor {
|
|
199
|
+
display: block;
|
|
200
|
+
}`;var jZ=class extends XB{constructor(n={}){super(),this.css=null,this.className="tiptap",this.editorView=null,this.isFocused=!1,this.destroyed=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.hasWarnedStaleDecorationRead=!1,this.options={element:typeof document<"u"?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:t})=>{throw t},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:lB,createMappablePosition:cB},this.setOptions(n),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("mount",this.options.onMount),this.on("unmount",this.options.onUnmount),this.on("contentError",this.options.onContentError),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:t,slice:r,moved:i})=>this.options.onDrop(t,r,i)),this.on("paste",({event:t,slice:r})=>this.options.onPaste(t,r)),this.on("delete",this.options.onDelete);const e=this.createDoc();if(!this.editorState){const t=jp(e,this.options.autofocus);this.editorState=Er.create({doc:e,schema:this.schema,selection:t||void 0})}EZ(this.schema),this.options.element&&this.mount(this.options.element)}mount(n){if(typeof document>"u")throw new Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");this.createView(n),this.emit("mount",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.options.autofocus!==!1&&this.options.autofocus!==null&&this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){this.editorState=this.editorView.state;const n=this.editorView.dom;n?.editor&&delete n.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{typeof this.css.remove=="function"?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(n){console.warn("Failed to remove CSS element:",n)}this.css=null,this.emit("unmount",{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager?this.commandManager.chain():Vs.createFakeChain()}can(){return this.commandManager?this.commandManager.can():Vs.createFallbackCan()}injectCSS(){this.options.injectCSS&&typeof document<"u"&&(this.css=KB(DZ,this.options.injectNonce))}setOptions(n={}){this.options={...this.options,...n},!(!this.editorView||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps({...this.options.editorProps,attributes:this.getEditorViewAttributes()}),this.view.updateState(this.state))}setEditable(n,e=!0){this.setOptions({editable:n}),e&&this.emit("update",{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:n=>{this.editorState=n},dispatch:n=>{this.dispatchTransaction(n)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(n,e)=>{if(this.editorView)return this.editorView[e];if(e==="state")return this.editorState;if(e in n)return Reflect.get(n,e);throw new Error(`[tiptap error]: The editor view is not available. Cannot access view['${e}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(n,e){const t=Lp(e)?e(n,[...this.state.plugins]):[...this.state.plugins,n],r=this.state.reconfigure({plugins:t});return this.view.updateState(r),r}unregisterPlugin(n){if(this.isDestroyed)return;const e=this.state.plugins;let t=e;if([].concat(n).forEach(i=>{const s=typeof i=="string"?`${i}$`:i.key;t=t.filter(o=>!o.key.startsWith(s))}),e.length===t.length)return;const r=this.state.reconfigure({plugins:t});return this.view.updateState(r),r}createExtensionManager(){var n,e;const t=[...this.options.enableCoreExtensions?[$Z,kZ.configure({blockSeparator:(n=this.options.coreExtensionOptions)===null||n===void 0||(n=n.clipboardTextSerializer)===null||n===void 0?void 0:n.blockSeparator}),vZ,PZ,TZ,AZ.configure({value:(e=this.options.coreExtensionOptions)===null||e===void 0||(e=e.tabindex)===null||e===void 0?void 0:e.value}),QZ,MZ,wZ,RZ.configure({direction:this.options.textDirection})].filter(r=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[r.name]!==!1:!0):[],...this.options.extensions].filter(r=>["extension","node","mark"].includes(r?.type));this.extensionManager=new Id(t,this)}createCommandManager(){this.commandManager=new Vs({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let n;try{n=Xp(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(e){if(!(e instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(e.message))throw e;const t=Xp(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1});return this.editorState=Er.create({doc:t,schema:this.schema,selection:jp(t,this.options.autofocus)||void 0}),this.emit("contentError",{editor:this,error:e,disableCollaboration:()=>{"collaboration"in this.storage&&typeof this.storage.collaboration=="object"&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(r=>r.name!=="collaboration"),this.createExtensionManager()}}),this.editorState.doc}return n}getEditorViewAttributes(){var n;const e=(n=this.options.editorProps)===null||n===void 0?void 0:n.attributes;return Lp(e)?t=>({role:"textbox",...e(t)}):{role:"textbox",...e}}createView(n){const{editorProps:e,enableExtensionDispatchTransaction:t}=this.options,r=e.dispatchTransaction||this.dispatchTransaction.bind(this),i=t?this.extensionManager.dispatchTransaction(r):r,s=e.transformPastedHTML,o=this.extensionManager.transformPastedHTML(s);this.editorView=new rQ(n,{...e,attributes:this.getEditorViewAttributes(),dispatchTransaction:i,transformPastedHTML:o,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});const a=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(a),this.prependClass(),this.injectCSS();const l=this.view.dom;l.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(n){this.isCapturingTransaction=!0,n(),this.isCapturingTransaction=!1;const e=this.capturedTransaction;return this.capturedTransaction=null,e}dispatchTransaction(n){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=n;return}n.steps.forEach(c=>{var d;return(d=this.capturedTransaction)===null||d===void 0?void 0:d.step(c)});return}const{state:e,transactions:t}=this.state.applyTransaction(n),r=!this.state.selection.eq(e.selection),i=t.includes(n),s=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:n,nextState:e}),!i)return;this.view.updateState(e),this.emit("transaction",{editor:this,transaction:n,appendedTransactions:t.slice(1)}),r&&this.emit("selectionUpdate",{editor:this,transaction:n});const o=t.findLast(c=>c.getMeta("focus")||c.getMeta("blur")),a=o?.getMeta("focus"),l=o?.getMeta("blur");a&&this.emit("focus",{editor:this,event:a.event,transaction:o}),l&&this.emit("blur",{editor:this,event:l.event,transaction:o}),!(n.getMeta("preventUpdate")||!t.some(c=>c.docChanged)||s.doc.eq(e.doc))&&this.emit("update",{editor:this,transaction:n,appendedTransactions:t.slice(1)})}getAttributes(n){return CQ(this.state,n)}isActive(n,e){const t=typeof n=="string"?n:null,r=typeof n=="string"?e:n;return rB(this.state,t,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return Tg(this.state.doc.content,this.schema)}getText(n){const{blockSeparator:e=`
|
|
201
|
+
|
|
202
|
+
`,textSerializers:t={}}=n||{};return G_(this.state.doc,{blockSeparator:e,textSerializers:{...$Q(this.schema),...t}})}get isEmpty(){return Sl(this.state.doc)}destroy(){this.destroyed||(this.destroyed=!0,this.emit("destroy"),this.unmount(),this.removeAllListeners(),this.extensionManager.destroy(),this.extensionManager=null,this.schema=null,this.commandManager=null,this.extensionStorage={})}get isDestroyed(){var n,e;return(n=(e=this.editorView)===null||e===void 0?void 0:e.isDestroyed)!==null&&n!==void 0?n:!0}$node(n,e){var t;return((t=this.$doc)===null||t===void 0?void 0:t.querySelector(n,e))||null}$nodes(n,e){var t;return((t=this.$doc)===null||t===void 0?void 0:t.querySelectorAll(n,e))||null}$pos(n){const e=this.state.doc.resolve(n),t=n>0&&e.nodeAfter&&!e.nodeAfter.isText&&e.nodeAfter.isAtom?e.nodeAfter:null;return new NZ(e,this,!1,t)}get $doc(){return this.$pos(0)}};function us(n){return new kl({find:n.find,handler:({state:e,range:t,match:r})=>{const i=ke(n.getAttributes,void 0,r);if(i===!1||i===null)return null;const{tr:s}=e,o=r[r.length-1],a=r[0];if(o){const l=a.search(/\S/),c=t.from+a.indexOf(o),d=c+o.length;if(Dd(t.from,t.to,e.doc).filter(f=>f.mark.type.excluded.find(p=>p===n.type&&p!==f.mark.type)).filter(f=>f.to>c).length)return null;d<t.to&&s.delete(d,t.to),c>t.from&&s.delete(t.from+l,c);const h=t.from+l+o.length;s.addMark(t.from+l,h,n.type.create(i||{})),s.removeStoredMark(n.type)}},undoable:n.undoable})}function IZ(n){return new kl({find:n.find,handler:({state:e,range:t,match:r})=>{const i=ke(n.getAttributes,void 0,r)||{},{tr:s}=e,o=t.from;let a=t.to;const l=n.type.create(i);if(r[1]){let c=o+r[0].lastIndexOf(r[1]);c>a?c=a:a=c+r[1].length;const d=r[0][r[0].length-1];s.insertText(d,o+r[0].length-1),s.replaceWith(c,a,l)}else if(r[0]){const c=n.type.isInline?o:o-1;s.insert(c,n.type.create(i)).delete(s.mapping.map(o),s.mapping.map(a))}s.scrollIntoView()},undoable:n.undoable})}function Bp(n){return new kl({find:n.find,handler:({state:e,range:t,match:r})=>{const i=e.doc.resolve(t.from),s=ke(n.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),n.type))return null;e.tr.delete(t.from,t.to).setBlockType(t.from,t.from,n.type,s)},undoable:n.undoable})}function uo(n){return new kl({find:n.find,handler:({state:e,range:t,match:r,chain:i})=>{const s=ke(n.getAttributes,void 0,r)||{},o=e.tr.delete(t.from,t.to),a=o.doc.resolve(t.from).blockRange(),l=a&&dg(a,n.type,s);if(!l)return null;if(o.wrap(a,l),n.keepMarks&&n.editor){const{selection:d,storedMarks:h}=e,{splittableMarks:f}=n.editor.extensionManager,p=h||d.$to.parentOffset&&d.$from.marks();if(p){const m=p.filter(O=>f.includes(O.type.name));o.ensureMarks(m)}}if(n.keepAttributes){const d=n.type.name==="bulletList"||n.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(d,s).run()}const c=o.doc.resolve(t.from-1).nodeBefore;c&&c.type===n.type&&Ci(o.doc,t.from-1)&&(!n.joinPredicate||n.joinPredicate(r,c))&&o.join(t.from-1)},undoable:n.undoable})}var sn=class zQ extends Eg{constructor(...e){super(...e),this.type="node"}static create(e={}){const t=typeof e=="function"?e():e;return new zQ(t)}configure(e){return super.configure(e)}extend(e){const t=typeof e=="function"?e():e;return super.extend(t)}};function ki(n){return new ZQ({find:n.find,handler:({state:e,range:t,match:r,pasteEvent:i})=>{const s=ke(n.getAttributes,void 0,r,i);if(s===!1||s===null)return null;const{tr:o}=e,a=r[r.length-1],l=r[0];let c=t.to;if(a){const d=l.search(/\S/),h=t.from+l.indexOf(a),f=h+a.length;if(Dd(t.from,t.to,e.doc).filter(p=>p.mark.type.excluded.find(m=>m===n.type&&m!==p.mark.type)).filter(p=>p.to>h).length)return null;f<t.to&&o.delete(f,t.to),h>t.from&&o.delete(t.from+d,h),c=t.from+d+a.length,o.addMark(t.from+d,c,n.type.create(s||{})),r.index!==void 0&&r.input!==void 0&&r.index+r[0].length>=r.input.length||o.removeStoredMark(n.type)}}})}const{getOwnPropertyNames:XZ,getOwnPropertySymbols:LZ}=Object,{hasOwnProperty:_Z}=Object.prototype;function Do(n,e){return function(r,i,s){return n(r,i,s)&&e(r,i,s)}}function jo(n){return function(t,r,i){if(!t||!r||typeof t!="object"||typeof r!="object")return n(t,r,i);const{cache:s}=i,o=s.get(t),a=s.get(r);if(o&&a)return o===r&&a===t;s.set(t,r),s.set(r,t);const l=n(t,r,i);return s.delete(t),s.delete(r),l}}function BZ(n){return n?.[Symbol.toStringTag]}function ky(n){return XZ(n).concat(LZ(n))}const ZZ=Object.hasOwn||((n,e)=>_Z.call(n,e));function fs(n,e){return n===e||!n&&!e&&n!==n&&e!==e}const WZ="__v",zZ="__o",VZ="_owner",{getOwnPropertyDescriptor:Zp,keys:vy}=Object,FZ=Zp(Object.getPrototypeOf(Int8Array.prototype),Symbol.toStringTag).get;function qZ(n,e){return n.byteLength===e.byteLength&&Qu(new Uint8Array(n),new Uint8Array(e))}function YZ(n,e,t){let r=n.length;if(e.length!==r)return!1;for(;r-- >0;)if(!t.equals(n[r],e[r],r,r,n,e,t))return!1;return!0}function UZ(n,e){return n.byteLength===e.byteLength&&Qu(new Uint8Array(n.buffer,n.byteOffset,n.byteLength),new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}function GZ(n,e){return fs(n.getTime(),e.getTime())}function wy(n,e,t){return n.name===e.name&&n.message===e.message&&n.stack===e.stack&&t.equals(n.cause,e.cause,"cause","cause",n,e,t)}function HZ(n,e){return n===e}function Qy(n,e,t){const r=n.size;if(r!==e.size)return!1;if(!r)return!0;const i=new Array(r),s=n.entries();let o,a,l=0;for(;(o=s.next())&&!o.done;){const c=e.entries();let d=!1,h=0;for(;(a=c.next())&&!a.done;){if(i[h]){h++;continue}const f=o.value,p=a.value;if(t.equals(f[0],p[0],l,h,n,e,t)&&t.equals(f[1],p[1],f[0],p[0],n,e,t)){d=i[h]=!0;break}h++}if(!d)return!1;l++}return!0}const KZ=fs;function $y(n,e,t){const r=vy(n);let i=r.length;if(vy(e).length!==i)return!1;for(;i-- >0;)if(!VQ(n,e,t,r[i]))return!1;return!0}function xs(n,e,t){const r=ky(n);let i=r.length;if(ky(e).length!==i)return!1;let s,o,a;for(;i-- >0;)if(s=r[i],!VQ(n,e,t,s)||(o=Zp(n,s),a=Zp(e,s),(o||a)&&(!o||!a||o.configurable!==a.configurable||o.enumerable!==a.enumerable||o.writable!==a.writable)))return!1;return!0}function JZ(n,e){return fs(n.valueOf(),e.valueOf())}function eW(n,e){return n.source===e.source&&n.flags===e.flags}function Cy(n,e,t){const r=n.size;if(r!==e.size)return!1;if(!r)return!0;const i=new Array(r),s=n.values();let o,a;for(;(o=s.next())&&!o.done;){const l=e.values();let c=!1,d=0;for(;(a=l.next())&&!a.done;){if(!i[d]&&t.equals(o.value,a.value,o.value,a.value,n,e,t)){c=i[d]=!0;break}d++}if(!c)return!1}return!0}function Qu(n,e){let t=n.length;if(e.length!==t||n.byteOffset!==e.byteOffset)return!1;const r=FZ.call(n);if(r==="Float64Array"||r==="Float32Array"||r==="Float16Array"){for(;t-- >0;)if(n[t]!==e[t]&&(n[t]===n[t]||e[t]===e[t]))return!1;return!0}for(;t-- >0;)if(n[t]!==e[t])return!1;return!0}function tW(n,e){return n.href===e.href?!0:n.protocol===e.protocol&&n.username===e.username&&n.password===e.password&&n.host===e.host&&n.pathname===e.pathname&&n.hash===e.hash&&nW(n.searchParams,e.searchParams)}function nW(n,e){const t=n.toString(),r=e.toString();return t===r||Py(t)===Py(r)}function Py(n){return n.split("&").sort().join("&")}function VQ(n,e,t,r){return(r===VZ||r===zZ||r===WZ)&&(n.$$typeof||e.$$typeof)?!0:ZZ(e,r)&&t.equals(n[r],e[r],r,r,n,e,t)}const rW="[object ArrayBuffer]",iW="[object Arguments]",sW="[object Boolean]",oW="[object DataView]",aW="[object Date]",lW="[object Error]",cW="[object Map]",uW="[object Number]",dW="[object Object]",hW="[object RegExp]",fW="[object Set]",pW="[object String]",mW={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},gW="[object URL]",OW=Object.prototype.toString;function bW({areArrayBuffersEqual:n,areArraysEqual:e,areDataViewsEqual:t,areDatesEqual:r,areErrorsEqual:i,areFunctionsEqual:s,areMapsEqual:o,areNumbersEqual:a,areObjectsEqual:l,arePrimitiveWrappersEqual:c,areRegExpsEqual:d,areSetsEqual:h,areTypedArraysEqual:f,areUrlsEqual:p,unknownTagComparators:m}){return function(b,y,k){if(b===y)return!0;if(b==null||y==null)return!1;const x=typeof b;if(x!==typeof y)return!1;if(x!=="object")return x==="number"?a(b,y,k):x==="function"?s(b,y,k):!1;const S=b.constructor;if(S!==y.constructor)return!1;if(S===Object)return l(b,y,k);if(Array.isArray(b))return e(b,y,k);if(S===Date)return r(b,y,k);if(S===RegExp)return d(b,y,k);if(S===Map)return o(b,y,k);if(S===Set)return h(b,y,k);if(S==null)return l(b,y,k);const v=OW.call(b);if(v===aW)return r(b,y,k);if(v===hW)return d(b,y,k);if(v===cW)return o(b,y,k);if(v===fW)return h(b,y,k);if(v===dW)return typeof b.then!="function"&&typeof y.then!="function"&&l(b,y,k);if(v===gW)return p(b,y,k);if(v===lW)return i(b,y,k);if(v===iW)return l(b,y,k);if(mW[v])return f(b,y,k);if(v===rW)return n(b,y,k);if(v===oW)return t(b,y,k);if(v===sW||v===uW||v===pW)return c(b,y,k);if(m){let w=m[v];if(!w){const Q=BZ(b);Q&&(w=m[Q])}if(w)return w(b,y,k)}return!1}}function yW({circular:n,createCustomConfig:e,strict:t}){let r={areArrayBuffersEqual:qZ,areArraysEqual:t?xs:YZ,areDataViewsEqual:UZ,areDatesEqual:GZ,areErrorsEqual:t?Do(wy,xs):Do(wy,$y),areFunctionsEqual:HZ,areMapsEqual:t?Do(Qy,xs):Qy,areNumbersEqual:KZ,areObjectsEqual:t?xs:$y,arePrimitiveWrappersEqual:JZ,areRegExpsEqual:eW,areSetsEqual:t?Do(Cy,xs):Cy,areTypedArraysEqual:t?Do(Qu,xs):Qu,areUrlsEqual:tW,unknownTagComparators:void 0};if(e&&(r=Object.assign({},r,e(r))),n){const i=jo(r.areArraysEqual),s=jo(r.areErrorsEqual),o=jo(r.areMapsEqual),a=jo(r.areObjectsEqual),l=jo(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:i,areErrorsEqual:s,areMapsEqual:o,areObjectsEqual:a,areSetsEqual:l})}return r}function xW(n){return function(e,t,r,i,s,o,a){return n(e,t,a)}}function SW({circular:n,comparator:e,createState:t,equals:r,strict:i}){if(t)return function(a,l){const{cache:c=n?new WeakMap:void 0,meta:d}=t();return e(a,l,{cache:c,equals:r,meta:d,strict:i})};if(n)return function(a,l){return e(a,l,{cache:new WeakMap,equals:r,meta:void 0,strict:i})};const s={cache:void 0,equals:r,meta:void 0,strict:i};return function(a,l){return e(a,l,s)}}Ti();Ti({strict:!0});const kW=Ti({circular:!0});Ti({circular:!0,strict:!0});Ti({createInternalComparator:()=>fs});Ti({strict:!0,createInternalComparator:()=>fs});Ti({circular:!0,createInternalComparator:()=>fs});Ti({circular:!0,createInternalComparator:()=>fs,strict:!0});function Ti(n={}){const{circular:e=!1,createInternalComparator:t,createState:r,strict:i=!1}=n,s=yW(n),o=bW(s),a=t?t(o):xW(o);return SW({circular:e,comparator:o,createState:r,equals:a,strict:i})}function vW(n,e){var t,r;if(n.isDestroyed||e.defaultPrevented||!e.cancelable||!n.isEditable||e.inputType!=="insertParagraph"&&e.inputType!=="insertLineBreak"||!Ja()&&!Ip())return;const i=n.view,s=i.root,o=(t=(r=s.getSelection)===null||r===void 0?void 0:r.call(s))!==null&&t!==void 0?t:i.dom.ownerDocument.getSelection(),a=o?.anchorNode,l=a?.nodeType===1?a:a?.parentElement,c=l?.closest("[data-node-view-content-react]");if(!c||!i.dom.contains(c))return;const d=i.input.lastKeyCode;d===13&&(i.input.lastKeyCode=null),i.domObserver.forceFlush(),i.domObserver.flush();const h=new KeyboardEvent("keydown",{key:"Enter",code:"Enter",keyCode:13,shiftKey:e.inputType==="insertLineBreak",bubbles:!0,cancelable:!0});i.someProp("handleKeyDown",f=>f(i,h))?(e.preventDefault(),i.input.lastIOSEnter=0,clearTimeout(i.input.lastIOSEnterFallbackTimeout)):d===13&&(i.input.lastKeyCode=d)}const Ty=new et("reactMobileEnter"),wW=(...n)=>e=>{n.forEach(t=>{typeof t=="function"?t(e):t&&(t.current=e)})},QW=({contentComponent:n})=>{const e=a2.useSyncExternalStore(n.subscribe,n.getSnapshot,n.getServerSnapshot);return g.jsx(g.Fragment,{children:Object.values(e)})};function $W(){const n=new Set;let e={},t=!1;const r=()=>{t||!n.size||(t=!0,queueMicrotask(()=>{t=!1,n.forEach(i=>i())}))};return{subscribe(i){return n.add(i),()=>{n.delete(i)}},getSnapshot(){return e},getServerSnapshot(){return e},setRenderer(i,s){e={...e,[i]:vC.createPortal(s.reactElement,s.element,i)},r()},removeRenderer(i){const s={...e};delete s[i],e=s,r()}}}var CW=class extends hr.Component{constructor(n){super(n),this.editorContentRef=hr.createRef()}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){var n;const e=this.props.editor;if(e&&!e.isDestroyed&&(!((n=e.view.dom)===null||n===void 0)&&n.parentNode)){if(e.contentComponent)return;const t=this.editorContentRef.current;t.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:t}),e.contentComponent=$W(),e.createNodeViews(),e.registerPlugin(new Ee({key:Ty,props:{handleDOMEvents:{beforeinput:(r,i)=>vW(e,i)}}})),e.isEditorContentInitialized=!0,this.forceUpdate()}}componentWillUnmount(){const n=this.props.editor;if(n){n.isEditorContentInitialized=!1,n.isDestroyed||(n.unregisterPlugin(Ty),n.view.setProps({nodeViews:{}})),n.contentComponent=null;try{var e;if(!(!((e=n.view.dom)===null||e===void 0)&&e.parentNode))return;const t=document.createElement("div");t.append(...n.view.dom.parentNode.childNodes),n.setOptions({element:t})}catch{}}}render(){const{editor:n,innerRef:e,...t}=this.props;return g.jsxs(g.Fragment,{children:[g.jsx("div",{ref:wW(e,this.editorContentRef),...t}),n?.contentComponent&&g.jsx(QW,{contentComponent:n.contentComponent})]})}};const PW=$.forwardRef((n,e)=>{const t=hr.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[n.editor]);return hr.createElement(CW,{key:t,innerRef:e,...n})}),Ng=hr.memo(PW),TW=typeof window<"u"?$.useLayoutEffect:$.useEffect;var MW=class{constructor(n){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=n,this.lastSnapshot={editor:n,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(n){return this.subscribers.add(n),()=>{this.subscribers.delete(n)}}watch(n){if(this.editor=n,this.editor){let e;const t=i=>{i?.transaction!==void 0&&i.transaction===e||(e=i?.transaction,this.transactionNumber+=1,this.subscribers.forEach(s=>s()))},r=this.editor;return r.on("transaction",t),r.on("update",t),()=>{r.off("transaction",t),r.off("update",t)}}}};function AW(n){var e;const[t]=$.useState(()=>new MW(n.editor)),r=PC.useSyncExternalStoreWithSelector(t.subscribe,t.getSnapshot,t.getServerSnapshot,n.selector,(e=n.equalityFn)!==null&&e!==void 0?e:kW);return TW(()=>t.watch(n.editor),[n.editor,t]),$.useDebugValue(r),r}const RW=!1,FQ=typeof window>"u",EW=FQ||!!(typeof window<"u"&&window.next);var NW=class qQ{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(t=>t())}getInitialEditor(){const e=this.options.current.immediatelyRender;let t=e??!0;return FQ?(t&&RW&&console.warn("SSR detected. `immediatelyRender` has been set to false to avoid hydration mismatches"),t=!1):EW&&e===void 0&&(t=!1),t?this.createEditor():null}createEditor(){const e={...this.options.current,onBeforeCreate:(...t)=>{var r,i;return(r=(i=this.options.current).onBeforeCreate)===null||r===void 0?void 0:r.call(i,...t)},onBlur:(...t)=>{var r,i;return(r=(i=this.options.current).onBlur)===null||r===void 0?void 0:r.call(i,...t)},onCreate:(...t)=>{var r,i;return(r=(i=this.options.current).onCreate)===null||r===void 0?void 0:r.call(i,...t)},onDestroy:(...t)=>{var r,i;return(r=(i=this.options.current).onDestroy)===null||r===void 0?void 0:r.call(i,...t)},onFocus:(...t)=>{var r,i;return(r=(i=this.options.current).onFocus)===null||r===void 0?void 0:r.call(i,...t)},onSelectionUpdate:(...t)=>{var r,i;return(r=(i=this.options.current).onSelectionUpdate)===null||r===void 0?void 0:r.call(i,...t)},onTransaction:(...t)=>{var r,i;return(r=(i=this.options.current).onTransaction)===null||r===void 0?void 0:r.call(i,...t)},onUpdate:(...t)=>{var r,i;return(r=(i=this.options.current).onUpdate)===null||r===void 0?void 0:r.call(i,...t)},onContentError:(...t)=>{var r,i;return(r=(i=this.options.current).onContentError)===null||r===void 0?void 0:r.call(i,...t)},onDrop:(...t)=>{var r,i;return(r=(i=this.options.current).onDrop)===null||r===void 0?void 0:r.call(i,...t)},onPaste:(...t)=>{var r,i;return(r=(i=this.options.current).onPaste)===null||r===void 0?void 0:r.call(i,...t)},onDelete:(...t)=>{var r,i;return(r=(i=this.options.current).onDelete)===null||r===void 0?void 0:r.call(i,...t)},onMount:(...t)=>{var r,i;return(r=(i=this.options.current).onMount)===null||r===void 0?void 0:r.call(i,...t)},onUnmount:(...t)=>{var r,i;return(r=(i=this.options.current).onUnmount)===null||r===void 0?void 0:r.call(i,...t)}};return new jZ(e)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}static compareOptions(e,t){return Object.keys(e).every(r=>["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(r)?!0:r==="extensions"&&e.extensions&&t.extensions?e.extensions.length!==t.extensions.length?!1:e.extensions.every((i,s)=>{var o;return i===((o=t.extensions)===null||o===void 0?void 0:o[s])}):e[r]===t[r])}onRender(e){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&e.length===0?qQ.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(e),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((t,r)=>t===e[r]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){const e=this.instanceId,t=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===e){t&&t.setOptions(this.options.current);return}t&&!t.isDestroyed&&(t.destroy(),this.instanceId===e&&this.setEditor(null))},1)}};function DW(n={},e=[]){const t=$.useRef(n);t.current=n;const[r]=$.useState(()=>new NW(t)),i=a2.useSyncExternalStore(r.subscribe,r.getEditor,r.getServerSnapshot);return $.useDebugValue(i),$.useEffect(r.onRender(e)),AW({editor:i,selector:({transactionNumber:s})=>n.shouldRerenderOnTransaction===!1||n.shouldRerenderOnTransaction===void 0?null:n.immediatelyRender&&s===0?0:s+1}),i}const YQ=$.createContext({editor:null});YQ.Consumer;const jW=$.createContext({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),IW=()=>$.useContext(jW);hr.forwardRef((n,e)=>{const{onDragStart:t}=IW(),r=n.as||"div";return g.jsx(r,{...n,ref:e,"data-node-view-wrapper":"",onDragStart:t,style:{whiteSpace:"normal",...n.style}})});hr.createContext({markViewContentRef:()=>{}});const Dg=$.createContext({get editor(){throw new Error("useTiptap must be used within a <Tiptap> provider")}});Dg.displayName="TiptapContext";const XW=()=>$.useContext(Dg);function UQ({children:n,...e}){const t="editor"in e?e.editor:e.instance;if(!t)throw new Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");const r=$.useMemo(()=>({editor:t}),[t]),i=$.useMemo(()=>({editor:t}),[t]);return g.jsx(YQ.Provider,{value:i,children:g.jsx(Dg.Provider,{value:r,children:n})})}UQ.displayName="Tiptap";function GQ({...n}){const{editor:e}=XW();return g.jsx(Ng,{editor:e,...n})}GQ.displayName="Tiptap.Content";Object.assign(UQ,{Content:GQ});const LW=fo(`
|
|
203
|
+
query Members($orgId: ID!) {
|
|
204
|
+
members(orgId: $orgId) {
|
|
205
|
+
userId
|
|
206
|
+
email
|
|
207
|
+
name
|
|
208
|
+
avatarUrl
|
|
209
|
+
role
|
|
210
|
+
teamId
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
`);function _W(n){var e;const{char:t,allowSpaces:r,allowToIncludeChar:i,allowedPrefixes:s,startOfLine:o,$position:a}=n,l=r&&!i,c=JB(t),d=new RegExp(`\\s${c}$`),h=o?"^":"",f=i?"":c,p=l?new RegExp(`${h}${c}.*?(?=\\s${f}|$)`,"gm"):new RegExp(`${h}(?:^)?${c}[^\\s${f}]*`,"gm"),m=((e=a.nodeBefore)===null||e===void 0?void 0:e.isText)&&a.nodeBefore.text;if(!m)return null;const O=a.pos-m.length,b=Array.from(m.matchAll(p)).pop();if(!b||b.input===void 0||b.index===void 0)return null;const y=b.input.slice(Math.max(0,b.index-1),b.index),k=new RegExp(`^[${s?.join("")}\0]?$`).test(y);if(s!==null&&!k)return null;const x=O+b.index;let S=x+b[0].length;return l&&d.test(m.slice(S-1,S+1))&&(b[0]+=" ",S+=1),x<a.pos&&S>=a.pos?{range:{from:x,to:S},query:b[0].slice(t.length),text:b[0]}:null}function BW(n){return n.docChanged?n.steps.some(e=>{const t=e.slice;if(!t?.content)return!1;const r=t.content.textBetween(0,t.content.size,`
|
|
214
|
+
`);return/\s/.test(r)}):!1}function ZW(n){return()=>{const e=n.state.selection.$anchor.pos,{top:t,right:r,bottom:i,left:s}=n.view.coordsAtPos(e);try{return new DOMRect(s,t,r-s,i-t)}catch{return null}}}function WW(n,e,t,r){return t?()=>{const i=r.getState(n.state),s=i?.decorationId,o=e.dom.querySelector(`[data-decoration-id="${s}"]`);return o?.getBoundingClientRect()||null}:ZW(n)}function zW({match:n,dismissedRange:e,state:t,transaction:r,editor:i,shouldResetDismissed:s,effectiveAllowSpaces:o}){return s?.({editor:i,state:t,range:e,match:n,transaction:r,allowSpaces:o})?!1:o?n.range.from===e.from:n.range.from===e.from&&!BW(r)}function VW({view:n,pluginKeyRef:e}){const t=n.state.tr.setMeta(e,{exit:!0});n.dispatch(t)}function FW({pluginKey:n,decorationTag:e,decorationClass:t,decorationContent:r,decorationEmptyClass:i,renderer:s,dispatchExit:o}){return{handleKeyDown(a,l){var c;const d=n.getState(a.state);if(!d.active)return!1;if(l.key==="Escape"||l.key==="Esc"){var h;return s==null||(h=s.onKeyDown)===null||h===void 0||h.call(s,{view:a,event:l,range:d.range}),o(a),!0}return(s==null||(c=s.onKeyDown)===null||c===void 0?void 0:c.call(s,{view:a,event:l,range:d.range}))||!1},decorations(a){const{active:l,range:c,decorationId:d,query:h}=n.getState(a);if(!l)return null;const f=!h?.length,p=[t];return f&&p.push(i),ye.create(a.doc,[jt.inline(c.from,c.to,{nodeName:e,class:p.join(" "),"data-decoration-id":d||void 0,"data-decoration-content":r})])}}}function qW({editor:n,char:e,effectiveAllowSpaces:t,allowToIncludeChar:r,allowedPrefixes:i,startOfLine:s,findSuggestionMatch:o,allow:a,shouldShow:l,shouldKeepDismissed:c,pluginKey:d}){return{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1,dismissedRange:null}},apply(h,f,p,m){const{isEditable:O}=n,{composing:b}=n.view,{selection:y}=h,{empty:k,from:x}=y,S={...f},v=h.getMeta(d);if(v&&v.exit)return S.active=!1,S.decorationId=null,S.range={from:0,to:0},S.query=null,S.text=null,S.dismissedRange=f.active?{...f.range}:f.dismissedRange,S;if(S.composing=b,h.docChanged&&S.dismissedRange!==null&&(S.dismissedRange={from:h.mapping.map(S.dismissedRange.from),to:h.mapping.map(S.dismissedRange.to)}),O&&(k||n.view.composing)){(x<f.range.from||x>f.range.to)&&!b&&!f.composing&&(S.active=!1);const w=o({char:e,allowSpaces:t,allowToIncludeChar:r,allowedPrefixes:i,startOfLine:s,$position:y.$from}),Q=`id_${Math.floor(Math.random()*4294967295)}`;w&&a({editor:n,state:m,range:w.range,isActive:f.active})&&(!l||l({editor:n,range:w.range,query:w.query,text:w.text,transaction:h}))?(S.dismissedRange!==null&&!c({match:w,dismissedRange:S.dismissedRange,state:m,transaction:h})&&(S.dismissedRange=null),S.dismissedRange===null?(S.active=!0,S.decorationId=f.decorationId||Q,S.range=w.range,S.query=w.query,S.text=w.text):S.active=!1):(w||(S.dismissedRange=null),S.active=!1)}else S.active=!1;return S.active||(S.decorationId=null,S.range={from:0,to:0},S.query=null,S.text=null),S}}}function YW({editor:n,items:e}){let t=null,r=null,i=null;const s=()=>{r!==null&&(clearTimeout(r),r=null),i?.(),i=null},o=c=>new Promise(d=>{i=d,r=setTimeout(()=>{r=null;const h=i;i=null,h?.()},c)}),a=()=>{t?.abort(),s(),t=null};return{abort:a,fetch:async(c,d)=>{a(),t=new AbortController;const h=t;if(d>0&&await o(d),t!==h||h.signal.aborted)return{status:"aborted"};try{const f=await e({editor:n,query:c,signal:h.signal});return t!==h||h.signal.aborted?{status:"aborted"}:{status:"resolved",items:f}}catch{return t!==h||h.signal.aborted?{status:"aborted"}:{status:"error"}}}}}function UW({placement:n,offset:e,flip:t,floatingUi:r}){var i,s,o,a;const l=[eC({mainAxis:(i=e.mainAxis)!==null&&i!==void 0?i:4,crossAxis:(s=e.crossAxis)!==null&&s!==void 0?s:0})];return t&&l.push(tC()),!(r==null||(o=r.middleware)===null||o===void 0)&&o.length&&l.push(...r.middleware),{placement:n,strategy:(a=r?.strategy)!==null&&a!==void 0?a:"absolute",middleware:l}}function GW(n){if(n instanceof HTMLElement)return n;if(typeof n=="string")try{const e=document.querySelector(n);if(e)return e}catch{return document.body}return document.body}function HW({getReferenceRect:n,contextElement:e,config:t,container:r,dismissOnOutsideClick:i,dismiss:s}){return(o,a={})=>{const l={getBoundingClientRect:()=>{var m;return(m=n())!==null&&m!==void 0?m:new DOMRect},contextElement:e};let c=!1;const d=!o.isConnected;d&&GW(r).appendChild(o),a.onPosition||(o.style.visibility="hidden",o.style.width="max-content");const f=nC(l,o,()=>{rC(l,o,{placement:t.placement,strategy:t.strategy,middleware:t.middleware}).then(({x:m,y:O,placement:b,strategy:y})=>{if(a.onPosition){a.onPosition({x:m,y:O,placement:b,strategy:y});return}Object.assign(o.style,{position:y,left:`${m}px`,top:`${O}px`}),c||(c=!0,o.style.visibility="")})},a.autoUpdate);let p;return i&&(p=m=>{const O=m.target;!(O instanceof Node)||o.contains(O)||e.contains(O)||s()},document.addEventListener("pointerdown",p,!0)),()=>{f(),p&&document.removeEventListener("pointerdown",p,!0),d&&o.remove()}}}function KW({editor:n,pluginKey:e,items:t,renderer:r,minQueryLength:i,debounce:s,initialItems:o,placement:a,offset:l,container:c,flip:d,floatingUi:h,dismissOnOutsideClick:f,command:p,clientRectFor:m,dispatchExit:O}){let b;const y=YW({editor:n,items:t}),k=UW({placement:a,offset:l,flip:d,floatingUi:h});function x(S,v){switch(S){case"started":var w;r==null||(w=r.onStart)===null||w===void 0||w.call(r,v);break;case"updated":var Q;r==null||(Q=r.onUpdate)===null||Q===void 0||Q.call(r,v);break;case"stopped":var P;r==null||(P=r.onExit)===null||P===void 0||P.call(r,v)}}return{update:async(S,v)=>{var w,Q;const P=e.getState(v),T=e.getState(S.state);if(!P||!T)return;let C=null;const R=P.query!==T.query,M=P.text!==T.text,j=P.range.from!==T.range.from||P.range.to!==T.range.to,N=R||M||j;if(!P.active&&T.active)C="started";else if(P.active&&!T.active)C="stopped";else if(T.active&&N)C="updated";else return;const I=C==="stopped"?P:T,L=S.dom.querySelector(`[data-decoration-id="${I.decorationId}"]`),te=m(S,L),le=i===0||(I.query?I.query.length>=i:!1),_=(C==="started"||C==="updated")&≤if(b={editor:n,range:I.range,query:I.query||"",text:I.text||"",items:o??[],command:pe=>p({editor:n,range:I.range,props:pe}),decorationNode:L,clientRect:te,loading:_,placement:a,offset:{mainAxis:(w=l.mainAxis)!==null&&w!==void 0?w:4,crossAxis:(Q=l.crossAxis)!==null&&Q!==void 0?Q:0},container:c,flip:d,floatingUi:k,mount:HW({getReferenceRect:te,contextElement:S.dom,config:k,container:c,dismissOnOutsideClick:f,dismiss:()=>O(n.view)})},C==="started"){var re;r==null||(re=r.onBeforeStart)===null||re===void 0||re.call(r,b)}if(C==="updated"){var ie;r==null||(ie=r.onBeforeUpdate)===null||ie===void 0||ie.call(r,b)}if(C==="started"&&x(C,b),C==="started"||C==="updated")if(!_)y.abort(),b={...b,items:o??[],loading:!1};else{b={...b,items:o??[],loading:!0},C="updated",x(C,b);const pe=await y.fetch(I.query||"",s);if(pe.status==="aborted")return;const Oe=e.getState(S.state);if(!Oe?.active){y.abort();return}b=pe.status==="resolved"?{...b,items:pe.items,loading:!1}:{...b,loading:!1}}if(C==="stopped"){y.abort(),x(C,b),b=void 0;return}C==="updated"&&x(C,b)},destroy:()=>{var S;y.abort(),b&&(r==null||(S=r.onExit)===null||S===void 0||S.call(r,b))}}}const JW=new et("suggestion");function ez({pluginKey:n=JW,editor:e,char:t="@",allowSpaces:r=!1,allowToIncludeChar:i=!1,allowedPrefixes:s=[" "],startOfLine:o=!1,decorationTag:a="span",decorationClass:l="suggestion",decorationContent:c="",decorationEmptyClass:d="is-empty",command:h=()=>null,items:f=()=>[],minQueryLength:p=0,debounce:m=0,initialItems:O,placement:b="bottom-start",offset:y={},container:k,flip:x=!0,floatingUi:S,dismissOnOutsideClick:v=!0,render:w=()=>({}),allow:Q=()=>!0,findSuggestionMatch:P=_W,shouldShow:T,shouldResetDismissed:C}){const R=w?.(),M=r&&!i,j=(L,te)=>WW(e,L,te,n);function N(L){return zW({...L,editor:e,shouldResetDismissed:C,effectiveAllowSpaces:M})}const I=L=>VW({view:L,pluginKeyRef:n});return new Ee({key:n,view:()=>KW({editor:e,pluginKey:n,items:f,renderer:R,minQueryLength:p,debounce:m,initialItems:O,placement:b,offset:y,container:k,flip:x,floatingUi:S,dismissOnOutsideClick:v,command:h,clientRectFor:j,dispatchExit:I}),state:qW({editor:e,char:t,effectiveAllowSpaces:M,allowToIncludeChar:i,allowedPrefixes:s,startOfLine:o,findSuggestionMatch:P,allow:Q,shouldShow:T,shouldKeepDismissed:N,pluginKey:n}),props:FW({pluginKey:n,decorationTag:a,decorationClass:l,decorationContent:c,decorationEmptyClass:d,renderer:R,dispatchExit:I})})}function tz({editor:n,overrideSuggestionOptions:e,extensionName:t,char:r="@"}){return{editor:n,char:r,pluginKey:new et,command:({editor:i,range:s,props:o})=>{var a,l;const c=i.view.state.selection.$to.nodeAfter;!(c==null||(a=c.text)===null||a===void 0)&&a.startsWith(" ")&&(s.to+=1),i.chain().focus().insertContentAt(s,[{type:t,attrs:{...o,mentionSuggestionChar:r}},{type:"text",text:" "}]).run(),(l=i.view.dom.ownerDocument.defaultView)===null||l===void 0||(l=l.getSelection())===null||l===void 0||l.collapseToEnd()},allow:({state:i,range:s})=>{const o=i.doc.resolve(s.from),a=i.schema.nodes[t];return!!o.parent.type.contentMatch.matchType(a)},...e}}function HQ(n){return(n.options.suggestions.length?n.options.suggestions:[n.options.suggestion]).map(e=>tz({editor:n.editor,overrideSuggestionOptions:e,extensionName:n.name,char:e.char}))}function My(n,e){const t=HQ(n),r=t.find(i=>i.char===e);return r||(t.length?t[0]:null)}const nz=sn.create({name:"mention",priority:101,addOptions(){return{HTMLAttributes:{},renderText({node:n,suggestion:e}){var t,r;return`${(t=e?.char)!==null&&t!==void 0?t:"@"}${(r=n.attrs.label)!==null&&r!==void 0?r:n.attrs.id}`},deleteTriggerWithBackspace:!1,renderHTML({options:n,node:e,suggestion:t}){var r,i;return["span",Ke(this.HTMLAttributes,n.HTMLAttributes),`${(r=t?.char)!==null&&r!==void 0?r:"@"}${(i=e.attrs.label)!==null&&i!==void 0?i:e.attrs.id}`]},suggestions:[],suggestion:{}}},group:"inline",inline:!0,selectable:!1,atom:!0,addAttributes(){return{id:{default:null,parseHTML:n=>n.getAttribute("data-id"),renderHTML:n=>n.id?{"data-id":n.id}:{}},label:{default:null,parseHTML:n=>n.getAttribute("data-label"),renderHTML:n=>n.label?{"data-label":n.label}:{}},mentionSuggestionChar:{default:"@",parseHTML:n=>n.getAttribute("data-mention-suggestion-char"),renderHTML:n=>({"data-mention-suggestion-char":n.mentionSuggestionChar})}}},parseHTML(){return[{tag:`span[data-type="${this.name}"]`}]},renderHTML({node:n,HTMLAttributes:e}){const t=My(this,n.attrs.mentionSuggestionChar);if(this.options.renderLabel!==void 0)return console.warn("renderLabel is deprecated use renderText and renderHTML instead"),["span",Ke({"data-type":this.name},this.options.HTMLAttributes,e),this.options.renderLabel({options:this.options,node:n,suggestion:t})];const r={...this.options};r.HTMLAttributes=Ke({"data-type":this.name},this.options.HTMLAttributes,e);const i=this.options.renderHTML({options:r,node:n,suggestion:t});return typeof i=="string"?["span",Ke({"data-type":this.name},this.options.HTMLAttributes,e),i]:i},...dZ({nodeName:"mention",name:"@",selfClosing:!0,allowedAttributes:["id","label",{name:"mentionSuggestionChar",skipIfDefault:"@"}],parseAttributes:n=>{const e={},t=/(?:^|\s)(\w+)=(?:"([^"]*)"|'([^']*)')/g;let r=t.exec(n);for(;r!==null;){const[,i,s,o]=r;e[i==="char"?"mentionSuggestionChar":i]=s??o,r=t.exec(n)}return e},serializeAttributes:n=>Object.entries(n).filter(([,e])=>e!=null).map(([e,t])=>`${e==="mentionSuggestionChar"?"char":e}="${t}"`).join(" ")}),renderText({node:n}){const e={options:this.options,node:n,suggestion:My(this,n.attrs.mentionSuggestionChar)};return this.options.renderLabel!==void 0?(console.warn("renderLabel is deprecated use renderText and renderHTML instead"),this.options.renderLabel(e)):this.options.renderText(e)},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command(({tr:n,state:e})=>{let t=!1;const{selection:r}=e,{empty:i,anchor:s}=r;if(!i)return!1;let o=new li,a=0;return e.doc.nodesBetween(s-1,s,(l,c)=>{if(l.type.name===this.name)return t=!0,o=l,a=c,!1}),t&&n.insertText(this.options.deleteTriggerWithBackspace?"":o.attrs.mentionSuggestionChar,a,a+o.nodeSize),t})}},addProseMirrorPlugins(){return HQ(this).map(ez)}});var rz=nz;function iz(n={}){return new Ee({view(e){return new sz(e,n)}})}class sz{constructor(e,t){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.lastDragEvent=null,this.width=(r=t.width)!==null&&r!==void 0?r:1,this.color=t.color===!1?void 0:t.color||"black",this.class=t.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let s=o=>{this[i](o)};return e.dom.addEventListener(i,s),{name:i,handler:s}})}destroy(){this.setCursor(null),this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){if(this.cursorPos!=null&&t.doc!=e.state.doc)if(this.lastDragEvent){let r=this.computeTarget(this.lastDragEvent);r==this.cursorPos?this.updateOverlay():this.setCursor(r)}else this.updateOverlay()}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),t=!e.parent.inlineContent,r,i=this.editorView.dom,s=i.getBoundingClientRect(),o=s.width/i.offsetWidth,a=s.height/i.offsetHeight;if(t){let h=e.nodeBefore,f=e.nodeAfter;if(h||f){let p=this.editorView.nodeDOM(this.cursorPos-(h?h.nodeSize:0));if(p){let m=p.getBoundingClientRect(),O=h?m.bottom:m.top;h&&f&&(O=(O+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let b=this.width/2*a;r={left:m.left,right:m.right,top:O-b,bottom:O+b}}}}if(!r){let h=this.editorView.coordsAtPos(this.cursorPos),f=this.width/2*o;r={left:h.left-f,right:h.left+f,top:h.top,bottom:h.bottom}}let l=this.editorView.dom.offsetParent;this.element||(this.element=l.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",t),this.element.classList.toggle("prosemirror-dropcursor-inline",!t);let c,d;if(!l||l==document.body&&getComputedStyle(l).position=="static")c=-pageXOffset,d=-pageYOffset;else{let h=l.getBoundingClientRect(),f=h.width/l.offsetWidth,p=h.height/l.offsetHeight;c=h.left-l.scrollLeft*f,d=h.top-l.scrollTop*p}this.element.style.left=(r.left-c)/o+"px",this.element.style.top=(r.top-d)/a+"px",this.element.style.width=(r.right-r.left)/o+"px",this.element.style.height=(r.bottom-r.top)/a+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}computeTarget(e){let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),i=r&&r.type.spec.disableDropCursor,s=typeof i=="function"?i(this.editorView,t,e):i;if(!t||s)return null;let o=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let a=Jw(this.editorView.state.doc,o,this.editorView.dragging.slice);a!=null&&(o=a)}return o}dragover(e){if(!this.editorView.editable)return;this.lastDragEvent=e;let t=this.computeTarget(e);t!=null&&(this.setCursor(t),this.scheduleRemoval(5e3))}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}class it extends ue{constructor(e){super(e,e)}map(e,t){let r=e.resolve(t.map(this.head));return it.valid(r)?new it(r):ue.near(r)}content(){return z.empty}eq(e){return e instanceof it&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new it(e.resolve(t.pos))}getBookmark(){return new jg(this.anchor)}static valid(e){let t=e.parent;if(t.inlineContent||!oz(e)||!az(e))return!1;let r=t.type.spec.allowGapCursor;if(r!=null)return r;let i=t.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,t,r=!1){e:for(;;){if(!r&&it.valid(e))return e;let i=e.pos,s=null;for(let o=e.depth;;o--){let a=e.node(o);if(t>0?e.indexAfter(o)<a.childCount:e.index(o)>0){s=a.child(t>0?e.indexAfter(o):e.index(o)-1);break}else if(o==0)return null;i+=t;let l=e.doc.resolve(i);if(it.valid(l))return l}for(;;){let o=t>0?s.firstChild:s.lastChild;if(!o){if(s.isAtom&&!s.isText&&!ee.isSelectable(s)){e=e.doc.resolve(i+s.nodeSize*t),r=!1;continue e}break}s=o,i+=t;let a=e.doc.resolve(i);if(it.valid(a))return a}return null}}}it.prototype.visible=!1;it.findFrom=it.findGapCursorFrom;ue.jsonID("gapcursor",it);class jg{constructor(e){this.pos=e}map(e){return new jg(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return it.valid(t)?new it(t):ue.near(t)}}function KQ(n){return n.isAtom||n.spec.isolating||n.spec.createGapCursor}function oz(n){for(let e=n.depth;e>=0;e--){let t=n.index(e),r=n.node(e);if(t==0){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(t-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||KQ(i.type))return!0;if(i.inlineContent)return!1}}return!0}function az(n){for(let e=n.depth;e>=0;e--){let t=n.indexAfter(e),r=n.node(e);if(t==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(t);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||KQ(i.type))return!0;if(i.inlineContent)return!1}}return!0}function lz(){return new Ee({props:{decorations:hz,createSelectionBetween(n,e,t){return e.pos==t.pos&&it.valid(t)?new it(t):null},handleClick:uz,handleKeyDown:cz,handleDOMEvents:{beforeinput:dz}}})}const cz=iQ({ArrowLeft:sc("horiz",-1),ArrowRight:sc("horiz",1),ArrowUp:sc("vert",-1),ArrowDown:sc("vert",1)});function sc(n,e){const t=n=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,i,s){let o=r.selection,a=e>0?o.$to:o.$from,l=o.empty;if(o instanceof J){if(!s.endOfTextblock(t)||a.depth==0)return!1;l=!1,a=r.doc.resolve(e>0?a.after():a.before())}let c=it.findGapCursorFrom(a,e,l);return c?(i&&i(r.tr.setSelection(new it(c))),!0):!1}}function uz(n,e,t){if(!n||!n.editable)return!1;let r=n.state.doc.resolve(e);if(!it.valid(r))return!1;let i=n.posAtCoords({left:t.clientX,top:t.clientY});return i&&i.inside>-1&&ee.isSelectable(n.state.doc.nodeAt(i.inside))?!1:(n.dispatch(n.state.tr.setSelection(new it(r))),!0)}function dz(n,e){if(e.inputType!="insertCompositionText"||!(n.state.selection instanceof it))return!1;let{$from:t}=n.state.selection,r=t.parent.contentMatchAt(t.index()).findWrapping(n.state.schema.nodes.text);if(!r)return!1;let i=E.empty;for(let o=r.length-1;o>=0;o--)i=E.from(r[o].createAndFill(null,i));let s=n.state.tr.replace(t.pos,t.pos,new z(i,0,0));return s.setSelection(J.near(s.doc.resolve(t.pos+1))),n.dispatch(s),!1}function hz(n){if(!(n.selection instanceof it))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",ye.create(n.doc,[jt.widget(n.selection.head,e,{key:"gapcursor"})])}at.create({name:"characterCount",addOptions(){return{limit:null,autoTrim:!0,mode:"textSize",textCounter:n=>n.length,wordCounter:n=>n.split(" ").filter(e=>e!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=n=>{const e=n?.node||this.editor.state.doc;if((n?.mode||this.options.mode)==="textSize"){const t=e.textBetween(0,e.content.size,void 0," ");return this.options.textCounter(t)}return e.nodeSize},this.storage.words=n=>{const e=n?.node||this.editor.state.doc,t=e.textBetween(0,e.content.size," "," ");return this.options.wordCounter(t)}},addProseMirrorPlugins(){let n=!1;return[new Ee({key:new et("characterCount"),appendTransaction:(e,t,r)=>{if(n)return;const i=this.options.limit,s=this.options.autoTrim;if(i==null||i===0||s===!1){n=!0;return}const o=this.storage.characters({node:r.doc});if(o>i){const a=o-i,l=0,c=a;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);const d=r.tr.deleteRange(l,c);return n=!0,d}n=!0},filterTransaction:(e,t)=>{const r=this.options.limit;if(!e.docChanged||r===0||r===null||r===void 0)return!0;const i=this.storage.characters({node:t.doc}),s=this.storage.characters({node:e.doc});if(s<=r||i>r&&s>r&&s<=i)return!0;if(i>r&&s>r&&s>i||!e.getMeta("paste"))return!1;const o=e.selection.$head.pos,a=o-(s-r),l=o;return e.deleteRange(a,l),!(this.storage.characters({node:e.doc})>r)}})]}});const fz=at.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[iz(this.options)]}});at.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new Ee({key:new et("focus"),props:{decorations:({doc:n,selection:e})=>{const{isEditable:t,isFocused:r}=this.editor,{anchor:i}=e,s=[];if(!t||!r)return ye.create(n,[]);let o=0;this.options.mode==="deepest"&&n.descendants((l,c)=>{if(!l.isText){if(!(i>=c&&i<=c+l.nodeSize-1))return!1;o+=1}});let a=0;return n.descendants((l,c)=>{if(l.isText||!(i>=c&&i<=c+l.nodeSize-1))return!1;if(a+=1,this.options.mode==="deepest"&&o-a>0||this.options.mode==="shallowest"&&a>1)return this.options.mode==="deepest";s.push(jt.node(c,c+l.nodeSize,{class:this.options.className}))}),ye.create(n,s)}}})]}});const pz=at.create({name:"gapCursor",addProseMirrorPlugins(){return[lz()]},extendNodeSchema(n){var e;const t={name:n.name,options:n.options,storage:n.storage};return{allowGapCursor:(e=ke(Y(n,"allowGapCursor",t)))!==null&&e!==void 0?e:null}}}),JQ="placeholder",Ay=new et("tiptap__placeholder");function e$(n){const{editor:e,placeholder:t,dataAttribute:r,pos:i,node:s,isEmptyDoc:o,hasAnchor:a,classes:{emptyNode:l,emptyEditor:c}}=n,d=[l];return o&&d.push(c),jt.node(i,i+s.nodeSize,{class:d.join(" "),[r]:typeof t=="function"?t({editor:e,node:s,pos:i,hasAnchor:a}):t})}function t$(n,e){return typeof n=="function"?n(e):n}function n$({editor:n,options:e,dataAttribute:t,doc:r,selection:i,from:s,to:o}){const{anchor:a}=i,l=[],c=n.isEmpty;return r.nodesBetween(s,o,(d,h)=>{const f=a>=h&&a<=h+d.nodeSize,p=!d.isLeaf&&Sl(d);return d.type.isTextblock&&(f||!e.showOnlyCurrent)&&p&&l.push(e$({editor:n,isEmptyDoc:c,dataAttribute:t,hasAnchor:f,placeholder:e.placeholder,classes:{emptyEditor:e.emptyEditorClass,emptyNode:t$(e.emptyNodeClass,{editor:n,node:d,pos:h,hasAnchor:f})},node:d,pos:h})),e.includeChildren}),l}function r$({editor:n,options:e,dataAttribute:t,doc:r,selection:i}){if(!(n.isEditable||!e.showOnlyWhenEditable))return null;const{anchor:s}=i,o=[],a=n.isEmpty;if(e.showOnlyCurrent&&!e.includeChildren){const l=r.resolve(s),c=l.depth>0?l.node(1):l.nodeAfter,d=l.depth>0?l.before(1):s;if(c&&c.type.isTextblock&&Sl(c)){const h=s>=d&&s<=d+c.nodeSize;o.push(e$({editor:n,isEmptyDoc:a,dataAttribute:t,hasAnchor:h,placeholder:e.placeholder,classes:{emptyEditor:e.emptyEditorClass,emptyNode:t$(e.emptyNodeClass,{editor:n,node:c,pos:d,hasAnchor:h})},node:c,pos:d}))}}else o.push(...n$({editor:n,options:e,dataAttribute:t,doc:r,selection:i,from:0,to:r.content.size}));return ye.create(r,o)}function ha(n,e){const t=n.resolve(e);if(t.depth===0){var r;const s=(r=t.nodeAfter)!==null&&r!==void 0?r:t.nodeBefore;if(!s)return{from:e,to:e};const o=t.nodeAfter?e:e-s.nodeSize;return{from:o,to:o+s.nodeSize}}const i=t.before(1);return{from:i,to:i+t.node(1).nodeSize}}function fa(n,e){return{from:Math.max(0,e.from-1),to:Math.min(n.content.size,e.to-1)}}function mz(n,e,t){const r=[];return n.forEach((i,s)=>{const o=s,a=o+i.nodeSize,l=o+1,c=a+1;l<t&&c>e&&r.push({from:o,to:a})}),r}function gz(n){if(n.length===0)return[];const e=[...n].sort((r,i)=>r.from-i.from),t=[{...e[0]}];for(let r=1;r<e.length;r+=1){const i=t[t.length-1],s=e[r];s.from<=i.to?i.to=Math.max(i.to,s.to):t.push({...s})}return t}function Oz(n,e){const t=mz(n,e.from,e.to);return t.push(fa(n,ha(n,e.from))),e.to>e.from?t.push(fa(n,ha(n,Math.min(e.to,n.content.size+1)-1))):e.from<n.content.size+1&&t.push(fa(n,ha(n,Math.min(e.from+1,n.content.size)))),t}function bz(n,e,t){const r=[];if(n.docChanged){const i=Nd(n);for(const s of i)r.push(...Oz(t.doc,s.newRange))}return n.selectionSet&&(r.push(fa(t.doc,ha(t.doc,n.mapping.map(e.selection.anchor)))),r.push(fa(t.doc,ha(t.doc,t.selection.anchor)))),gz(r)}function yz(n,e,t){const r=Math.max(0,Math.min(n,t.content.size));return{from:r,to:Math.max(r,Math.min(e,t.content.size))}}function xz({decorations:n,ranges:e,editor:t,options:r,dataAttribute:i,doc:s,selection:o}){let a=n;for(const l of e){const{from:c,to:d}=yz(l.from,l.to,s),h=a.find(c,d).filter(p=>p.from>=c&&p.to<=d);h.length&&(a=a.remove(h));const f=n$({editor:t,options:r,dataAttribute:i,doc:s,selection:o,from:c,to:d});f.length&&(a=a.add(s,f))}return a}function Sz({editor:n,options:e,dataAttribute:t}){return{init(r,i){const s=r$({editor:n,options:e,dataAttribute:t,doc:i.doc,selection:i.selection});return s??ye.empty},apply(r,i,s,o){return!r.docChanged&&!r.selectionSet?i:xz({decorations:i.map(r.mapping,r.doc),ranges:bz(r,s,o),editor:n,options:e,dataAttribute:t,doc:o.doc,selection:o.selection})}}}function kz(n){return n.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"").replace(/^[0-9-]+/,"").replace(/^-+/,"").toLowerCase()}function vz({editor:n,options:e}){const t=e.dataAttribute?`data-${kz(e.dataAttribute)}`:`data-${JQ}`,r=e.showOnlyCurrent&&!e.includeChildren;return new Ee({key:Ay,...r?{}:{state:Sz({editor:n,options:e,dataAttribute:t})},props:{decorations:r?({doc:i,selection:s})=>r$({editor:n,options:e,dataAttribute:t,doc:i,selection:s}):i=>{var s;return e.showOnlyWhenEditable&&!n.isEditable?ye.empty:(s=Ay.getState(i))!==null&&s!==void 0?s:ye.empty}}})}const wz=at.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",dataAttribute:JQ,placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[vz({editor:this.editor,options:this.options})]}});function Wp(n,e){return!n.selection.empty&&!PQ(n.selection)&&e.isEditable}function Qz(n,e){return Wp(n,e)&&!e.isFocused&&!e.view.dragging}function $z(){var n;(n=window.getSelection())===null||n===void 0||n.removeAllRanges()}function Cz(n){n.focus()}at.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:n,options:e}=this;return[new Ee({key:new et("selection"),props:{decorations(t){return Qz(t,n)?ye.create(t.doc,[jt.inline(t.selection.from,t.selection.to,{class:e.className})]):null},handleDOMEvents:{blur(t){return Wp(t.state,n)&&$z(),!1},focus(t){return Wp(t.state,n)&&requestAnimationFrame(()=>{!n.isDestroyed&&t.hasFocus()&&Cz(t)}),!1}}}})]}});function Ry({types:n,node:e}){return e&&Array.isArray(n)&&n.includes(e.type)||e?.type===n}const Pz=at.create({name:"trailingNode",addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){var n;const e=new et(this.name),t=this.options.node||((n=this.editor.schema.topNodeType.contentMatch.defaultType)===null||n===void 0?void 0:n.name)||"paragraph",r=Object.entries(this.editor.schema.nodes).map(([,i])=>i).filter(i=>(this.options.notAfter||[]).concat(t).includes(i.name));return[new Ee({key:e,appendTransaction:(i,s,o)=>{const{doc:a,tr:l,schema:c}=o,d=e.getState(o),h=a.content.size,f=c.nodes[t];if(!i.some(p=>p.getMeta("skipTrailingNode"))&&d)return l.insert(h,f.create())},state:{init:(i,s)=>{const o=s.tr.doc.lastChild;return!Ry({node:o,types:r})},apply:(i,s)=>{if(!i.docChanged||i.getMeta("__uniqueIDTransaction"))return s;const o=i.doc.lastChild;return!Ry({node:o,types:r})}}})]}}),Tz=at.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:n,dispatch:e})=>lQ(n,e),redo:()=>({state:n,dispatch:e})=>cQ(n,e)}},addProseMirrorPlugins(){return[q8(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}});var Mz=wz;const i$=new WeakSet,s$=new WeakSet;function Ai(n){const e=n;return i$.add(e),e}function zp(n){return Array.isArray(n)&&i$.has(n)}function o$(n){return n.flatMap(e=>e==null?[]:Array.isArray(e)&&s$.has(e)&&!zp(e)?o$(e):[e])}function Az(n,e){if(n==="slot")return 0;if(n instanceof Function){const i=n(e);return Array.isArray(i)&&!zp(i)&&!s$.has(i)?Ai(i):i}const{children:t,...r}=e??{};if(n==="svg")throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");if(Array.isArray(t)){if(zp(t))return Ai([n,r,t]);if(t.length===0)return Ai([n,r]);const i=o$(t);return i.length===0?Ai([n,r]):Ai([n,r,...i])}return t!=null?Ai([n,r,t]):Ai([n,r])}const $u=(n,e)=>Az(n,e),Rz=(n,e)=>{var t;const{state:r}=n,{selection:i}=r;if(!i.empty)return!1;const{$from:s}=i;if(s.parentOffset!==0)return!1;const o=s.depth-1;if(o<0)return!1;const a=s.node(o),l=s.index(o);if(l===0)return!1;if(a.type===e)return n.commands.lift(e.name);const c=a.child(l-1);if(c.type!==e||!(!((t=c.lastChild)===null||t===void 0)&&t.isTextblock))return!1;const d=s.before()-1-1;return n.commands.command(({tr:h,dispatch:f})=>{if(!f)return!0;const p=s.parent.content,m=new z(p,0,0);return h.replace(d,s.after(),m),h.setSelection(J.create(h.doc,d+p.size)),h.scrollIntoView(),f(h),!0})},Ez=/^\s*>\s$/,Nz=sn.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:n}){return $u("blockquote",{...Ke(this.options.HTMLAttributes,n),children:$u("slot",{})})},parseMarkdown:(n,e)=>{var t;const r=(t=e.parseBlockChildren)!==null&&t!==void 0?t:e.parseChildren;return e.createNode("blockquote",void 0,r(n.tokens||[]))},renderMarkdown:(n,e)=>{if(!n.content)return"";const t=">",r=[];return n.content.forEach((i,s)=>{var o,a;const l=((o=(a=e.renderChild)===null||a===void 0?void 0:a.call(e,i,s))!==null&&o!==void 0?o:e.renderChildren([i])).split(`
|
|
215
|
+
`).map(c=>c.trim()===""?t:`${t} ${c}`);r.push(l.join(`
|
|
216
|
+
`))}),r.join(`
|
|
217
|
+
${t}
|
|
218
|
+
`)},addCommands(){return{setBlockquote:()=>({commands:n})=>n.wrapIn(this.name),toggleBlockquote:()=>({commands:n})=>n.toggleWrap(this.name),unsetBlockquote:()=>({commands:n})=>n.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote(),Backspace:()=>Rz(this.editor,this.type)}},addInputRules(){return[uo({find:Ez,type:this.type})]}}),Dz=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,jz=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,Iz=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,Xz=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,Lz=hs.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:n=>n.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:n=>n.type.name===this.name},{style:"font-weight",getAttrs:n=>/^(bold(er)?|[5-9]\d{2,})$/.test(n)&&null}]},renderHTML({HTMLAttributes:n}){return $u("strong",{...Ke(this.options.HTMLAttributes,n),children:$u("slot",{})})},markdownTokenName:"strong",parseMarkdown:(n,e)=>e.applyMark("bold",e.parseInline(n.tokens||[])),markdownOptions:{htmlReopen:{open:"<strong>",close:"</strong>"}},renderMarkdown:(n,e)=>`**${e.renderChildren(n)}**`,addCommands(){return{setBold:()=>({commands:n})=>n.setMark(this.name),toggleBold:()=>({commands:n})=>n.toggleMark(this.name),unsetBold:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[us({find:Dz,type:this.type}),us({find:Iz,type:this.type})]},addPasteRules(){return[ki({find:jz,type:this.type}),ki({find:Xz,type:this.type})]}}),_z=n=>{const e=/`([^`]+)`(?!`)$/.exec(n);return!e||e.index>0&&n[e.index-1]==="`"?null:{index:e.index,text:e[0],replaceWith:e[1]}},Bz=n=>{const e=/`([^`]+)`(?!`)/g,t=[];let r;for(;(r=e.exec(n))!==null;)r.index>0&&n[r.index-1]==="`"||t.push({index:r.index,text:r[0],replaceWith:r[1]});return t};function Zz(n){const e=new Set((n.match(/`+/g)||[]).map(r=>r.length));let t=1;for(;e.has(t);)t+=1;return t}const Wz=hs.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:n}){return["code",Ke(this.options.HTMLAttributes,n),0]},markdownTokenName:"codespan",parseMarkdown:(n,e)=>e.applyMark("code",[{type:"text",text:n.text||""}]),renderMarkdown:(n,e,t)=>{var r;if(!n.content)return"";const i=typeof(t==null||(r=t.meta)===null||r===void 0?void 0:r.markText)=="string"?t.meta.markText:"",s="`".repeat(Zz(i)),o=i.startsWith("`")||i.endsWith("`")?" ":"";return`${s}${o}${e.renderChildren(n.content)}${o}${s}`},addCommands(){return{setCode:()=>({commands:n})=>n.setMark(this.name),toggleCode:()=>({commands:n})=>n.toggleMark(this.name),unsetCode:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[us({find:_z,type:this.type})]},addPasteRules(){return[ki({find:Bz,type:this.type})]}}),Hh=4,zz=/^```([a-z]+)?[\s\n]$/,Vz=/^~~~([a-z]+)?[\s\n]$/,Fz=sn.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,exitOnArrowUp:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:Hh,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:n=>{var e;const{languageClassPrefix:t}=this.options;if(!t)return null;const r=[...((e=n.firstElementChild)===null||e===void 0?void 0:e.classList)||[]].filter(i=>i.startsWith(t)).map(i=>i.replace(t,""))[0];return r||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:n,HTMLAttributes:e}){return["pre",Ke(this.options.HTMLAttributes,e),["code",{class:n.attrs.language?this.options.languageClassPrefix+n.attrs.language:null},0]]},markdownTokenName:"code",parseMarkdown:(n,e)=>{var t,r;return((t=n.raw)===null||t===void 0?void 0:t.startsWith("```"))===!1&&((r=n.raw)===null||r===void 0?void 0:r.startsWith("~~~"))===!1&&n.codeBlockStyle!=="indented"?[]:e.createNode("codeBlock",{language:n.lang||null},n.text?[e.createTextNode(n.text)]:[])},renderMarkdown:(n,e)=>{var t;let r="";const i=((t=n.attrs)===null||t===void 0?void 0:t.language)||"";return n.content?r=[`\`\`\`${i}`,e.renderChildren(n.content),"```"].join(`
|
|
219
|
+
`):r=`\`\`\`${i}
|
|
220
|
+
|
|
221
|
+
\`\`\``,r},addCommands(){return{setCodeBlock:n=>({commands:e})=>e.setNode(this.name,n),toggleCodeBlock:n=>({commands:e})=>e.toggleNode(this.name,"paragraph",n)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:n,$anchor:e}=this.editor.state.selection,t=e.pos===1;return!n||e.parent.type.name!==this.name?!1:t||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Tab:({editor:n})=>{var e;if(!this.options.enableTabIndentation)return!1;const t=(e=this.options.tabSize)!==null&&e!==void 0?e:Hh,{state:r}=n,{selection:i}=r,{$from:s,empty:o}=i;if(s.parent.type!==this.type)return!1;const a=" ".repeat(t);return o?n.commands.insertContent(a):n.commands.command(({tr:l})=>{const{from:c,to:d}=i,h=r.doc.textBetween(c,d,`
|
|
222
|
+
`,`
|
|
223
|
+
`).split(`
|
|
224
|
+
`).map(f=>a+f).join(`
|
|
225
|
+
`);return l.replaceWith(c,d,r.schema.text(h)),!0})},"Shift-Tab":({editor:n})=>{var e;if(!this.options.enableTabIndentation)return!1;const t=(e=this.options.tabSize)!==null&&e!==void 0?e:Hh,{state:r}=n,{selection:i}=r,{$from:s,empty:o}=i;return s.parent.type!==this.type?!1:o?n.commands.command(({tr:a})=>{var l;const{pos:c}=s,d=s.start(),h=s.end(),f=r.doc.textBetween(d,h,`
|
|
226
|
+
`,`
|
|
227
|
+
`).split(`
|
|
228
|
+
`);let p=0,m=0;const O=c-d;for(let x=0;x<f.length;x+=1){if(m+f[x].length>=O){p=x;break}m+=f[x].length+1}const b=((l=f[p].match(/^ */))===null||l===void 0?void 0:l[0])||"",y=Math.min(b.length,t);if(y===0)return!0;let k=d;for(let x=0;x<p;x+=1)k+=f[x].length+1;return a.delete(k,k+y),c-k<=y&&a.setSelection(J.create(a.doc,k)),!0}):n.commands.command(({tr:a})=>{const{from:l,to:c}=i,d=r.doc.textBetween(l,c,`
|
|
229
|
+
`,`
|
|
230
|
+
`).split(`
|
|
231
|
+
`).map(h=>{var f;const p=((f=h.match(/^ */))===null||f===void 0?void 0:f[0])||"",m=Math.min(p.length,t);return h.slice(m)}).join(`
|
|
232
|
+
`);return a.replaceWith(l,c,r.schema.text(d)),!0})},Enter:({editor:n})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=n,{selection:t}=e,{$from:r,empty:i}=t;if(!i||r.parent.type!==this.type)return!1;const s=r.parentOffset===r.parent.nodeSize-2,o=r.parent.textContent.endsWith(`
|
|
233
|
+
|
|
234
|
+
`);return!s||!o?!1:n.chain().command(({tr:a})=>(a.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowUp:({editor:n})=>{if(!this.options.exitOnArrowUp)return!1;const{state:e}=n,{selection:t}=e,{$from:r,empty:i}=t;if(!i||r.parent.type!==this.type||r.parentOffset!==0)return!1;const s=r.before();return s>0?!1:n.commands.insertDefaultBlock({pos:s})},ArrowDown:({editor:n})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=n,{selection:t,doc:r}=e,{$from:i,empty:s}=t;if(!s||i.parent.type!==this.type||i.parentOffset!==i.parent.nodeSize-2)return!1;const o=i.after();return o===void 0?!1:r.nodeAt(o)?n.commands.command(({tr:a})=>(a.setSelection(ue.near(r.resolve(o))),!0)):n.commands.exitCode()}}},addInputRules(){return[Bp({find:zz,type:this.type,getAttributes:n=>({language:n[1]})}),Bp({find:Vz,type:this.type,getAttributes:n=>({language:n[1]})})]},addProseMirrorPlugins(){return[new Ee({key:new et("codeBlockVSCodeHandler"),props:{handlePaste:(n,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const t=e.clipboardData.getData("text/plain"),r=e.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,s=i?.mode;if(!t||!s)return!1;const{tr:o,schema:a}=n.state,l=a.text(t.replace(/\r\n?/g,`
|
|
235
|
+
`));return o.replaceSelectionWith(this.type.create({language:s},l)),o.selection.$from.parent.type!==this.type&&o.setSelection(J.near(o.doc.resolve(Math.max(0,o.selection.from-2)))),o.setMeta("paste",!0),n.dispatch(o),!0}}})]}}),qz=sn.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(n,e)=>n.content?e.renderChildren(n.content,`
|
|
236
|
+
|
|
237
|
+
`):""}),Yz=sn.create({name:"hardBreak",markdownTokenName:"br",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:n}){return["br",Ke(this.options.HTMLAttributes,n)]},renderText(){return`
|
|
238
|
+
`},renderMarkdown:()=>`
|
|
239
|
+
`,parseMarkdown:()=>({type:"hardBreak"}),addCommands(){return{setHardBreak:()=>({commands:n,chain:e,state:t,editor:r})=>n.first([()=>n.exitCode(),()=>n.command(()=>{const{selection:i,storedMarks:s}=t;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:o}=this.options,{splittableMarks:a}=r.extensionManager,l=s||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:c,dispatch:d})=>{if(d&&l&&o){const h=l.filter(f=>a.includes(f.type.name));c.ensureMarks(h)}return!0}).scrollIntoView().run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),Uz=sn.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(n=>({tag:`h${n}`,attrs:{level:n}}))},renderHTML({node:n,HTMLAttributes:e}){return[`h${this.options.levels.includes(n.attrs.level)?n.attrs.level:this.options.levels[0]}`,Ke(this.options.HTMLAttributes,e),0]},parseMarkdown:(n,e)=>e.createNode("heading",{level:n.depth||1},e.parseInline(n.tokens||[])),renderMarkdown:(n,e)=>{var t;const r=!((t=n.attrs)===null||t===void 0)&&t.level?parseInt(n.attrs.level,10):1,i="#".repeat(r);return n.content?`${i} ${e.renderChildren(n.content)}`:""},addCommands(){return{setHeading:n=>({commands:e})=>this.options.levels.includes(n.level)?e.setNode(this.name,n):!1,toggleHeading:n=>({commands:e})=>this.options.levels.includes(n.level)?e.toggleNode(this.name,"paragraph",n):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((n,e)=>({...n,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(n=>Bp({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${n}})\\s$`),type:this.type,getAttributes:{level:n}}))}}),Gz=sn.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{},nextNodeType:"paragraph"}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:n}){return["hr",Ke(this.options.HTMLAttributes,n)]},markdownTokenName:"hr",parseMarkdown:(n,e)=>e.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:n,state:e})=>{if(!HB(e,e.schema.nodes[this.name]))return!1;const{selection:t}=e,{$to:r}=t,i=n();return PQ(t)?i.insertContentAt(r.pos,{type:this.name}):i.insertContent({type:this.name}),i.command(({state:s,tr:o,dispatch:a})=>{if(a){const{$to:l}=o.selection,c=l.end();if(l.nodeAfter)l.nodeAfter.isTextblock?o.setSelection(J.create(o.doc,l.pos+1)):l.nodeAfter.isBlock?o.setSelection(ee.create(o.doc,l.pos)):o.setSelection(J.create(o.doc,l.pos));else{const d=s.schema.nodes[this.options.nextNodeType]||l.parent.type.contentMatch.defaultType,h=d?.create();h&&(o.insert(c,h),o.setSelection(J.create(o.doc,c+1)))}o.scrollIntoView()}return!0}).run()}}},addInputRules(){return[IZ({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),Hz=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,Kz=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,Jz=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,eV=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,tV=hs.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:n=>n.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:n=>n.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:n}){return["em",Ke(this.options.HTMLAttributes,n),0]},addCommands(){return{setItalic:()=>({commands:n})=>n.setMark(this.name),toggleItalic:()=>({commands:n})=>n.toggleMark(this.name),unsetItalic:()=>({commands:n})=>n.unsetMark(this.name)}},markdownTokenName:"em",parseMarkdown:(n,e)=>e.applyMark("italic",e.parseInline(n.tokens||[])),markdownOptions:{htmlReopen:{open:"<em>",close:"</em>"}},renderMarkdown:(n,e)=>`*${e.renderChildren(n)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[us({find:Hz,type:this.type}),us({find:Jz,type:this.type})]},addPasteRules(){return[ki({find:Kz,type:this.type}),ki({find:eV,type:this.type})]}}),nV="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",rV="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",Vp="numeric",Fp="ascii",qp="alpha",pa="asciinumeric",Go="alphanumeric",Yp="domain",a$="emoji",iV="scheme",sV="slashscheme",Kh="whitespace";function oV(n,e){return n in e||(e[n]=[]),e[n]}function Bi(n,e,t){e[Vp]&&(e[pa]=!0,e[Go]=!0),e[Fp]&&(e[pa]=!0,e[qp]=!0),e[pa]&&(e[Go]=!0),e[qp]&&(e[Go]=!0),e[Go]&&(e[Yp]=!0),e[a$]&&(e[Yp]=!0);for(const r in e){const i=oV(r,t);i.indexOf(n)<0&&i.push(n)}}function aV(n,e){const t={};for(const r in e)e[r].indexOf(n)>=0&&(t[r]=!0);return t}function Gt(n=null){this.j={},this.jr=[],this.jd=null,this.t=n}Gt.groups={};Gt.prototype={accepts(){return!!this.t},go(n){const e=this,t=e.j[n];if(t)return t;for(let r=0;r<e.jr.length;r++){const i=e.jr[r][0],s=e.jr[r][1];if(s&&i.test(n))return s}return e.jd},has(n,e=!1){return e?n in this.j:!!this.go(n)},ta(n,e,t,r){for(let i=0;i<n.length;i++)this.tt(n[i],e,t,r)},tr(n,e,t,r){r=r||Gt.groups;let i;return e&&e.j?i=e:(i=new Gt(e),t&&r&&Bi(e,t,r)),this.jr.push([n,i]),i},ts(n,e,t,r){let i=this;const s=n.length;if(!s)return i;for(let o=0;o<s-1;o++)i=i.tt(n[o]);return i.tt(n[s-1],e,t,r)},tt(n,e,t,r){r=r||Gt.groups;const i=this;if(e&&e.j)return i.j[n]=e,e;const s=e;let o,a=i.go(n);if(a?(o=new Gt,Object.assign(o.j,a.j),o.jr.push.apply(o.jr,a.jr),o.jd=a.jd,o.t=a.t):o=new Gt,s){if(r)if(o.t&&typeof o.t=="string"){const l=Object.assign(aV(o.t,r),t);Bi(s,l,r)}else t&&Bi(s,t,r);o.t=s}return i.j[n]=o,o}};const fe=(n,e,t,r,i)=>n.ta(e,t,r,i),nt=(n,e,t,r,i)=>n.tr(e,t,r,i),Ey=(n,e,t,r,i)=>n.ts(e,t,r,i),D=(n,e,t,r,i)=>n.tt(e,t,r,i),Qr="WORD",Up="UWORD",l$="ASCIINUMERICAL",c$="ALPHANUMERICAL",tl="LOCALHOST",Gp="TLD",Hp="UTLD",jc="SCHEME",Ps="SLASH_SCHEME",Ig="NUM",Kp="WS",Xg="NL",ma="OPENBRACE",ga="CLOSEBRACE",Cu="OPENBRACKET",Pu="CLOSEBRACKET",Tu="OPENPAREN",Mu="CLOSEPAREN",Au="OPENANGLEBRACKET",Ru="CLOSEANGLEBRACKET",Eu="FULLWIDTHLEFTPAREN",Nu="FULLWIDTHRIGHTPAREN",Du="LEFTCORNERBRACKET",ju="RIGHTCORNERBRACKET",Iu="LEFTWHITECORNERBRACKET",Xu="RIGHTWHITECORNERBRACKET",Lu="FULLWIDTHLESSTHAN",_u="FULLWIDTHGREATERTHAN",Bu="AMPERSAND",Zu="APOSTROPHE",Wu="ASTERISK",ti="AT",zu="BACKSLASH",Vu="BACKTICK",Fu="CARET",Zi="COLON",Lg="COMMA",qu="DOLLAR",tr="DOT",Yu="EQUALS",_g="EXCLAMATION",kn="HYPHEN",Oa="PERCENT",Uu="PIPE",Gu="PLUS",Hu="POUND",ba="QUERY",Bg="QUOTE",u$="FULLWIDTHMIDDLEDOT",Zg="SEMI",nr="SLASH",ya="TILDE",Ku="UNDERSCORE",d$="EMOJI",Ju="SYM";var h$=Object.freeze({__proto__:null,ALPHANUMERICAL:c$,AMPERSAND:Bu,APOSTROPHE:Zu,ASCIINUMERICAL:l$,ASTERISK:Wu,AT:ti,BACKSLASH:zu,BACKTICK:Vu,CARET:Fu,CLOSEANGLEBRACKET:Ru,CLOSEBRACE:ga,CLOSEBRACKET:Pu,CLOSEPAREN:Mu,COLON:Zi,COMMA:Lg,DOLLAR:qu,DOT:tr,EMOJI:d$,EQUALS:Yu,EXCLAMATION:_g,FULLWIDTHGREATERTHAN:_u,FULLWIDTHLEFTPAREN:Eu,FULLWIDTHLESSTHAN:Lu,FULLWIDTHMIDDLEDOT:u$,FULLWIDTHRIGHTPAREN:Nu,HYPHEN:kn,LEFTCORNERBRACKET:Du,LEFTWHITECORNERBRACKET:Iu,LOCALHOST:tl,NL:Xg,NUM:Ig,OPENANGLEBRACKET:Au,OPENBRACE:ma,OPENBRACKET:Cu,OPENPAREN:Tu,PERCENT:Oa,PIPE:Uu,PLUS:Gu,POUND:Hu,QUERY:ba,QUOTE:Bg,RIGHTCORNERBRACKET:ju,RIGHTWHITECORNERBRACKET:Xu,SCHEME:jc,SEMI:Zg,SLASH:nr,SLASH_SCHEME:Ps,SYM:Ju,TILDE:ya,TLD:Gp,UNDERSCORE:Ku,UTLD:Hp,UWORD:Up,WORD:Qr,WS:Kp});const kr=/[a-z]/,Io=/\p{L}/u,Jh=/\p{Emoji}/u,vr=/\d/,ef=/\s/,Ny="\r",tf=`
|
|
240
|
+
`,lV="️",cV="",nf="";let oc=null,ac=null;function uV(n=[]){const e={};Gt.groups=e;const t=new Gt;oc==null&&(oc=Dy(nV)),ac==null&&(ac=Dy(rV)),D(t,"'",Zu),D(t,"{",ma),D(t,"}",ga),D(t,"[",Cu),D(t,"]",Pu),D(t,"(",Tu),D(t,")",Mu),D(t,"<",Au),D(t,">",Ru),D(t,"(",Eu),D(t,")",Nu),D(t,"「",Du),D(t,"」",ju),D(t,"『",Iu),D(t,"』",Xu),D(t,"<",Lu),D(t,">",_u),D(t,"&",Bu),D(t,"*",Wu),D(t,"@",ti),D(t,"`",Vu),D(t,"^",Fu),D(t,":",Zi),D(t,",",Lg),D(t,"$",qu),D(t,".",tr),D(t,"=",Yu),D(t,"!",_g),D(t,"-",kn),D(t,"%",Oa),D(t,"|",Uu),D(t,"+",Gu),D(t,"#",Hu),D(t,"?",ba),D(t,'"',Bg),D(t,"/",nr),D(t,";",Zg),D(t,"~",ya),D(t,"_",Ku),D(t,"\\",zu),D(t,"・",u$);const r=nt(t,vr,Ig,{[Vp]:!0});nt(r,vr,r);const i=nt(r,kr,l$,{[pa]:!0}),s=nt(r,Io,c$,{[Go]:!0}),o=nt(t,kr,Qr,{[Fp]:!0});nt(o,vr,i),nt(o,kr,o),nt(i,vr,i),nt(i,kr,i);const a=nt(t,Io,Up,{[qp]:!0});nt(a,kr),nt(a,vr,s),nt(a,Io,a),nt(s,vr,s),nt(s,kr),nt(s,Io,s);const l=D(t,tf,Xg,{[Kh]:!0}),c=D(t,Ny,Kp,{[Kh]:!0}),d=nt(t,ef,Kp,{[Kh]:!0});D(t,nf,d),D(c,tf,l),D(c,nf,d),nt(c,ef,d),D(d,Ny),D(d,tf),nt(d,ef,d),D(d,nf,d);const h=nt(t,Jh,d$,{[a$]:!0});D(h,"#"),nt(h,Jh,h),D(h,lV,h);const f=D(h,cV);D(f,"#"),nt(f,Jh,h);const p=[[kr,o],[vr,i]],m=[[kr,null],[Io,a],[vr,s]];for(let O=0;O<oc.length;O++)Yr(t,oc[O],Gp,Qr,p);for(let O=0;O<ac.length;O++)Yr(t,ac[O],Hp,Up,m);Bi(Gp,{tld:!0,ascii:!0},e),Bi(Hp,{utld:!0,alpha:!0},e),Yr(t,"file",jc,Qr,p),Yr(t,"mailto",jc,Qr,p),Yr(t,"http",Ps,Qr,p),Yr(t,"https",Ps,Qr,p),Yr(t,"ftp",Ps,Qr,p),Yr(t,"ftps",Ps,Qr,p),Bi(jc,{scheme:!0,ascii:!0},e),Bi(Ps,{slashscheme:!0,ascii:!0},e),n=n.sort((O,b)=>O[0]>b[0]?1:-1);for(let O=0;O<n.length;O++){const b=n[O][0],k=n[O][1]?{[iV]:!0}:{[sV]:!0};b.indexOf("-")>=0?k[Yp]=!0:kr.test(b)?vr.test(b)?k[pa]=!0:k[Fp]=!0:k[Vp]=!0,Ey(t,b,b,k)}return Ey(t,"localhost",tl,{ascii:!0}),t.jd=new Gt(Ju),{start:t,tokens:Object.assign({groups:e},h$)}}function f$(n,e){const t=dV(e.replace(/[A-Z]/g,a=>a.toLowerCase())),r=t.length,i=[];let s=0,o=0;for(;o<r;){let a=n,l=null,c=0,d=null,h=-1,f=-1;for(;o<r&&(l=a.go(t[o]));)a=l,a.accepts()?(h=0,f=0,d=a):h>=0&&(h+=t[o].length,f++),c+=t[o].length,s+=t[o].length,o++;s-=h,o-=f,c-=h,i.push({t:d.t,v:e.slice(s-c,s),s:s-c,e:s})}return i}function dV(n){const e=[],t=n.length;let r=0;for(;r<t;){let i=n.charCodeAt(r),s,o=i<55296||i>56319||r+1===t||(s=n.charCodeAt(r+1))<56320||s>57343?n[r]:n.slice(r,r+2);e.push(o),r+=o.length}return e}function Yr(n,e,t,r,i){let s;const o=e.length;for(let a=0;a<o-1;a++){const l=e[a];n.j[l]?s=n.j[l]:(s=new Gt(r),s.jr=i.slice(),n.j[l]=s),n=s}return s=new Gt(t),s.jr=i.slice(),n.j[e[o-1]]=s,s}function Dy(n){const e=[],t=[];let r=0,i="0123456789";for(;r<n.length;){let s=0;for(;i.indexOf(n[r+s])>=0;)s++;if(s>0){e.push(t.join(""));for(let o=parseInt(n.substring(r,r+s),10);o>0;o--)t.pop();r+=s}else t.push(n[r]),r++}return e}const nl={defaultProtocol:"http",events:null,format:jy,formatHref:jy,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function Wg(n,e=null){let t=Object.assign({},nl);n&&(t=Object.assign(t,n instanceof Wg?n.o:n));const r=t.ignoreTags,i=[];for(let s=0;s<r.length;s++)i.push(r[s].toUpperCase());this.o=t,e&&(this.defaultRender=e),this.ignoreTags=i}Wg.prototype={o:nl,ignoreTags:[],defaultRender(n){return n},check(n){return this.get("validate",n.toString(),n)},get(n,e,t){const r=e!=null;let i=this.o[n];return i&&(typeof i=="object"?(i=t.t in i?i[t.t]:nl[n],typeof i=="function"&&r&&(i=i(e,t))):typeof i=="function"&&r&&(i=i(e,t.t,t)),i)},getObj(n,e,t){let r=this.o[n];return typeof r=="function"&&e!=null&&(r=r(e,t.t,t)),r},render(n){const e=n.render(this);return(this.get("render",null,n)||this.defaultRender)(e,n.t,n)}};function jy(n){return n}function p$(n,e){this.t="token",this.v=n,this.tk=e}p$.prototype={isLink:!1,toString(){return this.v},toHref(n){return this.toString()},toFormattedString(n){const e=this.toString(),t=n.get("truncate",e,this),r=n.get("format",e,this);return t&&r.length>t?r.substring(0,t)+"…":r},toFormattedHref(n){return n.get("formatHref",this.toHref(n.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(n=nl.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(n),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(n){return{type:this.t,value:this.toFormattedString(n),isLink:this.isLink,href:this.toFormattedHref(n),start:this.startIndex(),end:this.endIndex()}},validate(n){return n.get("validate",this.toString(),this)},render(n){const e=this,t=this.toHref(n.get("defaultProtocol")),r=n.get("formatHref",t,this),i=n.get("tagName",t,e),s=this.toFormattedString(n),o={},a=n.get("className",t,e),l=n.get("target",t,e),c=n.get("rel",t,e),d=n.getObj("attributes",t,e),h=n.getObj("events",t,e);return o.href=r,a&&(o.class=a),l&&(o.target=l),c&&(o.rel=c),d&&Object.assign(o,d),{tagName:i,attributes:o,content:s,eventListeners:h}}};function Xd(n,e){class t extends p${constructor(i,s){super(i,s),this.t=n}}for(const r in e)t.prototype[r]=e[r];return t.t=n,t}const hV=Xd("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),Iy=Xd("text"),fV=Xd("nl"),lc=Xd("url",{isLink:!0,toHref(n=nl.defaultProtocol){return this.hasProtocol()?this.v:`${n}://${this.v}`},hasProtocol(){const n=this.tk;return n.length>=2&&n[0].t!==tl&&n[1].t===Zi}}),Sn=n=>new Gt(n);function pV({groups:n}){const e=n.domain.concat([Bu,Wu,ti,zu,Vu,Fu,qu,Yu,kn,Ig,Oa,Uu,Gu,Hu,nr,Ju,ya,Ku]),t=[Zu,Zi,Lg,tr,_g,Oa,ba,Bg,Zg,Au,Ru,ma,ga,Pu,Cu,Tu,Mu,Eu,Nu,Du,ju,Iu,Xu,Lu,_u],r=[Bu,Zu,Wu,zu,Vu,Fu,qu,Yu,kn,ma,ga,Oa,Uu,Gu,Hu,ba,nr,Ju,ya,Ku],i=Sn(),s=D(i,ya);fe(s,r,s),fe(s,n.domain,s);const o=Sn(),a=Sn(),l=Sn();fe(i,n.domain,o),fe(i,n.scheme,a),fe(i,n.slashscheme,l),fe(o,r,s),fe(o,n.domain,o);const c=D(o,ti);D(s,ti,c),D(a,ti,c),D(l,ti,c);const d=D(s,tr);fe(d,r,s),fe(d,n.domain,s);const h=Sn();fe(c,n.domain,h),fe(h,n.domain,h);const f=D(h,tr);fe(f,n.domain,h);const p=Sn(hV);fe(f,n.tld,p),fe(f,n.utld,p),D(c,tl,p);const m=D(h,kn);D(m,kn,m),fe(m,n.domain,h),fe(p,n.domain,h),D(p,tr,f),D(p,kn,m);const O=D(o,kn),b=D(o,tr);D(O,kn,O),fe(O,n.domain,o),fe(b,r,s),fe(b,n.domain,o);const y=Sn(lc);fe(b,n.tld,y),fe(b,n.utld,y),fe(y,n.domain,o),fe(y,r,s),D(y,tr,b),D(y,kn,O),D(y,ti,c);const k=D(y,Zi),x=Sn(lc);fe(k,n.numeric,x);const S=Sn(lc),v=Sn();fe(S,e,S),fe(S,t,v),fe(v,e,S),fe(v,t,v),D(y,nr,S),D(x,nr,S);const w=D(a,Zi),Q=D(l,Zi),P=D(Q,nr),T=D(P,nr);fe(a,n.domain,o),D(a,tr,b),D(a,kn,O),fe(l,n.domain,o),D(l,tr,b),D(l,kn,O),fe(w,n.domain,S),D(w,nr,S),D(w,ba,S),fe(T,n.domain,S),fe(T,e,S),D(T,nr,S);const C=[[ma,ga],[Cu,Pu],[Tu,Mu],[Au,Ru],[Eu,Nu],[Du,ju],[Iu,Xu],[Lu,_u]];for(let R=0;R<C.length;R++){const[M,j]=C[R],N=D(S,M);D(v,M,N);const I=Sn(lc);fe(N,e,I);const L=Sn();fe(N,t,L),D(N,j,S),fe(I,e,I),fe(I,t,L),fe(L,e,I),fe(L,t,L),D(I,j,S),D(L,j,S)}return D(i,tl,y),D(i,Xg,fV),{start:i,tokens:h$}}function mV(n,e,t){let r=t.length,i=0,s=[],o=[];for(;i<r;){let a=n,l=null,c=null,d=0,h=null,f=-1;for(;i<r&&!(l=a.go(t[i].t));)o.push(t[i++]);for(;i<r&&(c=l||a.go(t[i].t));)l=null,a=c,a.accepts()?(f=0,h=a):f>=0&&f++,i++,d++;if(f<0)i-=d,i<r&&(o.push(t[i]),i++);else{o.length>0&&(s.push(rf(Iy,e,o)),o=[]),i-=f,d-=f;const p=h.t,m=t.slice(i-d,i);s.push(rf(p,e,m))}}return o.length>0&&s.push(rf(Iy,e,o)),s}function rf(n,e,t){const r=t[0].s,i=t[t.length-1].e,s=e.slice(r,i);return new n(s,t)}const gV=typeof console<"u"&&console&&console.warn||(()=>{}),OV="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",qe={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function bV(){return Gt.groups={},qe.scanner=null,qe.parser=null,qe.tokenQueue=[],qe.pluginQueue=[],qe.customSchemes=[],qe.initialized=!1,qe}function Xy(n,e=!1){if(qe.initialized&&gV(`linkifyjs: already initialized - will not register custom scheme "${n}" ${OV}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(n))throw new Error(`linkifyjs: incorrect scheme format.
|
|
241
|
+
1. Must only contain digits, lowercase ASCII letters or "-"
|
|
242
|
+
2. Cannot start or end with "-"
|
|
243
|
+
3. "-" cannot repeat`);qe.customSchemes.push([n,e])}function yV(){qe.scanner=uV(qe.customSchemes);for(let n=0;n<qe.tokenQueue.length;n++)qe.tokenQueue[n][1]({scanner:qe.scanner});qe.parser=pV(qe.scanner.tokens);for(let n=0;n<qe.pluginQueue.length;n++)qe.pluginQueue[n][1]({scanner:qe.scanner,parser:qe.parser});return qe.initialized=!0,qe}function zg(n){return qe.initialized||yV(),mV(qe.parser.start,n,f$(qe.scanner.start,n))}zg.scan=f$;function m$(n,e=null,t=null){if(e&&typeof e=="object"){if(t)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);t=e,e=null}const r=new Wg(t),i=zg(n),s=[];for(let o=0;o<i.length;o++){const a=i[o];a.isLink&&(!e||a.t===e)&&r.check(a)&&s.push(a.toFormattedObject(r))}return s}const Ld="[\0- -\u2029 ]",xV=new RegExp(Ld),SV=new RegExp(`${Ld}$`),kV=new RegExp(`${Ld}+$`),vV=new RegExp(Ld,"g");function wV(n,e,t){var r,i;const s=n.doc.resolve(e.to);if(!(!((r=s.nodeBefore)===null||r===void 0)&&r.isText))return;const o=(i=n.doc.textBetween(e.from,e.to,"","").match(kV))===null||i===void 0?void 0:i[0];if(!o)return;const a=e.to-o.length,l=Dd(a,e.to,n.doc).filter(h=>h.mark.type===t);if(!l.length)return;const{nodeAfter:c}=s;if(c&&l.some(h=>h.mark.isInSet(c.marks)))return;const d=n.storedMarks;n.removeMark(a,e.to,t),n.setStoredMarks(d),n.selection.empty&&n.selection.from===e.to&&n.removeStoredMark(t)}function QV(n){return n.length===1?n[0].isLink:n.length===3&&n[1].isLink?["()","[]"].includes(n[0].value+n[2].value):!1}function $V(n){return new Ee({key:new et("autolink"),appendTransaction:(e,t,r)=>{const i=e.some(l=>l.docChanged)&&!t.doc.eq(r.doc),s=e.some(l=>l.getMeta("preventAutolink"));if(!i||s)return;const{tr:o}=r,a=SQ(t.doc,[...e]);if(!e.some(Y8)){const l=[];a.steps.forEach((c,d)=>{if(!(c instanceof rt)||!c.slice.size)return;const h=a.mapping.slice(d+1),f=h.map(c.from,1),p=h.map(c.from+c.slice.size,-1);f<p&&l.push({from:f,to:p})}),l.sort((c,d)=>d.to-c.to),l.forEach(c=>wV(o,c,n.type))}if(Nd(a).forEach(({newRange:l})=>{const c=__(r.doc,l,f=>f.isTextblock);let d,h;if(c.length>1)d=c[0],h=r.doc.textBetween(d.pos,d.pos+d.node.nodeSize,void 0," ");else if(c.length){const f=r.doc.textBetween(l.from,l.to," "," ");if(!SV.test(f))return;d=c[0],h=r.doc.textBetween(d.pos,l.to,void 0," ")}if(d&&h){const f=h.split(xV).filter(Boolean);if(f.length<=0)return!1;const p=f[f.length-1],m=d.pos+h.lastIndexOf(p);if(!p)return!1;const O=zg(p).map(b=>b.toObject(n.defaultProtocol));if(!QV(O))return!1;O.filter(b=>b.isLink).map(b=>({...b,from:m+b.start+1,to:m+b.end+1})).filter(b=>r.schema.marks.code?!r.doc.rangeHasMark(b.from,b.to,r.schema.marks.code):!0).filter(b=>n.validate(b.value)).filter(b=>n.shouldAutoLink(b.value)).forEach(b=>{Dd(b.from,b.to,r.doc).some(y=>y.mark.type===n.type)||o.addMark(b.from,b.to,n.type.create({href:b.href}))})}}),!!o.steps.length)return o}})}function CV(n){return new Ee({key:new et("handleClickLink"),props:{handleClick:(e,t,r)=>{if(r.button!==0||!e.editable)return!1;let i=null;if(r.target instanceof HTMLAnchorElement)i=r.target;else{const l=r.target;if(!l)return!1;const c=n.editor.view.dom;i=l.closest("a"),i&&!c.contains(i)&&(i=null)}if(!i)return!1;let s=!1;if(n.enableClickSelection&&(s=n.editor.commands.extendMarkRange(n.type.name)),n.openOnClick){var o,a;const l=CQ(e.state,n.type.name),c=(o=i.href)!==null&&o!==void 0?o:l.href,d=(a=i.target)!==null&&a!==void 0?a:l.target;c&&(window.open(c,d),s=!0)}return s}}})}const PV=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)$/,TV=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)/g;function g$(n,e){let t=0;for(let r=e-1;r>=0&&n[r]==="\\";r-=1)t+=1;return t%2===1}function MV(n,e){let t=0,r=0;for(;r<e;){if(n[r]!=="`"){r+=1;continue}if(t===0&&g$(n,r)){r+=1;continue}let i=0;for(;r<e&&n[r]==="`";)i+=1,r+=1;t===0?t=i:i===t&&(t=0)}return t>0}function O$(n,e,t){var r,i;const[,s,o]=e;return(e.index?n[e.index-1]:void 0)==="!"||g$(n,(r=e.index)!==null&&r!==void 0?r:0)||MV(n,(i=e.index)!==null&&i!==void 0?i:0)?!1:!!s.trim()&&t(o)}function b$(n){var e,t;const[r,i,s,,o,a,l]=n,c=(e=o??a)!==null&&e!==void 0?e:l;return{index:(t=n.index)!==null&&t!==void 0?t:0,text:r,replaceWith:i,data:{href:s,title:c||null,markdown:!0}}}function AV(n,e){return n.index<e.index+e.text.length&&e.index<n.index+n.text.length}function y$(n){var e,t,r;return{href:(e=n.data)===null||e===void 0?void 0:e.href,title:(t=(r=n.data)===null||r===void 0?void 0:r.title)!==null&&t!==void 0?t:null}}function RV(n){const e=us({find:t=>{const r=PV.exec(t);return!r||!O$(t,r,n.isAllowedHref)?null:b$(r)},type:n.type,getAttributes:y$});return new kl({find:e.find,handler:t=>{const r=e.handler(t);return r!==null&&t.state.tr.steps.length&&t.state.tr.setMeta("preventAutolink",!0),r}})}function EV(n){const e=ki({find:t=>{var r,i;const s=[];for(const a of t.matchAll(TV))O$(t,a,n.isAllowedHref)&&s.push(b$(a));const o=((r=(i=n.findPlainUrls)===null||i===void 0?void 0:i.call(n,t))!==null&&r!==void 0?r:[]).filter(a=>!s.some(l=>AV(l,a)));return[...s,...o]},type:n.type,getAttributes:y$});return new ZQ({find:e.find,handler:t=>{var r;const i=e.handler(t);return i!==null&&t.state.tr.steps.length&&(!((r=t.match.data)===null||r===void 0)&&r.markdown)&&t.state.tr.setMeta("preventAutolink",!0),i}})}function NV(n){return new Ee({key:new et("handlePasteLink"),props:{handlePaste:(e,t,r)=>{const{shouldAutoLink:i}=n,{state:s}=e,{selection:o}=s,{empty:a}=o;if(a)return!1;let l="";r.content.forEach(d=>{l+=d.textContent});const c=m$(l,{defaultProtocol:n.defaultProtocol}).find(d=>d.isLink&&d.value===l);return!l||!c||i!==void 0&&!i(c.value)?!1:n.editor.commands.setMark(n.type,{href:c.href})}}})}function wr(n,e){const t=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(r=>{const i=typeof r=="string"?r:r.scheme;i&&t.push(i)}),!n||n.replace(vV,"").match(new RegExp(`^(?:(?:${t.map(r=>r.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")).join("|")}):|[^a-z]|[a-z0-9+.\\-]+(?:[^a-z+.\\-:]|$))`,"i"))}const DV=hs.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(n=>{if(typeof n=="string"){Xy(n);return}Xy(n.scheme,n.optionalSlashes)})},onDestroy(){bV()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,markdownLinks:!1,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(n,e)=>!!wr(n,e.protocols),validate:n=>!!n,shouldAutoLink:n=>{const e=/^[a-z][a-z0-9+.-]*:\/\//i.test(n),t=/^[a-z][a-z0-9+.-]*:/i.test(n);if(e||t&&!n.includes("@"))return!0;const r=(n.includes("@")?n.split("@").pop():n).split(/[/?#:]/)[0];return!(/^\d{1,3}(\.\d{1,3}){3}$/.test(r)||!/\./.test(r))}}},addAttributes(){var n,e,t;return{href:{default:null,parseHTML(r){return r.getAttribute("href")}},target:{default:(n=this.options.HTMLAttributes.target)!==null&&n!==void 0?n:null},rel:{default:(e=this.options.HTMLAttributes.rel)!==null&&e!==void 0?e:null},class:{default:(t=this.options.HTMLAttributes.class)!==null&&t!==void 0?t:null},title:{default:null}}},parseHTML(){return[{tag:"a[href]",getAttrs:n=>{const e=n.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:t=>!!wr(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:n}){return this.options.isAllowedUri(n.href,{defaultValidate:e=>!!wr(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",Ke(this.options.HTMLAttributes,n),0]:["a",Ke(this.options.HTMLAttributes,{...n,href:""}),0]},markdownTokenName:"link",parseMarkdown:(n,e)=>e.applyMark("link",e.parseInline(n.tokens||[]),{href:n.href,title:n.title||null}),renderMarkdown:(n,e)=>{var t,r,i,s;const o=(t=(r=n.attrs)===null||r===void 0?void 0:r.href)!==null&&t!==void 0?t:"",a=(i=(s=n.attrs)===null||s===void 0?void 0:s.title)!==null&&i!==void 0?i:"",l=e.renderChildren(n);return a?`[${l}](${o} "${a}")`:`[${l}](${o})`},addCommands(){return{setLink:n=>({chain:e})=>{const{href:t}=n;return this.options.isAllowedUri(t,{defaultValidate:r=>!!wr(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,n).setMeta("preventAutolink",!0).run():!1},toggleLink:n=>({chain:e})=>{const{href:t}=n||{};return t&&!this.options.isAllowedUri(t,{defaultValidate:r=>!!wr(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:e().toggleMark(this.name,n,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:n})=>n().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addInputRules(){return this.options.markdownLinks?[RV({type:this.type,isAllowedHref:n=>this.options.isAllowedUri(n,{defaultValidate:e=>!!wr(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})})]:[]},addPasteRules(){const n=e=>{const t=[];if(e){const{protocols:r,defaultProtocol:i}=this.options;m$(e).filter(s=>s.isLink&&this.options.isAllowedUri(s.value,{defaultValidate:o=>!!wr(o,r),protocols:r,defaultProtocol:i})).forEach(s=>{this.options.shouldAutoLink(s.value)&&t.push({text:s.value,data:{href:s.href},index:s.start})})}return t};return this.options.markdownLinks?[EV({type:this.type,isAllowedHref:e=>this.options.isAllowedUri(e,{defaultValidate:t=>!!wr(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}),findPlainUrls:n})]:[ki({find:n,type:this.type,getAttributes:e=>{var t;return{href:(t=e.data)===null||t===void 0?void 0:t.href}}})]},addProseMirrorPlugins(){const n=[],{protocols:e,defaultProtocol:t}=this.options;return this.options.autolink&&n.push($V({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:i=>!!wr(i,e),protocols:e,defaultProtocol:t}),shouldAutoLink:this.options.shouldAutoLink})),n.push(CV({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick==="whenNotEditable"?!0:this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&n.push(NV({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),n}}),jV="listItem",Ly="textStyle",_y=/^\s*([-+*])\s$/,x$=sn.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:n}){return["ul",Ke(this.options.HTMLAttributes,n),0]},markdownTokenName:"list",parseMarkdown:(n,e)=>n.type!=="list"||n.ordered?[]:{type:"bulletList",content:n.items?e.parseChildren(n.items):[]},renderMarkdown:(n,e)=>n.content?e.renderChildren(n.content,`
|
|
244
|
+
`):"",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:n,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(jV,this.editor.getAttributes(Ly)).run():n.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let n=uo({find:_y,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(n=uo({find:_y,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(Ly),editor:this.editor})),[n]}}),IV=(n,e,t)=>{const{selection:r}=n;if(!r.empty)return null;const{$from:i}=r;if(!i.parent.isTextblock||i.parentOffset!==i.parent.content.size)return null;let s=-1;for(let p=i.depth;p>0;p-=1)if(i.node(p).type.name===e){s=p;break}if(s<0)return null;const o=i.node(s),a=i.index(s);if(a+1>=o.childCount)return null;const l=o.child(a+1);if(!t.includes(l.type.name))return null;const c=n.schema.nodes[e];let d=!1;if(l.forEach(p=>{p.type===c&&p.childCount>1&&(d=!0)}),!d)return null;const h=n.doc.resolve(i.after()).nodeAfter;if(!h||!t.includes(h.type.name))return null;const f=[];return h.forEach(p=>{f.push(p)}),f.length===0?null:{listItemDepth:s,nestedList:h,nestedListPos:i.after(),insertPos:i.after(s),items:f}},XV=(n,e,t,r)=>{const i=IV(n,t,r);if(!i)return!1;const{selection:s}=n,{nestedList:o,nestedListPos:a,insertPos:l,items:c}=i,d=n.tr;d.delete(a,a+o.nodeSize);const h=d.mapping.map(l);return d.insert(h,E.from(c)),d.setSelection(s.map(d.doc,d.mapping)),e&&e(d),!0},LV=(n,e,t)=>XV(n.state,n.view.dispatch,e,t),S$=(n,e)=>at.create({name:`${n}BranchingDeleteKeymap`,priority:101,addKeyboardShortcuts(){const t=()=>LV(this.editor,n,e);return{Delete:t,"Mod-Delete":t}}}),k$=[[1e3,"m"],[900,"cm"],[500,"d"],[400,"cd"],[100,"c"],[90,"xc"],[50,"l"],[40,"xl"],[10,"x"],[9,"ix"],[5,"v"],[4,"iv"],[1,"i"]],cc="abcdefghijklmnopqrstuvwxyz",v$=String.raw`\d+|[ivxlcdmIVXLCDM]+|${"[a-zA-Z]{1,2}"}`;function _d(n){let e=n,t="";for(const[r,i]of k$)for(;e>=r;)t+=i,e-=r;return t}function Vg(n){return _d(n).toUpperCase()}function w$(n){const e=n.toLowerCase();let t=0,r=0;for(;t<e.length;){let i=!1;for(const[s,o]of k$)if(e.startsWith(o,t)){r+=s,t+=o.length,i=!0;break}if(!i)return 0}return r}function _V(n){if(!/^[ivxlcdmIVXLCDM]+$/.test(n))return!1;const e=w$(n);return e<=0?!1:(n===n.toLowerCase()?_d(e):Vg(e))===n}function BV(n){const e=n.toLowerCase();if(e.length===1)return e.charCodeAt(0)-97+1;if(e.length===2){const t=e.charCodeAt(0)-97,r=e.charCodeAt(1)-97;return(t+1)*26+r+1}return 0}function ed(n){if(n<=26)return cc[n-1];const e=Math.floor((n-1)/26)-1,t=(n-1)%26;return e<0?cc[t]:cc[e]+cc[t]}function Bd(n){if(!(!n||/^\d+$/.test(n))){if(_V(n))return n===n.toLowerCase()?"i":"I";if(/^[a-z]{1,2}$/.test(n))return"a";if(/^[A-Z]{1,2}$/.test(n))return"A"}}function Fg(n){if(/^\d+$/.test(n))return parseInt(n,10);const e=Bd(n);if(e==="i"||e==="I")return w$(n);if(e==="a"||e==="A"){const r=BV(n);return r>0?r:1}const t=parseInt(n,10);return Number.isNaN(t)?1:t}function ZV(n,e){if(n==="numeric")return String(e);switch(n){case"a":return ed(e);case"A":return ed(e).toUpperCase();case"i":return _d(e);case"I":return Vg(e);default:return String(e)}}function WV(n){var e;if(n.length===0)return!1;const t=(e=Bd(n[0]))!==null&&e!==void 0?e:"numeric",r=Fg(n[0]);if(r<1)return!1;for(let i=0;i<n.length;i++){const s=ZV(t,r+i);if(n[i]!==s)return!1}return!0}function zV(n){return{type:Bd(n),start:Fg(n)}}function VV(n){const{type:e,start:t}=zV(n),r={};return e&&(r.type=e),t!==1&&(r.start=t),r}function FV(n,e,t=". "){const r=e+1;if(!n||n==="1")return`${r}${t}`;switch(n){case"a":return`${ed(r)}${t}`;case"A":return`${ed(r).toUpperCase()}${t}`;case"i":return`${_d(r)}${t}`;case"I":return`${Vg(r)}${t}`;default:return`${r}${t}`}}function qV(n){var e,t;const r=(e=n.tokens)===null||e===void 0?void 0:e[0];return!!(n.text&&((t=n.tokens)===null||t===void 0?void 0:t.length)===1&&r?.type==="list"&&r.ordered&&r.raw===n.text)}function YV(n,e){return e.tokenizeInline?e.parseInline(e.tokenizeInline(n)):e.parseInline([{type:"text",raw:n,text:n}])}const Q$=sn.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:n}){return["li",Ke(this.options.HTMLAttributes,n),0]},markdownTokenName:"list_item",parseMarkdown:(n,e)=>{var t;if(n.type!=="list_item")return[];const r=(t=e.parseBlockChildren)!==null&&t!==void 0?t:e.parseChildren;let i=[];if(n.tokens&&n.tokens.length>0){if(qV(n))return{type:"listItem",content:[{type:"paragraph",content:YV(n.text||"",e)}]};if(n.tokens.some(s=>s.type==="paragraph"))i=r(n.tokens);else{const s=n.tokens[0];if(s&&s.type==="text"&&s.tokens&&s.tokens.length>0){if(i=[{type:"paragraph",content:e.parseInline(s.tokens)}],n.tokens.length>1){const o=r(n.tokens.slice(1));i.push(...o)}}else i=r(n.tokens)}}return i.length===0&&(i=[{type:"paragraph",content:[]}]),{type:"listItem",content:i}},renderMarkdown:(n,e,t)=>LQ(n,e,r=>{if(r.parentType==="bulletList")return"- ";if(r.parentType==="orderedList"){var i,s;const o=((i=r.meta)===null||i===void 0||(i=i.parentAttrs)===null||i===void 0?void 0:i.start)||1;return FV((s=r.meta)===null||s===void 0||(s=s.parentAttrs)===null||s===void 0?void 0:s.type,o-1+(r.index||0),". ")}return"- "},t,{alignNestedToPrefix:t?.parentType==="orderedList"}),addExtensions(){return[S$(this.name,[this.options.bulletListTypeName,this.options.orderedListTypeName])]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),qg=(n,e)=>{const{$from:t}=e.selection,r=mt(n,e.schema);let i=null,s=t.depth,o=t.pos,a=null;for(;s>0&&a===null;)i=t.node(s),i.type===r?a=s:(s-=1,o-=1);return a===null?null:{$pos:e.doc.resolve(o),depth:a}},$$=(n,e)=>{const t=qg(n,e);if(!t)return!1;const[,r]=eB(e,n,t.$pos.pos+4);return r},UV=(n,e,t)=>{const{$anchor:r}=n.selection,i=Math.max(0,r.pos-2),s=n.doc.resolve(i).node();return!(!s||!t.includes(s.type.name))},By=(n,e,t)=>{if(n.commands.undoInputRule())return!0;if(n.state.selection.from!==n.state.selection.to)return!1;if(!Vr(n.state,e)&&UV(n.state,e,t)){const{$anchor:s}=n.state.selection,o=n.state.doc.resolve(s.before()-1),a=[];o.node().descendants((d,h)=>{d.type.name===e&&a.push({node:d,pos:h})});const l=a.at(-1);if(!l)return!1;const c=n.state.doc.resolve(o.start()+l.pos+1);return n.chain().cut({from:s.start()-1,to:s.end()+1},c.end()).joinForward().run()}if(!Vr(n.state,e)||!sB(n.state))return!1;const{$from:r}=n.state.selection,i=r.depth-1;return r.node(i).type!==n.schema.nodes[e]||r.index(i)!==0?!1:n.chain().liftListItem(e).run()},GV=(n,e)=>{const t=$$(n,e),r=qg(n,e);return!r||!t?!1:t>r.depth},HV=(n,e)=>{const t=$$(n,e),r=qg(n,e);return!r||!t?!1:t<r.depth},Zy=(n,e)=>{if(!Vr(n.state,e)||!iB(n.state,e))return!1;const{selection:t}=n.state,{$from:r,$to:i}=t;return!t.empty&&r.sameParent(i)?!1:GV(e,n.state)?n.chain().focus(n.state.selection.from+4).lift(e).joinBackward().run():HV(e,n.state)?n.chain().joinForward().joinBackward().run():n.commands.joinItemForward()},KV=(n,e,t)=>{const{state:r}=n,{selection:i}=r;if(!i.empty)return!1;const{$from:s}=i;if(s.parentOffset!==0||!s.parent.isTextblock||Vr(r,e))return!1;const o=tB(s);if(!o||!t.includes(o.type.name))return!1;const a=o.lastChild;if(!a||a.type.name!==e)return!1;const l=s.parent;if(!a.canReplace(a.childCount,a.childCount,E.from(l)))return!1;const c=s.before(),d=s.after(),h=c-2;return n.commands.command(({tr:f,dispatch:p})=>(p&&(f.delete(c,d).insert(h,E.from(l)),f.setSelection(J.create(f.doc,h+1)),f.scrollIntoView()),!0))},C$=at.create({name:"listKeymap",addOptions(){return{listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}},addKeyboardShortcuts(){return{Delete:({editor:n})=>{let e=!1;return this.options.listTypes.forEach(({itemName:t})=>{n.state.schema.nodes[t]!==void 0&&Zy(n,t)&&(e=!0)}),e},"Mod-Delete":({editor:n})=>{let e=!1;return this.options.listTypes.forEach(({itemName:t})=>{n.state.schema.nodes[t]!==void 0&&Zy(n,t)&&(e=!0)}),e},Backspace:({editor:n})=>{let e=!1;return this.options.listTypes.forEach(({itemName:t,wrapperNames:r})=>{n.state.schema.nodes[t]!==void 0&&By(n,t,r)&&(e=!0)}),e},"Mod-Backspace":({editor:n})=>{let e=!1;return this.options.listTypes.forEach(({itemName:t,wrapperNames:r})=>{n.state.schema.nodes[t]!==void 0&&By(n,t,r)&&(e=!0)}),e},Tab:({editor:n})=>{for(const{itemName:e,wrapperNames:t}of this.options.listTypes)if(n.state.schema.nodes[e]!==void 0&&KV(n,e,t))return!0;return!1}}}}),td=new RegExp(`^(\\s*)(${v$})([.)])\\s+(.*)$`),JV=/^\s/,Ts={heading:/^#{1,6}(?:\s|$)/,bulletItem:/^[-+*]\s+/,codeFence:/^(?:```|~~~)/,blockMath:/^\$\$/,thematicBreak:/^(?:(?:-[ \t]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})$/};function eF(n){return td.test(n.trimStart())}function tF(n){const e=n.trimStart();return Ts.bulletItem.test(e)||eF(e)||Ts.heading.test(e)||Ts.thematicBreak.test(e)&&!e.startsWith("-")||/^>\s?/.test(e)||Ts.codeFence.test(e)||Ts.blockMath.test(e)}function nF(n){return Object.values(Ts).some(e=>e.test(n))}function rF(n){const e=[],t=[];let r=!1;return n.forEach(i=>{if(r){t.push(i);return}if(i.trim()===""){r=!0,t.push(i);return}if(e.length>0&&tF(i)){r=!0,t.push(i);return}e.push(i)}),{paragraphLines:e,blockLines:t}}function Wy(n){const e=[];let t=0,r=0;for(;t<n.length;){const i=n[t],s=i.match(td);if(!s)break;const[,o,a,l,c]=s,d=o.length,h=parseInt(a,10),f=isNaN(h)?Bd(a):void 0,p=isNaN(h)?Fg(a):h,m=[c];let O=t+1;const b=[i];let y=!1;for(;O<n.length;){const k=n[O];if(k.match(td))break;if(k.trim()==="")b.push(k),m.push(""),y=!0,O+=1;else if(k.match(JV)){const x=k.length-k.trimStart().length,S=d+a.length+1;b.push(k),m.push(k.slice(Math.min(x,S))),O+=1}else{if(y||nF(k))break;b.push(k),m.push(k),O+=1}}e.push({indent:d,number:p,type:f,content:m.join(`
|
|
245
|
+
`).trim(),contentLines:m,raw:b.join(`
|
|
246
|
+
`)}),r=O,t=O}return[e,r]}const iF=new RegExp(`^(${v$})([.)])\\s+(.+)$`);function sF(n){const e=n.split(`
|
|
247
|
+
`).filter(r=>r.trim().length>0);if(e.length===0)return null;const t=[];for(const r of e){const i=r.trim().match(iF);if(!i)return null;t.push({marker:i[1],content:i[3]})}return WV(t.map(r=>r.marker))?{type:"orderedList",attrs:VV(t[0].marker),content:t.map(r=>({type:"listItem",content:[{type:"paragraph",content:[{type:"text",text:r.content}]}]}))}:null}function P$(n,e,t){const r=[];let i=0;for(;i<n.length;){const s=n[i];if(s.indent===e){const{paragraphLines:o,blockLines:a}=rF(s.contentLines),l=o.join(`
|
|
248
|
+
`).trim(),c=[];l&&c.push({type:"paragraph",raw:l,tokens:t.inlineTokens(l)});const d=a.join(`
|
|
249
|
+
`).trim();if(d){const p=t.blockTokens(d);c.push(...p)}let h=i+1;const f=[];for(;h<n.length&&n[h].indent>e;)f.push(n[h]),h+=1;if(f.length>0){const p=P$(f,Math.min(...f.map(m=>m.indent)),t);c.push({type:"list",ordered:!0,start:f[0].number,typeMarker:f[0].type,items:p,raw:f.map(m=>m.raw).join(`
|
|
250
|
+
`)})}r.push({type:"list_item",raw:s.raw,tokens:c}),i=h}else i+=1}return r}function oF(n,e){return n.map(t=>{if(t.type!=="list_item")return e.parseChildren([t])[0];const r=[];return t.tokens&&t.tokens.length>0&&t.tokens.forEach(i=>{if(i.type==="paragraph"||i.type==="list"||i.type==="blockquote"||i.type==="code")r.push(...e.parseChildren([i]));else if(i.type==="text"&&i.tokens){const s=e.parseChildren([i]);r.push({type:"paragraph",content:s})}else{const s=e.parseChildren([i]);s.length>0&&r.push(...s)}}),{type:"listItem",content:r}})}const aF=64;function zy(n,e){const t=[];let r=0;for(;t.length<e;){const i=n.indexOf(`
|
|
251
|
+
`,r);if(i===-1)return t.push(n.slice(r)),t;t.push(n.slice(r,i)),r=i+1}return t}function lF(n){const e=n.indexOf(`
|
|
252
|
+
`),t=e===-1?n:n.slice(0,e);if(!td.test(t))return[[],0,[]];let r=aF,i=zy(n,r),s=Wy(i);for(;s[1]===i.length&&i.length===r;)r*=2,i=zy(n,r),s=Wy(i);return[s[0],s[1],i]}const cF="listItem",Vy="textStyle",Fy=/^(\d+)\.\s$/;function qy(n){const e=n.match(/list-style-type\s*:\s*([^;]+)/i);if(!e)return null;switch(e[1].trim().toLowerCase()){case"upper-roman":return"I";case"lower-roman":return"i";case"upper-alpha":case"upper-latin":return"A";case"lower-alpha":case"lower-latin":return"a";default:return null}}const T$=sn.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:n=>n.hasAttribute("start")?parseInt(n.getAttribute("start")||"",10):1},type:{default:null,parseHTML:n=>{const e=n.getAttribute("type");if(e)return e;const t=n.getAttribute("style");if(t){const i=qy(t);if(i)return i}const r=n.querySelector("li");if(r){const i=r.getAttribute("style");if(i){const s=qy(i);if(s)return s}}return null}}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:n}){const{start:e,type:t,...r}=n,i=Ke(this.options.HTMLAttributes,r);return e!==1&&(i.start=e),t&&t!=="1"&&(i.type=t),["ol",i,0]},markdownTokenName:"list",parseMarkdown:(n,e)=>{if(n.type!=="list"||!n.ordered)return[];const t=n.start||1,r=n.typeMarker,i=n.items?oF(n.items,e):[],s={};return t!==1&&(s.start=t),r&&(s.type=r),Object.keys(s).length>0?{type:"orderedList",attrs:s,content:i}:{type:"orderedList",content:i}},renderMarkdown:(n,e)=>n.content?e.renderChildren(n.content,`
|
|
253
|
+
`):"",markdownTokenizer:{name:"orderedList",level:"block",start:()=>-1,tokenize:(n,e,t)=>{var r,i;const[s,o,a]=lF(n);if(s.length===0)return;const l=P$(s,s[0].indent,t);if(l.length!==0)return{type:"list",ordered:!0,start:((r=s[0])===null||r===void 0?void 0:r.number)||1,typeMarker:(i=s[0])===null||i===void 0?void 0:i.type,items:l,raw:a.slice(0,o).join(`
|
|
254
|
+
`)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:n,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(cF,this.editor.getAttributes(Vy)).run():n.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addProseMirrorPlugins(){return[new Ee({props:{handlePaste:(n,e)=>{var t,r;const i=(t=e.clipboardData)===null||t===void 0?void 0:t.getData("text/html");if(i?.trim())return!1;const s=(r=e.clipboardData)===null||r===void 0?void 0:r.getData("text/plain");if(!s)return!1;const o=sF(s);if(!o)return!1;try{const a=n.state.schema.nodeFromJSON(o),l=n.state.tr.replaceSelectionWith(a);return n.dispatch(l),!0}catch{return!1}}}})]},addInputRules(){const n=(t,r)=>(!r.attrs.type||r.attrs.type==="1")&&r.childCount+r.attrs.start===+t[1];let e=uo({find:Fy,type:this.type,getAttributes:t=>({start:+t[1]}),joinPredicate:n});return(this.options.keepMarks||this.options.keepAttributes)&&(e=uo({find:Fy,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:t=>({start:+t[1],...this.editor.getAttributes(Vy)}),joinPredicate:n,editor:this.editor})),[e]}}),uF=/^\s*(\[([( |x])?\])\s$/,dF="position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0",hF=(n,e,t)=>{var r;return(t==null||(r=t.checkboxLabel)===null||r===void 0?void 0:r.call(t,n,e))||`Task item checkbox for ${n.textContent||"empty task item"}`},fF=sn.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:n=>{const e=n.getAttribute("data-checked");return e===""||e==="true"},renderHTML:n=>({"data-checked":n.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51,contentElement:n=>{var e;return(e=n.querySelector("div"))!==null&&e!==void 0?e:n}}]},renderHTML({node:n,HTMLAttributes:e}){return["li",Ke(this.options.HTMLAttributes,e,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:n.attrs.checked?"checked":null}],["span"]],["div",0]]},parseMarkdown:(n,e)=>{const t=[];if(n.tokens&&n.tokens.length>0?t.push(e.createNode("paragraph",{},e.parseInline(n.tokens))):n.text?t.push(e.createNode("paragraph",{},[e.createNode("text",{text:n.text})])):t.push(e.createNode("paragraph",{},[])),n.nestedTokens&&n.nestedTokens.length>0){const r=e.parseChildren(n.nestedTokens);t.push(...r)}return e.createNode("taskItem",{checked:n.checked||!1},t)},renderMarkdown:(n,e)=>{var t;const r=`- [${!((t=n.attrs)===null||t===void 0)&&t.checked?"x":" "}] `;return LQ(n,e,r)},addExtensions(){return this.options.nested?[S$(this.name,[this.options.taskListTypeName])]:[]},addKeyboardShortcuts(){const n={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...n,Tab:()=>this.editor.commands.sinkListItem(this.name)}:n},addNodeView(){return({node:n,HTMLAttributes:e,getPos:t,editor:r})=>{const i=document.createElement("li"),s=document.createElement("label"),o=document.createElement("span"),a=document.createElement("input"),l=document.createElement("div");o.style.cssText=dF;const c=h=>{const f=hF(h,h.attrs.checked,this.options.a11y);a.setAttribute("aria-label",f),o.textContent=f};c(n),s.contentEditable="false",a.type="checkbox",a.addEventListener("mousedown",h=>h.preventDefault()),a.addEventListener("change",h=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){a.checked=!a.checked;return}const{checked:f}=h.target;r.isEditable&&typeof t=="function"&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:p})=>{const m=t();if(typeof m!="number")return!1;const O=p.doc.nodeAt(m);return p.setNodeMarkup(m,void 0,{...O?.attrs,checked:f}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(n,f)||(a.checked=!a.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([h,f])=>{i.setAttribute(h,f)}),i.dataset.checked=n.attrs.checked,a.checked=n.attrs.checked,s.append(a,o),i.append(s,l),Object.entries(e).forEach(([h,f])=>{i.setAttribute(h,f)});let d=new Set(Object.keys(e));return{dom:i,contentDOM:l,update:h=>{if(h.type!==this.type)return!1;i.dataset.checked=h.attrs.checked,a.checked=h.attrs.checked,c(h);const f=r.extensionManager.attributes,p=el(h,f),m=new Set(Object.keys(p)),O=this.options.HTMLAttributes;return d.forEach(b=>{m.has(b)||(b in O?i.setAttribute(b,O[b]):i.removeAttribute(b))}),Object.entries(p).forEach(([b,y])=>{y==null?b in O?i.setAttribute(b,O[b]):i.removeAttribute(b):i.setAttribute(b,y)}),d=m,!0}}}},addInputRules(){return[uo({find:uF,type:this.type,getAttributes:n=>({checked:n[n.length-1]==="x"})})]}}),pF=sn.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:n}){return["ul",Ke(this.options.HTMLAttributes,n,{"data-type":this.name}),0]},parseMarkdown:(n,e)=>e.createNode("taskList",{},e.parseChildren(n.items||[])),renderMarkdown:(n,e)=>n.content?e.renderChildren(n.content,`
|
|
255
|
+
`):"",markdownTokenizer:{name:"taskList",level:"block",start(n){var e;const t=(e=n.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))===null||e===void 0?void 0:e.index;return t!==void 0?t:-1},tokenize(n,e,t){const r=s=>{const o=by(s,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:a=>({indentLevel:a[1].length,mainContent:a[4],checked:a[3].toLowerCase()==="x"}),createToken:(a,l)=>({type:"taskItem",raw:"",mainContent:a.mainContent,indentLevel:a.indentLevel,checked:a.checked,text:a.mainContent,tokens:t.inlineTokens(a.mainContent),nestedTokens:l}),customNestedParser:r},t);if(o){const a={type:"taskList",raw:o.raw,items:o.items},l=s.slice(o.raw.length);return l.trim()?[a,...t.blockTokens(l)]:[a]}return t.blockTokens(s)},i=by(n,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:s=>({indentLevel:s[1].length,mainContent:s[4],checked:s[3].toLowerCase()==="x"}),createToken:(s,o)=>({type:"taskItem",raw:"",mainContent:s.mainContent,indentLevel:s.indentLevel,checked:s.checked,text:s.mainContent,tokens:t.inlineTokens(s.mainContent),nestedTokens:o}),customNestedParser:r},t);if(i)return{type:"taskList",raw:i.raw,items:i.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:n})=>n.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});at.create({name:"listKit",addExtensions(){const n=[];return this.options.bulletList!==!1&&n.push(x$.configure(this.options.bulletList)),this.options.listItem!==!1&&n.push(Q$.configure(this.options.listItem)),this.options.listKeymap!==!1&&n.push(C$.configure(this.options.listKeymap)),this.options.orderedList!==!1&&n.push(T$.configure(this.options.orderedList)),this.options.taskItem!==!1&&n.push(fF.configure(this.options.taskItem)),this.options.taskList!==!1&&n.push(pF.configure(this.options.taskList)),n}});const uc=" ",sf=" ",mF=sn.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:n}){return["p",Ke(this.options.HTMLAttributes,n),0]},parseMarkdown:(n,e)=>{const t=n.tokens||[];if(t.length===1&&t[0].type==="image")return e.parseChildren([t[0]]);const r=e.parseInline(t);return t.length===1&&t[0].type==="text"&&(t[0].raw===uc||t[0].text===uc||t[0].raw===sf||t[0].text===sf)&&r.length===1&&r[0].type==="text"&&(r[0].text===uc||r[0].text===sf)?e.createNode("paragraph",void 0,[]):e.createNode("paragraph",void 0,r)},renderMarkdown:(n,e,t)=>{if(!n)return"";const r=Array.isArray(n.content)?n.content:[];if(r.length===0){var i,s;const o=Array.isArray(t==null||(i=t.previousNode)===null||i===void 0?void 0:i.content)?t.previousNode.content:[];return(t==null||(s=t.previousNode)===null||s===void 0?void 0:s.type)==="paragraph"&&o.length===0?uc:""}return e.renderChildren(r)},addCommands(){return{setParagraph:()=>({commands:n})=>n.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),gF=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,OF=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,bF=hs.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:n=>n.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["s",Ke(this.options.HTMLAttributes,n),0]},markdownTokenName:"del",parseMarkdown:(n,e)=>e.applyMark("strike",e.parseInline(n.tokens||[])),renderMarkdown:(n,e)=>`~~${e.renderChildren(n)}~~`,addCommands(){return{setStrike:()=>({commands:n})=>n.setMark(this.name),toggleStrike:()=>({commands:n})=>n.toggleMark(this.name),unsetStrike:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[us({find:gF,type:this.type})]},addPasteRules(){return[ki({find:OF,type:this.type})]}}),yF=sn.create({name:"text",group:"inline",parseMarkdown:n=>({type:"text",text:n.text||""}),renderMarkdown:n=>n.text||""}),xF=hs.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:n=>n.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["u",Ke(this.options.HTMLAttributes,n),0]},parseMarkdown(n,e){return e.applyMark(this.name||"underline",e.parseInline(n.tokens||[]))},renderMarkdown(n,e){return`++${e.renderChildren(n)}++`},markdownTokenizer:{name:"underline",level:"inline",start(n){return n.indexOf("++")},tokenize(n,e,t){const r=/^(\+\+)([\s\S]+?)(\+\+)/.exec(n);if(!r)return;const i=r[2].trim();return{type:"underline",raw:r[0],text:i,tokens:t.inlineTokens(i)}}},addCommands(){return{setUnderline:()=>({commands:n})=>n.setMark(this.name),toggleUnderline:()=>({commands:n})=>n.toggleMark(this.name),unsetUnderline:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),SF=at.create({name:"starterKit",addExtensions(){const n=[];if(this.options.bold!==!1&&n.push(Lz.configure(this.options.bold)),this.options.blockquote!==!1&&n.push(Nz.configure(this.options.blockquote)),this.options.bulletList!==!1&&n.push(x$.configure(this.options.bulletList)),this.options.code!==!1&&n.push(Wz.configure(this.options.code)),this.options.codeBlock!==!1&&n.push(Fz.configure(this.options.codeBlock)),this.options.document!==!1&&n.push(qz.configure(this.options.document)),this.options.dropcursor!==!1&&n.push(fz.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&n.push(pz.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&n.push(Yz.configure(this.options.hardBreak)),this.options.heading!==!1&&n.push(Uz.configure(this.options.heading)),this.options.undoRedo!==!1&&n.push(Tz.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&n.push(Gz.configure(this.options.horizontalRule)),this.options.italic!==!1&&n.push(tV.configure(this.options.italic)),this.options.listItem!==!1&&n.push(Q$.configure(this.options.listItem)),this.options.listKeymap!==!1){var e;n.push(C$.configure((e=this.options)===null||e===void 0?void 0:e.listKeymap))}if(this.options.link!==!1){var t;n.push(DV.configure((t=this.options)===null||t===void 0?void 0:t.link))}if(this.options.orderedList!==!1&&n.push(T$.configure(this.options.orderedList)),this.options.paragraph!==!1&&n.push(mF.configure(this.options.paragraph)),this.options.strike!==!1&&n.push(bF.configure(this.options.strike)),this.options.text!==!1&&n.push(yF.configure(this.options.text)),this.options.underline!==!1){var r;n.push(xF.configure((r=this.options)===null||r===void 0?void 0:r.underline))}if(this.options.trailingNode!==!1){var i;n.push(Pz.configure((i=this.options)===null||i===void 0?void 0:i.trailingNode))}return n}});var kF=SF;function vF(n){return n==="dark"?{list:"w-[260px] overflow-hidden rounded-md border border-[#2A3242] bg-[#141925] shadow-lg",itemBase:"flex w-full items-center px-3 py-2 text-left text-sm text-[#F4F7FC]",itemSelected:"bg-[#1E2533]",itemDefault:"bg-[#141925] hover:bg-[#1E2533]",mentionClass:"rounded bg-[#3B6BFF]/20 px-1 py-0.5 font-medium text-[#93B4FF]"}:{list:"w-[260px] overflow-hidden rounded-md border border-gray-200 bg-white shadow-md",itemBase:"flex w-full items-center px-3 py-2 text-left text-sm text-gray-900",itemSelected:"bg-gray-100",itemDefault:"bg-white hover:bg-gray-100",mentionClass:"rounded bg-blue-50 px-1 py-0.5 font-medium text-blue-700"}}function Yy(n){try{return JSON.parse(n)}catch{return""}}function M$({value:n,setValue:e,editable:t=!0,theme:r="default"}){const i=sd()?.id,s=vF(r),{data:o}=xa(LW,{fetchPolicy:"cache-first",variables:{orgId:i},skip:!i}),a=$.useMemo(()=>mi(o?.members).map(d=>({id:d.email,label:d.email})),[o?.members]),l=DW({editable:t,immediatelyRender:!1,extensions:[kF.configure({heading:!1,blockquote:!1,code:!1,codeBlock:!1,bulletList:!1,orderedList:!1,listItem:!1,horizontalRule:!1}),...t?[Mz.configure({placeholder:"Add a comment..."})]:[],rz.configure({HTMLAttributes:{class:s.mentionClass},suggestion:{items({query:c}){const d=c.trim().toLowerCase();return d?a.filter(h=>h.label.toLowerCase().includes(d)):a},render(){let c=null,d=0,h=[],f=null,p=null;function m(O){if(!c)return;h=O.items,f=O.command,p=O.clientRect??null;const b=p?.();if(b&&(c.style.left=`${b.left}px`,c.style.top=`${b.bottom+6}px`),c.textContent="",!h.length)return;const y=document.createElement("div");y.className=s.list,d>=h.length&&(d=0);for(let k=0;k<h.length;k++){const x=h[k],S=document.createElement("button");S.type="button",S.className=s.itemBase+" "+(k===d?s.itemSelected:s.itemDefault),S.textContent=x.label,S.onmousedown=v=>{v.preventDefault(),f?.(x)},y.appendChild(S)}c.appendChild(y)}return{onStart:O=>{d=0,c=document.createElement("div"),c.className="fixed z-50",document.body.appendChild(c),m(O)},onUpdate:O=>{m(O)},onKeyDown:O=>{if(O.event.key==="Escape")return c?.remove(),c=null,!0;if(O.event.key==="ArrowDown")return h.length&&(d=(d+1)%h.length,m({items:h,command:f||(()=>{}),clientRect:p})),!0;if(O.event.key==="ArrowUp")return h.length&&(d=(d-1+h.length)%h.length,m({items:h,command:f||(()=>{}),clientRect:p})),!0;if(O.event.key==="Enter"){const b=h[d];return b&&f?.(b),!0}return!1},onExit:()=>{c?.remove(),c=null}}}}})],content:Yy(n),onUpdate:({editor:c})=>{const d=JSON.stringify(c.getJSON(),null,2);e(d)}},[r,a,t]);return $.useEffect(()=>{if(!l)return;const c=l.getJSON(),d=Yy(n);JSON.stringify(c)===JSON.stringify(d)||l.commands.setContent(d)},[n,l]),l}const wF="border-[#2A3242] bg-[#1E2533] text-[#F4F7FC] shadow-none ring-0 focus-within:ring-0 [&_.ProseMirror]:text-[#F4F7FC] [&_.ProseMirror_p.is-editor-empty:first-child::before]:text-[#828DA3] [&_.mention]:bg-[#3B6BFF]/20 [&_.mention]:text-[#93B4FF]";function A$({value:n,setValue:e,className:t,forceFocus:r=!1,theme:i="default"}){const s=M$({value:n,setValue:e,theme:i});return g.jsx("div",{className:F("border-stock rounded-md border bg-transparent px-3 py-2 text-sm shadow-xs transition-all","ring-stock ring-0 focus-within:ring-2",i==="dark"&&wF,t),onMouseDownCapture:o=>{r&&(o.stopPropagation(),o.nativeEvent.stopImmediatePropagation())},onDrop:o=>{r&&(o.stopPropagation(),o.nativeEvent.stopImmediatePropagation())},children:g.jsx(Ng,{editor:s,className:"prose max-w-none cursor-text text-sm [&_.ProseMirror]:min-h-[64px] [&_.ProseMirror]:whitespace-pre-wrap [&_.ProseMirror]:outline-none"})})}function R$({value:n,theme:e="default"}){const t=M$({value:n,setValue:()=>{},editable:!1,theme:e});return g.jsx(Ng,{editor:t,className:F("prose max-w-none text-sm",e==="dark"&&"text-[#F4F7FC] [&_.ProseMirror]:text-[#F4F7FC] [&_.mention]:bg-[#3B6BFF]/20 [&_.mention]:text-[#93B4FF]")})}function E$(n){const e=new Date,t=new Date(n),r=Math.floor((e.getTime()-t.getTime())/(1e3*60));return r<1?"Just now":r<60?`${r} min ago`:r<1440?`${Math.floor(r/60)} hour${Math.floor(r/60)>1?"s":""} ago`:`${Math.floor(r/1440)} day${Math.floor(r/1440)>1?"s":""} ago`}const QF=18,$F="#E2E8F0",of=10,CF=1,af=4,PF=.3,Uy=.75;function TF({id:n,data:e}){const{updateNodeData:t}=On(),r=$.useRef(null),i={...va,rowHeight:e.rowHeight??va.rowHeight},{rowCount:s}=e,a=Mn(e.componentFields,{componentFieldId:"name"})??e.label??"",l=e.color??$F,c=e.titleFontSize??QF,d=of/2,h=e.rowYs,f=e.activations,p=i.rowHeight*PF,m=(f??[]).map(x=>({top:(h?.[x.startRow]??Ud(x.startRow,i))-p,bottom:(h?.[x.endRow]??Ud(x.endRow,i))+p})),O=h?.length??s??1,b=e.lifelineHeight??i.headerHeight+O*i.rowHeight,y=e.lifelineStartRow!==void 0&&h?(h[e.lifelineStartRow]??i.headerHeight)-i.rowHeight/2:i.headerHeight,k=e.lifelineEndRow!==void 0&&h?(h[e.lifelineEndRow]??b)+i.rowHeight/2:b;return g.jsxs("div",{className:"relative overflow-visible",style:{width:of,height:b},children:[g.jsx("div",{className:"absolute top-0 left-1/2 -ml-0.5 flex items-end",style:{height:i.headerHeight,fontSize:c},onDoubleClick:()=>r.current?.focus(),children:g.jsxs("div",{className:"flex items-end gap-1.5 pb-2",children:[g.jsx("div",{className:"h-[1em] w-1 rounded-full",style:{backgroundColor:l}}),g.jsx("input",{ref:r,value:a,size:1,onKeyDown:x=>x.stopPropagation(),onMouseDown:x=>x.stopPropagation(),className:"text-foreground mb-[-0.25em] block field-sizing-content border-none bg-transparent p-0 text-[1em] leading-[1] font-medium whitespace-nowrap outline-none",style:{color:e.textColor},onChange:x=>{const S=e.componentFields??[];t(n,{componentFields:vi(S,{...rm(S,S),name:x.currentTarget.value})})}})]})}),g.jsxs("svg",{className:"pointer-events-none absolute top-0 left-0 overflow-visible",width:of,height:b,children:[g.jsx("line",{x1:d,y1:y,x2:d,y2:k,stroke:l,strokeOpacity:Uy,strokeWidth:CF}),m.map(x=>g.jsx("rect",{x:d-af/2,y:x.top,width:af,height:x.bottom-x.top,fill:l,fillOpacity:Uy,rx:af/2},x.top))]}),Array.from({length:O},(x,S)=>{const v=h?.[S]??Ud(S,i),w="!w-1 !h-1 !opacity-0 !border-0 !bg-transparent";return g.jsxs($.Fragment,{children:[g.jsx(un,{id:Ql(S,"left","target"),type:"target",position:ge.Left,className:w,style:{top:v}}),g.jsx(un,{id:Ql(S,"left","source"),type:"source",position:ge.Left,className:w,style:{top:v}}),g.jsx(un,{id:Ql(S,"right","target"),type:"target",position:ge.Right,className:w,style:{top:v}}),g.jsx(un,{id:Ql(S,"right","source"),type:"source",position:ge.Right,className:w,style:{top:v}})]},S)})]})}const MF="text-[#F4F7FC] border border-transparent px-1 text-[12px] leading-[1.5] font-normal",AF="text-[#F4F7FC] border-primary absolute inset-0 size-full border bg-[#1E2533] px-1 text-[12px] leading-[1.5] font-normal opacity-0 transition-all duration-100 outline-none focus:opacity-100";function lf({value:n,onChange:e,className:t,placeholder:r="—"}){return g.jsxs("div",{className:"relative isolate flex h-8 w-full items-center",children:[g.jsx("p",{className:F(MF,t),children:n||g.jsx("span",{className:"text-[#828DA3]",children:r})}),g.jsx("input",{value:n,placeholder:r,onChange:i=>e(i.target.value),onKeyDown:i=>i.stopPropagation(),className:F(AF,t)})]})}const nG=["Task","Owner","Status","Due"],rG=[["Website revamp","Amara","In progress","May 12"],["Marketing sync","Liu","Blocked","May 15"],["QA review","Nia","Ready","May 17"],["Launch prep","Theo","Planned","May 20"]];function RF({id:n,data:e,selected:t}){const{updateNodeData:r}=On(),i=Mn(e.componentFields,{componentFieldId:"name"}),s=$.useRef(null),[o,a]=dr(i??"Untitled table"),[l,c]=dr(e??{columns:[],rows:[]});function d(y){c(k=>{const x={...k??{},...y};return s.current&&clearTimeout(s.current),s.current=setTimeout(()=>{r(n,x)},200),x})}function h(y,k){const x=l?.columns?.map((S,v)=>v===y?k:S);d({columns:x})}function f(y,k,x){const S=l?.rows?.map((v,w)=>{if(w!==y)return v;const Q=Array.isArray(v)?[...v]:[];return Q[k]=x,Q});d({rows:S})}function p(){const y=l?.columns?.map(()=>"")??[];d({rows:[...l?.rows??[],y]})}function m(){const y=[...l?.columns??[],`Column ${(l?.columns?.length??0)+1}`],k=l?.rows?.map(x=>[...x??[],""])??[];d({columns:y,rows:k})}function O(y){const k=l?.rows?.filter((x,S)=>S!==y);d({rows:k})}function b(y){const k=l?.columns?.filter((S,v)=>v!==y),x=l?.rows?.map(S=>S?.filter((v,w)=>w!==y));d({columns:k,rows:x})}return g.jsx(wi,{selected:t,className:"relative isolate rounded-[0.5rem] bg-[#141925]",style:{borderRadius:e?.borderRadius??8},children:g.jsxs("div",{className:"flex h-full flex-col rounded-[inherit] border border-[#2A3242] bg-[#141925] text-xs text-[#F4F7FC]",children:[g.jsxs("div",{className:"flex items-center gap-2 border-b border-[#2A3242] p-2",children:[g.jsx("div",{className:"pl-2",children:g.jsx(QX,{className:"size-4 text-[#828DA3]"})}),g.jsx("div",{className:"mr-auto",children:g.jsx(lf,{value:o,onChange:y=>{a(y);const k=l?.componentFields??e.componentFields??[],S=k.some(v=>v?.componentFieldId==="name")?k:[...k,{componentFieldId:"name",type:Ar.TextInput,label:"Name",isReadonly:!1,data:[{value:""}]}];d({componentFields:vi(S,{name:y})})},placeholder:"Untitled table",className:F("cursor-grab rounded font-semibold",t&&"cursor-text active:cursor-grabbing")})}),g.jsxs("p",{className:"text-paragraph min-w-fit text-xs",children:[l?.columns?.length," column",l?.columns?.length===1?"":"s"]})]}),g.jsx("div",{className:"relative",children:g.jsxs($x,{className:"border-stock border-t text-xs [&_tr:hover]:bg-[#1E2533]/60",children:[g.jsx(Cx,{children:g.jsxs(Ko,{children:[g.jsx(Cr,{className:"h-9 w-10 p-0 px-2 text-center text-[11px] text-[#828DA3]",children:"#"}),l?.columns?.map((y,k)=>g.jsxs(Cr,{className:"relative h-auto p-0 pr-7 text-[11px] text-[#828DA3]",children:[g.jsx(lf,{value:String(y),onChange:x=>h(k,x),placeholder:`Column ${k+1}`,className:F("min-w-32 cursor-grab font-medium",t&&"cursor-text active:cursor-grabbing")}),t&&g.jsx(Dt,{variant:"ghost",onClick:()=>b(k),className:"hover:bg-destructive/10 hover:text-destructive absolute top-1.5 right-0.5 size-6 text-[#828DA3] [&_svg]:size-3!",children:g.jsx(Kg,{})})]},`col-${k}`)),g.jsx(Cr,{className:"size-9",children:t&&g.jsx(Dt,{variant:"ghost",onClick:m,className:"absolute top-0.5 right-0.5 z-10 size-8 px-1!",children:g.jsx(eO,{})})})]})}),g.jsx(Px,{children:l?.rows?.length?l?.rows?.map((y,k)=>g.jsxs(Ko,{className:"relative isolate last:border-none [&_td]:align-middle",children:[g.jsx(rr,{className:"w-10 px-2 py-1 text-center text-[11px] text-[#828DA3]",children:k+1}),l?.columns?.map((x,S)=>g.jsx(rr,{className:"p-0",children:g.jsx(lf,{value:String(y?.[S]??""),onChange:v=>f(k,S,v),className:F("cursor-grab",t&&"cursor-text active:cursor-grabbing")})},`cell-${k}-${S}`)),g.jsx(rr,{className:"size-9",children:t&&g.jsx(Dt,{variant:"ghost",onClick:()=>O(k),className:"hover:bg-destructive/10 hover:text-destructive absolute top-0.5 right-0.5 z-10 size-8 px-1! text-[#828DA3] [&_svg]:size-3!",children:g.jsx(Kg,{})})})]},`row-${k}`)):g.jsx(Ko,{children:g.jsx(rr,{colSpan:Math.max((l?.columns?.length??0)+1,1),className:"px-2 py-3 text-center text-[12px] text-[#828DA3]",children:"No rows yet"})})})]})}),g.jsx(gc,{children:t&&g.jsx(zi.div,{exit:{opacity:0,height:0},initial:{opacity:0,height:0},animate:{opacity:1,height:"48px"},transition:{duration:.2,ease:"easeOut"},className:"border-stock flex w-full items-center justify-center overflow-hidden border-t px-2",children:g.jsxs(Dt,{preset:"outline",className:"h-8 w-full text-xs shadow-none [&_svg]:size-3.5!",onClick:p,children:[g.jsx(eO,{})," Add Row"]})})})]})})}function EF({data:n,selected:e}){return g.jsxs(wi,{selected:e,className:"size-full overflow-hidden outline-transparent",children:[g.jsx(pr,{minWidth:20,minHeight:20,isVisible:e}),g.jsx("img",{src:n.src,alt:"React Flow Animated Node",className:"size-full rounded-[0.5rem]"})]})}function NF({component:n,category:e,fallbackIcon:t}){const r=Gy(n??"");if(r)return r;const i=Gy(e??"");return i||(t??g.jsx(SC,{}))}function Gy(n){switch(n){case"component_backend-flow-diagram":case"Architecture & Flows":return g.jsx(xC,{});case"component_api-contract":case"API & Contracts":return g.jsx(yC,{});case"component_performance-sla":case"Performance & Reliability":return g.jsx(bC,{});case"component_test-case-suite":case"Quality & Testing":return g.jsx(OC,{});case"component_business-rule-logic":case"Business Logic":return g.jsx(gC,{});case"component_feature-flag-config":case"Release & Feature Management":return g.jsx(mC,{});case"component_support-kb-troubleshooting":case"Support & Operations":return g.jsx(pC,{});case"component_analytics-telemetry-event":case"Analytics & Telemetry":return g.jsx(fC,{});case"component_security-and-pii":case"Security & Compliance":return g.jsx(hC,{});case"component_ownership-on-call":case"Ownership & On-call":return g.jsx(dC,{});case"component_design-spec-link":case"Design & UX":return g.jsx(uC,{});case"component_open-issues-bugs":case"Issue Tracking":return g.jsx(cC,{})}}function DF(n){return mr({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M6 21.5C4.067 21.5 2.5 19.933 2.5 18C2.5 16.067 4.067 14.5 6 14.5C7.5852 14.5 8.92427 15.5539 9.35481 16.9992L15 16.9994V15L17 14.9994V9.24339L14.757 6.99938H9V9.00003H3V3.00003H9V4.99939H14.757L18 1.75739L22.2426 6.00003L19 9.24139V14.9994L21 15V21H15V18.9994L9.35499 19.0003C8.92464 20.4459 7.58543 21.5 6 21.5ZM6 16.5C5.17157 16.5 4.5 17.1716 4.5 18C4.5 18.8285 5.17157 19.5 6 19.5C6.82843 19.5 7.5 18.8285 7.5 18C7.5 17.1716 6.82843 16.5 6 16.5ZM19 17H17V19H19V17ZM18 4.58581L16.5858 6.00003L18 7.41424L19.4142 6.00003L18 4.58581ZM7 5.00003H5V7.00003H7V5.00003Z"},child:[]}]})(n)}function iG(n){return mr({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M5.82843 6.99955L8.36396 9.53509L6.94975 10.9493L2 5.99955L6.94975 1.0498L8.36396 2.46402L5.82843 4.99955H13C17.4183 4.99955 21 8.58127 21 12.9996C21 17.4178 17.4183 20.9996 13 20.9996H4V18.9996H13C16.3137 18.9996 19 16.3133 19 12.9996C19 9.68584 16.3137 6.99955 13 6.99955H5.82843Z"},child:[]}]})(n)}const jF=[{tags:["microservice","service"],icon:g.jsx(ET,{})},{tags:["api-endpoint","api"],icon:g.jsx(NT,{})},{tags:["database","db"],icon:g.jsx(DT,{})},{tags:["message-queue","message","Message Queue","flow_diagram_component_message-queue"],icon:g.jsx(jT,{})},{tags:["external-service"],icon:g.jsx(IT,{})},{tags:["function-lambda","function","lambda","Function / Lambda"],icon:g.jsx(XT,{})},{tags:["job-scheduler","job","scheduler","Job / Scheduler"],icon:g.jsx(LT,{})},{tags:["code-block","code","Code Block"],icon:g.jsx(_T,{})},{tags:["label","Label"],icon:g.jsx(BT,{})},{tags:["file-note","file","note","File / Note"],icon:g.jsx(ZT,{})}],IF=[Ar.TextInput,Ar.URLInput,Ar.NumberInput,Ar.DropdownSelect,Ar.BooleanToggle];function XF(n,e){return jF.find(r=>r.tags.some(i=>i.toLowerCase().trim()===String(n).toLowerCase().trim()))?.icon??e??g.jsx(DF,{className:"text-gray-400"})}const Hy=3;function N$({fields:n}){const[e,t]=$.useState(!1),r=$.useMemo(()=>!n||n.length===0?[]:n.filter(o=>IF.includes(o.type)&&o.hidden===!1&&o.label!=="Name"&&o.label!=="Label"&&o.label!=="Description").map(o=>{const a=o.data?.[0]?.value,l=a&&typeof a=="object"&&("url"in a||"fileId"in a)?a.url??a.fileId:a;return{name:o.label??"",value:l===!0?"Yes":l===!1?"No":l}}).filter(o=>o.value&&typeof o.value=="string"||typeof o.value=="number"&&!Number.isNaN(o.value)),[n]),i=$.useMemo(()=>r.slice(0,Hy),[r]),s=$.useMemo(()=>r.slice(Hy),[r]);return g.jsx(g.Fragment,{children:i.length>0&&g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"border-t border-[#2A3242] bg-[#1E2533]/50 p-5",children:[g.jsx("div",{className:"grid grid-cols-2 gap-x-4 gap-y-3",children:i.map(({name:o,value:a},l)=>g.jsxs($.Fragment,{children:[g.jsx("div",{className:"text-sm font-medium text-[#828DA3] capitalize",children:o}),g.jsx("p",{className:"justify-self-end font-mono text-sm font-medium text-[#F4F7FC]",children:String(a)})]},o+l))}),s.length>0&&g.jsx("div",{className:F("grid overflow-hidden transition-all duration-500 ease-in-out",e?"grid-rows-[1fr] opacity-100":"grid-rows-[0fr] opacity-0"),children:g.jsx("div",{className:"overflow-hidden",children:g.jsx("div",{className:"grid grid-cols-2 gap-x-4 gap-y-3 pt-3",children:s.map(({name:o,value:a},l)=>g.jsxs($.Fragment,{children:[g.jsx("div",{className:"text-sm font-medium text-[#828DA3] capitalize",children:o}),g.jsx("p",{className:"justify-self-end font-mono text-sm font-medium text-[#F4F7FC]",children:String(a)})]},o+l))})})})]}),s.length>0&&g.jsx(g.Fragment,{children:g.jsx("div",{className:"border-t border-[#2A3242] text-center",children:g.jsxs("button",{onClick:()=>t(!e),className:"group/button inline-flex items-center gap-2 px-4 py-3 text-sm font-semibold text-[#828DA3] transition-colors hover:text-[#F4F7FC]",children:[g.jsxs("span",{children:[e?"Hide":"View"," Details"]}),g.jsx(eP,{className:F("h-4 w-4 transition-transform duration-300 group-hover/button:text-[#F4F7FC]",e&&"rotate-180")})]})})})]})})}function LF({icon:n,children:e,name:t,label:r,description:i,fields:s,selected:o,scale:a,contentSize:l,contentRef:c}){const d=a!=null&&l!=null,h=d?{width:l.width*a,height:l.height*a,minWidth:0,maxWidth:"none"}:void 0,f=d?{width:l.width,transform:`scale(${a})`,transformOrigin:"top left"}:void 0;return g.jsx(wi,{selected:o,style:h,className:"min-w-xl overflow-hidden rounded-[0.5rem] border border-[#2A3242] bg-[#141925] text-left",children:g.jsxs("div",{ref:c,style:f,children:[g.jsxs("div",{className:"p-5",children:[g.jsxs("div",{className:"grid grid-cols-[auto_1fr] gap-4",children:[g.jsx("div",{className:"size-12 overflow-hidden rounded-xl bg-[#1E2533] text-white [&>*]:size-full [&>*]:max-h-full [&>*]:min-h-full [&>*]:max-w-full [&>*]:min-w-full",children:n?typeof n=="string"?g.jsx("img",{src:n,alt:t,className:"block object-cover"}):n:g.jsx("div",{className:"flex h-full w-full items-center justify-center bg-[#1E2533]",children:g.jsx(uP,{className:"h-6 w-6 text-[#F4F7FC]"})})}),g.jsxs("div",{className:"flex-1 shrink-0 basis-full",children:[g.jsx("p",{className:"text-lg font-bold text-[#F4F7FC]",children:t}),r&&g.jsxs("div",{className:"mt-1 flex items-center gap-1.5",children:[g.jsx("span",{className:"bg-primary h-2 w-2 rounded-full"}),g.jsx("span",{className:"text-primary text-xs font-semibold",children:r})]})]})]}),i&&g.jsx("div",{className:"mt-4 text-[15px] leading-relaxed text-balance text-[#828DA3]",children:g.jsx("p",{children:i})})]}),e,g.jsx(N$,{fields:s})]})})}const sG=240,oG=1e3,_F=400;function BF({id:n,data:e,selected:t}){const{updateNode:r,updateNodeData:i}=On(),s=$.useRef(null),[o,a]=$.useState(null);$.useLayoutEffect(()=>{const k=s.current;if(!k)return;function x(){a(v=>v===k.offsetHeight?v:k.offsetHeight)}const S=new ResizeObserver(x);return S.observe(k),x(),()=>S.disconnect()},[]);const l=e.scale??1,c=e.contentWidth??_F,d=$.useRef(void 0);$.useLayoutEffect(()=>{if(!c||o==null)return;const k=Math.round(c*l),x=Math.round(o*l);d.current?.width===k&&d.current?.height===x||(d.current={width:k,height:x},r(n,{width:k,height:x}))},[c,o,l,n,r]);const h=$.useRef(c);h.current=c;const f=$.useCallback((k,x)=>{const S=h.current;S&&i(n,{scale:x.width/S})},[n,i]),p=$.useMemo(()=>{const k=NF({component:e.componentId,fallbackIcon:!1});if(k)return g.jsx("div",{className:"flex items-center justify-center bg-[#1E2533] [&>svg]:size-full",children:k});const x=XF(e.componentName);return g.jsx("div",{className:"bg-stock/60 flex items-center justify-center [&>svg]:text-3xl",children:x})},[e.componentId,e.componentName]),m=Mn(e.componentFields,{label:"Name"}),O=Mn(e.componentFields,{label:"Label"}),b=Mn(e.componentFields,{label:"Description"}),y=o!=null&&c>0?{width:c,height:o}:null;return g.jsxs(g.Fragment,{children:[g.jsx(pr,{isVisible:t,keepAspectRatio:!0,onResize:f}),g.jsx(LF,{name:m??"",label:O??"",description:b??"",fields:e.componentFields,selected:t,icon:p,scale:y?l:void 0,contentSize:y,contentRef:s})]})}const Ky=16,Jy=44,ex=16;function ZF(n,e,t){const r=n.find(x=>x.id===e);if(!r)return null;const i=n.filter(x=>x.parentId===e);if(i.length===0)return null;const s=t==="top"?Jy:ex,o=t==="bottom"?Jy:ex;let a=1/0,l=1/0,c=-1/0,d=-1/0;for(const x of i){const S=x.measured?.width??x.width??0,v=x.measured?.height??x.height??0;a=Math.min(a,x.position.x),l=Math.min(l,x.position.y),c=Math.max(c,x.position.x+S),d=Math.max(d,x.position.y+v)}const h=Ky-a,f=s-l,p=c-a+Ky*2,m=d-l+s+o,O=r.width??r.measured?.width??r.style?.width??0,b=r.height??r.measured?.height??r.style?.height??0;if(Math.abs(h)<.5&&Math.abs(f)<.5&&Math.abs(p-O)<.5&&Math.abs(m-b)<.5)return null;const k=new Set(i.map(x=>x.id));return n.map(x=>x.id===e?{...x,position:{x:x.position.x-h,y:x.position.y-f},width:p,height:m,style:{...x.style,width:p,height:m}}:k.has(x.id)?{...x,position:{x:x.position.x+h,y:x.position.y+f}}:x)}function D$(n,e,t){const{getNodes:r,setNodes:i}=On(),s=sm(o=>{let a="";return o.nodeLookup.forEach(l=>{if(l.parentId!==n)return;const c=l.measured?.width??l.width??0,d=l.measured?.height??l.height??0;a+=`${l.id},${l.position.x},${l.position.y},${c},${d};`}),a});$.useEffect(()=>{if(!e)return;const o=r();if(o.filter(c=>c.parentId===n).some(c=>c.measured?.width===void 0))return;const l=ZF(o,n,t);i((l??o).map(c=>c.id===n?{...c,data:{...c.data,autoLayout:void 0}}:c))},[e,s,n,t,r,i])}const WF=4,zF=2,cf=13,dc=6.5,tx=7.8,Jp=2.4,uf=Jp/2+.5;function VF({levels:n,color:e}){const t=Math.min(Math.max(n+1,zF),WF),r=cf*2+uf*2,i=dc*2+tx*(t-1)+uf*2,s=r/2;return g.jsx("svg",{viewBox:`0 0 ${r} ${i}`,style:{width:"1.3em",height:"auto",color:e},fill:"none","aria-hidden":!0,children:Array.from({length:t},(o,a)=>{const l=uf+dc+tx*a,c=`${s-cf},${l}`,d=`${s+cf},${l}`,h=`${s},${l+dc}`,f=`${s},${l-dc}`;return a===0?g.jsx("polygon",{points:`${f} ${d} ${h} ${c}`,fill:"currentColor",fillOpacity:.35,stroke:"currentColor",strokeWidth:Jp,strokeLinejoin:"round"},a):g.jsx("path",{d:`M ${c} L ${h} L ${d}`,stroke:"currentColor",strokeOpacity:.8,strokeWidth:Jp,strokeLinejoin:"round",strokeLinecap:"round"},a)})})}const FF=[{position:ge.Top,offset:"!-top-2"},{position:ge.Bottom,offset:"!-bottom-2"},{position:ge.Left,offset:"!-left-2"},{position:ge.Right,offset:"!-right-2"}];function j$(){const{isEdgeConnecting:n}=Fr();return FF.flatMap(({position:e,offset:t})=>["target","source"].map(r=>g.jsx(un,{id:`${r}-${e}`,type:r,position:e,className:F(t,n&&"connection-enabled"),style:{zIndex:10,pointerEvents:"auto"}},`${r}-${e}`)))}const qF={enterprise:"ENTERPRISE",system:"SYSTEM",container:"CONTAINER",generic:"BOUNDARY",node:"NODE"},YF="rgba(130, 141, 163, 0.06)",UF="#828DA3";function GF({id:n,data:e,selected:t}){const{updateNodeData:r,updateNode:i}=On(),{boundaryDepths:s}=Fr(),o=Mn(e.componentFields,{componentFieldId:"name"}),a=$.useRef(null),[l,c]=dr(o??"");function d(b){c(b),a.current&&clearTimeout(a.current),a.current=setTimeout(()=>{r(n,{componentFields:vi(e.componentFields??[],{name:b})})},1e3)}const h=e.autoLayout??!1,f=e.collapsed??!1;D$(n,h&&!f,"bottom");const p=e.borderColor??UF,m=e.boundaryType??qF[e.c4BoundaryKind]??"Boundary";function O(){return f?"solid":e.c4BoundaryKind==="generic"?"dotted":"dashed"}return g.jsxs("div",{className:"c4-boundary-box relative size-full rounded-[0.25rem]",style:{backgroundColor:e.backgroundColor??YF,border:`2px ${O()} ${p}`},children:[g.jsx(pr,{minWidth:200,minHeight:140,isVisible:t&&!h,onResize:(b,y)=>{i(n,{width:y.width,height:y.height})}}),g.jsx(j$,{}),g.jsxs("div",{className:F("c4-boundary-label absolute inset-x-0 bottom-0 flex flex-col items-start gap-0.5 px-3 pb-2",f&&"hidden"),children:[g.jsx(Fs,{value:l,placeholder:"Boundary",onKeyDown:b=>b.stopPropagation(),onMouseDown:b=>b.stopPropagation(),onDoubleClick:b=>b.stopPropagation(),onChange:b=>d(b.currentTarget.value),className:"w-full cursor-text resize-none bg-transparent text-left text-sm font-bold outline-none",style:{color:e.fontColor??p}}),g.jsxs("span",{className:"text-[0.625rem] leading-tight",style:{color:e.fontColor??p},children:["[",m,"]"]}),e.description&&g.jsx("span",{className:"max-w-full text-left text-[0.625rem] leading-tight whitespace-pre-line opacity-80",style:{color:e.fontColor??p},children:e.description})]}),g.jsxs("div",{className:F("c4-boundary-collapsed-label absolute inset-0 flex-col items-center justify-center gap-[0.3em] px-[5%] text-center",f?"flex":"hidden"),style:{color:e.fontColor??p,fontSize:f?"var(--lod-font-size)":void 0},children:[g.jsx("span",{className:"leading-tight font-bold wrap-anywhere",children:l||"Boundary"}),g.jsxs("span",{className:"flex items-center gap-[0.4em] text-[0.6em] leading-tight opacity-80",children:[g.jsx(VF,{levels:s.get(n)??1,color:e.fontColor??p}),"[",m,"]"]}),e.description&&g.jsx("span",{className:"line-clamp-2 text-[0.55em] leading-snug wrap-anywhere opacity-70",children:e.description})]})]})}function Yg({borderColor:n="transparent",borderWidth:e=0,borderRadius:t=0,borderStyle:r="solid",borderAnimationEnabled:i=!1,className:s,...o}){const a=$.useRef(null),[l,c]=$.useState(0),[d,h]=$.useState(0);$.useEffect(()=>{const b=a.current;if(!b)return;function y(){c(b.clientHeight),h(b.clientWidth)}const k=new ResizeObserver(y);return k.observe(b),y(),()=>{k.disconnect()}},[]);const f=e/2,p=Math.max(0,Math.min(t,d/2)-f),m=Math.max(0,Math.min(t,l/2)-f),O=r==="dashed"?`${e*2} ${e*2}`:r==="dotted"?`${e} ${e}`:void 0;return g.jsxs("svg",{...o,ref:a,viewBox:`0 0 ${d} ${l}`,className:F("pointer-events-none",s),children:[g.jsx("rect",{x:f,y:f,width:d-e,height:l-e,rx:p,ry:m,fill:"none",stroke:n,strokeWidth:e,strokeDasharray:O,style:{animation:i&&O?"stroke-fake-animation 8s linear infinite":void 0}}),g.jsx("style",{dangerouslySetInnerHTML:{__html:`
|
|
256
|
+
@keyframes stroke-fake-animation {
|
|
257
|
+
from { stroke-dashoffset: 0; }
|
|
258
|
+
to { stroke-dashoffset: 100%; }
|
|
259
|
+
}`}})]})}function HF({data:n,selected:e,width:t}){const r=Mn(n.componentFields,{componentFieldId:"name"});return g.jsxs(wi,{selected:e,className:"relative isolate size-full min-h-fit border border-[#2A3242] bg-[#141925]",style:{borderRadius:n?.borderRadius||8},children:[g.jsx(pr,{minWidth:125,minHeight:125,isVisible:e,keepAspectRatio:!0}),g.jsx(Yg,{className:"pointer-events-none absolute inset-0 size-full",borderColor:n?.stroke,borderStyle:n?.strokeStyle,borderWidth:n?.strokeWidth,borderRadius:n?.borderRadius,borderAnimationEnabled:n?.borderAnimationEnabled}),g.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-3 overflow-hidden p-4",style:{backgroundColor:n?.fill&&n.fill!=="transparent"?n.fill:"#1E2533",borderRadius:n?.borderRadius},children:[n.iconSrc&&g.jsx("div",{className:"flex min-h-0 w-full flex-1 items-center justify-center",children:g.jsx("img",{alt:r??"",src:n.iconSrc,className:"size-full object-contain",onError:i=>{const s=i.target;s.src="/placeholder.svg"}})}),r&&g.jsx("p",{className:"shrink-0 text-center text-sm leading-tight font-medium break-words text-[#F4F7FC]",style:{fontSize:Math.max(12,(t??0)/10)},children:r})]}),g.jsx(N$,{fields:n.componentFields})]})}const KF=String.raw;function JF({id:n,data:e,selected:t}){const{updateNodeData:r,updateNode:i}=On(),s=Mn(e.componentFields,{componentFieldId:"code"}),o=$.useRef(null),[a,l]=dr(s??"");function c(d){l(d),o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{r(n,{componentFields:vi(e.componentFields??[],{code:d})})},1e3)}return g.jsxs(wi,{className:"relative isolate w-full rounded-[0.5rem] bg-transparent leading-0 outline-transparent",selected:t,onWheel:d=>{d.stopPropagation(),d.nativeEvent.stopImmediatePropagation()},children:[g.jsx(pr,{isVisible:t,handleClassName:"z-10",onResize:(d,h)=>{i(n,{width:h.width,height:h.height})}}),g.jsx(lg,{id:`code-mirror-${n}`,value:a,onChange:c,fontSize:e?.fontSize||14,lineHeight:e?.lineHeight||2,className:"overflow-hidden rounded-[0.5rem]",style:{fontSize:e?.fontSize||14,lineHeight:e?.lineHeight||2,borderRadius:e?.borderRadius||0}}),g.jsx("style",{dangerouslySetInnerHTML:{__html:KF`
|
|
260
|
+
#code-mirror-${n} .cm-editor {
|
|
261
|
+
padding: ${e.strokeWidth}px;
|
|
262
|
+
}
|
|
263
|
+
`}}),g.jsx(Yg,{className:"pointer-events-none absolute inset-0 size-full",borderColor:e?.stroke,borderWidth:e?.strokeWidth,borderStyle:e?.strokeStyle,borderRadius:e?.borderRadius,borderAnimationEnabled:e?.borderAnimationEnabled})]})}const[eq,tq]=im(({resourceId:n})=>{const e=sd()?.id,[t,r]=$.useState(null),{data:i,loading:s}=xa(J1,{fetchPolicy:"cache-first",variables:{orgId:e,resourceId:n},skip:!e}),o=[{query:J1,variables:{orgId:e,resourceId:n}}],[a]=Ho(AX,{awaitRefetchQueries:!0,refetchQueries:o}),[l]=Ho(RX,{awaitRefetchQueries:!0,refetchQueries:o}),[c]=Ho(EX,{awaitRefetchQueries:!0,refetchQueries:o}),d=$.useMemo(()=>mi(i?.comments).map(m=>({commentId:m.id,resourceId:m.resourceId,parentCommentId:m.parentCommentId,text:m.text,createdBy:m.createdBy,createdAt:m.createdAt,authorName:m.createdByActor?.name,authorAvatarUrl:m.createdByActor?.avatarUrl})).sort((m,O)=>new Date(m.createdAt).getTime()-new Date(O.createdAt).getTime()),[i]),h=$.useCallback(async m=>{e&&await a({variables:{orgId:e,input:{resourceId:n,text:m.text,...m.parentCommentId?{parentCommentId:m.parentCommentId}:{}}}})},[e,n,a]),f=$.useCallback(async(m,O)=>{e&&await l({variables:{orgId:e,id:m,input:{text:O}}})},[e,l]),p=$.useCallback(async m=>{e&&await c({variables:{orgId:e,id:m}})},[e,c]);return{resourceId:n,comments:d,isLoading:s&&!i?.comments,createComment:h,updateComment:f,deleteComment:p,replyToCommentId:t,setReplyToCommentId:r}});function nq({comment:n,allComments:e,editingCommentId:t,editText:r,user:i,updatingCommentId:s,deletingCommentId:o,onEdit:a,onSaveEdit:l,onCancelEdit:c,onDelete:d,onReply:h,onEditTextChange:f}){const p=t===n.commentId,m=i?.userId===n.createdBy,O=n.authorAvatarUrl??"",b=n.authorName||"User",k=e.find(Q=>Q.commentId&&Q.commentId===n.parentCommentId)?.authorName,x=!!n.commentId&&s===n.commentId,S=!!n.commentId&&o===n.commentId,[v,w]=$.useState(!1);return g.jsxs(zi.div,{className:F("space-y-2"),initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.2},children:[g.jsxs("div",{className:"flex items-start gap-2",children:[g.jsxs(xx,{className:"size-5 flex-shrink-0",children:[g.jsx(Sx,{src:O||""}),g.jsx(kx,{className:"text-[10px]",children:(b.charAt(0)||"U").toUpperCase()})]}),g.jsxs("div",{className:"min-w-0 flex-1 space-y-1.5",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("span",{className:"text-[13px] font-medium text-[#F4F7FC]",children:b}),g.jsx("span",{className:"text-[11px] text-[#828DA3]",children:n.createdAt?E$(n.createdAt):""})]}),p?g.jsxs("div",{className:"space-y-2",children:[g.jsx(A$,{forceFocus:!0,theme:"dark",value:r,setValue:f}),g.jsxs("div",{className:"flex gap-2",children:[g.jsx(Dt,{preset:"primary",className:"h-8 px-3 text-xs",onClick:l,disabled:x,children:x?g.jsx(om,{className:"size-4!"}):"Save"}),g.jsx(Dt,{preset:"outline",className:"h-8 px-3 text-xs",onClick:c,disabled:x,children:"Cancel"})]})]}):g.jsxs(g.Fragment,{children:[!!n.parentCommentId&&g.jsxs("div",{className:"text-[11px] text-[#828DA3]",children:["Replying to"," ",g.jsx("span",{className:"font-medium text-[#F4F7FC]",children:k||"a comment"})]}),g.jsx("div",{className:"text-sm leading-snug text-[#F4F7FC]",children:g.jsx(R$,{theme:"dark",value:n.text??""})}),g.jsxs("div",{className:"flex items-center gap-1 text-[#828DA3]",children:[g.jsxs(Dt,{preset:"ghost",className:"-ml-3 h-7 px-2! text-[11px] font-medium text-[#828DA3] hover:text-[#F4F7FC]",onClick:()=>{n.commentId&&h(n.commentId,b)},children:[g.jsx(mP,{className:"mr-1 size-3"}),"Reply"]}),m&&g.jsxs(nP,{children:[g.jsx(rP,{asChild:!0,children:g.jsx(Dt,{preset:"ghost",className:"h-7 px-2! text-[11px] font-medium text-[#828DA3] hover:text-[#F4F7FC]",children:g.jsx(hP,{className:"size-3"})})}),g.jsxs(iP,{align:"start",className:"min-w-40 rounded-lg border-[#2A3242] bg-[#141925] p-1 text-[#F4F7FC] shadow-xl",children:[g.jsxs(Jg,{onClick:()=>{n.commentId&&a(n.commentId,n.text??"")},className:"cursor-pointer gap-2 rounded-md px-2.5 py-2 text-sm text-[#F4F7FC] focus:bg-[#1E2533] focus:text-[#F4F7FC]",children:[g.jsx(yP,{className:"size-4"}),"Edit"]}),g.jsxs(Jg,{onClick:()=>{n.commentId&&w(!0)},className:"text-destructive focus:text-destructive cursor-pointer gap-2 rounded-md px-2.5 py-2 text-sm focus:bg-[#1E2533]",disabled:S,children:[g.jsx(kC,{className:"size-4"}),"Delete"]})]})]})]})]})]})]}),g.jsx(tP,{open:v,onOpenChange:Q=>w(Q),title:"Delete comment?",description:"This action cannot be undone.",onConfirm:async()=>{n.commentId&&await d(n.commentId)}})]})}function rq({comments:n,isResolved:e,user:t,replyText:r,replyToName:i,editingCommentId:s,editText:o,isCreating:a,updatingCommentId:l,deletingCommentId:c,onToggleResolved:d,onClose:h,onReplyTextChange:f,onReply:p,onCancelReply:m,onEdit:O,onSaveEdit:b,onCancelEdit:y,onDelete:k,onReplyToAuthor:x,onEditTextChange:S}){return g.jsxs(zi.div,{className:"absolute top-8 left-6 z-50 w-72 overflow-hidden rounded-lg border border-[#2A3242] bg-[#141925] shadow-lg",initial:{opacity:0,y:-20,scale:.9},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-20,scale:.9},transition:{type:"spring",stiffness:300,damping:30,duration:.1},children:[g.jsx("div",{className:"border-b border-[#2A3242] px-3 py-2.5",children:g.jsxs("div",{className:"flex items-center justify-between",children:[g.jsx("h3",{className:"text-sm font-semibold text-[#F4F7FC]",children:"Comment"}),g.jsxs("div",{className:"flex items-center gap-1",children:[g.jsxs(Dt,{preset:"ghost",onClick:d,title:e?"Reopen comment":"Mark as resolved","aria-label":e?"Reopen comment":"Mark as resolved",className:F("h-7 px-2 text-xs font-medium text-[#828DA3] hover:text-[#F4F7FC]",e&&"text-emerald-400 hover:text-emerald-300"),children:[g.jsx(oP,{className:"size-3"}),g.jsx("span",{className:"ml-1",children:e?"Resolved":"Resolve"})]}),g.jsx(Dt,{preset:"ghost",onClick:h,title:"Deselect comment","aria-label":"Deselect comment",className:"size-7 p-0 text-[#828DA3] hover:text-[#F4F7FC]",children:g.jsx(aP,{className:"size-3.5"})})]})]})}),g.jsx("div",{onWheelCapture:v=>v.stopPropagation(),className:"max-h-96 overflow-x-hidden overflow-y-auto",children:g.jsx("div",{className:"divide-y divide-[#2A3242]",children:n.length===0?g.jsx("div",{className:"py-8 text-center text-sm text-[#828DA3]",children:"No comments yet. Start the conversation!"}):n.map(v=>g.jsx("div",{className:"p-3",children:g.jsx(nq,{comment:v,allComments:n,editingCommentId:s,editText:o,user:t,updatingCommentId:l,deletingCommentId:c,onEdit:O,onSaveEdit:b,onCancelEdit:y,onDelete:k,onReply:x,onEditTextChange:S})},v.commentId??v.createdAt??v.text))})}),g.jsx("div",{className:"border-t border-[#2A3242] px-3 py-2.5",children:g.jsxs("div",{className:"space-y-2",children:[!!i&&g.jsxs("div",{className:"flex items-center justify-between gap-2 rounded-md border border-[#2A3242] bg-[#1E2533] px-2.5 py-2 text-xs text-[#828DA3]",children:[g.jsxs("div",{className:"min-w-0 flex-1 truncate",children:["Replying to"," ",g.jsx("span",{className:"font-medium text-[#F4F7FC]",children:i})]}),g.jsx(Dt,{preset:"outline",disabled:a,onClick:m,className:"h-7 px-2 text-xs",children:"Cancel"})]}),g.jsxs("div",{className:"relative flex min-w-0 flex-1 items-end gap-2",children:[g.jsx("div",{className:"flex-1",children:g.jsx(A$,{forceFocus:!0,theme:"dark",value:r,setValue:f,className:"break-all"})}),g.jsx(Dt,{onClick:p,disabled:!r.trim()||a,preset:"primary",className:"size-9! p-0",children:a?g.jsx(om,{className:"size-4"}):g.jsx(OP,{className:"size-4!"})})]})]})})]})}function iq({comments:n,totalComments:e,onMouseEnter:t,onMouseLeave:r}){return g.jsx(zi.div,{className:"absolute top-8 left-6 z-50 rounded-lg border border-[#2A3242] bg-[#141925] p-3 shadow-lg",onMouseEnter:t,onMouseLeave:r,initial:{opacity:0,y:-10,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-10,scale:.95},transition:{type:"spring",stiffness:400,damping:25,duration:.1},children:n.length>0?g.jsx(sq,{comments:n,totalComments:e}):g.jsx("div",{className:"w-max text-xs text-[#828DA3]",children:"No comments yet"})})}function sq({comments:n,totalComments:e}){const t=n[0]?.authorAvatarUrl??"",r=n[0]?.authorName||"Anonymous";return g.jsxs("div",{className:"w-64 space-y-2",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsxs(xx,{className:"size-5",children:[g.jsx(Sx,{src:t||""}),g.jsx(kx,{className:"text-xs",children:(r.charAt(0)||"A").toUpperCase()})]}),g.jsx("span",{className:"text-xs font-medium text-[#F4F7FC]",children:r}),g.jsx("span",{className:"text-xs text-[#828DA3]",children:n[0]?.createdAt?E$(n[0].createdAt):""})]}),g.jsx("div",{className:"line-clamp-2 text-xs text-[#F4F7FC]",children:g.jsx(R$,{theme:"dark",value:n[0]?.text||"No comments yet"})}),e>1&&g.jsxs("div",{className:"text-xs text-[#828DA3]",children:["+",e-1," more"]})]})}function oq({...n}){return g.jsx(eq,{resourceId:n.id,children:g.jsx(aq,{...n})})}function aq({...n}){const{id:e,data:t,selected:r,dragging:i}=n,{updateNodeData:s,setNodes:o}=On(),a=wC(Se=>Se.user),l=a?{userId:a.userId,name:a.name,pic:a.avatarUrl??void 0}:null,c=sd()?.id,{comments:d,createComment:h,updateComment:f,deleteComment:p}=tq(),[m,O]=$.useState(t?.isResolved||!1),[b,y]=$.useState(r),[k,x]=$.useState(!1),[S,v]=$.useState(""),[w,Q]=$.useState(null),[P,T]=$.useState(null),[C,R]=$.useState(null),[M,j]=$.useState(""),[N,I]=$.useState(!1),[L,te]=$.useState(null),[le,_]=$.useState(null);function re(Se){s(e,Se)}async function ie(Se){const Ne=Se.trim();!Ne||!l?.userId||!c||(await h({text:Ne,parentCommentId:P??void 0}),v(""))}async function pe(Se,Ne){const dt=Ne.trim();dt&&(await f(Se,dt),R(null),j(""))}async function Oe(Se){await p(Se)}function U(){const Se=!m;O(Se),re({isResolved:Se})}async function de(){if(!(!S.trim()||N)){I(!0);try{await ie(S)}finally{I(!1),Q(null),T(null)}}}function Ye(Se,Ne){Q(Ne),T(Se),v(`@${Ne} `)}function ut(){Q(null),T(null),v("")}function bn(Se,Ne){R(Se),j(Ne)}async function gt(){if(!(!C||!M.trim()||L)){te(C);try{await pe(C,M)}finally{te(null)}}}function En(){R(null),j("")}function yr(Se){j(Se)}async function Nn(Se){if(!le){_(Se);try{await Oe(Se)}finally{_(null)}}}return $.useEffect(()=>{y(r)},[r]),g.jsxs("div",{className:"pointer-events-auto relative isolate",style:{transform:"scale(var(--react-flow-counter-scale))"},children:[g.jsx(zi.div,{className:F("flex size-8 cursor-pointer items-center justify-center rounded-full",m?"border-2 border-green-500 bg-green-100":"border-2 border-blue-500 bg-blue-100"),onClick:()=>y(!b),onMouseEnter:()=>x(!0),onMouseLeave:()=>x(!1),whileHover:{scale:1.1},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:g.jsx(zi.div,{className:F("size-2.5 rounded-full",m?"bg-green-600":"bg-blue-600"),animate:{scale:r?1.2:1},transition:{type:"spring",stiffness:400,damping:17}})}),g.jsx(gc,{children:d.length>0&&g.jsx(zi.div,{className:"pointer-events-none absolute -top-1 -right-1 flex size-5 items-center justify-center rounded-full bg-red-500 text-xs text-white",initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},transition:{type:"spring",stiffness:400,damping:17},children:d.length})}),g.jsx(gc,{children:k&&!r&&!i&&g.jsx(iq,{comments:d,totalComments:d.length,onMouseEnter:()=>x(!0),onMouseLeave:()=>x(!1)})}),g.jsx(gc,{children:r&&!i&&g.jsx(rq,{comments:d,isResolved:m,user:l,replyText:S,replyToName:w,editingCommentId:C,editText:M,isCreating:N,updatingCommentId:L,deletingCommentId:le,onToggleResolved:U,onClose:()=>{y(!1),o(Se=>Se.map(Ne=>Ne.id===e?{...Ne,selected:!1}:Ne))},onReplyTextChange:v,onReply:de,onCancelReply:ut,onEdit:bn,onSaveEdit:gt,onCancelEdit:En,onDelete:Nn,onReplyToAuthor:Ye,onEditTextChange:yr})})]})}function lq({data:n}){function e(t){const r=t.toLowerCase();return/(char|text|varchar|string)/.test(r)?"bg-violet-50 text-violet-700 border-violet-200":/(int|serial|decimal|numeric|float|double|real|number)/.test(r)?"bg-blue-50 text-blue-700 border-blue-200":/(bool)/.test(r)?"bg-emerald-50 text-emerald-700 border-emerald-200":/(date|time|timestamp)/.test(r)?"bg-amber-50 text-amber-700 border-amber-200":/(uuid)/.test(r)?"bg-accent/40 text-secondary-foreground border-stock":/(json|jsonb)/.test(r)?"bg-teal-50 text-teal-700 border-teal-200":"bg-accent/30 text-secondary-foreground border-stock"}return g.jsxs(g.Fragment,{children:[g.jsx("div",{children:g.jsxs($x,{children:[g.jsx(Cx,{children:g.jsxs(Ko,{children:[g.jsx(Cr,{className:"text-paragraph w-[40%] px-3 py-2 text-xs",children:"Column"}),g.jsx(Cr,{className:"text-paragraph w-[15%] px-3 py-2 text-xs",children:"Type"}),g.jsx(Cr,{className:"text-paragraph w-[10%] px-3 py-2 text-xs",children:"Null"}),g.jsx(Cr,{className:"text-paragraph w-[20%] px-3 py-2 text-xs",children:"Default"}),g.jsx(Cr,{className:"text-paragraph w-[7.5%] px-3 py-2 text-xs",children:"Key"}),g.jsx(Cr,{className:"text-paragraph w-[7.5%] px-3 py-2 text-xs",children:"FK to"})]})}),g.jsx(Px,{children:n.table.columns.map(t=>{const r=n.table.primaryKeys.includes(t.name),i=n.table.foreignKeys.find(s=>s.columnName===t.name);return g.jsxs(Ko,{className:"odd:bg-accent/30/30 hover:bg-accent/30",children:[g.jsx(rr,{className:"px-3 py-2",children:g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("span",{className:"font-medium",children:t.name}),t.description?g.jsx("span",{className:"text-paragraph text-[11px]",children:t.description}):null]})}),g.jsx(rr,{className:"text-secondary-foreground px-3 py-2",children:g.jsx(Ur,{variant:"outline",className:`border px-2 py-0.5 text-xs font-medium ${e(t.type)}`,children:t.type})}),g.jsx(rr,{className:"px-3 py-2",children:t.nullable?g.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-emerald-200 bg-emerald-50 px-2 py-0.5 text-xs text-emerald-700",children:[g.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500"}),"YES"]}):g.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-rose-200 bg-rose-50 px-2 py-0.5 text-xs text-rose-700",children:[g.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-rose-500"}),"NO"]})}),g.jsx(rr,{className:"text-foreground px-3 py-2",children:t.defaultValue?g.jsx("code",{className:"bg-accent/40 text-secondary-foreground rounded px-2 py-0.5 text-xs",children:t.defaultValue}):g.jsx("span",{className:"text-muted-foreground",children:"-"})}),g.jsx(rr,{className:"px-3 py-2",children:g.jsx("div",{className:"flex flex-wrap gap-1.5",children:r?g.jsx(Ur,{variant:"secondary",className:"border border-sky-200 bg-sky-50 px-1.5 py-0 text-[11px] text-sky-700",children:"PK"}):null})}),g.jsx(rr,{className:"px-3 py-2",children:i?g.jsxs(Ur,{variant:"outline",className:"border border-teal-200 bg-teal-50 px-2 py-0.5 text-xs text-teal-700",children:[i.referencedTable,".",i.referencedColumn]}):g.jsx("span",{className:"text-muted-foreground",children:"-"})})]},t.name)})})]})}),g.jsxs("div",{className:"border-stock grid grid-cols-1 gap-2 border-t px-3 py-2",children:[n.table.primaryKeys.length>0?g.jsxs("div",{children:[g.jsx("div",{className:"text-paragraph mb-1 text-xs",children:"Primary keys"}),g.jsx("div",{className:"flex flex-wrap gap-1.5",children:n.table.primaryKeys.map(t=>g.jsx(Ur,{variant:"secondary",className:"rounded-full border border-sky-200 bg-sky-50 px-2 py-0.5 text-xs text-sky-700",children:t},t))})]}):null,n.table.foreignKeys.length>0?g.jsxs("div",{children:[g.jsx("div",{className:"text-paragraph mb-1 text-xs",children:"Foreign keys"}),g.jsx("div",{className:"grid gap-1",children:n.table.foreignKeys.map(t=>g.jsxs("div",{className:"text-foreground text-sm",children:[g.jsx(Ur,{variant:"outline",className:"mr-1 border border-teal-200 bg-teal-50 px-1.5 py-0 text-[11px] text-teal-700",children:t.columnName}),g.jsx("span",{className:"text-muted-foreground mx-1",children:"→"}),g.jsxs(Ur,{variant:"outline",className:"border border-teal-200 bg-teal-50 px-1.5 py-0 text-[11px] text-teal-700",children:[t.referencedTable,".",t.referencedColumn]})]},`${t.columnName}->${t.referencedTable}.${t.referencedColumn}`))})]}):null,n.table.indexes.length>0?g.jsxs("div",{children:[g.jsx("div",{className:"text-paragraph mb-1 text-xs",children:"Indexes"}),g.jsx("div",{className:"grid gap-1",children:n.table.indexes.map(t=>g.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-sm",children:[g.jsx("span",{className:"font-medium",children:t.name}),t.unique?g.jsx(Ur,{variant:"secondary",className:"border border-amber-200 bg-amber-100 px-1.5 py-0 text-[11px] text-amber-700",children:"UNIQUE"}):null,g.jsx("div",{className:"flex flex-wrap gap-1",children:t.columns.map(r=>g.jsx("code",{className:"bg-accent/40 text-secondary-foreground rounded px-1.5 py-0.5 text-xs",children:r},r))})]},t.name))})]}):null]})]})}function cq({data:n}){return g.jsxs("div",{className:"outline-stock [.selected_&]:outline-primary rounded-[0.5rem] bg-[#141925] outline [.selected_&]:shadow-[0_24px_40px_0_rgba(0,0,0,0.2)]",children:[g.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-[#2A3242] px-3 py-2",children:[g.jsx("div",{className:"font-semibold text-[#F4F7FC]",children:n.table.name}),g.jsxs("div",{className:"rounded-full bg-[#1E2533] px-2 py-0.5 text-xs text-[#828DA3]",children:[n.table.columns.length," cols"]})]}),g.jsx(lq,{data:n})]})}function uq(n,e){const t=$.useRef(null),{dataTablesMap:r,setDataSources:i}=Fr(),s=rl({databaseName:n,tableName:e,setDataSources:i}),o=$.useMemo(()=>r.get(`${n}@${e}`),[r,n,e]),a=$.useCallback((c,d=250)=>{function h(){const{databaseName:f,tableName:p,setDataSources:m}=s.current;m(O=>O.map(b=>b.name===f?{...b,schemaAst:{...b.schemaAst,tables:b.schemaAst.tables.map(y=>y.name===p?{...y,...c}:y)}}:b))}t.current&&clearTimeout(t.current),d>0?t.current=setTimeout(h,d):h()},[s,t]),l=$.useCallback(c=>{s.current.setDataSources(d=>d.map(h=>h.name===n?{...h,...c}:h))},[s,n]);return{table:o?.table??null,dataSource:o?.source??null,mongoCollectionSource:o?.mongoCollectionSource??null,setTable:a,setDataSource:l}}function dq(n,e){const t=sd().id,r=xa(lP,{fetchPolicy:"cache-first",skip:!t||!n,variables:{orgId:t}}),i=$.useMemo(()=>mi(r.data?.services.items).find(a=>a.name===n)?.id??null,[r.data,n]),s=xa(TC,{fetchPolicy:"cache-first",skip:!t||!i,variables:{orgId:t,serviceId:i}});return{serviceDb:$.useMemo(()=>mi(s.data?.serviceDBs).map(MC).find(a=>a.dbName===e)??null,[s.data,e]),loading:r.loading||s.loading}}function I$({dataSource:n,mongoCollectionSource:e}){const t=JSON.stringify(n.dialect==="dynamodb"?n.sourceContent??"{}":e??"{}",null,2);return g.jsxs("div",{className:"skip-wheel relative",children:[g.jsx(lg,{readOnly:!0,basicSetup:{lineNumbers:!1,foldGutter:!1,foldKeymap:!1,searchKeymap:!1},value:t,editable:!1,maxHeight:"40rem"}),g.jsxs(Dt,{preset:"outline",className:"absolute top-3 right-3 h-9 px-3!",onClick:async()=>{await navigator.clipboard.writeText(t),od.success("JSON copied")},children:[g.jsx(iC,{className:"size-5"}),"Copy"]})]})}function X$({dataSource:n,isForcedOpen:e,mongoCollectionSource:t}){function r(x){return typeof x=="object"&&x!==null&&!Array.isArray(x)}function i(x){return typeof x=="string"?x:null}function s(x){return typeof x=="boolean"?x:null}function o(x){return Array.isArray(x)?x:null}function a(x){return r(x)?x:null}function l(x,S){const v=[];for(let w=0;w<x.length;w++){const Q=x[w],P=a(Q);if(!P)continue;const T=i(P.name),C=i(P.type);if(!T||!C||s(P.required)===null)continue;const R=C==="object"?o(P.fields):null,M=C==="array"?i(P.itemType):null,j=C==="array"&&M==="object"?o(P.itemFields):null,N=C==="object"?R:C==="array"&&M==="object"?j:null;v.push({id:`${S}/${T}`,name:T,type:C==="array"?M?M==="object"?"object[]":`${M}[]`:"array":C,children:N})}return v}const c=n.dialect==="dynamodb"?{sourceRec:a(n.sourceContent)}:null,d=c?.sourceRec?{primaryKey:a(c.sourceRec.primaryKey),globalSecondaryIndexes:o(c.sourceRec.globalSecondaryIndexes)??[]}:null,h=n.dialect==="mongodb"&&t?o(a(t)?.fields):null,f=c?.sourceRec?o(c.sourceRec.attributes):null,p=h?l(h,"collection"):[],m=f?l(f,"dynamodb"):[],[O,b]=$.useState(()=>{const x=d?m:p;return new Set(x.filter(S=>(S.children?.length??0)>0).map(S=>S.id))});function y(x){b(S=>{const v=new Set(S);return v.has(x)?v.delete(x):v.add(x),v})}function k(x,S){return x.map(v=>{const w=v.children?l(v.children,v.id):[],Q=w.length>0,P=e||Q&&O.has(v.id),T=S*12;return g.jsx("div",{children:Q?g.jsxs(g.Fragment,{children:[g.jsx("button",{type:"button",onClick:()=>y(v.id),className:"border-stock hover:bg-accent/30 block w-full border-b px-4 py-2 text-left transition-colors",children:g.jsxs("div",{className:"flex items-center justify-between gap-2",children:[g.jsx("div",{className:"flex min-w-0 flex-1 items-center gap-2",style:{paddingLeft:T},children:g.jsx("span",{className:"text-foreground truncate font-mono text-sm font-medium",children:v.name})}),g.jsxs("div",{className:"flex flex-shrink-0 items-center gap-2",children:[g.jsx("span",{className:"text-paragraph font-mono text-xs",children:v.type}),g.jsx(sP,{className:F("text-muted-foreground h-3.5 w-3.5 transition-transform",P&&"rotate-90")})]})]})}),P?k(w,S+1):null]}):g.jsx("div",{className:"border-stock hover:bg-accent/30 border-b px-4 py-2 transition-colors",children:g.jsxs("div",{className:"flex items-center justify-between gap-2",children:[g.jsx("div",{className:"flex min-w-0 flex-1 items-center gap-2",style:{paddingLeft:T},children:g.jsx("span",{className:"text-foreground truncate font-mono text-sm font-medium",children:v.name})}),g.jsx("span",{className:"text-paragraph flex-shrink-0 font-mono text-xs",children:v.type})]})})},v.id)})}if(d){const x=d.primaryKey?i(d.primaryKey.partitionKey):null,S=d.primaryKey?i(d.primaryKey.partitionKeyType):null,v=d.primaryKey?i(d.primaryKey.sortKey):null,w=d.primaryKey?i(d.primaryKey.sortKeyType):null,Q=d.globalSecondaryIndexes;return g.jsxs("div",{children:[g.jsx("div",{className:"border-stock bg-accent/30 text-secondary-foreground border-b px-4 py-2 text-xs font-semibold",children:"Keys"}),g.jsx("div",{className:"border-stock hover:bg-accent/30 border-b px-4 py-2 transition-colors",children:g.jsxs("div",{className:"flex items-center justify-between gap-2",children:[g.jsx("span",{className:"text-foreground truncate font-mono text-sm font-medium",children:"PK"}),g.jsx("span",{className:"text-paragraph flex-shrink-0 font-mono text-xs",children:x?`${x}${S?` (${S})`:""}`:"—"})]})}),g.jsx("div",{className:"border-stock hover:bg-accent/30 border-b px-4 py-2 transition-colors",children:g.jsxs("div",{className:"flex items-center justify-between gap-2",children:[g.jsx("span",{className:"text-foreground truncate font-mono text-sm font-medium",children:"SK"}),g.jsx("span",{className:"text-paragraph flex-shrink-0 font-mono text-xs",children:v?`${v}${w?` (${w})`:""}`:"—"})]})}),g.jsxs("div",{className:"border-stock bg-accent/30 text-secondary-foreground border-b px-4 py-2 text-xs font-semibold",children:["GSIs (",Q.length,")"]}),Q.length>0?Q.map((P,T)=>{const C=a(P),R=C?i(C.name):null,M=C?i(C.partitionKey):null,j=C?i(C.partitionKeyType):null,N=C?i(C.sortKey):null,I=C?i(C.sortKeyType):null,L=[M?`${M}${j?` (${j})`:""}`:null,N?`${N}${I?` (${I})`:""}`:null].filter(te=>te!==null).join(" / ");return g.jsx("div",{className:"border-stock hover:bg-accent/30 border-b px-4 py-2 transition-colors",children:g.jsxs("div",{className:"flex items-center justify-between gap-2",children:[g.jsx("span",{title:R??`gsi_${T+1}`,className:"text-foreground max-w-[16ch] shrink-0 truncate font-mono text-sm font-medium",children:R??`gsi_${T+1}`}),g.jsx("span",{title:L,className:"text-paragraph flex-1 flex-shrink-0 truncate font-mono text-xs",children:L||"—"})]})},`${R??"gsi"}-${T}`)}):g.jsx("div",{className:"border-stock text-paragraph border-b px-4 py-2 text-sm",children:"No GSIs"}),g.jsx("div",{className:"border-stock bg-accent/30 text-secondary-foreground border-b px-4 py-2 text-xs font-semibold",children:"Attributes"}),m.length>0?k(m,0):g.jsx("div",{className:"border-stock text-paragraph border-b px-4 py-2 text-sm",children:"No attributes"})]})}return h?g.jsx("div",{children:p.length>0?k(p,0):g.jsx("div",{className:"border-stock text-paragraph border-b px-4 py-2 text-sm",children:"No fields"})}):g.jsx("div",{className:"h-[200px]",children:g.jsx("div",{className:"border-stock text-paragraph border-b px-4 py-2 text-sm",children:"Unsupported schema"})})}function hq(n){return mr({attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{d:"M9.80307 3.0431C10.0554 3.15525 10.1691 3.45073 10.0569 3.70307L6.05691 12.7031C5.94475 12.9554 5.64927 13.0691 5.39693 12.9569C5.14459 12.8448 5.03094 12.5493 5.14309 12.2969L9.14309 3.29693C9.25525 3.04459 9.55073 2.93094 9.80307 3.0431ZM4.33218 5.3763C4.53857 5.55976 4.55716 5.87579 4.3737 6.08218L2.66898 8L4.3737 9.91782C4.55716 10.1242 4.53857 10.4402 4.33218 10.6237C4.12579 10.8072 3.80975 10.7886 3.6263 10.5822L1.6263 8.33218C1.4579 8.14274 1.4579 7.85726 1.6263 7.66782L3.6263 5.41782C3.80975 5.21143 4.12579 5.19284 4.33218 5.3763ZM11.6678 5.3763C11.8742 5.19284 12.1902 5.21143 12.3737 5.41782L14.3737 7.66782C14.5421 7.85726 14.5421 8.14274 14.3737 8.33218L12.3737 10.5822C12.1902 10.7886 11.8742 10.8072 11.6678 10.6237C11.4614 10.4402 11.4428 10.1242 11.6263 9.91782L13.331 8L11.6263 6.08218C11.4428 5.87579 11.4614 5.55976 11.6678 5.3763Z"},child:[]}]})(n)}function Ug({selected:n,tableName:e,baseColor:t,children:r,hasCodeMode:i,codeModeEnabled:s,onCodeModeEnable:o}){return g.jsx(il,{selected:n,children:g.jsxs("div",{className:F("border-stock bg-card relative min-w-[360px] overflow-hidden rounded-lg border-2 shadow-lg transition-[border-color]",n&&"border-primary"),children:[g.jsxs("div",{className:"bg-primary flex items-center justify-between gap-2 px-4 py-3",style:{backgroundColor:t},children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(yx,{className:"h-5 w-5 text-white"}),g.jsx("h3",{className:"truncate text-base font-semibold text-white",children:e})]}),i&&g.jsx(Dt,{onClick:()=>o?.(),preset:s?"outline":"primary",className:F("size-9 border-none!",!s&&"hover:bg-background/15"),children:g.jsx(hq,{className:"h-5 w-5"})})]}),g.jsx("div",{className:"bg-card",children:r})]})})}function L$({selected:n,tableName:e,style:t,indexes:r,foreignKeys:i,primaryKeys:s,columns:o,...a}){return g.jsxs(Ug,{selected:n,tableName:e,baseColor:t?.baseColor,...a,children:[g.jsx("div",{className:"max-h-[400px] overflow-y-auto",children:o.map((l,c)=>{const d=s.includes(l.name),h=i.some(f=>f.columnName===l.name);return g.jsxs("div",{className:`border-stock hover:bg-accent border-b px-4 py-2 transition-colors ${c===o.length-1?"border-b-0":""}`,children:[g.jsxs("div",{className:"flex items-center justify-between gap-2",children:[g.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[d&&g.jsx(tO,{className:"h-3.5 w-3.5 flex-shrink-0 text-amber-500"}),h&&!d&&g.jsx(tO,{className:"h-3.5 w-3.5 flex-shrink-0 text-blue-500"}),g.jsx("span",{className:"text-foreground truncate font-mono text-sm font-medium",children:l.name})]}),g.jsx("div",{className:"flex flex-shrink-0 items-center gap-1",children:g.jsx("span",{className:"text-paragraph font-mono text-xs",children:l.type})})]}),h&&g.jsx("div",{className:"mt-1 ml-6",children:i.filter(f=>f.columnName===l.name).map((f,p)=>g.jsxs("div",{className:"flex items-center gap-1 text-xs text-blue-400",children:[g.jsx("span",{children:"→"}),g.jsxs("span",{className:"font-mono",children:[f.referencedTable,".",f.referencedColumn]})]},p))})]},l.name)})}),r&&r.length>0&&g.jsxs("div",{className:"border-stock bg-shading-gray border-t px-4 py-2",children:[g.jsxs("div",{className:"text-foreground mb-1 text-xs font-semibold",children:["Indexes (",r.length,")"]}),g.jsxs("div",{className:"space-y-1",children:[r.slice(0,3).map((l,c)=>g.jsxs("div",{className:"text-paragraph flex items-center gap-1 text-xs",children:[l.unique&&g.jsx(Ur,{variant:"outline",className:"h-4 px-1 py-0 text-[9px]",children:"UNIQUE"}),g.jsx("span",{className:"truncate font-mono",children:l.name})]},c)),r.length>3&&g.jsxs("div",{className:"text-paragraph text-xs",children:["+",r.length-3," more"]})]})]})]})}function _$({selected:n,tableName:e,isLoading:t,style:r}){return g.jsx(il,{selected:n,children:g.jsxs("div",{className:F("border-stock bg-card relative max-w-[350px] min-w-[280px] overflow-hidden rounded-lg border-2 shadow-lg transition-[border-color]",n&&"border-primary"),children:[g.jsxs("div",{className:"bg-primary flex items-center gap-2 px-4 py-3",style:{backgroundColor:r?.baseColor},children:[g.jsx(yx,{className:"h-5 w-5 text-white"}),g.jsx("h3",{className:"truncate text-base font-semibold text-white",children:e})]}),g.jsx("div",{className:"flex h-15 items-center justify-center gap-2",children:t?g.jsxs(g.Fragment,{children:[g.jsx(om,{}),"Loading table..."]}):g.jsx("p",{className:"text-paragraph text-sm",children:"Table not found"})})]})})}function fq(n){return n.data.localTable?g.jsx(pq,{...n}):n.data.serviceTable?g.jsx(mq,{...n}):null}function pq({data:n,selected:e}){const[t,r]=$.useState(!1),{table:i,dataSource:s,mongoCollectionSource:o}=uq(n.localTable.databaseName,n.localTable.tableName);if(s?.dialect==="mongodb"||s?.dialect==="dynamodb"||s?.dialect==="json")return g.jsxs(g.Fragment,{children:[e&&t&&g.jsxs(g.Fragment,{children:[g.jsx(Qn,{resizeDirection:"horizontal",position:"top-left",minWidth:400}),g.jsx(Qn,{resizeDirection:"horizontal",position:"top-right",minWidth:400}),g.jsx(Qn,{resizeDirection:"horizontal",position:"bottom-left",minWidth:400}),g.jsx(Qn,{resizeDirection:"horizontal",position:"bottom-right",minWidth:400})]}),g.jsx(Ug,{hasCodeMode:!0,codeModeEnabled:t,onCodeModeEnable:()=>r(f=>!f),selected:e,baseColor:n.style?.baseColor,tableName:i?.name||"Unknown Table",children:t?g.jsx(I$,{table:i,dataSource:s,mongoCollectionSource:o}):g.jsx(X$,{table:i,dataSource:s,isForcedOpen:n.isForcedOpen??!1,mongoCollectionSource:o})})]});if(!i)return g.jsx(_$,{selected:e,tableName:n.localTable?.tableName??"Unknown Table",isLoading:!1,style:n.style});const l=i.constraints.find(f=>f.type==="primary_key")?.columns||i.columns.filter(f=>f.autoIncrement).map(f=>f.name),d=i.constraints.filter(f=>f.type==="foreign_key").flatMap(f=>f.columns.map((p,m)=>({columnName:p,referencedTable:f.referencedTable,referencedColumn:f.referencedColumns[m]??f.referencedColumns[0]}))),h=i.columns.map(f=>({name:f.name,type:f.dataType.name,isPrimaryKey:l.includes(f.name),isForeignKey:d.some(p=>p.columnName===f.name),nullable:f.nullable}));return g.jsx(L$,{indexes:i.indexes.map(f=>({name:f.name,columns:f.columns.map(p=>p.name),unique:f.unique})),selected:e,tableName:i.name,style:n.style,columns:h,primaryKeys:l,foreignKeys:d})}function mq({data:n,selected:e}){const{serviceName:t,databaseName:r,tableName:i}=n.serviceTable,{serviceDb:s,loading:o}=dq(t,r),[a,l]=$.useState(!1),c=$.useMemo(()=>{if(!s?.noSQLSchema)return null;try{const f=typeof s.noSQLSchema=="string"?JSON.parse(s.noSQLSchema):s.noSQLSchema;return s.dialect==="dynamodb"?f?.dynamo?.table??null:s.dialect==="mongodb"?f?.mongo?.collections??null:null}catch{return null}},[s?.noSQLSchema,s?.dialect]),d=$.useMemo(()=>s?.dialect!=="mongodb"||!c?null:(Array.isArray(c?.collections)?c.collections:Array.isArray(c)?c:null)?.find(p=>p.name===i)??null,[s?.dialect,c,i]),h=$.useMemo(()=>{if(!s?.tables?.length)return null;const f=s.tables.find(p=>p?.name===i);return f?{name:f.name??"",columns:mi(f.columns).map(p=>({name:p?.name??"",type:p?.type??"",isPrimaryKey:p?.isPrimaryKey??!1,isForeignKey:!1,nullable:p?.nullable??!1}))}:null},[s,i]);if(o||!c&&!h)return g.jsx(_$,{selected:e,tableName:i,isLoading:o,style:n.style});if(c){const f={id:s?.serviceDBId??"",name:i,sourceType:"manual",sourceContent:c,dialect:s.dialect,schemaAst:{tables:[],dialect:s.dialect},createdAt:0,modifiedAt:null};return g.jsxs(g.Fragment,{children:[e&&a&&g.jsxs(g.Fragment,{children:[g.jsx(Qn,{resizeDirection:"horizontal",position:"top-left",minWidth:400}),g.jsx(Qn,{resizeDirection:"horizontal",position:"top-right",minWidth:400}),g.jsx(Qn,{resizeDirection:"horizontal",position:"bottom-left",minWidth:400}),g.jsx(Qn,{resizeDirection:"horizontal",position:"bottom-right",minWidth:400})]}),g.jsx(Ug,{hasCodeMode:!0,codeModeEnabled:a,onCodeModeEnable:()=>l(p=>!p),selected:e,baseColor:n.style?.baseColor,tableName:i,children:a?g.jsx(I$,{table:null,dataSource:f,mongoCollectionSource:d}):g.jsx(X$,{table:null,dataSource:f,isForcedOpen:n.isForcedOpen??!1,mongoCollectionSource:d})})]})}return g.jsx(L$,{indexes:[],selected:e,tableName:n.serviceTable.tableName,style:n.style,columns:h?.columns??[],primaryKeys:[],foreignKeys:[]})}const nx="rgba(20, 25, 37, 0.35)",rx="#828DA3";function gq(n){const e=n.backgroundColor,t=n.borderColor;return e==="#FFFFFF"&&(!t||t==="#000000")?{backgroundColor:nx,borderColor:rx}:{backgroundColor:e||nx,borderColor:t||rx}}function Oq({id:n,data:e,selected:t}){const{updateNodeData:r}=On(),i=Mn(e.componentFields,{componentFieldId:"name"}),s=$.useRef(null),[o,a]=dr(i??"");function l(f){a(f),s.current&&clearTimeout(s.current),s.current=setTimeout(()=>{r(n,{componentFields:vi(e.componentFields??[],{name:f})})},250)}const c=e.autoLayout??!1,d=e.collapsed??!1;D$(n,c&&!d,"top");const h=gq(e);return g.jsxs("div",{className:"size-full rounded-[0.5rem]",style:{backgroundColor:h.backgroundColor,border:`2px dashed ${h.borderColor}`},children:[g.jsx(pr,{isVisible:t&&!c,minWidth:200,minHeight:150,keepAspectRatio:!1}),g.jsx(j$,{}),d&&g.jsx("div",{className:"flex size-full items-center justify-center px-[5%] text-center font-medium wrap-anywhere text-[#F4F7FC]",style:{fontSize:"var(--lod-font-size)"},children:o||"Frame"}),g.jsx(Fs,{value:o,placeholder:"",hidden:d,onKeyDown:f=>f.stopPropagation(),onMouseDown:f=>f.stopPropagation(),className:"pointer-events-auto absolute top-2 left-2 h-auto w-auto resize-none overflow-hidden border-none bg-transparent text-sm font-medium break-words text-[#F4F7FC] outline-none placeholder:text-[#828DA3]",onChange:f=>l(f.currentTarget.value)})]})}function bq({data:n,selected:e}){return g.jsxs(wi,{selected:e,className:"size-full overflow-hidden outline-transparent",children:[g.jsx(pr,{minWidth:20,minHeight:20,isVisible:e}),g.jsx("img",{src:n.src,alt:"React Flow Static Node",className:"size-full rounded-[0.5rem]"})]})}function $e(n,e){const t={paintOrder:"stroke fill"};switch(n){case"dash":return{...t,animation:"stroke-fake-animation 8s linear infinite"};default:return t}}function yq({fill:n="transparent",stroke:e="#d2d9e6",strokeWidth:t=4,strokeOpacity:r=1,strokeStyle:i="solid",strokeAnimation:s="none",cornerRadius:o=12,height:a=140,width:l=200}){const c=(Number(t)||0)/2,d=i==="dashed"?"8,4":i==="dotted"?"2,2":void 0,h=$e(s);return g.jsx("svg",{viewBox:`0 0 ${l} ${a}`,preserveAspectRatio:"none",children:g.jsx("rect",{x:c,y:c,width:l-c*2,height:a-c*2,rx:o,fill:n,stroke:e,strokeWidth:t,strokeOpacity:r,strokeDasharray:d,style:h})})}function xq({fill:n="transparent",stroke:e="#d2d9e6",strokeWidth:t=4,strokeOpacity:r=1,strokeStyle:i="solid",strokeAnimation:s="none",cornerRadius:o=40,height:a=140,width:l=200}){const c=(Number(t)||0)/2,d=i==="dashed"?"8,4":i==="dotted"?"2,2":void 0,h=$e(s);return g.jsx("svg",{viewBox:`0 0 ${l} ${a}`,preserveAspectRatio:"none",children:g.jsx("rect",{x:c,y:c,width:l-c*2,height:a-c*2,rx:o,fill:n,stroke:e,strokeWidth:t,strokeOpacity:r,strokeDasharray:d,style:h})})}function Sq({fill:n="transparent",stroke:e="#d2d9e6",strokeWidth:t=4,strokeOpacity:r=1,strokeStyle:i="solid",strokeAnimation:s="none",height:o=180,width:a=180}){const l=(Number(t)||0)/2,c=a/2,d=o/2,h=a/2-l,f=o/2-l,p=i==="dashed"?"8,4":i==="dotted"?"2,2":void 0,m=$e(s);return g.jsx("svg",{viewBox:`0 0 ${a} ${o}`,preserveAspectRatio:"none",children:g.jsx("ellipse",{cx:c,cy:d,rx:h,ry:f,fill:n,stroke:e,strokeWidth:t,strokeOpacity:r,strokeDasharray:p,style:m})})}function kq({fill:n="transparent",stroke:e="#d2d9e6",strokeWidth:t=4,strokeOpacity:r=1,strokeStyle:i="solid",strokeAnimation:s="none",height:o=200,width:a=200}){const l=(Number(t)||0)/2,c=a/2,d=o/2,h=`${c} ${l}, ${a-l} ${d}, ${c} ${o-l}, ${l} ${d}`,f=i==="dashed"?"8,4":i==="dotted"?"2,2":void 0,p=$e(s);return g.jsx("svg",{viewBox:`0 0 ${a} ${o}`,preserveAspectRatio:"none",children:g.jsx("polygon",{points:h,fill:n,stroke:e,strokeWidth:t,strokeOpacity:r,strokeDasharray:f,style:p})})}function vq({fill:n="transparent",stroke:e="#d2d9e6",strokeWidth:t=4,strokeOpacity:r=1,strokeStyle:i="solid",strokeAnimation:s="none",height:o=180,width:a=220}){const l=(Number(t)||0)/2,d=`${a/2} ${l}, ${a-l} ${o-l}, ${l} ${o-l}`,h=i==="dashed"?"8,4":i==="dotted"?"2,2":void 0,f=$e(s);return g.jsx("svg",{viewBox:`0 0 ${a} ${o}`,preserveAspectRatio:"none",children:g.jsx("polygon",{points:d,fill:n,stroke:e,strokeWidth:t,strokeOpacity:r,strokeDasharray:h,style:f})})}function wq({fill:n="transparent",stroke:e="#d2d9e6",strokeWidth:t=4,strokeOpacity:r=1,strokeStyle:i="solid",strokeAnimation:s="none",height:o=140,width:a=220}){const l=(Number(t)||0)/2,c=`${30+l} ${l}, ${a-l} ${l}, ${a-30-l} ${o-l}, ${l} ${o-l}`,d=i==="dashed"?"8,4":i==="dotted"?"2,2":void 0,h=$e(s);return g.jsx("svg",{viewBox:`0 0 ${a} ${o}`,preserveAspectRatio:"none",children:g.jsx("polygon",{points:c,fill:n,stroke:e,strokeWidth:t,strokeOpacity:r,strokeDasharray:d,style:h})})}function Qq({fill:n="transparent",stroke:e="#d2d9e6",strokeWidth:t=4,strokeOpacity:r=1,strokeStyle:i="solid",strokeAnimation:s="none",height:o=140,width:a=220}){const l=(Number(t)||0)/2,c=`${40+l} ${l}, ${a-40-l} ${l}, ${a-l} ${o-l}, ${l} ${o-l}`,d=i==="dashed"?"8,4":i==="dotted"?"2,2":void 0,h=$e(s);return g.jsx("svg",{viewBox:`0 0 ${a} ${o}`,preserveAspectRatio:"none",children:g.jsx("polygon",{points:c,fill:n,stroke:e,strokeWidth:t,strokeOpacity:r,strokeDasharray:d,style:h})})}function $q({fill:n="transparent",stroke:e="#d2d9e6",strokeWidth:t=4,strokeOpacity:r=1,strokeStyle:i="solid",strokeAnimation:s="none",height:o=140,width:a=220}){const l=(Number(t)||0)/2,c=`${40+l} ${l}, ${a-40-l} ${l}, ${a-l} 70, ${a-40-l} ${o-l}, ${40+l} ${o-l}, ${l} 70`,d=i==="dashed"?"8,4":i==="dotted"?"2,2":void 0,h=$e(s);return g.jsx("svg",{viewBox:`0 0 ${a} ${o}`,preserveAspectRatio:"none",children:g.jsx("polygon",{points:c,fill:n,stroke:e,strokeWidth:t,strokeOpacity:r,strokeDasharray:d,style:h})})}function Cq({fill:n="transparent",stroke:e="#d2d9e6",strokeWidth:t=4,strokeOpacity:r=1,strokeStyle:i="solid",strokeAnimation:s="none",height:o=160,width:a=220}){const l=(Number(t)||0)/2,c=o-l,d=Math.max(0,Math.min(o,a)*.12),h=`M ${l} ${l} H ${a-l} V ${c}
|
|
264
|
+
Q ${a*.75} ${c-d}, ${a*.5} ${c}
|
|
265
|
+
Q ${a*.25} ${c-d}, ${l} ${c} Z`,f=i==="dashed"?"8,4":i==="dotted"?"2,2":void 0,p=$e(s);return g.jsx("svg",{viewBox:`0 0 ${a} ${o}`,preserveAspectRatio:"none",children:g.jsx("path",{d:h,fill:n,stroke:e,strokeWidth:t,strokeOpacity:r,strokeDasharray:f,style:p})})}function Pq({fill:n="transparent",stroke:e="#d2d9e6",strokeWidth:t=4,strokeOpacity:r=1,strokeStyle:i="solid",strokeAnimation:s="none",height:o=160,width:a=220}){const l=(Number(t)||0)/2,c=a/2,d=Math.max(0,a/2-l),h=Math.max(0,o-2*l),f=Math.max(1,Math.min(h*.18,d)),p=l+f,m=o-l-f,O=i==="dashed"?"8,4":i==="dotted"?"2,2":void 0,b=$e(s);return g.jsxs("svg",{viewBox:`0 0 ${a} ${o}`,preserveAspectRatio:"none",children:[g.jsx("rect",{x:l,y:p,width:a-l*2,height:m-p,fill:n,stroke:e,strokeWidth:t,strokeOpacity:r,strokeDasharray:O,style:b}),g.jsx("ellipse",{cx:c,cy:p,rx:d,ry:f,fill:n,stroke:e,strokeWidth:t,strokeOpacity:r,strokeDasharray:O,style:b}),g.jsx("ellipse",{cx:c,cy:m,rx:d,ry:f,fill:n,stroke:e,strokeWidth:t,strokeOpacity:r,strokeDasharray:O,style:b})]})}function Tq({fill:n="transparent",stroke:e="#d2d9e6",strokeWidth:t=4,strokeOpacity:r=1,strokeStyle:i="solid",strokeAnimation:s="none",height:o=140,width:a=220}){const l=(Number(t)||0)/2,c=Math.max(0,Math.min((o-2*l)/2,(a-2*l)/2)),d=`M ${l} ${l} H ${a-c-l} A ${c} ${c} 0 0 1 ${a-c-l} ${o-l} H ${l} Z`,h=i==="dashed"?"8,4":i==="dotted"?"2,2":void 0;return g.jsx("svg",{viewBox:`0 0 ${a} ${o}`,preserveAspectRatio:"none",children:g.jsx("path",{d,fill:n,stroke:e,strokeWidth:t,strokeOpacity:r,strokeDasharray:h,style:$e(s)})})}function Mq({fill:n="transparent",stroke:e="#d2d9e6",strokeWidth:t=4,strokeOpacity:r=1,strokeStyle:i="solid",strokeAnimation:s="none",height:o=180,width:a=180}){const l=(Number(t)||0)/2,c=a/2,d=o/2,h=`${l} ${l}, ${a-l} ${l}, ${a-l} ${d}, ${c} ${o-l}, ${l} ${d}`,f=i==="dashed"?"8,4":i==="dotted"?"2,2":void 0;return g.jsx("svg",{viewBox:`0 0 ${a} ${o}`,preserveAspectRatio:"none",children:g.jsx("polygon",{points:h,fill:n,stroke:e,strokeWidth:t,strokeOpacity:r,strokeDasharray:f,style:$e(s)})})}function Aq({fill:n="transparent",stroke:e="#d2d9e6",strokeWidth:t=4,strokeOpacity:r=1,strokeStyle:i="solid",strokeAnimation:s="none",height:o=60,width:a=160}){const l=(Number(t)||0)/2,c=Math.max(0,Math.min((o-l*2)/2,(a-l*2)/2)),d=i==="dashed"?"8,4":i==="dotted"?"2,2":void 0;return g.jsx("svg",{viewBox:`0 0 ${a} ${o}`,preserveAspectRatio:"none",children:g.jsx("rect",{x:l,y:l,width:a-l*2,height:o-l*2,rx:c,ry:c,fill:n,stroke:e,strokeWidth:t,strokeOpacity:r,strokeDasharray:d,style:$e(s)})})}function Rq({fill:n="transparent",stroke:e="#d2d9e6",strokeWidth:t=4,strokeOpacity:r=1,strokeStyle:i="solid",strokeAnimation:s="none",cornerRadius:o=6,height:a=80,width:l=140}){const c=(Number(t)||0)/2,d=Math.min(12,Math.min(l,a)*.08),h=i==="dashed"?"8,4":i==="dotted"?"2,2":void 0;return g.jsxs("svg",{viewBox:`0 0 ${l} ${a}`,preserveAspectRatio:"none",children:[g.jsx("rect",{x:c+d,y:c+d,width:l-c*2-d,height:a-c*2-d,rx:o,fill:n,stroke:e,strokeWidth:t,strokeOpacity:r,strokeDasharray:h,style:$e(s)}),g.jsx("rect",{x:c+d/2,y:c+d/2,width:l-c*2-d/2,height:a-c*2-d/2,rx:o,fill:n,stroke:e,strokeWidth:t,strokeOpacity:r,strokeDasharray:h,style:$e(s)}),g.jsx("rect",{x:c,y:c,width:l-c*2,height:a-c*2,rx:o,fill:n,stroke:e,strokeWidth:t,strokeOpacity:r,strokeDasharray:h,style:$e(s)})]})}function Eq({fill:n="transparent",stroke:e="#d2d9e6",strokeWidth:t=4,strokeOpacity:r=1,strokeStyle:i="solid",strokeAnimation:s="none",cornerRadius:o=6,height:a=100,width:l=160}){const c=(Number(t)||0)/2,d=Math.max(2,Math.min(8,t)),h=Math.max(8,l*.06),f=i==="dashed"?"8,4":i==="dotted"?"2,2":void 0;return g.jsxs("svg",{viewBox:`0 0 ${l} ${a}`,preserveAspectRatio:"none",children:[g.jsx("rect",{x:c,y:c,width:l-c*2,height:a-c*2,rx:o,fill:n,stroke:e,strokeWidth:t,strokeOpacity:r,strokeDasharray:f,style:$e(s)}),g.jsx("rect",{x:c+h,y:c+6,width:d,height:a-c*2-12,fill:e}),g.jsx("rect",{x:l-c-h-d,y:c+6,width:d,height:a-c*2-12,fill:e})]})}function Nq({fill:n="transparent",stroke:e="#d2d9e6",strokeWidth:t=4,strokeOpacity:r=1,strokeStyle:i="solid",strokeAnimation:s="none",height:o=100,width:a=160}){const l=(Number(t)||0)/2,c=Math.min(40,a*.12),d=i==="dashed"?"8,4":i==="dotted"?"2,2":void 0,h=l+c,f=`${l} ${h}, ${a-l} ${l}, ${a-l} ${o-l}, ${l} ${o-l}`,p=$e(s);return g.jsx("svg",{viewBox:`0 0 ${a} ${o}`,preserveAspectRatio:"none",children:g.jsx("polygon",{points:f,fill:n,stroke:e,strokeWidth:t,strokeOpacity:r,strokeDasharray:d,style:p})})}function Dq({fill:n="transparent",stroke:e="#d2d9e6",strokeWidth:t=4,strokeOpacity:r=1,strokeStyle:i="solid",strokeAnimation:s="none",height:o=100,width:a=100}){const l=(Number(t)||0)/2,c=a/2,d=o/2,h=Math.max(0,Math.min(a,o)/2-l),f=h*.7,p=i==="dashed"?"8,4":i==="dotted"?"2,2":void 0,m=$e(s);return g.jsxs("svg",{viewBox:`0 0 ${a} ${o}`,preserveAspectRatio:"none",children:[g.jsx("circle",{cx:c,cy:d,r:h,fill:n,stroke:e,strokeWidth:t,strokeOpacity:r,strokeDasharray:p,style:m}),g.jsx("line",{x1:c-f,y1:d-f,x2:c+f,y2:d+f,stroke:e,strokeWidth:Math.max(1,t/1.5),strokeOpacity:r,strokeLinecap:"round",style:m}),g.jsx("line",{x1:c-f,y1:d+f,x2:c+f,y2:d-f,stroke:e,strokeWidth:Math.max(1,t/1.5),strokeOpacity:r,strokeLinecap:"round",style:m})]})}function jq({fill:n="transparent",stroke:e="#d2d9e6",strokeWidth:t=4,strokeOpacity:r=1,strokeStyle:i="solid",strokeAnimation:s="none",cornerRadius:o=6,height:a=100,width:l=140}){const c=(Number(t)||0)/2,d=Math.max(2,Math.min(8,t)),h=Math.max(6,l*.04),f=i==="dashed"?"8,4":i==="dotted"?"2,2":void 0;return g.jsxs("svg",{viewBox:`0 0 ${l} ${a}`,preserveAspectRatio:"none",children:[g.jsx("rect",{x:c,y:c,width:l-c*2,height:a-c*2,rx:o,fill:n,stroke:e,strokeWidth:t,strokeOpacity:r,strokeDasharray:f,style:$e(s)}),g.jsx("rect",{x:c,y:c+6,width:l-c*2,height:Math.max(2,t/1.5),fill:e}),g.jsx("rect",{x:l-h-d,y:c+8,width:d,height:a-c*2-16,fill:e}),g.jsx("rect",{x:l-h*2-d*2,y:c+8,width:d,height:a-c*2-16,fill:e})]})}function Iq({fill:n="transparent",stroke:e="#d2d9e6",strokeWidth:t=4,strokeOpacity:r=1,strokeStyle:i="solid",strokeAnimation:s="none",height:o=140,width:a=140}){const l=(Number(t)||0)/2,c=i==="dashed"?"8,4":i==="dotted"?"2,2":void 0,d=`${l} ${l}, ${a-l} ${l}, ${a/2} ${o/2}`,h=`${l} ${o-l}, ${a-l} ${o-l}, ${a/2} ${o/2}`;return g.jsxs("svg",{viewBox:`0 0 ${a} ${o}`,preserveAspectRatio:"none",children:[g.jsx("polygon",{points:d,fill:n,stroke:e,strokeWidth:t,strokeOpacity:r,strokeDasharray:c,style:$e(s)}),g.jsx("polygon",{points:h,fill:n,stroke:e,strokeWidth:t,strokeOpacity:r,strokeDasharray:c,style:$e(s)})]})}function Xq({fill:n="transparent",stroke:e="#d2d9e6",strokeWidth:t=4,strokeOpacity:r=1,strokeStyle:i="solid",strokeAnimation:s="none",height:o=140,width:a=140}){const l=(Number(t)||0)/2,c=a/2,d=o/2,h=i==="dashed"?"8,4":i==="dotted"?"2,2":void 0,f=`${c} ${l}, ${a-l} ${d}, ${c} ${o-l}, ${l} ${d}`,p=Math.min(a-2*l,o-2*l)*.22,m=`${c} ${l+p}, ${a-l-p} ${d}, ${c} ${o-l-p}, ${l+p} ${d}`;return g.jsxs("svg",{viewBox:`0 0 ${a} ${o}`,preserveAspectRatio:"none",children:[g.jsx("polygon",{points:f,fill:n,stroke:e,strokeWidth:t,strokeOpacity:r,strokeDasharray:h,style:$e(s)}),g.jsx("polygon",{points:m,fill:"none",stroke:e,strokeWidth:Math.max(1,t/1.5),strokeOpacity:r})]})}function Lq({fill:n="transparent",stroke:e="#d2d9e6",strokeWidth:t=4,strokeOpacity:r=1,strokeStyle:i="solid",strokeAnimation:s="none",height:o=100,width:a=100}){const l=(Number(t)||0)/2,c=a/2,d=o/2,h=Math.max(0,Math.min(a,o)/2-l),f=h*.7,p=i==="dashed"?"8,4":i==="dotted"?"2,2":void 0;return g.jsxs("svg",{viewBox:`0 0 ${a} ${o}`,preserveAspectRatio:"none",children:[g.jsx("circle",{cx:c,cy:d,r:h,fill:n,stroke:e,strokeWidth:t,strokeOpacity:r,strokeDasharray:p,style:$e(s)}),g.jsx("line",{x1:c-f,y1:d,x2:c+f,y2:d,stroke:e,strokeWidth:Math.max(1,t/1.5),strokeOpacity:r,strokeLinecap:"round"}),g.jsx("line",{x1:c,y1:d-f,x2:c,y2:d+f,stroke:e,strokeWidth:Math.max(1,t/1.5),strokeOpacity:r,strokeLinecap:"round"})]})}function _q({fill:n="transparent",stroke:e="#d2d9e6",strokeWidth:t=4,strokeOpacity:r=1,strokeStyle:i="solid",strokeAnimation:s="none",height:o=400,width:a=220}){const l=(Number(t)||0)/2,c=a/2,d=Math.max(0,a/2-l),h=Math.max(1,(o-2*l)/2-1),f=Math.max(2,(a-2*l)*.18),p=Math.min(f,h),m=l+p,O=o-l-p,b=i==="dashed"?"8,4":i==="dotted"?"2,2":void 0;return g.jsxs("svg",{viewBox:`0 0 ${a} ${o}`,preserveAspectRatio:"none",children:[g.jsx("rect",{x:l,y:m,width:a-l*2,height:O-m,fill:n,stroke:"none"}),g.jsx("line",{x1:l,y1:m,x2:l,y2:O,stroke:e,strokeWidth:t,strokeOpacity:r,strokeDasharray:b,style:$e(s)}),g.jsx("line",{x1:a-l,y1:m,x2:a-l,y2:O,stroke:e,strokeWidth:t,strokeOpacity:r,strokeDasharray:b,style:$e(s)}),g.jsx("ellipse",{cx:c,cy:m,rx:d,ry:p,fill:n,stroke:e,strokeWidth:t,strokeOpacity:r,strokeDasharray:b,style:$e(s)}),g.jsx("ellipse",{cx:c,cy:O,rx:d,ry:p,fill:"none",stroke:e,strokeWidth:t,strokeOpacity:r,strokeDasharray:b,style:$e(s)})]})}function Bq({fill:n="transparent",stroke:e="#d2d9e6",strokeWidth:t=4,strokeOpacity:r=1,strokeStyle:i="solid",strokeAnimation:s="none",height:o=140,width:a=220}){const l=(Number(t)||0)/2,c=`M ${l} ${l} H ${a-40-l} Q ${a-l} ${o/2} ${a-40-l} ${o-l} H ${l} Z`,d=i==="dashed"?"8,4":i==="dotted"?"2,2":void 0;return g.jsx("svg",{viewBox:`0 0 ${a} ${o}`,preserveAspectRatio:"none",children:g.jsx("path",{d:c,fill:n,stroke:e,strokeWidth:t,strokeOpacity:r,strokeDasharray:d,style:$e(s)})})}const em=[{id:"rectangle",label:"Rectangle",Component:yq,hasCornerRadius:!0,recommendedWidth:200,recommendedHeight:140,getTextInset:({width:n,height:e})=>{const t=Math.max(8,Math.min(n,e)*.06);return{top:t,right:t,bottom:t,left:t}}},{id:"rounded-rect",label:"Rounded Rectangle",Component:xq,hasCornerRadius:!0,recommendedWidth:200,recommendedHeight:140,getTextInset:({width:n,height:e})=>{const t=Math.max(8,Math.min(n,e)*.06),r=Math.min(n,e)*.04,i=t+r;return{top:i,right:i,bottom:i,left:i}}},{id:"ellipse",label:"Ellipse",Component:Sq,recommendedWidth:180,recommendedHeight:180,getTextInset:({width:n,height:e})=>{const t=Math.max(8,n*.1465),r=Math.max(8,e*.1465);return{top:r,right:t,bottom:r,left:t}}},{id:"diamond",label:"Diamond",Component:kq,recommendedWidth:200,recommendedHeight:200,getTextInset:({width:n,height:e})=>{const t=Math.max(8,n*.25),r=Math.max(8,e*.25);return{top:r,right:t,bottom:r,left:t}}},{id:"triangle",label:"Triangle",Component:vq,recommendedWidth:220,recommendedHeight:180,getTextInset:({width:n,height:e})=>{const t=Math.max(12,n*.18),r=Math.max(12,e*.22),i=Math.max(12,e*.06);return{top:r,right:t,bottom:i,left:t}}},{id:"parallelogram",label:"Parallelogram",Component:wq,recommendedWidth:220,recommendedHeight:140,getTextInset:()=>({top:12,right:30,bottom:12,left:30})},{id:"trapezoid",label:"Trapezoid",Component:Qq,recommendedWidth:220,recommendedHeight:140,getTextInset:()=>({top:12,right:40,bottom:12,left:40})},{id:"hexagon",label:"Hexagon",Component:$q,recommendedWidth:220,recommendedHeight:140,getTextInset:()=>({top:12,right:40,bottom:12,left:40})},{id:"document",label:"Document",Component:Cq,recommendedWidth:220,recommendedHeight:160,getTextInset:({width:n,height:e})=>{const t=Math.min(n,e)*.12,r=12,i=12,s=Math.max(12,t+8);return{top:i,right:r,bottom:s,left:r}}},{id:"cylinder",label:"Cylinder",Component:Pq,recommendedWidth:220,recommendedHeight:160,getTextInset:({width:n,height:e})=>{const t=Math.min(e*.18,n*.5),r=12,i=Math.max(12,t+8);return{top:i,right:r,bottom:i,left:r}}},{id:"delay",label:"Delay",Component:Tq,recommendedWidth:220,recommendedHeight:140,getTextInset:({width:n,height:e})=>{const t=Math.min(n*.5,e*.5),r=12,i=12,s=Math.max(16,t);return{top:r,right:s,bottom:r,left:i}}},{id:"off-page-connector",label:"Off-page Connector",Component:Mq,recommendedWidth:180,recommendedHeight:180,getTextInset:({width:n,height:e})=>{const t=Math.max(12,n*.18),r=12,i=Math.max(12,e*.28);return{top:r,right:t,bottom:i,left:t}}},{id:"display",label:"Display",Component:Bq,recommendedWidth:220,recommendedHeight:140,getTextInset:()=>({top:12,right:40,bottom:12,left:12})},{id:"collate",label:"Collate",Component:Iq,recommendedWidth:140,recommendedHeight:140,getTextInset:({height:n})=>{const e=Math.max(12,n*.28),t=12;return{top:e,right:t,bottom:e,left:t}}},{id:"sort",label:"Sort",Component:Xq,recommendedWidth:140,recommendedHeight:140,getTextInset:({width:n,height:e})=>{const t=Math.max(8,n*.22),r=Math.max(8,e*.22);return{top:r,right:t,bottom:r,left:t}}},{id:"terminator",label:"Terminator",Component:Aq,recommendedWidth:160,recommendedHeight:60,getTextInset:({height:n})=>{const e=Math.max(12,n/2),t=12;return{top:t,right:e,bottom:t,left:e}}},{id:"or",label:"Or",Component:Lq,recommendedWidth:100,recommendedHeight:100,getTextInset:({width:n,height:e})=>{const t=Math.max(8,n*.1465),r=Math.max(8,e*.1465);return{top:r,right:t,bottom:r,left:t}}},{id:"database",label:"Database",Component:_q,recommendedWidth:220,recommendedHeight:400,getTextInset:({width:n,height:e})=>{const t=Math.min(e*.18,n*.5),r=12,i=Math.max(60,t+8);return{top:i*1.6,right:r,bottom:i,left:r}}},{id:"multiple-documents",label:"Multiple Documents",Component:Rq,hasCornerRadius:!0,recommendedWidth:140,recommendedHeight:80,getTextInset:({width:n,height:e})=>{const t=Math.max(10,Math.min(n,e)*.08);return{top:t,right:t,bottom:t,left:t}}},{id:"subroutine",label:"Subroutine",Component:Eq,hasCornerRadius:!0,recommendedWidth:160,recommendedHeight:100,getTextInset:({width:n})=>{const e=Math.max(12,n*.1),t=12;return{top:t,right:e,bottom:t,left:e}}},{id:"manual-input",label:"Manual Input",Component:Nq,recommendedWidth:160,recommendedHeight:100,getTextInset:({width:n})=>{const e=Math.min(40,n*.12),t=Math.max(12,e),r=12;return{top:t,right:r,bottom:r,left:r}}},{id:"summing-junction",label:"Summing Junction",Component:Dq,recommendedWidth:200,recommendedHeight:200,isAspectLocked:!0,getTextInset:({width:n,height:e})=>{const t=Math.max(8,n*.1465),r=Math.max(8,e*.1465);return{top:r,right:t,bottom:r,left:t}}},{id:"internal-storage",label:"Internal Storage",Component:jq,hasCornerRadius:!0,recommendedWidth:140,recommendedHeight:100,getTextInset:({width:n})=>{const e=Math.max(16,n*.14),t=12;return{top:18,right:e,bottom:t,left:t}}}];Object.fromEntries(em.map(n=>[n.id,n.Component]));function ix({id:n,data:e,width:t,height:r,selected:i}){const{updateNodeData:s,updateNode:o}=On(),a=Mn(e.componentFields,{componentFieldId:"name"}),l=$.useRef(null),c=$.useRef(null),d=$.useRef(null),[h,f]=dr(a??"");function p(w){f(w),d.current&&clearTimeout(d.current),d.current=setTimeout(()=>{s(n,{componentFields:vi(e.componentFields??[],{name:w})})},250)}const[m,O]=$.useState(null),b=$.useMemo(()=>em.find(w=>w.id===e.shape)??em[0],[e.shape]),y=$.useMemo(()=>{if(e?.textColor)return e.textColor;const w=e?.fill;if(typeof w!="string")return;const Q=w.trim().replace("#","");if(Q.length!==6)return;const P=parseInt(Q.slice(0,2),16),T=parseInt(Q.slice(2,4),16),C=parseInt(Q.slice(4,6),16);if((.299*P+.587*T+.114*C)/255>.6)return"#0f172a"},[e?.textColor,e?.fill]),k=$.useMemo(()=>!b?.getTextInset||!t||!r?{top:0,right:0,bottom:0,left:0}:b.getTextInset({width:t,height:r}),[b,t,r]);$.useEffect(()=>{const w=l.current;if(!w)return;function Q(){O({width:w.clientWidth,height:w.clientHeight})}const P=new ResizeObserver(Q);return P.observe(w),Q(),()=>P.disconnect()},[]);const x=m?.width&&t?Math.max(m.width,t):void 0,S=m?.height&&r?Math.max(m.height,r):void 0,v=rl({width:t,height:r,shapeWidth:x,shapeHeight:S});return g.jsxs(il,{ref:l,selected:i,onDoubleClick:()=>c.current?.focus(),className:"relative flex size-full min-h-fit min-w-fit items-center justify-center [&>svg]:size-full!",children:[g.jsx(pr,{isVisible:i,keepAspectRatio:b?.isAspectLocked??!1}),b&&g.jsx("div",{className:"absolute inset-0 -z-10 [&>svg]:size-full",children:g.jsx(b.Component,{...e,strokeStyle:e.strokeAnimation==="dash"?"dashed":e.strokeStyle,width:x,height:S})}),g.jsx("style",{dangerouslySetInnerHTML:{__html:`
|
|
266
|
+
@keyframes stroke-fake-animation {
|
|
267
|
+
from { stroke-dashoffset: 0; }
|
|
268
|
+
to { stroke-dashoffset: 100%; }
|
|
269
|
+
}`}}),e.sequenceNumber!==void 0&&g.jsx("div",{className:"bg-muted text-muted-foreground absolute -top-2 -left-2 flex size-5 items-center justify-center rounded-full text-[10px] font-medium",children:e.sequenceNumber}),g.jsx(Fs,{ref:c,value:h,className:"text-foreground w-full resize-none overflow-hidden border-none bg-transparent text-center text-sm break-words outline-none",style:{marginTop:k.top,marginLeft:k.left,marginRight:k.right,marginBottom:k.bottom,fontSize:e?.textFontSize||14,color:y},onChange:w=>{p(w.target.value);const Q=v.current.height,P=w.target.clientHeight;Q&&Q>P||o(n,{height:P})}})]})}function Zq({id:n,data:e,selected:t}){const{updateNodeData:r,updateNode:i}=On(),s=Mn(e.componentFields,{componentFieldId:"text"}),o=$.useRef(null),[a,l]=dr(s??"");function c(d){l(d),o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{r(n,{componentFields:vi(e.componentFields??[],{text:d})})},1e3)}return g.jsxs(wi,{className:"relative isolate w-full rounded-[0.5rem] bg-transparent leading-0 outline-transparent",style:{borderRadius:e?.borderRadius||8},selected:t,onWheel:d=>{d.stopPropagation(),d.nativeEvent.stopImmediatePropagation()},children:[g.jsx(pr,{isVisible:t,handleClassName:"z-10",onResize:(d,h)=>{i(n,{width:h.width,height:h.height})}}),g.jsx(Yg,{className:"pointer-events-none absolute inset-0 size-full",borderColor:e?.stroke,borderWidth:e?.strokeWidth,borderStyle:e?.strokeStyle,borderRadius:e?.borderRadius,borderAnimationEnabled:e?.borderAnimationEnabled}),g.jsx(Fs,{value:a,placeholder:"Add text",onKeyDown:d=>d.stopPropagation(),onMouseDown:d=>d.stopPropagation(),onChange:d=>c(d.currentTarget.value),className:F("h-auto w-auto max-w-full cursor-grab resize-none bg-transparent px-3 py-2 outline-none",t&&"cursor-text active:cursor-grabbing"),style:{borderStyle:"solid",borderColor:"transparent",borderWidth:e?.strokeWidth,borderRadius:e?.borderRadius,fontSize:e?.fontSize||14,fontWeight:e?.fontWeight||400,lineHeight:e?.lineHeight||1.5,fontFamily:e?.fontFamily||"inherit",backgroundColor:e?.fill||"transparent",color:e?.color||"var(--foreground)"},onWheel:d=>{d.stopPropagation(),d.nativeEvent.stopImmediatePropagation()}})]})}const Wq={default:ix,builder:BF,comment:oq,gif:EF,group:Oq,shape:ix,cloud:HF,image:bq,sequenceParticipant:TF,table:RF,code:JF,text:Zq,databaseTableSQL:fq,dataTableInterface:cq,c4:$T,c4Boundary:GF,subDiagram:AT};function zq(n){return mr({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M217.9 256L345 129c9.4-9.4 9.4-24.6 0-33.9-9.4-9.4-24.6-9.3-34 0L167 239c-9.1 9.1-9.3 23.7-.7 33.1L310.9 417c4.7 4.7 10.9 7 17 7s12.3-2.3 17-7c9.4-9.4 9.4-24.6 0-33.9L217.9 256z"},child:[]}]})(n)}function sx(n,e){const t=ox(n),r=ox(e),i=Math.abs(t.x-r.x),s=Math.abs(t.y-r.y);let o;i>s?o=t.x>r.x?ge.Left:ge.Right:o=t.y>r.y?ge.Top:ge.Bottom;const[a,l]=Vq(n,o);return[a,l,o]}function Vq(n,e){const t=n.internals.handleBounds?.source?.find(a=>a.position===e);if(!t)return[n.internals.positionAbsolute.x+n.measured.width/2,n.internals.positionAbsolute.y+n.measured.height/2];let r=t.width/2,i=t.height/2;switch(e){case ge.Left:r=0;break;case ge.Right:r=t.width;break;case ge.Top:i=0;break;case ge.Bottom:i=t.height;break}const s=n.internals.positionAbsolute.x+t.x+r,o=n.internals.positionAbsolute.y+t.y+i;return[s,o]}function ox(n){return{x:n.internals.positionAbsolute.x+n.measured.width/2,y:n.internals.positionAbsolute.y+n.measured.height/2}}function Fq(n,e){const[t,r,i]=sx(n,e),[s,o,a]=sx(e,n);return{sx:t,sy:r,tx:s,ty:o,sourcePos:i,targetPos:a}}const qq=28,ax=8;function Yq(n){const e=new Map;for(const r of n){if(r.hidden||r.source===r.target)continue;const i=r.source<r.target?`${r.source}|${r.target}`:`${r.target}|${r.source}`,s=e.get(i);s?s.push(r):e.set(i,[r])}const t=new Map;for(const r of e.values())r.length<2||r.forEach((i,s)=>{t.set(i.id,(s-(r.length-1)/2)*qq)});return n.map(r=>{const i=t.get(r.id)??0;return r.data?.parallelOffset===i||r.data?.parallelOffset===void 0&&i===0?r:{...r,data:{...r.data,parallelOffset:i}}})}function hc(n,{x:e,y:t,position:r,width:i,height:s}){if(r===ge.Left||r===ge.Right){const o=Math.max(s/2-ax,0);return{x:e,y:t+lx(n,o)}}if(r===ge.Top||r===ge.Bottom){const o=Math.max(i/2-ax,0);return{x:e+lx(n,o),y:t}}throw new Error(`Unknown handle position: ${r}`)}function lx(n,e){return Math.max(-e,Math.min(e,n))}function B$(n,e,t,r){const i=n+(r?.source??0),s=n+(r?.target??0);return{sourceX:i===0?e.x:hc(i,e).x,sourceY:i===0?e.y:hc(i,e).y,targetX:s===0?t.x:hc(s,t).x,targetY:s===0?t.y:hc(s,t).y}}const cx=5;function Z$({sourceX:n,sourceY:e,targetX:t,targetY:r}){return g.jsxs(g.Fragment,{children:[g.jsx("circle",{r:cx,className:"react-flow__edge-endpoint",style:{transform:`translate(${n}px, ${e}px) scale(var(--react-flow-counter-scale))`}}),g.jsx("circle",{r:cx,className:"react-flow__edge-endpoint",style:{transform:`translate(${t}px, ${r}px) scale(var(--react-flow-counter-scale))`}})]})}function Uq({id:n,data:e,label:t,labelStyle:r,style:i,source:s,target:o,selected:a,markerEnd:l,markerStart:c}){const d=Lc(s),h=Lc(o),f=e?.labelFontSize??12,p=!!e?.reverseAnimation,m=$.useRef(null),[O,b]=$.useState({width:0,height:0});if($.useEffect(()=>{if(m.current){const{width:te,height:le}=m.current.getBBox();b({width:te,height:le})}},[t,f]),!d||!h)return null;const{sx:y,sy:k,tx:x,ty:S,sourcePos:v,targetPos:w}=Fq(d,h),Q=e?.parallelOffset??0,P=e?.hubOffset,{sourceX:T,sourceY:C,targetX:R,targetY:M}=B$(Q,{x:y,y:k,position:v,...wa(d)},{x,y:S,position:w,...wa(h)},P),[j]=vx({sourceX:T,sourceY:C,sourcePosition:v,targetPosition:w,targetX:R,targetY:M}),N=e?.labelOffset,I=(T+R)/2+(N?.x??0),L=(C+M)/2+(N?.y??0);return g.jsxs("g",{children:[g.jsx("path",{id:n,d:j,className:"react-flow__edge-path",style:{stroke:"transparent",strokeWidth:20}}),g.jsx("path",{id:n,className:"react-flow__edge-path",d:j,markerEnd:l,markerStart:c,style:p?{...i,animationDirection:"reverse"}:i}),a&&g.jsx(Z$,{sourceX:T,sourceY:C,targetX:R,targetY:M}),t&&g.jsxs(g.Fragment,{children:[g.jsx("rect",{x:I-O.width/2-4,y:L-O.height/2-2,width:O.width+8,height:O.height+4,fill:r?.backgroundColor??"#1e2533",rx:4,ry:4,style:{pointerEvents:"none",userSelect:"none"}}),g.jsx("text",{ref:m,x:I,y:L,textAnchor:"middle",dominantBaseline:"middle",fill:r?.color??"#f4f7fc",style:{pointerEvents:"none",userSelect:"none",fontSize:f},children:t})]})]})}function nd(n,e){return Math.sqrt((e.x-n.x)**2+(e.y-n.y)**2)}function Gq(n){const e=[];for(const t of n){const r=e[e.length-1];r&&r.x===t.x&&r.y===t.y||e.push(t)}for(let t=e.length-2;t>=1;t--){const r=e[t-1],i=e[t],s=e[t+1];(r.x===i.x&&i.x===s.x||r.y===i.y&&i.y===s.y)&&e.splice(t,1)}return e}function Hq(n){const[e]=pf({...n,borderRadius:0}),t=/[ML]\s*(-?[\d.]+)[\s,]+(-?[\d.]+)/g,r=[];let i=t.exec(e);for(;i;)r.push({x:Number(i[1]),y:Number(i[2])}),i=t.exec(e);return Gq(r)}function ux(n){const e=[];for(let t=0;t<n.length-1;t++){const r=n[t],i=n[t+1];if(r.x===i.x)e.push({index:t,axis:"x",from:r,to:i});else if(r.y===i.y)e.push({index:t,axis:"y",from:r,to:i});else throw new Error(`Route segment ${t} is not orthogonal`)}return e}function Kq(n){return n.map(e=>e.axis).join("")}function Jq(n,e){if(!n||typeof n!="object")return null;const t=n;return t.axes!==e||!Array.isArray(t.offsets)||t.offsets.length!==e.length||t.offsets.some(r=>!Number.isFinite(r))?null:{axes:e,offsets:t.offsets}}function eY(n,e,t){const r=n.map(i=>({...i}));for(let i=1;i<e.length-1;i++){const s=t[i];if(s!==0)if(e[i]==="x")r[i].x+=s,r[i+1].x+=s;else if(e[i]==="y")r[i].y+=s,r[i+1].y+=s;else throw new Error(`Unknown route axis: ${e[i]}`)}return r}function tY(n,e,t,r){const i=Math.min(nd(n,e)/2,nd(e,t)/2,r),{x:s,y:o}=e;if(n.x===s&&s===t.x||n.y===o&&o===t.y)return`L${s} ${o}`;if(n.y===o){const c=n.x<t.x?-1:1,d=n.y<t.y?1:-1;return`L ${s+i*c},${o}Q ${s},${o} ${s},${o+i*d}`}const a=n.x<t.x?1:-1,l=n.y<t.y?-1:1;return`L ${s},${o+i*l}Q ${s},${o} ${s+i*a},${o}`}function nY(n,e){const t=n[n.length-1];let r=`M${n[0].x} ${n[0].y}`;for(let i=1;i<n.length-1;i++)r+=tY(n[i-1],n[i],n[i+1],e);return`${r}L${t.x} ${t.y}`}function rY(n){let e=0;for(let i=0;i<n.length-1;i++)e+=nd(n[i],n[i+1]);let t=e/2;for(let i=0;i<n.length-1;i++){const s=n[i],o=n[i+1],a=nd(s,o);if(t<=a){const l=a===0?0:t/a;return[s.x+(o.x-s.x)*l,s.y+(o.y-s.y)*l]}t-=a}const r=n[n.length-1];return[r.x,r.y]}const iY=14,sY=6,oY="#0059ea";function aY({edgeId:n,axes:e,offsets:t,segments:r,draft:i,onDraft:s}){const{screenToFlowPosition:o}=On(),a=Fr(),[l,c]=$.useState(null);function d(f){a.setEdges(p=>p.map(m=>{if(m.id!==n)return m;if(f===null){const O={...m.data};return delete O.routing,{...m,data:O}}return{...m,data:{...m.data,routing:{axes:e,offsets:f}}}}))}function h(f,p){f.preventDefault();const m=o({x:f.clientX,y:f.clientY}),O=t[p.index],b=document.body.style.cursor,y=document.body.style.userSelect;document.body.style.cursor=p.axis==="x"?"col-resize":"row-resize",document.body.style.userSelect="none";let k=null;function x(v){const w=o({x:v.clientX,y:v.clientY});k=Math.round(O+w[p.axis]-m[p.axis]),s({index:p.index,value:k})}function S(){window.removeEventListener("pointermove",x),window.removeEventListener("pointerup",S),window.removeEventListener("pointercancel",S),document.body.style.cursor=b,document.body.style.userSelect=y;const v=k;if(s(null),v===null||v===O)return;const w=t.map((Q,P)=>P===p.index?v:Q);d(w.every(Q=>Q===0)?null:w)}window.addEventListener("pointermove",x),window.addEventListener("pointerup",S),window.addEventListener("pointercancel",S)}return g.jsx(g.Fragment,{children:r.map(f=>{if(f.index===0||f.index===r.length-1)return null;const p=`M ${f.from.x} ${f.from.y} L ${f.to.x} ${f.to.y}`,m=i?.index===f.index||l===f.index;return g.jsxs("g",{children:[m&&g.jsx("path",{d:p,fill:"none",stroke:oY,strokeWidth:sY,strokeOpacity:.35,strokeLinecap:"round",vectorEffect:"non-scaling-stroke",style:{pointerEvents:"none"}}),g.jsx("path",{d:p,fill:"none",stroke:"transparent",strokeWidth:iY,vectorEffect:"non-scaling-stroke",style:{cursor:f.axis==="x"?"col-resize":"row-resize"},onPointerEnter:()=>c(f.index),onPointerLeave:()=>c(null),onPointerDown:O=>h(O,f),onDoubleClick:O=>{O.stopPropagation(),d(null)}})]},f.index)})})}const lY=5,cY=1e3;function Xo(n){return function({id:t,data:r,label:i,labelStyle:s,style:o,selected:a,markerEnd:l,markerStart:c,source:d,sourceX:h,sourceY:f,target:p,targetX:m,targetY:O,sourcePosition:b,targetPosition:y}){const k=Lc(d),x=Lc(p),[S,v]=$.useState(null),w=sm(de=>de.elementsSelectable),Q=r?.parallelOffset??0,P=r?.hubOffset,T=k?wa(k):{width:0,height:0},C=x?wa(x):{width:0,height:0},{sourceX:R,sourceY:M,targetX:j,targetY:N}=B$(Q,{x:h,y:f,position:b,...T},{x:m,y:O,position:y,...C},P);let I=0;k?.parentId&&(I=k.internals.z),x?.parentId&&x.internals.z>I&&(I=x.internals.z),a&&(I+=cY);const L={sourceX:R,sourceY:M,targetX:j,targetY:N,sourcePosition:b,targetPosition:y};let te,le,_;if(n==="straight")[te,le,_]=zC({sourceX:R,sourceY:M,targetX:j,targetY:N});else if(n==="smoothstep")[te,le,_]=pf(L);else if(n==="step")[te,le,_]=pf({...L,borderRadius:0});else if(n==="simplebezier")[te,le,_]=AC(L);else if(n==="bezier")[te,le,_]=vx(L);else throw new Error(`Unknown edge path type: ${n}`);const re=r?.routing,ie=$.useMemo(()=>{if(n!=="step"&&n!=="smoothstep"||!re&&!w&&!S)return null;const de=Hq({sourceX:R,sourceY:M,targetX:j,targetY:N,sourcePosition:b,targetPosition:y}),Ye=Kq(ux(de)),ut=Jq(re,Ye),bn=ut?ut.offsets:Ye.split("").map(()=>0),gt=S?bn.map((Nn,Se)=>Se===S.index?S.value:Nn):bn,En=gt.some(Nn=>Nn!==0),yr=En?eY(de,Ye,gt):de;return{axes:Ye,offsets:gt,points:yr,isRouted:En,segments:ux(yr)}},[re,w,S,R,M,j,N,b,y]);ie?.isRouted&&(te=nY(ie.points,n==="step"?0:lY),[le,_]=rY(ie.points));const pe=r?.labelOffset;pe&&(le+=pe.x,_+=pe.y);const Oe=r?.labelFontSize??12,U=!!r?.reverseAnimation;return g.jsxs(g.Fragment,{children:[g.jsx(RC,{id:t,path:te,style:U?{...o,animationDirection:"reverse"}:o,markerEnd:l,markerStart:c}),a&&g.jsx(Z$,{sourceX:R,sourceY:M,targetX:j,targetY:N}),ie&&(w||S!==null)&&g.jsx(aY,{edgeId:t,axes:ie.axes,offsets:ie.offsets,segments:ie.segments,draft:S,onDraft:v}),i&&g.jsx(EC,{children:g.jsx("div",{className:r?.lodLabelClass,style:{position:"absolute",zIndex:I,transform:`translate(-50%, -50%) translate(${le}px, ${_}px)`,fontSize:Oe,lineHeight:1.2,padding:"2px 6px",borderRadius:4,background:s?.backgroundColor??"#1E293B",color:s?.color??"#E2E8F0",border:s?.backgroundColor?"none":"1px solid #334155",pointerEvents:"none",userSelect:"none",whiteSpace:"nowrap"},children:i})})]})}}const uY={default:Xo("bezier"),straight:Xo("straight"),step:Xo("step"),smoothstep:Xo("smoothstep"),simplebezier:Xo("simplebezier"),dynamic:Uq},aG=[{id:"default",label:"Auto"},{id:"straight",label:"Straight"},{id:"step",label:"Step"},{id:"smoothstep",label:"Smooth Step"},{id:"simplebezier",label:"Simple Bezier"},{id:"dynamic",label:"Dynamic"}],lG=[{id:Wi.Arrow,label:"Arrow",icon:g.jsx(zq,{})},{id:Wi.ArrowClosed,label:"Arrow Closed",icon:g.jsx(JC,{})},{id:"erdOne",label:"ERD One",icon:g.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",children:g.jsx("line",{x1:"8",y1:"3",x2:"8",y2:"13",stroke:"currentColor",strokeWidth:"2"})})},{id:"erdMany",label:"ERD Many",icon:g.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",children:[g.jsx("line",{x1:"4",y1:"8",x2:"12",y2:"4",stroke:"currentColor",strokeWidth:"2"}),g.jsx("line",{x1:"4",y1:"8",x2:"12",y2:"12",stroke:"currentColor",strokeWidth:"2"}),g.jsx("line",{x1:"4",y1:"8",x2:"12",y2:"8",stroke:"currentColor",strokeWidth:"2"})]})},{id:"erdOnlyOne",label:"ERD Only One",icon:g.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",children:[g.jsx("line",{x1:"11",y1:"4",x2:"11",y2:"12",stroke:"currentColor",strokeWidth:"1.5"}),g.jsx("line",{x1:"13",y1:"4",x2:"13",y2:"12",stroke:"currentColor",strokeWidth:"1.5"})]})},{id:"erdZeroOrOne",label:"ERD Zero or One",icon:g.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",children:[g.jsx("circle",{cx:"5",cy:"8",r:"2",stroke:"currentColor",strokeWidth:"1.5",fill:"white"}),g.jsx("line",{x1:"10",y1:"4",x2:"10",y2:"12",stroke:"currentColor",strokeWidth:"1.5"})]})},{id:"erdOneToMany",label:"ERD One to Many",icon:g.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",children:[g.jsx("line",{x1:"4",y1:"4",x2:"4",y2:"12",stroke:"currentColor",strokeWidth:"1.5"}),g.jsx("line",{x1:"6",y1:"8",x2:"12",y2:"5",stroke:"currentColor",strokeWidth:"1.5"}),g.jsx("line",{x1:"6",y1:"8",x2:"12",y2:"11",stroke:"currentColor",strokeWidth:"1.5"}),g.jsx("line",{x1:"6",y1:"8",x2:"12",y2:"8",stroke:"currentColor",strokeWidth:"1.5"})]})},{id:"erdOneOrMany",label:"ERD One or Many",icon:g.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",children:[g.jsx("line",{x1:"7",y1:"4",x2:"7",y2:"12",stroke:"currentColor",strokeWidth:"1.5"}),g.jsx("line",{x1:"5",y1:"8",x2:"12",y2:"5",stroke:"currentColor",strokeWidth:"1.5"}),g.jsx("line",{x1:"5",y1:"8",x2:"12",y2:"11",stroke:"currentColor",strokeWidth:"1.5"}),g.jsx("line",{x1:"5",y1:"8",x2:"12",y2:"8",stroke:"currentColor",strokeWidth:"1.5"})]})},{id:"erdZeroOrMany",label:"ERD Zero or Many",icon:g.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",children:[g.jsx("circle",{cx:"4",cy:"8",r:"2",stroke:"currentColor",strokeWidth:"1.5",fill:"white"}),g.jsx("line",{x1:"7",y1:"8",x2:"13",y2:"5",stroke:"currentColor",strokeWidth:"1.5"}),g.jsx("line",{x1:"7",y1:"8",x2:"13",y2:"11",stroke:"currentColor",strokeWidth:"1.5"}),g.jsx("line",{x1:"7",y1:"8",x2:"13",y2:"8",stroke:"currentColor",strokeWidth:"1.5"})]})}];function dY(){const[n,e]=$.useState({x:0,y:0}),[t,r]=$.useState(!1);return $.useEffect(()=>{function i(s){const o=s.target;r(!!o?.closest(".react-flow__pane")),e({x:s.clientX,y:s.clientY})}return window.addEventListener("mousemove",i),()=>{window.removeEventListener("mousemove",i)}},[]),t?g.jsx("div",{style:{position:"fixed",top:n.y,left:n.x,pointerEvents:"none",zIndex:9999},children:g.jsx("div",{className:"flex size-7 -translate-y-full items-center justify-center rounded-full rounded-bl-none border-2 border-blue-500 bg-blue-100 text-blue-600 shadow-lg",children:g.jsx(sC,{className:"size-3.5"})})}):null}const df=60;function hY(){const n=On(),[e,t]=$.useState(null);return $.useEffect(()=>{const r=setInterval(()=>{const i=n.getNodes();if(i.length===0){t(null);return}const s=fc(i),o=s.width+df,a=s.height+df,l=VC(s,o,a,1,1,df);t({nodesBounds:s,visualBounds:JT(i),captureBounds:{x:-l.x/l.zoom,y:-l.y/l.zoom,width:o/l.zoom,height:a/l.zoom}})},1e3);return()=>clearInterval(r)},[n]),e?g.jsxs(NC,{children:[g.jsx("div",{className:"pointer-events-none absolute border-2 border-red-500",style:{left:e.nodesBounds.x,top:e.nodesBounds.y,width:e.nodesBounds.width,height:e.nodesBounds.height},children:g.jsxs("div",{className:"absolute -top-6 left-0 bg-red-500 px-1 text-xs whitespace-nowrap text-white",children:["nodesBounds ",Math.round(e.nodesBounds.x),",",Math.round(e.nodesBounds.y)," ",Math.round(e.nodesBounds.width),"x",Math.round(e.nodesBounds.height)]})}),g.jsx("div",{className:"pointer-events-none absolute border-2 border-dashed border-lime-400",style:{left:e.captureBounds.x,top:e.captureBounds.y,width:e.captureBounds.width,height:e.captureBounds.height},children:g.jsxs("div",{className:"absolute -bottom-6 left-0 bg-lime-400 px-1 text-xs whitespace-nowrap text-black",children:["captureBounds ",Math.round(e.captureBounds.x),",",Math.round(e.captureBounds.y)," ",Math.round(e.captureBounds.width),"x",Math.round(e.captureBounds.height)]})}),g.jsx("div",{className:"pointer-events-none absolute border-2 border-cyan-400",style:{left:e.visualBounds.x,top:e.visualBounds.y,width:e.visualBounds.width,height:e.visualBounds.height},children:g.jsxs("div",{className:"absolute -top-6 right-0 bg-cyan-400 px-1 text-xs whitespace-nowrap text-black",children:["visualBounds ",Math.round(e.visualBounds.x),",",Math.round(e.visualBounds.y)," ",Math.round(e.visualBounds.width),"x",Math.round(e.visualBounds.height)]})})]}):null}function fY({isDrawing:n,onDrawComplete:e}){const[t,r]=$.useState(null),[i,s]=$.useState(null),o=$.useCallback(c=>{if(!n)return;const d=c.currentTarget.getBoundingClientRect(),h=c.clientX-d.left,f=c.clientY-d.top;r({x:h,y:f}),s({x:h,y:f})},[n]),a=$.useCallback(c=>{if(!n||!t)return;const d=c.currentTarget.getBoundingClientRect(),h=c.clientX-d.left,f=c.clientY-d.top;s({x:h,y:f})},[n,t]),l=$.useCallback(()=>{if(!n||!t||!i)return;const c={x:Math.min(t.x,i.x),y:Math.min(t.y,i.y),width:Math.abs(i.x-t.x),height:Math.abs(i.y-t.y)};c.width>50&&c.height>50&&e(c),r(null),s(null)},[n,t,i,e]);return n?g.jsx("div",{className:"absolute inset-0 z-20",style:{cursor:n?"crosshair":"default"},onMouseDown:o,onMouseMove:a,onMouseUp:l,children:t&&i&&g.jsx("div",{className:"bg-opacity-20 absolute border-2 border-dashed border-blue-500 bg-blue-100",style:{left:Math.min(t.x,i.x),top:Math.min(t.y,i.y),width:Math.abs(i.x-t.x),height:Math.abs(i.y-t.y)}})}):null}const nn=6;function pY(n){return g.jsx("marker",{id:"erdOne",viewBox:"0 0 12 12",markerWidth:nn,markerHeight:nn,refX:"12",refY:"6",orient:"auto-start-reverse",...n,children:g.jsx("path",{d:"M10 1 L10 11",stroke:"context-stroke",strokeWidth:"2",fill:"none"})})}function mY(n){return g.jsxs("marker",{id:"erdMany",viewBox:"0 0 12 12",markerWidth:nn,markerHeight:nn,refX:"12",refY:"6",orient:"auto-start-reverse",...n,children:[g.jsx("path",{d:"M4 6 L11 1",stroke:"context-stroke",strokeWidth:"2",fill:"none"}),g.jsx("path",{d:"M4 6 L11 11",stroke:"context-stroke",strokeWidth:"2",fill:"none"}),g.jsx("path",{d:"M4 6 L11 6",stroke:"context-stroke",strokeWidth:"2",fill:"none"})]})}function gY(n){return g.jsxs("marker",{id:"erdOnlyOne",viewBox:"0 0 12 12",markerWidth:nn,markerHeight:nn,refX:"12",refY:"6",orient:"auto-start-reverse",...n,children:[g.jsx("path",{d:"M8 1 L8 11",stroke:"context-stroke",strokeWidth:"2",fill:"none"}),g.jsx("path",{d:"M10 1 L10 11",stroke:"context-stroke",strokeWidth:"2",fill:"none"})]})}function OY(n){return g.jsxs("marker",{id:"erdZeroOrOne",viewBox:"0 0 16 12",markerWidth:nn,markerHeight:nn,refX:"16",refY:"6",orient:"auto-start-reverse",...n,children:[g.jsx("circle",{cx:"8",cy:"6",r:"2.5",stroke:"context-stroke",strokeWidth:"2",fill:"white"}),g.jsx("path",{d:"M13 1 L13 11",stroke:"context-stroke",strokeWidth:"2",fill:"none"})]})}function bY(n){return g.jsxs("marker",{id:"erdOneOrMany",viewBox:"0 0 18 12",markerWidth:nn,markerHeight:nn,refX:"18",refY:"6",orient:"auto-start-reverse",...n,children:[g.jsx("path",{d:"M8 1 L8 11",stroke:"context-stroke",strokeWidth:"2",fill:"none"}),g.jsx("path",{d:"M6 6 L17 1",stroke:"context-stroke",strokeWidth:"2",fill:"none"}),g.jsx("path",{d:"M6 6 L17 11",stroke:"context-stroke",strokeWidth:"2",fill:"none"}),g.jsx("path",{d:"M6 6 L17 6",stroke:"context-stroke",strokeWidth:"2",fill:"none"})]})}function yY(n){return g.jsxs("marker",{id:"erdZeroOrMany",viewBox:"0 0 20 12",markerWidth:nn,markerHeight:nn,refX:"20",refY:"6",orient:"auto-start-reverse",...n,children:[g.jsx("circle",{cx:"8",cy:"6",r:"2.5",stroke:"context-stroke",strokeWidth:"2",fill:"white"}),g.jsx("path",{d:"M10 6 L19 1",stroke:"context-stroke",strokeWidth:"2",fill:"none"}),g.jsx("path",{d:"M10 6 L19 11",stroke:"context-stroke",strokeWidth:"2",fill:"none"}),g.jsx("path",{d:"M10 6 L19 6",stroke:"context-stroke",strokeWidth:"2",fill:"none"})]})}function xY(n){return g.jsxs("marker",{id:"erdOneToMany",viewBox:"0 0 18 12",markerWidth:nn,markerHeight:nn,refX:"18",refY:"6",orient:"auto-start-reverse",...n,children:[g.jsx("path",{d:"M7 1 L7 11",stroke:"context-stroke",strokeWidth:"2",fill:"none"}),g.jsx("path",{d:"M8.5 6 L17 1",stroke:"context-stroke",strokeWidth:"2",fill:"none"}),g.jsx("path",{d:"M8.5 6 L17 11",stroke:"context-stroke",strokeWidth:"2",fill:"none"}),g.jsx("path",{d:"M8.5 6 L17 6",stroke:"context-stroke",strokeWidth:"2",fill:"none"})]})}function SY(){return g.jsx("svg",{children:g.jsxs("defs",{children:[g.jsx(pY,{}),g.jsx(mY,{}),g.jsx(gY,{}),g.jsx(OY,{}),g.jsx(xY,{}),g.jsx(bY,{}),g.jsx(yY,{})]})})}const rd="lod-hidden",kY="lod-collapsed",vY="lod-boundary-label",dx=[.3,.5,.7],wY=.03,QY=32,$Y=.08,CY=.16,PY=16,TY=.45;function W$(n){const e=n.width??n.measured?.width,t=n.height??n.measured?.height;return!e||!t?PY:Math.min(e*$Y,t*CY)}function MY(n,e){for(let t=0;t<dx.length;t++){const r=dx[t],i=e<=t?r+wY:r;if(n<i)return t}return 1/0}function AY(n,e,t){const r=new Map(n.map(c=>[c.id,c]));function i(c){let d=0,h=c.parentId?r.get(c.parentId):void 0;for(let f=0;f<QY&&h;f++)h.type==="c4Boundary"&&d++,h=h.parentId?r.get(h.parentId):void 0;return d}const s=new Set,o=new Map,a=n.map(c=>{const d=i(c);if(d>t)return s.add(c.id),{...c,className:rd};if(c.type==="c4Boundary"&&d===t){const h=W$(c);return o.set(c.id,h),{...c,className:kY,style:{...c.style,"--lod-font-size":`${h}px`}}}return{...c,className:void 0}}),l=e.map(c=>{const d=r.get(c.source)?.type==="c4Boundary",h=r.get(c.target)?.type==="c4Boundary";if(d&&h){const f=o.get(c.source),p=o.get(c.target);return f===void 0||p===void 0?{...c,className:void 0,hidden:!0}:{...c,className:void 0,hidden:!1,data:{...c.data,labelFontSize:Math.min(f,p)*TY,lodLabelClass:vY}}}return s.has(c.source)||s.has(c.target)?{...c,className:rd,hidden:!1}:{...c,className:void 0,hidden:!1}});return{nodes:a,edges:l}}const RY=32;function EY(n,e){if(!n.some(l=>Tr(l)))return{nodes:n,edges:e};const t=new Map(n.map(l=>[l.id,l]));function r(l){let c=l.parentId?t.get(l.parentId):void 0;for(let d=0;d<RY&&c;d++){if(Tr(c))return!0;c=c.parentId?t.get(c.parentId):void 0}return!1}const i=new Set(n.filter(r).map(l=>l.id)),s=n.map(l=>i.has(l.id)?{...l,hidden:!0,selected:!1}:Tr(l)?l.className===rd?l:{...l,className:void 0,style:{...l.style,"--lod-font-size":`${W$(l)}px`}}:l);function o(l){return!l||l.hidden===!0?!1:l.className!==rd}const a=e.map(l=>{if(i.has(l.source)||i.has(l.target))return{...l,hidden:!0};const c=t.get(l.source),d=t.get(l.target);return!o(c)||!o(d)?l:Tr(c)||Tr(d)?{...l,hidden:!1}:l});return{nodes:s,edges:a}}function tm(){if(typeof window>"u")return"Control";const n=window.navigator.platform.toLowerCase();return n.includes("mac")||n.includes("iphone")||n.includes("ipad")?"Meta":"Control"}const NY=[{key:"=",isShift:!1,isCtrlOrCmd:!0,preventDefault:!0,handler({rf:n}){sO(n,iO)}},{key:"-",isShift:!1,isCtrlOrCmd:!0,preventDefault:!0,handler({rf:n}){sO(n,1/iO)}},{key:"0",isShift:!1,isCtrlOrCmd:!0,preventDefault:!0,handler({rf:n}){FP(n)}},{key:"2",isShift:!1,isCtrlOrCmd:!0,preventDefault:!0,handler({rf:n}){const e=n.getNodes().filter(t=>t.selected).map(t=>t.id);Rx(n,e)}},{key:"a",isShift:!1,isCtrlOrCmd:!0,preventDefault:!0,handler({selectAllNodes:n}){n()}},{key:"k",isShift:!1,isCtrlOrCmd:!0,preventDefault:!0,allowInInput:!0,handler({openCommandPalette:n}){n()}}];function DY(n){const t=tm()==="Meta"?n.metaKey:n.ctrlKey;return NY.find(r=>!(r.key!==n.key||"isShift"in r&&r.isShift!==n.shiftKey||"isCtrlOrCmd"in r&&r.isCtrlOrCmd!==t))??null}const jY=24;function IY(n,e){const t=new Map(n.map(a=>[a.id,a])),r=new Map;function i(a,l,c,d){const h=t.get(c),f=t.get(d);if(!h||!f)return;const p=qs(h,t),m=qs(f,t),O=Of(p,m),b={x:m.x+m.width/2,y:m.y+m.height/2},y=`${c}|${O}`,k=r.get(y),x={edgeId:a,role:l,side:O,otherCenter:b};k?k.push(x):r.set(y,[x])}for(const a of e){if(a.hidden||a.source===a.target||a.data?.handlesLocked)continue;const l=t.get(a.source),c=t.get(a.target);!l||!c||Zc(l)||Zc(c)||(i(a.id,"source",a.source,a.target),i(a.id,"target",a.target,a.source))}const s=new Map,o=new Map;for(const a of r.values()){if(a.length<2)continue;const l=a[0].side,c=[...a].sort((d,h)=>l===ge.Left||l===ge.Right?d.otherCenter.y-h.otherCenter.y:d.otherCenter.x-h.otherCenter.x);c.forEach((d,h)=>{const f=(h-(c.length-1)/2)*jY;(d.role==="source"?s:o).set(d.edgeId,f)})}return e.map(a=>{const l=s.has(a.id),c=o.has(a.id),d=a.data?.hubOffset;if(!l&&!c){if(d===void 0)return a;const{hubOffset:p,...m}=a.data??{};return{...a,data:m}}const h=s.get(a.id)??0,f=o.get(a.id)??0;return d&&d.source===h&&d.target===f?a:{...a,data:{...a.data,hubOffset:{source:h,target:f}}}})}const XY=50,LY=22;function _Y(n,e){return Math.hypot(n.x-e.x,n.y-e.y)}function hx(n){const e=Math.hypot(n.x,n.y);return e===0?{x:0,y:1}:{x:n.x/e,y:n.y/e}}function BY(n,e){const t=new Map(n.map(a=>[a.id,a])),r=[];for(const a of e){if(a.hidden||!a.label)continue;const l=t.get(a.source),c=t.get(a.target);if(!l||!c)continue;const d=qs(l,t),h=qs(c,t),f={x:d.x+d.width/2,y:d.y+d.height/2},p={x:h.x+h.width/2,y:h.y+h.height/2};r.push({edge:a,point:{x:(f.x+p.x)/2,y:(f.y+p.y)/2},dir:hx({x:p.x-f.x,y:p.y-f.y})})}const i=[],s=new Set;for(const a of r){if(s.has(a.edge.id))continue;const l=[a];s.add(a.edge.id);for(const c of r)s.has(c.edge.id)||_Y(a.point,c.point)<=XY&&(l.push(c),s.add(c.edge.id));i.push(l)}const o=new Map;for(const a of i){if(a.length<2)continue;const l=hx(a.reduce((d,h)=>({x:d.x+h.dir.x,y:d.y+h.dir.y}),{x:0,y:0})),c={x:-l.y,y:l.x};a.forEach((d,h)=>{const f=(h-(a.length-1)/2)*LY;o.set(d.edge.id,{x:c.x*f,y:c.y*f})})}return e.map(a=>{const l=o.get(a.id),c=a.data?.labelOffset;return!l&&c===void 0||l&&c&&c.x===l.x&&c.y===l.y?a:{...a,data:{...a.data,labelOffset:l}}})}function Ic(n){return Array.isArray(n.data?.childNodes)?n.data.childNodes:[]}function Xc(n,e){return{...n,data:{...n.data,childNodes:e}}}function Zd(n,e){return e.getInternalNode(n.id)?.internals.positionAbsolute??n.position}function nm(n,e){const t=Zd(n,e),r=n.measured?.width??n.width??0,i=n.measured?.height??n.height??0;return{left:t.x,top:t.y,right:t.x+r,bottom:t.y+i,area:r*i}}function ZY(n,e,t){if(!e)return n.position;const r=Zd(e,t);return{x:n.position.x+r.x,y:n.position.y+r.y}}function fx(n,e,t){const r=t.getNodes(),i=r.find(h=>h.id===e.parentId&&Rr(h)),s=ZY(e,i,t),o=e.measured?.width??e.width??0,a=e.measured?.height??e.height??0,l={x:s.x+o/2,y:s.y+a/2};let c,d=1/0;for(const h of r){if(!Rr(h)||h.id===e.id||Tr(h)||Mx(r,h.id,e.id))continue;const f=nm(h,t);l.x>=f.left&&l.x<=f.right&&l.y>=f.top&&l.y<=f.bottom&&(f.area>=d||(c=h,d=f.area))}if(c){if(e.parentId===c.id)return;const h=Zd(c,t);return t.setNodes(f=>f.map(p=>p.id===e.id?{...p,parentId:c.id,position:{x:s.x-h.x,y:s.y-h.y}}:i&&p.id===i.id?Xc(p,Ic(p).filter(m=>m!==e.id)):p.id===c.id?Xc(p,[...Ic(p).filter(m=>m!==e.id),e.id]):p))}i&&t.setNodes(h=>h.map(f=>f.id===e.id?{...f,parentId:void 0,position:s}:f.id===i.id?Xc(f,Ic(f).filter(p=>p!==e.id)):f))}function WY(n,e){if(Tr(n))return;const t=Zd(n,e),r=nm(n,e);e.setNodes(i=>{const s=i.filter(a=>{if(a.id===n.id||Rr(a)||a.parentId)return!1;const l=nm(a,e);return l.left>=r.left&&l.right<=r.right&&l.top>=r.top&&l.bottom<=r.bottom}).map(a=>a.id);if(!s.length)return i;const o=new Set(s);return i.map(a=>o.has(a.id)?{...a,parentId:n.id,position:{x:a.position.x-t.x,y:a.position.y-t.y}}:a.id===n.id?Xc(a,[...Ic(a).filter(l=>!o.has(l)),...s]):a)})}function zY(n,e){return{id:Ws(),type:"group",position:{x:n.x,y:n.y},data:{childNodes:e,backgroundColor:"rgba(20, 25, 37, 0.35)",borderColor:"#828DA3",componentFields:[{componentFieldId:"name",type:Ar.TextInput,label:"Name",isReadonly:!0,data:[{value:"Group"}]}]},style:{width:n.width+20,height:n.height+50}}}var hf,px;function VY(){if(px)return hf;px=1;var n=FC();function e(t,r){return n(t,r)}return hf=e,hf}var FY=VY();const mx=gx(FY),qY=100,YY=500;function UY({nodes:n,edges:e,setNodes:t,setEdges:r,enabled:i}){const s=$.useRef([]),o=$.useRef(-1),a=$.useRef(null),l=$.useCallback(()=>{const h=a.current;if(!h)return;a.current=null;const f=s.current,p=o.current;mx(h,f[p])||(f.splice(p+1),f.push(h),o.current=f.length-1,f.length>qY&&(f.shift(),o.current=f.length-1))},[]);$.useEffect(()=>{if(!i||n.some(m=>m.dragging))return;const h={nodes:n,edges:e},f=s.current;if(f.length===0){s.current=[h],o.current=0;return}if(mx(h,f[o.current]))return;a.current=h;const p=setTimeout(l,YY);return()=>clearTimeout(p)},[n,e,i,l]);const c=$.useCallback(()=>{if(!i)return;l();const h=o.current;if(h<=0)return;o.current=h-1;const f=s.current[h-1];t(f.nodes),r(f.edges)},[i,t,r,l]),d=$.useCallback(()=>{if(!i)return;l();const h=s.current,f=o.current;if(f>=h.length-1)return;o.current=f+1;const p=h[f+1];t(p.nodes),r(p.edges)},[i,t,r,l]);return{undo:c,redo:d}}function cG({forceAutoFitMinZoom:n,forceNoBackground:e,forceAutoFitView:t,forceReadOnly:r}){const{viewport:i,setViewport:s,showGrid:o,showMinimap:a,drawingMode:l,setDrawingMode:c,edges:d,nodes:h,setEdges:f,setNodes:p,onEdgesChange:m,onNodesChange:O,reactFLowRef:b,reactFlowInstance:y,setReactFlowInstance:k,sidebarActiveTool:x,setSidebarActiveTool:S,cursorMode:v,setIsEdgeConnecting:w,dataSources:Q,isPreviewing:P,tempDiagramState:T,setIsCommandPaletteOpen:C,setSelectedNodeIds:R,setSelectedEdgeIds:M,isC4Diagram:j}=Fr(),N=rl({reactFlowInstance:y,dataSources:Q,setIsCommandPaletteOpen:C,viewport:i,nodes:h,isPreviewing:P,setSelectedNodeIds:R,setSelectedEdgeIds:M}),I=$.useRef(null),L=$.useRef(null),te=$.useCallback(V=>{L.current=V,I.current===null&&(I.current=requestAnimationFrame(()=>{I.current=null,L.current&&s(L.current)}))},[s]);$.useEffect(()=>()=>{I.current!==null&&cancelAnimationFrame(I.current)},[]);const le=T?.versionId??null;$.useEffect(()=>{const{reactFlowInstance:V,viewport:H}=N.current;!V||!H||V.setViewport(H,{duration:Bc})},[le,N]);const _=$.useCallback(V=>f(H=>V.source&&V.target&&V.source===V.target?H:DC({...V,type:zd.Bezier,markerEnd:Ih({type:Wi.Arrow})},H)),[f]),re=$.useCallback((V,{isValid:H,fromNode:ce,fromHandle:ve,toHandle:yn})=>{if(w(!1),H||H===!1||!ce||!y)return console.warn("Invalid connection state",{isValid:H,fromNode:ce});const{clientX:tt,clientY:Dn}="changedTouches"in V?V.changedTouches[0]:V,xn=document.elementFromPoint(tt,Dn)?.closest?.(".react-flow__node");if(xn){const Un=xn.getAttribute("data-id")||void 0;if(Un&&Un!==ce.id){const vl=h.find(Wd=>Wd.id===Un);if(vl&&!Rr(vl)){const Wd=Ws();return f(z$=>[...z$,{id:Wd,source:ce.id,target:Un,sourceHandle:ve?.id,type:zd.Bezier,markerEnd:Ih({type:Wi.Arrow})}])}}}const on=Ws();p(Un=>[...Un,{id:on,type:"default",origin:[.5,0],data:{componentFields:[{componentFieldId:"name",type:Ar.TextInput,label:"Name",data:[{value:""}]}]},position:y.screenToFlowPosition({x:tt,y:Dn})}]),f(Un=>[...Un,{id:on,target:on,source:ce.id,targetHandle:yn?.id,sourceHandle:ve?.id,type:zd.Bezier,markerEnd:Ih({type:Wi.Arrow})}])},[y,f,p,h,w]),ie=$.useCallback(()=>{w(!0)},[w]),pe=$.useCallback((V,H)=>{f(ce=>ce.map(ve=>{if(ve.id!==V.id)return ve;const yn=H.source??ve.source,tt=H.target??ve.target;return yn===tt?ve:{...ve,source:yn,target:tt,sourceHandle:H.sourceHandle??ve.sourceHandle,targetHandle:H.targetHandle??ve.targetHandle}}))},[f]),Oe=$.useCallback(()=>{w(!0)},[w]),U=$.useCallback(()=>{w(!1)},[w]),de=$.useCallback(V=>{V.preventDefault(),V.dataTransfer.dropEffect="move"},[]),Ye=$.useCallback(V=>{if(!y||P)return;V.preventDefault();const H=MX(V.dataTransfer);if(!H)return od.error("Invalid node");const ce={...H,position:y.screenToFlowPosition({x:V.clientX-24,y:V.clientY-24})};if(Rr(ce))p(ve=>[ce,...ve]);else if(y.addNodes([ce]),fx(V,ce,y),ce.type==="databaseTableSQL"&&"localTable"in ce.data){console.log("Mutating database table",ce);const{dataSources:ve}=N.current,yn=y.getNodes(),tt=y.getEdges(),Dn=ce.data.localTable?.tableName,ht=ce.data.localTable?.databaseName,xn=ve.find(on=>on.name===ht)?.schemaAst;if(Dn&&ht&&xn){const on=K$.updateReactFlow({edges:tt,nodes:[...yn,ce],sourceName:ht,schema:xn,oldDataSources:ve});console.log("Updating edges",on.edges),f(on.edges)}}},[N,y,P,p,f]),ut=$.useCallback(V=>{if(!y||P||x!=="add-comment")return;const H=Ws(),ce=y.screenToFlowPosition({x:V.clientX,y:V.clientY});p(ve=>[...ve,{id:H,type:"comment",data:{message:""},position:ce}]),S(null)},[y,P,x,p,S]),bn=$.useCallback(V=>{if(!y)return;const ce={...y.screenToFlowPosition({x:V.x,y:V.y}),width:V.width/y.getZoom(),height:V.height/y.getZoom()},ve=h.filter(tt=>{if(Rr(tt)||tt.type==="comment"||tt.parentId)return!1;const Dn=tt.position.x,ht=tt.position.y,xn=ce.x+ce.width,on=ce.y+ce.height;return tt.position.x>=ce.x&&tt.position.y>=ce.y&&Dn<=xn&&ht<=on}),yn=ve.map(tt=>tt.id);if(ve.length>0){const tt=zY(ce,yn);p(Dn=>[tt,...Dn.map(ht=>yn.includes(ht.id)?{...ht,parentId:tt.id,position:{x:ht.position.x-ce.x,y:ht.position.y-ce.y}}:ht)])}c(!1)},[y,h,p,c]),gt=$.useCallback((V,H)=>{if(y)if(Rr(H))WY(H,y);else if(H.id.startsWith("message-")){const{nodes:ce,edges:ve}=UT(y.getNodes(),y.getEdges());p(ce),f(ve)}else fx(V,H,y)},[y,p,f]),[En,yr]=$.useState(1/0);$.useEffect(()=>{yr(V=>MY(i?.zoom??1,V))},[i?.zoom]);const Nn=j?En:1/0,Se=$.useMemo(()=>{const V=AY(h,d,Nn),H=EY(V.nodes,V.edges);return{nodes:H.nodes,edges:BY(H.nodes,IY(H.nodes,Yq(H.edges)))}},[h,d,Nn]),Ne=jC("Space"),dt=!l&&!r&&!P,{undo:qn,redo:Yn}=UY({nodes:h,edges:d,setNodes:p,setEdges:f,enabled:dt});return $.useEffect(()=>{function V(H){const ce=H.target,ve=ce.tagName==="INPUT"||ce.tagName==="TEXTAREA"||ce.isContentEditable,yn=H.ctrlKey||H.metaKey,tt=ve&&ce.closest(".react-flow__node")!==null&&ce.closest(".react-flow__node-comment")===null,Dn=!ve||tt;if(yn&&!H.shiftKey&&H.key==="z"&&Dn){H.preventDefault(),H.stopPropagation(),qn();return}if(yn&&(H.key==="y"||H.shiftKey&&H.key==="z")&&Dn){H.preventDefault(),H.stopPropagation(),Yn();return}const ht=DY(H),xn=N.current.reactFlowInstance;function on(Un){return{rf:Un,openCommandPalette:()=>N.current.setIsCommandPaletteOpen(!0),selectAllNodes:()=>{N.current.isPreviewing||(N.current.setSelectedNodeIds(N.current.nodes.map(vl=>vl.id)),N.current.setSelectedEdgeIds([]))}}}if(ve){ht?.allowInInput&&xn&&(ht.preventDefault&&H.preventDefault(),ht.handler(on(xn)));return}ht&&xn&&(ht.preventDefault&&H.preventDefault(),ht.handler(on(xn)))}return window.addEventListener("keydown",V,{capture:!0}),()=>{window.removeEventListener("keydown",V,{capture:!0})}},[N,qn,Yn]),g.jsxs(g.Fragment,{children:[x==="add-comment"&&g.jsx(dY,{}),P&&g.jsx("style",{children:`
|
|
270
|
+
.diagram-preview-locked .react-flow__node,
|
|
271
|
+
.diagram-preview-locked .react-flow__node *,
|
|
272
|
+
.diagram-preview-locked .react-flow__edge,
|
|
273
|
+
.diagram-preview-locked .react-flow__edge * {
|
|
274
|
+
pointer-events: none !important;
|
|
275
|
+
user-select: none !important;
|
|
276
|
+
}
|
|
277
|
+
`}),g.jsxs(IC,{ref:b,nodeTypes:Wq,edgeTypes:uY,selectionMode:YC.Partial,selectNodesOnDrag:!1,panOnDrag:v==="pan"||Ne?!0:[1,2],selectionOnDrag:v==="select"&&!Ne,panOnScroll:v==="select",noWheelClassName:"skip-wheel",nodes:Se.nodes,edges:Se.edges,onDrop:Ye,onConnect:_,onConnectEnd:re,onConnectStart:ie,onDragOver:de,onPaneClick:ut,onReconnect:pe,onReconnectStart:Oe,onReconnectEnd:U,onNodeDragStop:gt,isValidConnection:V=>!V.source||!V.target?!0:V.source!==V.target,selectionKeyCode:tm(),multiSelectionKeyCode:tm(),className:F("relative isolate opacity-0 transition-opacity duration-100",y&&"opacity-100",Nn!==1/0&&"lod-active",Ne&&"space-panning",x==="add-comment"&&"cursor-none! [&_*]:cursor-none!",P&&"diagram-preview-locked"),onNodesChange:O,onEdgesChange:m,connectionMode:qC.Strict,connectionLineStyle:{strokeWidth:3},defaultEdgeOptions:{type:"default",style:{strokeWidth:3}},defaultViewport:i??void 0,onViewportChange:te,onMoveEnd:(V,H)=>s(H),onNodeDoubleClick:(V,H)=>{if(Tr(H))return p(ve=>TP(ve,H.id));const ce=N.current.reactFlowInstance;H.type!=="c4Boundary"||!ce||Rx(ce,[H.id])},onInit:async V=>{!(V.getNodes().length===0&&V.getEdges().length===0)&&t&&await V.fitView(t?{padding:"20px",minZoom:n}:{maxZoom:.8,minZoom:.8}),s(V.getViewport()),k(V)},onPointerDown:()=>{S(V=>V==="add-comment"?V:null)},nodesDraggable:dt&&!Ne,nodesConnectable:dt&&!Ne,elementsSelectable:dt&&!Ne,edgesReconnectable:dt,minZoom:Sa,maxZoom:ka,children:[g.jsx(SY,{}),a&&g.jsx(XC,{className:"!border !border-[#2A3242] !bg-[#141925] !shadow-sm",maskColor:"rgb(11 14 22 / 0.75)",nodeColor:"#3859FF"}),!e&&o&&g.jsx(LC,{variant:_C.Dots,gap:12,size:1,color:"#2A3242"}),g.jsx(fY,{isDrawing:l&&!P,onDrawComplete:bn}),ZP.VITE_FEATURE_ENABLE_DEBUG_DIAGRAM_NODE_BOUNDS&&g.jsx(hY,{})]})]})}export{J1 as $,gc as A,DU as B,lg as C,MU as D,Ud as E,TU as F,Ih as G,Ql as H,rl as I,PU as J,RU as K,FP as L,PP as M,wl as N,tG as O,AX as P,EX as Q,cG as R,E$ as S,A$ as T,RX as U,R$ as V,mP as W,hP as X,yP as Y,iO as Z,OP as _,CU as a,AU as a0,$F as a1,nG as a2,rG as a3,QX as a4,em as a5,HU as a6,GU as a7,lG as a8,aG as a9,iG as aa,IF as ab,_F as ac,oG as ad,sG as ae,uq as af,dq as ag,QF as ah,EU as ai,ZP as aj,kX as ak,JU as b,KU as c,eG as d,qU as e,Ar as f,Ws as g,UU as h,YU as i,Mn as j,NF as k,NU as l,qP as m,Fr as n,Rx as o,CT as p,gO as q,IP as r,gr as s,Rr as t,vX as u,UT as v,jU as w,JT as x,va as y,sO as z};
|