allyhub 0.15.0 → 0.15.2
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/CHANGELOG.md +10 -0
- package/dist/node_modules/@allyhub/3d-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/audio/package.json +1 -1
- package/dist/node_modules/@allyhub/browser/package.json +1 -1
- package/dist/node_modules/@allyhub/build/package.json +1 -1
- package/dist/node_modules/@allyhub/canvas-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/canvas-model/package.json +1 -1
- package/dist/node_modules/@allyhub/chart/package.json +1 -1
- package/dist/node_modules/@allyhub/check/package.json +1 -1
- package/dist/node_modules/@allyhub/cloud/package.json +1 -1
- package/dist/node_modules/@allyhub/components/package.json +1 -1
- package/dist/node_modules/@allyhub/dev-server/dist/server.js +2 -2
- package/dist/node_modules/@allyhub/dev-server/package.json +1 -1
- package/dist/node_modules/@allyhub/diagnostics/package.json +1 -1
- package/dist/node_modules/@allyhub/doc/package.json +1 -1
- package/dist/node_modules/@allyhub/doc-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/doc-print/dist/drawn.js +4 -4
- package/dist/node_modules/@allyhub/doc-print/dist/fonts.js +3 -3
- package/dist/node_modules/@allyhub/doc-print/dist/layout.js +4 -4
- package/dist/node_modules/@allyhub/doc-print/dist/pdf.js +4 -4
- package/dist/node_modules/@allyhub/doc-print/package.json +1 -1
- package/dist/node_modules/@allyhub/export/package.json +1 -1
- package/dist/node_modules/@allyhub/extension-api/package.json +1 -1
- package/dist/node_modules/@allyhub/extension-host/package.json +1 -1
- package/dist/node_modules/@allyhub/formats/package.json +1 -1
- package/dist/node_modules/@allyhub/i18n/package.json +1 -1
- package/dist/node_modules/@allyhub/image-draw/package.json +1 -1
- package/dist/node_modules/@allyhub/image-extension/dist/cli.js +1 -1
- package/dist/node_modules/@allyhub/image-extension/dist/export.js +2 -2
- package/dist/node_modules/@allyhub/image-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/image-measure/package.json +1 -1
- package/dist/node_modules/@allyhub/image-psd/dist/ag-psd.js +2 -0
- package/dist/node_modules/@allyhub/image-psd/dist/read.js +12 -12
- package/dist/node_modules/@allyhub/image-psd/dist/write.js +1 -1
- package/dist/node_modules/@allyhub/image-psd/package.json +1 -1
- package/dist/node_modules/@allyhub/image-render/dist/pdf.js +1 -1
- package/dist/node_modules/@allyhub/image-render/package.json +1 -1
- package/dist/node_modules/@allyhub/image-runtime/package.json +1 -1
- package/dist/node_modules/@allyhub/image-sdk/package.json +1 -1
- package/dist/node_modules/@allyhub/jobs/package.json +1 -1
- package/dist/node_modules/@allyhub/linkedin-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/linkedin-model/package.json +1 -1
- package/dist/node_modules/@allyhub/linkedin-view/dist/index.js +2 -1
- package/dist/node_modules/@allyhub/linkedin-view/dist/stage.js +65 -1
- package/dist/node_modules/@allyhub/linkedin-view/package.json +1 -1
- package/dist/node_modules/@allyhub/measure/package.json +1 -1
- package/dist/node_modules/@allyhub/media/package.json +1 -1
- package/dist/node_modules/@allyhub/media-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/model/package.json +1 -1
- package/dist/node_modules/@allyhub/ooxml/package.json +1 -1
- package/dist/node_modules/@allyhub/piece/package.json +1 -1
- package/dist/node_modules/@allyhub/project/package.json +1 -1
- package/dist/node_modules/@allyhub/protocol/package.json +1 -1
- package/dist/node_modules/@allyhub/registry/package.json +1 -1
- package/dist/node_modules/@allyhub/render/dist/exports.js +2 -2
- package/dist/node_modules/@allyhub/render/package.json +1 -1
- package/dist/node_modules/@allyhub/runtime/package.json +1 -1
- package/dist/node_modules/@allyhub/runtimes/dist/index.d.ts +1 -1
- package/dist/node_modules/@allyhub/runtimes/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/runtimes/dist/packages.d.ts +17 -0
- package/dist/node_modules/@allyhub/runtimes/dist/packages.js +3 -3
- package/dist/node_modules/@allyhub/runtimes/package.json +1 -1
- package/dist/node_modules/@allyhub/runtimes/pins/ag-psd/package-lock.json +49 -0
- package/dist/node_modules/@allyhub/runtimes/pins/ag-psd/package.json +7 -0
- package/dist/node_modules/@allyhub/runtimes/pins/fontsource-caladea/package-lock.json +24 -0
- package/dist/node_modules/@allyhub/runtimes/pins/fontsource-caladea/package.json +23 -0
- package/dist/node_modules/@allyhub/runtimes/pins/fontsource-carlito/package-lock.json +24 -0
- package/dist/node_modules/@allyhub/runtimes/pins/fontsource-carlito/package.json +23 -0
- package/dist/node_modules/@allyhub/runtimes/pins/fontsource-cousine/package-lock.json +24 -0
- package/dist/node_modules/@allyhub/runtimes/pins/fontsource-cousine/package.json +23 -0
- package/dist/node_modules/@allyhub/runtimes/pins/fontsource-lxgw-wenkai/package-lock.json +24 -0
- package/dist/node_modules/@allyhub/runtimes/pins/fontsource-lxgw-wenkai/package.json +19 -0
- package/dist/node_modules/@allyhub/runtimes/pins/fontsource-noto-color-emoji/package-lock.json +24 -0
- package/dist/node_modules/@allyhub/runtimes/pins/fontsource-noto-color-emoji/package.json +17 -0
- package/dist/node_modules/@allyhub/runtimes/pins/fontsource-noto-sans-sc/package-lock.json +24 -0
- package/dist/node_modules/@allyhub/runtimes/pins/fontsource-noto-sans-sc/package.json +19 -0
- package/dist/node_modules/@allyhub/runtimes/pins/fontsource-noto-serif-sc/package-lock.json +24 -0
- package/dist/node_modules/@allyhub/runtimes/pins/fontsource-noto-serif-sc/package.json +19 -0
- package/dist/node_modules/@allyhub/runtimes/pins/fontsource-tinos/package-lock.json +24 -0
- package/dist/node_modules/@allyhub/runtimes/pins/fontsource-tinos/package.json +23 -0
- package/dist/node_modules/@allyhub/runtimes/pins/mermaid/package-lock.json +19 -0
- package/dist/node_modules/@allyhub/runtimes/pins/mermaid/package.json +15 -0
- package/dist/node_modules/@allyhub/runtimes/pins/pdf-lib/package-lock.json +55 -0
- package/dist/node_modules/@allyhub/runtimes/pins/pdf-lib/package.json +7 -0
- package/dist/node_modules/@allyhub/runtimes/pins/pptxgenjs/package-lock.json +169 -0
- package/dist/node_modules/@allyhub/runtimes/pins/pptxgenjs/package.json +7 -0
- package/dist/node_modules/@allyhub/scaffold/package.json +1 -1
- package/dist/node_modules/@allyhub/scenery/package.json +1 -1
- package/dist/node_modules/@allyhub/scenery-host/package.json +1 -1
- package/dist/node_modules/@allyhub/sheet/package.json +1 -1
- package/dist/node_modules/@allyhub/sheet-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/slides-core/package.json +1 -1
- package/dist/node_modules/@allyhub/slides-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/slides-pptx/dist/read/chart.js +2 -2
- package/dist/node_modules/@allyhub/slides-pptx/package.json +1 -1
- package/dist/node_modules/@allyhub/slides-runtime/package.json +1 -1
- package/dist/node_modules/@allyhub/stage/package.json +1 -1
- package/dist/node_modules/@allyhub/stage-page/package.json +1 -1
- package/dist/node_modules/@allyhub/stage-runtime/package.json +1 -1
- package/dist/node_modules/@allyhub/telemetry/package.json +1 -1
- package/dist/node_modules/@allyhub/text-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/video-core/package.json +1 -1
- package/dist/node_modules/@allyhub/video-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/video-measure/package.json +1 -1
- package/dist/node_modules/@allyhub/video-sdk/package.json +1 -1
- package/dist/node_modules/@allyhub/website/package.json +1 -1
- package/dist/node_modules/@allyhub/website-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/x-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/x-model/package.json +1 -1
- package/dist/node_modules/@allyhub/x-view/dist/index.js +262 -1
- package/dist/node_modules/@allyhub/x-view/dist/stage.js +325 -1
- package/dist/node_modules/@allyhub/x-view/package.json +1 -1
- package/dist/package.json +12 -12
- package/editor-web/assets/{abnfDiagram-WEYOIA3C-BHI0AbUY.js → abnfDiagram-WEYOIA3C-9z0ZEYUq.js} +1 -1
- package/editor-web/assets/{architecture-WOLXFQ4H-BMQS-OKZ.js → architecture-WOLXFQ4H-ELMO_PA6.js} +1 -1
- package/editor-web/assets/{architectureDiagram-ZHVYKT53-DZp9CM6P.js → architectureDiagram-ZHVYKT53-C0yuCWU3.js} +1 -1
- package/editor-web/assets/article-DHFgHYjv.js +3 -0
- package/editor-web/assets/article-Dt9id9Y9.js +7 -0
- package/editor-web/assets/{blockDiagram-RJAE7QA3-h6LWaev4.js → blockDiagram-RJAE7QA3-vi6JOg4o.js} +1 -1
- package/editor-web/assets/{c4Diagram-XDPPPE54-BvSMs7J4.js → c4Diagram-XDPPPE54-Agf_H8uS.js} +1 -1
- package/editor-web/assets/channel-Dkg198L0.js +1 -0
- package/editor-web/assets/{chunk-2E7WHVMD-0EJTAmDF.js → chunk-2E7WHVMD-XalaZaha.js} +1 -1
- package/editor-web/assets/{chunk-4EMNKR2T-BeYB4AEY.js → chunk-4EMNKR2T-DUlRZkCS.js} +1 -1
- package/editor-web/assets/{chunk-55XCU76K-BPFOPTBe.js → chunk-55XCU76K-DTa7whGr.js} +1 -1
- package/editor-web/assets/{chunk-7S6XSTFO-CZ2C7ULu.js → chunk-7S6XSTFO-85zCPzj0.js} +1 -1
- package/editor-web/assets/{chunk-AQDTSKZB-B5RtsZkj.js → chunk-AQDTSKZB-CWBseIyh.js} +1 -1
- package/editor-web/assets/{chunk-DSNLSHJZ-_3G4hddj.js → chunk-DSNLSHJZ-BFnyvrWg.js} +1 -1
- package/editor-web/assets/{chunk-HAGFOTED-DO5b4ll2.js → chunk-HAGFOTED-DFWda2Rk.js} +1 -1
- package/editor-web/assets/{chunk-HNE4Q36P-C6XNI71Q.js → chunk-HNE4Q36P-aXibFitC.js} +1 -1
- package/editor-web/assets/{chunk-NQOKRVIF-nDCX29rQ.js → chunk-NQOKRVIF-CtJUuFdN.js} +1 -1
- package/editor-web/assets/{chunk-UHW7PFBP-CRCOiitq.js → chunk-UHW7PFBP-B6QKSKWE.js} +1 -1
- package/editor-web/assets/{chunk-VQ5W62QI-hNPKKjCN.js → chunk-VQ5W62QI-CF6Al55P.js} +1 -1
- package/editor-web/assets/{chunk-WQQL4CDK-KlnVtIDc.js → chunk-WQQL4CDK-w2TKLkyw.js} +1 -1
- package/editor-web/assets/{chunk-YZO67HFG-B76hDUrM.js → chunk-YZO67HFG-DVGOATM3.js} +1 -1
- package/editor-web/assets/{chunk-ZAUX2LTX-D9m1N0wI.js → chunk-ZAUX2LTX-Cq7MMjDP.js} +1 -1
- package/editor-web/assets/{chunk-ZCHMQSOR-443euxzo.js → chunk-ZCHMQSOR-GMW_lBh4.js} +1 -1
- package/editor-web/assets/{classDiagram-v2-4MYWR3UA-Bbw-8Ons.js → classDiagram-v2-4MYWR3UA-C7AK5Bkj.js} +1 -1
- package/editor-web/assets/code-BID_OoRp.js +1 -0
- package/editor-web/assets/{cynefin-EF2NZ3EQ-C4E7TlUr.js → cynefin-EF2NZ3EQ-ZnDieQsN.js} +1 -1
- package/editor-web/assets/{cynefinDiagram-WF24UDRP-PBPGa_HS.js → cynefinDiagram-WF24UDRP-BrukKIBF.js} +1 -1
- package/editor-web/assets/{dagre-NK4GIZVX-DwXdEtQG.js → dagre-NK4GIZVX-DfO0S2p_.js} +1 -1
- package/editor-web/assets/{diagram-CBK3MWTC-BE3FwdX7.js → diagram-CBK3MWTC-D43RLesi.js} +1 -1
- package/editor-web/assets/{diagram-I5XIIV2D-BPl2ZY33.js → diagram-I5XIIV2D-bA1B1QQG.js} +1 -1
- package/editor-web/assets/{diagram-ODIL2UCW-BLVPYSzw.js → diagram-ODIL2UCW-DAdXBD2K.js} +1 -1
- package/editor-web/assets/{diagram-PFBEJUXE-BVZk62FO.js → diagram-PFBEJUXE-C_KyEaws.js} +1 -1
- package/editor-web/assets/{diagram-RJA3I4VV-Z75LSbxH.js → diagram-RJA3I4VV-oXTtENF7.js} +1 -1
- package/editor-web/assets/{diagram-TYUNFSNR-BynGqDAg.js → diagram-TYUNFSNR-Czupe6mO.js} +1 -1
- package/editor-web/assets/dist-2lNSE-G_.js +82 -0
- package/editor-web/assets/{dist-D_xVYGnk.js → dist-5HNrQ9AU.js} +3 -3
- package/editor-web/assets/dist-BPecIPz6.js +530 -0
- package/editor-web/assets/dist-BXJKASX4.js +24 -0
- package/editor-web/assets/{dist-CIQUbiAd.js → dist-BeDRTqQ8.js} +11 -11
- package/editor-web/assets/{dist-CxlIyluY.js → dist-BlL-4sl3.js} +1 -1
- package/editor-web/assets/dist-BtRMClDw.js +40 -0
- package/editor-web/assets/{dist-Ch34PllS.js → dist-BuqBg8k8.js} +1 -1
- package/editor-web/assets/{dist-cUeSwqws.js → dist-BwW08gSh.js} +1 -1
- package/editor-web/assets/{dist-VP4ECMOk.js → dist-C30Thvb3.js} +1 -1
- package/editor-web/assets/dist-Cj5AmpVb.js +5 -0
- package/editor-web/assets/dist-CjjnDOa8.js +3 -0
- package/editor-web/assets/dist-D7ur8721.js +6 -0
- package/editor-web/assets/{dist-Nc_h0Jye.js → dist-DOHhp09C.js} +1 -1
- package/editor-web/assets/{dist-UG2TIZxP.js → dist-LhFEYZza.js} +1 -1
- package/editor-web/assets/{ebnfDiagram-V4P3TTPT-SwhqbeK4.js → ebnfDiagram-V4P3TTPT-BOhNZmtp.js} +1 -1
- package/editor-web/assets/{elk-QONTBCTQ-Bb1GSt2Z.js → elk-QONTBCTQ-DoZH3OoE.js} +1 -1
- package/editor-web/assets/{erDiagram-KYQIGQAA-qUy0NDKn.js → erDiagram-KYQIGQAA-Bv0KDJi4.js} +1 -1
- package/editor-web/assets/{eventmodeling-K75KTNOO-BYBYso_j.js → eventmodeling-K75KTNOO-C-_xzqfj.js} +1 -1
- package/editor-web/assets/flowDiagram-IUGLLWBU-C7ZmHJZW.js +1 -0
- package/editor-web/assets/{ganttDiagram-R7GPNTJY-Cw-BkZT8.js → ganttDiagram-R7GPNTJY-CAuJlaZX.js} +1 -1
- package/editor-web/assets/{gitGraph-VSP46ZUC-CTXzWPq_.js → gitGraph-VSP46ZUC-Dx2xLi5C.js} +1 -1
- package/editor-web/assets/{gitGraphDiagram-PDYL7XHY-Jd9HU3WA.js → gitGraphDiagram-PDYL7XHY-DHsk_UOT.js} +1 -1
- package/editor-web/assets/{index-CglHrLRS.js → index-BGAXezRR.js} +2 -2
- package/editor-web/assets/{info-OHQRW6UA-C4oj5BpF.js → info-OHQRW6UA-CnKQHx5m.js} +1 -1
- package/editor-web/assets/{infoDiagram-MVDRKAX5-D09aYJ28.js → infoDiagram-MVDRKAX5-ibAVFw_2.js} +1 -1
- package/editor-web/assets/{ishikawaDiagram-HPEHV2GE-BEdXoXb2.js → ishikawaDiagram-HPEHV2GE-C1OCHt3y.js} +1 -1
- package/editor-web/assets/{journeyDiagram-BOSHW7O7-DE-_0aww.js → journeyDiagram-BOSHW7O7-BDdqMOM1.js} +1 -1
- package/editor-web/assets/{kanban-definition-FNSA4HC5-Cn3_bvPS.js → kanban-definition-FNSA4HC5-CSAS_zGn.js} +1 -1
- package/editor-web/assets/lib-KOEbW83T.js +3 -0
- package/editor-web/assets/{mermaid-parser.core-BK52JMZH.js → mermaid-parser.core-DTLyYXbn.js} +3 -3
- package/editor-web/assets/{mermaid.core-CmfBU89G.js → mermaid.core-B8478wZ1.js} +4 -4
- package/editor-web/assets/{mindmap-definition-6OY57UG3-CtUhkv9I.js → mindmap-definition-6OY57UG3-DSWHcglH.js} +1 -1
- package/editor-web/assets/{packet-JDAUHWVQ-C7nciBNp.js → packet-JDAUHWVQ-_k1BF29s.js} +1 -1
- package/editor-web/assets/{pegDiagram-ECIUJNBX-DUkbAcTs.js → pegDiagram-ECIUJNBX-B22YyWAa.js} +1 -1
- package/editor-web/assets/{pie-XZMESJXO-BIGyKhav.js → pie-XZMESJXO-CSwV32hj.js} +1 -1
- package/editor-web/assets/{pieDiagram-GNMPY74T-DrYj-JeG.js → pieDiagram-GNMPY74T-rSFNeWnq.js} +1 -1
- package/editor-web/assets/{props-form-DrZYDmSM.js → props-form-B6mYjTgZ.js} +1 -1
- package/editor-web/assets/{quadrantDiagram-D57K4MC3-qkBoh1ep.js → quadrantDiagram-D57K4MC3-Xrntfg4j.js} +1 -1
- package/editor-web/assets/{radar-ABXABTNO-BkJmvR6a.js → radar-ABXABTNO-Dwq5qiNw.js} +1 -1
- package/editor-web/assets/{railroad-I3PHUGI6-BFH-ip4B.js → railroad-I3PHUGI6-sIUGWcZh.js} +1 -1
- package/editor-web/assets/{railroad-abnf-LNEFI6M7-BBlzHL6Z.js → railroad-abnf-LNEFI6M7-1rWlT9BX.js} +1 -1
- package/editor-web/assets/{railroad-ebnf-DWYD2UWJ-CCVsG0ui.js → railroad-ebnf-DWYD2UWJ-DWdkzEHc.js} +1 -1
- package/editor-web/assets/{railroad-peg-JR7BVNR7-Puo7BFPl.js → railroad-peg-JR7BVNR7-CME0JBbV.js} +1 -1
- package/editor-web/assets/{railroadDiagram-Y72NRBL7-DCwfkv35.js → railroadDiagram-Y72NRBL7-Ch4BpP22.js} +1 -1
- package/editor-web/assets/{requirementDiagram-EQYSW5RA-DSTcDj32.js → requirementDiagram-EQYSW5RA-CgE-x3wN.js} +1 -1
- package/editor-web/assets/{sankeyDiagram-SY24JHO5-Kqq4fCvG.js → sankeyDiagram-SY24JHO5-DBf4G6n3.js} +1 -1
- package/editor-web/assets/{sequenceDiagram-BLEHNHQU-B1uodEgL.js → sequenceDiagram-BLEHNHQU-Bz07CoUS.js} +1 -1
- package/editor-web/assets/{split-Cu0fidVK.js → split-mDSkdQkd.js} +1 -1
- package/editor-web/assets/{stateDiagram-v2-A6IESKWZ-B6gG3vUm.js → stateDiagram-v2-A6IESKWZ-DuqAmDPP.js} +1 -1
- package/editor-web/assets/{swimlanes-B3ENRKFQ-CZayRtvU.js → swimlanes-B3ENRKFQ-C7sOL6rB.js} +1 -1
- package/editor-web/assets/swimlanesDiagram-AYQRV4AK-CQ2aWYP-.js +8 -0
- package/editor-web/assets/syntax-BIEjjMZL.js +27 -0
- package/editor-web/assets/{tabs-B_K0Db1I.js → tabs-C0AHyuE5.js} +1 -1
- package/editor-web/assets/{timeline-definition-JXYKGLGB-5YoY8Xhw.js → timeline-definition-JXYKGLGB-CaLYz9mc.js} +1 -1
- package/editor-web/assets/{treeView-D4JQ5SDB-Brd_NUPx.js → treeView-D4JQ5SDB-D1P1Kyxc.js} +1 -1
- package/editor-web/assets/{treemap-SAJKECNS-DmfdnlWl.js → treemap-SAJKECNS-2YaFL53t.js} +1 -1
- package/editor-web/assets/{usecaseDiagram-WPOLBNNX-lcAkMviI.js → usecaseDiagram-WPOLBNNX-uYdbUhUS.js} +1 -1
- package/editor-web/assets/{vennDiagram-Q3Y3IDCW-DY_n48hQ.js → vennDiagram-Q3Y3IDCW-DHepmX4t.js} +1 -1
- package/editor-web/assets/{video-Bv3rETBU.js → video-Xl-OaXRc.js} +1 -1
- package/editor-web/assets/{wardley-7MLQ67FV-DzIFSBQz.js → wardley-7MLQ67FV-Dx0MOPV1.js} +1 -1
- package/editor-web/assets/{wardleyDiagram-IVAIDKWA-CsXNajIg.js → wardleyDiagram-IVAIDKWA-BX8ElwDW.js} +1 -1
- package/editor-web/assets/words-B2FXYyeZ.js +263 -0
- package/editor-web/assets/words-DFIhHhHF.js +3 -0
- package/editor-web/assets/{xychartDiagram-4URNHDU4-DDpGFEum.js → xychartDiagram-4URNHDU4-DoWQRJUS.js} +1 -1
- package/editor-web/index.html +1 -1
- package/package.json +2 -19
- package/editor-web/assets/article-C_mBG5a1.js +0 -8
- package/editor-web/assets/article-DWBxNvX0.js +0 -7
- package/editor-web/assets/bookmark-Dfji3syX.js +0 -1
- package/editor-web/assets/channel-BFHB0S0f.js +0 -1
- package/editor-web/assets/dist--ijXGgvi.js +0 -5
- package/editor-web/assets/dist-C-yi9AAi.js +0 -274
- package/editor-web/assets/dist-D9N4Fxqr.js +0 -84
- package/editor-web/assets/dist-DWKEqAou.js +0 -6
- package/editor-web/assets/dist-DX0VLTRV.js +0 -3
- package/editor-web/assets/dist-xpAaABxb.js +0 -24
- package/editor-web/assets/flowDiagram-IUGLLWBU-BSCBBtP3.js +0 -1
- package/editor-web/assets/katex-UWCZofcd.js +0 -257
- package/editor-web/assets/play-DvMyq5xW.js +0 -1
- package/editor-web/assets/repeat-2-DfPmKp4w.js +0 -1
- package/editor-web/assets/swimlanesDiagram-AYQRV4AK-B9tLTrym.js +0 -8
- package/editor-web/assets/syntax-PERQ2szW.js +0 -66
- package/editor-web/assets/words-BTRrBFUo.js +0 -2
- package/editor-web/assets/words-ll_94CD2.js +0 -3
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import{i as e,t}from"./rolldown-runtime-COiEfhsA.js";import{v as n}from"./react-Bk7NnOLX.js";import{At as r}from"./button-BVQH7zxz.js";import{t as i}from"./jsx-runtime-DePvh3-m.js";import{t as a}from"./createLucideIcon-REX213UO.js";import{C as o,E as s,S as c,T as l,_ as u,b as d,d as f,f as p,g as m,h,l as g,m as _,o as v,p as y,s as b,t as ee,u as te,v as ne,w as re,x as ie,y as x}from"./dist-BrGYx10E.js";import{I as ae,P as S,_ as oe}from"./syntax-C0iPON60.js";import{D as se,E as C,O as ce,S as le,T as ue,_ as de,a as fe,b as pe,c as w,d as T,g as me,h as he,i as ge,k as E,l as D,m as _e,n as O,o as k,p as ve,r as ye,s as A,t as be,v as xe,w as Se,x as Ce}from"./dist-YW8hS4IM.js";var we=a(`quote`,[[`path`,{d:`M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z`,key:`rib7q0`}],[`path`,{d:`M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z`,key:`1ymkrd`}]]),Te=e(t(((e,t)=>{(function(){var e=t===void 0?function(){return this||(0,eval)(`this`)}():t.exports=i;e.format=i,e.vsprintf=r,typeof console<`u`&&typeof console.log==`function`&&(e.printf=n);function n(){console.log(i.apply(null,arguments))}function r(e,t){return i.apply(null,[e].concat(t))}function i(e){for(var t=1,n=[].slice.call(arguments),r=0,i=e.length,a=``,o,s=!1,c,l,u=!1,d,f=function(){return n[t++]},p=function(){for(var t=``;/\d/.test(e[r]);)t+=e[r++],o=e[r];return t.length>0?parseInt(t):null};r<i;++r)if(o=e[r],s)switch(s=!1,o==`.`?(u=!1,o=e[++r]):o==`0`&&e[r+1]==`.`?(u=!0,r+=2,o=e[r]):u=!0,d=p(),o){case`b`:a+=parseInt(f(),10).toString(2);break;case`c`:c=f(),typeof c==`string`||c instanceof String?a+=c:a+=String.fromCharCode(parseInt(c,10));break;case`d`:a+=parseInt(f(),10);break;case`f`:l=String(parseFloat(f()).toFixed(d||6)),a+=u?l:l.replace(/^0/,``);break;case`j`:a+=JSON.stringify(f());break;case`o`:a+=`0`+parseInt(f(),10).toString(8);break;case`s`:a+=f();break;case`x`:a+=`0x`+parseInt(f(),10).toString(16);break;case`X`:a+=`0x`+parseInt(f(),10).toString(16).toUpperCase();break;default:a+=o}else o===`%`?s=!0:a+=o;return a}})()}))(),1),Ee=Object.assign(j(Error),{eval:j(EvalError),range:j(RangeError),reference:j(ReferenceError),syntax:j(SyntaxError),type:j(TypeError),uri:j(URIError)});function j(e){return t.displayName=e.displayName||e.name,t;function t(t,...n){return new e(t&&(0,Te.default)(t,...n))}}var De={}.hasOwnProperty,Oe={yaml:`-`,toml:`+`};function ke(e){let t=[],n=-1,r=Array.isArray(e)?e:e?[e]:[`yaml`];for(;++n<r.length;)t[n]=Ae(r[n]);return t}function Ae(e){let t=e;if(typeof t==`string`){if(!De.call(Oe,t))throw Ee("Missing matter definition for `%s`",t);t={type:t,marker:Oe[t]}}else if(typeof t!=`object`)throw Ee("Expected matter to be an object, not `%j`",t);if(!De.call(t,`type`))throw Ee("Missing `type` in matter `%j`",t);if(!De.call(t,`fence`)&&!De.call(t,`marker`))throw Ee("Missing `marker` or `fence` in matter `%j`",t);return t}function je(e){let t=ke(e),n={},r=-1;for(;++r<t.length;){let e=t[r],i=Ne(e,`open`).charCodeAt(0),a=Me(e),o=n[i];Array.isArray(o)?o.push(a):n[i]=[a]}return{flow:n}}function Me(e){let t=e.anywhere,n=e.type,r=n+`Fence`,i=r+`Sequence`,a=n+`Value`,o={tokenize:u,partial:!0},s,c=0;return{tokenize:l,concrete:!0};function l(l,u,d){let f=this;return p;function p(a){let o=f.now();return o.column===1&&(o.line===1||t)&&(s=Ne(e,`open`),c=0,a===s.charCodeAt(c))?(l.enter(n),l.enter(r),l.enter(i),m(a)):d(a)}function m(e){return c===s.length?(l.exit(i),ae(e)?(l.enter(`whitespace`),h(e)):g(e)):e===s.charCodeAt(c++)?(l.consume(e),m):d(e)}function h(e){return ae(e)?(l.consume(e),h):(l.exit(`whitespace`),g(e))}function g(t){return S(t)?(l.exit(r),l.enter(`lineEnding`),l.consume(t),l.exit(`lineEnding`),s=Ne(e,`close`),c=0,l.attempt(o,b,_)):d(t)}function _(e){return e===null||S(e)?y(e):(l.enter(a),v(e))}function v(e){return e===null||S(e)?(l.exit(a),y(e)):(l.consume(e),v)}function y(e){return e===null?d(e):(l.enter(`lineEnding`),l.consume(e),l.exit(`lineEnding`),l.attempt(o,b,_))}function b(e){return l.exit(n),u(e)}}function u(e,t,n){let a=0;return o;function o(t){return t===s.charCodeAt(a)?(e.enter(r),e.enter(i),c(t)):n(t)}function c(t){return a===s.length?(e.exit(i),ae(t)?(e.enter(`whitespace`),l(t)):u(t)):t===s.charCodeAt(a++)?(e.consume(t),c):n(t)}function l(t){return ae(t)?(e.consume(t),l):(e.exit(`whitespace`),u(t))}function u(i){return i===null||S(i)?(e.exit(r),t(i)):n(i)}}}function Ne(e,t){return e.marker?Pe(e.marker,t).repeat(3):Pe(e.fence,t)}function Pe(e,t){return typeof e==`string`?e:e[t]}function Fe(e){let t=ke(e),n={},r={},i=-1;for(;++i<t.length;){let e=t[i];n[e.type]=Ie(e),r[e.type]=Le,r[e.type+`Value`]=Re}return{enter:n,exit:r}}function Ie(e){return t;function t(t){this.enter({type:e.type,value:``},t),this.buffer()}}function Le(e){let t=this.resume(),n=this.stack[this.stack.length-1];`value`in n,this.exit(e),n.value=t.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``)}function Re(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}function ze(e){let t=[],n={},r=ke(e),i=-1;for(;++i<r.length;){let e=r[i];n[e.type]=Be(e);let a=Ve(e,`open`);t.push({atBreak:!0,character:a.charAt(0),after:oe(a.charAt(1))})}return{unsafe:t,handlers:n}}function Be(e){let t=Ve(e,`open`),n=Ve(e,`close`);return r;function r(e){return t+(e.value?`
|
|
2
|
-
`+e.value:``)+`
|
|
3
|
-
`+n}}function Ve(e,t){return e.marker?He(e.marker,t).repeat(3):He(e.fence,t)}function He(e,t){return typeof e==`string`?e:e[t]}var Ue=Object.defineProperty,We=(e,t)=>{let n={};for(var r in e)Ue(n,r,{get:e[r],enumerable:!0});return t||Ue(n,Symbol.toStringTag,{value:`Module`}),n};function Ge(e,t=null){return function(n,r){let{$from:i,$to:a}=n.selection,o=i.blockRange(a);if(!o)return!1;let s=r?n.tr:null;return Ke(s,o,e,t)?(r&&r(s.scrollIntoView()),!0):!1}}function Ke(e,t,n,r=null){let i=!1,a=t,o=t.$from.doc;if(t.depth>=2&&t.$from.node(t.depth-1).type.compatibleContent(n)&&t.startIndex==0){if(t.$from.index(t.depth-1)==0)return!1;let e=o.resolve(t.start-2);a=new se(e,e,t.depth),t.endIndex<t.parent.childCount&&(t=new se(t.$from,o.resolve(t.$to.end(t.depth)),t.depth)),i=!0}let s=pe(a,n,r,t);return s?(e&&qe(e,t,s,i,n),!0):!1}function qe(e,t,n,r,i){let a=C.empty;for(let e=n.length-1;e>=0;e--)a=C.from(n[e].type.create(n[e].attrs,a));e.step(new _e(t.start-(r?2:0),t.end,t.start,t.end,new E(a,0,0),n.length,!0));let o=0;for(let e=0;e<n.length;e++)n[e].type==i&&(o=e+1);let s=n.length-o,c=t.start+n.length-(r?2:0),l=t.parent;for(let n=t.startIndex,r=t.endIndex,i=!0;n<r;n++,i=!1)!i&&xe(e.doc,c,s)&&(e.split(c,s),c+=2*s),c+=l.child(n).nodeSize;return e}function Je(e){return function(t,n){let{$from:r,$to:i}=t.selection,a=r.blockRange(i,t=>t.childCount>0&&t.firstChild.type==e);return a?n?r.node(a.depth-1).type==e?Ye(t,n,e,a):Xe(t,n,a):!0:!1}}function Ye(e,t,n,r){let i=e.tr,a=r.end,o=r.$to.end(r.depth);a<o&&(i.step(new _e(a-1,o,a,o,new E(C.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new se(i.doc.resolve(r.$from.pos),i.doc.resolve(o),r.depth));let s=le(r);if(s==null)return!1;i.lift(r,s);let c=i.doc.resolve(i.mapping.map(a,-1)-1);return de(i.doc,c.pos)&&c.nodeBefore.type==c.nodeAfter.type&&i.join(c.pos),t(i.scrollIntoView()),!0}function Xe(e,t,n){let r=e.tr,i=n.parent;for(let e=n.end,t=n.endIndex-1,a=n.startIndex;t>a;t--)e-=i.child(t).nodeSize,r.delete(e-1,e+1);let a=r.doc.resolve(n.start),o=a.nodeAfter;if(r.mapping.map(n.end)!=n.start+a.nodeAfter.nodeSize)return!1;let s=n.startIndex==0,c=n.endIndex==i.childCount,l=a.node(-1),u=a.index(-1);if(!l.canReplace(u+ +!s,u+1,o.content.append(c?C.empty:C.from(i))))return!1;let d=a.pos,f=d+o.nodeSize;return r.step(new _e(d-+!!s,f+ +!!c,d+1,f-1,new E((s?C.empty:C.from(i.copy(C.empty))).append(c?C.empty:C.from(i.copy(C.empty))),+!s,+!c),+!s)),t(r.scrollIntoView()),!0}function Ze(e){return function(t,n){let{$from:r,$to:i}=t.selection,a=r.blockRange(i,t=>t.childCount>0&&t.firstChild.type==e);if(!a)return!1;let o=a.startIndex;if(o==0)return!1;let s=a.parent,c=s.child(o-1);if(c.type!=e)return!1;if(n){let r=c.lastChild&&c.lastChild.type==s.type,i=C.from(r?e.create():null),o=new E(C.from(e.create(null,C.from(s.type.create(null,i)))),r?3:1,0),l=a.start,u=a.end;n(t.tr.step(new _e(l-(r?3:1),u,l,u,o,1,!0)).scrollIntoView())}return!0}}function Qe(e){let{state:t,transaction:n}=e,{selection:r}=n,{doc:i}=n,{storedMarks:a}=n;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return a},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,a=n.storedMarks,n}}}var M=class e{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(){let{rawCommands:e,editor:t,state:n}=this,{view:r}=t,{tr:i}=n,a=this.buildProps(i);return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,(...e)=>{let n=t(...e)(a);return!i.getMeta(`preventDispatch`)&&!this.hasCustomState&&r.dispatch(i),n}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){let{rawCommands:n,editor:r,state:i}=this,{view:a}=r,o=[],s=!!e,c=e||i.tr,l=()=>(!s&&t&&!c.getMeta(`preventDispatch`)&&!this.hasCustomState&&a.dispatch(c),o.every(e=>e===!0)),u={...Object.fromEntries(Object.entries(n).map(([e,n])=>[e,(...e)=>{let r=this.buildProps(c,t),i=n(...e)(r);return o.push(i),u}])),run:l};return u}static createFakeChain(){let e=new Proxy({},{get:(t,n)=>{if(n!==`then`)return n===`run`?()=>!1:()=>e}});return e}createCan(e){let{rawCommands:t,state:n}=this,r=e||n.tr,i=this.buildProps(r,!1);return{...Object.fromEntries(Object.entries(t).map(([e,t])=>[e,(...e)=>t(...e)({...i,dispatch:void 0})])),chain:()=>this.createChain(r,!1)}}static createFallbackCan(){let t=e.createFakeChain();return new Proxy({chain:()=>t},{get:(e,t)=>{if(t!==`then`)return t===`chain`?e.chain:()=>!1}})}buildProps(e,t=!0){let{rawCommands:n,editor:r,state:i}=this,{view:a}=r,o={tr:e,editor:r,view:a,state:Qe({state:i,transaction:e}),dispatch:t?()=>void 0:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(n).map(([e,t])=>[e,(...e)=>t(...e)(o)]))}};return o}},$e=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{if(!e.isDestroyed){var n;t.dom.blur(),(n=window)==null||(n=n.getSelection())==null||n.removeAllRanges()}}),!0),et=(e=!0)=>({commands:t})=>t.setContent(``,{emitUpdate:e}),tt=()=>({state:e,tr:t,dispatch:n})=>{let{selection:r}=t,{ranges:i}=r;return n&&i.forEach(({$from:n,$to:r})=>{e.doc.nodesBetween(n.pos,r.pos,(e,n)=>{if(e.type.isText)return;let{doc:r,mapping:i}=t,a=r.resolve(i.map(n)),o=r.resolve(i.map(n+e.nodeSize)),s=a.blockRange(o);if(!s)return;let c=le(s);if(e.type.isTextblock){let{defaultType:e}=a.parent.contentMatchAt(a.index());t.setNodeMarkup(s.start,e)}(c||c===0)&&t.lift(s,c)})}),!0},nt=e=>t=>e(t),rt=()=>({state:e,dispatch:t})=>g(e,t),it=(e,t)=>({editor:n,tr:r})=>{let{state:i}=n,a=i.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);let o=r.mapping.map(t);return r.insert(o,a.content),r.setSelection(new T(r.doc.resolve(Math.max(o-1,0)))),!0},at=()=>({tr:e,dispatch:t})=>{let{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;let i=e.selection.$anchor;for(let n=i.depth;n>0;--n)if(i.node(n).type===r.type){if(t){let t=i.before(n),r=i.after(n);e.delete(t,r).scrollIntoView()}return!0}return!1};function N(e,t){if(typeof e==`string`){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}var ot=e=>({tr:t,state:n,dispatch:r})=>{let i=N(e,n.schema),a=t.selection.$anchor;for(let e=a.depth;e>0;--e)if(a.node(e).type===i){if(r){let n=a.before(e),r=a.after(e);t.delete(n,r).scrollIntoView()}return!0}return!1},st=e=>({tr:t,dispatch:n})=>{let{from:r,to:i}=e;return n&&t.delete(r,i),!0},ct=e=>e.content?/^text(\*|\+)/.test(e.content):!1,lt=(e,t,n)=>{if(!e.parent.isInline||n===`left`&&e.pos>e.start()||n===`right`&&e.pos<e.end())return e.pos;let r=t.nodes[e.parent.type.name].spec;return ct(r)?n===`left`?e.start()-1:e.end()+1:e.pos},ut=(e,t,n)=>({from:lt(e,n,`left`),to:lt(t,n,`right`)}),dt=()=>({state:e,dispatch:t})=>{if(e.selection.empty)return!1;if(t){let n=e.tr,{ranges:r}=e.selection,i=n.steps.length;r.forEach(t=>{let r=n.mapping.slice(i),{from:a,to:o}=ut(n.doc.resolve(r.map(t.$from.pos)),n.doc.resolve(r.map(t.$to.pos)),e.schema);n.deleteRange(a,o)}),n.selection.empty||n.setSelection(T.near(n.doc.resolve(n.selection.from))),n.scrollIntoView(),t(n)}return!0},ft=()=>({commands:e})=>e.keyboardShortcut(`Enter`),pt=()=>({state:e,dispatch:t})=>te(e,t);function mt(e){return Object.prototype.toString.call(e)===`[object RegExp]`}function ht(e,t,n={strict:!0}){let r=Object.keys(t);return!r.length||r.every(r=>n.strict?t[r]===e[r]:mt(t[r])?t[r].test(e[r]):t[r]===e[r])}function gt(e,t,n={}){return e.find(e=>e.type===t&&ht(Object.fromEntries(Object.keys(n).map(t=>[t,e.attrs[t]])),n))}function _t(e,t,n={}){return!!gt(e,t,n)}function vt(e,t,n){if(!e||!t)return;let r=e.parent.childAfter(e.parentOffset);if(r.node&&r.node.marks.some(e=>e.type===t)||(r=e.parent.childBefore(e.parentOffset)),!r.node||!r.node.marks.some(e=>e.type===t))return;if(!n){let e=r.node.marks.find(e=>e.type===t);e&&(n=e.attrs)}if(!gt([...r.node.marks],t,n))return;let i=r.index,a=e.start()+r.offset,o=i+1,s=a+r.node.nodeSize;for(;i>0&&_t([...e.parent.child(i-1).marks],t,n);)--i,a-=e.parent.child(i).nodeSize;for(;o<e.parent.childCount&&_t([...e.parent.child(o).marks],t,n);)s+=e.parent.child(o).nodeSize,o+=1;return{from:a,to:s}}function P(e,t){if(typeof e==`string`){if(!t.marks[e])throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);return t.marks[e]}return e}var yt=(e,t)=>({tr:n,state:r,dispatch:i})=>{let a=P(e,r.schema),{doc:o,selection:s}=n,{$from:c,from:l,to:u}=s;if(i){let e=vt(c,a,t);if(e&&e.from<=l&&e.to>=u){let t=T.create(o,e.from,e.to);n.setSelection(t)}}return!0},bt=e=>t=>{let n=typeof e==`function`?e(t):e;for(let e=0;e<n.length;e+=1)if(n[e](t))return!0;return!1};function xt(e){return e instanceof T}function F(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function St(e,t=null){if(!t)return null;let n=D.atStart(e),r=D.atEnd(e);if(t===`start`||t===!0)return n;if(t===`end`)return r;let i=n.from,a=r.to;return t===`all`?T.create(e,F(0,i,a),F(e.content.size,i,a)):T.create(e,F(t,i,a),F(t,i,a))}function Ct(){return[`Android`].includes(navigator.platform)||/android/i.test(navigator.userAgent)}function I(){return[`iPad Simulator`,`iPhone Simulator`,`iPod Simulator`,`iPad`,`iPhone`,`iPod`].includes(navigator.platform)||navigator.userAgent.includes(`Mac`)&&`ontouchend`in document}function wt(){return typeof navigator<`u`&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}var Tt=(e=null,t={})=>({editor:n,view:r,tr:i,dispatch:a})=>{t={scrollIntoView:!0,...t};let o=()=>{(I()||Ct())&&r.dom.focus(),wt()&&!I()&&!Ct()&&r.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),t?.scrollIntoView&&n.commands.scrollIntoView())})};try{if(r.hasFocus()&&e===null||e===!1)return!0}catch{return!1}if(a&&e===null&&!xt(n.state.selection))return o(),!0;let s=St(i.doc,e)||n.state.selection,c=n.state.selection.eq(s);return a&&(c||i.setSelection(s),c&&i.storedMarks&&i.setStoredMarks(i.storedMarks),o()),!0},Et=(e,t)=>n=>e.every((e,r)=>t(e,{...n,index:r})),Dt=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),Ot=e=>{let t=e.childNodes;for(let n=t.length-1;n>=0;--n){let r=t[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?e.removeChild(r):r.nodeType===1&&Ot(r)}return e};function kt(e){if(typeof window>`u`)throw Error(`[tiptap error]: there is no window object available, so this function cannot be used`);let t=`<body>${e}</body>`,n=new window.DOMParser().parseFromString(t,`text/html`).body;return Ot(n)}function At(e){return typeof e?.nodesBetween==`function`}function jt(e,t,n){if(At(e))return e;let r=typeof e==`object`&&!!e;n={slice:!0,parseOptions:{},...n};let i=typeof e==`string`;if(r)try{if(Array.isArray(e)&&e.length>0)return C.fromArray(e.map(e=>t.nodeFromJSON(e)));let r=t.nodeFromJSON(e);return n.errorOnInvalidContent&&r.check(),r}catch(r){if(n.errorOnInvalidContent)throw Error(`[tiptap error]: Invalid JSON content`,{cause:r});return console.warn(`[tiptap warn]: Invalid content.`,`Passed value:`,e,`Error:`,r),jt(``,t,n)}if(i){if(n.errorOnInvalidContent){let r=!1,i=``,a=new ce({topNode:t.spec.topNode,marks:t.spec.marks,nodes:t.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:`inline*`,group:`block`,parseDOM:[{tag:`*`,getAttrs:e=>(r=!0,i=typeof e==`string`?e:e.outerHTML,null)}]}})});if(n.slice?Se.fromSchema(a).parseSlice(kt(e),n.parseOptions):Se.fromSchema(a).parse(kt(e),n.parseOptions),n.errorOnInvalidContent&&r)throw Error(`[tiptap error]: Invalid HTML content`,{cause:Error(`Invalid element found: ${i}`)})}let r=Se.fromSchema(t);return n.slice?r.parseSlice(kt(e),n.parseOptions).content:r.parse(kt(e),n.parseOptions)}return jt(``,t,n)}function Mt(e){return!(`type`in e)}function Nt(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof he||i instanceof _e))return;let a=e.mapping.maps[r],o=0;a.forEach((e,t,n,r)=>{o===0&&(o=r)}),e.setSelection(D.near(e.doc.resolve(o),n))}var Pt=(e,t,n)=>({tr:r,dispatch:i,editor:a})=>{if(i){n={parseOptions:a.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let i,o=e=>{a.emit(`contentError`,{editor:a,error:e,disableCollaboration:()=>{`collaboration`in a.storage&&typeof a.storage.collaboration==`object`&&a.storage.collaboration&&(a.storage.collaboration.isDisabled=!0)}})},s={preserveWhitespace:`full`,...n.parseOptions};if(!n.errorOnInvalidContent&&!a.options.enableContentCheck&&a.options.emitContentError)try{jt(t,a.schema,{parseOptions:s,errorOnInvalidContent:!0})}catch(e){o(e)}try{i=jt(t,a.schema,{parseOptions:s,errorOnInvalidContent:n.errorOnInvalidContent??a.options.enableContentCheck})}catch(e){return o(e),!1}let{from:c,to:l}=typeof e==`number`?{from:e,to:e}:{from:e.from,to:e.to},u=!0,d=!0,f=Mt(i)?i.content:[i];if(f.forEach(e=>{e.check(),u=u?e.isText&&e.marks.length===0:!1,d=d?e.isBlock:!1}),c===l&&d){let{parent:e}=r.doc.resolve(c);e.isTextblock&&!e.type.spec.code&&!e.childCount&&(--c,l+=1)}let p;if(u)p=Array.isArray(t)?t.map(e=>e.text||``).join(``):At(t)?f.map(e=>e.text??``).join(``):typeof t==`object`&&t&&t.text?t.text:t,r.insertText(p,c,l);else{p=C.from(f);let e=r.doc.resolve(c),t=e.node(),n=e.parentOffset===0,i=t.isText||t.isTextblock,a=t.content.size>0;n&&i&&a&&d&&(c=Math.max(0,c-1)),r.replaceWith(c,l,f)}n.updateSelection&&Nt(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta(`applyInputRules`,{from:c,text:p}),n.applyPasteRules&&r.setMeta(`applyPasteRules`,{from:c,text:p})}return!0};function Ft(e){for(let t=0;t<e.edgeCount;t+=1){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}var It=(e={})=>({tr:t,dispatch:n,editor:r})=>{let{pos:i,attrs:a,content:o,updateSelection:s=!0}=e,c;c=typeof i==`number`?t.doc.resolve(i):i||t.selection.$from;let l=Ft(c.parent.contentMatchAt(c.index()));if(!l)return!1;let u=Object.keys(l.spec.attrs||{}),d=a?Object.fromEntries(Object.entries(a).filter(([e])=>u.includes(e))):{},f;if(o){let e=jt(o,r.schema);f=l.createAndFill(d,e)}else f=l.createAndFill(d);return f?(n&&(t.insert(c.pos,f),s&&Nt(t,t.steps.length-1,-1)),!0):!1},Lt=()=>({state:e,dispatch:t})=>m(e,t),Rt=()=>({state:e,dispatch:t})=>p(e,t),zt=()=>({state:e,dispatch:t})=>f(e,t),Bt=()=>({state:e,dispatch:t})=>y(e,t),Vt=(e,t)=>{let n=e.resolve(t),r=n.nodeBefore,i=n.nodeAfter;return!r||!i?!1:!r.type.spec.isolating&&!i.type.spec.isolating},Ht=()=>({state:e,dispatch:t,tr:n})=>{try{let r=Ce(e.doc,e.selection.$from.pos,-1);return r==null||!Vt(e.doc,r)?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},Ut=()=>({state:e,dispatch:t,tr:n})=>{try{let r=Ce(e.doc,e.selection.$from.pos,1);return r==null||!Vt(e.doc,r)?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},Wt=()=>({state:e,dispatch:t})=>_(e,t),Gt=()=>({state:e,dispatch:t})=>h(e,t);function Kt(){return typeof navigator<`u`&&/Mac/.test(navigator.platform)}function qt(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n===`Space`&&(n=` `);let r,i,a,o;for(let e=0;e<t.length-1;e+=1){let n=t[e];if(/^(cmd|meta|m)$/i.test(n))o=!0;else if(/^a(lt)?$/i.test(n))r=!0;else if(/^(c|ctrl|control)$/i.test(n))i=!0;else if(/^s(hift)?$/i.test(n))a=!0;else if(/^mod$/i.test(n))I()||Kt()?o=!0:i=!0;else throw Error(`Unrecognized modifier name: ${n}`)}return r&&(n=`Alt-${n}`),i&&(n=`Ctrl-${n}`),o&&(n=`Meta-${n}`),a&&(n=`Shift-${n}`),n}var Jt=e=>({editor:t,view:n,tr:r,dispatch:i})=>{let a=qt(e).split(/-(?!$)/),o=a.find(e=>![`Alt`,`Ctrl`,`Meta`,`Shift`].includes(e)),s=new KeyboardEvent(`keydown`,{key:o===`Space`?` `:o,altKey:a.includes(`Alt`),ctrlKey:a.includes(`Ctrl`),metaKey:a.includes(`Meta`),shiftKey:a.includes(`Shift`),bubbles:!0,cancelable:!0});return t.captureTransaction(()=>{n.someProp(`handleKeyDown`,e=>e(n,s))})?.steps.forEach(e=>{let t=e.map(r.mapping);t&&i&&r.maybeStep(t)}),!0};function Yt(e,t,n={}){let{from:r,to:i,empty:a}=e.selection,o=t?N(t,e.schema):null,s=[];e.doc.nodesBetween(r,i,(e,t)=>{if(e.isText)return;let n=Math.max(r,t),a=Math.min(i,t+e.nodeSize);s.push({node:e,from:n,to:a})});let c=i-r,l=s.filter(e=>!o||o.name===e.node.type.name).filter(e=>ht(e.node.attrs,n,{strict:!1}));return a?!!l.length:l.reduce((e,t)=>e+t.to-t.from,0)>=c}var Xt=(e,t={})=>({state:n,dispatch:r})=>Yt(n,N(e,n.schema),t)?u(n,r):!1,Zt=()=>({state:e,dispatch:t})=>ne(e,t),Qt=e=>({state:t,dispatch:n})=>Je(N(e,t.schema))(t,n),$t=()=>({state:e,dispatch:t})=>x(e,t);function en(e,t){return t.nodes[e]?`node`:t.marks[e]?`mark`:null}function tn(e,t){let n=typeof t==`string`?[t]:t;return Object.keys(e).reduce((t,r)=>(n.includes(r)||(t[r]=e[r]),t),{})}var nn=(e,t)=>({tr:n,state:r,dispatch:i})=>{let a=null,o=null,s=en(typeof e==`string`?e:e.name,r.schema);if(!s)return!1;s===`node`&&(a=N(e,r.schema)),s===`mark`&&(o=P(e,r.schema));let c=!1;return n.selection.ranges.forEach(e=>{r.doc.nodesBetween(e.$from.pos,e.$to.pos,(e,r)=>{a&&a===e.type&&(c=!0,i&&n.setNodeMarkup(r,void 0,tn(e.attrs,t))),o&&e.marks.length&&e.marks.forEach(a=>{o===a.type&&(c=!0,i&&n.addMark(r,r+e.nodeSize,o.create(tn(a.attrs,t))))})})}),c},rn=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),an=()=>({tr:e,dispatch:t})=>{if(t){let t=new ge(e.doc);e.setSelection(t)}return!0},on=()=>({state:e,dispatch:t})=>d(e,t),sn=()=>({state:e,dispatch:t})=>ie(e,t),cn=()=>({state:e,dispatch:t})=>c(e,t),ln=()=>({state:e,dispatch:t})=>o(e,t),un=()=>({state:e,dispatch:t})=>re(e,t);function dn(e,t,n={},r={}){return jt(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var fn=(e,{errorOnInvalidContent:t,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:i,tr:a,dispatch:o,commands:s})=>{let{doc:c}=a;if(r.preserveWhitespace!==`full`){let s=dn(e,i.schema,r,{errorOnInvalidContent:t??i.options.enableContentCheck});if(o){let e=Mt(s)?s.content:[s];a.replaceWith(0,c.content.size,e).setMeta(`preventUpdate`,!n)}return!0}return o&&a.setMeta(`preventUpdate`,!n),s.insertContentAt({from:0,to:c.content.size},e,{parseOptions:r,errorOnInvalidContent:t??i.options.enableContentCheck})};function pn(e,t){let n=P(t,e.schema),{from:r,to:i,empty:a}=e.selection,o=[];a?(e.storedMarks&&o.push(...e.storedMarks),o.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,i,e=>{o.push(...e.marks)});let s=o.find(e=>e.type.name===n.name);return s?{...s.attrs}:{}}function mn(e,t){let n=new me(e);return t.forEach(e=>{e.steps.forEach(e=>{n.step(e)})}),n}function hn(e,t,n){let r=[];return e.nodesBetween(t.from,t.to,(e,t)=>{n(e)&&r.push({node:e,pos:t})}),r}function gn(e,t){for(let n=e.depth;n>0;--n){let r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}function _n(e){return t=>gn(t.$from,e)}function L(e,t,n){return e.config[t]===void 0&&e.parent?L(e.parent,t,n):typeof e.config[t]==`function`?e.config[t].bind({...n,parent:e.parent?L(e.parent,t,n):null}):e.config[t]}function vn(e){return e.map(e=>{let t=L(e,`addExtensions`,{name:e.name,options:e.options,storage:e.storage});return t?[e,...vn(t())]:e}).flat(10)}function yn(e,t){let n=ue.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement(`div`);return r.appendChild(n),r.innerHTML}function bn(e,t){let n=new Map;for(let t of e){let e=n.get(t.type)??new Map;e.set(t.name,t),n.set(t.type,e)}return[...Object.values(t.nodes),...Object.values(t.marks)].flatMap(e=>Object.entries(e.spec.attrs??{}).map(([t,r])=>{let i=n.get(e.name)?.get(t),a=Object.hasOwn(r,`default`);return{type:e.name,name:t,attribute:{rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,...i?.attribute,default:r.default,isRequired:!a,validate:r.validate}}}))}var xn={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`},Sn={inclusive:`boolean`,excludes:`string`,group:`string`,spanning:`boolean`,code:`boolean`};function Cn(e,t,n){return Object.fromEntries(Object.entries(t).flatMap(([t,r])=>{let i=e[t];if(i===void 0)return[];if(!(typeof r==`string`?typeof i===r:typeof i==`string`&&r.includes(i)))throw RangeError(`Invalid schemaSpec field '${n}.${t}'`);return[[t,i]]}))}function wn(e,t,n,r){return{...Object.fromEntries(Object.entries(t).filter(([e])=>e!==`attrs`&&!Object.hasOwn(r,e))),...Cn(n,r,e),attrs:n.attrs}}function Tn(e,t,n){for(let r of Object.keys(t))if(!Object.hasOwn(e,r))throw RangeError(`schemaSpec requires a local ${n} extension named '${r}'`);for(let r of Object.keys(e))if(!Object.hasOwn(t,r))throw RangeError(`Local ${n} extension '${r}' is not in schemaSpec`)}function En(e,t){Tn(e.nodes,t.nodes,`node`),Tn(e.marks,t.marks,`mark`);let n=t.spec.nodes,r=t.spec.marks;return t.spec.nodes.forEach((t,r)=>{n=n.update(t,wn(t,e.nodes[t],r,xn))}),t.spec.marks.forEach((t,n)=>{r=r.update(t,wn(t,e.marks[t],n,Sn))}),{topNode:t.topNodeType.name,nodes:n,marks:r}}function Dn(e){let t=e.filter((t,n)=>e.indexOf(t)!==n);return Array.from(new Set(t))}function On(e){return{baseExtensions:e.filter(e=>e.type===`extension`),nodeExtensions:e.filter(e=>e.type===`node`),markExtensions:e.filter(e=>e.type===`mark`)}}function kn(e){let t=[],{nodeExtensions:n,markExtensions:r}=On(e),i=[...n,...r],a={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},o=n.filter(e=>e.name!==`text`).map(e=>e.name),s=r.map(e=>e.name),c=[...o,...s];return e.forEach(e=>{let n=L(e,`addGlobalAttributes`,{name:e.name,options:e.options,storage:e.storage,extensions:i});n&&n().forEach(e=>{let n;n=Array.isArray(e.types)?e.types:e.types===`*`?c:e.types===`nodes`?o:e.types===`marks`?s:[],n.forEach(n=>{Object.entries(e.attributes).forEach(([e,r])=>{t.push({type:n,name:e,attribute:{...a,...r}})})})})}),i.forEach(e=>{let n=L(e,`addAttributes`,{name:e.name,options:e.options,storage:e.storage});if(!n)return;let r=n();Object.entries(r).forEach(([n,r])=>{let i={...a,...r};typeof i?.default==`function`&&(i.default=i.default()),i?.isRequired&&i?.default===void 0&&delete i.default,t.push({type:e.name,name:n,attribute:i})})}),t}function An(e){return typeof e==`function`}function R(e,t=void 0,...n){return An(e)?t?e.bind(t)(...n):e(...n):e}function jn(e={}){return Object.keys(e).length===0&&e.constructor===Object}function Mn(e){let t=[],n=``,r=!1,i=!1,a=0,o=e.length;for(let s=0;s<o;s+=1){let o=e[s];if(o===`'`&&!i)r=!r,n+=o;else if(o===`"`&&!r)i=!i,n+=o;else{if(!r&&!i){if(o===`(`){a+=1,n+=o;continue}if(o===`)`&&a>0){--a,n+=o;continue}if(o===`;`&&a===0){t.push(n),n=``;continue}}n+=o}}return n&&t.push(n),t}function Nn(e){let t=[],n=Mn(e||``),r=n.length;for(let e=0;e<r;e+=1){let r=n[e],i=r.indexOf(`:`);if(i===-1)continue;let a=r.slice(0,i).trim(),o=r.slice(i+1).trim();a&&o&&t.push([a,o])}return t}function z(...e){return e.filter(e=>!!e).reduce((e,t)=>{let n={...e};return Object.entries(t).forEach(([e,t])=>{if(e===`__proto__`)Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:t,writable:!0});else if(!n[e])n[e]=t;else if(e===`class`){let r=t?String(t).split(` `):[],i=n[e]?n[e].split(` `):[],a=r.filter(e=>!i.includes(e));n[e]=[...i,...a].join(` `)}else if(e===`style`){let r=new Map([...Nn(n[e]),...Nn(t)]);n[e]=Array.from(r.entries()).map(([e,t])=>`${e}: ${t}`).join(`; `)}else n[e]=t}),n},{})}function B(e,t){return t.filter(t=>t.type===e.type.name).filter(e=>e.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(e.attrs)||{}:{[t.name]:e.attrs[t.name]}).reduce((e,t)=>z(e,t),{})}function Pn(e){return typeof e==`string`?e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):e===`true`||e!==`false`&&e:e}function Fn(e,t){return`style`in e?e:{...e,getAttrs:n=>{let r=e.getAttrs?e.getAttrs(n):e.attrs;if(r===!1)return!1;let i=t.reduce((e,t)=>{let r=t.attribute.parseHTML?t.attribute.parseHTML(n):Pn(n.getAttribute(t.name));return r==null?e:{...e,[t.name]:r}},{});return{...r,...i}}}}function In(e){return Object.fromEntries(Object.entries(e).filter(([e,t])=>e===`attrs`&&jn(t)?!1:t!=null))}function Ln(e){var t,n;let r={};return!(e!=null&&(t=e.attribute)!=null&&t.isRequired)&&`default`in(e?.attribute||{})&&(r.default=e.attribute.default),(e==null||(n=e.attribute)==null?void 0:n.validate)!==void 0&&(r.validate=e.attribute.validate),[e.name,r]}function Rn(e,t,n=kn(e)){let{nodeExtensions:r,markExtensions:i}=On(e);return{topNode:r.find(e=>L(e,`topNode`))?.name,nodes:Object.fromEntries(r.map(r=>{let i=n.filter(e=>e.type===r.name),a={name:r.name,options:r.options,storage:r.storage,editor:t},o=In({...e.reduce((e,t)=>{let n=L(t,`extendNodeSchema`,a);return{...e,...n?n(r):{}}},{}),content:R(L(r,`content`,a)),marks:R(L(r,`marks`,a)),group:R(L(r,`group`,a)),inline:R(L(r,`inline`,a)),atom:R(L(r,`atom`,a)),selectable:R(L(r,`selectable`,a)),draggable:R(L(r,`draggable`,a)),code:R(L(r,`code`,a)),whitespace:R(L(r,`whitespace`,a)),linebreakReplacement:R(L(r,`linebreakReplacement`,a)),defining:R(L(r,`defining`,a)),isolating:R(L(r,`isolating`,a)),attrs:Object.fromEntries(i.map(Ln))}),s=R(L(r,`parseHTML`,a));s&&(o.parseDOM=s.map(e=>Fn(e,i)));let c=L(r,`renderHTML`,a);c&&(o.toDOM=e=>c({node:e,HTMLAttributes:B(e,i)}));let l=L(r,`renderText`,a);return l&&(o.toText=l),[r.name,o]})),marks:Object.fromEntries(i.map(r=>{let i=n.filter(e=>e.type===r.name),a={name:r.name,options:r.options,storage:r.storage,editor:t},o=In({...e.reduce((e,t)=>{let n=L(t,`extendMarkSchema`,a);return{...e,...n?n(r):{}}},{}),inclusive:R(L(r,`inclusive`,a)),excludes:R(L(r,`excludes`,a)),group:R(L(r,`group`,a)),spanning:R(L(r,`spanning`,a)),code:R(L(r,`code`,a)),attrs:Object.fromEntries(i.map(Ln))}),s=R(L(r,`parseHTML`,a));s&&(o.parseDOM=s.map(e=>Fn(e,i)));let c=L(r,`renderHTML`,a);return c&&(o.toDOM=e=>c({mark:e,HTMLAttributes:B(e,i)})),[r.name,o]}))}}function zn(e,t,n){if(n===void 0)return new ce(Rn(e,t));let r=Dn(e.filter(e=>e.type!==`extension`).map(e=>e.name));if(r.length)throw RangeError(`Duplicate local schema types: ${r.join(`, `)}`);let i=new ce(n),a=Rn(e,t,bn(kn(e),i));return new ce(En(a,i))}function Bn(e){return e.sort((e,t)=>{let n=L(e,`priority`)||100,r=L(t,`priority`)||100;return n>r?-1:+(n<r)})}function Vn(e){let t=Bn(vn(e)),n=Dn(t.map(e=>e.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(e=>`'${e}'`).join(`, `)}]. This can lead to issues.`),t}function Hn(e,t){return zn(Vn(e),t)}function Un(e,t,n){let{from:r,to:i}=t,{blockSeparator:a=`
|
|
4
|
-
|
|
5
|
-
`,textSerializers:o={}}=n||{},s=``;return e.nodesBetween(r,i,(e,n,c,l)=>{e.isBlock&&n>r&&(s+=a);let u=o?.[e.type.name];if(u)return c&&(s+=u({node:e,pos:n,parent:c,index:l,range:t})),!1;if(e.isText){var d;s+=e==null||(d=e.text)==null?void 0:d.slice(Math.max(r,n)-n,i-n)}}),s}function Wn(e,t){return Un(e,{from:0,to:e.content.size},t)}function Gn(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}function Kn(e,t){let n=N(t,e.schema),{from:r,to:i}=e.selection,a=[];e.doc.nodesBetween(r,i,e=>{a.push(e)});let o=a.reverse().find(e=>e.type.name===n.name);return o?{...o.attrs}:{}}function qn(e,t){let n=en(typeof t==`string`?t:t.name,e.schema);return n===`node`?Kn(e,t):n===`mark`?pn(e,t):{}}function Jn(e,t=JSON.stringify){let n={};return e.filter(e=>{let r=t(e);return Object.prototype.hasOwnProperty.call(n,r)?!1:n[r]=!0})}function Yn(e){let t=Jn(e);return t.length===1?t:t.filter((e,n)=>!t.filter((e,t)=>t!==n).some(t=>e.oldRange.from>=t.oldRange.from&&e.oldRange.to<=t.oldRange.to&&e.newRange.from>=t.newRange.from&&e.newRange.to<=t.newRange.to))}function Xn(e){let{mapping:t,steps:n}=e,r=[];return t.maps.forEach((e,i)=>{let a=[];if(e.ranges.length)e.forEach((e,t)=>{a.push({from:e,to:t})});else{let{from:e,to:t}=n[i];if(e===void 0||t===void 0)return;a.push({from:e,to:t})}a.forEach(({from:e,to:n})=>{let a=t.slice(i).map(e,-1),o=t.slice(i).map(n),s=t.invert().map(a,-1),c=t.invert().map(o);r.push({oldRange:{from:s,to:c},newRange:{from:a,to:o}})})}),Yn(r)}function Zn(e,t,n){let r=[];return e===t?n.resolve(e).marks().forEach(t=>{let i=vt(n.resolve(e),t.type);i&&r.push({mark:t,...i})}):n.nodesBetween(e,t,(e,t)=>{e&&e?.nodeSize!==void 0&&r.push(...e.marks.map(n=>({from:t,to:t+e.nodeSize,mark:n})))}),r}var Qn=(e,t,n,r=20)=>{let i=e.doc.resolve(n),a=r,o=null;for(;a>0&&o===null;){let e=i.node(a);e?.type.name===t?o=e:--a}return[o,a]},$n=e=>{let t=e.depth-1;if(t<0)return null;let n=e.index(t);return n===0?null:e.node(t).child(n-1)};function V(e,t){return t.nodes[e]||t.marks[e]||null}function er(e,t,n){return Object.fromEntries(Object.entries(n).filter(([n])=>{let r=e.find(e=>e.type===t&&e.name===n);return r?r.attribute.keepOnSplit:!1}))}var tr=(e,t=500)=>{let n=``,r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,(e,t,i,a)=>{var o;let s=(o=e.type.spec).toText?.call(o,{node:e,pos:t,parent:i,index:a})||e.textContent||`%leaf%`;n+=e.isAtom&&!e.isText?s:s.slice(0,Math.max(0,r-t))}),n};function nr(e,t,n={}){let{empty:r,ranges:i}=e.selection,a=t?P(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(e=>!a||a.name===e.type.name).find(e=>ht(e.attrs,n,{strict:!1}));let o=0,s=[];if(i.forEach(({$from:t,$to:n})=>{let r=t.pos,i=n.pos;e.doc.nodesBetween(r,i,(e,t)=>{if(a&&e.inlineContent&&!e.type.allowsMarkType(a))return!1;if(!e.isText&&!e.marks.length)return;let n=Math.max(r,t),c=Math.min(i,t+e.nodeSize),l=c-n;o+=l,s.push(...e.marks.map(e=>({mark:e,from:n,to:c})))})}),o===0)return!1;let c=s.filter(e=>!a||a.name===e.mark.type.name).filter(e=>ht(e.mark.attrs,n,{strict:!1})).reduce((e,t)=>e+t.to-t.from,0),l=s.filter(e=>!a||e.mark.type!==a&&e.mark.type.excludes(a)).reduce((e,t)=>e+t.to-t.from,0);return(c>0?c+l:c)>=o}function rr(e,t,n={}){if(!t)return Yt(e,null,n)||nr(e,null,n);let r=en(t,e.schema);return r===`node`?Yt(e,t,n):r===`mark`&&nr(e,t,n)}var ir=(e,t)=>{let{$from:n,$to:r,$anchor:i}=e.selection;if(t){let n=_n(e=>e.type.name===t)(e.selection);if(!n)return!1;let r=e.doc.resolve(n.pos+1);return i.pos+1===r.end()}return!(r.parentOffset<r.parent.nodeSize-2||n.pos!==r.pos)},ar=e=>{let{$from:t,$to:n}=e.selection;return!(t.parentOffset>0||t.pos!==n.pos)};function or(e,t){return Array.isArray(t)?t.some(t=>(typeof t==`string`?t:t.name)===e.name):t}function sr(e,t){let{nodeExtensions:n}=On(t),r=n.find(t=>t.name===e);if(!r)return!1;let i=R(L(r,`group`,{name:r.name,options:r.options,storage:r.storage}));return typeof i==`string`&&i.split(` `).includes(`list`)}function cr(e,{checkChildren:t=!0,ignoreWhitespace:n=!1}={}){if(n){if(e.type.name===`hardBreak`)return!0;if(e.isText)return!/\S/.test(e.text??``)}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(e.content.childCount===0)return!0;if(t){let r=!0;return e.content.forEach(e=>{r!==!1&&(cr(e,{ignoreWhitespace:n,checkChildren:t})||(r=!1))}),r}return!1}function lr(e){return e instanceof k}function ur(e){if(typeof e!=`object`||!e)return!1;let t=e;return typeof t.apply==`function`&&typeof t.getMap==`function`&&typeof t.invert==`function`&&typeof t.map==`function`&&typeof t.merge==`function`&&typeof t.toJSON==`function`}function dr(e){if(typeof e!=`object`||!e)return!1;let t=e;if(!ur(t))return!1;let n=t.toJSON();return!(typeof n!=`object`||!n||n.stepType!==`replace`)}var fr=class e{constructor(e){this.position=e}static fromJSON(t){return new e(t.position)}toJSON(){return{position:this.position}}};function pr(e,t){let n=t.mapping.mapResult(e.position);return{position:new fr(n.pos),mapResult:n}}function mr(e){return new fr(e)}function hr(e,t,n){let r=e.state.doc.content.size,i=F(t,0,r),a=F(n,0,r),o=e.coordsAtPos(i),s=e.coordsAtPos(a,-1),c=Math.min(o.top,s.top),l=Math.max(o.bottom,s.bottom),u=Math.min(o.left,s.left),d=Math.max(o.right,s.right),f={top:c,bottom:l,left:u,right:d,width:d-u,height:l-c,x:u,y:c};return{...f,toJSON:()=>f}}function gr(e,t,n){let{selection:r}=t,i=null;if(xt(r)&&(i=r.$cursor),i){let t=e.storedMarks??i.marks();return i.parent.type.allowsMarkType(n)&&(!!n.isInSet(t)||!t.some(e=>e.type.excludes(n)))}let{ranges:a}=r;return a.some(({$from:t,$to:r})=>{let i=t.depth===0&&e.doc.inlineContent&&e.doc.type.allowsMarkType(n);return e.doc.nodesBetween(t.pos,r.pos,(e,t,r)=>{if(i)return!1;if(e.isInline){let t=!r||r.type.allowsMarkType(n),a=!!n.isInSet(e.marks)||!e.marks.some(e=>e.type.excludes(n));i=t&&a}return!i}),i})}var _r=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let{selection:a}=n,{empty:o,ranges:s}=a,c=P(e,r.schema);if(i){if(o){let e=pn(r,c);n.addStoredMark(c.create({...e,...t}))}else s.forEach(e=>{let i=e.$from.pos,a=e.$to.pos;r.doc.nodesBetween(i,a,(e,r)=>{let o=Math.max(r,i),s=Math.min(r+e.nodeSize,a);e.marks.find(e=>e.type===c)?e.marks.forEach(e=>{c===e.type&&n.addMark(o,s,c.create({...e.attrs,...t}))}):n.addMark(o,s,c.create(t))})})}return gr(r,n,c)},vr=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),yr=(e,t={})=>({state:n,dispatch:r,chain:i})=>{let a=N(e,n.schema),o;return n.selection.$anchor.sameParent(n.selection.$head)&&(o=n.selection.$anchor.parent.attrs),a.isTextblock?i().command(({commands:e})=>l(a,{...o,...t})(n)?!0:e.clearNodes()).command(({state:e})=>l(a,{...o,...t})(e,r)).run():(console.warn(`[tiptap warn]: Currently "setNode()" only supports text block nodes.`),!1)},br=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,r=F(e,0,n.content.size),i=k.create(n,r);t.setSelection(i)}return!0},xr=(e,t)=>({tr:n,state:r,dispatch:i})=>{let{selection:a}=r,o,s;return typeof t==`number`?(o=t,s=t):t&&`from`in t&&`to`in t?(o=t.from,s=t.to):(o=a.from,s=a.to),i&&n.doc.nodesBetween(o,s,(t,r)=>{t.isText||n.setNodeMarkup(r,void 0,{...t.attrs,dir:e})}),!0},Sr=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,{from:r,to:i}=typeof e==`number`?{from:e,to:e}:e,a=T.atStart(n).from,o=T.atEnd(n).to,s=F(r,a,o),c=F(i,a,o),l=T.create(n,s,c);t.setSelection(l)}return!0},Cr=e=>({state:t,dispatch:n})=>Ze(N(e,t.schema))(t,n);function wr(e,t){let n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){let r=n.filter(e=>t?.includes(e.type.name));e.tr.ensureMarks(r)}}var Tr=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:i})=>{let{selection:a,doc:o}=t,{$from:s,$to:c}=a,l=i.extensionManager.attributes,u=er(l,s.node().type.name,s.node().attrs);if(a instanceof k&&a.node.isBlock)return!s.parentOffset||!xe(o,s.pos)?!1:(r&&(e&&wr(n,i.extensionManager.splittableMarks),t.split(s.pos).scrollIntoView()),!0);if(!s.parent.isBlock)return!1;let d=c.parentOffset===c.parent.content.size,f=s.depth===0?void 0:Ft(s.node(-1).contentMatchAt(s.indexAfter(-1))),p=d&&f?[{type:f,attrs:u}]:void 0,m=a instanceof T&&!a.empty?fe.create({doc:t.doc,selection:a}).tr.deleteSelection():null,h=m?m.doc:t.doc,g=m?m.mapping.map(s.pos):s.pos,_=xe(h,g,1,p);if(!p&&!_&&xe(h,g,1,f?[{type:f}]:void 0)&&(_=!0,p=f?[{type:f,attrs:u}]:void 0),r){if(_){let e=t.steps.length;if(a instanceof T&&t.deleteSelection(),t.split(t.mapping.slice(e).map(s.pos),1,p),f&&!d&&!s.parentOffset&&s.parent.type!==f){let n=t.mapping.slice(e).map(s.before()),r=t.doc.resolve(n);s.node(-1).canReplaceWith(r.index(),r.index()+1,f)&&t.setNodeMarkup(t.mapping.slice(e).map(s.before()),f)}}e&&wr(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return _},Er=(e,t={})=>({tr:n,state:r,dispatch:i,editor:a})=>{let o=N(e,r.schema),{$from:s,$to:c}=r.selection,l=r.selection.node;if(l&&l.isBlock||s.depth<2||!s.sameParent(c))return!1;let u=s.node(-1);if(u.type!==o)return!1;let d=a.extensionManager.attributes;if(s.parent.content.size===0&&s.node(-1).childCount===s.indexAfter(-1)){if(s.depth===2||s.node(-3).type!==o||s.index(-2)!==s.node(-2).childCount-1)return!1;if(i){let e=C.empty,r=s.index(-1)?1:s.index(-2)?2:3;for(let t=s.depth-r;t>=s.depth-3;--t)e=C.from(s.node(t).copy(e));let i=s.indexAfter(-1)<s.node(-2).childCount?1:s.indexAfter(-2)<s.node(-3).childCount?2:3,a={...er(d,s.node().type.name,s.node().attrs),...t},c=o.contentMatch.defaultType?.createAndFill(a)||void 0;e=e.append(C.from(o.createAndFill(null,c)||void 0));let l=s.before(s.depth-(r-1));n.replace(l,s.after(-i),new E(e,4-r,0));let u=-1;n.doc.nodesBetween(l,n.doc.content.size,(e,t)=>{if(u>-1)return!1;e.isTextblock&&e.content.size===0&&(u=t+1)}),u>-1&&n.setSelection(T.near(n.doc.resolve(u))),n.scrollIntoView()}return!0}let f=c.pos===s.end()?u.contentMatchAt(0).defaultType:null,p={...er(d,u.type.name,u.attrs),...t},m={...er(d,s.node().type.name,s.node().attrs),...t},h=s.parentOffset===0&&s.index(-1)===0,g=s.before(-1);n.delete(s.pos,c.pos);let _=h?u.attrs:p,v=f?[{type:o,attrs:_},{type:f,attrs:m}]:[{type:o,attrs:_}];if(!xe(n.doc,s.pos,2))return!1;if(i){let{selection:e,storedMarks:t}=r,{splittableMarks:o}=a.extensionManager,c=t||e.$to.parentOffset&&e.$from.marks();if(n.split(s.pos,2,v).scrollIntoView(),h&&n.setNodeMarkup(g,void 0,p),!c||!i)return!0;let l=c.filter(e=>o.includes(e.type.name));n.ensureMarks(l)}return!0};function Dr(e,t,n){if(!e.validContent(t))return null;try{return e.create(n,t)}catch{return null}}function Or(e,t){if(e.pendingContent.length===0)return!0;let n=Dr(t,C.from(e.pendingContent));return n?(e.items.push(n),e.pendingContent=[],!0):!1}function kr(e,t,n){return n.validContent(C.from([...t.pendingContent,e]))?(t.pendingContent.push(e),!0):!Or(t,n)||!n.validContent(C.from(e))?!1:(t.pendingContent.push(e),!0)}function Ar(e,t,n,r){let i=r(e,n);if(!i)return!1;let a=Dr(n.listType,C.from(i),e.attrs);return a?n.itemType.validContent(C.from([...t.pendingContent,a]))?(t.pendingContent.push(a),!0):Or(t,n.itemType)?(t.items.push(...i),!0):!1:!1}function jr(e,t,n){let r={items:[],pendingContent:[]};for(let i=0;i<e.childCount;i+=1){let a=e.child(i);if(!(t.isListNode(a)?Ar(a,r,t,n):kr(a,r,t.itemType)))return null}return Or(r,t.itemType)?r.items:null}function Mr(e,t){let n=[];for(let r=0;r<e.childCount;r+=1){let i=jr(e.child(r),t,Mr);if(!i)return null;n.push(...i)}return n}function Nr(e,t){let n=null;return e.descendants((e,r)=>e!==t||(n=r,!1)),n}function Pr(e){return!e||e===`1`?null:e}function Fr(e,t){return Pr(e)===Pr(t)}var Ir=(e,t)=>{let n=_n(e=>e.type===t)(e.selection);if(!n)return!0;let r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;let i=e.doc.nodeAt(r);return!(n.node.type===i?.type&&de(e.doc,n.pos))||!Fr(n.node.attrs.type,i?.attrs.type)||e.join(n.pos),!0},Lr=(e,t)=>{let n=_n(e=>e.type===t)(e.selection);if(!n)return!0;let r=e.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;let i=e.doc.nodeAt(r);return!(n.node.type===i?.type&&de(e.doc,r))||!Fr(n.node.attrs.type,i?.attrs.type)||e.join(r),!0};function Rr(e){let t=e.doc,n=t.firstChild;if(!n)return null;let r=t.resolve(1),i=t.resolve(n.nodeSize-1);return T.between(r,i)}var zr=(e,t,n,r={})=>({editor:i,tr:a,state:o,dispatch:s,chain:c,commands:l,can:u})=>{let{extensions:d,splittableMarks:f}=i.extensionManager,p=N(e,o.schema),m=N(t,o.schema),{selection:h,storedMarks:g}=o,{$from:_,$to:v}=h,y=_.blockRange(v),b=g||h.$to.parentOffset&&h.$from.marks();if(!y)return!1;let ee=_n(e=>sr(e.type.name,d))(h),te=h.from===0&&h.to===o.doc.content.size,ne=o.doc.content.content,re=ne.length===1?ne[0]:null,ie=te&&re&&sr(re.type.name,d)?{node:re,pos:0,depth:0}:null,x=ee??ie,ae=!!ee&&y.depth>=1&&y.depth-ee.depth<=1,S=!!ie;if((ae||S)&&x){if(x.node.type===p)return te&&S?c().command(({tr:e,dispatch:t})=>{let n=Rr(e);return n?(e.setSelection(n),t&&t(e),!0):!1}).liftListItem(m).run():l.liftListItem(m);if(sr(x.node.type.name,d)&&p.validContent(x.node.content))return c().command(()=>(a.setNodeMarkup(x.pos,p),!0)).command(()=>Ir(a,p)).command(()=>Lr(a,p)).run();if(sr(x.node.type.name,d)){let e=x.node.firstChild?.type;if(e&&e!==m){let e=Mr(x.node,{listType:p,itemType:m,isListNode:e=>sr(e.type.name,d)}),t=e?C.from(e):null;return!t||!p.validContent(t)?!1:c().command(()=>{let{$anchor:e,$head:n}=a.selection,i=e.parent,o=n.parent,s=e.parentOffset,c=n.parentOffset,l;try{l=p.create(r,t)}catch{return!1}if(a.replaceWith(x.pos,x.pos+x.node.nodeSize,l),i.inlineContent&&o.inlineContent){let e=Nr(l,i),t=Nr(l,o);if(e!==null&&t!==null){let n=x.pos+e+2+s,r=x.pos+t+2+c;a.setSelection(T.create(a.doc,n,r))}}return!0}).command(()=>Ir(a,p)).command(()=>Lr(a,p)).run()}}}return!n||!b||!s?c().command(()=>u().wrapInList(p,r)?!0:l.clearNodes()).wrapInList(p,r).command(()=>Ir(a,p)).command(()=>Lr(a,p)).run():c().command(()=>{let e=u().wrapInList(p,r),t=b.filter(e=>f.includes(e.type.name));return a.ensureMarks(t),e?!0:l.clearNodes()}).wrapInList(p,r).command(()=>Ir(a,p)).command(()=>Lr(a,p)).run()},Br=(e,t={},n={})=>({state:r,commands:i})=>{let{extendEmptyMarkRange:a=!1}=n,o=P(e,r.schema);return nr(r,o,t)?i.unsetMark(o,{extendEmptyMarkRange:a}):i.setMark(o,t)},Vr=(e,t,n={})=>({state:r,commands:i})=>{let a=N(e,r.schema),o=N(t,r.schema),s=Yt(r,a,n),c;return r.selection.$anchor.sameParent(r.selection.$head)&&(c=r.selection.$anchor.parent.attrs),s?i.setNode(o,c):i.setNode(a,{...c,...n})},Hr=(e,t={})=>({state:n,commands:r})=>{let i=N(e,n.schema);return Yt(n,i,t)?r.lift(i):r.wrapIn(i,t)},Ur=()=>({state:e,dispatch:t})=>{let n=e.plugins;for(let r=0;r<n.length;r+=1){let i=n[r],a;if(i.spec.isInputRules&&(a=i.getState(e))){if(t){let t=e.tr,n=a.transform;for(let e=n.steps.length-1;e>=0;--e)t.step(n.steps[e].invert(n.docs[e]));if(a.text){let n=t.doc.resolve(a.from).marks();t.replaceWith(a.from,a.to,e.schema.text(a.text,n))}else t.delete(a.from,a.to)}return!0}}return!1},Wr=(e={})=>({tr:t,dispatch:n,editor:r})=>{let{ignoreClearable:i=!1}=e,{selection:a}=t,{empty:o,ranges:s}=a;if(o)return!0;let{nonClearableMarks:c}=r.extensionManager;if(n){let e=Object.values(r.schema.marks).filter(e=>i||!c.includes(e.name));s.forEach(n=>{for(let r of e)t.removeMark(n.$from.pos,n.$to.pos,r)})}return!0},Gr=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let{extendEmptyMarkRange:a=!1}=t,{selection:o}=n,s=P(e,r.schema),{$from:c,empty:l,ranges:u}=o;if(!i)return!0;if(l&&a){let{from:e,to:t}=o,r=vt(c,s,c.marks().find(e=>e.type===s)?.attrs);r&&(e=r.from,t=r.to),n.removeMark(e,t,s)}else u.forEach(e=>{n.removeMark(e.$from.pos,e.$to.pos,s)});return n.removeStoredMark(s),!0},Kr=e=>({tr:t,state:n,dispatch:r})=>{let{selection:i}=n,a,o;return typeof e==`number`?(a=e,o=e):e&&`from`in e&&`to`in e?(a=e.from,o=e.to):(a=i.from,o=i.to),r&&t.doc.nodesBetween(a,o,(e,n)=>{if(e.isText)return;let r={...e.attrs};delete r.dir,t.setNodeMarkup(n,void 0,r)}),!0},qr=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let a=null,o=null,s=en(typeof e==`string`?e:e.name,r.schema);if(!s)return!1;s===`node`&&(a=N(e,r.schema)),s===`mark`&&(o=P(e,r.schema));let c=!1;return n.selection.ranges.forEach(e=>{let s=e.$from.pos,l=e.$to.pos,u,d,f,p;n.selection.empty?r.doc.nodesBetween(s,l,(e,t)=>{a&&a===e.type&&(c=!0,f=Math.max(t,s),p=Math.min(t+e.nodeSize,l),u=t,d=e)}):r.doc.nodesBetween(s,l,(e,r)=>{r<s&&a&&a===e.type&&(c=!0,f=Math.max(r,s),p=Math.min(r+e.nodeSize,l),u=r,d=e),r>=s&&r<=l&&(a&&a===e.type&&(c=!0,i&&n.setNodeMarkup(r,void 0,{...e.attrs,...t})),o&&e.marks.length&&e.marks.forEach(a=>{if(o===a.type&&(c=!0,i)){let i=Math.max(r,s),c=Math.min(r+e.nodeSize,l);n.addMark(i,c,o.create({...a.attrs,...t}))}}))}),d&&(u!==void 0&&i&&n.setNodeMarkup(u,void 0,{...d.attrs,...t}),o&&d.marks.length&&d.marks.forEach(e=>{o===e.type&&i&&n.addMark(f,p,o.create({...e.attrs,...t}))}))}),c},H=new w(`__tiptap_decorations__`),Jr=e=>({tr:t,dispatch:n})=>(n&&t.setMeta(H,{type:`force`,name:e}),!0),Yr=(e,t={})=>({state:n,dispatch:r})=>{let i=N(e,n.schema);return s(i,t)(n,r)},Xr=(e,t={})=>({state:n,dispatch:r})=>Ge(N(e,n.schema),t)(n,r),Zr=We({blur:()=>$e,clearContent:()=>et,clearNodes:()=>tt,command:()=>nt,createParagraphNear:()=>rt,cut:()=>it,deleteCurrentNode:()=>at,deleteNode:()=>ot,deleteRange:()=>st,deleteSelection:()=>dt,enter:()=>ft,exitCode:()=>pt,extendMarkRange:()=>yt,first:()=>bt,focus:()=>Tt,forEach:()=>Et,insertContent:()=>Dt,insertContentAt:()=>Pt,insertDefaultBlock:()=>It,joinBackward:()=>zt,joinDown:()=>Rt,joinForward:()=>Bt,joinItemBackward:()=>Ht,joinItemForward:()=>Ut,joinTextblockBackward:()=>Wt,joinTextblockForward:()=>Gt,joinUp:()=>Lt,keyboardShortcut:()=>Jt,lift:()=>Xt,liftEmptyBlock:()=>Zt,liftListItem:()=>Qt,newlineInCode:()=>$t,resetAttributes:()=>nn,scrollIntoView:()=>rn,selectAll:()=>an,selectNodeBackward:()=>on,selectNodeForward:()=>sn,selectParentNode:()=>cn,selectTextblockEnd:()=>ln,selectTextblockStart:()=>un,setContent:()=>fn,setMark:()=>_r,setMeta:()=>vr,setNode:()=>yr,setNodeSelection:()=>br,setTextDirection:()=>xr,setTextSelection:()=>Sr,sinkListItem:()=>Cr,splitBlock:()=>Tr,splitListItem:()=>Er,toggleList:()=>zr,toggleMark:()=>Br,toggleNode:()=>Vr,toggleWrap:()=>Hr,undoInputRule:()=>Ur,unsetAllMarks:()=>Wr,unsetMark:()=>Gr,unsetTextDirection:()=>Kr,updateAttributes:()=>qr,updateDecorations:()=>Jr,wrapIn:()=>Yr,wrapInList:()=>Xr}),U=new WeakMap;function Qr(e,t){U.set(e,(U.get(e)??0)+1);try{return t()}finally{let t=(U.get(e)??1)-1;t>0?U.set(e,t):U.delete(e)}}function $r(e){return U.has(e)}var ei=class{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){let n=this.callbacks[e];return n&&n.forEach(e=>e.apply(this,t)),this}off(e,t){let n=this.callbacks[e];return n&&(t?this.callbacks[e]=n.filter(e=>e!==t):delete this.callbacks[e]),this}once(e,t){let n=(...r)=>{this.off(e,n),t.apply(this,r)};return this.on(e,n)}removeAllListeners(){this.callbacks={}}},ti=typeof process<`u`&&!1;function ni(e){return e.kind===`widget`}function ri(e,t){let n=[],r=new Set;for(let i of e)i.kind===`widget`&&ni(i)&&r.add(i.key),n.push(i.toPMDecoration(t));return{decorations:n,widgetKeys:r}}function ii(e,t,n){let{decorations:r,widgetKeys:i}=ri(t,n);return{set:O.create(e,r),widgetKeys:i}}function ai({position:e,from:t,to:n,docSize:r}){return e<t?!1:e<n||e===n&&n===r}function oi({decorations:e,from:t,to:n,docSize:r,extensionName:i,warnedExtensions:a}){return e.filter(e=>ai({position:e.anchor,from:t,to:n,docSize:r})?!0:(e.anchor===n||a.has(i)||(a.add(i),console.warn(`[tiptap warn]: Extension "${i}" returned a decoration outside the requested range [${t}, ${n}). It was ignored.`)),!1))}function si(e){let t=e.spec?.key;return typeof t==`string`?t:void 0}function ci(e){let t=new Map,n=new Map;for(let r of e.find()){let e=si(r);if(!e)continue;let i=r.spec.extensionName??`unknown`,a=t.get(e)??new Set;a.add(i),t.set(e,a),n.set(e,(n.get(e)??0)+1)}return Array.from(t,([e,t])=>({key:e,extensions:t})).filter(({key:e})=>(n.get(e)??0)>1)}function li(e){return e.jsonID===`attr`}function ui(e){let t=!1;if(e.getMap().forEach(()=>{t=!0}),t||li(e))return!0;let n=e;return typeof n.from==`number`&&typeof n.to==`number`}function di(e,t){let n=null,r=0,i=0;for(let a=0;a<e.childCount&&!(i>t.to);a+=1){let o=i+e.child(a).nodeSize;o>=t.from&&(n===null&&(n=i),r=o),i=o}return n===null?null:{from:n,to:r}}function fi(e,t){if(e.steps.some(e=>!ui(e)))return{type:`full`};let n=Xn(e).map(({newRange:e})=>e);e.steps.forEach((t,r)=>{if(!li(t))return;let i=e.mapping.slice(r);n.push({from:i.map(t.pos,-1),to:i.map(t.pos+1)})});let r=[];for(let e of n){let n=di(t,e);n&&r.push(n)}r.sort((e,t)=>e.from-t.from);let i=[];for(let e of r){let t=i[i.length-1];t&&e.from<=t.to?t.to=Math.max(t.to,e.to):i.push({...e})}return{type:`ranges`,ranges:i}}function pi(e,t,n,r){return e.map(t,n,{onRemove:e=>{let t=e?.key;typeof t==`string`&&r.delete(t)}})}function mi(e,t,n){let r=t.decorationSetsByExtension[e]??O.empty,i=new Set(t.widgetKeysByExtension[e]??[]);return{set:pi(r,n.mapping,n.doc,i),widgetKeys:i}}function hi(e,t){let n=Object.values(t).flatMap(e=>e.find());return O.create(e,n)}function gi(e){let t=new Set;for(let n of Object.values(e))for(let e of n)t.add(e);return t}function _i(e,t){switch(t.update??`document`){case`document`:if(t.createInRange)throw Error(`[tiptap error]: Extension "${e}" provides createInRange() but does not use the "changedRanges" decoration update strategy.`);return;case`changedRanges`:if(!t.createInRange)throw Error(`[tiptap error]: Extension "${e}" uses the "changedRanges" decoration update strategy but does not provide createInRange().`);return;case`manual`:if(t.createInRange)throw Error(`[tiptap error]: Extension "${e}" uses the "manual" decoration update strategy, which is not compatible with createInRange(). createInRange() requires the "changedRanges" strategy.`);if(t.shouldUpdate)throw Error(`[tiptap error]: Extension "${e}" cannot combine the "manual" decoration update strategy with shouldUpdate().`);return;default:throw Error(`[tiptap error]: Extension "${e}" uses an unknown decoration update strategy. Expected "document", "changedRanges", or "manual".`)}}function vi(e,t,n){return n?!0:e.update===`manual`?!1:e.shouldUpdate?e.shouldUpdate(t):t.tr.docChanged}var yi=new Set,bi=class{constructor(e){this.warnedWidgetKeys=new Set,this.warnedOutOfRangeExtensions=new Set,this.handleBeforeTransaction=({nextState:e})=>{let t=H.getState(e);t&&this.warnDuplicateWidgetKeys(t)},this.editor=e.editor,this.entries=this.resolveEntries(e.entries),this.entries.forEach(({name:e,spec:t})=>_i(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(){return H.getState(this.editor.state)?.widgetKeys??yi}get mountedView(){return this.editor.isDestroyed?null:this.editor.view}resolveEntries(e){let t=[];for(let{name:n,addDecorations:r}of e){let e=r();e&&t.push({name:n,spec:e})}return t}createPlugin(){let{editor:e,entries:t}=this;return new A({key:H,state:{init:(e,n)=>{let r={},i={};for(let{name:e,spec:a}of t){let{set:t,widgetKeys:o}=this.buildFullSet(e,a,n);r[e]=t,i[e]=o}let a={decorationSetsByExtension:r,widgetKeysByExtension:i,mergedDecorationSet:this.buildMergedSet(n.doc,r),widgetKeys:gi(i)};return this.warnDuplicateWidgetKeys(a),a},apply:(n,r,i,a)=>{let o=n.getMeta(H),s=o?.type===`force`&&!o.name,c=o?.type===`force`?o.name:void 0,l={},u={},d=new Set;return Qr(e,()=>{for(let{name:o,spec:f}of t){let t=s||c===o;if(!vi(f,{editor:e,tr:n,oldState:i,newState:a},t)){let e=mi(o,r,n);l[o]=e.set,u[o]=e.widgetKeys}else if(f.update===`changedRanges`&&n.docChanged&&!t){let e=this.applyChangedRangesRecompute(o,f,r,n,a);l[o]=e.set,u[o]=e.widgetKeys,d.add(o)}else{let{set:e,widgetKeys:t}=this.buildFullSet(o,f,a);l[o]=e,u[o]=t,d.add(o)}}}),d.size===0&&!n.docChanged?r:{decorationSetsByExtension:l,widgetKeysByExtension:u,mergedDecorationSet:this.mergeAfterApply({entries:t,previous:r,tr:n,decorationSetsByExtension:l,recomputedNames:d}),widgetKeys:gi(u)}}},props:{decorations(e){return H.getState(e)?.mergedDecorationSet??O.empty}}})}applyChangedRangesRecompute(e,t,n,r,i){let a=fi(r,i.doc);return a.type===`full`?this.buildFullSet(e,t,i):this.rebuildRanges(e,t,n,r,i,a.ranges)}rebuildRanges(e,t,n,r,i,a){let o=n.decorationSetsByExtension[e]??O.empty,s=new Set(n.widgetKeysByExtension[e]??[]),c=pi(o,r.mapping,r.doc,s),l=i.doc.content.size;for(let{from:n,to:r}of a){let a=c.find(n,r).filter(e=>ai({position:e.from,from:n,to:r,docSize:l}));for(let e of a){let t=si(e);t&&s.delete(t)}c=c.remove(a);let{decorations:o,widgetKeys:u}=ri(oi({decorations:this.runCreate(e,`createInRange`,()=>t.createInRange({editor:this.editor,state:i,view:this.mountedView,from:n,to:r})),from:n,to:r,docSize:l,extensionName:e,warnedExtensions:this.warnedOutOfRangeExtensions}),e);c=c.add(i.doc,o);for(let e of u)s.add(e)}return{set:c,widgetKeys:s}}buildFullSet(e,t,n){let r=this.runCreate(e,`create`,()=>t.create({editor:this.editor,state:n,view:this.mountedView}));return ii(n.doc,r,e)}runCreate(e,t,n){try{return n()}catch(n){return console.error(`[tiptap error]: Extension "${e}" threw in \`addDecorations().${t}()\`. Its decorations were dropped for this update.`,n),[]}}warnDuplicateWidgetKeys(e){if(!ti)return;if(e.widgetKeys.size===0){this.warnedWidgetKeys.clear();return}let t=ci(e.mergedDecorationSet),n=new Set(t.map(({key:e})=>e));for(let{key:e,extensions:n}of t){if(this.warnedWidgetKeys.has(e))continue;let t=Array.from(n).map(e=>`"${e}"`).join(`, `);console.warn(`[tiptap warn]: Duplicate widget decoration key "${e}" in extension${n.size===1?``:`s`} ${t}. Widget decoration keys must be globally unique, otherwise ProseMirror misplaces the widget DOM. Use a stable, unique key (e.g. \`comment-\${id}\`).`)}this.warnedWidgetKeys=n}buildMergedSet(e,t){let n=Object.keys(t);return n.length===1?t[n[0]]:hi(e,t)}mergeAfterApply({entries:e,previous:t,tr:n,decorationSetsByExtension:r,recomputedNames:i}){return e.length===1?r[e[0].name]:i.size===0?t.mergedDecorationSet.map(n.mapping,n.doc):hi(n.doc,r)}};function xi(e,t){let{selection:n}=e,{$from:r}=n;if(n instanceof k){let e=r.index();return r.parent.canReplaceWith(e,e+1,t)}let i=r.depth;for(;i>=0;){let e=r.index(i);if(r.node(i).contentMatchAt(e).matchType(t))return!0;--i}return!1}function Si(e,t,n){let r=document.querySelector(`style[data-tiptap-style${n?`-${n}`:``}]`);if(r!==null)return r;let i=document.createElement(`style`);return t&&i.setAttribute(`nonce`,t),i.setAttribute(`data-tiptap-style${n?`-${n}`:``}`,``),i.innerHTML=e,document.getElementsByTagName(`head`)[0].appendChild(i),i}function Ci(e){return typeof e==`number`}function wi(e){return Object.prototype.toString.call(e).slice(8,-1)}function Ti(e){return wi(e)===`Object`&&e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}function Ei(e,t,n){let r=e.split(`
|
|
6
|
-
`),i=[],a=``,o=0,s=t.baseIndentSize||2;for(;o<r.length;){let e=r[o],u=e.match(t.itemPattern);if(!u){if(i.length>0)break;if(e.trim()===``){o+=1,a=`${a}${e}\n`;continue}return}let d=t.extractItemData(u),{indentLevel:f,mainContent:p}=d;a=`${a}${e}\n`;let m=[p];for(o+=1;o<r.length;){var c;let e=r[o];if(e.trim()===``){var l;let t=r.slice(o+1).findIndex(e=>e.trim()!==``);if(t===-1)break;if((((l=r[o+1+t].match(/^(\s*)/))==null||(l=l[1])==null?void 0:l.length)||0)>f){m.push(e),a=`${a}${e}\n`,o+=1;continue}break}if((((c=e.match(/^(\s*)/))==null||(c=c[1])==null?void 0:c.length)||0)>f)m.push(e),a=`${a}${e}\n`,o+=1;else break}let h,g=m.slice(1);if(g.length>0){let e=g.map(e=>e.slice(f+s)).join(`
|
|
7
|
-
`);e.trim()&&(h=t.customNestedParser?t.customNestedParser(e):n.blockTokens(e))}let _=t.createToken(d,h);i.push(_)}if(i.length!==0)return{items:i,raw:a}}var Di=4;function Oi(e){let t=0;for(let n of e)t=n===` `?t+Di-t%Di:t+1;return t}function ki(e,t,n,r,i){if(!e||!Array.isArray(e.content))return``;let a=typeof n==`function`?n(r):n,[o,...s]=e.content,c=`${a}${t.renderChildren([o])}`;return s&&s.length>0&&s.forEach((e,n)=>{let r=t.renderChild?.call(t,e,n+1)??t.renderChildren([e]);if(r!=null){let n=e=>{if(!i?.alignNestedToPrefix)return t.indent(e);let n=t.indent(``),r=Oi(a);return(Oi(n)>=r?n:` `.repeat(r))+e},o=r.split(`
|
|
8
|
-
`).map(e=>n(e||``)).join(`
|
|
9
|
-
`);c+=e.type===`paragraph`?`\n\n${o}`:`\n${o}`}}),c}function Ai(e,t){let n={...e};return Ti(e)&&Ti(t)&&Object.keys(t).forEach(r=>{Ti(t[r])&&Ti(e[r])?n[r]=Ai(e[r],t[r]):n[r]=t[r]}),n}function ji(e,t,n={}){let{state:r}=t,{doc:i,tr:a}=r,o=e;i.descendants((t,r)=>{let i=a.mapping.map(r),s=a.mapping.map(r)+t.nodeSize,c=null;if(t.marks.forEach(e=>{if(e!==o)return!1;c=e}),!c)return;let l=!1;if(Object.keys(n).forEach(e=>{n[e]!==c.attrs[e]&&(l=!0)}),l){let t=e.type.create({...e.attrs,...n});a.removeMark(i,s,e.type),a.addMark(i,s,t)}}),a.docChanged&&t.view.dispatch(a)}var Mi=class{constructor(e,t,n){this.component=e,this.editor=t.editor,this.options={...n},this.mark=t.mark,this.HTMLAttributes=t.HTMLAttributes}get dom(){return this.editor.view.dom}get contentDOM(){return null}updateAttributes(e,t){ji(t||this.mark,this.editor,e)}ignoreMutation(e){return!this.dom||!this.contentDOM?!0:typeof this.options.ignoreMutation==`function`?this.options.ignoreMutation({mutation:e}):e.type===`selection`||this.contentDOM.contains(e.target)&&e.type===`childList`&&(I()||Ct())&&this.editor.isFocused&&[...Array.from(e.addedNodes),...Array.from(e.removedNodes)].every(e=>e.isContentEditable)?!1:this.contentDOM===e.target&&e.type===`attributes`||!this.contentDOM.contains(e.target)}},Ni=class{constructor(e){this.find=e.find,this.handler=e.handler,this.undoable=e.undoable??!0}},Pi=(e,t)=>{if(mt(t))return t.exec(e);let n=t(e);if(!n)return null;let r=[n.text];return r.index=n.index,r.input=e,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn(`[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".`),r.push(n.replaceWith)),r};function Fi(e){let{editor:t,from:n,to:r,text:i,insertText:a}=e;if(!a)return{inputTransaction:null,tr:t.view.state.tr};let o=t.view.state.tr.insertText(i,n,r);return{inputTransaction:o,tr:fe.create({doc:o.doc,selection:o.selection,storedMarks:o.storedMarks}).tr}}function Ii(e){let{editor:t,from:n,to:r,text:i,rule:a,match:o,plugin:s,insertText:c}=e,{view:l}=t,{inputTransaction:u,tr:d}=Fi({editor:t,from:n,to:r,text:i,insertText:c}),f=u?n+i.length:r,p=Qe({state:l.state,transaction:d}),m={from:n-(o[0].length-i.length),to:f},{commands:h,chain:g,can:_}=new M({editor:t,state:p});return a.handler({state:p,range:m,match:o,commands:h,chain:g,can:_})===null||!d.steps.length?!1:(u&&(l.dispatch(u),!l.state.doc.eq(u.doc))||(ee(d),d.setMeta(`inputRule`,!0),a.undoable&&d.setMeta(s,{transform:d,from:n,to:f,text:i}),l.dispatch(d)),!0)}function Li(e,t,n){let r=t[0].length-n.length;if(r<=0)return!0;let i=e.parentOffset-r;return i>=0&&e.parent.textBetween(i,e.parentOffset)===t[0].slice(0,r)}function Ri(e){let{editor:t,from:n,to:r,text:i,rules:a,plugin:o,insertText:s}=e,{view:c}=t;if(c.composing)return!1;let l=c.state.doc.resolve(n);if(l.parent.type.spec.code||(l.nodeBefore||l.nodeAfter)?.marks.find(e=>e.type.spec.code))return!1;let u=tr(l)+i;for(let e of a){let a=Pi(u,e.find);if(a&&Li(l,a,i)&&Ii({editor:t,from:n,to:r,text:i,rule:e,match:a,plugin:o,insertText:s}))return!0}return!1}function zi(e){let{editor:t,rules:n}=e,r=new A({state:{init(){return null},apply(e,i,a){let o=e.getMeta(r);if(o)return o;let s=e.getMeta(`applyInputRules`);return s&&setTimeout(()=>{let{text:e}=s;e=typeof e==`string`?e:yn(C.from(e),a.schema);let{from:i}=s,o=i+e.length;Ri({editor:t,from:i,to:o,text:e,rules:n,plugin:r})}),e.selectionSet||e.docChanged?null:i}},props:{handleTextInput(e,i,a,o){return Ri({editor:t,from:i,to:a,text:o,rules:n,plugin:r,insertText:!0})},handleDOMEvents:{compositionend:e=>(setTimeout(()=>{let{$cursor:i}=e.state.selection;i&&Ri({editor:t,from:i.pos,to:i.pos,text:``,rules:n,plugin:r})}),!1)},handleKeyDown(e,i){if(i.key!==`Enter`)return!1;let{$cursor:a}=e.state.selection;return a?Ri({editor:t,from:a.pos,to:a.pos,text:`
|
|
10
|
-
`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}var Bi=class{constructor(e={}){this.type=`extendable`,this.parent=null,this.child=null,this.name=``,this.config={name:this.name},this.config={...this.config,...e},this.name=this.config.name}get options(){return{...R(L(this,`addOptions`,{name:this.name}))}}get storage(){return{...R(L(this,`addStorage`,{name:this.name,options:this.options}))}}configure(e={}){let t=this.extend({...this.config,addOptions:()=>Ai(this.options,e)});return t.name=this.name,t.parent=this.parent,this.child=null,t}extend(e={}){let t=new this.constructor({...this.config,...e});return t.parent=this,this.child=t,t.name=`name`in e?e.name:t.parent.name,t}},W=class e extends Bi{constructor(...e){super(...e),this.type=`mark`}static create(t={}){let n=typeof t==`function`?t():t;return new e(n)}static handleExit({editor:e,mark:t}){let{tr:n}=e.state,r=e.state.selection.$from;if(r.pos===r.end()){let i=r.marks();if(!i.find(e=>e?.type.name===t.name))return!1;let a=i.find(e=>e?.type.name===t.name);return a&&n.removeStoredMark(a),n.insertText(` `,r.pos),e.view.dispatch(n),!0}return!1}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}},Vi=class{constructor(e){this.find=e.find,this.handler=e.handler}},Hi=(e,t,n)=>{if(mt(t))return[...e.matchAll(t)];let r=t(e,n);return r?r.map(t=>{let n=[t.text];return n.index=t.index,n.input=e,n.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn(`[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".`),n.push(t.replaceWith)),n}):[]};function Ui(e){let{editor:t,state:n,from:r,to:i,rule:a,pasteEvent:o,dropEvent:s}=e,{commands:c,chain:l,can:u}=new M({editor:t,state:n}),d=[];return n.doc.nodesBetween(r,i,(e,t)=>{var f;if((f=e.type)!=null&&(f=f.spec)!=null&&f.code||!(e.isText||e.isTextblock||e.isInline))return;let p=e.content?.size??e.nodeSize??0,m=Math.max(r,t),h=Math.min(i,t+p);m>=h||Hi(e.isText?e.text||``:e.textBetween(m-t,h-t,void 0,``),a.find,o).forEach(e=>{if(e.index===void 0)return;let t=m+e.index+1,r=t+e[0].length,i={from:n.tr.mapping.map(t),to:n.tr.mapping.map(r)},f=a.handler({state:n,range:i,match:e,commands:c,chain:l,can:u,pasteEvent:o,dropEvent:s});d.push(f)})}),d.every(e=>e!==null)}var Wi=null,Gi=e=>{var t;let n=new ClipboardEvent(`paste`,{clipboardData:new DataTransfer});return(t=n.clipboardData)==null||t.setData(`text/html`,e),n};function Ki(e){let{editor:t,rules:n}=e,r=null,i=!1,a=!1,o=typeof ClipboardEvent<`u`?new ClipboardEvent(`paste`):null,s;try{s=typeof DragEvent<`u`?new DragEvent(`drop`):null}catch{s=null}let c=({state:e,from:n,to:r,rule:i,pasteEvt:a})=>{let c=e.tr,l=Qe({state:e,transaction:c});if(Ui({editor:t,state:l,from:Math.max(n-1,0),to:r.b-1,rule:i,pasteEvent:a,dropEvent:s})&&c.steps.length){try{s=typeof DragEvent<`u`?new DragEvent(`drop`):null}catch{s=null}return o=typeof ClipboardEvent<`u`?new ClipboardEvent(`paste`):null,c}};return t.on(`destroy`,()=>{Wi===t&&(Wi=null)}),n.map(e=>new A({view(e){let n=n=>{r=e.dom.parentElement?.contains(n.target)?e.dom.parentElement:null,r&&(Wi=t)},i=()=>{Wi&&=null};return window.addEventListener(`dragstart`,n),window.addEventListener(`dragend`,i),{destroy(){window.removeEventListener(`dragstart`,n),window.removeEventListener(`dragend`,i)}}},props:{handleDOMEvents:{drop:(e,t)=>{if(a=r===e.dom.parentElement,s=t,!a){let e=Wi;e?.isEditable&&setTimeout(()=>{if(e.isDestroyed)return;let t=e.state.selection;t&&e.commands.deleteRange({from:t.from,to:t.to})},10)}return!1},paste:(e,t)=>{let n=t.clipboardData?.getData(`text/html`);return o=t,i=!!n?.includes(`data-pm-slice`),!1}}},appendTransaction:(t,n,r)=>{let s=t[0],l=s.getMeta(`uiEvent`)===`paste`&&!i,u=s.getMeta(`uiEvent`)===`drop`&&!a,d=s.getMeta(`applyPasteRules`),f=!!d;if(!l&&!u&&!f)return;if(f){let{text:t}=d;t=typeof t==`string`?t:yn(C.from(t),r.schema);let{from:n}=d,i=n+t.length,a=Gi(t);return c({rule:e,state:r,from:n,to:{b:i},pasteEvt:a})}let p=n.doc.content.findDiffStart(r.doc.content),m=n.doc.content.findDiffEnd(r.doc.content);if(Ci(p)&&m&&p!==m.b)return c({rule:e,state:r,from:p,to:m,pasteEvt:o})}}))}var qi=class{constructor(e,t){this.splittableMarks=[],this.nonClearableMarks=[],this.decorationManager=null,this.editor=t,this.baseExtensions=e,this.extensions=Vn(e),this.hasSchemaSpec=t.options.schemaSpec!==void 0,this.schema=zn(this.extensions,t,t.options.schemaSpec),this.setupExtensions()}get commands(){return this.extensions.reduce((e,t)=>{let n=L(t,`addCommands`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:V(t.name,this.schema)});return n?{...e,...n()}:e},{})}get plugins(){let{editor:e}=this,t=Bn([...this.extensions].reverse()).flatMap(t=>{let n={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:V(t.name,this.schema)},r=[],i=L(t,`addKeyboardShortcuts`,n),a={};if(t.type===`mark`&&L(t,`exitable`,n)&&(a.ArrowRight=()=>W.handleExit({editor:e,mark:t})),i){let t=Object.fromEntries(Object.entries(i()).map(([t,n])=>[t,()=>n({editor:e})]));a={...a,...t}}let o=b(a);r.push(o);let s=L(t,`addInputRules`,n);if(or(t,e.options.enableInputRules)&&s){let t=s();if(t&&t.length){let n=zi({editor:e,rules:t}),i=Array.isArray(n)?n:[n];r.push(...i)}}let c=L(t,`addPasteRules`,n);if(or(t,e.options.enablePasteRules)&&c){let t=c();if(t&&t.length){let n=Ki({editor:e,rules:t});r.push(...n)}}let l=L(t,`addProseMirrorPlugins`,n);if(l){let e=l();r.push(...e)}return r}),n=this.createDecorationPlugin();return n&&t.push(n),t}createDecorationPlugin(){var e;let{editor:t}=this;(e=this.decorationManager)==null||e.destroy();let n=[];return this.extensions.forEach(e=>{let r=L(e,`addDecorations`,{name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:t,type:V(e.name,this.schema)});r&&n.push({name:e.name,addDecorations:r})}),this.decorationManager=new bi({editor:t,entries:n}),this.decorationManager.plugin}get attributes(){let e=kn(this.extensions);return this.hasSchemaSpec?bn(e,this.schema):e}get nodeViews(){let{editor:e}=this,{nodeExtensions:t}=On(this.extensions);return Object.fromEntries(t.filter(e=>!!L(e,`addNodeView`)).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r=L(t,`addNodeView`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:N(t.name,this.schema)});if(!r)return[];let i=r();return i?[t.name,(r,a,o,s,c)=>{let l=B(r,n);return i({node:r,view:a,getPos:o,decorations:s,innerDecorations:c,editor:e,extension:t,HTMLAttributes:l})}]:[]}))}dispatchTransaction(e){let{editor:t}=this;return Bn([...this.extensions].reverse()).reduceRight((e,n)=>{let r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:V(n.name,this.schema)},i=L(n,`dispatchTransaction`,r);return i?t=>{i.call(r,{transaction:t,next:e})}:e},e)}transformPastedHTML(e){let{editor:t}=this;return Bn([...this.extensions]).reduce((e,n)=>{let r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:V(n.name,this.schema)},i=L(n,`transformPastedHTML`,r);return i?(t,n)=>{let a=e(t,n);return i.call(r,a)}:e},e||(e=>e))}get markViews(){let{editor:e}=this,{markExtensions:t}=On(this.extensions);return Object.fromEntries(t.filter(e=>!!L(e,`addMarkView`)).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r=L(t,`addMarkView`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:P(t.name,this.schema)});return r?[t.name,(i,a,o)=>{let s=B(i,n);return r()({mark:i,view:a,inline:o,editor:e,extension:t,HTMLAttributes:s,updateAttributes:t=>{ji(i,e,t)}})}]:[]}))}destroy(){var e;(e=this.decorationManager)==null||e.destroy(),this.extensions.forEach(e=>{let t=e;for(;t.parent;){let e=t.parent;e.child===t&&(e.child=null),t=e}}),this.extensions=[],this.baseExtensions=[],this.decorationManager=null,this.schema=null,this.editor=null}setupExtensions(){let e=this.extensions;this.editor.extensionStorage=Object.fromEntries(e.map(e=>[e.name,e.storage])),e.forEach(e=>{let t={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:V(e.name,this.schema)};e.type===`mark`&&((R(L(e,`keepOnSplit`,t))??!0)&&this.splittableMarks.push(e.name),(R(L(e,`clearable`,t))??!0)||this.nonClearableMarks.push(e.name));let n=L(e,`onBeforeCreate`,t),r=L(e,`onCreate`,t),i=L(e,`onUpdate`,t),a=L(e,`onSelectionUpdate`,t),o=L(e,`onTransaction`,t),s=L(e,`onFocus`,t),c=L(e,`onBlur`,t),l=L(e,`onDestroy`,t);n&&this.editor.on(`beforeCreate`,n),r&&this.editor.on(`create`,r),i&&this.editor.on(`update`,i),a&&this.editor.on(`selectionUpdate`,a),o&&this.editor.on(`transaction`,o),s&&this.editor.on(`focus`,s),c&&this.editor.on(`blur`,c),l&&this.editor.on(`destroy`,l)})}};qi.resolve=Vn,qi.sort=Bn,qi.flatten=vn;var G=class e extends Bi{constructor(...e){super(...e),this.type=`extension`}static create(t={}){let n=typeof t==`function`?t():t;return new e(n)}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}},Ji=G.create({name:`clipboardTextSerializer`,addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new A({key:new w(`clipboardTextSerializer`),props:{clipboardTextSerializer:()=>{let{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:i}=t,a=Gn(n),{blockSeparator:o}=this.options,s={...o===void 0?{}:{blockSeparator:o},textSerializers:a};return[...i.ranges].sort((e,t)=>e.$from.pos-t.$from.pos).map(({$from:e,$to:t})=>Un(r,{from:e.pos,to:t.pos},s)).join(o??`
|
|
11
|
-
|
|
12
|
-
`)}}})]}}),Yi=G.create({name:`commands`,addCommands(){return{...Zr}}}),Xi=G.create({name:`delete`,onUpdate({transaction:e,appendedTransactions:t}){var n;let r=()=>{var n,r;if(((n=this.editor.options.coreExtensionOptions)==null||(n=n.delete)==null||(r=n.filterTransaction)==null?void 0:r.call(n,e))??e.getMeta(`y-sync$`))return;let i=mn(e.before,[e,...t]);Xn(i).forEach(t=>{i.mapping.mapResult(t.oldRange.from).deletedAfter&&i.mapping.mapResult(t.oldRange.to).deletedBefore&&i.before.nodesBetween(t.oldRange.from,t.oldRange.to,(n,r)=>{let a=r+n.nodeSize-2,o=t.oldRange.from<=r&&a<=t.oldRange.to;this.editor.emit(`delete`,{type:`node`,node:n,from:r,to:a,newFrom:i.mapping.map(r),newTo:i.mapping.map(a),deletedRange:t.oldRange,newRange:t.newRange,partial:!o,editor:this.editor,transaction:e,combinedTransform:i})})});let a=i.mapping;i.steps.forEach((t,n)=>{if(t instanceof ve){let r=a.slice(n).map(t.from,-1),o=a.slice(n).map(t.to),s=a.invert().map(r,-1),c=a.invert().map(o),l=r>0&&i.doc.nodeAt(r-1)?.marks.some(e=>e.eq(t.mark)),u=i.doc.nodeAt(o)?.marks.some(e=>e.eq(t.mark));this.editor.emit(`delete`,{type:`mark`,mark:t.mark,from:t.from,to:t.to,deletedRange:{from:s,to:c},newRange:{from:r,to:o},partial:!!(u||l),editor:this.editor,transaction:e,combinedTransform:i})}})};((n=this.editor.options.coreExtensionOptions)==null||(n=n.delete)==null?void 0:n.async)??!0?setTimeout(r,0):r()}}),Zi=G.create({name:`drop`,addProseMirrorPlugins(){return[new A({key:new w(`tiptapDrop`),props:{handleDrop:(e,t,n,r)=>{this.editor.emit(`drop`,{editor:this.editor,event:t,slice:n,moved:r})}}})]}}),Qi=G.create({name:`editable`,addProseMirrorPlugins(){return[new A({key:new w(`editable`),props:{editable:()=>this.editor.options.editable}})]}}),$i=new w(`focusEvents`),ea=G.create({name:`focusEvents`,addProseMirrorPlugins(){let{editor:e}=this;return[new A({key:$i,props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;let r=e.state.tr.setMeta(`focus`,{event:n}).setMeta(`addToHistory`,!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;let r=e.state.tr.setMeta(`blur`,{event:n}).setMeta(`addToHistory`,!1);return t.dispatch(r),!1}}}})]}}),ta=G.create({name:`keymap`,addKeyboardShortcuts(){let e=()=>this.editor.commands.first(({commands:e})=>[()=>e.undoInputRule(),()=>e.command(({tr:t})=>{let{selection:n,doc:r}=t,{empty:i,$anchor:a}=n,{pos:o,parent:s}=a,c=a.parent.isTextblock&&o>0?t.doc.resolve(o-1):a,l=c.parent.type.spec.isolating,u=a.pos-a.parentOffset,d=l&&c.parent.childCount===1?u===a.pos:D.atStart(r).from===o;return!i||!s.type.isTextblock||s.textContent.length||!d||d&&a.parent.type.name===`paragraph`?!1:e.clearNodes()}),()=>e.deleteSelection(),()=>e.joinBackward(),()=>e.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:e})=>[()=>e.deleteSelection(),()=>e.deleteCurrentNode(),()=>e.joinForward(),()=>e.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:e})=>[()=>e.newlineInCode(),()=>e.createParagraphNear(),()=>e.liftEmptyBlock(),()=>e.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},r={...n},i={...n,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return I()||Kt()?i:r},addProseMirrorPlugins(){return[new A({key:new w(`clearDocument`),appendTransaction:(e,t,n)=>{if(e.some(e=>e.getMeta(`composition`)))return;let r=e.some(e=>e.docChanged)&&!t.doc.eq(n.doc),i=e.some(e=>e.getMeta(`preventClearDocument`));if(!r||i)return;let{empty:a,from:o,to:s}=t.selection,c=D.atStart(t.doc).from,l=D.atEnd(t.doc).to;if(a||o!==c||s!==l||!cr(n.doc))return;let u=n.tr,d=Qe({state:n,transaction:u}),{commands:f}=new M({editor:this.editor,state:d});if(f.clearNodes(),u.steps.length)return u}})]}}),na=G.create({name:`paste`,addProseMirrorPlugins(){return[new A({key:new w(`tiptapPaste`),props:{handlePaste:(e,t,n)=>{this.editor.emit(`paste`,{editor:this.editor,event:t,slice:n})}}})]}}),ra=G.create({name:`tabindex`,addOptions(){return{value:void 0}},addProseMirrorPlugins(){return[new A({key:new w(`tabindex`),props:{attributes:()=>!this.editor.isEditable&&this.options.value===void 0?{}:{tabindex:this.options.value??`0`}}})]}}),ia=G.create({name:`textDirection`,addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];let{nodeExtensions:e}=On(this.extensions);return[{types:e.filter(e=>e.name!==`text`).map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{let 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 A({key:new w(`textDirection`),props:{attributes:()=>{let e=this.options.direction;return e?{dir:e}:{}}}})]}}),aa=We({ClipboardTextSerializer:()=>Ji,Commands:()=>Yi,Delete:()=>Xi,Drop:()=>Zi,Editable:()=>Qi,FocusEvents:()=>ea,Keymap:()=>ta,Paste:()=>na,Tabindex:()=>ra,TextDirection:()=>ia,focusEventsPluginKey:()=>$i}),oa=!1;function sa(e){if(oa)return;oa=!0;let t;try{let n=he.fromJSON(e,{from:0,to:0});if(!dr(n))return;t=n.slice.content}catch{return}t instanceof C||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 ca=class e{get name(){return this.node.type.name}constructor(e,t,n=!1,r=null){this.currentNode=null,this.actualDepth=null,this.isBlock=n,this.resolvedPos=e,this.editor=t,this.currentNode=r}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){return this.actualDepth??this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let t=this.from,n=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,n=this.to-1}this.editor.commands.insertContentAt({from:t,to:n},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}get parent(){if(this.depth===0)return null;let t=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(t);return new e(n,this.editor)}get before(){let t=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.from-3)),new e(t,this.editor)}get after(){let t=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.to+3)),new e(t,this.editor)}get children(){let t=[];return this.node.content.forEach((n,r)=>{let i=n.isBlock&&!n.isTextblock,a=n.isAtom&&!n.isText,o=n.isInline,s=this.pos+r+ +!a;if(s<0||s>this.resolvedPos.doc.nodeSize-2)return;let c=this.resolvedPos.doc.resolve(s);if(!i&&!o&&c.depth<=this.depth)return;let l=new e(c,this.editor,i,i||o?n:null);i&&(l.actualDepth=this.depth+1),t.push(l)}),t}get firstChild(){return this.children[0]||null}get lastChild(){let e=this.children;return e[e.length-1]||null}closest(e,t={}){let n=null,r=this.parent;for(;r&&!n;){if(r.node.type.name===e){if(Object.keys(t).length>0){let e=r.node.attrs,n=Object.keys(t);for(let r=0;r<n.length;r+=1){let i=n[r];if(e[i]!==t[i])break}}else n=r}r=r.parent}return n}querySelector(e,t={}){return this.querySelectorAll(e,t,!0)[0]||null}querySelectorAll(e,t={},n=!1){let r=[];if(!this.children||this.children.length===0)return r;let i=Object.keys(t);return this.children.forEach(a=>{n&&r.length>0||(a.node.type.name===e&&i.every(e=>t[e]===a.node.attrs[e])&&r.push(a),!(n&&r.length>0)&&(r=r.concat(a.querySelectorAll(e,t,n))))}),r}setAttribute(e){let{tr:t}=this.editor.state;t.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(t)}},la=`.ProseMirror {
|
|
13
|
-
position: relative;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.ProseMirror {
|
|
17
|
-
word-wrap: break-word;
|
|
18
|
-
white-space: pre-wrap;
|
|
19
|
-
white-space: break-spaces;
|
|
20
|
-
-webkit-font-variant-ligatures: none;
|
|
21
|
-
font-variant-ligatures: none;
|
|
22
|
-
font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
.ProseMirror [contenteditable="false"] {
|
|
26
|
-
white-space: normal;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.ProseMirror [contenteditable="false"] [contenteditable="true"] {
|
|
30
|
-
white-space: pre-wrap;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.ProseMirror pre {
|
|
34
|
-
white-space: pre-wrap;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
img.ProseMirror-separator {
|
|
38
|
-
display: inline !important;
|
|
39
|
-
border: none !important;
|
|
40
|
-
margin: 0 !important;
|
|
41
|
-
width: 0 !important;
|
|
42
|
-
height: 0 !important;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.ProseMirror-gapcursor {
|
|
46
|
-
display: none;
|
|
47
|
-
pointer-events: none;
|
|
48
|
-
position: absolute;
|
|
49
|
-
margin: 0;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
.ProseMirror-gapcursor:after {
|
|
53
|
-
content: "";
|
|
54
|
-
display: block;
|
|
55
|
-
position: absolute;
|
|
56
|
-
top: -2px;
|
|
57
|
-
width: 20px;
|
|
58
|
-
border-top: 1px solid black;
|
|
59
|
-
animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
@keyframes ProseMirror-cursor-blink {
|
|
63
|
-
to {
|
|
64
|
-
visibility: hidden;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
.ProseMirror-hideselection *::selection {
|
|
69
|
-
background: transparent;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
.ProseMirror-hideselection *::-moz-selection {
|
|
73
|
-
background: transparent;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
.ProseMirror-hideselection * {
|
|
77
|
-
caret-color: transparent;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
.ProseMirror-focused .ProseMirror-gapcursor {
|
|
81
|
-
display: block;
|
|
82
|
-
}`,ua=class extends ei{constructor(e={}){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:e})=>{throw e},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:pr,createMappablePosition:mr},this.setOptions(e),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:e,slice:t,moved:n})=>this.options.onDrop(e,t,n)),this.on(`paste`,({event:e,slice:t})=>this.options.onPaste(e,t)),this.on(`delete`,this.options.onDelete);let t=this.createDoc();if(!this.editorState){let e=St(t,this.options.autofocus);this.editorState=fe.create({doc:t,schema:this.schema,selection:e||void 0})}sa(this.schema),this.options.element&&this.mount(this.options.element)}mount(e){if(typeof document>`u`)throw Error(`[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.`);this.createView(e),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;let e=this.editorView.dom;e?.editor&&delete e.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(e){console.warn(`Failed to remove CSS element:`,e)}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():M.createFakeChain()}can(){return this.commandManager?this.commandManager.can():M.createFallbackCan()}injectCSS(){this.options.injectCSS&&typeof document<`u`&&(this.css=Si(la,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},this.editorView&&this.state&&!this.isDestroyed&&(this.options.editorProps&&this.view.setProps({...this.options.editorProps,attributes:this.getEditorViewAttributes()}),this.view.updateState(this.state))}setEditable(e,t=!0){this.setOptions({editable:e}),t&&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:e=>{this.editorState=e},dispatch:e=>{this.dispatchTransaction(e)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(e,t)=>{if(this.editorView)return this.editorView[t];if(t===`state`)return this.editorState;if(t in e)return Reflect.get(e,t);throw Error(`[tiptap error]: The editor view is not available. Cannot access view['${t}']. The editor may not be mounted yet.`)}})}get state(){return ti&&!this.hasWarnedStaleDecorationRead&&$r(this)&&(this.hasWarnedStaleDecorationRead=!0,console.warn("[tiptap warn]: `editor.state` was read while decoration `create()` was running. It returns the pre-transaction document. Use the `state` argument passed to `create()` instead. Helpers like `editor.isActive()` read `editor.state` too, so pass `state` to their standalone versions instead of calling them on the editor.")),this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(e,t){let n=An(t)?t(e,[...this.state.plugins]):[...this.state.plugins,e],r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}unregisterPlugin(e){if(this.isDestroyed)return;let t=this.state.plugins,n=t;if([].concat(e).forEach(e=>{let t=typeof e==`string`?`${e}$`:e.key;n=n.filter(e=>!e.key.startsWith(t))}),t.length===n.length)return;let r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){var e,t;let n=[...this.options.enableCoreExtensions?[Qi,Ji.configure({blockSeparator:(e=this.options.coreExtensionOptions)==null||(e=e.clipboardTextSerializer)==null?void 0:e.blockSeparator}),Yi,ea,ta,ra.configure({value:(t=this.options.coreExtensionOptions)==null||(t=t.tabindex)==null?void 0:t.value}),Zi,na,Xi,ia.configure({direction:this.options.textDirection})].filter(e=>typeof this.options.enableCoreExtensions!=`object`||this.options.enableCoreExtensions[e.name]!==!1):[],...this.options.extensions].filter(e=>[`extension`,`node`,`mark`].includes(e?.type));this.extensionManager=new qi(n,this)}createCommandManager(){this.commandManager=new M({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let e;try{e=dn(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;let t=dn(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1});return this.editorState=fe.create({doc:t,schema:this.schema,selection:St(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(e=>e.name!==`collaboration`),this.createExtensionManager()}}),this.editorState.doc}return e}getEditorViewAttributes(){let e=this.options.editorProps?.attributes;return An(e)?t=>({role:`textbox`,...e(t)}):{role:`textbox`,...e}}createView(e){let{editorProps:t,enableExtensionDispatchTransaction:n}=this.options,r=t.dispatchTransaction||this.dispatchTransaction.bind(this),i=n?this.extensionManager.dispatchTransaction(r):r,a=t.transformPastedHTML,o=this.extensionManager.transformPastedHTML(a);this.editorView=new ye(e,{...t,attributes:this.getEditorViewAttributes(),dispatchTransaction:i,transformPastedHTML:o,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});let s=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(s),this.prependClass(),this.injectCSS();let c=this.view.dom;c.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(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;let t=this.capturedTransaction;return this.capturedTransaction=null,t}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(e=>this.capturedTransaction?.step(e));return}let{state:t,transactions:n}=this.state.applyTransaction(e),r=!this.state.selection.eq(t.selection),i=n.includes(e),a=this.state;if(this.emit(`beforeTransaction`,{editor:this,transaction:e,nextState:t}),!i)return;this.view.updateState(t),this.emit(`transaction`,{editor:this,transaction:e,appendedTransactions:n.slice(1)}),r&&this.emit(`selectionUpdate`,{editor:this,transaction:e});let o=n.findLast(e=>e.getMeta(`focus`)||e.getMeta(`blur`)),s=o?.getMeta(`focus`),c=o?.getMeta(`blur`);s&&this.emit(`focus`,{editor:this,event:s.event,transaction:o}),c&&this.emit(`blur`,{editor:this,event:c.event,transaction:o}),!(e.getMeta(`preventUpdate`)||!n.some(e=>e.docChanged)||a.doc.eq(t.doc))&&this.emit(`update`,{editor:this,transaction:e,appendedTransactions:n.slice(1)})}getAttributes(e){return qn(this.state,e)}isActive(e,t){let n=typeof e==`string`?e:null,r=typeof e==`string`?t:e;return rr(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return yn(this.state.doc.content,this.schema)}getText(e){let{blockSeparator:t=`
|
|
83
|
-
|
|
84
|
-
`,textSerializers:n={}}=e||{};return Wn(this.state.doc,{blockSeparator:t,textSerializers:{...Gn(this.schema),...n}})}get isEmpty(){return cr(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(){return this.editorView?.isDestroyed??!0}$node(e,t){return this.$doc?.querySelector(e,t)||null}$nodes(e,t){return this.$doc?.querySelectorAll(e,t)||null}$pos(e){let t=this.state.doc.resolve(e),n=e>0&&t.nodeAfter&&!t.nodeAfter.isText&&t.nodeAfter.isAtom?t.nodeAfter:null;return new ca(t,this,!1,n)}get $doc(){return this.$pos(0)}};function K(e){return new Ni({find:e.find,handler:({state:t,range:n,match:r})=>{let i=R(e.getAttributes,void 0,r);if(i===!1||i===null)return null;let{tr:a}=t,o=r[r.length-1],s=r[0];if(o){let r=s.search(/\S/),c=n.from+s.indexOf(o),l=c+o.length;if(Zn(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>c).length)return null;l<n.to&&a.delete(l,n.to),c>n.from&&a.delete(n.from+r,c);let u=n.from+r+o.length;a.addMark(n.from+r,u,e.type.create(i||{})),a.removeStoredMark(e.type)}},undoable:e.undoable})}function da(e){return new Ni({find:e.find,handler:({state:t,range:n,match:r})=>{let i=R(e.getAttributes,void 0,r)||{},{tr:a}=t,o=n.from,s=n.to,c=e.type.create(i);if(r[1]){let e=o+r[0].lastIndexOf(r[1]);e>s?e=s:s=e+r[1].length;let t=r[0][r[0].length-1];a.insertText(t,o+r[0].length-1),a.replaceWith(e,s,c)}else if(r[0]){let t=e.type.isInline?o:o-1;a.insert(t,e.type.create(i)).delete(a.mapping.map(o),a.mapping.map(s))}a.scrollIntoView()},undoable:e.undoable})}function fa(e){return new Ni({find:e.find,handler:({state:t,range:n,match:r})=>{let i=t.doc.resolve(n.from),a=R(e.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,a)},undoable:e.undoable})}function pa(e){return new Ni({find:e.find,handler:({state:t,range:n,match:r,chain:i})=>{let a=R(e.getAttributes,void 0,r)||{},o=t.tr.delete(n.from,n.to),s=o.doc.resolve(n.from).blockRange(),c=s&&pe(s,e.type,a);if(!c)return null;if(o.wrap(s,c),e.keepMarks&&e.editor){let{selection:n,storedMarks:r}=t,{splittableMarks:i}=e.editor.extensionManager,a=r||n.$to.parentOffset&&n.$from.marks();if(a){let e=a.filter(e=>i.includes(e.type.name));o.ensureMarks(e)}}if(e.keepAttributes){let t=e.type.name===`bulletList`||e.type.name===`orderedList`?`listItem`:`taskList`;i().updateAttributes(t,a).run()}let l=o.doc.resolve(n.from-1).nodeBefore;l&&l.type===e.type&&de(o.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,l))&&o.join(n.from-1)},undoable:e.undoable})}var ma=class e extends Bi{constructor(...e){super(...e),this.type=`node`}static create(t={}){let n=typeof t==`function`?t():t;return new e(n)}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}},ha=class{constructor(e,t,n){this.isDragging=!1,this.component=e,this.editor=t.editor,this.options={stopEvent:null,ignoreMutation:null,...n},this.extension=t.extension,this.node=t.node,this.decorations=t.decorations,this.innerDecorations=t.innerDecorations,this.view=t.view,this.HTMLAttributes=t.HTMLAttributes,this.getPos=()=>{try{return t.getPos()}catch{return}},this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(e){let{view:t}=this.editor,n=e.target,r=n.nodeType===3?n.parentElement?.closest(`[data-drag-handle]`):n.closest(`[data-drag-handle]`);if(!this.dom||this.contentDOM?.contains(n)||!r)return;let i=0,a=0;if(this.dom!==r){let t=this.dom.getBoundingClientRect(),n=r.getBoundingClientRect(),o=e.offsetX??e.nativeEvent?.offsetX,s=e.offsetY??e.nativeEvent?.offsetY;i=n.x-t.x+o,a=n.y-t.y+s}let o=this.dom.cloneNode(!0);try{let e=this.dom.getBoundingClientRect();o.style.width=`${Math.round(e.width)}px`,o.style.height=`${Math.round(e.height)}px`,o.style.boxSizing=`border-box`,o.style.pointerEvents=`none`}catch{}let s=null;try{var c;s=document.createElement(`div`),s.style.position=`absolute`,s.style.top=`-9999px`,s.style.left=`-9999px`,s.style.pointerEvents=`none`,s.appendChild(o),document.body.appendChild(s),(c=e.dataTransfer)==null||c.setDragImage(o,i,a)}finally{s&&setTimeout(()=>{try{s?.remove()}catch{}},0)}let l=this.getPos();if(typeof l!=`number`)return;let u=k.create(t.state.doc,l),d=t.state.tr.setSelection(u);t.dispatch(d)}stopEvent(e){if(!this.dom)return!1;if(typeof this.options.stopEvent==`function`)return this.options.stopEvent({event:e});let t=e.target;if(!this.dom.contains(t)||this.contentDOM?.contains(t))return!1;let n=e.type.startsWith(`drag`),r=e.type===`dragover`||e.type===`dragenter`,i=e.type===`drop`;if(([`INPUT`,`BUTTON`,`SELECT`,`TEXTAREA`].includes(t.tagName)||t.isContentEditable)&&!i&&!n)return!0;let{isEditable:a}=this.editor,{isDragging:o}=this,s=!!this.node.type.spec.draggable,c=k.isSelectable(this.node),l=e.type===`copy`,u=e.type===`paste`,d=e.type===`cut`,f=e.type===`mousedown`;if(!s&&c&&n&&e.target===this.dom&&e.preventDefault(),s&&n&&!o&&e.target===this.dom)return e.preventDefault(),!1;if(s&&a&&!o&&f){let e=t.closest(`[data-drag-handle]`);e&&(this.dom===e||this.dom.contains(e))&&(this.isDragging=!0,document.addEventListener(`dragend`,()=>{this.isDragging=!1},{once:!0}),document.addEventListener(`drop`,()=>{this.isDragging=!1},{once:!0}),document.addEventListener(`mouseup`,()=>{this.isDragging=!1},{once:!0}))}return!(o||r||i||l||u||d||f&&c)}ignoreMutation(e){return this.dom?this.contentDOM?typeof this.options.ignoreMutation==`function`?this.options.ignoreMutation({mutation:e}):this.node.isLeaf||this.node.isAtom?!0:e.type===`selection`||this.contentDOM.contains(e.target)&&e.type===`childList`&&(I()||Ct())&&this.editor.isFocused&&[...Array.from(e.addedNodes),...Array.from(e.removedNodes)].every(e=>e.isContentEditable)?!1:this.contentDOM===e.target&&e.type===`attributes`||!this.contentDOM.contains(e.target):e.type!==`selection`:!0}updateAttributes(e){this.editor.commands.command(({tr:t})=>{let n=this.getPos();return typeof n==`number`&&(t.setNodeMarkup(n,void 0,{...this.node.attrs,...e}),!0)})}deleteNode(){let e=this.getPos();if(typeof e!=`number`)return;let t=e+this.node.nodeSize;this.editor.commands.deleteRange({from:e,to:t})}};function q(e){return new Vi({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:i})=>{let a=R(e.getAttributes,void 0,r,i);if(a===!1||a===null)return null;let{tr:o}=t,s=r[r.length-1],c=r[0],l=n.to;if(s){let i=c.search(/\S/),u=n.from+c.indexOf(s),d=u+s.length;if(Zn(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>u).length)return null;d<n.to&&o.delete(d,n.to),u>n.from&&o.delete(n.from+i,u),l=n.from+i+s.length,o.addMark(n.from+i,l,e.type.create(a||{})),r.index!==void 0&&r.input!==void 0&&r.index+r[0].length>=r.input.length||o.removeStoredMark(e.type)}}})}var ga=new WeakSet,_a=new WeakSet;function J(e){let t=e;return ga.add(t),t}function va(e){return Array.isArray(e)&&ga.has(e)}function ya(e){return e.flatMap(e=>e==null?[]:Array.isArray(e)&&_a.has(e)&&!va(e)?ya(e):[e])}function ba(e,t){if(e===`slot`)return 0;if(e instanceof Function){let n=e(t);return Array.isArray(n)&&!va(n)&&!_a.has(n)?J(n):n}let{children:n,...r}=t??{};if(e===`svg`)throw Error(`SVG elements are not supported in the JSX syntax, use the array syntax instead`);if(Array.isArray(n)){if(va(n))return J([e,r,n]);if(n.length===0)return J([e,r]);let t=ya(n);return t.length===0?J([e,r]):J([e,r,...t])}return J(n==null?[e,r]:[e,r,n])}var xa=(e,t)=>ba(e,t),Sa=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,Ca=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,wa=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,Ta=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,Ea=W.create({name:`bold`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`strong`},{tag:`b`,getAttrs:e=>e.style.fontWeight!==`normal`&&null},{style:`font-weight=400`,clearMark:e=>e.type.name===this.name},{style:`font-weight`,getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}]},renderHTML({HTMLAttributes:e}){return xa(`strong`,{...z(this.options.HTMLAttributes,e),children:xa(`slot`,{})})},markdownTokenName:`strong`,parseMarkdown:(e,t)=>t.applyMark(`bold`,t.parseInline(e.tokens||[])),markdownOptions:{htmlReopen:{open:`<strong>`,close:`</strong>`}},renderMarkdown:(e,t)=>`**${t.renderChildren(e)}**`,addCommands(){return{setBold:()=>({commands:e})=>e.setMark(this.name),toggleBold:()=>({commands:e})=>e.toggleMark(this.name),unsetBold:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[K({find:Sa,type:this.type}),K({find:wa,type:this.type})]},addPasteRules(){return[q({find:Ca,type:this.type}),q({find:Ta,type:this.type})]}}),Da=Ea,Oa=e=>{let t=/`([^`]+)`(?!`)$/.exec(e);return!t||t.index>0&&e[t.index-1]==="`"?null:{index:t.index,text:t[0],replaceWith:t[1]}},ka=e=>{let t=/`([^`]+)`(?!`)/g,n=[],r;for(;(r=t.exec(e))!==null;)r.index>0&&e[r.index-1]==="`"||n.push({index:r.index,text:r[0],replaceWith:r[1]});return n};function Aa(e){let t=new Set((e.match(/`+/g)||[]).map(e=>e.length)),n=1;for(;t.has(n);)n+=1;return n}var ja=W.create({name:`code`,addOptions(){return{HTMLAttributes:{}}},excludes:`_`,code:!0,exitable:!0,parseHTML(){return[{tag:`code`}]},renderHTML({HTMLAttributes:e}){return[`code`,z(this.options.HTMLAttributes,e),0]},markdownTokenName:`codespan`,parseMarkdown:(e,t)=>t.applyMark(`code`,[{type:`text`,text:e.text||``}]),renderMarkdown:(e,t,n)=>{var r;if(!e.content)return``;let i=typeof(n==null||(r=n.meta)==null?void 0:r.markText)==`string`?n.meta.markText:``,a="`".repeat(Aa(i)),o=i.startsWith("`")||i.endsWith("`")?` `:``;return`${a}${o}${t.renderChildren(e.content)}${o}${a}`},addCommands(){return{setCode:()=>({commands:e})=>e.setMark(this.name),toggleCode:()=>({commands:e})=>e.toggleMark(this.name),unsetCode:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[K({find:Oa,type:this.type})]},addPasteRules(){return[q({find:ka,type:this.type})]}}),Ma=ja,Na=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,Pa=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,Fa=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,Ia=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,La=W.create({name:`italic`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`em`},{tag:`i`,getAttrs:e=>e.style.fontStyle!==`normal`&&null},{style:`font-style=normal`,clearMark:e=>e.type.name===this.name},{style:`font-style=italic`}]},renderHTML({HTMLAttributes:e}){return[`em`,z(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},markdownTokenName:`em`,parseMarkdown:(e,t)=>t.applyMark(`italic`,t.parseInline(e.tokens||[])),markdownOptions:{htmlReopen:{open:`<em>`,close:`</em>`}},renderMarkdown:(e,t)=>`*${t.renderChildren(e)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[K({find:Na,type:this.type}),K({find:Fa,type:this.type})]},addPasteRules(){return[q({find:Pa,type:this.type}),q({find:Ia,type:this.type})]}}),Ra=La,za=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,Ba=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,Va=W.create({name:`strike`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`s`},{tag:`del`},{tag:`strike`},{style:`text-decoration`,consuming:!1,getAttrs:e=>e.includes(`line-through`)?{}:!1}]},renderHTML({HTMLAttributes:e}){return[`s`,z(this.options.HTMLAttributes,e),0]},markdownTokenName:`del`,parseMarkdown:(e,t)=>t.applyMark(`strike`,t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>`~~${t.renderChildren(e)}~~`,addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[K({find:za,type:this.type})]},addPasteRules(){return[q({find:Ba,type:this.type})]}}),Ha=Va,Ua=W.create({name:`underline`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`u`},{style:`text-decoration`,consuming:!1,getAttrs:e=>e.includes(`underline`)?{}:!1}]},renderHTML({HTMLAttributes:e}){return[`u`,z(this.options.HTMLAttributes,e),0]},parseMarkdown(e,t){return t.applyMark(this.name||`underline`,t.parseInline(e.tokens||[]))},renderMarkdown(e,t){return`++${t.renderChildren(e)}++`},markdownTokenizer:{name:`underline`,level:`inline`,start(e){return e.indexOf(`++`)},tokenize(e,t,n){let r=/^(\+\+)([\s\S]+?)(\+\+)/.exec(e);if(!r)return;let i=r[2].trim();return{type:`underline`,raw:r[0],text:i,tokens:n.inlineTokens(i)}}},addCommands(){return{setUnderline:()=>({commands:e})=>e.setMark(this.name),toggleUnderline:()=>({commands:e})=>e.toggleMark(this.name),unsetUnderline:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),Wa=Ua,Ga=ma.create({name:`text`,group:`inline`,parseMarkdown:e=>({type:`text`,text:e.text||``}),renderMarkdown:e=>e.text||``}),Y=class e extends D{constructor(e){super(e,e)}map(t,n){let r=t.resolve(n.map(this.head));return e.valid(r)?new e(r):D.near(r)}content(){return E.empty}eq(t){return t instanceof e&&t.head==this.head}toJSON(){return{type:`gapcursor`,pos:this.head}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for GapCursor.fromJSON`);return new e(t.resolve(n.pos))}getBookmark(){return new Ka(this.anchor)}static valid(e){let t=e.parent;if(t.inlineContent||!Ja(e)||!Ya(e))return!1;let n=t.type.spec.allowGapCursor;if(n!=null)return n;let r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(t,n,r=!1){search:for(;;){if(!r&&e.valid(t))return t;let i=t.pos,a=null;for(let r=t.depth;;r--){let o=t.node(r);if(n>0?t.indexAfter(r)<o.childCount:t.index(r)>0){a=o.child(n>0?t.indexAfter(r):t.index(r)-1);break}if(r==0)return null;i+=n;let s=t.doc.resolve(i);if(e.valid(s))return s}for(;;){let o=n>0?a.firstChild:a.lastChild;if(!o){if(a.isAtom&&!a.isText&&!k.isSelectable(a)){t=t.doc.resolve(i+a.nodeSize*n),r=!1;continue search}break}a=o,i+=n;let s=t.doc.resolve(i);if(e.valid(s))return s}return null}}};Y.prototype.visible=!1,Y.findFrom=Y.findGapCursorFrom,D.jsonID(`gapcursor`,Y);var Ka=class e{constructor(e){this.pos=e}map(t){return new e(t.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return Y.valid(t)?new Y(t):D.near(t)}};function qa(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}function Ja(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(n==0){if(r.type.spec.isolating)return!0}else for(let e=r.child(n-1);;e=e.lastChild){if(e.childCount==0&&!e.inlineContent||qa(e.type))return!0;if(e.inlineContent)return!1}}return!0}function Ya(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n==r.childCount){if(r.type.spec.isolating)return!0}else for(let e=r.child(n);;e=e.firstChild){if(e.childCount==0&&!e.inlineContent||qa(e.type))return!0;if(e.inlineContent)return!1}}return!0}function Xa(){return new A({props:{decorations:to,createSelectionBetween(e,t,n){return t.pos==n.pos&&Y.valid(n)?new Y(n):null},handleClick:$a,handleKeyDown:Za,handleDOMEvents:{beforeinput:eo}}})}var Za=v({ArrowLeft:Qa(`horiz`,-1),ArrowRight:Qa(`horiz`,1),ArrowUp:Qa(`vert`,-1),ArrowDown:Qa(`vert`,1)});function Qa(e,t){let n=e==`vert`?t>0?`down`:`up`:t>0?`right`:`left`;return function(e,r,i){let a=e.selection,o=t>0?a.$to:a.$from,s=a.empty;if(a instanceof T){if(!i.endOfTextblock(n)||o.depth==0)return!1;s=!1,o=e.doc.resolve(t>0?o.after():o.before())}let c=Y.findGapCursorFrom(o,t,s);return c?(r&&r(e.tr.setSelection(new Y(c))),!0):!1}}function $a(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!Y.valid(r))return!1;let i=e.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&k.isSelectable(e.state.doc.nodeAt(i.inside))?!1:(e.dispatch(e.state.tr.setSelection(new Y(r))),!0)}function eo(e,t){if(t.inputType!=`insertCompositionText`||!(e.state.selection instanceof Y))return!1;let{$from:n}=e.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;let i=C.empty;for(let e=r.length-1;e>=0;e--)i=C.from(r[e].createAndFill(null,i));let a=e.state.tr.replace(n.pos,n.pos,new E(i,0,0));return a.setSelection(T.near(a.doc.resolve(n.pos+1))),e.dispatch(a),!1}function to(e){if(!(e.selection instanceof Y))return null;let t=document.createElement(`div`);return t.className=`ProseMirror-gapcursor`,O.create(e.doc,[be.widget(e.selection.head,t,{key:`gapcursor`})])}var no=t((e=>{var t=n();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=t.useState,o=t.useEffect,s=t.useLayoutEffect,c=t.useDebugValue;function l(e,t){var n=t(),r=a({inst:{value:n,getSnapshot:t}}),i=r[0].inst,l=r[1];return s(function(){i.value=n,i.getSnapshot=t,u(i)&&l({inst:i})},[e,n,t]),o(function(){return u(i)&&l({inst:i}),e(function(){u(i)&&l({inst:i})})},[e]),c(n),n}function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:l;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),ro=t(((e,t)=>{t.exports=no()})),X=e(n(),1),io=e(r(),1),Z=i(),ao=ro(),{getOwnPropertyNames:oo,getOwnPropertySymbols:so}=Object,{hasOwnProperty:co}=Object.prototype;function lo(e,t){return function(n,r,i){return e(n,r,i)&&t(n,r,i)}}function uo(e){return function(t,n,r){if(!t||!n||typeof t!=`object`||typeof n!=`object`)return e(t,n,r);let{cache:i}=r,a=i.get(t),o=i.get(n);if(a&&o)return a===n&&o===t;i.set(t,n),i.set(n,t);let s=e(t,n,r);return i.delete(t),i.delete(n),s}}function fo(e){return e?.[Symbol.toStringTag]}function po(e){return oo(e).concat(so(e))}var mo=Object.hasOwn||((e,t)=>co.call(e,t));function Q(e,t){return e===t||!e&&!t&&e!==e&&t!==t}var ho=`__v`,go=`__o`,_o=`_owner`,vo=64,{getOwnPropertyDescriptor:yo,keys:bo}=Object,{propertyIsEnumerable:xo}=Object.prototype,So=yo(Object.getPrototypeOf(Int8Array.prototype),Symbol.toStringTag).get;function Co(e,t){return e.byteLength===t.byteLength&&Lo(new Uint8Array(e),new Uint8Array(t))}function wo(e,t,n){let r=e.length;if(t.length!==r)return!1;for(;r-->0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function To(e,t){return e.byteLength===t.byteLength&&Lo(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function Eo(e,t){return Q(e.getTime(),t.getTime())}function Do(e,t,n){if(e.name!==t.name||e.message!==t.message||e.stack!==t.stack)return!1;let r=e.cause,i=t.cause;if(r!==i&&!n.equals(r,i,`cause`,`cause`,e,t,n))return!1;let a=e.errors,o=t.errors;if(a!==o&&!n.equals(a,o,`errors`,`errors`,e,t,n))return!1;let s=bo(e),c=bo(t),l=s.length;if(!l&&!c.length)return!0;let u=0,d;for(;l-->0;)if(d=s[l],d!==`cause`&&d!==`errors`){if(d!==c[l]&&!xo.call(t,d)||!n.equals(e[d],t[d],d,d,e,t,n))return!1;++u}let f=c.length-u;return!f||f===+!!xo.call(t,`cause`)+ +!!xo.call(t,`errors`)}function Oo(e,t){return e===t}function ko(e,t,n){return e.name===t.name&&e.message===t.message&&e.stack===t.stack&&No(e,t,n)}function Ao(e,t,n){let r=e.size;if(r!==t.size)return!1;if(!r)return!0;let i=Array(r),a=e.entries(),o,s,c=0;for(;(o=a.next())&&!o.done;){let r=t.entries(),a=!1,l=0;for(;(s=r.next())&&!s.done;){if(i[l]){l++;continue}let r=o.value,u=s.value;if(n.equals(r[0],u[0],c,l,e,t,n)&&n.equals(r[1],u[1],r[0],u[0],e,t,n)){a=i[l]=!0;break}l++}if(!a)return!1;c++}return!0}var jo=Q;function Mo(e,t,n){let r=bo(e),i=bo(t),a=r.length;if(i.length!==a)return!1;let o=a<=vo,s;for(;a-->0;)if(s=r[a],!Vo(e,t,s)&&(s!==i[a]&&!(o?i.includes(s):xo.call(t,s))||!n.equals(e[s],t[s],s,s,e,t,n)))return!1;return!0}function No(e,t,n){let r=po(e),i=r.length;if(po(t).length!==i)return!1;let a,o,s;for(;i-->0;)if(a=r[i],!Vo(e,t,a)&&(!mo(t,a)||!n.equals(e[a],t[a],a,a,e,t,n))||(o=yo(e,a),s=yo(t,a),(o||s)&&(!o||!s||o.configurable!==s.configurable||o.enumerable!==s.enumerable||o.writable!==s.writable)))return!1;return!0}function Po(e,t){return Q(e.valueOf(),t.valueOf())}function Fo(e,t){return e.source===t.source&&e.flags===t.flags}function Io(e,t,n){let r=e.size;if(r!==t.size)return!1;if(!r)return!0;let i=Array(r),a=e.values(),o,s;for(;(o=a.next())&&!o.done;){let r=t.values(),a=!1,c=0;for(;(s=r.next())&&!s.done;){if(!i[c]&&n.equals(o.value,s.value,o.value,s.value,e,t,n)){a=i[c]=!0;break}c++}if(!a)return!1}return!0}function Lo(e,t){let n=e.length;if(t.length!==n||e.byteOffset!==t.byteOffset)return!1;let r=So.call(e);if(r===`Float64Array`||r===`Float32Array`||r===`Float16Array`){for(;n-->0;)if(e[n]!==t[n]&&(e[n]===e[n]||t[n]===t[n]))return!1;return!0}for(;n-->0;)if(e[n]!==t[n])return!1;return!0}function Ro(e,t){return e.href===t.href||e.protocol===t.protocol&&e.username===t.username&&e.password===t.password&&e.host===t.host&&e.pathname===t.pathname&&e.hash===t.hash&&zo(e.searchParams,t.searchParams)}function zo(e,t){let n=e.toString(),r=t.toString();return n===r||Bo(n)===Bo(r)}function Bo(e){return e.split(`&`).sort().join(`&`)}function Vo(e,t,n){return(n===_o||n===go||n===ho)&&!!(e.$$typeof||t.$$typeof)}var Ho=`[object ArrayBuffer]`,Uo=`[object Arguments]`,Wo=`[object Boolean]`,Go=`[object DataView]`,Ko=`[object Date]`,qo=`[object Error]`,Jo=`[object Map]`,Yo=`[object Number]`,Xo=`[object Object]`,Zo=`[object RegExp]`,Qo=`[object Set]`,$o=`[object String]`,es={"[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},ts=`[object URL]`,ns=Object.prototype.toString;function rs({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:i,areFunctionsEqual:a,areMapsEqual:o,areNumbersEqual:s,areObjectsEqual:c,arePrimitiveWrappersEqual:l,areRegExpsEqual:u,areSetsEqual:d,areTypedArraysEqual:f,areUrlsEqual:p,unknownTagComparators:m}){return function(h,g,_){if(h===g)return!0;if(h==null||g==null)return!1;let v=typeof h;if(v!==typeof g)return!1;if(v!==`object`)return v===`number`?s(h,g,_):v===`function`&&a(h,g,_);let y=h.constructor;if(y!==g.constructor)return!1;if(y===Object)return c(h,g,_);if(Array.isArray(h))return t(h,g,_);if(y===Date)return r(h,g,_);if(y===RegExp)return u(h,g,_);if(y===Map)return o(h,g,_);if(y===Set)return d(h,g,_);if(y==null)return c(h,g,_);let b=ns.call(h);if(b===Ko)return r(h,g,_);if(b===Zo)return u(h,g,_);if(b===Jo)return o(h,g,_);if(b===Qo)return d(h,g,_);if(b===Xo)return typeof h.then!=`function`&&typeof g.then!=`function`&&c(h,g,_);if(b===ts)return p(h,g,_);if(b===qo)return i(h,g,_);if(b===Uo)return c(h,g,_);if(es[b])return f(h,g,_);if(b===Ho)return e(h,g,_);if(b===Go)return n(h,g,_);if(b===Wo||b===Yo||b===$o)return l(h,g,_);if(m){let e=m[b];if(!e){let t=fo(h);t&&(e=m[t])}if(e)return e(h,g,_)}return!1}}function is({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:Co,areArraysEqual:n?No:wo,areDataViewsEqual:To,areDatesEqual:Eo,areErrorsEqual:n?ko:Do,areFunctionsEqual:Oo,areMapsEqual:n?lo(Ao,No):Ao,areNumbersEqual:jo,areObjectsEqual:n?No:Mo,arePrimitiveWrappersEqual:Po,areRegExpsEqual:Fo,areSetsEqual:n?lo(Io,No):Io,areTypedArraysEqual:n?lo(Lo,No):Lo,areUrlsEqual:Ro,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){let e=uo(r.areArraysEqual),t=uo(r.areErrorsEqual),n=uo(r.areMapsEqual),i=uo(r.areObjectsEqual),a=uo(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:e,areErrorsEqual:t,areMapsEqual:n,areObjectsEqual:i,areSetsEqual:a})}return r}function as(e){return function(t,n,r,i,a,o,s){return e(t,n,s)}}function os({circular:e,comparator:t,createState:n,equals:r,strict:i}){if(n)return function(a,o){let{cache:s=e?new WeakMap:void 0,meta:c}=n();return t(a,o,{cache:s,equals:r,meta:c,strict:i})};if(e)return function(e,n){return t(e,n,{cache:new WeakMap,equals:r,meta:void 0,strict:i})};let a={cache:void 0,equals:r,meta:void 0,strict:i};return function(e,n){return t(e,n,a)}}$(),$({strict:!0});var ss=$({circular:!0});$({circular:!0,strict:!0}),$({createInternalComparator:()=>Q}),$({strict:!0,createInternalComparator:()=>Q}),$({circular:!0,createInternalComparator:()=>Q}),$({circular:!0,createInternalComparator:()=>Q,strict:!0});function $(e={}){let{circular:t=!1,createInternalComparator:n,createState:r,strict:i=!1}=e,a=rs(is(e));return os({circular:t,comparator:a,createState:r,equals:n?n(a):as(a),strict:i})}var cs=t((e=>{var t=n(),r=ro();function i(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var a=typeof Object.is==`function`?Object.is:i,o=r.useSyncExternalStore,s=t.useRef,c=t.useEffect,l=t.useMemo,u=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var d=s(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=l(function(){function e(e){if(!o){if(o=!0,s=e,e=r(e),i!==void 0&&f.hasValue){var t=f.value;if(i(t,e))return c=t}return c=e}if(t=c,a(s,e))return t;var n=r(e);return i!==void 0&&i(t,n)?(s=e,t):(s=e,c=n)}var o=!1,s,c,l=n===void 0?null:n;return[function(){return e(t())},l===null?void 0:function(){return e(l())}]},[t,n,r,i]);var p=o(e,d[0],d[1]);return c(function(){f.hasValue=!0,f.value=p},[p]),u(p),p}})),ls=t(((e,t)=>{t.exports=cs()})),us=ls();function ds(e,t){if(e.isDestroyed||t.defaultPrevented||!t.cancelable||!e.isEditable||t.inputType!==`insertParagraph`&&t.inputType!==`insertLineBreak`||!I()&&!Ct())return;let n=e.view,r=n.root,i=(r.getSelection?.call(r)??n.dom.ownerDocument.getSelection())?.anchorNode,a=(i?.nodeType===1?i:i?.parentElement)?.closest(`[data-node-view-content-react]`);if(!a||!n.dom.contains(a))return;let o=n.input.lastKeyCode;o===13&&(n.input.lastKeyCode=null),n.domObserver.forceFlush(),n.domObserver.flush();let s=new KeyboardEvent(`keydown`,{key:`Enter`,code:`Enter`,keyCode:13,shiftKey:t.inputType===`insertLineBreak`,bubbles:!0,cancelable:!0});n.someProp(`handleKeyDown`,e=>e(n,s))?(t.preventDefault(),n.input.lastIOSEnter=0,clearTimeout(n.input.lastIOSEnterFallbackTimeout)):o===13&&(n.input.lastKeyCode=o)}var fs=new w(`reactMobileEnter`),ps=(...e)=>t=>{e.forEach(e=>{typeof e==`function`?e(t):e&&(e.current=t)})},ms=({contentComponent:e})=>{let t=(0,ao.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getServerSnapshot);return(0,Z.jsx)(Z.Fragment,{children:Object.values(t)})};function hs(){let e=new Set,t={},n=!1,r=()=>{!n&&e.size&&(n=!0,queueMicrotask(()=>{n=!1,e.forEach(e=>e())}))};return{subscribe(t){return e.add(t),()=>{e.delete(t)}},getSnapshot(){return t},getServerSnapshot(){return t},setRenderer(e,n){t={...t,[e]:io.createPortal(n.reactElement,n.element,e)},r()},removeRenderer(e){let n={...t};delete n[e],t=n,r()}}}var gs=class extends X.Component{constructor(e){super(e),this.editorContentRef=X.createRef()}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){let e=this.props.editor;if(e&&!e.isDestroyed&&e.view.dom?.parentNode){if(e.contentComponent)return;let t=this.editorContentRef.current;t.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:t}),e.contentComponent=hs(),e.createNodeViews(),e.registerPlugin(new A({key:fs,props:{handleDOMEvents:{beforeinput:(t,n)=>ds(e,n)}}})),e.isEditorContentInitialized=!0,this.forceUpdate()}}componentWillUnmount(){let e=this.props.editor;if(e){e.isEditorContentInitialized=!1,e.isDestroyed||(e.unregisterPlugin(fs),e.view.setProps({nodeViews:{}})),e.contentComponent=null;try{if(!e.view.dom?.parentNode)return;let t=document.createElement(`div`);t.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:t})}catch{}}}render(){let{editor:e,innerRef:t,...n}=this.props;return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{ref:ps(t,this.editorContentRef),...n}),e?.contentComponent&&(0,Z.jsx)(ms,{contentComponent:e.contentComponent})]})}},_s=(0,X.forwardRef)((e,t)=>{let n=X.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[e.editor]);return X.createElement(gs,{key:n,innerRef:t,...e})}),vs=X.memo(_s),ys=typeof window<`u`?X.useLayoutEffect:X.useEffect,bs=class{constructor(e){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=e,this.lastSnapshot={editor:e,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.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber}),this.lastSnapshot}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}watch(e){if(this.editor=e,this.editor){let e,t=t=>{(t?.transaction===void 0||t.transaction!==e)&&(e=t?.transaction,this.transactionNumber+=1,this.subscribers.forEach(e=>e()))},n=this.editor;return n.on(`transaction`,t),n.on(`update`,t),()=>{n.off(`transaction`,t),n.off(`update`,t)}}}};function xs(e){let[t]=(0,X.useState)(()=>new bs(e.editor)),n=(0,us.useSyncExternalStoreWithSelector)(t.subscribe,t.getSnapshot,t.getServerSnapshot,e.selector,e.equalityFn??ss);return ys(()=>t.watch(e.editor),[e.editor,t]),(0,X.useDebugValue)(n),n}var Ss=typeof window>`u`,Cs=Ss||!!(typeof window<`u`&&window.next),ws=class e{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(e=>e())}getInitialEditor(){let e=this.options.current.immediatelyRender,t=e??!0;return(Ss||Cs&&e===void 0)&&(t=!1),t?this.createEditor():null}createEditor(){return new ua({...this.options.current,onBeforeCreate:(...e)=>{var t;return(t=this.options.current).onBeforeCreate?.call(t,...e)},onBlur:(...e)=>{var t;return(t=this.options.current).onBlur?.call(t,...e)},onCreate:(...e)=>{var t;return(t=this.options.current).onCreate?.call(t,...e)},onDestroy:(...e)=>{var t;return(t=this.options.current).onDestroy?.call(t,...e)},onFocus:(...e)=>{var t;return(t=this.options.current).onFocus?.call(t,...e)},onSelectionUpdate:(...e)=>{var t;return(t=this.options.current).onSelectionUpdate?.call(t,...e)},onTransaction:(...e)=>{var t;return(t=this.options.current).onTransaction?.call(t,...e)},onUpdate:(...e)=>{var t;return(t=this.options.current).onUpdate?.call(t,...e)},onContentError:(...e)=>{var t;return(t=this.options.current).onContentError?.call(t,...e)},onDrop:(...e)=>{var t;return(t=this.options.current).onDrop?.call(t,...e)},onPaste:(...e)=>{var t;return(t=this.options.current).onPaste?.call(t,...e)},onDelete:(...e)=>{var t;return(t=this.options.current).onDelete?.call(t,...e)},onMount:(...e)=>{var t;return(t=this.options.current).onMount?.call(t,...e)},onUnmount:(...e)=>{var t;return(t=this.options.current).onUnmount?.call(t,...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(n=>[`onCreate`,`onBeforeCreate`,`onDestroy`,`onUpdate`,`onTransaction`,`onFocus`,`onBlur`,`onSelectionUpdate`,`onContentError`,`onDrop`,`onPaste`].includes(n)?!0:n===`extensions`&&e.extensions&&t.extensions?e.extensions.length===t.extensions.length&&e.extensions.every((e,n)=>e===t.extensions?.[n]):e[n]===t[n])}onRender(t){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&t.length===0?e.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(t),()=>{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,n)=>t===e[n]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){let e=this.instanceId,t=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{this.isComponentMounted&&this.instanceId===e?t&&t.setOptions(this.options.current):t&&!t.isDestroyed&&(t.destroy(),this.instanceId===e&&this.setEditor(null))},1)}};function Ts(e={},t=[]){let n=(0,X.useRef)(e);n.current=e;let[r]=(0,X.useState)(()=>new ws(n)),i=(0,ao.useSyncExternalStore)(r.subscribe,r.getEditor,r.getServerSnapshot);return(0,X.useDebugValue)(i),(0,X.useEffect)(r.onRender(t)),xs({editor:i,selector:({transactionNumber:t})=>e.shouldRerenderOnTransaction===!1||e.shouldRerenderOnTransaction===void 0?null:e.immediatelyRender&&t===0?0:t+1}),i}var Es=(0,X.createContext)({editor:null});Es.Consumer;var Ds=(0,X.createContext)({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),Os=()=>(0,X.useContext)(Ds),ks=X.forwardRef((e,t)=>{let{onDragStart:n}=Os(),r=e.as||`div`;return(0,Z.jsx)(r,{...e,ref:t,"data-node-view-wrapper":``,onDragStart:n,style:{whiteSpace:`normal`,...e.style}})});function As(e){return!!(typeof e==`function`&&e.prototype&&e.prototype.isReactComponent)}function js(e){return!(typeof e!=`object`||!e.$$typeof||e.$$typeof.toString()!==`Symbol(react.forward_ref)`&&e.$$typeof.description!==`react.forward_ref`)}function Ms(e){return!(typeof e!=`object`||!e.$$typeof||e.$$typeof.toString()!==`Symbol(react.memo)`&&e.$$typeof.description!==`react.memo`)}function Ns(e){if(As(e)||js(e))return!0;if(Ms(e)){let t=e.type;if(t)return As(t)||js(t)}return!1}function Ps(){try{if(X.version)return parseInt(X.version.split(`.`)[0],10)>=19}catch{}return!1}var Fs=class{constructor(e,{editor:t,props:n={},as:r=`div`,className:i=``}){this.ref=null,this.destroyed=!1,this.id=Math.floor(Math.random()*4294967295).toString(),this.component=e,this.editor=t,this.props=n,this.element=document.createElement(r),this.element.classList.add(`react-renderer`),i&&this.element.classList.add(...i.split(` `)),this.editor.isEditorContentInitialized?(0,io.flushSync)(()=>{this.render()}):queueMicrotask(()=>{this.destroyed||this.render()})}render(){var e;if(this.destroyed)return;let t=this.component,n=this.props,r=this.editor,i=Ps(),a=Ns(t),o={...n};o.ref&&!(i||a)&&delete o.ref,!o.ref&&(i||a)&&(o.ref=e=>{this.ref=e}),this.reactElement=(0,Z.jsx)(t,{...o}),r==null||(e=r.contentComponent)==null||e.setRenderer(this.id,this)}updateProps(e={}){if(this.destroyed)return;let t=!1,n=Object.keys(e);for(let r=0;r<n.length;r+=1){let i=n[r];if(e[i]!==this.props[i]){t=!0;break}}t&&(this.props={...this.props,...e},this.render())}destroy(){var e;this.destroyed=!0;let t=this.editor;t==null||(e=t.contentComponent)==null||e.removeRenderer(this.id);try{this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)}catch{}}updateAttributes(e){Object.keys(e).forEach(t=>{this.element.setAttribute(t,e[t])})}},Is=X.createContext({markViewContentRef:()=>{}}),Ls=class extends Mi{constructor(e,t,n){super(e,t,n);let{as:r=`span`,attrs:i,className:a=``}=n||{},o={...t,updateAttributes:this.updateAttributes.bind(this)};this.contentDOMElement=document.createElement(`span`);let s={markViewContentRef:e=>{e&&!e.contains(this.contentDOMElement)&&e.appendChild(this.contentDOMElement)}},c=X.memo(t=>(0,Z.jsx)(Is.Provider,{value:s,children:X.createElement(e,t)}));c.displayName=`ReactMarkView`,this.renderer=new Fs(c,{editor:t.editor,props:o,as:r,className:`mark-${t.mark.type.name} ${a}`.trim()}),i&&this.renderer.updateAttributes(i)}get dom(){return this.renderer.element}get contentDOM(){return this.contentDOMElement}};function Rs(e,t={}){return n=>new Ls(e,n,t)}function zs(e){var t;let n=e.getRootNode(),r=typeof n.getSelection==`function`?n.getSelection():(t=e.ownerDocument)==null||(t=t.defaultView)==null?void 0:t.getSelection();if(!r||r.rangeCount===0)return null;let{anchorNode:i,anchorOffset:a,focusNode:o,focusOffset:s}=r;return!i||!o||!e.contains(i)||!e.contains(o)?null:()=>{try{r.setBaseAndExtent(i,a,o,s)}catch{}}}function Bs(e,t,n){return e.node(n)===t.node(n)&&e.before(n)===t.before(n)}function Vs(e){if(!xt(e))return[];let{$from:t,$to:n}=e,r=[],i=Math.min(t.depth,n.depth);for(let e=1;e<=i&&Bs(t,n,e);e+=1)r.push(t.before(e));return r}var Hs=class{constructor(e){this.views=new WeakMap,this.viewCount=0,this.insideViews=new Set,this.syncQueued=!1,this.scheduleSync=()=>{this.syncQueued||(this.syncQueued=!0,queueMicrotask(()=>{this.syncQueued=!1,this.sync()}))},this.handleTransaction=()=>this.scheduleSync(),this.editor=e}register(e){this.viewCount===0&&this.editor.on(`transaction`,this.handleTransaction),this.views.set(e.dom,e),this.viewCount+=1,this.scheduleSync()}unregister(e){this.views.delete(e.dom),--this.viewCount,this.insideViews.delete(e),this.viewCount===0&&this.editor.off(`transaction`,this.handleTransaction)}sync(){if(this.viewCount===0||this.editor.isDestroyed)return;let e=this.findInsideViews();this.updateViews(this.insideViews,e,!1),this.updateViews(e,this.insideViews,!0),this.insideViews=e}updateViews(e,t,n){for(let r of e)t.has(r)||r.setSelectionInside(n)}findInsideViews(){let e=new Set;for(let t of Vs(this.editor.state.selection)){let n=this.editor.view.nodeDOM(t),r=n?this.views.get(n):void 0;r&&e.add(r)}return e}},Us=new WeakMap;function Ws(e){let t=Us.get(e);return t||(t=new Hs(e),Us.set(e,t)),t}var Gs=class extends ha{constructor(e,t,n){if(super(e,t,n),this.nodeSelected=!1,this.handlePositionUpdate=()=>{let e=this.getPos();typeof e==`number`&&e!==this.currentPos&&(this.currentPos=e,this.renderer.updateProps({getPos:()=>this.getPos()}),typeof this.options.attrs==`function`&&this.updateElementAttributes())},this.cachedExtensionWithSyncedStorage=null,!this.node.isLeaf){this.contentDOMElement=this.options.contentDOMElementTag?document.createElement(this.options.contentDOMElementTag):document.createElement(this.node.isInline?`span`:`div`),this.contentDOMElement.dataset.nodeViewContentReact=``,this.contentDOMElement.dataset.nodeViewWrapper=``,this.contentDOMElement.style.whiteSpace=`inherit`;let e=this.dom.querySelector(`[data-node-view-content]`);e?e.appendChild(this.contentDOMElement):this.dom.appendChild(this.contentDOMElement)}this.options.trackNodeViewPosition&&this.editor.on(`update`,this.handlePositionUpdate)}get extensionWithSyncedStorage(){if(!this.cachedExtensionWithSyncedStorage){let e=this.editor,t=this.extension;this.cachedExtensionWithSyncedStorage=new Proxy(t,{get(n,r,i){return r===`storage`?e.storage[t.name]??{}:Reflect.get(n,r,i)}})}return this.cachedExtensionWithSyncedStorage}mount(){let e={editor:this.editor,node:this.node,decorations:this.decorations,innerDecorations:this.innerDecorations,view:this.view,selected:!1,selectionInside:!1,extension:this.extensionWithSyncedStorage,HTMLAttributes:this.HTMLAttributes,getPos:()=>this.getPos(),updateAttributes:(e={})=>this.updateAttributes(e),deleteNode:()=>this.deleteNode(),ref:(0,X.createRef)()};if(!this.component.displayName){let e=e=>e.charAt(0).toUpperCase()+e.substring(1);this.component.displayName=e(this.extension.name)}let t={onDragStart:this.onDragStart.bind(this),nodeViewContentRef:e=>{if(e&&this.contentDOMElement&&e.firstChild!==this.contentDOMElement){e.hasAttribute(`data-node-view-wrapper`)&&e.removeAttribute(`data-node-view-wrapper`);let t=zs(this.contentDOMElement);e.appendChild(this.contentDOMElement),t?.()}}},n=this.component,r=(0,X.memo)(e=>(0,Z.jsx)(Ds.Provider,{value:t,children:(0,X.createElement)(n,e)}));r.displayName=`ReactNodeView`;let i=this.node.isInline?`span`:`div`;this.options.as&&(i=this.options.as);let{className:a=``}=this.options;this.renderer=new Fs(r,{editor:this.editor,props:e,as:i,className:`node-${this.node.type.name} ${a}`.trim()}),Ws(this.editor).register(this),this.updateElementAttributes(),this.currentPos=this.getPos()}get dom(){if(this.renderer.element.firstElementChild&&!this.renderer.element.firstElementChild?.hasAttribute(`data-node-view-wrapper`))throw Error(`Please use the NodeViewWrapper component for your node view.`);return this.renderer.element}get contentDOM(){return this.node.isLeaf?null:this.contentDOMElement}update(e,t,n){let r=e=>{this.renderer.updateProps(e),typeof this.options.attrs==`function`&&this.updateElementAttributes()};if(e.type!==this.node.type)return!1;if(typeof this.options.update==`function`){let i=this.node,a=this.decorations,o=this.innerDecorations;return this.node=e,this.decorations=t,this.innerDecorations=n,this.currentPos=this.getPos(),this.options.update({oldNode:i,oldDecorations:a,newNode:e,newDecorations:t,oldInnerDecorations:o,innerDecorations:n,updateProps:()=>r({node:e,decorations:t,innerDecorations:n,extension:this.extensionWithSyncedStorage})})}if(e===this.node)return this.node=e,this.decorations=t,this.innerDecorations=n,!0;let i=this.getPos();this.node=e,this.decorations=t,this.innerDecorations=n,this.currentPos=i;let a={node:e,decorations:t,innerDecorations:n,extension:this.extensionWithSyncedStorage};return this.options.trackNodeViewPosition&&(a.getPos=()=>this.getPos()),r(a),!0}selectNode(){this.nodeSelected=!0,this.updateSelectedState(!0)}deselectNode(){this.nodeSelected=!1,this.updateSelectedState(this.options.selectedOnTextSelection===!0&&this.isTextSelectionInside())}setSelectionInside(e){let t=this.nodeSelected||this.options.selectedOnTextSelection===!0&&e;this.renderer.updateProps({selectionInside:e,selected:t}),this.renderer.element.classList.toggle(`ProseMirror-selectednode`,t)}updateSelectedState(e){this.renderer.updateProps({selected:e}),this.renderer.element.classList.toggle(`ProseMirror-selectednode`,e)}isTextSelectionInside(){let e=this.getPos();return typeof e==`number`&&Vs(this.editor.state.selection).includes(e)}destroy(){this.renderer.destroy(),Ws(this.editor).unregister(this),this.options.trackNodeViewPosition&&this.editor.off(`update`,this.handlePositionUpdate),this.contentDOMElement=null}updateElementAttributes(){if(this.options.attrs){let e={};if(typeof this.options.attrs==`function`){let t=this.editor.extensionManager.attributes,n=B(this.node,t);e=this.options.attrs({node:this.node,HTMLAttributes:n})}else e=this.options.attrs;this.renderer.updateAttributes(e)}}};function Ks(e,t){return n=>n.editor.contentComponent?new Gs(e,n,t):{dom:document.createElement(`span`),contentDOM:null,update:()=>!1,destroy:()=>{},selectNode:()=>{},deselectNode:()=>{},stopEvent:()=>!1,ignoreMutation:()=>!0}}var qs=(0,X.createContext)({get editor(){throw Error(`useTiptap must be used within a <Tiptap> provider`)}});qs.displayName=`TiptapContext`;var Js=()=>(0,X.useContext)(qs);function Ys({children:e,...t}){let n=`editor`in t?t.editor:t.instance;if(!n)throw Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");let r=(0,X.useMemo)(()=>({editor:n}),[n]),i=(0,X.useMemo)(()=>({editor:n}),[n]);return(0,Z.jsx)(Es.Provider,{value:i,children:(0,Z.jsx)(qs.Provider,{value:r,children:e})})}Ys.displayName=`Tiptap`;function Xs({...e}){let{editor:t}=Js();return(0,Z.jsx)(vs,{editor:t,...e})}Xs.displayName=`Tiptap.Content`,Object.assign(Ys,{Content:Xs});export{lr as $,R as A,Xn as B,xa as C,W as D,Ni as E,hn as F,N as G,vt as H,_n as I,Hn as J,$n as K,gn as L,mn as M,dn as N,ma as O,aa as P,cr as Q,vn as R,Da as S,G as T,Zn as U,L as V,Qn as W,ar as X,ir as Y,Yt as Z,La as _,Gs as a,hr as at,Ma as b,Os as c,fa as ct,Xa as d,ze as dt,K as et,Ga as f,je as ft,Ha as g,Va as h,Rs as i,Ei as it,xi as j,Vi as k,ls as l,pa as lt,Wa as m,ks as n,z as nt,Ks as o,ki as ot,Ua as p,we as pt,B as q,Is as r,da as rt,Ts as s,Nt as st,vs as t,q as tt,ro as u,Fe as ut,Ra as v,ua as w,Ea as x,ja as y,qn as z};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{a as t,c as n,i as r,o as i,s as a,t as o,v as s}from"./react-Bk7NnOLX.js";import{$ as c,At as l,B as u,G as d,H as f,J as p,K as m,Q as h,R as g,U as _,V as v,W as y,X as b,Y as x,Z as S,_t as C,a as ee,at as w,dt as T,gt as E,i as te,lt as D,mt as O,n as ne,nt as re,o as ie,ot as k,pt as A,q as ae,r as oe,rt as j,t as se,tt as ce,yt as le,z as ue}from"./button-BVQH7zxz.js";import{o as de}from"./snapshots-CTS2iez5.js";import{t as fe}from"./jsx-runtime-DePvh3-m.js";import{t as M}from"./createLucideIcon-REX213UO.js";import{n as pe,t as me}from"./progress-udl4pNsP.js";import{B as he,E as ge,F as _e,G as ve,H as ye,I as be,J as xe,L as Se,M as Ce,N as we,P as Te,R as Ee,U as De,V as Oe,W as ke,Y as Ae,_ as je,_t as N,a as Me,c as Ne,dt as Pe,h as Fe,i as Ie,it as Le,l as Re,lt as ze,o as Be,p as Ve,s as He,t as P,x as Ue,z as We}from"./index-CglHrLRS.js";var Ge=M(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),Ke=M(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),qe=M(`ellipsis-vertical`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]]),Je=M(`file-archive`,[[`path`,{d:`M13.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v11.5`,key:`4pqfef`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M8 12v-1`,key:`1ej8lb`}],[`path`,{d:`M8 18v-2`,key:`qcmpov`}],[`path`,{d:`M8 7V6`,key:`1nbb54`}],[`circle`,{cx:`8`,cy:`20`,r:`2`,key:`ckkr5m`}]]),Ye=M(`file-box`,[[`path`,{d:`M14.5 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v3.8`,key:`1kchwa`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M11.7 14.2 7 17l-4.7-2.8`,key:`1yk8tc`}],[`path`,{d:`M3 13.1a2 2 0 0 0-.999 1.76v3.24a2 2 0 0 0 .969 1.78L6 21.7a2 2 0 0 0 2.03.01L11 19.9a2 2 0 0 0 1-1.76V14.9a2 2 0 0 0-.97-1.78L8 11.3a2 2 0 0 0-2.03-.01z`,key:`19flxy`}],[`path`,{d:`M7 17v5`,key:`1yj1jh`}]]),Xe=M(`file-braces`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1`,key:`1oajmo`}],[`path`,{d:`M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1`,key:`mpwhp6`}]]),Ze=M(`file-chart-column`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M8 18v-1`,key:`zg0ygc`}],[`path`,{d:`M12 18v-6`,key:`17g6i2`}],[`path`,{d:`M16 18v-3`,key:`j5jt4h`}]]),Qe=M(`file-code`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 12.5 8 15l2 2.5`,key:`1tg20x`}],[`path`,{d:`m14 12.5 2 2.5-2 2.5`,key:`yinavb`}]]),$e=M(`file-image`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`circle`,{cx:`10`,cy:`12`,r:`2`,key:`737tya`}],[`path`,{d:`m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22`,key:`wt3hpn`}]]),et=M(`file-pen-line`,[[`path`,{d:`M14.364 13.634a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506l4.013-4.009a1 1 0 0 0-3.004-3.004z`,key:`ukzhwg`}],[`path`,{d:`M14.487 7.858A1 1 0 0 1 14 7V2`,key:`1klhew`}],[`path`,{d:`M20 19.645V20a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l2.516 2.516`,key:`rxaxab`}],[`path`,{d:`M8 18h1`,key:`13wk12`}]]),tt=M(`file-output`,[[`path`,{d:`M4.226 20.925A2 2 0 0 0 6 22h12a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v3.127`,key:`wfxp4w`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m5 11-3 3`,key:`1dgrs4`}],[`path`,{d:`m5 17-3-3h10`,key:`1mvvaf`}]]),nt=M(`file-play`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M15.033 13.44a.647.647 0 0 1 0 1.12l-4.065 2.352a.645.645 0 0 1-.968-.56v-4.704a.645.645 0 0 1 .967-.56z`,key:`1tzo1f`}]]),rt=M(`file-spreadsheet`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M8 13h2`,key:`yr2amv`}],[`path`,{d:`M14 13h2`,key:`un5t4a`}],[`path`,{d:`M8 17h2`,key:`2yhykz`}],[`path`,{d:`M14 17h2`,key:`10kma7`}]]),it=M(`file-stack`,[[`path`,{d:`M11 21a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1v-8a1 1 0 0 1 1-1`,key:`likhh7`}],[`path`,{d:`M16 16a1 1 0 0 1-1 1H9a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1`,key:`17ky3x`}],[`path`,{d:`M21 6a2 2 0 0 0-.586-1.414l-2-2A2 2 0 0 0 17 2h-3a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1z`,key:`1hyeo0`}]]),at=M(`file-type`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M11 18h2`,key:`12mj7e`}],[`path`,{d:`M12 12v6`,key:`3ahymv`}],[`path`,{d:`M9 13v-.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 .5.5v.5`,key:`qbrxap`}]]),ot=M(`file-video-camera`,[[`path`,{d:`M4 12V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2`,key:`jrl274`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m10 17.843 3.033-1.755a.64.64 0 0 1 .967.56v4.704a.65.65 0 0 1-.967.56L10 20.157`,key:`17aeo9`}],[`rect`,{width:`7`,height:`6`,x:`3`,y:`16`,rx:`1`,key:`s27ndx`}]]),st=M(`folder-open`,[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]),F=M(`pen-line`,[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]),ct=M(`rotate-ccw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),lt=M(`share`,[[`path`,{d:`M12 2v13`,key:`1km8f5`}],[`path`,{d:`m16 6-4-4-4 4`,key:`13yo43`}],[`path`,{d:`M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8`,key:`1b2hhj`}]]),I=e(s(),1),L=fe(),ut=Object.defineProperty,R=(e,t)=>ut(e,`name`,{value:t,configurable:!0}),dt=`Checkbox`,[ft,pt]=k(dt),[mt,ht]=ft(dt);function gt(e){let{__scopeCheckbox:t,checked:n,children:r,defaultChecked:i,disabled:a,form:o,name:s,onCheckedChange:c,required:l,value:u=`on`,internal_do_not_use_render:d}=e,[f,p]=j({prop:n,defaultProp:i??!1,onChange:c,caller:dt}),[m,h]=I.useState(null),[g,_]=I.useState(null),v=I.useRef(!1),[y,b]=I.useReducer(e=>e+1,0),x=!m||!!o||!!m.closest(`form`),S={checked:f,disabled:a,setChecked:p,control:m,setControl:h,name:s,form:o,value:u,hasConsumerStoppedPropagationRef:v,userInteractionCount:y,onUserInteraction:b,required:l,defaultChecked:!z(i)&&i,isFormControl:x,bubbleInput:g,setBubbleInput:_};return(0,L.jsx)(mt,{scope:t,...S,children:wt(d)?d(S):r})}R(gt,`CheckboxProvider`);var _t=`CheckboxTrigger`,vt=I.forwardRef(R(function({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},i){let{control:a,value:o,disabled:s,checked:c,required:l,setControl:u,setChecked:d,hasConsumerStoppedPropagationRef:f,onUserInteraction:p,isFormControl:m,bubbleInput:h}=ht(_t,e),g=A(i,u),_=I.useRef(c);return I.useEffect(()=>{let e=a?.form;if(e){let t=R(()=>d(_.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[a,d]),(0,L.jsx)(D.button,{type:`button`,role:`checkbox`,"aria-checked":z(c)?`mixed`:c,"aria-required":l,"data-state":Tt(c),"data-disabled":s?``:void 0,disabled:s,value:o,...r,ref:g,onKeyDown:w(t,e=>{e.key===`Enter`&&e.preventDefault()}),onClick:w(n,e=>{p(),d(e=>z(e)?!0:!e),h&&m&&(f.current=e.isPropagationStopped(),f.current||e.stopPropagation())})})},`CheckboxTrigger`)),yt=I.forwardRef(R(function(e,t){let{__scopeCheckbox:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,L.jsx)(gt,{__scopeCheckbox:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(vt,{...d,ref:t,__scopeCheckbox:n}),e&&(0,L.jsx)(Ct,{__scopeCheckbox:n})]})})},`Checkbox`)),bt=`CheckboxIndicator`,xt=I.forwardRef(R(function(e,t){let{__scopeCheckbox:n,forceMount:r,...i}=e,a=ht(bt,n);return(0,L.jsx)(re,{present:r||z(a.checked)||a.checked===!0,children:(0,L.jsx)(D.span,{"data-state":Tt(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:t,style:{pointerEvents:`none`,...e.style}})})},`CheckboxIndicator`)),St=`CheckboxBubbleInput`,Ct=I.forwardRef(R(function({__scopeCheckbox:e,onClick:t,...n},r){let{control:i,hasConsumerStoppedPropagationRef:a,userInteractionCount:o,checked:s,defaultChecked:c,required:l,disabled:u,name:d,value:f,form:p,bubbleInput:m,setBubbleInput:h}=ht(St,e),_=A(r,h),v=g(i),y=I.useRef(!1),b=I.useRef(s),x=I.useRef(o);I.useEffect(()=>{let e=m;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=o!==x.current;x.current=o;let i=b.current!==s;b.current=s;let c=!(r&&a.current);if(i&&n){y.current=!r;let t=new Event(`click`,{bubbles:c});e.indeterminate=z(s),n.call(e,!z(s)&&s),e.dispatchEvent(t),y.current=!1}},[m,s,a,o]);let S=I.useRef(!z(s)&&s);return(0,L.jsx)(D.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:c??S.current,required:l,disabled:u,name:d,value:f,form:p,...n,tabIndex:-1,ref:_,onClick:w(t,e=>{y.current&&e.stopPropagation()}),style:{...n.style,...v,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`CheckboxBubbleInput`));function wt(e){return typeof e==`function`}R(wt,`isFunction`);function z(e){return e===`indeterminate`}R(z,`isIndeterminate`);function Tt(e){return z(e)?`indeterminate`:e?`checked`:`unchecked`}R(Tt,`getState`);var Et=Object.defineProperty,B=(e,t)=>Et(e,`name`,{value:t,configurable:!0}),Dt=`ContextMenu`,[Ot,kt]=k(Dt,[Oe]),V=Oe(),[At,jt]=Ot(Dt),Mt=B(e=>{let{__scopeContextMenu:t,children:n,onOpenChange:r,open:i,dir:a,modal:o=!0}=e,s=I.useRef(!1),[c,l]=j({prop:i,defaultProp:!1,onChange:r,caller:Dt}),u=V(t);return(0,L.jsx)(At,{scope:t,open:c,onOpenChange:l,modal:o,hasInteractedRef:s,children:(0,L.jsx)(Ce,{...u,dir:a,open:c,onOpenChange:l,modal:o,children:n})})},`ContextMenu`),Nt=`ContextMenuTrigger`,Pt=I.forwardRef(B(function(e,t){let{__scopeContextMenu:n,disabled:r=!1,...i}=e,a=jt(Nt,n),o=V(n),[s,c]=I.useState({x:0,y:0}),l=I.useMemo(()=>({current:{getBoundingClientRect:B(()=>DOMRect.fromRect({width:0,height:0,...s}),`getBoundingClientRect`)}}),[s]),u=I.useRef(0),d=I.useCallback(()=>window.clearTimeout(u.current),[]),f=B(e=>{a.hasInteractedRef.current=!0,c({x:e.clientX,y:e.clientY}),a.onOpenChange(!0)},`handleOpen`);return I.useEffect(()=>d,[d]),I.useEffect(()=>void(r&&d()),[r,d]),(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(we,{...o,virtualRef:l}),(0,L.jsx)(D.span,{"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,...i,ref:t,style:{WebkitTouchCallout:`none`,...e.style},onContextMenu:r?e.onContextMenu:w(e.onContextMenu,e=>{d(),f(e),e.preventDefault()}),onPointerDown:r?e.onPointerDown:w(e.onPointerDown,H(e=>{d(),a.open&&a.onOpenChange(!1),u.current=window.setTimeout(()=>f(e),700)})),onPointerMove:r?e.onPointerMove:w(e.onPointerMove,H(d)),onPointerCancel:r?e.onPointerCancel:w(e.onPointerCancel,H(d)),onPointerUp:r?e.onPointerUp:w(e.onPointerUp,H(d))})]})},`ContextMenuTrigger`)),Ft=B(e=>{let{__scopeContextMenu:t,...n}=e,r=V(t);return(0,L.jsx)(be,{...r,...n})},`ContextMenuPortal`),It=`ContextMenuContent`,Lt=I.forwardRef(B(function(e,t){let{__scopeContextMenu:n,...r}=e,i=jt(It,n),a=V(n),o=I.useRef(!1);return(0,L.jsx)(Te,{...a,...r,ref:t,side:`right`,sideOffset:2,align:`start`,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),!t.defaultPrevented&&o.current&&t.preventDefault(),o.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),!t.defaultPrevented&&!i.modal&&(o.current=!0)},style:{...e.style,"--radix-context-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-context-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-context-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-context-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-context-menu-trigger-height":`var(--radix-popper-anchor-height)`}})},`ContextMenuContent`)),Rt=I.forwardRef(B(function(e,t){let{__scopeContextMenu:n,...r}=e,i=V(n);return(0,L.jsx)(_e,{...i,...r,ref:t})},`ContextMenuItem`)),zt=I.forwardRef(B(function(e,t){let{__scopeContextMenu:n,...r}=e,i=V(n);return(0,L.jsx)(Se,{...i,...r,ref:t})},`ContextMenuSeparator`)),Bt=`ContextMenuSub`,Vt=B(e=>{let{__scopeContextMenu:t,children:n,onOpenChange:r,open:i,defaultOpen:a}=e,o=V(t),[s,c]=j({prop:i,defaultProp:a??!1,onChange:r,caller:Bt});return(0,L.jsx)(Ee,{...o,open:s,onOpenChange:c,children:n})},`ContextMenuSub`),Ht=I.forwardRef(B(function(e,t){let{__scopeContextMenu:n,...r}=e,i=V(n);return(0,L.jsx)(he,{...i,...r,ref:t})},`ContextMenuSubTrigger`)),Ut=I.forwardRef(B(function(e,t){let{__scopeContextMenu:n,...r}=e,i=V(n);return(0,L.jsx)(We,{...i,...r,ref:t,style:{...e.style,"--radix-context-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-context-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-context-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-context-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-context-menu-trigger-height":`var(--radix-popper-anchor-height)`}})},`ContextMenuSubContent`));function H(e){return t=>t.pointerType===`mouse`?void 0:e(t)}B(H,`whenTouchOrPen`);var Wt=Object.defineProperty,U=(e,t)=>Wt(e,`name`,{value:t,configurable:!0}),Gt=`Popover`,[Kt,qt]=k(Gt,[ie]),W=ie(),[Jt,G]=Kt(Gt),Yt=U(e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=W(t),c=I.useRef(null),[l,u]=I.useState(!1),[d,f]=I.useState(0),[p,m]=I.useState(0),[h,g]=j({prop:r,defaultProp:i??!1,onChange:a,caller:Gt});return(0,L.jsx)(ne,{...s,children:(0,L.jsx)(Jt,{scope:t,contentId:ce(),titleId:ce(),descriptionId:ce(),titlePresent:d>0,descriptionPresent:p>0,setTitleCount:f,setDescriptionCount:m,triggerRef:c,open:h,onOpenChange:g,onOpenToggle:I.useCallback(()=>g(e=>!e),[g]),hasCustomAnchor:l,onCustomAnchorAdd:I.useCallback(()=>u(!0),[]),onCustomAnchorRemove:I.useCallback(()=>u(!1),[]),modal:o,children:n})})},`Popover`),Xt=`PopoverAnchor`,Zt=I.forwardRef(U(function(e,t){let{__scopePopover:n,...r}=e,i=G(Xt,n),a=W(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return I.useEffect(()=>(o(),()=>s()),[o,s]),(0,L.jsx)(oe,{...a,...r,ref:t})},`PopoverAnchor`)),Qt=`PopoverTrigger`,$t=I.forwardRef(U(function(e,t){let{__scopePopover:n,...r}=e,i=G(Qt,n),a=W(n),o=A(t,i.triggerRef),s=(0,L.jsx)(D.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":dn(i.open),...r,ref:o,onClick:w(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,L.jsx)(oe,{asChild:!0,...a,children:s})},`PopoverTrigger`)),en=`PopoverPortal`,[tn,nn]=Kt(en,{forceMount:void 0}),rn=U(e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=G(en,t);return(0,L.jsx)(tn,{scope:t,forceMount:n,children:(0,L.jsx)(re,{present:n||a.open,children:(0,L.jsx)(p,{asChild:!0,container:i,children:r})})})},`PopoverPortal`),K=`PopoverContent`,an=I.forwardRef(U(function(e,t){let n=nn(K,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=G(K,e.__scopePopover);return(0,L.jsx)(re,{present:r||a.open,children:a.modal?(0,L.jsx)(sn,{...i,ref:t}):(0,L.jsx)(cn,{...i,ref:t})})},`PopoverContent`)),on=T(`PopoverContent.RemoveScroll`),sn=I.forwardRef(U(function(e,t){let n=G(K,e.__scopePopover),r=I.useRef(null),i=A(t,r),a=I.useRef(!1),{nodes:o,registry:s}=h();return I.useEffect(()=>{let e=r.current;if(e)return d(e)},[]),(0,L.jsx)(m,{as:on,allowPinchZoom:!0,shards:I.useMemo(()=>[r,...o.map(e=>({current:e}))],[r,o]),children:(0,L.jsx)(ln,{...e,ref:i,branchNodes:o,branchRegistry:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:w(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:w(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;a.current=r},{checkForDefaultPrevented:!1}),onFocusOutside:w(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})},`PopoverContentModal`)),cn=I.forwardRef(U(function(e,t){let n=G(K,e.__scopePopover),r=I.useRef(!1),i=I.useRef(!1);return(0,L.jsx)(ln,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`PopoverContentNonModal`)),ln=I.forwardRef(U(function(e,t){let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:d,"aria-describedby":f,branchNodes:p,branchRegistry:m,...h}=e,g=G(K,n),_=W(n),[v,y]=I.useState(null),C=A(t,y);return S(v),ae(),(0,L.jsx)(b,{registry:m,children:(0,L.jsx)(x,{asChild:!0,loop:!0,trapped:r,branches:p,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,L.jsx)(c,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:d,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:u,onDismiss:()=>g.onOpenChange(!1),deferPointerDownOutside:!0,children:(0,L.jsx)(ee,{"data-state":dn(g.open),role:`dialog`,id:g.contentId,"aria-labelledby":g.titlePresent?g.titleId:void 0,"aria-describedby":g.descriptionPresent?fn(f,g.descriptionId):f,..._,...h,ref:C,style:{...h.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})})},`PopoverContentImpl`)),un=I.forwardRef(U(function(e,t){let{__scopePopover:n,...r}=e,i=W(n);return(0,L.jsx)(te,{...i,...r,ref:t})},`PopoverArrow`));function dn(e){return e?`open`:`closed`}U(dn,`getState`);function fn(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}U(fn,`concatAriaDescribedby`);var pn=Object.defineProperty,mn=(e,t)=>pn(e,`name`,{value:t,configurable:!0}),hn=`Toggle`,gn=I.forwardRef(mn(function(e,t){let{pressed:n,defaultPressed:r,onPressedChange:i,...a}=e,[o,s]=j({prop:n,onChange:i,defaultProp:r??!1,caller:hn});return(0,L.jsx)(D.button,{type:`button`,"aria-pressed":o,"data-state":o?`on`:`off`,"data-disabled":e.disabled?``:void 0,...a,ref:t,onClick:w(e.onClick,()=>{e.disabled||s(!o)})})},`Toggle`)),_n=Object.defineProperty,q=(e,t)=>_n(e,`name`,{value:t,configurable:!0}),J=`ToggleGroup`,Y={Single:`single`,Multiple:`multiple`},[vn,yn]=k(J,[ke]),bn=ke(),xn=I.forwardRef(q(function(e,t){let{type:n,...r}=e;if(n===Y.Single)return(0,L.jsx)(wn,{role:`radiogroup`,...r,ref:t});if(n===Y.Multiple)return(0,L.jsx)(Tn,{role:`toolbar`,...r,ref:t});throw Error(`Missing prop \`type\` expected on \`${J}\``)},`ToggleGroup`)),[Sn,Cn]=vn(J),wn=I.forwardRef(q(function(e,t){let{value:n,defaultValue:r,onValueChange:i=q(()=>{},`onValueChange`),...a}=e,[o,s]=j({prop:n,defaultProp:r??``,onChange:i,caller:J});return(0,L.jsx)(Sn,{scope:e.__scopeToggleGroup,type:Y.Single,value:I.useMemo(()=>o?[o]:[],[o]),onItemActivate:s,onItemDeactivate:I.useCallback(()=>s(``),[s]),children:(0,L.jsx)(On,{...a,ref:t})})},`ToggleGroupImplSingle`)),Tn=I.forwardRef(q(function(e,t){let{value:n,defaultValue:r,onValueChange:i=q(()=>{},`onValueChange`),...a}=e,[o,s]=j({prop:n,defaultProp:r??[],onChange:i,caller:J}),c=I.useCallback(e=>s((t=[])=>[...t,e]),[s]),l=I.useCallback(e=>s((t=[])=>t.filter(t=>t!==e)),[s]);return(0,L.jsx)(Sn,{scope:e.__scopeToggleGroup,type:Y.Multiple,value:o,onItemActivate:c,onItemDeactivate:l,children:(0,L.jsx)(On,{...a,ref:t})})},`ToggleGroupImplMultiple`)),[En,Dn]=vn(J),On=I.forwardRef(q(function(e,t){let{__scopeToggleGroup:n,disabled:r=!1,rovingFocus:i=!0,orientation:a,dir:o,loop:s=!0,...c}=e,l=bn(n),u=ve(o),d={dir:u,...c};return(0,L.jsx)(En,{scope:n,rovingFocus:i,disabled:r,children:i?(0,L.jsx)(ye,{asChild:!0,...l,orientation:a,dir:u,loop:s,children:(0,L.jsx)(D.div,{...d,ref:t})}):(0,L.jsx)(D.div,{...d,ref:t})})},`ToggleGroupImpl`)),kn=`ToggleGroupItem`,An=I.forwardRef(q(function(e,t){let n=Cn(kn,e.__scopeToggleGroup),r=Dn(kn,e.__scopeToggleGroup),i=bn(e.__scopeToggleGroup),a=n.value.includes(e.value),o=r.disabled||e.disabled,s={...e,pressed:a,disabled:o},c=I.useRef(null);return r.rovingFocus?(0,L.jsx)(De,{asChild:!0,...i,focusable:!o,active:a,ref:c,children:(0,L.jsx)(jn,{...s,ref:t})}):(0,L.jsx)(jn,{...s,ref:t})},`ToggleGroupItem`)),jn=I.forwardRef(q(function(e,t){let{__scopeToggleGroup:n,value:r,...i}=e,a=Cn(kn,n),o={role:`radio`,"aria-checked":e.pressed,"aria-pressed":void 0},s=a.type===Y.Single?o:void 0;return(0,L.jsx)(gn,{...s,...i,ref:t,onPressedChange:e=>{e?a.onItemActivate(r):a.onItemDeactivate(r)}})},`ToggleGroupItemImpl`)),X=le({en:{saved:{saved:`Saved`,saving:`Saving…`,unsaved:`Not saved yet`,error:`Not saved`},agentDoing:{editing:e=>`${e} is editing`,looking:e=>`${e} is looking`},follow:e=>`Follow ${e}`,unfollow:e=>`Stop following ${e}`,markUp:`Mark up`,markUpHint:`Mark up what is on show, and AI makes the changes`,moreTools:`More`,export:`Export`,share:`Share`,exported:`Exported`,exportFailed:`Export failed`,format:`Format`,versions:`Languages`,include:`Include`,onShow:`On show`,all:e=>`All ${String(e)} languages`,choose:`Choose…`,chosen:e=>`${String(e)} chosen`,back:`Back`,checking:`Checking…`,blocked:e=>e===1?`1 must-fix problem stops the export`:`${String(e)} must-fix problems stop the export`,start:`Export`,queued:`Waiting`,queuedAhead:e=>`Waiting, ${String(e)} ahead`,running:e=>`Exporting ${String(e)}%`,cancel:`Cancel`,retry:`Try again`,failedHelp:e=>`Try again, or ask ${e} what went wrong.`,partial:`Some files could not be made.`,startFailed:`The export did not start`,nVersions:e=>`${String(e)} versions`,show:`Show in folder`,download:`Download`,option:{pptx:{label:`Slides`,values:{native:`Editable`,picture:`Pictures`}},steps:{label:`Each animation step`},scale:{label:`Size`}},type:{mov:`MOV (ProRes)`,srt:`Captions`,cover:`Cover image`,pptx:`PowerPoint`,zip:`ZIP (each board as a PNG)`}},"zh-cn":{saved:{saved:`已保存`,saving:`正在保存…`,unsaved:`尚未保存`,error:`没能保存`},agentDoing:{editing:e=>`${e} 正在编辑`,looking:e=>`${e} 正在查看`},follow:e=>`跟随 ${e}`,unfollow:e=>`停止跟随 ${e}`,markUp:`批改`,markUpHint:`在画面上批改,AI 照着改`,moreTools:`更多`,export:`导出`,share:`分享`,exported:`已导出`,exportFailed:`导出失败`,format:`格式`,versions:`语言`,include:`附带`,onShow:`当前`,all:e=>`全部 ${String(e)} 种语言`,choose:`选择…`,chosen:e=>`已选 ${String(e)} 个`,back:`返回`,checking:`检查中…`,blocked:e=>`有 ${String(e)} 个必修问题,暂时不能导出`,start:`导出`,queued:`排队中`,queuedAhead:e=>`排队中,前面还有 ${String(e)} 个`,running:e=>`导出中 ${String(e)}%`,cancel:`取消`,retry:`重试`,failedHelp:e=>`请重试,或让 ${e} 看看哪里出了问题。`,partial:`部分文件没能生成。`,startFailed:`导出没有开始`,nVersions:e=>`${String(e)} 个版本`,show:`在文件夹中显示`,download:`下载`,option:{pptx:{label:`幻灯片`,values:{native:`可编辑`,picture:`图片`}},steps:{label:`每个动画步骤`},scale:{label:`尺寸`}},type:{mov:`MOV(ProRes)`,srt:`字幕`,cover:`封面图`,pptx:`PowerPoint`,zip:`ZIP(每个画板一张 PNG)`}},"zh-tw":{saved:{saved:`已儲存`,saving:`正在儲存…`,unsaved:`尚未儲存`,error:`沒能儲存`},agentDoing:{editing:e=>`${e} 正在編輯`,looking:e=>`${e} 正在查看`},follow:e=>`跟隨 ${e}`,unfollow:e=>`停止跟隨 ${e}`,markUp:`批改`,markUpHint:`在畫面上批改,AI 照著改`,moreTools:`更多`,export:`匯出`,share:`分享`,exported:`已匯出`,exportFailed:`匯出失敗`,format:`格式`,versions:`語言`,include:`附帶`,onShow:`目前`,all:e=>`全部 ${String(e)} 種語言`,choose:`選擇…`,chosen:e=>`已選 ${String(e)} 個`,back:`返回`,checking:`檢查中…`,blocked:e=>`有 ${String(e)} 個必須修正的問題,暫時無法匯出`,start:`匯出`,queued:`排隊中`,queuedAhead:e=>`排隊中,前面還有 ${String(e)} 個`,running:e=>`匯出中 ${String(e)}%`,cancel:`取消`,retry:`重試`,failedHelp:e=>`請重試,或讓 ${e} 看看哪裡出了問題。`,partial:`部分檔案沒能產生。`,startFailed:`匯出沒有開始`,nVersions:e=>`${String(e)} 個版本`,show:`在資料夾中顯示`,download:`下載`,option:{pptx:{label:`投影片`,values:{native:`可編輯`,picture:`圖片`}},steps:{label:`每個動畫步驟`},scale:{label:`尺寸`}},type:{mov:`MOV(ProRes)`,srt:`字幕`,cover:`封面圖`,pptx:`PowerPoint`,zip:`ZIP(每個畫板一張 PNG)`}},ja:{saved:{saved:`保存済み`,saving:`保存中…`,unsaved:`未保存`,error:`保存できませんでした`},agentDoing:{editing:e=>`${e}が編集中`,looking:e=>`${e}が表示中`},follow:e=>`${e}をフォロー`,unfollow:e=>`${e}のフォローをやめる`,markUp:`赤入れ`,markUpHint:`画面に赤を入れると、AI が直します`,moreTools:`その他`,export:`書き出し`,share:`共有`,exported:`書き出し済み`,exportFailed:`書き出しに失敗`,format:`形式`,versions:`言語`,include:`追加`,onShow:`表示中`,all:e=>`全 ${String(e)} 言語`,choose:`選択…`,chosen:e=>`${String(e)} 件選択`,back:`戻る`,checking:`チェック中…`,blocked:e=>`要修正の問題が ${String(e)} 件あるため書き出せません`,start:`書き出す`,queued:`待機中`,queuedAhead:e=>`待機中、前に ${String(e)} 件`,running:e=>`書き出し中 ${String(e)}%`,cancel:`キャンセル`,retry:`再試行`,failedHelp:e=>`もう一度試すか、${e} に原因を確認してください。`,partial:`一部のファイルを作成できませんでした。`,startFailed:`書き出しを開始できませんでした`,nVersions:e=>`${String(e)} 個のバージョン`,show:`フォルダに表示`,download:`ダウンロード`,option:{pptx:{label:`スライド`,values:{native:`編集可能`,picture:`画像`}},steps:{label:`アニメーションの各ステップ`},scale:{label:`サイズ`}},type:{mov:`MOV(ProRes)`,srt:`字幕`,cover:`カバー画像`,pptx:`PowerPoint`,zip:`ZIP(各ボードを PNG で)`}},ko:{saved:{saved:`저장됨`,saving:`저장 중…`,unsaved:`아직 저장되지 않음`,error:`저장되지 않음`},agentDoing:{editing:e=>`${e} 편집 중`,looking:e=>`${e} 보는 중`},follow:e=>`${e} 따라가기`,unfollow:e=>`${e} 따라가기 중지`,markUp:`첨삭`,markUpHint:`화면에 첨삭하면 AI가 고쳐 줍니다`,moreTools:`더보기`,export:`내보내기`,share:`공유`,exported:`내보냄`,exportFailed:`내보내기 실패`,format:`형식`,versions:`언어`,include:`포함`,onShow:`현재`,all:e=>`${String(e)}개 언어 모두`,choose:`선택…`,chosen:e=>`${String(e)}개 선택`,back:`뒤로`,checking:`확인 중…`,blocked:e=>`수정이 필요한 문제 ${String(e)}개 때문에 내보낼 수 없습니다`,start:`내보내기`,queued:`대기 중`,queuedAhead:e=>`대기 중, 앞에 ${String(e)}개`,running:e=>`내보내는 중 ${String(e)}%`,cancel:`취소`,retry:`다시 시도`,failedHelp:e=>`다시 시도하거나 ${e}에게 원인을 물어보세요.`,partial:`일부 파일을 만들지 못했습니다.`,startFailed:`내보내기를 시작하지 못했습니다`,nVersions:e=>`버전 ${String(e)}개`,show:`폴더에서 보기`,download:`다운로드`,option:{pptx:{label:`슬라이드`,values:{native:`편집 가능`,picture:`이미지`}},steps:{label:`애니메이션 단계별로`},scale:{label:`크기`}},type:{mov:`MOV (ProRes)`,srt:`자막`,cover:`표지 이미지`,pptx:`PowerPoint`,zip:`ZIP (보드마다 PNG)`}},es:{saved:{saved:`Guardado`,saving:`Guardando…`,unsaved:`Aún sin guardar`,error:`No guardado`},agentDoing:{editing:e=>`${e} está editando`,looking:e=>`${e} está mirando`},follow:e=>`Seguir a ${e}`,unfollow:e=>`Dejar de seguir a ${e}`,markUp:`Corregir`,markUpHint:`Corrige lo que ves y la IA hace los cambios`,moreTools:`Más`,export:`Exportar`,share:`Compartir`,exported:`Exportado`,exportFailed:`Error al exportar`,format:`Formato`,versions:`Idiomas`,include:`Incluir`,onShow:`Actual`,all:e=>`Los ${String(e)} idiomas`,choose:`Elegir…`,chosen:e=>`${String(e)} elegidos`,back:`Atrás`,checking:`Comprobando…`,blocked:e=>`${String(e)} problemas obligatorios detienen la exportación`,start:`Exportar`,queued:`En espera`,queuedAhead:e=>`En espera, ${String(e)} delante`,running:e=>`Exportando ${String(e)} %`,cancel:`Cancelar`,retry:`Reintentar`,failedHelp:e=>`Reinténtalo o pregunta a ${e} qué ha fallado.`,partial:`No se pudieron crear algunos archivos.`,startFailed:`La exportación no empezó`,nVersions:e=>`${String(e)} versiones`,show:`Mostrar en la carpeta`,download:`Descargar`,option:{pptx:{label:`Diapositivas`,values:{native:`Editables`,picture:`Imágenes`}},steps:{label:`Cada paso de animación`},scale:{label:`Tamaño`}},type:{mov:`MOV (ProRes)`,srt:`Subtítulos`,cover:`Imagen de portada`,pptx:`PowerPoint`,zip:`ZIP (cada mesa de trabajo en PNG)`}},fr:{saved:{saved:`Enregistré`,saving:`Enregistrement…`,unsaved:`Pas encore enregistré`,error:`Non enregistré`},agentDoing:{editing:e=>`${e} modifie`,looking:e=>`${e} regarde`},follow:e=>`Suivre ${e}`,unfollow:e=>`Ne plus suivre ${e}`,markUp:`Annoter`,markUpHint:`Annotez ce qui est affiché, et l'IA fait les changements`,moreTools:`Plus`,export:`Exporter`,share:`Partager`,exported:`Exporté`,exportFailed:`Échec de l’export`,format:`Format`,versions:`Langues`,include:`Inclure`,onShow:`Affichée`,all:e=>`Les ${String(e)} langues`,choose:`Choisir…`,chosen:e=>`${String(e)} choisies`,back:`Retour`,checking:`Vérification…`,blocked:e=>`${String(e)} problèmes à corriger bloquent l’export`,start:`Exporter`,queued:`En attente`,queuedAhead:e=>`En attente, ${String(e)} avant celui-ci`,running:e=>`Export ${String(e)}\u00a0%`,cancel:`Annuler`,retry:`Réessayer`,failedHelp:e=>`Réessayez ou demandez à ${e} ce qui n’a pas marché.`,partial:`Certains fichiers n’ont pas pu être créés.`,startFailed:`L’export n’a pas démarré`,nVersions:e=>`${String(e)} versions`,show:`Afficher dans le dossier`,download:`Télécharger`,option:{pptx:{label:`Diapositives`,values:{native:`Modifiables`,picture:`Images`}},steps:{label:`Chaque étape d'animation`},scale:{label:`Taille`}},type:{mov:`MOV (ProRes)`,srt:`Sous-titres`,cover:`Image de couverture`,pptx:`PowerPoint`,zip:`ZIP (chaque plan de travail en PNG)`}},de:{saved:{saved:`Gespeichert`,saving:`Wird gespeichert…`,unsaved:`Noch nicht gespeichert`,error:`Nicht gespeichert`},agentDoing:{editing:e=>`${e} bearbeitet`,looking:e=>`${e} schaut sich um`},follow:e=>`${e} folgen`,unfollow:e=>`${e} nicht mehr folgen`,markUp:`Korrigieren`,markUpHint:`Korrigieren Sie, was zu sehen ist, und die KI setzt es um`,moreTools:`Mehr`,export:`Exportieren`,share:`Teilen`,exported:`Exportiert`,exportFailed:`Export fehlgeschlagen`,format:`Format`,versions:`Sprachen`,include:`Dazu`,onShow:`Aktuell`,all:e=>`Alle ${String(e)} Sprachen`,choose:`Auswählen…`,chosen:e=>`${String(e)} ausgewählt`,back:`Zurück`,checking:`Wird geprüft…`,blocked:e=>`${String(e)} Probleme verhindern den Export`,start:`Exportieren`,queued:`Wartet`,queuedAhead:e=>`Wartet, ${String(e)} davor`,running:e=>`Export läuft: ${String(e)} %`,cancel:`Abbrechen`,retry:`Erneut versuchen`,failedHelp:e=>`Versuche es erneut oder frage ${e}, was schiefgelaufen ist.`,partial:`Einige Dateien konnten nicht erstellt werden.`,startFailed:`Der Export ist nicht gestartet`,nVersions:e=>`${String(e)} Versionen`,show:`Im Ordner zeigen`,download:`Herunterladen`,option:{pptx:{label:`Folien`,values:{native:`Bearbeitbar`,picture:`Bilder`}},steps:{label:`Jeden Animationsschritt`},scale:{label:`Größe`}},type:{mov:`MOV (ProRes)`,srt:`Untertitel`,cover:`Titelbild`,pptx:`PowerPoint`,zip:`ZIP (jede Zeichenfläche als PNG)`}},pt:{saved:{saved:`Salvo`,saving:`Salvando…`,unsaved:`Ainda não salvo`,error:`Não salvo`},agentDoing:{editing:e=>`${e} está editando`,looking:e=>`${e} está olhando`},follow:e=>`Seguir ${e}`,unfollow:e=>`Parar de seguir ${e}`,markUp:`Corrigir`,markUpHint:`Corrija o que vê e a IA faz as alterações`,moreTools:`Mais`,export:`Exportar`,share:`Compartilhar`,exported:`Exportado`,exportFailed:`Falha ao exportar`,format:`Formato`,versions:`Idiomas`,include:`Incluir`,onShow:`Atual`,all:e=>`Todos os ${String(e)} idiomas`,choose:`Escolher…`,chosen:e=>`${String(e)} escolhidos`,back:`Voltar`,checking:`Verificando…`,blocked:e=>`${String(e)} problemas obrigatórios impedem a exportação`,start:`Exportar`,queued:`Aguardando`,queuedAhead:e=>`Aguardando, ${String(e)} na frente`,running:e=>`Exportando ${String(e)}%`,cancel:`Cancelar`,retry:`Tentar novamente`,failedHelp:e=>`Tente novamente ou pergunte a ${e} o que deu errado.`,partial:`Não foi possível criar alguns arquivos.`,startFailed:`A exportação não começou`,nVersions:e=>`${String(e)} versões`,show:`Mostrar na pasta`,download:`Baixar`,option:{pptx:{label:`Slides`,values:{native:`Editáveis`,picture:`Imagens`}},steps:{label:`Cada etapa da animação`},scale:{label:`Tamanho`}},type:{mov:`MOV (ProRes)`,srt:`Legendas`,cover:`Imagem de capa`,pptx:`PowerPoint`,zip:`ZIP (cada prancheta em PNG)`}}});function Mn(){let e=a(),t=X.of(e?.locale);return e=>e.doing===void 0?e.name:t.agentDoing[e.doing](e.name)}function Nn(){let e=a(),n=Mn(),{agent:r,following:i,follow:s,unfollow:c}=t();if(r?.doing===void 0)return null;let l=X.of(e?.locale);return(0,L.jsxs)(P,{[o]:``,"data-testid":`agent-here`,"data-doing":r.doing,"aria-pressed":i,title:i?l.unfollow(r.name):l.follow(r.name),className:`text-agent-text hover:text-agent-text aria-pressed:text-agent-text`,onClick:()=>{i?c():s()},children:[(0,L.jsx)(`span`,{"aria-hidden":!0,className:E(`size-2 flex-none rounded-full`,i?`bg-agent motion-safe:animate-pulse`:`border-agent border`)}),n(r)]})}function Pn(){let e=i(),{agent:r,following:a,follow:o,unfollow:s}=t(),c=r?.doing,l=r?.name;return(0,I.useEffect)(()=>{e[`agent/here`]({...c===void 0||l===void 0?{}:{agent:{name:l,doing:c}},following:a}).catch(()=>void 0)},[e,c,l,a]),n(`editor/command`,({command:e})=>{e===`follow`?o():e===`unfollow`&&s()}),null}function Fn({checked:e,multiple:t=!1,variant:n=`row`,className:r,children:i,...a}){return(0,L.jsxs)(`button`,{type:`button`,role:t?`checkbox`:`radio`,"aria-checked":e,"data-slot":`choice`,...a,className:E(`text-sm text-ink transition-colors focus-visible:outline focus-visible:-outline-offset-1 focus-visible:outline-pencil disabled:cursor-default disabled:opacity-50`,n===`row`?`flex min-h-8 items-center gap-2.5 rounded-md px-2 py-1 text-left`:`flex flex-col items-center rounded-md border px-2 py-2.5`,e?E(`bg-pencil-wash`,n===`box`&&`border-pencil`):E(`hover:bg-hover active:bg-press`,n===`box`&&`border-rule hover:border-rule-strong`),r),children:[n===`row`&&(0,L.jsx)(`span`,{"aria-hidden":!0,className:E(`flex size-4 flex-none items-center justify-center border text-on-pencil`,t?`rounded-sm`:`rounded-full`,e?t?`border-pencil bg-pencil`:`border-4 border-pencil`:`border-rule-strong`),children:t&&e&&(0,L.jsx)(Pe,{className:`size-3`})}),i]})}var Z=16,In=8;function Ln(){return(0,L.jsx)(un,{asChild:!0,width:Z,height:In,children:(0,L.jsxs)(`svg`,{viewBox:`0 0 ${String(Z)} ${String(In)}`,"aria-hidden":!0,className:`-mt-px block overflow-visible`,children:[(0,L.jsx)(`path`,{d:`M0 -1 L${String(Z/2)} 7 L${String(Z)} -1 Z`,className:`fill-popover`}),(0,L.jsx)(`path`,{d:`M0 0 L${String(Z/2)} 7 L${String(Z)} 0`,className:`fill-none stroke-border`})]})})}function Rn({className:e,...t}){return(0,L.jsx)(yt,{"data-slot":`checkbox`,className:E(`peer size-4 shrink-0 rounded-[4px] border border-input shadow-xs transition-shadow outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:bg-input/30 dark:aria-invalid:ring-destructive/40 dark:data-[state=checked]:bg-primary`,e),...t,children:(0,L.jsx)(xt,{"data-slot":`checkbox-indicator`,className:`grid place-content-center text-current transition-none`,children:(0,L.jsx)(Pe,{className:`size-3.5`})})})}function zn({...e}){return(0,L.jsx)(Yt,{"data-slot":`popover`,...e})}function Bn({...e}){return(0,L.jsx)($t,{"data-slot":`popover-trigger`,...e})}function Vn({className:e,align:t=`center`,sideOffset:n=4,...r}){return(0,L.jsx)(rn,{children:(0,L.jsx)(an,{"data-slot":`popover-content`,align:t,sideOffset:n,className:E(`z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-hidden data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95`,e),...r})})}function Hn({...e}){return(0,L.jsx)(Zt,{"data-slot":`popover-anchor`,...e})}function Un({...e}){return(0,L.jsx)(ue,{"data-slot":`sheet`,...e})}function Wn({...e}){return(0,L.jsx)(_,{"data-slot":`sheet-portal`,...e})}function Gn({className:e,...t}){return(0,L.jsx)(f,{"data-slot":`sheet-overlay`,className:E(`fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0`,e),...t})}function Kn({className:e,children:t,side:n=`right`,showCloseButton:r=!0,...i}){return(0,L.jsxs)(Wn,{children:[(0,L.jsx)(Gn,{}),(0,L.jsxs)(v,{"data-slot":`sheet-content`,className:E(`fixed z-50 flex flex-col gap-4 bg-background shadow-lg transition ease-in-out data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:animate-in data-[state=open]:duration-500`,n===`right`&&`inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm`,n===`left`&&`inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm`,n===`top`&&`inset-x-0 top-0 h-auto border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top`,n===`bottom`&&`inset-x-0 bottom-0 h-auto border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom`,e),...i,children:[t,r&&(0,L.jsxs)(u,{className:`absolute top-2.5 right-2.5 grid size-7 place-items-center rounded-md text-lead ring-offset-background hover:bg-hover hover:text-ink focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus:outline-hidden active:bg-press disabled:pointer-events-none motion-safe:transition-colors [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,children:[(0,L.jsx)(C,{className:`size-4`}),(0,L.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function qn({className:e,...t}){return(0,L.jsx)(y,{"data-slot":`sheet-title`,className:E(`font-semibold text-foreground`,e),...t})}var Jn=O(`inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-[color,box-shadow] outline-none hover:bg-muted hover:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-transparent`,outline:`border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground`},size:{default:`h-9 min-w-9 px-2`,sm:`h-8 min-w-8 px-1.5`,lg:`h-10 min-w-10 px-2.5`}},defaultVariants:{variant:`default`,size:`default`}}),Yn=I.createContext({size:`default`,variant:`default`,spacing:0});function Xn({className:e,variant:t,size:n,spacing:r=0,children:i,...a}){return(0,L.jsx)(xn,{"data-slot":`toggle-group`,"data-variant":t,"data-size":n,"data-spacing":r,style:{"--gap":r},className:E(`group/toggle-group flex w-fit items-center gap-[--spacing(var(--gap))] rounded-md data-[spacing=default]:data-[variant=outline]:shadow-xs`,e),...a,children:(0,L.jsx)(Yn.Provider,{value:{variant:t,size:n,spacing:r},children:i})})}function Zn({className:e,children:t,variant:n,size:r,...i}){let a=I.useContext(Yn);return(0,L.jsx)(An,{"data-slot":`toggle-group-item`,"data-variant":a.variant||n,"data-size":a.size||r,"data-spacing":a.spacing,className:E(Jn({variant:a.variant||n,size:a.size||r}),`w-auto min-w-0 shrink-0 px-3 focus:z-10 focus-visible:z-10`,`data-[spacing=0]:rounded-none data-[spacing=0]:shadow-none data-[spacing=0]:first:rounded-l-md data-[spacing=0]:last:rounded-r-md data-[spacing=0]:data-[variant=outline]:border-l-0 data-[spacing=0]:data-[variant=outline]:first:border-l`,e),...i,children:t})}var Qn=5;function $n(e,t){let n=new Set;return e.filter(e=>e.item===t&&e.state!==`cancelled`).reverse().filter(e=>{if(e.state!==`done`||e.files.length===0)return!0;let t=[...e.files].sort().join(`
|
|
2
|
-
`);return!n.has(t)&&(n.add(t),!0)}).slice(0,Qn)}var Q=e=>e.state===`queued`||e.state===`running`;function er(e,t,n,r={}){let i=(e,t)=>e.length===t.length&&e.every(e=>t.includes(e));return Q(e)&&i(e.versions,t)&&i(e.types,n)&&tr(e.options??{},r)}var tr=(e,t)=>Object.keys({...e,...t}).every(n=>e[n]===t[n]);function nr(e,t,n){return Object.fromEntries(e.flatMap(e=>{let r=n[e.name];return!e.only.includes(t)||r===void 0?[]:e.values?e.values.includes(String(r))?[[e.name,r]]:[]:r===!0?[[e.name,!0]]:[]}))}function rr(e,t){return Math.max(0,e.filter(Q).map(e=>e.id).indexOf(t))}function ir(e,t,n,r){if(n.length!==0)return e===`all`?[...n]:e===`some`?n.filter(e=>r.includes(e)):t===void 0?[...n]:[t]}function ar(e,t){let n=e.findLast(Q);if(n)return n.state===`running`?{at:`running`,percent:Math.round(n.progress*100)}:{at:`queued`};let r=e[0];return r===void 0||!t.has(r.id)?{at:`idle`}:r.state===`failed`?{at:`failed`}:{at:`done`}}var or=e=>e.slice(e.lastIndexOf(`/`)+1),sr={mp4:`MP4`,gif:`GIF`,png:`PNG`,jpeg:`JPEG`,webp:`WebP`,avif:`AVIF`,pdf:`PDF`,html:`HTML`,zip:`ZIP`,psd:`PSD`,docx:`Word`,md:`Markdown`,xlsx:`Excel`,csv:`CSV`,json:`JSON`,glb:`GLB`},cr=(e,t)=>sr[t]??(t in e.type?e.type[t]:t);function lr(){let e=a(),t=X.of(e?.locale),n=e?.item.kindInfo.exports?.names,r=e?.locale??`en`;return e=>{let i=n?.[e];return i?.[r]??i?.en??cr(t,e)}}function ur(){let[e,t]=(0,I.useState)(()=>window.matchMedia(`(max-width: 479px)`).matches);return(0,I.useEffect)(()=>{let e=window.matchMedia(`(max-width: 479px)`),n=()=>{t(e.matches)};return e.addEventListener(`change`,n),()=>{e.removeEventListener(`change`,n)}},[]),e}function dr(e){let t=i(),[r,a]=(0,I.useState)([]),[o,s]=(0,I.useState)(new Set),[c,l]=(0,I.useState)(!1);(0,I.useEffect)(()=>{let e=!0;return N(t,`export/list`,{}).then(t=>{e&&(a(t.jobs),l(t.reveal))},()=>void 0),()=>{e=!1}},[t]),n(`export/changed`,({job:t})=>{a(e=>{let n=e.findIndex(e=>e.id===t.id);return n<0?[...e,t]:e.map((e,r)=>r===n?t:e)}),!Q(t)&&!e&&s(e=>new Set(e).add(t.id))});let[u,d]=(0,I.useState)(e);return u!==e&&(d(e),e&&s(new Set)),{all:r,fresh:o,reveals:c}}function fr(e,t){let n=i(),r=`item-bar.export.${e}`,[a,o]=(0,I.useState)({type:t.types[0]??``,extras:[],options:{}});return(0,I.useEffect)(()=>{let e=!0;return n[`storage/get`]({key:r}).then(({value:n})=>{let r=n;if(!e||!r)return;let i=t.types.find(e=>e===r.type);i!==void 0&&o({type:i,extras:t.extras.filter(e=>r.extras?.includes(e)),options:r.options??{}})},()=>void 0),()=>{e=!1}},[n,r,t]),[a,e=>{o(e),n[`storage/set`]({key:r,value:e}).catch(()=>void 0)}]}async function pr(e,t){let{url:n}=await e[`files/url`]({path:t}),r=document.createElement(`a`);r.href=n,r.download=or(t),r.click()}async function mr(e,t,n){n&&await N(e,`export/reveal`,{path:t}).then(()=>!0,()=>!1)||await pr(e,t)}function hr({job:e,versions:t,ahead:n,words:r,reveals:o}){let s=lr(),c=i(),l=a()?.agent?.name??`AllyHub`,u=Math.round(e.progress*100),d=o?st:Ke,f=o?r.show:r.download,p=e.versions.length===0?void 0:e.versions.length>2?r.nVersions(e.versions.length):e.versions.map(e=>t.find(t=>t.key===e)?.label??e).join(`, `),m=[e.types.map(e=>s(e)).join(`, `),...t.length>1&&p!==void 0?[p]:[]].join(` · `);return(0,L.jsxs)(`div`,{className:`border-t py-2 pr-2 pl-4`,"data-testid":`export-job`,"data-state":e.state,children:[Q(e)&&(0,L.jsxs)(`div`,{className:`pr-2`,children:[(0,L.jsxs)(`div`,{className:`flex h-7 items-center gap-2`,children:[(0,L.jsx)(`span`,{className:`text-dense min-w-0 flex-1 truncate`,children:m}),(0,L.jsx)(`span`,{className:`text-lead text-xs tabular-nums`,children:e.state===`running`?`${String(u)}%`:n>0?r.queuedAhead(n):r.queued}),(0,L.jsx)(P,{icon:!0,"aria-label":r.cancel,title:r.cancel,"data-testid":`export-cancel`,onClick:()=>{N(c,`export/cancel`,{job:e.id}).catch(()=>void 0)},children:(0,L.jsx)(C,{"aria-hidden":!0})})]}),(0,L.jsx)(me,{value:u,className:`mt-1 h-1`})]}),e.state===`failed`&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(`div`,{className:`flex h-7 items-center gap-2`,children:[(0,L.jsx)(Ae,{className:`text-destructive size-3.5 flex-none`,"aria-hidden":!0}),(0,L.jsxs)(`span`,{className:`text-dense text-destructive min-w-0 flex-1 truncate`,children:[r.exportFailed,` · `,m]}),(0,L.jsx)(P,{icon:!0,"aria-label":r.retry,title:r.retry,"data-testid":`export-retry`,onClick:()=>{N(c,`export/start`,{item:e.item,versions:e.versions,types:e.types,...e.options?{options:e.options}:{}}).catch(e=>{xe.error(r.startFailed,{description:e instanceof Error?e.message:String(e)})})},children:(0,L.jsx)(ct,{"aria-hidden":!0})})]}),(0,L.jsx)(`p`,{className:`text-lead pr-2 pl-5.5 text-xs`,title:e.error,children:r.failedHelp(l)})]}),e.files.map(e=>(0,L.jsxs)(`div`,{className:`flex h-7 items-center gap-2`,"data-testid":`export-file`,children:[(0,L.jsx)(Pe,{className:`text-success size-3.5 flex-none`,"aria-hidden":!0}),(0,L.jsx)(`span`,{className:`text-dense min-w-0 flex-1 truncate`,title:e,children:or(e)}),(0,L.jsx)(P,{icon:!0,"aria-label":f,title:f,"data-testid":`export-give`,onClick:()=>{mr(c,e,o)},children:(0,L.jsx)(d,{"aria-hidden":!0})})]},e)),e.state===`done`&&e.error!==void 0&&(0,L.jsx)(`p`,{className:`text-lead pr-2 pl-5.5 text-xs`,title:e.error,children:r.partial})]})}function gr({versions:e,shown:t,picked:n,onPick:r,onBack:i,words:a}){return(0,L.jsxs)(`div`,{"data-testid":`export-choose`,children:[(0,L.jsxs)(`div`,{className:`flex h-11 items-center gap-1 border-b pr-4 pl-2`,children:[(0,L.jsx)(P,{icon:!0,"aria-label":a.back,title:a.back,onClick:i,children:(0,L.jsx)(Ge,{"aria-hidden":!0})}),(0,L.jsx)(`span`,{className:`text-sm font-medium`,children:a.versions}),(0,L.jsxs)(`span`,{className:`text-lead ml-auto text-xs tabular-nums`,children:[n.length,`/`,e.length]})]}),(0,L.jsx)(`ul`,{className:`max-h-64 overflow-y-auto p-2`,children:e.map(e=>(0,L.jsx)(`li`,{children:(0,L.jsxs)(`label`,{className:`pressable flex h-8 items-center gap-2 rounded-md px-2 text-sm`,children:[(0,L.jsx)(Rn,{checked:n.includes(e.key),"data-version":e.key,onCheckedChange:t=>{r(t===!0?[...n,e.key]:n.filter(t=>t!==e.key))}}),(0,L.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.label}),e.key===t&&(0,L.jsx)(`span`,{className:`text-lead text-xs`,children:a.onShow})]})},e.key))})]})}function _r({kind:e,offer:t,item:n,props:r,jobs:a,all:o,words:s,reveals:c,startRef:l}){let u=lr(),d=i(),f=r.versions??[],p=f.map(e=>e.key),m=f.find(e=>e.key===r.shown)?.label,h=r.unavailable??{},[g,_]=fr(e,t),[v,y]=(0,I.useState)(`shown`),[b,x]=(0,I.useState)(r.shown===void 0?[]:[r.shown]),[S,C]=(0,I.useState)(!1),[ee,w]=(0,I.useState)(!1),T=ir(v,r.shown,p,b),te=T?.length??1,D=[g.type,...g.extras.filter(e=>h[e]===void 0)],O=t.options.filter(e=>e.only.includes(g.type)),ne=nr(O,g.type,g.options),re=O.filter(e=>e.values===void 0),ie=(e,t)=>{_({...g,options:{...g.options,[e]:t}})},k=r.check?.waiting===!0,A=k?0:r.check?.problems(T)??0,ae=a.some(e=>er(e,T??[],D,ne)),oe=async()=>{w(!0);try{await N(d,`export/start`,{item:n,...T?{versions:T}:{},types:D,...Object.keys(ne).length>0?{options:ne}:{}})}catch(e){if(de(e))return;xe.error(s.startFailed,{description:e instanceof Error?e.message:String(e)})}finally{w(!1)}},j=(0,L.jsx)(yr,{label:s.format,types:t.types,chosen:g.type,name:u,onChoose:e=>{_({...g,type:e})}}),ce=(0,L.jsx)(se,{ref:l,size:`sm`,disabled:k||A>0||ee||te===0||ae,"data-testid":`export-start`,onClick:()=>{oe()},children:k?s.checking:s.start});return(0,L.jsxs)(`div`,{className:`overflow-hidden rounded-lg text-sm`,"data-testid":`export-panel`,children:[S?(0,L.jsx)(gr,{versions:f,shown:r.shown,picked:b,onPick:x,onBack:()=>{C(!1)},words:s}):(0,L.jsxs)(L.Fragment,{children:[t.types.length>1&&(0,L.jsx)(`div`,{className:`px-4 pt-4`,children:j}),(p.length>1||t.extras.length+O.length>0)&&(0,L.jsxs)(`div`,{className:`grid grid-cols-[max-content_minmax(0,1fr)] items-center gap-x-4 gap-y-3 px-4 pt-4`,children:[O.map(e=>e.values?(0,L.jsxs)(I.Fragment,{children:[(0,L.jsx)(`span`,{className:`text-lead`,children:s.option[e.name]?.label}),(0,L.jsx)(Xn,{type:`single`,variant:`outline`,size:`sm`,className:`w-full`,"aria-label":s.option[e.name]?.label,"data-testid":`export-option-${e.name}`,value:String(g.options[e.name]??e.values[0]),onValueChange:t=>{t!==``&&ie(e.name,t)},children:e.values.map(t=>(0,L.jsx)(Zn,{value:t,"data-value":t,className:`flex-1`,children:s.option[e.name]?.values?.[t]??t},t))})]},e.name):null),p.length>1&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`span`,{className:`text-lead`,children:s.versions}),(0,L.jsxs)(Ie,{value:v,onValueChange:e=>{y(e),e===`some`&&C(!0)},children:[(0,L.jsx)(Ne,{size:`sm`,"aria-label":s.versions,className:`w-full min-w-0`,"data-testid":`export-scope`,children:(0,L.jsx)(Re,{})}),(0,L.jsxs)(Me,{position:`popper`,align:`start`,children:[(0,L.jsx)(Be,{value:`shown`,children:m??s.onShow}),(0,L.jsx)(Be,{value:`all`,children:s.all(p.length)}),(0,L.jsx)(He,{}),(0,L.jsx)(Be,{value:`some`,onPointerUp:()=>{C(!0)},children:v===`some`?s.chosen(b.length):s.choose})]})]})]}),t.extras.length+re.length>0&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`span`,{className:`text-lead self-start`,children:s.include}),(0,L.jsxs)(`div`,{className:`grid gap-1.5`,"data-testid":`export-include`,children:[re.map(e=>(0,L.jsxs)(`label`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(Rn,{checked:g.options[e.name]===!0,"data-option":e.name,onCheckedChange:t=>{ie(e.name,t===!0)}}),(0,L.jsx)(`span`,{className:`truncate`,children:s.option[e.name]?.label})]},e.name)),t.extras.map(e=>{let t=h[e];return(0,L.jsxs)(`label`,{title:t,className:E(`flex items-center gap-2`,t!==void 0&&`text-lead-soft`),children:[(0,L.jsx)(Rn,{checked:t===void 0&&g.extras.includes(e),disabled:t!==void 0,"data-type":e,onCheckedChange:t=>{_({...g,extras:t===!0?[...g.extras,e]:g.extras.filter(t=>t!==e)})}}),(0,L.jsx)(`span`,{className:`truncate`,children:u(e)})]},e)})]})]})]}),A>0&&(0,L.jsxs)(`p`,{className:`text-dense text-destructive flex items-start gap-1.5 px-4 pt-3`,"data-testid":`export-blocked`,children:[(0,L.jsx)(Ae,{className:`mt-0.5 size-3.5 flex-none`,"aria-hidden":!0}),s.blocked(A)]}),(0,L.jsxs)(`div`,{className:`flex items-center gap-3 p-4`,children:[(0,L.jsx)(`span`,{className:`text-lead min-w-0 flex-1 truncate text-xs`,children:r.facts??(t.types.length===1?u(g.type):void 0)}),ce]})]}),a.length>0&&(0,L.jsx)(`div`,{className:`max-h-56 overflow-y-auto`,children:a.map(e=>(0,L.jsx)(hr,{job:e,versions:f,ahead:rr(o,e.id),words:s,reveals:c},e.id))})]})}var vr={png:$e,jpeg:$e,webp:$e,avif:$e,gif:nt,mp4:ot,mov:ot,pdf:Le,docx:et,md:at,txt:at,html:Qe,xlsx:rt,csv:rt,json:Xe,pptx:Ze,zip:Je,psd:it,glb:Ye};function yr(e){let t=(0,I.useRef)(null),n=e.types.length,r=n<=4?n:Math.min(4,Math.ceil(n/2));return(0,L.jsx)(`div`,{ref:t,role:`radiogroup`,"aria-label":e.label,"data-testid":`export-format`,className:`grid gap-2`,style:{gridTemplateColumns:`repeat(${String(r)}, minmax(0, 1fr))`},onKeyDown:r=>{let i=r.key===`ArrowRight`||r.key===`ArrowDown`?1:r.key===`ArrowLeft`||r.key===`ArrowUp`?-1:0;if(i===0)return;r.preventDefault();let a=e.types[(e.types.indexOf(e.chosen)+i+n)%n];a!==void 0&&(e.onChoose(a),t.current?.querySelector(`[data-type="${a}"]`)?.focus())},children:e.types.map(t=>{let n=vr[t]??tt,r=e.chosen===t;return(0,L.jsxs)(Fn,{variant:`box`,checked:r,tabIndex:r?0:-1,"data-type":t,title:e.name(t),className:`min-h-16 min-w-0 justify-center gap-1.5 rounded-lg px-1.5 py-2.5`,onClick:()=>{e.onChoose(t)},children:[(0,L.jsx)(n,{"aria-hidden":!0,strokeWidth:1.5,className:E(`size-5`,r?`text-pencil`:`text-lead`)}),(0,L.jsx)(`span`,{className:`line-clamp-2 w-full text-center text-xs leading-tight text-balance break-words`,children:e.name(t)})]},t)})})}function br(e){let t=/Mac|iPhone|iPad/u.test(navigator.userAgent),n=e.target;return e.code===`KeyE`&&(t?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey)&&!e.shiftKey&&!e.altKey&&!(n instanceof HTMLElement&&(n.isContentEditable||n.tagName===`INPUT`||n.tagName===`TEXTAREA`))}function xr(e){let t=i(),r=a(),o=r?.commands===!0,s=r?.item.kind,c=r?.item.kindInfo.exports,l=r?.item.id,u=X.of(r?.locale),d=ur(),f=(0,I.useRef)(null),[p,m]=(0,I.useState)(!1),{all:h,fresh:g,reveals:_}=dr(p);n(`editor/command`,({command:e,open:t})=>{e===`export`&&m(e=>t??!e)}),(0,I.useEffect)(()=>{let e=e=>{br(e)&&(e.preventDefault(),m(e=>!e))};return window.addEventListener(`keydown`,e),()=>{window.removeEventListener(`keydown`,e)}},[]),(0,I.useEffect)(()=>{if(!p||d)return;let e=()=>{m(!1)};return window.addEventListener(`blur`,e),()=>{window.removeEventListener(`blur`,e)}},[p,d]);let v=c!==void 0,y=l===void 0?[]:$n(h,l),b=ar(y,g),x=b.at===`running`?b.percent:void 0;if((0,I.useEffect)(()=>{o&&v&&t[`export/state`]({at:b.at,...x===void 0?{}:{percent:x},open:p}).catch(()=>void 0)},[t,o,v,b.at,x,p]),s===void 0||l===void 0||c===void 0)return null;let S=b.at===`running`?`${String(b.percent)}%`:b.at===`queued`?u.queued:b.at===`done`?u.exported:b.at===`failed`?u.exportFailed:u.export,C=(0,L.jsxs)(P,{"data-testid":`export`,"data-state":b.at,"aria-pressed":p,"aria-label":b.at===`running`?u.running(b.percent):S,title:S,onClick:()=>{d&&m(!0)},children:[b.at===`running`&&(0,L.jsx)(pe,{value:b.percent/100}),b.at===`queued`&&(0,L.jsx)(pe,{value:0}),b.at===`done`&&(0,L.jsx)(Pe,{className:`text-success`,"aria-hidden":!0}),b.at===`failed`&&(0,L.jsx)(Ae,{className:`text-destructive`,"aria-hidden":!0}),b.at===`idle`&&(0,L.jsx)(Ke,{"aria-hidden":!0}),(0,L.jsx)(`span`,{className:`@max-lg/item:hidden`,children:S})]}),ee=(0,L.jsx)(_r,{kind:s,offer:c,item:l,props:e,jobs:y,all:h,words:u,reveals:_,startRef:f});return d?(0,L.jsxs)(L.Fragment,{children:[!o&&C,(0,L.jsx)(Un,{open:p,onOpenChange:m,children:(0,L.jsxs)(Kn,{side:`bottom`,showCloseButton:!1,className:`gap-0 rounded-t-lg`,children:[(0,L.jsx)(qn,{className:`sr-only`,children:u.export}),ee]})})]}):(0,L.jsxs)(zn,{open:p,onOpenChange:m,children:[o?(0,L.jsx)(Hn,{className:`pointer-events-none fixed top-0 right-2 size-0`}):(0,L.jsx)(Bn,{asChild:!0,children:C}),(0,L.jsxs)(Vn,{align:`end`,sideOffset:o?4:8,className:`w-88 p-0`,onOpenAutoFocus:e=>{f.current&&!f.current.disabled&&(e.preventDefault(),f.current.focus())},children:[!o&&(0,L.jsx)(Ln,{}),ee]})]})}function Sr({...e}){return(0,L.jsx)(Mt,{"data-slot":`context-menu`,...e})}function Cr({...e}){return(0,L.jsx)(Pt,{"data-slot":`context-menu-trigger`,...e})}function wr({...e}){return(0,L.jsx)(Vt,{"data-slot":`context-menu-sub`,...e})}function Tr({className:e,inset:t,children:n,...r}){return(0,L.jsxs)(Ht,{"data-slot":`context-menu-sub-trigger`,"data-inset":t,className:E(`flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[inset]:pl-8 data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground`,e),...r,children:[n,(0,L.jsx)(ze,{className:`ml-auto`})]})}function Er({className:e,...t}){return(0,L.jsx)(Ut,{"data-slot":`context-menu-sub-content`,className:E(`z-50 min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95`,e),...t})}function Dr({className:e,container:t,...n}){return(0,L.jsx)(Ft,{container:t,children:(0,L.jsx)(Lt,{"data-slot":`context-menu-content`,className:E(`z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95`,e),...n})})}function Or({className:e,inset:t,variant:n=`default`,...r}){return(0,L.jsx)(Rt,{"data-slot":`context-menu-item`,"data-inset":t,"data-variant":n,className:E(`relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:*:[svg]:text-destructive!`,e),...r})}function kr({className:e,...t}){return(0,L.jsx)(zt,{"data-slot":`context-menu-separator`,className:E(`-mx-1 my-1 h-px bg-border`,e),...t})}function Ar({className:e,...t}){return(0,L.jsx)(`span`,{"data-slot":`context-menu-shortcut`,className:E(`ml-auto text-xs tracking-widest text-muted-foreground`,e),...t})}var jr=150,Mr=e=>{if(!(e.currentTarget instanceof Element))return;let t=e.currentTarget.getBoundingClientRect();return{x:t.x,y:t.y,width:t.width,height:t.height}},Nr=(e,t,n=!0)=>{let r=Mr(t);setTimeout(()=>{e.begin(r,n)},jr)};function $(){let e=i(),t=a();if(t?.notes!==!0)return;let n=X.of(t.locale);return{label:n.markUp,hint:n.markUpHint,begin:(t,n)=>{e[`note/begin`]({...t?{from:t}:{},...n===!0?{selection:n}:{}}).catch(()=>void 0)}}}function Pr(){let e=$();return e?(0,L.jsxs)(P,{title:e.hint,"data-testid":`mark-up`,className:`text-ink`,onClick:t=>{e.begin(Mr(t))},children:[(0,L.jsx)(F,{"aria-hidden":!0}),e.label]}):null}function Fr(e){let t=$();return t?(0,L.jsx)(`div`,{role:`toolbar`,"aria-label":t.label,"data-note-chrome":``,"data-testid":`mark-up-bar`,className:`border-rule bg-sheet shadow-overlay flex items-center rounded-lg border p-0.5 ${e.className??``}`,style:e.style,onPointerDown:e=>{e.stopPropagation()},children:(0,L.jsxs)(P,{title:t.hint,"data-testid":`mark-up-selected`,className:`text-ink`,onClick:e=>{t.begin(Mr(e),!0)},children:[(0,L.jsx)(F,{"aria-hidden":!0}),t.label]})}):null}function Ir({selection:e=!0}={}){let t=$();return t?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(Ue,{}),(0,L.jsxs)(je,{title:t.hint,"data-testid":`mark-up-item`,onSelect:n=>{Nr(t,n,e)},children:[(0,L.jsx)(F,{className:`size-3.5`,"aria-hidden":!0}),t.label]})]}):null}function Lr(){let e=$();return e?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(kr,{}),(0,L.jsxs)(Or,{title:e.hint,"data-testid":`mark-up-item`,onSelect:t=>{Nr(e,t)},children:[(0,L.jsx)(F,{className:`size-3.5`,"aria-hidden":!0}),e.label]})]}):null}var Rr=e=>e instanceof Element&&e.closest(`input, textarea`)!==null;function zr(){let e=$(),t=e!==void 0,[n,r]=(0,I.useState)();return(0,I.useEffect)(()=>{if(!t)return;let e=e=>{e.defaultPrevented||Rr(e.target)||(e.preventDefault(),r({x:e.clientX,y:e.clientY}))};return document.addEventListener(`contextmenu`,e),()=>{document.removeEventListener(`contextmenu`,e)}},[t]),!e||!n?null:(0,L.jsxs)(Ve,{open:!0,onOpenChange:e=>{e||r(void 0)},children:[(0,L.jsx)(ge,{asChild:!0,children:(0,L.jsx)(`span`,{style:{position:`fixed`,left:n.x,top:n.y,width:0,height:0}})}),(0,L.jsx)(Fe,{align:`start`,className:`text-xs`,children:(0,L.jsxs)(je,{title:e.hint,"data-testid":`mark-up-item`,onSelect:t=>{Nr(e,t)},children:[(0,L.jsx)(F,{className:`size-3.5`,"aria-hidden":!0}),e.label]})})]})}function Br(){let e=a();return e?.share===!0&&e.mode===`edit`&&e.item.kindInfo.share===!0}function Vr(){let e=i(),t=a();if(!Br())return null;let n=X.of(t?.locale);return(0,L.jsxs)(P,{"data-testid":`share`,"aria-label":n.share,title:n.share,onClick:()=>{e[`share/begin`]({}).catch(()=>void 0)},children:[(0,L.jsx)(lt,{"aria-hidden":!0}),(0,L.jsx)(`span`,{className:`@max-lg/item:hidden`,children:n.share})]})}var Hr=800;function Ur(e){let t=e?.state===`saving`||e?.state===`unsaved`,[n,r]=(0,I.useState)(!1);return(0,I.useEffect)(()=>{if(!t)return;let e=setTimeout(()=>{r(!0)},Hr);return()=>{clearTimeout(e),r(!1)}},[t]),e!==void 0&&e.state!==`saved`&&(!t||n)}function Wr({saved:e,words:t}){return(0,L.jsx)(`span`,{"data-testid":`save-state`,"data-state":e.state,title:e.message,className:E(`px-1 text-xs`,e.state===`error`?`text-destructive`:`text-lead`),children:t.saved[e.state]})}function Gr({start:e,saved:t,exports:n}){let i=a(),o=Br(),s=X.of(i?.locale),c=Ur(t),l=r()?.doing!==void 0;if(i?.mode!==`edit`)return e?(0,L.jsx)(`div`,{className:`bg-background flex min-h-9 flex-none items-center gap-1 border-b px-1 font-sans text-sm`,"data-testid":`item-bar`,children:e}):null;if(i.commands===!0)return(0,L.jsxs)(L.Fragment,{children:[e?(0,L.jsx)(`div`,{className:`bg-background @container/item flex min-h-9 flex-none items-center gap-1 border-b px-1 font-sans text-sm`,"data-testid":`item-bar`,children:e}):null,(0,L.jsx)(Pn,{}),(0,L.jsx)(xr,{...n}),(0,L.jsx)(zr,{})]});let u=i.item.kindInfo.exports!==void 0;return!e&&!c&&!u&&!o&&!l?(0,L.jsx)(zr,{}):(0,L.jsxs)(`div`,{className:`bg-background @container/item flex min-h-9 flex-none items-center gap-1 border-b px-1 font-sans text-sm`,"data-testid":`item-bar`,children:[e,(0,L.jsxs)(`div`,{className:`ml-auto flex flex-none items-center gap-1`,children:[(0,L.jsx)(Nn,{}),t&&c&&(0,L.jsx)(Wr,{saved:t,words:s}),(0,L.jsx)(Pr,{}),(0,L.jsx)(xr,{...n}),(0,L.jsx)(Vr,{})]}),(0,L.jsx)(zr,{})]})}var Kr=e(l(),1),qr=`group-data-[compact]/bar:hidden`,Jr=32,Yr={compact:!1,out:[],firsts:[],order:{}},Xr=(0,I.createContext)(null),Zr=(e,t)=>e.compact===t.compact&&e.out.join(`
|
|
3
|
-
`)===t.out.join(`
|
|
4
|
-
`)&&e.firsts.join(`
|
|
5
|
-
`)===t.firsts.join(`
|
|
6
|
-
`)&&JSON.stringify(e.order)===JSON.stringify(t.order);function Qr({children:e,id:t,priority:n=0,keep:r=!1,ruled:i=!0}){let a=(0,I.useContext)(Xr),o=(0,I.useId)(),s=t??o,c=a?.fit.firsts.includes(s)??!1,l=a?.touch;(0,I.useLayoutEffect)(()=>(l?.(),l),[l]);let u=(0,L.jsx)(`span`,{className:E(`relative flex h-8 flex-none items-center gap-0.5`,!c&&`pl-2`,!c&&i&&`before:bg-rule before:absolute before:top-2 before:bottom-2 before:left-0.75 before:w-px`),children:e});if(!a)return u;let d=a.fit.out.includes(s);return(0,L.jsx)(`span`,{"data-group":s,"data-priority":n,"data-keep":r?``:void 0,className:d?`hidden`:`flex flex-none`,children:d?a.panel?(0,Kr.createPortal)((0,L.jsx)(`span`,{"data-group":s,"data-away":``,className:`flex flex-none`,style:{order:a.fit.order[s]??0},children:u}),a.panel):null:u})}function $r({testid:e,className:t,children:n,...r}){let i=a(),o=X.of(i?.locale),s=(0,I.useRef)(null),[c,l]=(0,I.useState)(null),u=(0,I.useRef)(new Map),[d,f]=(0,I.useState)(Yr),[p,m]=(0,I.useState)(!1),[h,g]=(0,I.useState)(0),_=(0,I.useCallback)(()=>{g(e=>e+1)},[]),v=(0,I.useRef)(null);return(0,I.useLayoutEffect)(()=>{let e=new ResizeObserver(()=>{g(e=>e+1)});return v.current=e,s.current&&e.observe(s.current),()=>{e.disconnect(),v.current=null}},[]),(0,I.useLayoutEffect)(()=>{let e=s.current;if(!e)return;let t=[],n=new Set,r=!0;for(let i of e.querySelectorAll(`[data-group]:not([data-away]), [data-spacer]`)){if(i.dataset.spacer!==void 0){r=!0;continue}let e=i.dataset.group??``;if(t.push({key:e,priority:Number(i.dataset.priority??0),keep:i.dataset.keep!==void 0,at:t.length}),d.out.includes(e))continue;r&&n.add(e),r=!1,v.current?.observe(i);let a=i.getBoundingClientRect().width;a>0&&u.current.set(`${String(d.compact)}:${e}`,a)}for(let e of c?.querySelectorAll(`[data-away]`)??[]){let t=e.getBoundingClientRect().width;t>0&&u.current.set(`${String(d.compact)}:${e.dataset.group??``}`,t)}let i=e.clientWidth,a=(e,t)=>u.current.get(`${String(e)}:${t.key}`),o=e=>t.every(t=>a(e,t)!==void 0),l=e=>t.reduce((t,n)=>t+(a(e,n)??0),0),h=!1,g=[];if(!o(!1)||l(!1)<=i)h=!1;else if(!o(!0)||l(!0)<=i)h=!0;else{h=!0;let e=t.filter(e=>!e.keep).sort((e,t)=>e.priority-t.priority||t.at-e.at),n=new Set,r=l(!0)+Jr;for(let t of e){if(r<=i)break;n.add(t.key),r-=a(!0,t)??0}g=t.filter(e=>n.has(e.key)).map(e=>e.key)}let _={compact:h,out:g,firsts:[...n],order:Object.fromEntries(t.map(e=>[e.key,e.at]))};Zr(_,d)||f(_),g.length===0&&p&&m(!1)},[d,p,h,c,n]),(0,L.jsx)(Xr.Provider,{value:{fit:d,panel:p?c:null,touch:_},children:(0,L.jsxs)(`div`,{...r,ref:s,role:r.role??`toolbar`,"data-testid":e,"data-compact":d.compact?``:void 0,className:E(`group/bar relative flex h-8 min-w-0 flex-1 items-center overflow-hidden`,t),children:[n,d.out.length>0?(0,L.jsxs)(zn,{open:p,onOpenChange:m,children:[(0,L.jsx)(Bn,{asChild:!0,children:(0,L.jsx)(P,{icon:!0,className:`ml-auto flex-none`,"aria-label":o.moreTools,title:o.moreTools,"data-testid":`${e}-more`,onMouseDown:e=>{e.preventDefault()},children:(0,L.jsx)(qe,{})})}),(0,L.jsx)(Vn,{align:`end`,collisionPadding:8,role:`toolbar`,"aria-label":o.moreTools,"data-testid":`${e}-panel`,"data-compact":d.compact?``:void 0,onOpenAutoFocus:e=>{e.preventDefault()},onCloseAutoFocus:e=>{e.preventDefault()},onInteractOutside:e=>{let t=e.target;t instanceof Element&&t.closest(`[data-radix-popper-content-wrapper]`)&&e.preventDefault()},className:`group/bar w-auto max-w-[calc(100vw-1rem)] overflow-hidden p-1`,children:(0,L.jsx)(`div`,{ref:l,className:`-ml-2 flex flex-wrap items-center`})})]}):null]})})}export{Fn as C,F as D,ct as E,Rn as S,lt as T,Cr as _,Fr as a,Vn as b,$ as c,Or as d,kr as f,Tr as g,Er as h,Gr as i,Sr as l,wr as m,Qr as n,Lr as o,Ar as p,$r as r,Ir as s,qr as t,Dr as u,zn as v,Mn as w,Bn as x,Hn as y};
|