file-viewer3 1.0.26 → 2.0.0
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/README.en.md +7 -377
- package/README.md +8 -352
- package/dist/file-viewer3.css +1 -2
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/package.json +27 -129
- package/dist/components/3MFLoader.js +0 -527
- package/dist/components/AMFLoader.js +0 -188
- package/dist/components/ArchiveViewer.js +0 -526
- package/dist/components/AudioViewer.js +0 -66
- package/dist/components/CadViewer.js +0 -9040
- package/dist/components/CodeViewer.js +0 -151
- package/dist/components/ColladaLoader.js +0 -2282
- package/dist/components/DrawingViewer.js +0 -295
- package/dist/components/EdaViewer.js +0 -630
- package/dist/components/EmailViewer.js +0 -276
- package/dist/components/EpubViewer.js +0 -172
- package/dist/components/FBXLoader.js +0 -1574
- package/dist/components/GLTFLoader.js +0 -1383
- package/dist/components/ImageViewer.js +0 -1519
- package/dist/components/KMZLoader.js +0 -45
- package/dist/components/MarkdownViewer.js +0 -1476
- package/dist/components/ModelViewer.js +0 -797
- package/dist/components/OBJLoader.js +0 -287
- package/dist/components/OfdViewer.js +0 -133
- package/dist/components/PCDLoader.js +0 -141
- package/dist/components/PLYLoader.js +0 -305
- package/dist/components/PdfView.js +0 -27667
- package/dist/components/PptxRender.js +0 -11217
- package/dist/components/STLLoader.js +0 -83
- package/dist/components/TDSLoader.js +0 -228
- package/dist/components/TypstViewer.js +0 -1697
- package/dist/components/USDLoader.js +0 -2526
- package/dist/components/UmdViewer.js +0 -1873
- package/dist/components/VRMLLoader.js +0 -6422
- package/dist/components/VTKLoader.js +0 -337
- package/dist/components/XYZLoader.js +0 -30
- package/dist/components/XlsxTable.js +0 -7879
- package/dist/components/__vite-browser-external.js +0 -7
- package/dist/components/_plugin-vue_export-helper.js +0 -8
- package/dist/components/ar-SA-G6X2FPQ2.js +0 -523
- package/dist/components/arc.js +0 -79
- package/dist/components/architecture-7EHR7CIX.js +0 -3
- package/dist/components/architectureDiagram-3BPJPVTR.js +0 -4096
- package/dist/components/archive.js +0 -24
- package/dist/components/asyncToGenerator.js +0 -29
- package/dist/components/audio.js +0 -19
- package/dist/components/az-AZ-76LH7QW2.js +0 -523
- package/dist/components/bash.js +0 -169
- package/dist/components/bg-BG-XCXSNQG7.js +0 -523
- package/dist/components/blockDiagram-GPEHLZMM.js +0 -3357
- package/dist/components/bn-BD-2XOGV67Q.js +0 -523
- package/dist/components/c4Diagram-AAUBKEIU.js +0 -2957
- package/dist/components/ca-ES-6MX7JW3Y.js +0 -523
- package/dist/components/cad.js +0 -23
- package/dist/components/cfb.js +0 -1174
- package/dist/components/channel.js +0 -5
- package/dist/components/chunk-2J33WTMH.js +0 -26
- package/dist/components/chunk-3OPIFGDE.js +0 -4167
- package/dist/components/chunk-4BX2VUAB.js +0 -19
- package/dist/components/chunk-55IACEB6.js +0 -9
- package/dist/components/chunk-5ZQYHXKU.js +0 -669
- package/dist/components/chunk-6U3AYISY.js +0 -624
- package/dist/components/chunk-727SXJPM.js +0 -3356
- package/dist/components/chunk-AGHRB4JF.js +0 -324
- package/dist/components/chunk-AQP2D5EJ.js +0 -2055
- package/dist/components/chunk-BSJP7CBP.js +0 -83
- package/dist/components/chunk-CSCIHK7Q.js +0 -3500
- package/dist/components/chunk-EIO257PC.js +0 -1836
- package/dist/components/chunk-FMBD7UC4.js +0 -5
- package/dist/components/chunk-K2UTITRG.js +0 -17627
- package/dist/components/chunk-KSCS5N6A.js +0 -572
- package/dist/components/chunk-L5ZTLDWV.js +0 -40
- package/dist/components/chunk-LZXEDZCA.js +0 -60
- package/dist/components/chunk-ND2GUHAM.js +0 -61
- package/dist/components/chunk-NNHCCRGN.js +0 -20425
- package/dist/components/chunk-NZK2D7GU.js +0 -68
- package/dist/components/chunk-O5CBEL6O.js +0 -1894
- package/dist/components/chunk-QZHKN3VN.js +0 -12
- package/dist/components/chunk-SRAX5OIU.js +0 -22
- package/dist/components/chunk-WU5MYG2G.js +0 -14
- package/dist/components/chunk-XPW4576I.js +0 -1146
- package/dist/components/chunk-Z3N5DIM6.js +0 -59
- package/dist/components/chunk-ZUYEQ4TG.js +0 -22
- package/dist/components/chunk.js +0 -23
- package/dist/components/classDiagram-4FO5ZUOK.js +0 -29
- package/dist/components/classDiagram-v2-Q7XG4LA2.js +0 -29
- package/dist/components/compiler.js +0 -2
- package/dist/components/core.js +0 -845
- package/dist/components/cose-bilkent-S5V4N54A.js +0 -2268
- package/dist/components/cpp.js +0 -225
- package/dist/components/cs-CZ-2BRQDIVT.js +0 -523
- package/dist/components/csharp.js +0 -260
- package/dist/components/css.js +0 -140
- package/dist/components/cytoscape.esm.js +0 -18114
- package/dist/components/da-DK-5WZEPLOC.js +0 -523
- package/dist/components/dagre-BM42HDAG.js +0 -325
- package/dist/components/dagre.js +0 -1936
- package/dist/components/de-DE-XR44H4JA.js +0 -523
- package/dist/components/defaultLocale.js +0 -201
- package/dist/components/defineProperty.js +0 -50
- package/dist/components/diagram-2AECGRRQ.js +0 -229
- package/dist/components/diagram-5GNKFQAL.js +0 -108
- package/dist/components/diagram-KO2AKTUF.js +0 -443
- package/dist/components/diagram-LMA3HP47.js +0 -139
- package/dist/components/diagram-OG6HWLK6.js +0 -541
- package/dist/components/diff.js +0 -39
- package/dist/components/directory-open-01563666.js +0 -26
- package/dist/components/directory-open-4ed118d0.js +0 -83
- package/dist/components/dist.js +0 -50
- package/dist/components/dist2.js +0 -3291
- package/dist/components/dist3.js +0 -1593
- package/dist/components/documentSearch.js +0 -378
- package/dist/components/docx-preview.js +0 -3113
- package/dist/components/drawing.js +0 -19
- package/dist/components/ebook.js +0 -16
- package/dist/components/eda.js +0 -20
- package/dist/components/el-GR-BZB4AONW.js +0 -523
- package/dist/components/email.js +0 -21
- package/dist/components/en-B4ZKOASM.js +0 -3
- package/dist/components/erDiagram-TEJ5UH35.js +0 -1719
- package/dist/components/es-ES-U4NZUMDT.js +0 -523
- package/dist/components/eu-ES-A7QVB2H4.js +0 -523
- package/dist/components/eventmodeling-FCH6USID.js +0 -3
- package/dist/components/fa-IR-HGAKTJCU.js +0 -523
- package/dist/components/fflate.module.js +0 -323
- package/dist/components/fi-FI-Z5N7JZ37.js +0 -523
- package/dist/components/file-open-002ab408.js +0 -38
- package/dist/components/file-open-7c801643.js +0 -24
- package/dist/components/file-save-3189631c.js +0 -40
- package/dist/components/file-save-745eba88.js +0 -36
- package/dist/components/flowDiagram-I6XJVG4X.js +0 -4181
- package/dist/components/fr-FR-RHASNOE6.js +0 -523
- package/dist/components/ganttDiagram-6RSMTGT7.js +0 -2182
- package/dist/components/gitGraph-WXDBUCRP.js +0 -3
- package/dist/components/gitGraphDiagram-PVQCEYII.js +0 -788
- package/dist/components/gl-ES-HMX3MZ6V.js +0 -523
- package/dist/components/global-compiler.js +0 -23
- package/dist/components/global-renderer.js +0 -23
- package/dist/components/go.js +0 -140
- package/dist/components/graphlib.js +0 -1267
- package/dist/components/he-IL-6SHJWFNN.js +0 -523
- package/dist/components/hi-IN-IWLTKZ5I.js +0 -523
- package/dist/components/hu-HU-A5ZG7DT2.js +0 -523
- package/dist/components/id-ID-SAP4L64H.js +0 -523
- package/dist/components/image-GAAHSSAO.js +0 -3
- package/dist/components/image-blob-reduce.esm.js +0 -1429
- package/dist/components/image.js +0 -17
- package/dist/components/info-J43DQDTF.js +0 -3
- package/dist/components/infoDiagram-5YYISTIA.js +0 -26
- package/dist/components/ini.js +0 -88
- package/dist/components/init.js +0 -15
- package/dist/components/ishikawaDiagram-YF4QCWOH.js +0 -718
- package/dist/components/it-IT-JPQ66NNP.js +0 -523
- package/dist/components/ja-JP-DBVTYXUO.js +0 -523
- package/dist/components/java.js +0 -169
- package/dist/components/javascript.js +0 -436
- package/dist/components/journeyDiagram-JHISSGLW.js +0 -885
- package/dist/components/json.js +0 -36
- package/dist/components/jszip.min.js +0 -3033
- package/dist/components/kaa-6HZHGXH3.js +0 -523
- package/dist/components/kab-KAB-ZGHBKWFO.js +0 -523
- package/dist/components/kanban-definition-UN3LZRKU.js +0 -986
- package/dist/components/katex.js +0 -21979
- package/dist/components/kk-KZ-P5N5QNE5.js +0 -523
- package/dist/components/km-KH-HSX4SM5Z.js +0 -523
- package/dist/components/ko-KR-MTYHY66A.js +0 -523
- package/dist/components/ku-TR-6OUDTVRD.js +0 -523
- package/dist/components/lib.js +0 -4877
- package/dist/components/libarchive.js +0 -360
- package/dist/components/linear.js +0 -289
- package/dist/components/lt-LT-XHIRWOB4.js +0 -523
- package/dist/components/lv-LV-5QDEKY6T.js +0 -523
- package/dist/components/markdown.js +0 -181
- package/dist/components/md.js +0 -17
- package/dist/components/mermaid-parser.core.js +0 -328
- package/dist/components/mindmap-definition-RKZ34NQL.js +0 -1016
- package/dist/components/model.js +0 -21
- package/dist/components/mp4.js +0 -12
- package/dist/components/mr-IN-CRQNXWMA.js +0 -523
- package/dist/components/my-MM-5M5IBNSE.js +0 -523
- package/dist/components/nb-NO-T6EIAALU.js +0 -523
- package/dist/components/nestedRender.js +0 -158
- package/dist/components/nl-NL-IS3SIHDZ.js +0 -523
- package/dist/components/nn-NO-6E72VCQL.js +0 -523
- package/dist/components/objectSpread2.js +0 -29
- package/dist/components/objectWithoutProperties.js +0 -28
- package/dist/components/oc-FR-POXYY2M6.js +0 -523
- package/dist/components/ofd.js +0 -5261
- package/dist/components/ofd2.js +0 -16
- package/dist/components/ordinal.js +0 -65
- package/dist/components/pa-IN-N4M65BXN.js +0 -523
- package/dist/components/packet-YPE3B663.js +0 -3
- package/dist/components/pdf.js +0 -24
- package/dist/components/percentages-BXMCSKIN.js +0 -3
- package/dist/components/php.js +0 -294
- package/dist/components/pica.js +0 -1009
- package/dist/components/pie-LRSECV5Y.js +0 -3
- package/dist/components/pie.js +0 -47
- package/dist/components/pieDiagram-4H26LBE5.js +0 -130
- package/dist/components/pl-PL-T2D74RX3.js +0 -523
- package/dist/components/postal-mime.js +0 -3146
- package/dist/components/pptx.js +0 -15
- package/dist/components/printLayout.js +0 -42
- package/dist/components/prod.js +0 -21770
- package/dist/components/pt-BR-5N22H2LF.js +0 -523
- package/dist/components/pt-PT-UZXXM6DQ.js +0 -523
- package/dist/components/python.js +0 -238
- package/dist/components/quadrantDiagram-W4KKPZXB.js +0 -1988
- package/dist/components/radar-GUYGQ44K.js +0 -3
- package/dist/components/renderer.js +0 -2
- package/dist/components/requirementDiagram-4Y6WPE33.js +0 -2230
- package/dist/components/ro-RO-JPDTUUEW.js +0 -523
- package/dist/components/rough.esm.js +0 -1355
- package/dist/components/roundRect.js +0 -90
- package/dist/components/ru-RU-B4JR7IUQ.js +0 -523
- package/dist/components/rust.js +0 -169
- package/dist/components/sankeyDiagram-5OEKKPKP.js +0 -972
- package/dist/components/sequenceDiagram-3UESZ5HK.js +0 -4255
- package/dist/components/shared.js +0 -175
- package/dist/components/shared2.js +0 -4
- package/dist/components/si-LK-N5RQ5JYF.js +0 -523
- package/dist/components/sk-SK-C5VTKIMK.js +0 -523
- package/dist/components/sl-SI-NN7IZMDC.js +0 -523
- package/dist/components/sourceLoading.js +0 -134
- package/dist/components/sql.js +0 -118
- package/dist/components/src.js +0 -2664
- package/dist/components/src2.js +0 -10722
- package/dist/components/stateDiagram-AJRCARHV.js +0 -217
- package/dist/components/stateDiagram-v2-BHNVJYJU.js +0 -27
- package/dist/components/subset-shared.chunk.js +0 -3
- package/dist/components/subset-worker.chunk.js +0 -21
- package/dist/components/sv-SE-XGPEYMSR.js +0 -523
- package/dist/components/ta-IN-2NMHFXQM.js +0 -523
- package/dist/components/text.js +0 -20
- package/dist/components/th-TH-HPSO5L25.js +0 -523
- package/dist/components/three.module.js +0 -13134
- package/dist/components/time.js +0 -910
- package/dist/components/timeline-definition-PNZ67QCA.js +0 -1084
- package/dist/components/tr-TR-DEFEU3FU.js +0 -523
- package/dist/components/treeView-BLDUP644.js +0 -3
- package/dist/components/treemap-LRROVOQU.js +0 -3
- package/dist/components/typescript.js +0 -521
- package/dist/components/typst.js +0 -25
- package/dist/components/uk-UA-QMV73CPH.js +0 -523
- package/dist/components/umd.js +0 -16
- package/dist/components/use.js +0 -422
- package/dist/components/util.js +0 -49
- package/dist/components/vennDiagram-CIIHVFJN.js +0 -1880
- package/dist/components/vi-VN-M7AON7JQ.js +0 -523
- package/dist/components/viewerZoom.js +0 -92
- package/dist/components/wardley-L42UT6IY.js +0 -3
- package/dist/components/wardleyDiagram-YWT4CUSO.js +0 -656
- package/dist/components/wasm-pack-shim.js +0 -1711
- package/dist/components/wasm-pack-shim2.js +0 -934
- package/dist/components/wasm.js +0 -97
- package/dist/components/word.js +0 -3055
- package/dist/components/worker-ref.js +0 -16
- package/dist/components/xlsx.js +0 -21
- package/dist/components/xml.js +0 -166
- package/dist/components/xychartDiagram-2RQKCTM6.js +0 -2015
- package/dist/components/yaml.js +0 -144
- package/dist/components/zh-CN-LNUGB5OW.js +0 -523
- package/dist/components/zh-HK-E62DVLB3.js +0 -523
- package/dist/components/zh-TW-RAJ6MFWO.js +0 -523
- package/dist/index.mjs +0 -3293
- package/dist/src/App.vue.d.ts +0 -3
- package/dist/src/compare/CompareApp.vue.d.ts +0 -3
- package/dist/src/compare/main.d.ts +0 -0
- package/dist/src/compare/useSynchronizedScroll.d.ts +0 -7
- package/dist/src/components/HelloWorld.vue.d.ts +0 -3
- package/dist/src/components/utils.d.ts +0 -4
- package/dist/src/main.d.ts +0 -0
- package/dist/src/package/common/printCapability.d.ts +0 -27
- package/dist/src/package/common/printLayout.d.ts +0 -16
- package/dist/src/package/common/sourceLoading.d.ts +0 -10
- package/dist/src/package/common/type.d.ts +0 -544
- package/dist/src/package/common/util.d.ts +0 -5
- package/dist/src/package/common/worker-ref.d.ts +0 -12
- package/dist/src/package/components/FileViewer/FileViewer.vue.d.ts +0 -75
- package/dist/src/package/components/FileViewer/exportDocumentTemplate.d.ts +0 -9
- package/dist/src/package/components/FileViewer/hooks/useViewerDocumentFeatures.d.ts +0 -29
- package/dist/src/package/components/FileViewer/hooks/useViewerExport.d.ts +0 -21
- package/dist/src/package/components/FileViewer/hooks/useViewerWatermark.d.ts +0 -8
- package/dist/src/package/components/FileViewer/hooks/useViewerZoom.d.ts +0 -34
- package/dist/src/package/components/FileViewer/index.d.ts +0 -2
- package/dist/src/package/components/FileViewer/util.d.ts +0 -3
- package/dist/src/package/index.d.ts +0 -22
- package/dist/src/package/use/documentLocation.d.ts +0 -15
- package/dist/src/package/use/documentSearch.d.ts +0 -234
- package/dist/src/package/use/index.d.ts +0 -5
- package/dist/src/package/use/loading.d.ts +0 -33
- package/dist/src/package/use/viewerZoom.d.ts +0 -42
- package/dist/src/package/use/worker.d.ts +0 -24
- package/dist/src/package/vendors/archive/ArchiveViewer.vue.d.ts +0 -9
- package/dist/src/package/vendors/archive/cache.d.ts +0 -10
- package/dist/src/package/vendors/archive/fallback.d.ts +0 -9
- package/dist/src/package/vendors/archive/index.d.ts +0 -3
- package/dist/src/package/vendors/archive/shared.d.ts +0 -24
- package/dist/src/package/vendors/audio/AudioViewer.vue.d.ts +0 -7
- package/dist/src/package/vendors/audio/index.d.ts +0 -7
- package/dist/src/package/vendors/cad/CadViewer.vue.d.ts +0 -9
- package/dist/src/package/vendors/cad/index.d.ts +0 -8
- package/dist/src/package/vendors/drawing/DrawingViewer.vue.d.ts +0 -15
- package/dist/src/package/vendors/drawing/index.d.ts +0 -7
- package/dist/src/package/vendors/ebook/EpubViewer.vue.d.ts +0 -6
- package/dist/src/package/vendors/ebook/index.d.ts +0 -7
- package/dist/src/package/vendors/eda/EdaViewer.vue.d.ts +0 -8
- package/dist/src/package/vendors/eda/index.d.ts +0 -2
- package/dist/src/package/vendors/eda/parser.d.ts +0 -77
- package/dist/src/package/vendors/email/EmailViewer.vue.d.ts +0 -10
- package/dist/src/package/vendors/email/index.d.ts +0 -2
- package/dist/src/package/vendors/image/ImageViewer.vue.d.ts +0 -6
- package/dist/src/package/vendors/image/index.d.ts +0 -4
- package/dist/src/package/vendors/md/MarkdownViewer.vue.d.ts +0 -6
- package/dist/src/package/vendors/md/index.d.ts +0 -4
- package/dist/src/package/vendors/model/ModelViewer.vue.d.ts +0 -8
- package/dist/src/package/vendors/model/index.d.ts +0 -3
- package/dist/src/package/vendors/model/shared.d.ts +0 -1
- package/dist/src/package/vendors/mp4/index.d.ts +0 -4
- package/dist/src/package/vendors/nestedRender.d.ts +0 -10
- package/dist/src/package/vendors/ofd/OfdViewer.vue.d.ts +0 -6
- package/dist/src/package/vendors/ofd/index.d.ts +0 -7
- package/dist/src/package/vendors/pdf/PdfView.vue.d.ts +0 -10
- package/dist/src/package/vendors/pdf/index.d.ts +0 -2
- package/dist/src/package/vendors/pdf/worker/index.d.ts +0 -4
- package/dist/src/package/vendors/pdf/worker/pdf.worker.d.ts +0 -0
- package/dist/src/package/vendors/pptx/PptxRender.vue.d.ts +0 -9
- package/dist/src/package/vendors/pptx/index.d.ts +0 -6
- package/dist/src/package/vendors/pptx/options.d.ts +0 -39
- package/dist/src/package/vendors/pptx/support/chart.d.ts +0 -4
- package/dist/src/package/vendors/pptx/worker/index.d.ts +0 -4
- package/dist/src/package/vendors/renders.d.ts +0 -3
- package/dist/src/package/vendors/text/CodeViewer.vue.d.ts +0 -7
- package/dist/src/package/vendors/text/index.d.ts +0 -10
- package/dist/src/package/vendors/typst/TypstViewer.vue.d.ts +0 -15
- package/dist/src/package/vendors/typst/index.d.ts +0 -8
- package/dist/src/package/vendors/umd/UmdViewer.vue.d.ts +0 -6
- package/dist/src/package/vendors/umd/index.d.ts +0 -7
- package/dist/src/package/vendors/umd/parser.d.ts +0 -30
- package/dist/src/package/vendors/word/doc.d.ts +0 -5
- package/dist/src/package/vendors/word/docx.d.ts +0 -5
- package/dist/src/package/vendors/word/docx.worker.d.ts +0 -1
- package/dist/src/package/vendors/word/index.d.ts +0 -3
- package/dist/src/package/vendors/xlsx/XlsxTable.state.d.ts +0 -80
- package/dist/src/package/vendors/xlsx/XlsxTable.view.d.ts +0 -25
- package/dist/src/package/vendors/xlsx/XlsxTable.vue.d.ts +0 -6
- package/dist/src/package/vendors/xlsx/index.d.ts +0 -6
- package/dist/src/package/vendors/xlsx/util.d.ts +0 -3
- package/dist/src/package/vendors/xlsx/worker/index.d.ts +0 -4
- package/dist/src/package/vendors/xlsx/worker/sheetjs/SheetJsModel.d.ts +0 -73
- package/dist/src/package/vendors/xlsx/worker/sheetjs/color.d.ts +0 -2
- package/dist/src/package/vendors/xlsx/worker/sheetjs/index.d.ts +0 -4
- package/dist/src/package/vendors/xlsx/worker/sheetjs/sheet.worker.d.ts +0 -1
- package/dist/style.css +0 -1
- package/dist/wasm/cad/dwfv-render.wasm +0 -0
- package/dist/wasm/cad/dwg-worker.js +0 -24
- package/dist/wasm/cad/libredwg-web.js +0 -15
- package/dist/wasm/cad/libredwg-web.wasm +0 -0
|
@@ -1,1894 +0,0 @@
|
|
|
1
|
-
import { n as e, t } from "./defineProperty.js";
|
|
2
|
-
import { n, t as r } from "./objectSpread2.js";
|
|
3
|
-
import { n as i, t as a } from "./asyncToGenerator.js";
|
|
4
|
-
import { n as o, r as s } from "./chunk-AGHRB4JF.js";
|
|
5
|
-
import { A as c, F as l, b as u, s as d, z as f } from "./chunk-CSCIHK7Q.js";
|
|
6
|
-
import { Q as p } from "./src.js";
|
|
7
|
-
import { a as m } from "./chunk-5ZQYHXKU.js";
|
|
8
|
-
//#region node_modules/.pnpm/@iconify+utils@3.1.3/node_modules/@iconify/utils/lib/icon/defaults.js
|
|
9
|
-
n();
|
|
10
|
-
var h = Object.freeze({
|
|
11
|
-
left: 0,
|
|
12
|
-
top: 0,
|
|
13
|
-
width: 16,
|
|
14
|
-
height: 16
|
|
15
|
-
}), g = Object.freeze({
|
|
16
|
-
rotate: 0,
|
|
17
|
-
vFlip: !1,
|
|
18
|
-
hFlip: !1
|
|
19
|
-
}), ee = Object.freeze(r(r({}, h), g)), te = Object.freeze(r(r({}, ee), {}, {
|
|
20
|
-
body: "",
|
|
21
|
-
hidden: !1
|
|
22
|
-
}));
|
|
23
|
-
e(), n();
|
|
24
|
-
var ne = Object.freeze({
|
|
25
|
-
width: null,
|
|
26
|
-
height: null
|
|
27
|
-
}), re = Object.freeze(r(r({}, ne), g)), ie = (e, t, n, r = "") => {
|
|
28
|
-
let i = e.split(":");
|
|
29
|
-
if (e.slice(0, 1) === "@") {
|
|
30
|
-
if (i.length < 2 || i.length > 3) return null;
|
|
31
|
-
r = i.shift().slice(1);
|
|
32
|
-
}
|
|
33
|
-
if (i.length > 3 || !i.length) return null;
|
|
34
|
-
if (i.length > 1) {
|
|
35
|
-
let e = i.pop(), n = i.pop(), a = {
|
|
36
|
-
provider: i.length > 0 ? i[0] : r,
|
|
37
|
-
prefix: n,
|
|
38
|
-
name: e
|
|
39
|
-
};
|
|
40
|
-
return t && !ae(a) ? null : a;
|
|
41
|
-
}
|
|
42
|
-
let a = i[0], o = a.split("-");
|
|
43
|
-
if (o.length > 1) {
|
|
44
|
-
let e = {
|
|
45
|
-
provider: r,
|
|
46
|
-
prefix: o.shift(),
|
|
47
|
-
name: o.join("-")
|
|
48
|
-
};
|
|
49
|
-
return t && !ae(e) ? null : e;
|
|
50
|
-
}
|
|
51
|
-
if (n && r === "") {
|
|
52
|
-
let e = {
|
|
53
|
-
provider: r,
|
|
54
|
-
prefix: "",
|
|
55
|
-
name: a
|
|
56
|
-
};
|
|
57
|
-
return t && !ae(e, n) ? null : e;
|
|
58
|
-
}
|
|
59
|
-
return null;
|
|
60
|
-
}, ae = (e, t) => e ? !!((t && e.prefix === "" || e.prefix) && e.name) : !1;
|
|
61
|
-
//#endregion
|
|
62
|
-
//#region node_modules/.pnpm/@iconify+utils@3.1.3/node_modules/@iconify/utils/lib/icon/transformations.js
|
|
63
|
-
function oe(e, t) {
|
|
64
|
-
let n = {};
|
|
65
|
-
!e.hFlip != !t.hFlip && (n.hFlip = !0), !e.vFlip != !t.vFlip && (n.vFlip = !0);
|
|
66
|
-
let r = ((e.rotate || 0) + (t.rotate || 0)) % 4;
|
|
67
|
-
return r && (n.rotate = r), n;
|
|
68
|
-
}
|
|
69
|
-
//#endregion
|
|
70
|
-
//#region node_modules/.pnpm/@iconify+utils@3.1.3/node_modules/@iconify/utils/lib/icon/merge.js
|
|
71
|
-
function se(e, t) {
|
|
72
|
-
let n = oe(e, t);
|
|
73
|
-
for (let r in te) r in g ? r in e && !(r in n) && (n[r] = g[r]) : r in t ? n[r] = t[r] : r in e && (n[r] = e[r]);
|
|
74
|
-
return n;
|
|
75
|
-
}
|
|
76
|
-
//#endregion
|
|
77
|
-
//#region node_modules/.pnpm/@iconify+utils@3.1.3/node_modules/@iconify/utils/lib/icon-set/tree.js
|
|
78
|
-
function ce(e, t) {
|
|
79
|
-
let n = e.icons, r = e.aliases || Object.create(null), i = Object.create(null);
|
|
80
|
-
function a(e) {
|
|
81
|
-
if (n[e]) return i[e] = [];
|
|
82
|
-
if (!(e in i)) {
|
|
83
|
-
i[e] = null;
|
|
84
|
-
let t = r[e] && r[e].parent, n = t && a(t);
|
|
85
|
-
n && (i[e] = [t].concat(n));
|
|
86
|
-
}
|
|
87
|
-
return i[e];
|
|
88
|
-
}
|
|
89
|
-
return (t || Object.keys(n).concat(Object.keys(r))).forEach(a), i;
|
|
90
|
-
}
|
|
91
|
-
//#endregion
|
|
92
|
-
//#region node_modules/.pnpm/@iconify+utils@3.1.3/node_modules/@iconify/utils/lib/icon-set/get-icon.js
|
|
93
|
-
function le(e, t, n) {
|
|
94
|
-
let r = e.icons, i = e.aliases || Object.create(null), a = {};
|
|
95
|
-
function o(e) {
|
|
96
|
-
a = se(r[e] || i[e], a);
|
|
97
|
-
}
|
|
98
|
-
return o(t), n.forEach(o), se(e, a);
|
|
99
|
-
}
|
|
100
|
-
function ue(e, t) {
|
|
101
|
-
if (e.icons[t]) return le(e, t, []);
|
|
102
|
-
let n = ce(e, [t])[t];
|
|
103
|
-
return n ? le(e, t, n) : null;
|
|
104
|
-
}
|
|
105
|
-
//#endregion
|
|
106
|
-
//#region node_modules/.pnpm/@iconify+utils@3.1.3/node_modules/@iconify/utils/lib/svg/size.js
|
|
107
|
-
var de = /(-?[0-9.]*[0-9]+[0-9.]*)/g, fe = /^-?[0-9.]*[0-9]+[0-9.]*$/g;
|
|
108
|
-
function pe(e, t, n) {
|
|
109
|
-
if (t === 1) return e;
|
|
110
|
-
if (n = n || 100, typeof e == "number") return Math.ceil(e * t * n) / n;
|
|
111
|
-
if (typeof e != "string") return e;
|
|
112
|
-
let r = e.split(de);
|
|
113
|
-
if (r === null || !r.length) return e;
|
|
114
|
-
let i = [], a = r.shift(), o = fe.test(a);
|
|
115
|
-
for (;;) {
|
|
116
|
-
if (o) {
|
|
117
|
-
let e = parseFloat(a);
|
|
118
|
-
isNaN(e) ? i.push(a) : i.push(Math.ceil(e * t * n) / n);
|
|
119
|
-
} else i.push(a);
|
|
120
|
-
if (a = r.shift(), a === void 0) return i.join("");
|
|
121
|
-
o = !o;
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
//#endregion
|
|
125
|
-
//#region node_modules/.pnpm/@iconify+utils@3.1.3/node_modules/@iconify/utils/lib/svg/defs.js
|
|
126
|
-
function me(e, t = "defs") {
|
|
127
|
-
let n = "", r = e.indexOf("<" + t);
|
|
128
|
-
for (; r >= 0;) {
|
|
129
|
-
let i = e.indexOf(">", r), a = e.indexOf("</" + t);
|
|
130
|
-
if (i === -1 || a === -1) break;
|
|
131
|
-
let o = e.indexOf(">", a);
|
|
132
|
-
if (o === -1) break;
|
|
133
|
-
n += e.slice(i + 1, a).trim(), e = e.slice(0, r).trim() + e.slice(o + 1);
|
|
134
|
-
}
|
|
135
|
-
return {
|
|
136
|
-
defs: n,
|
|
137
|
-
content: e
|
|
138
|
-
};
|
|
139
|
-
}
|
|
140
|
-
function he(e, t) {
|
|
141
|
-
return e ? "<defs>" + e + "</defs>" + t : t;
|
|
142
|
-
}
|
|
143
|
-
function ge(e, t, n) {
|
|
144
|
-
let r = me(e);
|
|
145
|
-
return he(r.defs, t + r.content + n);
|
|
146
|
-
}
|
|
147
|
-
//#endregion
|
|
148
|
-
//#region node_modules/.pnpm/@iconify+utils@3.1.3/node_modules/@iconify/utils/lib/svg/build.js
|
|
149
|
-
n();
|
|
150
|
-
var _e = (e) => e === "unset" || e === "undefined" || e === "none";
|
|
151
|
-
function ve(e, t) {
|
|
152
|
-
let n = r(r({}, ee), e), i = r(r({}, re), t), a = {
|
|
153
|
-
left: n.left,
|
|
154
|
-
top: n.top,
|
|
155
|
-
width: n.width,
|
|
156
|
-
height: n.height
|
|
157
|
-
}, o = n.body;
|
|
158
|
-
[n, i].forEach((e) => {
|
|
159
|
-
let t = [], n = e.hFlip, r = e.vFlip, i = e.rotate;
|
|
160
|
-
n ? r ? i += 2 : (t.push("translate(" + (a.width + a.left).toString() + " " + (0 - a.top).toString() + ")"), t.push("scale(-1 1)"), a.top = a.left = 0) : r && (t.push("translate(" + (0 - a.left).toString() + " " + (a.height + a.top).toString() + ")"), t.push("scale(1 -1)"), a.top = a.left = 0);
|
|
161
|
-
let s;
|
|
162
|
-
switch (i < 0 && (i -= Math.floor(i / 4) * 4), i %= 4, i) {
|
|
163
|
-
case 1:
|
|
164
|
-
s = a.height / 2 + a.top, t.unshift("rotate(90 " + s.toString() + " " + s.toString() + ")");
|
|
165
|
-
break;
|
|
166
|
-
case 2:
|
|
167
|
-
t.unshift("rotate(180 " + (a.width / 2 + a.left).toString() + " " + (a.height / 2 + a.top).toString() + ")");
|
|
168
|
-
break;
|
|
169
|
-
case 3:
|
|
170
|
-
s = a.width / 2 + a.left, t.unshift("rotate(-90 " + s.toString() + " " + s.toString() + ")");
|
|
171
|
-
break;
|
|
172
|
-
}
|
|
173
|
-
i % 2 == 1 && (a.left !== a.top && (s = a.left, a.left = a.top, a.top = s), a.width !== a.height && (s = a.width, a.width = a.height, a.height = s)), t.length && (o = ge(o, "<g transform=\"" + t.join(" ") + "\">", "</g>"));
|
|
174
|
-
});
|
|
175
|
-
let s = i.width, c = i.height, l = a.width, u = a.height, d, f;
|
|
176
|
-
s === null ? (f = c === null ? "1em" : c === "auto" ? u : c, d = pe(f, l / u)) : (d = s === "auto" ? l : s, f = c === null ? pe(d, u / l) : c === "auto" ? u : c);
|
|
177
|
-
let p = {}, m = (e, t) => {
|
|
178
|
-
_e(t) || (p[e] = t.toString());
|
|
179
|
-
};
|
|
180
|
-
m("width", d), m("height", f);
|
|
181
|
-
let h = [
|
|
182
|
-
a.left,
|
|
183
|
-
a.top,
|
|
184
|
-
l,
|
|
185
|
-
u
|
|
186
|
-
];
|
|
187
|
-
return p.viewBox = h.join(" "), {
|
|
188
|
-
attributes: p,
|
|
189
|
-
viewBox: h,
|
|
190
|
-
body: o
|
|
191
|
-
};
|
|
192
|
-
}
|
|
193
|
-
//#endregion
|
|
194
|
-
//#region node_modules/.pnpm/@iconify+utils@3.1.3/node_modules/@iconify/utils/lib/svg/id.js
|
|
195
|
-
var ye = /\sid="(\S+)"/g, be = /* @__PURE__ */ new Map();
|
|
196
|
-
function xe(e) {
|
|
197
|
-
e = e.replace(/[0-9]+$/, "") || "a";
|
|
198
|
-
let t = be.get(e) || 0;
|
|
199
|
-
return be.set(e, t + 1), t ? `${e}${t}` : e;
|
|
200
|
-
}
|
|
201
|
-
function Se(e) {
|
|
202
|
-
let t = [], n;
|
|
203
|
-
for (; n = ye.exec(e);) t.push(n[1]);
|
|
204
|
-
if (!t.length) return e;
|
|
205
|
-
let r = "suffix" + (Math.random() * 16777216 | Date.now()).toString(16);
|
|
206
|
-
return t.forEach((t) => {
|
|
207
|
-
let n = xe(t), i = t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
208
|
-
e = e.replace(RegExp("([#;\"])(" + i + ")([\")]|\\.[a-z])", "g"), "$1" + n + r + "$3");
|
|
209
|
-
}), e = e.replace(new RegExp(r, "g"), ""), e;
|
|
210
|
-
}
|
|
211
|
-
//#endregion
|
|
212
|
-
//#region node_modules/.pnpm/@iconify+utils@3.1.3/node_modules/@iconify/utils/lib/svg/html.js
|
|
213
|
-
function Ce(e, t) {
|
|
214
|
-
let n = e.indexOf("xlink:") === -1 ? "" : " xmlns:xlink=\"http://www.w3.org/1999/xlink\"";
|
|
215
|
-
for (let e in t) n += " " + e + "=\"" + t[e] + "\"";
|
|
216
|
-
return "<svg xmlns=\"http://www.w3.org/2000/svg\"" + n + ">" + e + "</svg>";
|
|
217
|
-
}
|
|
218
|
-
i(), n();
|
|
219
|
-
var _;
|
|
220
|
-
function v() {
|
|
221
|
-
return {
|
|
222
|
-
async: !1,
|
|
223
|
-
breaks: !1,
|
|
224
|
-
extensions: null,
|
|
225
|
-
gfm: !0,
|
|
226
|
-
hooks: null,
|
|
227
|
-
pedantic: !1,
|
|
228
|
-
renderer: null,
|
|
229
|
-
silent: !1,
|
|
230
|
-
tokenizer: null,
|
|
231
|
-
walkTokens: null
|
|
232
|
-
};
|
|
233
|
-
}
|
|
234
|
-
var y = v();
|
|
235
|
-
function we(e) {
|
|
236
|
-
y = e;
|
|
237
|
-
}
|
|
238
|
-
var b = { exec: () => null };
|
|
239
|
-
function x(e, t = "") {
|
|
240
|
-
let n = typeof e == "string" ? e : e.source, r = {
|
|
241
|
-
replace: (e, t) => {
|
|
242
|
-
let i = typeof t == "string" ? t : t.source;
|
|
243
|
-
return i = i.replace(S.caret, "$1"), n = n.replace(e, i), r;
|
|
244
|
-
},
|
|
245
|
-
getRegex: () => new RegExp(n, t)
|
|
246
|
-
};
|
|
247
|
-
return r;
|
|
248
|
-
}
|
|
249
|
-
var S = {
|
|
250
|
-
codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm,
|
|
251
|
-
outputLinkReplace: /\\([\[\]])/g,
|
|
252
|
-
indentCodeCompensation: /^(\s+)(?:```)/,
|
|
253
|
-
beginningSpace: /^\s+/,
|
|
254
|
-
endingHash: /#$/,
|
|
255
|
-
startingSpaceChar: /^ /,
|
|
256
|
-
endingSpaceChar: / $/,
|
|
257
|
-
nonSpaceChar: /[^ ]/,
|
|
258
|
-
newLineCharGlobal: /\n/g,
|
|
259
|
-
tabCharGlobal: /\t/g,
|
|
260
|
-
multipleSpaceGlobal: /\s+/g,
|
|
261
|
-
blankLine: /^[ \t]*$/,
|
|
262
|
-
doubleBlankLine: /\n[ \t]*\n[ \t]*$/,
|
|
263
|
-
blockquoteStart: /^ {0,3}>/,
|
|
264
|
-
blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g,
|
|
265
|
-
blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm,
|
|
266
|
-
listReplaceTabs: /^\t+/,
|
|
267
|
-
listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g,
|
|
268
|
-
listIsTask: /^\[[ xX]\] /,
|
|
269
|
-
listReplaceTask: /^\[[ xX]\] +/,
|
|
270
|
-
anyLine: /\n.*\n/,
|
|
271
|
-
hrefBrackets: /^<(.*)>$/,
|
|
272
|
-
tableDelimiter: /[:|]/,
|
|
273
|
-
tableAlignChars: /^\||\| *$/g,
|
|
274
|
-
tableRowBlankLine: /\n[ \t]*$/,
|
|
275
|
-
tableAlignRight: /^ *-+: *$/,
|
|
276
|
-
tableAlignCenter: /^ *:-+: *$/,
|
|
277
|
-
tableAlignLeft: /^ *:-+ *$/,
|
|
278
|
-
startATag: /^<a /i,
|
|
279
|
-
endATag: /^<\/a>/i,
|
|
280
|
-
startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i,
|
|
281
|
-
endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i,
|
|
282
|
-
startAngleBracket: /^</,
|
|
283
|
-
endAngleBracket: />$/,
|
|
284
|
-
pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/,
|
|
285
|
-
unicodeAlphaNumeric: /* @__PURE__ */ RegExp("[\\p{L}\\p{N}]", "u"),
|
|
286
|
-
escapeTest: /[&<>"']/,
|
|
287
|
-
escapeReplace: /[&<>"']/g,
|
|
288
|
-
escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,
|
|
289
|
-
escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,
|
|
290
|
-
unescapeTest: /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,
|
|
291
|
-
caret: /(^|[^\[])\^/g,
|
|
292
|
-
percentDecode: /%25/g,
|
|
293
|
-
findPipe: /\|/g,
|
|
294
|
-
splitPipe: / \|/,
|
|
295
|
-
slashPipe: /\\\|/g,
|
|
296
|
-
carriageReturn: /\r\n|\r/g,
|
|
297
|
-
spaceLine: /^ +$/gm,
|
|
298
|
-
notSpaceStart: /^\S*/,
|
|
299
|
-
endingNewline: /\n$/,
|
|
300
|
-
listItemRegex: (e) => RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),
|
|
301
|
-
nextBulletRegex: (e) => RegExp(`^ {0,${Math.min(3, e - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),
|
|
302
|
-
hrRegex: (e) => RegExp(`^ {0,${Math.min(3, e - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),
|
|
303
|
-
fencesBeginRegex: (e) => RegExp(`^ {0,${Math.min(3, e - 1)}}(?:\`\`\`|~~~)`),
|
|
304
|
-
headingBeginRegex: (e) => RegExp(`^ {0,${Math.min(3, e - 1)}}#`),
|
|
305
|
-
htmlBeginRegex: (e) => RegExp(`^ {0,${Math.min(3, e - 1)}}<(?:[a-z].*>|!--)`, "i")
|
|
306
|
-
}, Te = /^(?:[ \t]*(?:\n|$))+/, Ee = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, De = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, C = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, Oe = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, w = /(?:[*+-]|\d{1,9}[.)])/, ke = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, Ae = x(ke).replace(/bull/g, w).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), je = x(ke).replace(/bull/g, w).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), T = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, Me = /^[^\n]+/, E = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, Ne = x(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", E).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Pe = x(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, w).getRegex(), D = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", O = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, Fe = x("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", O).replace("tag", D).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), Ie = x(T).replace("hr", C).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", D).getRegex(), k = {
|
|
307
|
-
blockquote: x(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", Ie).getRegex(),
|
|
308
|
-
code: Ee,
|
|
309
|
-
def: Ne,
|
|
310
|
-
fences: De,
|
|
311
|
-
heading: Oe,
|
|
312
|
-
hr: C,
|
|
313
|
-
html: Fe,
|
|
314
|
-
lheading: Ae,
|
|
315
|
-
list: Pe,
|
|
316
|
-
newline: Te,
|
|
317
|
-
paragraph: Ie,
|
|
318
|
-
table: b,
|
|
319
|
-
text: Me
|
|
320
|
-
}, Le = x("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", C).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", D).getRegex(), Re = r(r({}, k), {}, {
|
|
321
|
-
lheading: je,
|
|
322
|
-
table: Le,
|
|
323
|
-
paragraph: x(T).replace("hr", C).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", Le).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", D).getRegex()
|
|
324
|
-
}), ze = r(r({}, k), {}, {
|
|
325
|
-
html: x("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment", O).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),
|
|
326
|
-
def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
|
|
327
|
-
heading: /^(#{1,6})(.*)(?:\n+|$)/,
|
|
328
|
-
fences: b,
|
|
329
|
-
lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
|
|
330
|
-
paragraph: x(T).replace("hr", C).replace("heading", " *#{1,6} *[^\n]").replace("lheading", Ae).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
|
|
331
|
-
}), Be = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Ve = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, He = /^( {2,}|\\)\n(?!\s*$)/, Ue = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, A = /* @__PURE__ */ RegExp("[\\p{P}\\p{S}]", "u"), j = /* @__PURE__ */ RegExp("[\\s\\p{P}\\p{S}]", "u"), We = /* @__PURE__ */ RegExp("[^\\s\\p{P}\\p{S}]", "u"), Ge = x(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, j).getRegex(), Ke = /* @__PURE__ */ RegExp("(?!~)[\\p{P}\\p{S}]", "u"), qe = /* @__PURE__ */ RegExp("(?!~)[\\s\\p{P}\\p{S}]", "u"), Je = /* @__PURE__ */ RegExp("(?:[^\\s\\p{P}\\p{S}]|~)", "u"), Ye = /\[[^\[\]]*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)|`[^`]*?`|<(?! )[^<>]*?>/g, Xe = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/, Ze = x(Xe, "u").replace(/punct/g, A).getRegex(), Qe = x(Xe, "u").replace(/punct/g, Ke).getRegex(), $e = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", et = x($e, "gu").replace(/notPunctSpace/g, We).replace(/punctSpace/g, j).replace(/punct/g, A).getRegex(), tt = x($e, "gu").replace(/notPunctSpace/g, Je).replace(/punctSpace/g, qe).replace(/punct/g, Ke).getRegex(), nt = x("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, We).replace(/punctSpace/g, j).replace(/punct/g, A).getRegex(), rt = x(/\\(punct)/, "gu").replace(/punct/g, A).getRegex(), it = x(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), at = x(O).replace("(?:-->|$)", "-->").getRegex(), ot = x("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", at).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), M = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`[^`]*`|[^\[\]\\`])*?/, st = x(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label", M).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), ct = x(/^!?\[(label)\]\[(ref)\]/).replace("label", M).replace("ref", E).getRegex(), lt = x(/^!?\[(ref)\](?:\[\])?/).replace("ref", E).getRegex(), N = {
|
|
332
|
-
_backpedal: b,
|
|
333
|
-
anyPunctuation: rt,
|
|
334
|
-
autolink: it,
|
|
335
|
-
blockSkip: Ye,
|
|
336
|
-
br: He,
|
|
337
|
-
code: Ve,
|
|
338
|
-
del: b,
|
|
339
|
-
emStrongLDelim: Ze,
|
|
340
|
-
emStrongRDelimAst: et,
|
|
341
|
-
emStrongRDelimUnd: nt,
|
|
342
|
-
escape: Be,
|
|
343
|
-
link: st,
|
|
344
|
-
nolink: lt,
|
|
345
|
-
punctuation: Ge,
|
|
346
|
-
reflink: ct,
|
|
347
|
-
reflinkSearch: x("reflink|nolink(?!\\()", "g").replace("reflink", ct).replace("nolink", lt).getRegex(),
|
|
348
|
-
tag: ot,
|
|
349
|
-
text: Ue,
|
|
350
|
-
url: b
|
|
351
|
-
}, ut = r(r({}, N), {}, {
|
|
352
|
-
link: x(/^!?\[(label)\]\((.*?)\)/).replace("label", M).getRegex(),
|
|
353
|
-
reflink: x(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", M).getRegex()
|
|
354
|
-
}), P = r(r({}, N), {}, {
|
|
355
|
-
emStrongRDelimAst: tt,
|
|
356
|
-
emStrongLDelim: Qe,
|
|
357
|
-
url: x(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/, "i").replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),
|
|
358
|
-
_backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
|
|
359
|
-
del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,
|
|
360
|
-
text: /^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/
|
|
361
|
-
}), dt = r(r({}, P), {}, {
|
|
362
|
-
br: x(He).replace("{2,}", "*").getRegex(),
|
|
363
|
-
text: x(P.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
|
|
364
|
-
}), F = {
|
|
365
|
-
normal: k,
|
|
366
|
-
gfm: Re,
|
|
367
|
-
pedantic: ze
|
|
368
|
-
}, I = {
|
|
369
|
-
normal: N,
|
|
370
|
-
gfm: P,
|
|
371
|
-
breaks: dt,
|
|
372
|
-
pedantic: ut
|
|
373
|
-
}, ft = {
|
|
374
|
-
"&": "&",
|
|
375
|
-
"<": "<",
|
|
376
|
-
">": ">",
|
|
377
|
-
"\"": """,
|
|
378
|
-
"'": "'"
|
|
379
|
-
}, pt = (e) => ft[e];
|
|
380
|
-
function L(e, t) {
|
|
381
|
-
if (t) {
|
|
382
|
-
if (S.escapeTest.test(e)) return e.replace(S.escapeReplace, pt);
|
|
383
|
-
} else if (S.escapeTestNoEncode.test(e)) return e.replace(S.escapeReplaceNoEncode, pt);
|
|
384
|
-
return e;
|
|
385
|
-
}
|
|
386
|
-
function mt(e) {
|
|
387
|
-
try {
|
|
388
|
-
e = encodeURI(e).replace(S.percentDecode, "%");
|
|
389
|
-
} catch (e) {
|
|
390
|
-
return null;
|
|
391
|
-
}
|
|
392
|
-
return e;
|
|
393
|
-
}
|
|
394
|
-
function ht(e, t) {
|
|
395
|
-
var n;
|
|
396
|
-
let r = e.replace(S.findPipe, (e, t, n) => {
|
|
397
|
-
let r = !1, i = t;
|
|
398
|
-
for (; --i >= 0 && n[i] === "\\";) r = !r;
|
|
399
|
-
return r ? "|" : " |";
|
|
400
|
-
}).split(S.splitPipe), i = 0;
|
|
401
|
-
if (r[0].trim() || r.shift(), r.length > 0 && !((n = r.at(-1)) != null && n.trim()) && r.pop(), t) if (r.length > t) r.splice(t);
|
|
402
|
-
else for (; r.length < t;) r.push("");
|
|
403
|
-
for (; i < r.length; i++) r[i] = r[i].trim().replace(S.slashPipe, "|");
|
|
404
|
-
return r;
|
|
405
|
-
}
|
|
406
|
-
function R(e, t, n) {
|
|
407
|
-
let r = e.length;
|
|
408
|
-
if (r === 0) return "";
|
|
409
|
-
let i = 0;
|
|
410
|
-
for (; i < r;) {
|
|
411
|
-
let a = e.charAt(r - i - 1);
|
|
412
|
-
if (a === t && !n) i++;
|
|
413
|
-
else if (a !== t && n) i++;
|
|
414
|
-
else break;
|
|
415
|
-
}
|
|
416
|
-
return e.slice(0, r - i);
|
|
417
|
-
}
|
|
418
|
-
function gt(e, t) {
|
|
419
|
-
if (e.indexOf(t[1]) === -1) return -1;
|
|
420
|
-
let n = 0;
|
|
421
|
-
for (let r = 0; r < e.length; r++) if (e[r] === "\\") r++;
|
|
422
|
-
else if (e[r] === t[0]) n++;
|
|
423
|
-
else if (e[r] === t[1] && (n--, n < 0)) return r;
|
|
424
|
-
return n > 0 ? -2 : -1;
|
|
425
|
-
}
|
|
426
|
-
function _t(e, t, n, r, i) {
|
|
427
|
-
let a = t.href, o = t.title || null, s = e[1].replace(i.other.outputLinkReplace, "$1");
|
|
428
|
-
r.state.inLink = !0;
|
|
429
|
-
let c = {
|
|
430
|
-
type: e[0].charAt(0) === "!" ? "image" : "link",
|
|
431
|
-
raw: n,
|
|
432
|
-
href: a,
|
|
433
|
-
title: o,
|
|
434
|
-
text: s,
|
|
435
|
-
tokens: r.inlineTokens(s)
|
|
436
|
-
};
|
|
437
|
-
return r.state.inLink = !1, c;
|
|
438
|
-
}
|
|
439
|
-
function vt(e, t, n) {
|
|
440
|
-
let r = e.match(n.other.indentCodeCompensation);
|
|
441
|
-
if (r === null) return t;
|
|
442
|
-
let i = r[1];
|
|
443
|
-
return t.split("\n").map((e) => {
|
|
444
|
-
let t = e.match(n.other.beginningSpace);
|
|
445
|
-
if (t === null) return e;
|
|
446
|
-
let [r] = t;
|
|
447
|
-
return r.length >= i.length ? e.slice(i.length) : e;
|
|
448
|
-
}).join("\n");
|
|
449
|
-
}
|
|
450
|
-
var z = class {
|
|
451
|
-
constructor(e) {
|
|
452
|
-
t(this, "options", void 0), t(this, "rules", void 0), t(this, "lexer", void 0), this.options = e || y;
|
|
453
|
-
}
|
|
454
|
-
space(e) {
|
|
455
|
-
let t = this.rules.block.newline.exec(e);
|
|
456
|
-
if (t && t[0].length > 0) return {
|
|
457
|
-
type: "space",
|
|
458
|
-
raw: t[0]
|
|
459
|
-
};
|
|
460
|
-
}
|
|
461
|
-
code(e) {
|
|
462
|
-
let t = this.rules.block.code.exec(e);
|
|
463
|
-
if (t) {
|
|
464
|
-
let e = t[0].replace(this.rules.other.codeRemoveIndent, "");
|
|
465
|
-
return {
|
|
466
|
-
type: "code",
|
|
467
|
-
raw: t[0],
|
|
468
|
-
codeBlockStyle: "indented",
|
|
469
|
-
text: this.options.pedantic ? e : R(e, "\n")
|
|
470
|
-
};
|
|
471
|
-
}
|
|
472
|
-
}
|
|
473
|
-
fences(e) {
|
|
474
|
-
let t = this.rules.block.fences.exec(e);
|
|
475
|
-
if (t) {
|
|
476
|
-
let e = t[0], n = vt(e, t[3] || "", this.rules);
|
|
477
|
-
return {
|
|
478
|
-
type: "code",
|
|
479
|
-
raw: e,
|
|
480
|
-
lang: t[2] ? t[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : t[2],
|
|
481
|
-
text: n
|
|
482
|
-
};
|
|
483
|
-
}
|
|
484
|
-
}
|
|
485
|
-
heading(e) {
|
|
486
|
-
let t = this.rules.block.heading.exec(e);
|
|
487
|
-
if (t) {
|
|
488
|
-
let e = t[2].trim();
|
|
489
|
-
if (this.rules.other.endingHash.test(e)) {
|
|
490
|
-
let t = R(e, "#");
|
|
491
|
-
(this.options.pedantic || !t || this.rules.other.endingSpaceChar.test(t)) && (e = t.trim());
|
|
492
|
-
}
|
|
493
|
-
return {
|
|
494
|
-
type: "heading",
|
|
495
|
-
raw: t[0],
|
|
496
|
-
depth: t[1].length,
|
|
497
|
-
text: e,
|
|
498
|
-
tokens: this.lexer.inline(e)
|
|
499
|
-
};
|
|
500
|
-
}
|
|
501
|
-
}
|
|
502
|
-
hr(e) {
|
|
503
|
-
let t = this.rules.block.hr.exec(e);
|
|
504
|
-
if (t) return {
|
|
505
|
-
type: "hr",
|
|
506
|
-
raw: R(t[0], "\n")
|
|
507
|
-
};
|
|
508
|
-
}
|
|
509
|
-
blockquote(e) {
|
|
510
|
-
let t = this.rules.block.blockquote.exec(e);
|
|
511
|
-
if (t) {
|
|
512
|
-
let e = R(t[0], "\n").split("\n"), n = "", r = "", i = [];
|
|
513
|
-
for (; e.length > 0;) {
|
|
514
|
-
let t = !1, a = [], o;
|
|
515
|
-
for (o = 0; o < e.length; o++) if (this.rules.other.blockquoteStart.test(e[o])) a.push(e[o]), t = !0;
|
|
516
|
-
else if (!t) a.push(e[o]);
|
|
517
|
-
else break;
|
|
518
|
-
e = e.slice(o);
|
|
519
|
-
let s = a.join("\n"), c = s.replace(this.rules.other.blockquoteSetextReplace, "\n $1").replace(this.rules.other.blockquoteSetextReplace2, "");
|
|
520
|
-
n = n ? `${n}
|
|
521
|
-
${s}` : s, r = r ? `${r}
|
|
522
|
-
${c}` : c;
|
|
523
|
-
let l = this.lexer.state.top;
|
|
524
|
-
if (this.lexer.state.top = !0, this.lexer.blockTokens(c, i, !0), this.lexer.state.top = l, e.length === 0) break;
|
|
525
|
-
let u = i.at(-1);
|
|
526
|
-
if ((u == null ? void 0 : u.type) === "code") break;
|
|
527
|
-
if ((u == null ? void 0 : u.type) === "blockquote") {
|
|
528
|
-
let t = u, a = t.raw + "\n" + e.join("\n"), o = this.blockquote(a);
|
|
529
|
-
i[i.length - 1] = o, n = n.substring(0, n.length - t.raw.length) + o.raw, r = r.substring(0, r.length - t.text.length) + o.text;
|
|
530
|
-
break;
|
|
531
|
-
} else if ((u == null ? void 0 : u.type) === "list") {
|
|
532
|
-
let t = u, a = t.raw + "\n" + e.join("\n"), o = this.list(a);
|
|
533
|
-
i[i.length - 1] = o, n = n.substring(0, n.length - u.raw.length) + o.raw, r = r.substring(0, r.length - t.raw.length) + o.raw, e = a.substring(i.at(-1).raw.length).split("\n");
|
|
534
|
-
continue;
|
|
535
|
-
}
|
|
536
|
-
}
|
|
537
|
-
return {
|
|
538
|
-
type: "blockquote",
|
|
539
|
-
raw: n,
|
|
540
|
-
tokens: i,
|
|
541
|
-
text: r
|
|
542
|
-
};
|
|
543
|
-
}
|
|
544
|
-
}
|
|
545
|
-
list(e) {
|
|
546
|
-
let t = this.rules.block.list.exec(e);
|
|
547
|
-
if (t) {
|
|
548
|
-
let n = t[1].trim(), r = n.length > 1, i = {
|
|
549
|
-
type: "list",
|
|
550
|
-
raw: "",
|
|
551
|
-
ordered: r,
|
|
552
|
-
start: r ? +n.slice(0, -1) : "",
|
|
553
|
-
loose: !1,
|
|
554
|
-
items: []
|
|
555
|
-
};
|
|
556
|
-
n = r ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = r ? n : "[*+-]");
|
|
557
|
-
let a = this.rules.other.listItemRegex(n), o = !1;
|
|
558
|
-
for (; e;) {
|
|
559
|
-
let n = !1, r = "", s = "";
|
|
560
|
-
if (!(t = a.exec(e)) || this.rules.block.hr.test(e)) break;
|
|
561
|
-
r = t[0], e = e.substring(r.length);
|
|
562
|
-
let c = t[2].split("\n", 1)[0].replace(this.rules.other.listReplaceTabs, (e) => " ".repeat(3 * e.length)), l = e.split("\n", 1)[0], u = !c.trim(), d = 0;
|
|
563
|
-
if (this.options.pedantic ? (d = 2, s = c.trimStart()) : u ? d = t[1].length + 1 : (d = t[2].search(this.rules.other.nonSpaceChar), d = d > 4 ? 1 : d, s = c.slice(d), d += t[1].length), u && this.rules.other.blankLine.test(l) && (r += l + "\n", e = e.substring(l.length + 1), n = !0), !n) {
|
|
564
|
-
let t = this.rules.other.nextBulletRegex(d), n = this.rules.other.hrRegex(d), i = this.rules.other.fencesBeginRegex(d), a = this.rules.other.headingBeginRegex(d), o = this.rules.other.htmlBeginRegex(d);
|
|
565
|
-
for (; e;) {
|
|
566
|
-
let f = e.split("\n", 1)[0], p;
|
|
567
|
-
if (l = f, this.options.pedantic ? (l = l.replace(this.rules.other.listReplaceNesting, " "), p = l) : p = l.replace(this.rules.other.tabCharGlobal, " "), i.test(l) || a.test(l) || o.test(l) || t.test(l) || n.test(l)) break;
|
|
568
|
-
if (p.search(this.rules.other.nonSpaceChar) >= d || !l.trim()) s += "\n" + p.slice(d);
|
|
569
|
-
else {
|
|
570
|
-
if (u || c.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || i.test(c) || a.test(c) || n.test(c)) break;
|
|
571
|
-
s += "\n" + l;
|
|
572
|
-
}
|
|
573
|
-
!u && !l.trim() && (u = !0), r += f + "\n", e = e.substring(f.length + 1), c = p.slice(d);
|
|
574
|
-
}
|
|
575
|
-
}
|
|
576
|
-
i.loose || (o ? i.loose = !0 : this.rules.other.doubleBlankLine.test(r) && (o = !0));
|
|
577
|
-
let f = null, p;
|
|
578
|
-
this.options.gfm && (f = this.rules.other.listIsTask.exec(s), f && (p = f[0] !== "[ ] ", s = s.replace(this.rules.other.listReplaceTask, ""))), i.items.push({
|
|
579
|
-
type: "list_item",
|
|
580
|
-
raw: r,
|
|
581
|
-
task: !!f,
|
|
582
|
-
checked: p,
|
|
583
|
-
loose: !1,
|
|
584
|
-
text: s,
|
|
585
|
-
tokens: []
|
|
586
|
-
}), i.raw += r;
|
|
587
|
-
}
|
|
588
|
-
let s = i.items.at(-1);
|
|
589
|
-
if (s) s.raw = s.raw.trimEnd(), s.text = s.text.trimEnd();
|
|
590
|
-
else return;
|
|
591
|
-
i.raw = i.raw.trimEnd();
|
|
592
|
-
for (let e = 0; e < i.items.length; e++) if (this.lexer.state.top = !1, i.items[e].tokens = this.lexer.blockTokens(i.items[e].text, []), !i.loose) {
|
|
593
|
-
let t = i.items[e].tokens.filter((e) => e.type === "space");
|
|
594
|
-
i.loose = t.length > 0 && t.some((e) => this.rules.other.anyLine.test(e.raw));
|
|
595
|
-
}
|
|
596
|
-
if (i.loose) for (let e = 0; e < i.items.length; e++) i.items[e].loose = !0;
|
|
597
|
-
return i;
|
|
598
|
-
}
|
|
599
|
-
}
|
|
600
|
-
html(e) {
|
|
601
|
-
let t = this.rules.block.html.exec(e);
|
|
602
|
-
if (t) return {
|
|
603
|
-
type: "html",
|
|
604
|
-
block: !0,
|
|
605
|
-
raw: t[0],
|
|
606
|
-
pre: t[1] === "pre" || t[1] === "script" || t[1] === "style",
|
|
607
|
-
text: t[0]
|
|
608
|
-
};
|
|
609
|
-
}
|
|
610
|
-
def(e) {
|
|
611
|
-
let t = this.rules.block.def.exec(e);
|
|
612
|
-
if (t) {
|
|
613
|
-
let e = t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal, " "), n = t[2] ? t[2].replace(this.rules.other.hrefBrackets, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "", r = t[3] ? t[3].substring(1, t[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : t[3];
|
|
614
|
-
return {
|
|
615
|
-
type: "def",
|
|
616
|
-
tag: e,
|
|
617
|
-
raw: t[0],
|
|
618
|
-
href: n,
|
|
619
|
-
title: r
|
|
620
|
-
};
|
|
621
|
-
}
|
|
622
|
-
}
|
|
623
|
-
table(e) {
|
|
624
|
-
var t;
|
|
625
|
-
let n = this.rules.block.table.exec(e);
|
|
626
|
-
if (!n || !this.rules.other.tableDelimiter.test(n[2])) return;
|
|
627
|
-
let r = ht(n[1]), i = n[2].replace(this.rules.other.tableAlignChars, "").split("|"), a = (t = n[3]) != null && t.trim() ? n[3].replace(this.rules.other.tableRowBlankLine, "").split("\n") : [], o = {
|
|
628
|
-
type: "table",
|
|
629
|
-
raw: n[0],
|
|
630
|
-
header: [],
|
|
631
|
-
align: [],
|
|
632
|
-
rows: []
|
|
633
|
-
};
|
|
634
|
-
if (r.length === i.length) {
|
|
635
|
-
for (let e of i) this.rules.other.tableAlignRight.test(e) ? o.align.push("right") : this.rules.other.tableAlignCenter.test(e) ? o.align.push("center") : this.rules.other.tableAlignLeft.test(e) ? o.align.push("left") : o.align.push(null);
|
|
636
|
-
for (let e = 0; e < r.length; e++) o.header.push({
|
|
637
|
-
text: r[e],
|
|
638
|
-
tokens: this.lexer.inline(r[e]),
|
|
639
|
-
header: !0,
|
|
640
|
-
align: o.align[e]
|
|
641
|
-
});
|
|
642
|
-
for (let e of a) o.rows.push(ht(e, o.header.length).map((e, t) => ({
|
|
643
|
-
text: e,
|
|
644
|
-
tokens: this.lexer.inline(e),
|
|
645
|
-
header: !1,
|
|
646
|
-
align: o.align[t]
|
|
647
|
-
})));
|
|
648
|
-
return o;
|
|
649
|
-
}
|
|
650
|
-
}
|
|
651
|
-
lheading(e) {
|
|
652
|
-
let t = this.rules.block.lheading.exec(e);
|
|
653
|
-
if (t) return {
|
|
654
|
-
type: "heading",
|
|
655
|
-
raw: t[0],
|
|
656
|
-
depth: t[2].charAt(0) === "=" ? 1 : 2,
|
|
657
|
-
text: t[1],
|
|
658
|
-
tokens: this.lexer.inline(t[1])
|
|
659
|
-
};
|
|
660
|
-
}
|
|
661
|
-
paragraph(e) {
|
|
662
|
-
let t = this.rules.block.paragraph.exec(e);
|
|
663
|
-
if (t) {
|
|
664
|
-
let e = t[1].charAt(t[1].length - 1) === "\n" ? t[1].slice(0, -1) : t[1];
|
|
665
|
-
return {
|
|
666
|
-
type: "paragraph",
|
|
667
|
-
raw: t[0],
|
|
668
|
-
text: e,
|
|
669
|
-
tokens: this.lexer.inline(e)
|
|
670
|
-
};
|
|
671
|
-
}
|
|
672
|
-
}
|
|
673
|
-
text(e) {
|
|
674
|
-
let t = this.rules.block.text.exec(e);
|
|
675
|
-
if (t) return {
|
|
676
|
-
type: "text",
|
|
677
|
-
raw: t[0],
|
|
678
|
-
text: t[0],
|
|
679
|
-
tokens: this.lexer.inline(t[0])
|
|
680
|
-
};
|
|
681
|
-
}
|
|
682
|
-
escape(e) {
|
|
683
|
-
let t = this.rules.inline.escape.exec(e);
|
|
684
|
-
if (t) return {
|
|
685
|
-
type: "escape",
|
|
686
|
-
raw: t[0],
|
|
687
|
-
text: t[1]
|
|
688
|
-
};
|
|
689
|
-
}
|
|
690
|
-
tag(e) {
|
|
691
|
-
let t = this.rules.inline.tag.exec(e);
|
|
692
|
-
if (t) return !this.lexer.state.inLink && this.rules.other.startATag.test(t[0]) ? this.lexer.state.inLink = !0 : this.lexer.state.inLink && this.rules.other.endATag.test(t[0]) && (this.lexer.state.inLink = !1), !this.lexer.state.inRawBlock && this.rules.other.startPreScriptTag.test(t[0]) ? this.lexer.state.inRawBlock = !0 : this.lexer.state.inRawBlock && this.rules.other.endPreScriptTag.test(t[0]) && (this.lexer.state.inRawBlock = !1), {
|
|
693
|
-
type: "html",
|
|
694
|
-
raw: t[0],
|
|
695
|
-
inLink: this.lexer.state.inLink,
|
|
696
|
-
inRawBlock: this.lexer.state.inRawBlock,
|
|
697
|
-
block: !1,
|
|
698
|
-
text: t[0]
|
|
699
|
-
};
|
|
700
|
-
}
|
|
701
|
-
link(e) {
|
|
702
|
-
let t = this.rules.inline.link.exec(e);
|
|
703
|
-
if (t) {
|
|
704
|
-
let e = t[2].trim();
|
|
705
|
-
if (!this.options.pedantic && this.rules.other.startAngleBracket.test(e)) {
|
|
706
|
-
if (!this.rules.other.endAngleBracket.test(e)) return;
|
|
707
|
-
let t = R(e.slice(0, -1), "\\");
|
|
708
|
-
if ((e.length - t.length) % 2 == 0) return;
|
|
709
|
-
} else {
|
|
710
|
-
let e = gt(t[2], "()");
|
|
711
|
-
if (e === -2) return;
|
|
712
|
-
if (e > -1) {
|
|
713
|
-
let n = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + e;
|
|
714
|
-
t[2] = t[2].substring(0, e), t[0] = t[0].substring(0, n).trim(), t[3] = "";
|
|
715
|
-
}
|
|
716
|
-
}
|
|
717
|
-
let n = t[2], r = "";
|
|
718
|
-
if (this.options.pedantic) {
|
|
719
|
-
let e = this.rules.other.pedanticHrefTitle.exec(n);
|
|
720
|
-
e && (n = e[1], r = e[3]);
|
|
721
|
-
} else r = t[3] ? t[3].slice(1, -1) : "";
|
|
722
|
-
return n = n.trim(), this.rules.other.startAngleBracket.test(n) && (n = this.options.pedantic && !this.rules.other.endAngleBracket.test(e) ? n.slice(1) : n.slice(1, -1)), _t(t, {
|
|
723
|
-
href: n && n.replace(this.rules.inline.anyPunctuation, "$1"),
|
|
724
|
-
title: r && r.replace(this.rules.inline.anyPunctuation, "$1")
|
|
725
|
-
}, t[0], this.lexer, this.rules);
|
|
726
|
-
}
|
|
727
|
-
}
|
|
728
|
-
reflink(e, t) {
|
|
729
|
-
let n;
|
|
730
|
-
if ((n = this.rules.inline.reflink.exec(e)) || (n = this.rules.inline.nolink.exec(e))) {
|
|
731
|
-
let e = t[(n[2] || n[1]).replace(this.rules.other.multipleSpaceGlobal, " ").toLowerCase()];
|
|
732
|
-
if (!e) {
|
|
733
|
-
let e = n[0].charAt(0);
|
|
734
|
-
return {
|
|
735
|
-
type: "text",
|
|
736
|
-
raw: e,
|
|
737
|
-
text: e
|
|
738
|
-
};
|
|
739
|
-
}
|
|
740
|
-
return _t(n, e, n[0], this.lexer, this.rules);
|
|
741
|
-
}
|
|
742
|
-
}
|
|
743
|
-
emStrong(e, t, n = "") {
|
|
744
|
-
let r = this.rules.inline.emStrongLDelim.exec(e);
|
|
745
|
-
if (!(!r || r[3] && n.match(this.rules.other.unicodeAlphaNumeric)) && (!(r[1] || r[2]) || !n || this.rules.inline.punctuation.exec(n))) {
|
|
746
|
-
let n = [...r[0]].length - 1, i, a, o = n, s = 0, c = r[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
|
|
747
|
-
for (c.lastIndex = 0, t = t.slice(-1 * e.length + n); (r = c.exec(t)) != null;) {
|
|
748
|
-
if (i = r[1] || r[2] || r[3] || r[4] || r[5] || r[6], !i) continue;
|
|
749
|
-
if (a = [...i].length, r[3] || r[4]) {
|
|
750
|
-
o += a;
|
|
751
|
-
continue;
|
|
752
|
-
} else if ((r[5] || r[6]) && n % 3 && !((n + a) % 3)) {
|
|
753
|
-
s += a;
|
|
754
|
-
continue;
|
|
755
|
-
}
|
|
756
|
-
if (o -= a, o > 0) continue;
|
|
757
|
-
a = Math.min(a, a + o + s);
|
|
758
|
-
let t = [...r[0]][0].length, c = e.slice(0, n + r.index + t + a);
|
|
759
|
-
if (Math.min(n, a) % 2) {
|
|
760
|
-
let e = c.slice(1, -1);
|
|
761
|
-
return {
|
|
762
|
-
type: "em",
|
|
763
|
-
raw: c,
|
|
764
|
-
text: e,
|
|
765
|
-
tokens: this.lexer.inlineTokens(e)
|
|
766
|
-
};
|
|
767
|
-
}
|
|
768
|
-
let l = c.slice(2, -2);
|
|
769
|
-
return {
|
|
770
|
-
type: "strong",
|
|
771
|
-
raw: c,
|
|
772
|
-
text: l,
|
|
773
|
-
tokens: this.lexer.inlineTokens(l)
|
|
774
|
-
};
|
|
775
|
-
}
|
|
776
|
-
}
|
|
777
|
-
}
|
|
778
|
-
codespan(e) {
|
|
779
|
-
let t = this.rules.inline.code.exec(e);
|
|
780
|
-
if (t) {
|
|
781
|
-
let e = t[2].replace(this.rules.other.newLineCharGlobal, " "), n = this.rules.other.nonSpaceChar.test(e), r = this.rules.other.startingSpaceChar.test(e) && this.rules.other.endingSpaceChar.test(e);
|
|
782
|
-
return n && r && (e = e.substring(1, e.length - 1)), {
|
|
783
|
-
type: "codespan",
|
|
784
|
-
raw: t[0],
|
|
785
|
-
text: e
|
|
786
|
-
};
|
|
787
|
-
}
|
|
788
|
-
}
|
|
789
|
-
br(e) {
|
|
790
|
-
let t = this.rules.inline.br.exec(e);
|
|
791
|
-
if (t) return {
|
|
792
|
-
type: "br",
|
|
793
|
-
raw: t[0]
|
|
794
|
-
};
|
|
795
|
-
}
|
|
796
|
-
del(e) {
|
|
797
|
-
let t = this.rules.inline.del.exec(e);
|
|
798
|
-
if (t) return {
|
|
799
|
-
type: "del",
|
|
800
|
-
raw: t[0],
|
|
801
|
-
text: t[2],
|
|
802
|
-
tokens: this.lexer.inlineTokens(t[2])
|
|
803
|
-
};
|
|
804
|
-
}
|
|
805
|
-
autolink(e) {
|
|
806
|
-
let t = this.rules.inline.autolink.exec(e);
|
|
807
|
-
if (t) {
|
|
808
|
-
let e, n;
|
|
809
|
-
return t[2] === "@" ? (e = t[1], n = "mailto:" + e) : (e = t[1], n = e), {
|
|
810
|
-
type: "link",
|
|
811
|
-
raw: t[0],
|
|
812
|
-
text: e,
|
|
813
|
-
href: n,
|
|
814
|
-
tokens: [{
|
|
815
|
-
type: "text",
|
|
816
|
-
raw: e,
|
|
817
|
-
text: e
|
|
818
|
-
}]
|
|
819
|
-
};
|
|
820
|
-
}
|
|
821
|
-
}
|
|
822
|
-
url(e) {
|
|
823
|
-
let t;
|
|
824
|
-
if (t = this.rules.inline.url.exec(e)) {
|
|
825
|
-
let e, i;
|
|
826
|
-
if (t[2] === "@") e = t[0], i = "mailto:" + e;
|
|
827
|
-
else {
|
|
828
|
-
var n, r;
|
|
829
|
-
let a;
|
|
830
|
-
do
|
|
831
|
-
a = t[0], t[0] = (n = (r = this.rules.inline._backpedal.exec(t[0])) == null ? void 0 : r[0]) == null ? "" : n;
|
|
832
|
-
while (a !== t[0]);
|
|
833
|
-
e = t[0], i = t[1] === "www." ? "http://" + t[0] : t[0];
|
|
834
|
-
}
|
|
835
|
-
return {
|
|
836
|
-
type: "link",
|
|
837
|
-
raw: t[0],
|
|
838
|
-
text: e,
|
|
839
|
-
href: i,
|
|
840
|
-
tokens: [{
|
|
841
|
-
type: "text",
|
|
842
|
-
raw: e,
|
|
843
|
-
text: e
|
|
844
|
-
}]
|
|
845
|
-
};
|
|
846
|
-
}
|
|
847
|
-
}
|
|
848
|
-
inlineText(e) {
|
|
849
|
-
let t = this.rules.inline.text.exec(e);
|
|
850
|
-
if (t) {
|
|
851
|
-
let e = this.lexer.state.inRawBlock;
|
|
852
|
-
return {
|
|
853
|
-
type: "text",
|
|
854
|
-
raw: t[0],
|
|
855
|
-
text: t[0],
|
|
856
|
-
escaped: e
|
|
857
|
-
};
|
|
858
|
-
}
|
|
859
|
-
}
|
|
860
|
-
}, B = class e {
|
|
861
|
-
constructor(e) {
|
|
862
|
-
t(this, "tokens", void 0), t(this, "options", void 0), t(this, "state", void 0), t(this, "tokenizer", void 0), t(this, "inlineQueue", void 0), this.tokens = [], this.tokens.links = Object.create(null), this.options = e || y, this.options.tokenizer = this.options.tokenizer || new z(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
|
|
863
|
-
inLink: !1,
|
|
864
|
-
inRawBlock: !1,
|
|
865
|
-
top: !0
|
|
866
|
-
};
|
|
867
|
-
let n = {
|
|
868
|
-
other: S,
|
|
869
|
-
block: F.normal,
|
|
870
|
-
inline: I.normal
|
|
871
|
-
};
|
|
872
|
-
this.options.pedantic ? (n.block = F.pedantic, n.inline = I.pedantic) : this.options.gfm && (n.block = F.gfm, this.options.breaks ? n.inline = I.breaks : n.inline = I.gfm), this.tokenizer.rules = n;
|
|
873
|
-
}
|
|
874
|
-
static get rules() {
|
|
875
|
-
return {
|
|
876
|
-
block: F,
|
|
877
|
-
inline: I
|
|
878
|
-
};
|
|
879
|
-
}
|
|
880
|
-
static lex(t, n) {
|
|
881
|
-
return new e(n).lex(t);
|
|
882
|
-
}
|
|
883
|
-
static lexInline(t, n) {
|
|
884
|
-
return new e(n).inlineTokens(t);
|
|
885
|
-
}
|
|
886
|
-
lex(e) {
|
|
887
|
-
e = e.replace(S.carriageReturn, "\n"), this.blockTokens(e, this.tokens);
|
|
888
|
-
for (let e = 0; e < this.inlineQueue.length; e++) {
|
|
889
|
-
let t = this.inlineQueue[e];
|
|
890
|
-
this.inlineTokens(t.src, t.tokens);
|
|
891
|
-
}
|
|
892
|
-
return this.inlineQueue = [], this.tokens;
|
|
893
|
-
}
|
|
894
|
-
blockTokens(e, t = [], n = !1) {
|
|
895
|
-
for (this.options.pedantic && (e = e.replace(S.tabCharGlobal, " ").replace(S.spaceLine, "")); e;) {
|
|
896
|
-
var r, i;
|
|
897
|
-
let a;
|
|
898
|
-
if (!((r = this.options.extensions) == null || (r = r.block) == null) && r.some((n) => (a = n.call({ lexer: this }, e, t)) ? (e = e.substring(a.raw.length), t.push(a), !0) : !1)) continue;
|
|
899
|
-
if (a = this.tokenizer.space(e)) {
|
|
900
|
-
e = e.substring(a.raw.length);
|
|
901
|
-
let n = t.at(-1);
|
|
902
|
-
a.raw.length === 1 && n !== void 0 ? n.raw += "\n" : t.push(a);
|
|
903
|
-
continue;
|
|
904
|
-
}
|
|
905
|
-
if (a = this.tokenizer.code(e)) {
|
|
906
|
-
e = e.substring(a.raw.length);
|
|
907
|
-
let n = t.at(-1);
|
|
908
|
-
(n == null ? void 0 : n.type) === "paragraph" || (n == null ? void 0 : n.type) === "text" ? (n.raw += (n.raw.endsWith("\n") ? "" : "\n") + a.raw, n.text += "\n" + a.text, this.inlineQueue.at(-1).src = n.text) : t.push(a);
|
|
909
|
-
continue;
|
|
910
|
-
}
|
|
911
|
-
if (a = this.tokenizer.fences(e)) {
|
|
912
|
-
e = e.substring(a.raw.length), t.push(a);
|
|
913
|
-
continue;
|
|
914
|
-
}
|
|
915
|
-
if (a = this.tokenizer.heading(e)) {
|
|
916
|
-
e = e.substring(a.raw.length), t.push(a);
|
|
917
|
-
continue;
|
|
918
|
-
}
|
|
919
|
-
if (a = this.tokenizer.hr(e)) {
|
|
920
|
-
e = e.substring(a.raw.length), t.push(a);
|
|
921
|
-
continue;
|
|
922
|
-
}
|
|
923
|
-
if (a = this.tokenizer.blockquote(e)) {
|
|
924
|
-
e = e.substring(a.raw.length), t.push(a);
|
|
925
|
-
continue;
|
|
926
|
-
}
|
|
927
|
-
if (a = this.tokenizer.list(e)) {
|
|
928
|
-
e = e.substring(a.raw.length), t.push(a);
|
|
929
|
-
continue;
|
|
930
|
-
}
|
|
931
|
-
if (a = this.tokenizer.html(e)) {
|
|
932
|
-
e = e.substring(a.raw.length), t.push(a);
|
|
933
|
-
continue;
|
|
934
|
-
}
|
|
935
|
-
if (a = this.tokenizer.def(e)) {
|
|
936
|
-
e = e.substring(a.raw.length);
|
|
937
|
-
let n = t.at(-1);
|
|
938
|
-
(n == null ? void 0 : n.type) === "paragraph" || (n == null ? void 0 : n.type) === "text" ? (n.raw += (n.raw.endsWith("\n") ? "" : "\n") + a.raw, n.text += "\n" + a.raw, this.inlineQueue.at(-1).src = n.text) : this.tokens.links[a.tag] || (this.tokens.links[a.tag] = {
|
|
939
|
-
href: a.href,
|
|
940
|
-
title: a.title
|
|
941
|
-
}, t.push(a));
|
|
942
|
-
continue;
|
|
943
|
-
}
|
|
944
|
-
if (a = this.tokenizer.table(e)) {
|
|
945
|
-
e = e.substring(a.raw.length), t.push(a);
|
|
946
|
-
continue;
|
|
947
|
-
}
|
|
948
|
-
if (a = this.tokenizer.lheading(e)) {
|
|
949
|
-
e = e.substring(a.raw.length), t.push(a);
|
|
950
|
-
continue;
|
|
951
|
-
}
|
|
952
|
-
let o = e;
|
|
953
|
-
if ((i = this.options.extensions) != null && i.startBlock) {
|
|
954
|
-
let t = Infinity, n = e.slice(1), r;
|
|
955
|
-
this.options.extensions.startBlock.forEach((e) => {
|
|
956
|
-
r = e.call({ lexer: this }, n), typeof r == "number" && r >= 0 && (t = Math.min(t, r));
|
|
957
|
-
}), t < Infinity && t >= 0 && (o = e.substring(0, t + 1));
|
|
958
|
-
}
|
|
959
|
-
if (this.state.top && (a = this.tokenizer.paragraph(o))) {
|
|
960
|
-
let r = t.at(-1);
|
|
961
|
-
n && (r == null ? void 0 : r.type) === "paragraph" ? (r.raw += (r.raw.endsWith("\n") ? "" : "\n") + a.raw, r.text += "\n" + a.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = r.text) : t.push(a), n = o.length !== e.length, e = e.substring(a.raw.length);
|
|
962
|
-
continue;
|
|
963
|
-
}
|
|
964
|
-
if (a = this.tokenizer.text(e)) {
|
|
965
|
-
e = e.substring(a.raw.length);
|
|
966
|
-
let n = t.at(-1);
|
|
967
|
-
(n == null ? void 0 : n.type) === "text" ? (n.raw += (n.raw.endsWith("\n") ? "" : "\n") + a.raw, n.text += "\n" + a.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = n.text) : t.push(a);
|
|
968
|
-
continue;
|
|
969
|
-
}
|
|
970
|
-
if (e) {
|
|
971
|
-
let t = "Infinite loop on byte: " + e.charCodeAt(0);
|
|
972
|
-
if (this.options.silent) {
|
|
973
|
-
console.error(t);
|
|
974
|
-
break;
|
|
975
|
-
} else throw Error(t);
|
|
976
|
-
}
|
|
977
|
-
}
|
|
978
|
-
return this.state.top = !0, t;
|
|
979
|
-
}
|
|
980
|
-
inline(e, t = []) {
|
|
981
|
-
return this.inlineQueue.push({
|
|
982
|
-
src: e,
|
|
983
|
-
tokens: t
|
|
984
|
-
}), t;
|
|
985
|
-
}
|
|
986
|
-
inlineTokens(e, t = []) {
|
|
987
|
-
var n, r;
|
|
988
|
-
let i = e, a = null;
|
|
989
|
-
if (this.tokens.links) {
|
|
990
|
-
let e = Object.keys(this.tokens.links);
|
|
991
|
-
if (e.length > 0) for (; (a = this.tokenizer.rules.inline.reflinkSearch.exec(i)) != null;) e.includes(a[0].slice(a[0].lastIndexOf("[") + 1, -1)) && (i = i.slice(0, a.index) + "[" + "a".repeat(a[0].length - 2) + "]" + i.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
|
|
992
|
-
}
|
|
993
|
-
for (; (a = this.tokenizer.rules.inline.anyPunctuation.exec(i)) != null;) i = i.slice(0, a.index) + "++" + i.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
|
|
994
|
-
for (; (a = this.tokenizer.rules.inline.blockSkip.exec(i)) != null;) i = i.slice(0, a.index) + "[" + "a".repeat(a[0].length - 2) + "]" + i.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
|
|
995
|
-
i = (n = (r = this.options.hooks) == null || (r = r.emStrongMask) == null ? void 0 : r.call({ lexer: this }, i)) == null ? i : n;
|
|
996
|
-
let o = !1, s = "";
|
|
997
|
-
for (; e;) {
|
|
998
|
-
var c, l;
|
|
999
|
-
o || (s = ""), o = !1;
|
|
1000
|
-
let n;
|
|
1001
|
-
if (!((c = this.options.extensions) == null || (c = c.inline) == null) && c.some((r) => (n = r.call({ lexer: this }, e, t)) ? (e = e.substring(n.raw.length), t.push(n), !0) : !1)) continue;
|
|
1002
|
-
if (n = this.tokenizer.escape(e)) {
|
|
1003
|
-
e = e.substring(n.raw.length), t.push(n);
|
|
1004
|
-
continue;
|
|
1005
|
-
}
|
|
1006
|
-
if (n = this.tokenizer.tag(e)) {
|
|
1007
|
-
e = e.substring(n.raw.length), t.push(n);
|
|
1008
|
-
continue;
|
|
1009
|
-
}
|
|
1010
|
-
if (n = this.tokenizer.link(e)) {
|
|
1011
|
-
e = e.substring(n.raw.length), t.push(n);
|
|
1012
|
-
continue;
|
|
1013
|
-
}
|
|
1014
|
-
if (n = this.tokenizer.reflink(e, this.tokens.links)) {
|
|
1015
|
-
e = e.substring(n.raw.length);
|
|
1016
|
-
let r = t.at(-1);
|
|
1017
|
-
n.type === "text" && (r == null ? void 0 : r.type) === "text" ? (r.raw += n.raw, r.text += n.text) : t.push(n);
|
|
1018
|
-
continue;
|
|
1019
|
-
}
|
|
1020
|
-
if (n = this.tokenizer.emStrong(e, i, s)) {
|
|
1021
|
-
e = e.substring(n.raw.length), t.push(n);
|
|
1022
|
-
continue;
|
|
1023
|
-
}
|
|
1024
|
-
if (n = this.tokenizer.codespan(e)) {
|
|
1025
|
-
e = e.substring(n.raw.length), t.push(n);
|
|
1026
|
-
continue;
|
|
1027
|
-
}
|
|
1028
|
-
if (n = this.tokenizer.br(e)) {
|
|
1029
|
-
e = e.substring(n.raw.length), t.push(n);
|
|
1030
|
-
continue;
|
|
1031
|
-
}
|
|
1032
|
-
if (n = this.tokenizer.del(e)) {
|
|
1033
|
-
e = e.substring(n.raw.length), t.push(n);
|
|
1034
|
-
continue;
|
|
1035
|
-
}
|
|
1036
|
-
if (n = this.tokenizer.autolink(e)) {
|
|
1037
|
-
e = e.substring(n.raw.length), t.push(n);
|
|
1038
|
-
continue;
|
|
1039
|
-
}
|
|
1040
|
-
if (!this.state.inLink && (n = this.tokenizer.url(e))) {
|
|
1041
|
-
e = e.substring(n.raw.length), t.push(n);
|
|
1042
|
-
continue;
|
|
1043
|
-
}
|
|
1044
|
-
let r = e;
|
|
1045
|
-
if ((l = this.options.extensions) != null && l.startInline) {
|
|
1046
|
-
let t = Infinity, n = e.slice(1), i;
|
|
1047
|
-
this.options.extensions.startInline.forEach((e) => {
|
|
1048
|
-
i = e.call({ lexer: this }, n), typeof i == "number" && i >= 0 && (t = Math.min(t, i));
|
|
1049
|
-
}), t < Infinity && t >= 0 && (r = e.substring(0, t + 1));
|
|
1050
|
-
}
|
|
1051
|
-
if (n = this.tokenizer.inlineText(r)) {
|
|
1052
|
-
e = e.substring(n.raw.length), n.raw.slice(-1) !== "_" && (s = n.raw.slice(-1)), o = !0;
|
|
1053
|
-
let r = t.at(-1);
|
|
1054
|
-
(r == null ? void 0 : r.type) === "text" ? (r.raw += n.raw, r.text += n.text) : t.push(n);
|
|
1055
|
-
continue;
|
|
1056
|
-
}
|
|
1057
|
-
if (e) {
|
|
1058
|
-
let t = "Infinite loop on byte: " + e.charCodeAt(0);
|
|
1059
|
-
if (this.options.silent) {
|
|
1060
|
-
console.error(t);
|
|
1061
|
-
break;
|
|
1062
|
-
} else throw Error(t);
|
|
1063
|
-
}
|
|
1064
|
-
}
|
|
1065
|
-
return t;
|
|
1066
|
-
}
|
|
1067
|
-
}, V = class {
|
|
1068
|
-
constructor(e) {
|
|
1069
|
-
t(this, "options", void 0), t(this, "parser", void 0), this.options = e || y;
|
|
1070
|
-
}
|
|
1071
|
-
space(e) {
|
|
1072
|
-
return "";
|
|
1073
|
-
}
|
|
1074
|
-
code({ text: e, lang: t, escaped: n }) {
|
|
1075
|
-
var r;
|
|
1076
|
-
let i = (r = (t || "").match(S.notSpaceStart)) == null ? void 0 : r[0], a = e.replace(S.endingNewline, "") + "\n";
|
|
1077
|
-
return i ? "<pre><code class=\"language-" + L(i) + "\">" + (n ? a : L(a, !0)) + "</code></pre>\n" : "<pre><code>" + (n ? a : L(a, !0)) + "</code></pre>\n";
|
|
1078
|
-
}
|
|
1079
|
-
blockquote({ tokens: e }) {
|
|
1080
|
-
return `<blockquote>
|
|
1081
|
-
${this.parser.parse(e)}</blockquote>
|
|
1082
|
-
`;
|
|
1083
|
-
}
|
|
1084
|
-
html({ text: e }) {
|
|
1085
|
-
return e;
|
|
1086
|
-
}
|
|
1087
|
-
def(e) {
|
|
1088
|
-
return "";
|
|
1089
|
-
}
|
|
1090
|
-
heading({ tokens: e, depth: t }) {
|
|
1091
|
-
return `<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
1092
|
-
`;
|
|
1093
|
-
}
|
|
1094
|
-
hr(e) {
|
|
1095
|
-
return "<hr>\n";
|
|
1096
|
-
}
|
|
1097
|
-
list(e) {
|
|
1098
|
-
let t = e.ordered, n = e.start, r = "";
|
|
1099
|
-
for (let t = 0; t < e.items.length; t++) {
|
|
1100
|
-
let n = e.items[t];
|
|
1101
|
-
r += this.listitem(n);
|
|
1102
|
-
}
|
|
1103
|
-
let i = t ? "ol" : "ul", a = t && n !== 1 ? " start=\"" + n + "\"" : "";
|
|
1104
|
-
return "<" + i + a + ">\n" + r + "</" + i + ">\n";
|
|
1105
|
-
}
|
|
1106
|
-
listitem(e) {
|
|
1107
|
-
let t = "";
|
|
1108
|
-
if (e.task) {
|
|
1109
|
-
var n;
|
|
1110
|
-
let r = this.checkbox({ checked: !!e.checked });
|
|
1111
|
-
e.loose ? ((n = e.tokens[0]) == null ? void 0 : n.type) === "paragraph" ? (e.tokens[0].text = r + " " + e.tokens[0].text, e.tokens[0].tokens && e.tokens[0].tokens.length > 0 && e.tokens[0].tokens[0].type === "text" && (e.tokens[0].tokens[0].text = r + " " + L(e.tokens[0].tokens[0].text), e.tokens[0].tokens[0].escaped = !0)) : e.tokens.unshift({
|
|
1112
|
-
type: "text",
|
|
1113
|
-
raw: r + " ",
|
|
1114
|
-
text: r + " ",
|
|
1115
|
-
escaped: !0
|
|
1116
|
-
}) : t += r + " ";
|
|
1117
|
-
}
|
|
1118
|
-
return t += this.parser.parse(e.tokens, !!e.loose), `<li>${t}</li>
|
|
1119
|
-
`;
|
|
1120
|
-
}
|
|
1121
|
-
checkbox({ checked: e }) {
|
|
1122
|
-
return "<input " + (e ? "checked=\"\" " : "") + "disabled=\"\" type=\"checkbox\">";
|
|
1123
|
-
}
|
|
1124
|
-
paragraph({ tokens: e }) {
|
|
1125
|
-
return `<p>${this.parser.parseInline(e)}</p>
|
|
1126
|
-
`;
|
|
1127
|
-
}
|
|
1128
|
-
table(e) {
|
|
1129
|
-
let t = "", n = "";
|
|
1130
|
-
for (let t = 0; t < e.header.length; t++) n += this.tablecell(e.header[t]);
|
|
1131
|
-
t += this.tablerow({ text: n });
|
|
1132
|
-
let r = "";
|
|
1133
|
-
for (let t = 0; t < e.rows.length; t++) {
|
|
1134
|
-
let i = e.rows[t];
|
|
1135
|
-
n = "";
|
|
1136
|
-
for (let e = 0; e < i.length; e++) n += this.tablecell(i[e]);
|
|
1137
|
-
r += this.tablerow({ text: n });
|
|
1138
|
-
}
|
|
1139
|
-
return r && (r = `<tbody>${r}</tbody>`), "<table>\n<thead>\n" + t + "</thead>\n" + r + "</table>\n";
|
|
1140
|
-
}
|
|
1141
|
-
tablerow({ text: e }) {
|
|
1142
|
-
return `<tr>
|
|
1143
|
-
${e}</tr>
|
|
1144
|
-
`;
|
|
1145
|
-
}
|
|
1146
|
-
tablecell(e) {
|
|
1147
|
-
let t = this.parser.parseInline(e.tokens), n = e.header ? "th" : "td";
|
|
1148
|
-
return (e.align ? `<${n} align="${e.align}">` : `<${n}>`) + t + `</${n}>
|
|
1149
|
-
`;
|
|
1150
|
-
}
|
|
1151
|
-
strong({ tokens: e }) {
|
|
1152
|
-
return `<strong>${this.parser.parseInline(e)}</strong>`;
|
|
1153
|
-
}
|
|
1154
|
-
em({ tokens: e }) {
|
|
1155
|
-
return `<em>${this.parser.parseInline(e)}</em>`;
|
|
1156
|
-
}
|
|
1157
|
-
codespan({ text: e }) {
|
|
1158
|
-
return `<code>${L(e, !0)}</code>`;
|
|
1159
|
-
}
|
|
1160
|
-
br(e) {
|
|
1161
|
-
return "<br>";
|
|
1162
|
-
}
|
|
1163
|
-
del({ tokens: e }) {
|
|
1164
|
-
return `<del>${this.parser.parseInline(e)}</del>`;
|
|
1165
|
-
}
|
|
1166
|
-
link({ href: e, title: t, tokens: n }) {
|
|
1167
|
-
let r = this.parser.parseInline(n), i = mt(e);
|
|
1168
|
-
if (i === null) return r;
|
|
1169
|
-
e = i;
|
|
1170
|
-
let a = "<a href=\"" + e + "\"";
|
|
1171
|
-
return t && (a += " title=\"" + L(t) + "\""), a += ">" + r + "</a>", a;
|
|
1172
|
-
}
|
|
1173
|
-
image({ href: e, title: t, text: n, tokens: r }) {
|
|
1174
|
-
r && (n = this.parser.parseInline(r, this.parser.textRenderer));
|
|
1175
|
-
let i = mt(e);
|
|
1176
|
-
if (i === null) return L(n);
|
|
1177
|
-
e = i;
|
|
1178
|
-
let a = `<img src="${e}" alt="${n}"`;
|
|
1179
|
-
return t && (a += ` title="${L(t)}"`), a += ">", a;
|
|
1180
|
-
}
|
|
1181
|
-
text(e) {
|
|
1182
|
-
return "tokens" in e && e.tokens ? this.parser.parseInline(e.tokens) : "escaped" in e && e.escaped ? e.text : L(e.text);
|
|
1183
|
-
}
|
|
1184
|
-
}, H = class {
|
|
1185
|
-
strong({ text: e }) {
|
|
1186
|
-
return e;
|
|
1187
|
-
}
|
|
1188
|
-
em({ text: e }) {
|
|
1189
|
-
return e;
|
|
1190
|
-
}
|
|
1191
|
-
codespan({ text: e }) {
|
|
1192
|
-
return e;
|
|
1193
|
-
}
|
|
1194
|
-
del({ text: e }) {
|
|
1195
|
-
return e;
|
|
1196
|
-
}
|
|
1197
|
-
html({ text: e }) {
|
|
1198
|
-
return e;
|
|
1199
|
-
}
|
|
1200
|
-
text({ text: e }) {
|
|
1201
|
-
return e;
|
|
1202
|
-
}
|
|
1203
|
-
link({ text: e }) {
|
|
1204
|
-
return "" + e;
|
|
1205
|
-
}
|
|
1206
|
-
image({ text: e }) {
|
|
1207
|
-
return "" + e;
|
|
1208
|
-
}
|
|
1209
|
-
br() {
|
|
1210
|
-
return "";
|
|
1211
|
-
}
|
|
1212
|
-
}, U = class e {
|
|
1213
|
-
constructor(e) {
|
|
1214
|
-
t(this, "options", void 0), t(this, "renderer", void 0), t(this, "textRenderer", void 0), this.options = e || y, this.options.renderer = this.options.renderer || new V(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new H();
|
|
1215
|
-
}
|
|
1216
|
-
static parse(t, n) {
|
|
1217
|
-
return new e(n).parse(t);
|
|
1218
|
-
}
|
|
1219
|
-
static parseInline(t, n) {
|
|
1220
|
-
return new e(n).parseInline(t);
|
|
1221
|
-
}
|
|
1222
|
-
parse(e, t = !0) {
|
|
1223
|
-
let n = "";
|
|
1224
|
-
for (let i = 0; i < e.length; i++) {
|
|
1225
|
-
var r;
|
|
1226
|
-
let a = e[i];
|
|
1227
|
-
if (!((r = this.options.extensions) == null || (r = r.renderers) == null) && r[a.type]) {
|
|
1228
|
-
let e = a, t = this.options.extensions.renderers[e.type].call({ parser: this }, e);
|
|
1229
|
-
if (t !== !1 || ![
|
|
1230
|
-
"space",
|
|
1231
|
-
"hr",
|
|
1232
|
-
"heading",
|
|
1233
|
-
"code",
|
|
1234
|
-
"table",
|
|
1235
|
-
"blockquote",
|
|
1236
|
-
"list",
|
|
1237
|
-
"html",
|
|
1238
|
-
"def",
|
|
1239
|
-
"paragraph",
|
|
1240
|
-
"text"
|
|
1241
|
-
].includes(e.type)) {
|
|
1242
|
-
n += t || "";
|
|
1243
|
-
continue;
|
|
1244
|
-
}
|
|
1245
|
-
}
|
|
1246
|
-
let o = a;
|
|
1247
|
-
switch (o.type) {
|
|
1248
|
-
case "space":
|
|
1249
|
-
n += this.renderer.space(o);
|
|
1250
|
-
continue;
|
|
1251
|
-
case "hr":
|
|
1252
|
-
n += this.renderer.hr(o);
|
|
1253
|
-
continue;
|
|
1254
|
-
case "heading":
|
|
1255
|
-
n += this.renderer.heading(o);
|
|
1256
|
-
continue;
|
|
1257
|
-
case "code":
|
|
1258
|
-
n += this.renderer.code(o);
|
|
1259
|
-
continue;
|
|
1260
|
-
case "table":
|
|
1261
|
-
n += this.renderer.table(o);
|
|
1262
|
-
continue;
|
|
1263
|
-
case "blockquote":
|
|
1264
|
-
n += this.renderer.blockquote(o);
|
|
1265
|
-
continue;
|
|
1266
|
-
case "list":
|
|
1267
|
-
n += this.renderer.list(o);
|
|
1268
|
-
continue;
|
|
1269
|
-
case "html":
|
|
1270
|
-
n += this.renderer.html(o);
|
|
1271
|
-
continue;
|
|
1272
|
-
case "def":
|
|
1273
|
-
n += this.renderer.def(o);
|
|
1274
|
-
continue;
|
|
1275
|
-
case "paragraph":
|
|
1276
|
-
n += this.renderer.paragraph(o);
|
|
1277
|
-
continue;
|
|
1278
|
-
case "text": {
|
|
1279
|
-
let r = o, a = this.renderer.text(r);
|
|
1280
|
-
for (; i + 1 < e.length && e[i + 1].type === "text";) r = e[++i], a += "\n" + this.renderer.text(r);
|
|
1281
|
-
t ? n += this.renderer.paragraph({
|
|
1282
|
-
type: "paragraph",
|
|
1283
|
-
raw: a,
|
|
1284
|
-
text: a,
|
|
1285
|
-
tokens: [{
|
|
1286
|
-
type: "text",
|
|
1287
|
-
raw: a,
|
|
1288
|
-
text: a,
|
|
1289
|
-
escaped: !0
|
|
1290
|
-
}]
|
|
1291
|
-
}) : n += a;
|
|
1292
|
-
continue;
|
|
1293
|
-
}
|
|
1294
|
-
default: {
|
|
1295
|
-
let e = "Token with \"" + o.type + "\" type was not found.";
|
|
1296
|
-
if (this.options.silent) return console.error(e), "";
|
|
1297
|
-
throw Error(e);
|
|
1298
|
-
}
|
|
1299
|
-
}
|
|
1300
|
-
}
|
|
1301
|
-
return n;
|
|
1302
|
-
}
|
|
1303
|
-
parseInline(e, t = this.renderer) {
|
|
1304
|
-
let n = "";
|
|
1305
|
-
for (let i = 0; i < e.length; i++) {
|
|
1306
|
-
var r;
|
|
1307
|
-
let a = e[i];
|
|
1308
|
-
if (!((r = this.options.extensions) == null || (r = r.renderers) == null) && r[a.type]) {
|
|
1309
|
-
let e = this.options.extensions.renderers[a.type].call({ parser: this }, a);
|
|
1310
|
-
if (e !== !1 || ![
|
|
1311
|
-
"escape",
|
|
1312
|
-
"html",
|
|
1313
|
-
"link",
|
|
1314
|
-
"image",
|
|
1315
|
-
"strong",
|
|
1316
|
-
"em",
|
|
1317
|
-
"codespan",
|
|
1318
|
-
"br",
|
|
1319
|
-
"del",
|
|
1320
|
-
"text"
|
|
1321
|
-
].includes(a.type)) {
|
|
1322
|
-
n += e || "";
|
|
1323
|
-
continue;
|
|
1324
|
-
}
|
|
1325
|
-
}
|
|
1326
|
-
let o = a;
|
|
1327
|
-
switch (o.type) {
|
|
1328
|
-
case "escape":
|
|
1329
|
-
n += t.text(o);
|
|
1330
|
-
break;
|
|
1331
|
-
case "html":
|
|
1332
|
-
n += t.html(o);
|
|
1333
|
-
break;
|
|
1334
|
-
case "link":
|
|
1335
|
-
n += t.link(o);
|
|
1336
|
-
break;
|
|
1337
|
-
case "image":
|
|
1338
|
-
n += t.image(o);
|
|
1339
|
-
break;
|
|
1340
|
-
case "strong":
|
|
1341
|
-
n += t.strong(o);
|
|
1342
|
-
break;
|
|
1343
|
-
case "em":
|
|
1344
|
-
n += t.em(o);
|
|
1345
|
-
break;
|
|
1346
|
-
case "codespan":
|
|
1347
|
-
n += t.codespan(o);
|
|
1348
|
-
break;
|
|
1349
|
-
case "br":
|
|
1350
|
-
n += t.br(o);
|
|
1351
|
-
break;
|
|
1352
|
-
case "del":
|
|
1353
|
-
n += t.del(o);
|
|
1354
|
-
break;
|
|
1355
|
-
case "text":
|
|
1356
|
-
n += t.text(o);
|
|
1357
|
-
break;
|
|
1358
|
-
default: {
|
|
1359
|
-
let e = "Token with \"" + o.type + "\" type was not found.";
|
|
1360
|
-
if (this.options.silent) return console.error(e), "";
|
|
1361
|
-
throw Error(e);
|
|
1362
|
-
}
|
|
1363
|
-
}
|
|
1364
|
-
}
|
|
1365
|
-
return n;
|
|
1366
|
-
}
|
|
1367
|
-
}, W = (_ = class {
|
|
1368
|
-
constructor(e) {
|
|
1369
|
-
t(this, "options", void 0), t(this, "block", void 0), this.options = e || y;
|
|
1370
|
-
}
|
|
1371
|
-
preprocess(e) {
|
|
1372
|
-
return e;
|
|
1373
|
-
}
|
|
1374
|
-
postprocess(e) {
|
|
1375
|
-
return e;
|
|
1376
|
-
}
|
|
1377
|
-
processAllTokens(e) {
|
|
1378
|
-
return e;
|
|
1379
|
-
}
|
|
1380
|
-
emStrongMask(e) {
|
|
1381
|
-
return e;
|
|
1382
|
-
}
|
|
1383
|
-
provideLexer() {
|
|
1384
|
-
return this.block ? B.lex : B.lexInline;
|
|
1385
|
-
}
|
|
1386
|
-
provideParser() {
|
|
1387
|
-
return this.block ? U.parse : U.parseInline;
|
|
1388
|
-
}
|
|
1389
|
-
}, t(_, "passThroughHooks", new Set([
|
|
1390
|
-
"preprocess",
|
|
1391
|
-
"postprocess",
|
|
1392
|
-
"processAllTokens",
|
|
1393
|
-
"emStrongMask"
|
|
1394
|
-
])), t(_, "passThroughHooksRespectAsync", new Set([
|
|
1395
|
-
"preprocess",
|
|
1396
|
-
"postprocess",
|
|
1397
|
-
"processAllTokens"
|
|
1398
|
-
])), _), G = new class {
|
|
1399
|
-
constructor(...e) {
|
|
1400
|
-
t(this, "defaults", v()), t(this, "options", this.setOptions), t(this, "parse", this.parseMarkdown(!0)), t(this, "parseInline", this.parseMarkdown(!1)), t(this, "Parser", U), t(this, "Renderer", V), t(this, "TextRenderer", H), t(this, "Lexer", B), t(this, "Tokenizer", z), t(this, "Hooks", W), this.use(...e);
|
|
1401
|
-
}
|
|
1402
|
-
walkTokens(e, t) {
|
|
1403
|
-
let n = [];
|
|
1404
|
-
for (let i of e) switch (n = n.concat(t.call(this, i)), i.type) {
|
|
1405
|
-
case "table": {
|
|
1406
|
-
let e = i;
|
|
1407
|
-
for (let r of e.header) n = n.concat(this.walkTokens(r.tokens, t));
|
|
1408
|
-
for (let r of e.rows) for (let e of r) n = n.concat(this.walkTokens(e.tokens, t));
|
|
1409
|
-
break;
|
|
1410
|
-
}
|
|
1411
|
-
case "list": {
|
|
1412
|
-
let e = i;
|
|
1413
|
-
n = n.concat(this.walkTokens(e.items, t));
|
|
1414
|
-
break;
|
|
1415
|
-
}
|
|
1416
|
-
default: {
|
|
1417
|
-
var r;
|
|
1418
|
-
let e = i;
|
|
1419
|
-
!((r = this.defaults.extensions) == null || (r = r.childTokens) == null) && r[e.type] ? this.defaults.extensions.childTokens[e.type].forEach((r) => {
|
|
1420
|
-
let i = e[r].flat(Infinity);
|
|
1421
|
-
n = n.concat(this.walkTokens(i, t));
|
|
1422
|
-
}) : e.tokens && (n = n.concat(this.walkTokens(e.tokens, t)));
|
|
1423
|
-
}
|
|
1424
|
-
}
|
|
1425
|
-
return n;
|
|
1426
|
-
}
|
|
1427
|
-
use(...e) {
|
|
1428
|
-
let t = this.defaults.extensions || {
|
|
1429
|
-
renderers: {},
|
|
1430
|
-
childTokens: {}
|
|
1431
|
-
};
|
|
1432
|
-
return e.forEach((e) => {
|
|
1433
|
-
let n = r({}, e);
|
|
1434
|
-
if (n.async = this.defaults.async || n.async || !1, e.extensions && (e.extensions.forEach((e) => {
|
|
1435
|
-
if (!e.name) throw Error("extension name required");
|
|
1436
|
-
if ("renderer" in e) {
|
|
1437
|
-
let n = t.renderers[e.name];
|
|
1438
|
-
n ? t.renderers[e.name] = function(...t) {
|
|
1439
|
-
let r = e.renderer.apply(this, t);
|
|
1440
|
-
return r === !1 && (r = n.apply(this, t)), r;
|
|
1441
|
-
} : t.renderers[e.name] = e.renderer;
|
|
1442
|
-
}
|
|
1443
|
-
if ("tokenizer" in e) {
|
|
1444
|
-
if (!e.level || e.level !== "block" && e.level !== "inline") throw Error("extension level must be 'block' or 'inline'");
|
|
1445
|
-
let n = t[e.level];
|
|
1446
|
-
n ? n.unshift(e.tokenizer) : t[e.level] = [e.tokenizer], e.start && (e.level === "block" ? t.startBlock ? t.startBlock.push(e.start) : t.startBlock = [e.start] : e.level === "inline" && (t.startInline ? t.startInline.push(e.start) : t.startInline = [e.start]));
|
|
1447
|
-
}
|
|
1448
|
-
"childTokens" in e && e.childTokens && (t.childTokens[e.name] = e.childTokens);
|
|
1449
|
-
}), n.extensions = t), e.renderer) {
|
|
1450
|
-
let t = this.defaults.renderer || new V(this.defaults);
|
|
1451
|
-
for (let n in e.renderer) {
|
|
1452
|
-
if (!(n in t)) throw Error(`renderer '${n}' does not exist`);
|
|
1453
|
-
if (["options", "parser"].includes(n)) continue;
|
|
1454
|
-
let r = n, i = e.renderer[r], a = t[r];
|
|
1455
|
-
t[r] = (...e) => {
|
|
1456
|
-
let n = i.apply(t, e);
|
|
1457
|
-
return n === !1 && (n = a.apply(t, e)), n || "";
|
|
1458
|
-
};
|
|
1459
|
-
}
|
|
1460
|
-
n.renderer = t;
|
|
1461
|
-
}
|
|
1462
|
-
if (e.tokenizer) {
|
|
1463
|
-
let t = this.defaults.tokenizer || new z(this.defaults);
|
|
1464
|
-
for (let n in e.tokenizer) {
|
|
1465
|
-
if (!(n in t)) throw Error(`tokenizer '${n}' does not exist`);
|
|
1466
|
-
if ([
|
|
1467
|
-
"options",
|
|
1468
|
-
"rules",
|
|
1469
|
-
"lexer"
|
|
1470
|
-
].includes(n)) continue;
|
|
1471
|
-
let r = n, i = e.tokenizer[r], a = t[r];
|
|
1472
|
-
t[r] = (...e) => {
|
|
1473
|
-
let n = i.apply(t, e);
|
|
1474
|
-
return n === !1 && (n = a.apply(t, e)), n;
|
|
1475
|
-
};
|
|
1476
|
-
}
|
|
1477
|
-
n.tokenizer = t;
|
|
1478
|
-
}
|
|
1479
|
-
if (e.hooks) {
|
|
1480
|
-
let t = this.defaults.hooks || new W();
|
|
1481
|
-
for (let n in e.hooks) {
|
|
1482
|
-
if (!(n in t)) throw Error(`hook '${n}' does not exist`);
|
|
1483
|
-
if (["options", "block"].includes(n)) continue;
|
|
1484
|
-
let r = n, i = e.hooks[r], a = t[r];
|
|
1485
|
-
W.passThroughHooks.has(n) ? t[r] = (e) => {
|
|
1486
|
-
if (this.defaults.async && W.passThroughHooksRespectAsync.has(n)) return Promise.resolve(i.call(t, e)).then((e) => a.call(t, e));
|
|
1487
|
-
let r = i.call(t, e);
|
|
1488
|
-
return a.call(t, r);
|
|
1489
|
-
} : t[r] = (...e) => {
|
|
1490
|
-
let n = i.apply(t, e);
|
|
1491
|
-
return n === !1 && (n = a.apply(t, e)), n;
|
|
1492
|
-
};
|
|
1493
|
-
}
|
|
1494
|
-
n.hooks = t;
|
|
1495
|
-
}
|
|
1496
|
-
if (e.walkTokens) {
|
|
1497
|
-
let t = this.defaults.walkTokens, r = e.walkTokens;
|
|
1498
|
-
n.walkTokens = function(e) {
|
|
1499
|
-
let n = [];
|
|
1500
|
-
return n.push(r.call(this, e)), t && (n = n.concat(t.call(this, e))), n;
|
|
1501
|
-
};
|
|
1502
|
-
}
|
|
1503
|
-
this.defaults = r(r({}, this.defaults), n);
|
|
1504
|
-
}), this;
|
|
1505
|
-
}
|
|
1506
|
-
setOptions(e) {
|
|
1507
|
-
return this.defaults = r(r({}, this.defaults), e), this;
|
|
1508
|
-
}
|
|
1509
|
-
lexer(e, t) {
|
|
1510
|
-
return B.lex(e, t == null ? this.defaults : t);
|
|
1511
|
-
}
|
|
1512
|
-
parser(e, t) {
|
|
1513
|
-
return U.parse(e, t == null ? this.defaults : t);
|
|
1514
|
-
}
|
|
1515
|
-
parseMarkdown(e) {
|
|
1516
|
-
return (t, n) => {
|
|
1517
|
-
let i = r({}, n), a = r(r({}, this.defaults), i), o = this.onError(!!a.silent, !!a.async);
|
|
1518
|
-
if (this.defaults.async === !0 && i.async === !1) return o(/* @__PURE__ */ Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));
|
|
1519
|
-
if (typeof t > "u" || t === null) return o(/* @__PURE__ */ Error("marked(): input parameter is undefined or null"));
|
|
1520
|
-
if (typeof t != "string") return o(/* @__PURE__ */ Error("marked(): input parameter is of type " + Object.prototype.toString.call(t) + ", string expected"));
|
|
1521
|
-
a.hooks && (a.hooks.options = a, a.hooks.block = e);
|
|
1522
|
-
let s = a.hooks ? a.hooks.provideLexer() : e ? B.lex : B.lexInline, c = a.hooks ? a.hooks.provideParser() : e ? U.parse : U.parseInline;
|
|
1523
|
-
if (a.async) return Promise.resolve(a.hooks ? a.hooks.preprocess(t) : t).then((e) => s(e, a)).then((e) => a.hooks ? a.hooks.processAllTokens(e) : e).then((e) => a.walkTokens ? Promise.all(this.walkTokens(e, a.walkTokens)).then(() => e) : e).then((e) => c(e, a)).then((e) => a.hooks ? a.hooks.postprocess(e) : e).catch(o);
|
|
1524
|
-
try {
|
|
1525
|
-
a.hooks && (t = a.hooks.preprocess(t));
|
|
1526
|
-
let e = s(t, a);
|
|
1527
|
-
a.hooks && (e = a.hooks.processAllTokens(e)), a.walkTokens && this.walkTokens(e, a.walkTokens);
|
|
1528
|
-
let n = c(e, a);
|
|
1529
|
-
return a.hooks && (n = a.hooks.postprocess(n)), n;
|
|
1530
|
-
} catch (e) {
|
|
1531
|
-
return o(e);
|
|
1532
|
-
}
|
|
1533
|
-
};
|
|
1534
|
-
}
|
|
1535
|
-
onError(e, t) {
|
|
1536
|
-
return (n) => {
|
|
1537
|
-
if (n.message += "\nPlease report this to https://github.com/markedjs/marked.", e) {
|
|
1538
|
-
let e = "<p>An error occurred:</p><pre>" + L(n.message + "", !0) + "</pre>";
|
|
1539
|
-
return t ? Promise.resolve(e) : e;
|
|
1540
|
-
}
|
|
1541
|
-
if (t) return Promise.reject(n);
|
|
1542
|
-
throw n;
|
|
1543
|
-
};
|
|
1544
|
-
}
|
|
1545
|
-
}();
|
|
1546
|
-
function K(e, t) {
|
|
1547
|
-
return G.parse(e, t);
|
|
1548
|
-
}
|
|
1549
|
-
K.options = K.setOptions = function(e) {
|
|
1550
|
-
return G.setOptions(e), K.defaults = G.defaults, we(K.defaults), K;
|
|
1551
|
-
}, K.getDefaults = v, K.defaults = y, K.use = function(...e) {
|
|
1552
|
-
return G.use(...e), K.defaults = G.defaults, we(K.defaults), K;
|
|
1553
|
-
}, K.walkTokens = function(e, t) {
|
|
1554
|
-
return G.walkTokens(e, t);
|
|
1555
|
-
}, K.parseInline = G.parseInline, K.Parser = U, K.parser = U.parse, K.Renderer = V, K.TextRenderer = H, K.Lexer = B, K.lexer = B.lex, K.Tokenizer = z, K.Hooks = W, K.parse = K, K.options, K.setOptions, K.use, K.walkTokens, K.parseInline, U.parse, B.lex;
|
|
1556
|
-
//#endregion
|
|
1557
|
-
//#region node_modules/.pnpm/ts-dedent@2.2.0/node_modules/ts-dedent/esm/index.js
|
|
1558
|
-
function yt(e) {
|
|
1559
|
-
var t = [...arguments].slice(1), n = Array.from(typeof e == "string" ? [e] : e);
|
|
1560
|
-
n[n.length - 1] = n[n.length - 1].replace(/\r?\n([\t ]*)$/, "");
|
|
1561
|
-
var r = n.reduce(function(e, t) {
|
|
1562
|
-
var n = t.match(/\n([\t ]+|(?!\s).)/g);
|
|
1563
|
-
return n ? e.concat(n.map(function(e) {
|
|
1564
|
-
var t, n;
|
|
1565
|
-
return (n = (t = e.match(/[\t ]/g)) == null ? void 0 : t.length) == null ? 0 : n;
|
|
1566
|
-
})) : e;
|
|
1567
|
-
}, []);
|
|
1568
|
-
if (r.length) {
|
|
1569
|
-
var i = RegExp("\n[ ]{" + Math.min.apply(Math, r) + "}", "g");
|
|
1570
|
-
n = n.map(function(e) {
|
|
1571
|
-
return e.replace(i, "\n");
|
|
1572
|
-
});
|
|
1573
|
-
}
|
|
1574
|
-
n[0] = n[0].replace(/^\r?\n/, "");
|
|
1575
|
-
var a = n[0];
|
|
1576
|
-
return t.forEach(function(e, t) {
|
|
1577
|
-
var r = a.match(/(?:^|\n)( *)$/), i = r ? r[1] : "", o = e;
|
|
1578
|
-
typeof e == "string" && e.includes("\n") && (o = String(e).split("\n").map(function(e, t) {
|
|
1579
|
-
return t === 0 ? e : "" + i + e;
|
|
1580
|
-
}).join("\n")), a += o + n[t + 1];
|
|
1581
|
-
}), a;
|
|
1582
|
-
}
|
|
1583
|
-
//#endregion
|
|
1584
|
-
//#region node_modules/.pnpm/mermaid@11.15.0/node_modules/mermaid/dist/chunks/mermaid.core/chunk-O5CBEL6O.mjs
|
|
1585
|
-
n();
|
|
1586
|
-
var bt = {
|
|
1587
|
-
body: "<g><rect width=\"80\" height=\"80\" style=\"fill: #087ebf; stroke-width: 0px;\"/><text transform=\"translate(21.16 64.67)\" style=\"fill: #fff; font-family: ArialMT, Arial; font-size: 67.75px;\"><tspan x=\"0\" y=\"0\">?</tspan></text></g>",
|
|
1588
|
-
height: 80,
|
|
1589
|
-
width: 80
|
|
1590
|
-
}, q = /* @__PURE__ */ new Map(), xt = /* @__PURE__ */ new Map(), St = /* @__PURE__ */ o((e) => {
|
|
1591
|
-
for (let t of e) {
|
|
1592
|
-
if (!t.name) throw Error("Invalid icon loader. Must have a \"name\" property with non-empty string value.");
|
|
1593
|
-
if (s.debug("Registering icon pack:", t.name), "loader" in t) xt.set(t.name, t.loader);
|
|
1594
|
-
else if ("icons" in t) q.set(t.name, t.icons);
|
|
1595
|
-
else throw s.error("Invalid icon loader:", t), Error("Invalid icon loader. Must have either \"icons\" or \"loader\" property.");
|
|
1596
|
-
}
|
|
1597
|
-
}, "registerIconPacks"), Ct = /* @__PURE__ */ o(function() {
|
|
1598
|
-
var e = a(function* (e, t) {
|
|
1599
|
-
let n = ie(e, !0, t !== void 0);
|
|
1600
|
-
if (!n) throw Error(`Invalid icon name: ${e}`);
|
|
1601
|
-
let i = n.prefix || t;
|
|
1602
|
-
if (!i) throw Error(`Icon name must contain a prefix: ${e}`);
|
|
1603
|
-
let a = q.get(i);
|
|
1604
|
-
if (!a) {
|
|
1605
|
-
let e = xt.get(i);
|
|
1606
|
-
if (!e) throw Error(`Icon set not found: ${n.prefix}`);
|
|
1607
|
-
try {
|
|
1608
|
-
a = r(r({}, yield e()), {}, { prefix: i }), q.set(i, a);
|
|
1609
|
-
} catch (e) {
|
|
1610
|
-
throw s.error(e), Error(`Failed to load icon set: ${n.prefix}`);
|
|
1611
|
-
}
|
|
1612
|
-
}
|
|
1613
|
-
let o = ue(a, n.name);
|
|
1614
|
-
if (!o) throw Error(`Icon not found: ${e}`);
|
|
1615
|
-
return o;
|
|
1616
|
-
});
|
|
1617
|
-
return function(t, n) {
|
|
1618
|
-
return e.apply(this, arguments);
|
|
1619
|
-
};
|
|
1620
|
-
}(), "getRegisteredIconData"), wt = /* @__PURE__ */ o(function() {
|
|
1621
|
-
var e = a(function* (e) {
|
|
1622
|
-
try {
|
|
1623
|
-
return yield Ct(e), !0;
|
|
1624
|
-
} catch (e) {
|
|
1625
|
-
return !1;
|
|
1626
|
-
}
|
|
1627
|
-
});
|
|
1628
|
-
return function(t) {
|
|
1629
|
-
return e.apply(this, arguments);
|
|
1630
|
-
};
|
|
1631
|
-
}(), "isIconAvailable"), Tt = /* @__PURE__ */ o(function() {
|
|
1632
|
-
var e = a(function* (e, t, n) {
|
|
1633
|
-
let i;
|
|
1634
|
-
try {
|
|
1635
|
-
i = yield Ct(e, t == null ? void 0 : t.fallbackPrefix);
|
|
1636
|
-
} catch (e) {
|
|
1637
|
-
s.error(e), i = bt;
|
|
1638
|
-
}
|
|
1639
|
-
let a = ve(i, t);
|
|
1640
|
-
return f(Ce(Se(a.body), r(r({}, a.attributes), n)), u());
|
|
1641
|
-
});
|
|
1642
|
-
return function(t, n, r) {
|
|
1643
|
-
return e.apply(this, arguments);
|
|
1644
|
-
};
|
|
1645
|
-
}(), "getIconSVG");
|
|
1646
|
-
function Et(e, { markdownAutoWrap: t }) {
|
|
1647
|
-
return yt(e.replace(/<br\/>/g, "\n").replace(/\n{2,}/g, "\n"));
|
|
1648
|
-
}
|
|
1649
|
-
o(Et, "preprocessMarkdown");
|
|
1650
|
-
function Dt(e) {
|
|
1651
|
-
return e.split(/\\n|\n|<br\s*\/?>/gi).map((e) => {
|
|
1652
|
-
var t, n;
|
|
1653
|
-
return (t = (n = e.trim().match(/<[^>]+>|[^\s<>]+/g)) == null ? void 0 : n.map((e) => ({
|
|
1654
|
-
content: e,
|
|
1655
|
-
type: "normal"
|
|
1656
|
-
}))) == null ? [] : t;
|
|
1657
|
-
});
|
|
1658
|
-
}
|
|
1659
|
-
o(Dt, "nonMarkdownToLines");
|
|
1660
|
-
function Ot(e, t = {}) {
|
|
1661
|
-
let n = Et(e, t), r = K.lexer(n), i = [[]], a = 0;
|
|
1662
|
-
function s(e, t = "normal") {
|
|
1663
|
-
e.type === "text" ? e.text.split("\n").forEach((e, n) => {
|
|
1664
|
-
n !== 0 && (a++, i.push([])), e.split(" ").forEach((e) => {
|
|
1665
|
-
e = e.replace(/'/g, "'"), e && i[a].push({
|
|
1666
|
-
content: e,
|
|
1667
|
-
type: t
|
|
1668
|
-
});
|
|
1669
|
-
});
|
|
1670
|
-
}) : e.type === "strong" || e.type === "em" ? e.tokens.forEach((t) => {
|
|
1671
|
-
s(t, e.type);
|
|
1672
|
-
}) : e.type === "html" && i[a].push({
|
|
1673
|
-
content: e.text,
|
|
1674
|
-
type: "normal"
|
|
1675
|
-
});
|
|
1676
|
-
}
|
|
1677
|
-
return o(s, "processNode"), r.forEach((e) => {
|
|
1678
|
-
if (e.type === "paragraph") {
|
|
1679
|
-
var t;
|
|
1680
|
-
(t = e.tokens) == null || t.forEach((e) => {
|
|
1681
|
-
s(e);
|
|
1682
|
-
});
|
|
1683
|
-
} else e.type === "html" ? i[a].push({
|
|
1684
|
-
content: e.text,
|
|
1685
|
-
type: "normal"
|
|
1686
|
-
}) : i[a].push({
|
|
1687
|
-
content: e.raw,
|
|
1688
|
-
type: "normal"
|
|
1689
|
-
});
|
|
1690
|
-
}), i;
|
|
1691
|
-
}
|
|
1692
|
-
o(Ot, "markdownToLines");
|
|
1693
|
-
function kt(e) {
|
|
1694
|
-
return e ? `<p>${e.replace(/\\n|\n/g, "<br />")}</p>` : "";
|
|
1695
|
-
}
|
|
1696
|
-
o(kt, "nonMarkdownToHTML");
|
|
1697
|
-
function At(e, { markdownAutoWrap: t } = {}) {
|
|
1698
|
-
let n = K.lexer(e);
|
|
1699
|
-
function r(e) {
|
|
1700
|
-
if (e.type === "text") return t === !1 ? e.text.replace(/\n */g, "<br/>").replace(/ /g, " ") : e.text.replace(/\n */g, "<br/>");
|
|
1701
|
-
if (e.type === "strong") {
|
|
1702
|
-
var n;
|
|
1703
|
-
return `<strong>${(n = e.tokens) == null ? void 0 : n.map(r).join("")}</strong>`;
|
|
1704
|
-
} else if (e.type === "em") {
|
|
1705
|
-
var i;
|
|
1706
|
-
return `<em>${(i = e.tokens) == null ? void 0 : i.map(r).join("")}</em>`;
|
|
1707
|
-
} else if (e.type === "paragraph") {
|
|
1708
|
-
var a;
|
|
1709
|
-
return `<p>${(a = e.tokens) == null ? void 0 : a.map(r).join("")}</p>`;
|
|
1710
|
-
} else if (e.type === "space") return "";
|
|
1711
|
-
else if (e.type === "html") return `${e.text}`;
|
|
1712
|
-
else if (e.type === "escape") return e.text;
|
|
1713
|
-
return s.warn(`Unsupported markdown: ${e.type}`), e.raw;
|
|
1714
|
-
}
|
|
1715
|
-
return o(r, "output"), n.map(r).join("");
|
|
1716
|
-
}
|
|
1717
|
-
o(At, "markdownToHTML");
|
|
1718
|
-
function jt(e) {
|
|
1719
|
-
return Intl.Segmenter ? [...new Intl.Segmenter().segment(e)].map((e) => e.segment) : [...e];
|
|
1720
|
-
}
|
|
1721
|
-
o(jt, "splitTextToChars");
|
|
1722
|
-
function Mt(e, t) {
|
|
1723
|
-
return J(e, [], jt(t.content), t.type);
|
|
1724
|
-
}
|
|
1725
|
-
o(Mt, "splitWordToFitWidth");
|
|
1726
|
-
function J(e, t, n, r) {
|
|
1727
|
-
if (n.length === 0) return [{
|
|
1728
|
-
content: t.join(""),
|
|
1729
|
-
type: r
|
|
1730
|
-
}, {
|
|
1731
|
-
content: "",
|
|
1732
|
-
type: r
|
|
1733
|
-
}];
|
|
1734
|
-
let [i, ...a] = n, o = [...t, i];
|
|
1735
|
-
return e([{
|
|
1736
|
-
content: o.join(""),
|
|
1737
|
-
type: r
|
|
1738
|
-
}]) ? J(e, o, a, r) : (t.length === 0 && i && (t.push(i), n.shift()), [{
|
|
1739
|
-
content: t.join(""),
|
|
1740
|
-
type: r
|
|
1741
|
-
}, {
|
|
1742
|
-
content: n.join(""),
|
|
1743
|
-
type: r
|
|
1744
|
-
}]);
|
|
1745
|
-
}
|
|
1746
|
-
o(J, "splitWordToFitWidthRecursion");
|
|
1747
|
-
function Nt(e, t) {
|
|
1748
|
-
if (e.some(({ content: e }) => e.includes("\n"))) throw Error("splitLineToFitWidth does not support newlines in the line");
|
|
1749
|
-
return Y(e, t);
|
|
1750
|
-
}
|
|
1751
|
-
o(Nt, "splitLineToFitWidth");
|
|
1752
|
-
function Y(e, t, n = [], r = []) {
|
|
1753
|
-
var i;
|
|
1754
|
-
if (e.length === 0) return r.length > 0 && n.push(r), n.length > 0 ? n : [];
|
|
1755
|
-
let a = "";
|
|
1756
|
-
e[0].content === " " && (a = " ", e.shift());
|
|
1757
|
-
let o = (i = e.shift()) == null ? {
|
|
1758
|
-
content: " ",
|
|
1759
|
-
type: "normal"
|
|
1760
|
-
} : i, s = [...r];
|
|
1761
|
-
if (a !== "" && s.push({
|
|
1762
|
-
content: a,
|
|
1763
|
-
type: "normal"
|
|
1764
|
-
}), s.push(o), t(s)) return Y(e, t, n, s);
|
|
1765
|
-
if (r.length > 0) n.push(r), e.unshift(o);
|
|
1766
|
-
else if (o.content) {
|
|
1767
|
-
let [r, i] = Mt(t, o);
|
|
1768
|
-
n.push([r]), i.content && e.unshift(i);
|
|
1769
|
-
}
|
|
1770
|
-
return Y(e, t, n);
|
|
1771
|
-
}
|
|
1772
|
-
o(Y, "splitLineToFitWidthRecursion");
|
|
1773
|
-
function X(e, t) {
|
|
1774
|
-
t && e.attr("style", t);
|
|
1775
|
-
}
|
|
1776
|
-
o(X, "applyStyle");
|
|
1777
|
-
var Pt = 16384;
|
|
1778
|
-
function Ft(e, t, n, r) {
|
|
1779
|
-
return Z.apply(this, arguments);
|
|
1780
|
-
}
|
|
1781
|
-
function Z() {
|
|
1782
|
-
return Z = a(function* (e, t, n, r, i = !1, a = u()) {
|
|
1783
|
-
let o = e.append("foreignObject");
|
|
1784
|
-
o.attr("width", `${Math.min(10 * n, Pt)}px`), o.attr("height", `${Math.min(10 * n, Pt)}px`);
|
|
1785
|
-
let s = o.append("xhtml:div"), p = c(t.label) ? yield l(t.label.replace(d.lineBreakRegex, "\n"), a) : f(t.label, a), m = t.isNode ? "nodeLabel" : "edgeLabel", h = s.append("span");
|
|
1786
|
-
h.html(p), X(h, t.labelStyle), h.attr("class", `${m} ${r}`), X(s, t.labelStyle), s.style("display", "table-cell"), s.style("white-space", "nowrap"), s.style("line-height", "1.5"), n !== Infinity && (s.style("max-width", n + "px"), s.style("text-align", "center")), s.attr("xmlns", "http://www.w3.org/1999/xhtml"), i && s.attr("class", "labelBkg");
|
|
1787
|
-
let g = s.node().getBoundingClientRect();
|
|
1788
|
-
return g.width === n && (s.style("display", "table"), s.style("white-space", "break-spaces"), s.style("width", n + "px"), g = s.node().getBoundingClientRect()), o.node();
|
|
1789
|
-
}), Z.apply(this, arguments);
|
|
1790
|
-
}
|
|
1791
|
-
o(Ft, "addHtmlSpan");
|
|
1792
|
-
function Q(e, t, n, r = !1) {
|
|
1793
|
-
let i = e.append("tspan").attr("class", "text-outer-tspan").attr("x", 0).attr("y", t * n - .1 + "em").attr("dy", n + "em");
|
|
1794
|
-
return r && i.attr("text-anchor", "middle"), i;
|
|
1795
|
-
}
|
|
1796
|
-
o(Q, "createTspan");
|
|
1797
|
-
function It(e, t, n) {
|
|
1798
|
-
let r = e.append("text"), i = Q(r, 1, t);
|
|
1799
|
-
$(i, n);
|
|
1800
|
-
let a = i.node().getComputedTextLength();
|
|
1801
|
-
return r.remove(), a;
|
|
1802
|
-
}
|
|
1803
|
-
o(It, "computeWidthOfText");
|
|
1804
|
-
function Lt(e, t, n) {
|
|
1805
|
-
var r;
|
|
1806
|
-
let i = e.append("text"), a = Q(i, 1, t);
|
|
1807
|
-
$(a, [{
|
|
1808
|
-
content: n,
|
|
1809
|
-
type: "normal"
|
|
1810
|
-
}]);
|
|
1811
|
-
let o = (r = a.node()) == null ? void 0 : r.getBoundingClientRect();
|
|
1812
|
-
return o && i.remove(), o;
|
|
1813
|
-
}
|
|
1814
|
-
o(Lt, "computeDimensionOfText");
|
|
1815
|
-
function Rt(e, t, n, r = !1, i = !1) {
|
|
1816
|
-
let a = 1.1, s = t.append("g"), c = s.insert("rect").attr("class", "background").attr("style", "stroke: none"), l = s.append("text").attr("y", "-10.1");
|
|
1817
|
-
i && l.attr("text-anchor", "middle");
|
|
1818
|
-
let u = 0;
|
|
1819
|
-
for (let t of n) {
|
|
1820
|
-
let n = /* @__PURE__ */ o((t) => It(s, a, t) <= e, "checkWidth"), r = n(t) ? [t] : Nt(t, n);
|
|
1821
|
-
for (let e of r) $(Q(l, u, a, i), e), u++;
|
|
1822
|
-
}
|
|
1823
|
-
if (r) {
|
|
1824
|
-
let e = l.node().getBBox();
|
|
1825
|
-
return c.attr("x", e.x - 2).attr("y", e.y - 2).attr("width", e.width + 4).attr("height", e.height + 4), s.node();
|
|
1826
|
-
} else return l.node();
|
|
1827
|
-
}
|
|
1828
|
-
o(Rt, "createFormattedText");
|
|
1829
|
-
function zt(e) {
|
|
1830
|
-
return e.replace(/&(amp|lt|gt);/g, (e, t) => {
|
|
1831
|
-
switch (t) {
|
|
1832
|
-
case "amp": return "&";
|
|
1833
|
-
case "lt": return "<";
|
|
1834
|
-
case "gt": return ">";
|
|
1835
|
-
default: return e;
|
|
1836
|
-
}
|
|
1837
|
-
});
|
|
1838
|
-
}
|
|
1839
|
-
o(zt, "decodeHTMLEntities");
|
|
1840
|
-
function $(e, t) {
|
|
1841
|
-
e.text(""), t.forEach((t, n) => {
|
|
1842
|
-
let r = e.append("tspan").attr("font-style", t.type === "em" ? "italic" : "normal").attr("class", "text-inner-tspan").attr("font-weight", t.type === "strong" ? "bold" : "normal");
|
|
1843
|
-
n === 0 ? r.text(zt(t.content)) : r.text(" " + zt(t.content));
|
|
1844
|
-
});
|
|
1845
|
-
}
|
|
1846
|
-
o($, "updateTextContentAndStyles");
|
|
1847
|
-
function Bt(e) {
|
|
1848
|
-
return Vt.apply(this, arguments);
|
|
1849
|
-
}
|
|
1850
|
-
function Vt() {
|
|
1851
|
-
return Vt = a(function* (e, t = {}) {
|
|
1852
|
-
let n = [];
|
|
1853
|
-
e.replace(/(fa[bklrs]?):fa-([\w-]+)/g, (e, r, i) => (n.push(a(function* () {
|
|
1854
|
-
let n = `${r}:${i}`;
|
|
1855
|
-
return (yield wt(n)) ? yield Tt(n, void 0, { class: "label-icon" }) : `<i class='${f(e, t).replace(":", " ")}'></i>`;
|
|
1856
|
-
})()), e));
|
|
1857
|
-
let r = yield Promise.all(n);
|
|
1858
|
-
return e.replace(/(fa[bklrs]?):fa-([\w-]+)/g, () => {
|
|
1859
|
-
var e;
|
|
1860
|
-
return (e = r.shift()) == null ? "" : e;
|
|
1861
|
-
});
|
|
1862
|
-
}), Vt.apply(this, arguments);
|
|
1863
|
-
}
|
|
1864
|
-
o(Bt, "replaceIconSubstring");
|
|
1865
|
-
var Ht = /* @__PURE__ */ o(function() {
|
|
1866
|
-
var e = a(function* (e, t = "", { style: n = "", isTitle: r = !1, classes: i = "", useHtmlLabels: a = !0, markdown: o = !0, isNode: l = !0, width: u = 200, addSvgBackground: d = !1 } = {}, f) {
|
|
1867
|
-
if (s.debug("XYZ createText", t, n, r, i, a, l, "addSvgBackground: ", d), a) {
|
|
1868
|
-
let r = yield Bt(m(o ? At(t, f) : kt(t)), f), a = t.replace(/\\\\/g, "\\");
|
|
1869
|
-
return yield Ft(e, {
|
|
1870
|
-
isNode: l,
|
|
1871
|
-
label: c(t) ? a : r,
|
|
1872
|
-
labelStyle: n.replace("fill:", "color:")
|
|
1873
|
-
}, u, i, d, f);
|
|
1874
|
-
} else {
|
|
1875
|
-
let i = m(t.replace(/<br\s*\/?>/g, "<br/>")), a = Rt(u, e, o ? Ot(i.replace("<br>", "<br/>"), f) : Dt(i), t ? d : !1, !l);
|
|
1876
|
-
if (l) {
|
|
1877
|
-
/stroke:/.exec(n) && (n = n.replace("stroke:", "lineColor:"));
|
|
1878
|
-
let e = n.replace(/stroke:[^;]+;?/g, "").replace(/stroke-width:[^;]+;?/g, "").replace(/fill:[^;]+;?/g, "").replace(/color:/g, "fill:");
|
|
1879
|
-
p(a).attr("style", e);
|
|
1880
|
-
} else {
|
|
1881
|
-
let e = n.replace(/stroke:[^;]+;?/g, "").replace(/stroke-width:[^;]+;?/g, "").replace(/fill:[^;]+;?/g, "").replace(/background:/g, "fill:");
|
|
1882
|
-
p(a).select("rect").attr("style", e.replace(/background:/g, "fill:"));
|
|
1883
|
-
let t = n.replace(/stroke:[^;]+;?/g, "").replace(/stroke-width:[^;]+;?/g, "").replace(/fill:[^;]+;?/g, "").replace(/color:/g, "fill:");
|
|
1884
|
-
p(a).select("text").attr("style", t);
|
|
1885
|
-
}
|
|
1886
|
-
return r ? p(a).selectAll("tspan.text-outer-tspan").classed("title-row", !0) : p(a).selectAll("tspan.text-outer-tspan").classed("row", !0), a;
|
|
1887
|
-
}
|
|
1888
|
-
});
|
|
1889
|
-
return function(t) {
|
|
1890
|
-
return e.apply(this, arguments);
|
|
1891
|
-
};
|
|
1892
|
-
}(), "createText");
|
|
1893
|
-
//#endregion
|
|
1894
|
-
export { bt as a, St as i, Ht as n, yt as o, Tt as r, Lt as t };
|