@nxgt/material 1.12.3 → 1.16.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.
Files changed (151) hide show
  1. package/README.md +5 -1
  2. package/dist/abnfDiagram-O67JEVCF-mm89LXw2.js +89 -0
  3. package/dist/architecture-7GRP2DOG-DDr0RGVC.js +3 -0
  4. package/dist/architectureDiagram-NJMV4G6O-CGoA5SIv.js +4146 -0
  5. package/dist/array-CApNbSU9.js +6 -0
  6. package/dist/blockDiagram-BEXU5L5S-Dq8gitB4.js +1946 -0
  7. package/dist/c4Diagram-YGBWAQC7-DO_alqIu.js +2990 -0
  8. package/dist/channel-1fT-W0NS.js +5 -0
  9. package/dist/chunk-2Q5K7J3B-kzxEEeTu.js +15 -0
  10. package/dist/chunk-3FUC2YCW-C3yD2fMw.js +364 -0
  11. package/dist/chunk-5DYCD2WN-Dn2jrYde.js +37 -0
  12. package/dist/chunk-5VM5RSS4-Cr17nBXp.js +5 -0
  13. package/dist/chunk-6AEJRKK7-JyfUnUEu.js +10 -0
  14. package/dist/chunk-742MDFTN-BbWkrtj2.js +275 -0
  15. package/dist/chunk-7INBJB4K-C3x7JNTG.js +4487 -0
  16. package/dist/chunk-7M6MHVWA-Cc7UTu4b.js +4256 -0
  17. package/dist/chunk-7PRAP22T-C8rsGRvH.js +67 -0
  18. package/dist/chunk-DUW6YSOI-BdOla2G8.js +10 -0
  19. package/dist/chunk-FOHPRMQF-Crq0JMf2.js +21388 -0
  20. package/dist/chunk-GNY47TPC-d-Bi8r0p.js +75 -0
  21. package/dist/chunk-GTNCS2PH-CTS015lZ.js +490 -0
  22. package/dist/chunk-GWA4HPMP-B4pgM-E1.js +61 -0
  23. package/dist/chunk-J5ZVWO5B-CYzz6Pq8.js +12 -0
  24. package/dist/chunk-JWPE2WC7-Ccb0QaC8.js +8 -0
  25. package/dist/chunk-LNGE3PJU-CiGrDO_F.js +1513 -0
  26. package/dist/chunk-MBY4JIJT-Dg6AeftH.js +1847 -0
  27. package/dist/chunk-NETBCI7D-TXZM0vKz.js +236 -0
  28. package/dist/chunk-O7XYJQB3-md6vjVm4.js +3922 -0
  29. package/dist/chunk-UA2S7LBM-DQTYPe9y.js +363 -0
  30. package/dist/chunk-WEXAMYUT-DmKWJz6y.js +26 -0
  31. package/dist/chunk-XXDRQBXY-C9XIYQdM.js +9 -0
  32. package/dist/chunk-Y2CYZVJY-i11wjrBe.js +12 -0
  33. package/dist/chunk-Z7XXMR3K-BoDf6lxl.js +677 -0
  34. package/dist/chunk-ZIGJFQKS-CP5430fN.js +663 -0
  35. package/dist/classDiagram-v2-NBCMYWYE-6KoTmufe.js +3397 -0
  36. package/dist/components.js +3 -3
  37. package/dist/cose-bilkent-JH36ORCC-CejnZl_t.js +2251 -0
  38. package/dist/cynefin-OW5HDTMX-B8HVdZhp.js +3 -0
  39. package/dist/cynefinDiagram-VND7K2PF-DZnc0dlm.js +349 -0
  40. package/dist/cytoscape.esm-_jXi1N4y.js +18151 -0
  41. package/dist/dagre-6A5THRUB-cuS57NO5.js +2192 -0
  42. package/dist/diagram-22UHCM2B-zQSFmH0t.js +5084 -0
  43. package/dist/diagram-3UASUU5V-D45Fgu1j.js +724 -0
  44. package/dist/diagram-ATOU4E4O-YMtQnlqd.js +432 -0
  45. package/dist/diagram-CDSNMT55-DP7UmEW1.js +301 -0
  46. package/dist/diagram-MLGK6HIB-WvSqrTRC.js +134 -0
  47. package/dist/diagram-MPIPVDR6-C2F3__mt.js +214 -0
  48. package/dist/dist-1DdJvBEt.js +50 -0
  49. package/dist/{dist-DGsPFADz.js → dist-DppLdkXt.js} +2 -2
  50. package/dist/dnd.js +2 -2
  51. package/dist/ebnfDiagram-ZINNZB2B-BZC6cSiy.js +100 -0
  52. package/dist/elk-276RUBZZ-7DJf1MEV.js +47598 -0
  53. package/dist/erDiagram-OPXOYQCR-YKlEVEF0.js +1970 -0
  54. package/dist/eventmodeling-NTZA5JFV-C1CEo-26.js +3 -0
  55. package/dist/flowDiagram-KWPJA3E3-DyLvzIlg.js +17 -0
  56. package/dist/ganttDiagram-FUAMR5RP-KIaOrYOF.js +2928 -0
  57. package/dist/gitGraph-4MIJSDKK-BTeCS_5q.js +3 -0
  58. package/dist/gitGraphDiagram-X574FWY7-DpFW-7JE.js +729 -0
  59. package/dist/graphlib-DFaO_iIU.js +372 -0
  60. package/dist/{hooks-BjSuqEof.js → hooks-C5xy0u03.js} +1 -1
  61. package/dist/hooks.js +1 -1
  62. package/dist/{i18n-DmVqVJXj.js → i18n-Cech9IAc.js} +328 -843
  63. package/dist/i18n.js +1 -1
  64. package/dist/info-A6RAGUB7-BvtuPd9C.js +3 -0
  65. package/dist/infoDiagram-VRGFBTTK-H3F-BCnu.js +20 -0
  66. package/dist/init-Buj1GKRa.js +27 -0
  67. package/dist/isArrayLikeObject-VG1KOJ3m.js +539 -0
  68. package/dist/ishikawaDiagram-OU5B5YK6-DgQDmcF3.js +719 -0
  69. package/dist/journeyDiagram-ZHPQQLJL-CanDOlfn.js +884 -0
  70. package/dist/kanban-definition-PNTS6WVX-DmnUgxgb.js +976 -0
  71. package/dist/katex-BMQ6LGsM.js +21962 -0
  72. package/dist/lib/components/index.d.ts +4 -0
  73. package/dist/lib/components/ui/action-card.d.ts +1 -1
  74. package/dist/lib/components/ui/chat/chat-composer-mentions.d.ts +8 -0
  75. package/dist/lib/components/ui/chat/chat-composer.d.ts +5 -1
  76. package/dist/lib/components/ui/chat/chat-markdown.d.ts +2 -2
  77. package/dist/lib/components/ui/emoji/emoji-list.d.ts +5 -0
  78. package/dist/lib/components/ui/emoji/emoji-picker.d.ts +7 -0
  79. package/dist/lib/components/ui/emoji/emoji.utils.d.ts +2 -0
  80. package/dist/lib/components/ui/emoji/emoji.utils.test.d.ts +1 -0
  81. package/dist/lib/components/ui/emoji/index.d.ts +4 -0
  82. package/dist/lib/components/ui/emoji/types.d.ts +6 -0
  83. package/dist/lib/components/ui/entity-header.stories.d.ts +1 -0
  84. package/dist/lib/components/ui/kanban/kanban.stories.d.ts +1 -0
  85. package/dist/lib/components/ui/markdown/index.d.ts +3 -0
  86. package/dist/lib/components/ui/markdown/markdown.d.ts +7 -0
  87. package/dist/lib/components/ui/markdown/markdown.stories.d.ts +14 -0
  88. package/dist/lib/components/ui/markdown/markdown.test.d.ts +1 -0
  89. package/dist/lib/components/ui/markdown/markdown.utils.d.ts +1 -0
  90. package/dist/lib/components/ui/markdown/mermaid.lazy.d.ts +12 -0
  91. package/dist/lib/components/ui/markdown/partials/markdown-code.d.ts +2 -0
  92. package/dist/lib/components/ui/markdown/partials/mermaid-diagram.d.ts +4 -0
  93. package/dist/lib/components/ui/mentions/index.d.ts +3 -0
  94. package/dist/lib/components/ui/mentions/mention-list.d.ts +8 -0
  95. package/dist/lib/components/ui/mentions/mentions.utils.d.ts +7 -0
  96. package/dist/lib/components/ui/mentions/mentions.utils.test.d.ts +1 -0
  97. package/dist/lib/components/ui/mentions/types.d.ts +7 -0
  98. package/dist/lib/components/ui/rich-text-editor/extensions/mention/mention-list.d.ts +12 -1
  99. package/dist/lib/components/ui/terminal/index.d.ts +2 -0
  100. package/dist/lib/components/ui/terminal/terminal.d.ts +11 -0
  101. package/dist/lib/components/ui/terminal/terminal.stories.d.ts +14 -0
  102. package/dist/lib/components/ui/terminal/terminal.utils.d.ts +5 -0
  103. package/dist/lib/components/ui/terminal/terminal.utils.test.d.ts +1 -0
  104. package/dist/lib/i18n/resources/en/index.d.ts +13 -0
  105. package/dist/lib/i18n/resources/en/material.json.d.ts +14 -1
  106. package/dist/lib/i18n/resources/fr/index.d.ts +13 -0
  107. package/dist/lib/i18n/resources/fr/material.json.d.ts +14 -1
  108. package/dist/lib/i18n/resources/index.d.ts +26 -0
  109. package/dist/lib/i18n/translator.d.ts +1 -1
  110. package/dist/{lib-B1KXma-r.js → lib-Bbw5QPoj.js} +472 -471
  111. package/dist/lib.js +2 -2
  112. package/dist/{main-Cw-Yaqo9.js → main-BjDU9FDM.js} +58614 -29566
  113. package/dist/main.js +6 -6
  114. package/dist/material.css +1 -1
  115. package/dist/math-C5EhTgJw.js +10 -0
  116. package/dist/mermaid-parser.core-Cz-MfB4Z.js +638 -0
  117. package/dist/mermaid.core-BI1sunfX.js +1096 -0
  118. package/dist/mindmap-definition-NLK3R4M7-DW0BIU_q.js +1008 -0
  119. package/dist/ordinal-DuP05kVQ.js +65 -0
  120. package/dist/packet-AYTQ26CC-CshIswP8.js +3 -0
  121. package/dist/path-Cjou0lUh.js +85 -0
  122. package/dist/pegDiagram-GJSIUBJH-CJIx0u4M.js +94 -0
  123. package/dist/pie-WAS4IAKB-CYs22y4X.js +3 -0
  124. package/dist/pieDiagram-5QR66LMP-zAhv5fKz.js +157 -0
  125. package/dist/quadrantDiagram-O4NWA36T-CO4n_yQo.js +2001 -0
  126. package/dist/radar-RG4KPBEZ-BOJKjbGv.js +3 -0
  127. package/dist/railroad-74A4TZTK-Dt1BmUkI.js +3 -0
  128. package/dist/railroad-abnf-HS5TGJTU-Cs9GMUMY.js +3 -0
  129. package/dist/railroad-ebnf-LZEXJU2U-D4y0fXoW.js +3 -0
  130. package/dist/railroad-peg-WCYAUIDC-D2f_ZNR5.js +3 -0
  131. package/dist/railroadDiagram-XR7U4H2S-B8iV7mfe.js +76 -0
  132. package/dist/requirementDiagram-PLB6GJNP-CGoX1NrW.js +2228 -0
  133. package/dist/rough.esm-rcMoXTJj.js +1352 -0
  134. package/dist/sankeyDiagram-IPEJSGJF-DdSM2wiI.js +962 -0
  135. package/dist/sequenceDiagram-PO4LG4MO-CCRqF5XO.js +4200 -0
  136. package/dist/sizeCapture-INFHLROL-CHXIsPO_.js +46 -0
  137. package/dist/src-B4npqWNl.js +1775 -0
  138. package/dist/stateDiagram-v2-GCMORJYK-CQTX5ks8.js +2143 -0
  139. package/dist/step-B6KjpKgN.js +706 -0
  140. package/dist/string-B-ZWXCs2.js +392 -0
  141. package/dist/swimlanes-2SLR337P-C2NNOb5n.js +4763 -0
  142. package/dist/swimlanesDiagram-TC7HE7FX-CPsqPrbP.js +28 -0
  143. package/dist/timeline-definition-EJHVYXUP-DuxGHv-N.js +1073 -0
  144. package/dist/treeView-Q6P3EWNA-BrJylG9N.js +3 -0
  145. package/dist/treemap-WGGIJYW6-DpIZuqbj.js +3 -0
  146. package/dist/usecaseDiagram-POWQR4AR-cuAeIBW3.js +9932 -0
  147. package/dist/vennDiagram-UO4OBE2U-DLwBSAnC.js +1880 -0
  148. package/dist/wardley-WFR3VGLG-CbwdAAbH.js +3 -0
  149. package/dist/wardleyDiagram-VNRHLVJA-D7IZU6vu.js +645 -0
  150. package/dist/xychartDiagram-PMCCYNJV-BDOFv_xK.js +2167 -0
  151. package/package.json +7 -1
@@ -0,0 +1,1847 @@
1
+ import { n as e, t } from "./src-B4npqWNl.js";
2
+ import { a as n } from "./chunk-ZIGJFQKS-CP5430fN.js";
3
+ import { n as r } from "./chunk-Y2CYZVJY-i11wjrBe.js";
4
+ import { A as i, F as a, b as o, s, z as c } from "./chunk-O7XYJQB3-md6vjVm4.js";
5
+ import { n as l, t as u } from "./chunk-742MDFTN-BbWkrtj2.js";
6
+ //#region node_modules/marked/lib/marked.esm.js
7
+ function d() {
8
+ return {
9
+ async: !1,
10
+ breaks: !1,
11
+ extensions: null,
12
+ gfm: !0,
13
+ hooks: null,
14
+ pedantic: !1,
15
+ renderer: null,
16
+ silent: !1,
17
+ tokenizer: null,
18
+ walkTokens: null
19
+ };
20
+ }
21
+ var f = d();
22
+ function p(e) {
23
+ f = e;
24
+ }
25
+ var m = { exec: () => null };
26
+ function h(e, t = "") {
27
+ let n = typeof e == "string" ? e : e.source, r = {
28
+ replace: (e, t) => {
29
+ let i = typeof t == "string" ? t : t.source;
30
+ return i = i.replace(_.caret, "$1"), n = n.replace(e, i), r;
31
+ },
32
+ getRegex: () => new RegExp(n, t)
33
+ };
34
+ return r;
35
+ }
36
+ var g = (() => {
37
+ try {
38
+ return !0;
39
+ } catch {
40
+ return !1;
41
+ }
42
+ })(), _ = {
43
+ codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm,
44
+ outputLinkReplace: /\\([\[\]])/g,
45
+ indentCodeCompensation: /^(\s+)(?:```)/,
46
+ beginningSpace: /^\s+/,
47
+ endingHash: /#$/,
48
+ startingSpaceChar: /^ /,
49
+ endingSpaceChar: / $/,
50
+ nonSpaceChar: /[^ ]/,
51
+ newLineCharGlobal: /\n/g,
52
+ tabCharGlobal: /\t/g,
53
+ multipleSpaceGlobal: /\s+/g,
54
+ blankLine: /^[ \t]*$/,
55
+ doubleBlankLine: /\n[ \t]*\n[ \t]*$/,
56
+ blockquoteStart: /^ {0,3}>/,
57
+ blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g,
58
+ blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm,
59
+ listReplaceTabs: /^\t+/,
60
+ listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g,
61
+ listIsTask: /^\[[ xX]\] /,
62
+ listReplaceTask: /^\[[ xX]\] +/,
63
+ anyLine: /\n.*\n/,
64
+ hrefBrackets: /^<(.*)>$/,
65
+ tableDelimiter: /[:|]/,
66
+ tableAlignChars: /^\||\| *$/g,
67
+ tableRowBlankLine: /\n[ \t]*$/,
68
+ tableAlignRight: /^ *-+: *$/,
69
+ tableAlignCenter: /^ *:-+: *$/,
70
+ tableAlignLeft: /^ *:-+ *$/,
71
+ startATag: /^<a /i,
72
+ endATag: /^<\/a>/i,
73
+ startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i,
74
+ endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i,
75
+ startAngleBracket: /^</,
76
+ endAngleBracket: />$/,
77
+ pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/,
78
+ unicodeAlphaNumeric: /[\p{L}\p{N}]/u,
79
+ escapeTest: /[&<>"']/,
80
+ escapeReplace: /[&<>"']/g,
81
+ escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,
82
+ escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,
83
+ unescapeTest: /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,
84
+ caret: /(^|[^\[])\^/g,
85
+ percentDecode: /%25/g,
86
+ findPipe: /\|/g,
87
+ splitPipe: / \|/,
88
+ slashPipe: /\\\|/g,
89
+ carriageReturn: /\r\n|\r/g,
90
+ spaceLine: /^ +$/gm,
91
+ notSpaceStart: /^\S*/,
92
+ endingNewline: /\n$/,
93
+ listItemRegex: (e) => RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),
94
+ nextBulletRegex: (e) => RegExp(`^ {0,${Math.min(3, e - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),
95
+ hrRegex: (e) => RegExp(`^ {0,${Math.min(3, e - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),
96
+ fencesBeginRegex: (e) => RegExp(`^ {0,${Math.min(3, e - 1)}}(?:\`\`\`|~~~)`),
97
+ headingBeginRegex: (e) => RegExp(`^ {0,${Math.min(3, e - 1)}}#`),
98
+ htmlBeginRegex: (e) => RegExp(`^ {0,${Math.min(3, e - 1)}}<(?:[a-z].*>|!--)`, "i")
99
+ }, ee = /^(?:[ \t]*(?:\n|$))+/, te = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, ne = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, v = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, re = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, y = /(?:[*+-]|\d{1,9}[.)])/, ie = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, ae = h(ie).replace(/bull/g, y).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(), oe = h(ie).replace(/bull/g, y).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(), b = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, se = /^[^\n]+/, x = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, ce = h(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", x).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), le = h(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, y).getRegex(), S = "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", C = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, ue = h("^ {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", C).replace("tag", S).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), de = h(b).replace("hr", v).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", S).getRegex(), w = {
100
+ blockquote: h(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", de).getRegex(),
101
+ code: te,
102
+ def: ce,
103
+ fences: ne,
104
+ heading: re,
105
+ hr: v,
106
+ html: ue,
107
+ lheading: ae,
108
+ list: le,
109
+ newline: ee,
110
+ paragraph: de,
111
+ table: m,
112
+ text: se
113
+ }, fe = h("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", v).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", S).getRegex(), pe = {
114
+ ...w,
115
+ lheading: oe,
116
+ table: fe,
117
+ paragraph: h(b).replace("hr", v).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", fe).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", S).getRegex()
118
+ }, me = {
119
+ ...w,
120
+ html: h("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment", C).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(),
121
+ def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
122
+ heading: /^(#{1,6})(.*)(?:\n+|$)/,
123
+ fences: m,
124
+ lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
125
+ paragraph: h(b).replace("hr", v).replace("heading", " *#{1,6} *[^\n]").replace("lheading", ae).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
126
+ }, he = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, ge = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, _e = /^( {2,}|\\)\n(?!\s*$)/, ve = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, T = /[\p{P}\p{S}]/u, E = /[\s\p{P}\p{S}]/u, ye = /[^\s\p{P}\p{S}]/u, be = h(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, E).getRegex(), xe = /(?!~)[\p{P}\p{S}]/u, Se = /(?!~)[\s\p{P}\p{S}]/u, Ce = /(?:[^\s\p{P}\p{S}]|~)/u, we = h(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", g ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), Te = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/, Ee = h(Te, "u").replace(/punct/g, T).getRegex(), De = h(Te, "u").replace(/punct/g, xe).getRegex(), Oe = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", ke = h(Oe, "gu").replace(/notPunctSpace/g, ye).replace(/punctSpace/g, E).replace(/punct/g, T).getRegex(), Ae = h(Oe, "gu").replace(/notPunctSpace/g, Ce).replace(/punctSpace/g, Se).replace(/punct/g, xe).getRegex(), je = h("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, ye).replace(/punctSpace/g, E).replace(/punct/g, T).getRegex(), Me = h(/\\(punct)/, "gu").replace(/punct/g, T).getRegex(), Ne = h(/^<(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(), Pe = h(C).replace("(?:-->|$)", "-->").getRegex(), Fe = h("^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", Pe).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), D = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/, Ie = h(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label", D).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), Le = h(/^!?\[(label)\]\[(ref)\]/).replace("label", D).replace("ref", x).getRegex(), Re = h(/^!?\[(ref)\](?:\[\])?/).replace("ref", x).getRegex(), ze = h("reflink|nolink(?!\\()", "g").replace("reflink", Le).replace("nolink", Re).getRegex(), Be = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, O = {
127
+ _backpedal: m,
128
+ anyPunctuation: Me,
129
+ autolink: Ne,
130
+ blockSkip: we,
131
+ br: _e,
132
+ code: ge,
133
+ del: m,
134
+ emStrongLDelim: Ee,
135
+ emStrongRDelimAst: ke,
136
+ emStrongRDelimUnd: je,
137
+ escape: he,
138
+ link: Ie,
139
+ nolink: Re,
140
+ punctuation: be,
141
+ reflink: Le,
142
+ reflinkSearch: ze,
143
+ tag: Fe,
144
+ text: ve,
145
+ url: m
146
+ }, Ve = {
147
+ ...O,
148
+ link: h(/^!?\[(label)\]\((.*?)\)/).replace("label", D).getRegex(),
149
+ reflink: h(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", D).getRegex()
150
+ }, k = {
151
+ ...O,
152
+ emStrongRDelimAst: Ae,
153
+ emStrongLDelim: De,
154
+ url: h(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", Be).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),
155
+ _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
156
+ del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,
157
+ text: h(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", Be).getRegex()
158
+ }, He = {
159
+ ...k,
160
+ br: h(_e).replace("{2,}", "*").getRegex(),
161
+ text: h(k.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
162
+ }, A = {
163
+ normal: w,
164
+ gfm: pe,
165
+ pedantic: me
166
+ }, j = {
167
+ normal: O,
168
+ gfm: k,
169
+ breaks: He,
170
+ pedantic: Ve
171
+ }, Ue = {
172
+ "&": "&amp;",
173
+ "<": "&lt;",
174
+ ">": "&gt;",
175
+ "\"": "&quot;",
176
+ "'": "&#39;"
177
+ }, We = (e) => Ue[e];
178
+ function M(e, t) {
179
+ if (t) {
180
+ if (_.escapeTest.test(e)) return e.replace(_.escapeReplace, We);
181
+ } else if (_.escapeTestNoEncode.test(e)) return e.replace(_.escapeReplaceNoEncode, We);
182
+ return e;
183
+ }
184
+ function Ge(e) {
185
+ try {
186
+ e = encodeURI(e).replace(_.percentDecode, "%");
187
+ } catch {
188
+ return null;
189
+ }
190
+ return e;
191
+ }
192
+ function Ke(e, t) {
193
+ let n = e.replace(_.findPipe, (e, t, n) => {
194
+ let r = !1, i = t;
195
+ for (; --i >= 0 && n[i] === "\\";) r = !r;
196
+ return r ? "|" : " |";
197
+ }).split(_.splitPipe), r = 0;
198
+ if (n[0].trim() || n.shift(), n.length > 0 && !n.at(-1)?.trim() && n.pop(), t) if (n.length > t) n.splice(t);
199
+ else for (; n.length < t;) n.push("");
200
+ for (; r < n.length; r++) n[r] = n[r].trim().replace(_.slashPipe, "|");
201
+ return n;
202
+ }
203
+ function N(e, t, n) {
204
+ let r = e.length;
205
+ if (r === 0) return "";
206
+ let i = 0;
207
+ for (; i < r;) {
208
+ let a = e.charAt(r - i - 1);
209
+ if (a === t && !n) i++;
210
+ else if (a !== t && n) i++;
211
+ else break;
212
+ }
213
+ return e.slice(0, r - i);
214
+ }
215
+ function qe(e, t) {
216
+ if (e.indexOf(t[1]) === -1) return -1;
217
+ let n = 0;
218
+ for (let r = 0; r < e.length; r++) if (e[r] === "\\") r++;
219
+ else if (e[r] === t[0]) n++;
220
+ else if (e[r] === t[1] && (n--, n < 0)) return r;
221
+ return n > 0 ? -2 : -1;
222
+ }
223
+ function Je(e, t, n, r, i) {
224
+ let a = t.href, o = t.title || null, s = e[1].replace(i.other.outputLinkReplace, "$1");
225
+ r.state.inLink = !0;
226
+ let c = {
227
+ type: e[0].charAt(0) === "!" ? "image" : "link",
228
+ raw: n,
229
+ href: a,
230
+ title: o,
231
+ text: s,
232
+ tokens: r.inlineTokens(s)
233
+ };
234
+ return r.state.inLink = !1, c;
235
+ }
236
+ function Ye(e, t, n) {
237
+ let r = e.match(n.other.indentCodeCompensation);
238
+ if (r === null) return t;
239
+ let i = r[1];
240
+ return t.split("\n").map((e) => {
241
+ let t = e.match(n.other.beginningSpace);
242
+ if (t === null) return e;
243
+ let [r] = t;
244
+ return r.length >= i.length ? e.slice(i.length) : e;
245
+ }).join("\n");
246
+ }
247
+ var P = class {
248
+ options;
249
+ rules;
250
+ lexer;
251
+ constructor(e) {
252
+ this.options = e || f;
253
+ }
254
+ space(e) {
255
+ let t = this.rules.block.newline.exec(e);
256
+ if (t && t[0].length > 0) return {
257
+ type: "space",
258
+ raw: t[0]
259
+ };
260
+ }
261
+ code(e) {
262
+ let t = this.rules.block.code.exec(e);
263
+ if (t) {
264
+ let e = t[0].replace(this.rules.other.codeRemoveIndent, "");
265
+ return {
266
+ type: "code",
267
+ raw: t[0],
268
+ codeBlockStyle: "indented",
269
+ text: this.options.pedantic ? e : N(e, "\n")
270
+ };
271
+ }
272
+ }
273
+ fences(e) {
274
+ let t = this.rules.block.fences.exec(e);
275
+ if (t) {
276
+ let e = t[0], n = Ye(e, t[3] || "", this.rules);
277
+ return {
278
+ type: "code",
279
+ raw: e,
280
+ lang: t[2] ? t[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : t[2],
281
+ text: n
282
+ };
283
+ }
284
+ }
285
+ heading(e) {
286
+ let t = this.rules.block.heading.exec(e);
287
+ if (t) {
288
+ let e = t[2].trim();
289
+ if (this.rules.other.endingHash.test(e)) {
290
+ let t = N(e, "#");
291
+ (this.options.pedantic || !t || this.rules.other.endingSpaceChar.test(t)) && (e = t.trim());
292
+ }
293
+ return {
294
+ type: "heading",
295
+ raw: t[0],
296
+ depth: t[1].length,
297
+ text: e,
298
+ tokens: this.lexer.inline(e)
299
+ };
300
+ }
301
+ }
302
+ hr(e) {
303
+ let t = this.rules.block.hr.exec(e);
304
+ if (t) return {
305
+ type: "hr",
306
+ raw: N(t[0], "\n")
307
+ };
308
+ }
309
+ blockquote(e) {
310
+ let t = this.rules.block.blockquote.exec(e);
311
+ if (t) {
312
+ let e = N(t[0], "\n").split("\n"), n = "", r = "", i = [];
313
+ for (; e.length > 0;) {
314
+ let t = !1, a = [], o;
315
+ for (o = 0; o < e.length; o++) if (this.rules.other.blockquoteStart.test(e[o])) a.push(e[o]), t = !0;
316
+ else if (!t) a.push(e[o]);
317
+ else break;
318
+ e = e.slice(o);
319
+ let s = a.join("\n"), c = s.replace(this.rules.other.blockquoteSetextReplace, "\n $1").replace(this.rules.other.blockquoteSetextReplace2, "");
320
+ n = n ? `${n}
321
+ ${s}` : s, r = r ? `${r}
322
+ ${c}` : c;
323
+ let l = this.lexer.state.top;
324
+ if (this.lexer.state.top = !0, this.lexer.blockTokens(c, i, !0), this.lexer.state.top = l, e.length === 0) break;
325
+ let u = i.at(-1);
326
+ if (u?.type === "code") break;
327
+ if (u?.type === "blockquote") {
328
+ let t = u, a = t.raw + "\n" + e.join("\n"), o = this.blockquote(a);
329
+ 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;
330
+ break;
331
+ } else if (u?.type === "list") {
332
+ let t = u, a = t.raw + "\n" + e.join("\n"), o = this.list(a);
333
+ 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");
334
+ continue;
335
+ }
336
+ }
337
+ return {
338
+ type: "blockquote",
339
+ raw: n,
340
+ tokens: i,
341
+ text: r
342
+ };
343
+ }
344
+ }
345
+ list(e) {
346
+ let t = this.rules.block.list.exec(e);
347
+ if (t) {
348
+ let n = t[1].trim(), r = n.length > 1, i = {
349
+ type: "list",
350
+ raw: "",
351
+ ordered: r,
352
+ start: r ? +n.slice(0, -1) : "",
353
+ loose: !1,
354
+ items: []
355
+ };
356
+ n = r ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = r ? n : "[*+-]");
357
+ let a = this.rules.other.listItemRegex(n), o = !1;
358
+ for (; e;) {
359
+ let n = !1, r = "", s = "";
360
+ if (!(t = a.exec(e)) || this.rules.block.hr.test(e)) break;
361
+ r = t[0], e = e.substring(r.length);
362
+ 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;
363
+ 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) {
364
+ 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);
365
+ for (; e;) {
366
+ let f = e.split("\n", 1)[0], p;
367
+ 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;
368
+ if (p.search(this.rules.other.nonSpaceChar) >= d || !l.trim()) s += "\n" + p.slice(d);
369
+ else {
370
+ if (u || c.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || i.test(c) || a.test(c) || n.test(c)) break;
371
+ s += "\n" + l;
372
+ }
373
+ !u && !l.trim() && (u = !0), r += f + "\n", e = e.substring(f.length + 1), c = p.slice(d);
374
+ }
375
+ }
376
+ i.loose || (o ? i.loose = !0 : this.rules.other.doubleBlankLine.test(r) && (o = !0));
377
+ let f = null, p;
378
+ this.options.gfm && (f = this.rules.other.listIsTask.exec(s), f && (p = f[0] !== "[ ] ", s = s.replace(this.rules.other.listReplaceTask, ""))), i.items.push({
379
+ type: "list_item",
380
+ raw: r,
381
+ task: !!f,
382
+ checked: p,
383
+ loose: !1,
384
+ text: s,
385
+ tokens: []
386
+ }), i.raw += r;
387
+ }
388
+ let s = i.items.at(-1);
389
+ if (s) s.raw = s.raw.trimEnd(), s.text = s.text.trimEnd();
390
+ else return;
391
+ i.raw = i.raw.trimEnd();
392
+ 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) {
393
+ let t = i.items[e].tokens.filter((e) => e.type === "space");
394
+ i.loose = t.length > 0 && t.some((e) => this.rules.other.anyLine.test(e.raw));
395
+ }
396
+ if (i.loose) for (let e = 0; e < i.items.length; e++) i.items[e].loose = !0;
397
+ return i;
398
+ }
399
+ }
400
+ html(e) {
401
+ let t = this.rules.block.html.exec(e);
402
+ if (t) return {
403
+ type: "html",
404
+ block: !0,
405
+ raw: t[0],
406
+ pre: t[1] === "pre" || t[1] === "script" || t[1] === "style",
407
+ text: t[0]
408
+ };
409
+ }
410
+ def(e) {
411
+ let t = this.rules.block.def.exec(e);
412
+ if (t) {
413
+ 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];
414
+ return {
415
+ type: "def",
416
+ tag: e,
417
+ raw: t[0],
418
+ href: n,
419
+ title: r
420
+ };
421
+ }
422
+ }
423
+ table(e) {
424
+ let t = this.rules.block.table.exec(e);
425
+ if (!t || !this.rules.other.tableDelimiter.test(t[2])) return;
426
+ let n = Ke(t[1]), r = t[2].replace(this.rules.other.tableAlignChars, "").split("|"), i = t[3]?.trim() ? t[3].replace(this.rules.other.tableRowBlankLine, "").split("\n") : [], a = {
427
+ type: "table",
428
+ raw: t[0],
429
+ header: [],
430
+ align: [],
431
+ rows: []
432
+ };
433
+ if (n.length === r.length) {
434
+ for (let e of r) this.rules.other.tableAlignRight.test(e) ? a.align.push("right") : this.rules.other.tableAlignCenter.test(e) ? a.align.push("center") : this.rules.other.tableAlignLeft.test(e) ? a.align.push("left") : a.align.push(null);
435
+ for (let e = 0; e < n.length; e++) a.header.push({
436
+ text: n[e],
437
+ tokens: this.lexer.inline(n[e]),
438
+ header: !0,
439
+ align: a.align[e]
440
+ });
441
+ for (let e of i) a.rows.push(Ke(e, a.header.length).map((e, t) => ({
442
+ text: e,
443
+ tokens: this.lexer.inline(e),
444
+ header: !1,
445
+ align: a.align[t]
446
+ })));
447
+ return a;
448
+ }
449
+ }
450
+ lheading(e) {
451
+ let t = this.rules.block.lheading.exec(e);
452
+ if (t) return {
453
+ type: "heading",
454
+ raw: t[0],
455
+ depth: t[2].charAt(0) === "=" ? 1 : 2,
456
+ text: t[1],
457
+ tokens: this.lexer.inline(t[1])
458
+ };
459
+ }
460
+ paragraph(e) {
461
+ let t = this.rules.block.paragraph.exec(e);
462
+ if (t) {
463
+ let e = t[1].charAt(t[1].length - 1) === "\n" ? t[1].slice(0, -1) : t[1];
464
+ return {
465
+ type: "paragraph",
466
+ raw: t[0],
467
+ text: e,
468
+ tokens: this.lexer.inline(e)
469
+ };
470
+ }
471
+ }
472
+ text(e) {
473
+ let t = this.rules.block.text.exec(e);
474
+ if (t) return {
475
+ type: "text",
476
+ raw: t[0],
477
+ text: t[0],
478
+ tokens: this.lexer.inline(t[0])
479
+ };
480
+ }
481
+ escape(e) {
482
+ let t = this.rules.inline.escape.exec(e);
483
+ if (t) return {
484
+ type: "escape",
485
+ raw: t[0],
486
+ text: t[1]
487
+ };
488
+ }
489
+ tag(e) {
490
+ let t = this.rules.inline.tag.exec(e);
491
+ 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), {
492
+ type: "html",
493
+ raw: t[0],
494
+ inLink: this.lexer.state.inLink,
495
+ inRawBlock: this.lexer.state.inRawBlock,
496
+ block: !1,
497
+ text: t[0]
498
+ };
499
+ }
500
+ link(e) {
501
+ let t = this.rules.inline.link.exec(e);
502
+ if (t) {
503
+ let e = t[2].trim();
504
+ if (!this.options.pedantic && this.rules.other.startAngleBracket.test(e)) {
505
+ if (!this.rules.other.endAngleBracket.test(e)) return;
506
+ let t = N(e.slice(0, -1), "\\");
507
+ if ((e.length - t.length) % 2 == 0) return;
508
+ } else {
509
+ let e = qe(t[2], "()");
510
+ if (e === -2) return;
511
+ if (e > -1) {
512
+ let n = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + e;
513
+ t[2] = t[2].substring(0, e), t[0] = t[0].substring(0, n).trim(), t[3] = "";
514
+ }
515
+ }
516
+ let n = t[2], r = "";
517
+ if (this.options.pedantic) {
518
+ let e = this.rules.other.pedanticHrefTitle.exec(n);
519
+ e && (n = e[1], r = e[3]);
520
+ } else r = t[3] ? t[3].slice(1, -1) : "";
521
+ 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)), Je(t, {
522
+ href: n && n.replace(this.rules.inline.anyPunctuation, "$1"),
523
+ title: r && r.replace(this.rules.inline.anyPunctuation, "$1")
524
+ }, t[0], this.lexer, this.rules);
525
+ }
526
+ }
527
+ reflink(e, t) {
528
+ let n;
529
+ if ((n = this.rules.inline.reflink.exec(e)) || (n = this.rules.inline.nolink.exec(e))) {
530
+ let e = t[(n[2] || n[1]).replace(this.rules.other.multipleSpaceGlobal, " ").toLowerCase()];
531
+ if (!e) {
532
+ let e = n[0].charAt(0);
533
+ return {
534
+ type: "text",
535
+ raw: e,
536
+ text: e
537
+ };
538
+ }
539
+ return Je(n, e, n[0], this.lexer, this.rules);
540
+ }
541
+ }
542
+ emStrong(e, t, n = "") {
543
+ let r = this.rules.inline.emStrongLDelim.exec(e);
544
+ if (!(!r || r[3] && n.match(this.rules.other.unicodeAlphaNumeric)) && (!(r[1] || r[2]) || !n || this.rules.inline.punctuation.exec(n))) {
545
+ let n = [...r[0]].length - 1, i, a, o = n, s = 0, c = r[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
546
+ for (c.lastIndex = 0, t = t.slice(-1 * e.length + n); (r = c.exec(t)) != null;) {
547
+ if (i = r[1] || r[2] || r[3] || r[4] || r[5] || r[6], !i) continue;
548
+ if (a = [...i].length, r[3] || r[4]) {
549
+ o += a;
550
+ continue;
551
+ } else if ((r[5] || r[6]) && n % 3 && !((n + a) % 3)) {
552
+ s += a;
553
+ continue;
554
+ }
555
+ if (o -= a, o > 0) continue;
556
+ a = Math.min(a, a + o + s);
557
+ let t = [...r[0]][0].length, c = e.slice(0, n + r.index + t + a);
558
+ if (Math.min(n, a) % 2) {
559
+ let e = c.slice(1, -1);
560
+ return {
561
+ type: "em",
562
+ raw: c,
563
+ text: e,
564
+ tokens: this.lexer.inlineTokens(e)
565
+ };
566
+ }
567
+ let l = c.slice(2, -2);
568
+ return {
569
+ type: "strong",
570
+ raw: c,
571
+ text: l,
572
+ tokens: this.lexer.inlineTokens(l)
573
+ };
574
+ }
575
+ }
576
+ }
577
+ codespan(e) {
578
+ let t = this.rules.inline.code.exec(e);
579
+ if (t) {
580
+ 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);
581
+ return n && r && (e = e.substring(1, e.length - 1)), {
582
+ type: "codespan",
583
+ raw: t[0],
584
+ text: e
585
+ };
586
+ }
587
+ }
588
+ br(e) {
589
+ let t = this.rules.inline.br.exec(e);
590
+ if (t) return {
591
+ type: "br",
592
+ raw: t[0]
593
+ };
594
+ }
595
+ del(e) {
596
+ let t = this.rules.inline.del.exec(e);
597
+ if (t) return {
598
+ type: "del",
599
+ raw: t[0],
600
+ text: t[2],
601
+ tokens: this.lexer.inlineTokens(t[2])
602
+ };
603
+ }
604
+ autolink(e) {
605
+ let t = this.rules.inline.autolink.exec(e);
606
+ if (t) {
607
+ let e, n;
608
+ return t[2] === "@" ? (e = t[1], n = "mailto:" + e) : (e = t[1], n = e), {
609
+ type: "link",
610
+ raw: t[0],
611
+ text: e,
612
+ href: n,
613
+ tokens: [{
614
+ type: "text",
615
+ raw: e,
616
+ text: e
617
+ }]
618
+ };
619
+ }
620
+ }
621
+ url(e) {
622
+ let t;
623
+ if (t = this.rules.inline.url.exec(e)) {
624
+ let e, n;
625
+ if (t[2] === "@") e = t[0], n = "mailto:" + e;
626
+ else {
627
+ let r;
628
+ do
629
+ r = t[0], t[0] = this.rules.inline._backpedal.exec(t[0])?.[0] ?? "";
630
+ while (r !== t[0]);
631
+ e = t[0], n = t[1] === "www." ? "http://" + t[0] : t[0];
632
+ }
633
+ return {
634
+ type: "link",
635
+ raw: t[0],
636
+ text: e,
637
+ href: n,
638
+ tokens: [{
639
+ type: "text",
640
+ raw: e,
641
+ text: e
642
+ }]
643
+ };
644
+ }
645
+ }
646
+ inlineText(e) {
647
+ let t = this.rules.inline.text.exec(e);
648
+ if (t) {
649
+ let e = this.lexer.state.inRawBlock;
650
+ return {
651
+ type: "text",
652
+ raw: t[0],
653
+ text: t[0],
654
+ escaped: e
655
+ };
656
+ }
657
+ }
658
+ }, F = class e {
659
+ tokens;
660
+ options;
661
+ state;
662
+ tokenizer;
663
+ inlineQueue;
664
+ constructor(e) {
665
+ this.tokens = [], this.tokens.links = Object.create(null), this.options = e || f, this.options.tokenizer = this.options.tokenizer || new P(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
666
+ inLink: !1,
667
+ inRawBlock: !1,
668
+ top: !0
669
+ };
670
+ let t = {
671
+ other: _,
672
+ block: A.normal,
673
+ inline: j.normal
674
+ };
675
+ this.options.pedantic ? (t.block = A.pedantic, t.inline = j.pedantic) : this.options.gfm && (t.block = A.gfm, this.options.breaks ? t.inline = j.breaks : t.inline = j.gfm), this.tokenizer.rules = t;
676
+ }
677
+ static get rules() {
678
+ return {
679
+ block: A,
680
+ inline: j
681
+ };
682
+ }
683
+ static lex(t, n) {
684
+ return new e(n).lex(t);
685
+ }
686
+ static lexInline(t, n) {
687
+ return new e(n).inlineTokens(t);
688
+ }
689
+ lex(e) {
690
+ e = e.replace(_.carriageReturn, "\n"), this.blockTokens(e, this.tokens);
691
+ for (let e = 0; e < this.inlineQueue.length; e++) {
692
+ let t = this.inlineQueue[e];
693
+ this.inlineTokens(t.src, t.tokens);
694
+ }
695
+ return this.inlineQueue = [], this.tokens;
696
+ }
697
+ blockTokens(e, t = [], n = !1) {
698
+ for (this.options.pedantic && (e = e.replace(_.tabCharGlobal, " ").replace(_.spaceLine, "")); e;) {
699
+ let r;
700
+ if (this.options.extensions?.block?.some((n) => (r = n.call({ lexer: this }, e, t)) ? (e = e.substring(r.raw.length), t.push(r), !0) : !1)) continue;
701
+ if (r = this.tokenizer.space(e)) {
702
+ e = e.substring(r.raw.length);
703
+ let n = t.at(-1);
704
+ r.raw.length === 1 && n !== void 0 ? n.raw += "\n" : t.push(r);
705
+ continue;
706
+ }
707
+ if (r = this.tokenizer.code(e)) {
708
+ e = e.substring(r.raw.length);
709
+ let n = t.at(-1);
710
+ n?.type === "paragraph" || n?.type === "text" ? (n.raw += (n.raw.endsWith("\n") ? "" : "\n") + r.raw, n.text += "\n" + r.text, this.inlineQueue.at(-1).src = n.text) : t.push(r);
711
+ continue;
712
+ }
713
+ if (r = this.tokenizer.fences(e)) {
714
+ e = e.substring(r.raw.length), t.push(r);
715
+ continue;
716
+ }
717
+ if (r = this.tokenizer.heading(e)) {
718
+ e = e.substring(r.raw.length), t.push(r);
719
+ continue;
720
+ }
721
+ if (r = this.tokenizer.hr(e)) {
722
+ e = e.substring(r.raw.length), t.push(r);
723
+ continue;
724
+ }
725
+ if (r = this.tokenizer.blockquote(e)) {
726
+ e = e.substring(r.raw.length), t.push(r);
727
+ continue;
728
+ }
729
+ if (r = this.tokenizer.list(e)) {
730
+ e = e.substring(r.raw.length), t.push(r);
731
+ continue;
732
+ }
733
+ if (r = this.tokenizer.html(e)) {
734
+ e = e.substring(r.raw.length), t.push(r);
735
+ continue;
736
+ }
737
+ if (r = this.tokenizer.def(e)) {
738
+ e = e.substring(r.raw.length);
739
+ let n = t.at(-1);
740
+ n?.type === "paragraph" || n?.type === "text" ? (n.raw += (n.raw.endsWith("\n") ? "" : "\n") + r.raw, n.text += "\n" + r.raw, this.inlineQueue.at(-1).src = n.text) : this.tokens.links[r.tag] || (this.tokens.links[r.tag] = {
741
+ href: r.href,
742
+ title: r.title
743
+ }, t.push(r));
744
+ continue;
745
+ }
746
+ if (r = this.tokenizer.table(e)) {
747
+ e = e.substring(r.raw.length), t.push(r);
748
+ continue;
749
+ }
750
+ if (r = this.tokenizer.lheading(e)) {
751
+ e = e.substring(r.raw.length), t.push(r);
752
+ continue;
753
+ }
754
+ let i = e;
755
+ if (this.options.extensions?.startBlock) {
756
+ let t = Infinity, n = e.slice(1), r;
757
+ this.options.extensions.startBlock.forEach((e) => {
758
+ r = e.call({ lexer: this }, n), typeof r == "number" && r >= 0 && (t = Math.min(t, r));
759
+ }), t < Infinity && t >= 0 && (i = e.substring(0, t + 1));
760
+ }
761
+ if (this.state.top && (r = this.tokenizer.paragraph(i))) {
762
+ let a = t.at(-1);
763
+ n && a?.type === "paragraph" ? (a.raw += (a.raw.endsWith("\n") ? "" : "\n") + r.raw, a.text += "\n" + r.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = a.text) : t.push(r), n = i.length !== e.length, e = e.substring(r.raw.length);
764
+ continue;
765
+ }
766
+ if (r = this.tokenizer.text(e)) {
767
+ e = e.substring(r.raw.length);
768
+ let n = t.at(-1);
769
+ n?.type === "text" ? (n.raw += (n.raw.endsWith("\n") ? "" : "\n") + r.raw, n.text += "\n" + r.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = n.text) : t.push(r);
770
+ continue;
771
+ }
772
+ if (e) {
773
+ let t = "Infinite loop on byte: " + e.charCodeAt(0);
774
+ if (this.options.silent) {
775
+ console.error(t);
776
+ break;
777
+ } else throw Error(t);
778
+ }
779
+ }
780
+ return this.state.top = !0, t;
781
+ }
782
+ inline(e, t = []) {
783
+ return this.inlineQueue.push({
784
+ src: e,
785
+ tokens: t
786
+ }), t;
787
+ }
788
+ inlineTokens(e, t = []) {
789
+ let n = e, r = null;
790
+ if (this.tokens.links) {
791
+ let e = Object.keys(this.tokens.links);
792
+ if (e.length > 0) for (; (r = this.tokenizer.rules.inline.reflinkSearch.exec(n)) != null;) e.includes(r[0].slice(r[0].lastIndexOf("[") + 1, -1)) && (n = n.slice(0, r.index) + "[" + "a".repeat(r[0].length - 2) + "]" + n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
793
+ }
794
+ for (; (r = this.tokenizer.rules.inline.anyPunctuation.exec(n)) != null;) n = n.slice(0, r.index) + "++" + n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
795
+ let i;
796
+ for (; (r = this.tokenizer.rules.inline.blockSkip.exec(n)) != null;) i = r[2] ? r[2].length : 0, n = n.slice(0, r.index + i) + "[" + "a".repeat(r[0].length - i - 2) + "]" + n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
797
+ n = this.options.hooks?.emStrongMask?.call({ lexer: this }, n) ?? n;
798
+ let a = !1, o = "";
799
+ for (; e;) {
800
+ a || (o = ""), a = !1;
801
+ let r;
802
+ if (this.options.extensions?.inline?.some((n) => (r = n.call({ lexer: this }, e, t)) ? (e = e.substring(r.raw.length), t.push(r), !0) : !1)) continue;
803
+ if (r = this.tokenizer.escape(e)) {
804
+ e = e.substring(r.raw.length), t.push(r);
805
+ continue;
806
+ }
807
+ if (r = this.tokenizer.tag(e)) {
808
+ e = e.substring(r.raw.length), t.push(r);
809
+ continue;
810
+ }
811
+ if (r = this.tokenizer.link(e)) {
812
+ e = e.substring(r.raw.length), t.push(r);
813
+ continue;
814
+ }
815
+ if (r = this.tokenizer.reflink(e, this.tokens.links)) {
816
+ e = e.substring(r.raw.length);
817
+ let n = t.at(-1);
818
+ r.type === "text" && n?.type === "text" ? (n.raw += r.raw, n.text += r.text) : t.push(r);
819
+ continue;
820
+ }
821
+ if (r = this.tokenizer.emStrong(e, n, o)) {
822
+ e = e.substring(r.raw.length), t.push(r);
823
+ continue;
824
+ }
825
+ if (r = this.tokenizer.codespan(e)) {
826
+ e = e.substring(r.raw.length), t.push(r);
827
+ continue;
828
+ }
829
+ if (r = this.tokenizer.br(e)) {
830
+ e = e.substring(r.raw.length), t.push(r);
831
+ continue;
832
+ }
833
+ if (r = this.tokenizer.del(e)) {
834
+ e = e.substring(r.raw.length), t.push(r);
835
+ continue;
836
+ }
837
+ if (r = this.tokenizer.autolink(e)) {
838
+ e = e.substring(r.raw.length), t.push(r);
839
+ continue;
840
+ }
841
+ if (!this.state.inLink && (r = this.tokenizer.url(e))) {
842
+ e = e.substring(r.raw.length), t.push(r);
843
+ continue;
844
+ }
845
+ let i = e;
846
+ if (this.options.extensions?.startInline) {
847
+ let t = Infinity, n = e.slice(1), r;
848
+ this.options.extensions.startInline.forEach((e) => {
849
+ r = e.call({ lexer: this }, n), typeof r == "number" && r >= 0 && (t = Math.min(t, r));
850
+ }), t < Infinity && t >= 0 && (i = e.substring(0, t + 1));
851
+ }
852
+ if (r = this.tokenizer.inlineText(i)) {
853
+ e = e.substring(r.raw.length), r.raw.slice(-1) !== "_" && (o = r.raw.slice(-1)), a = !0;
854
+ let n = t.at(-1);
855
+ n?.type === "text" ? (n.raw += r.raw, n.text += r.text) : t.push(r);
856
+ continue;
857
+ }
858
+ if (e) {
859
+ let t = "Infinite loop on byte: " + e.charCodeAt(0);
860
+ if (this.options.silent) {
861
+ console.error(t);
862
+ break;
863
+ } else throw Error(t);
864
+ }
865
+ }
866
+ return t;
867
+ }
868
+ }, I = class {
869
+ options;
870
+ parser;
871
+ constructor(e) {
872
+ this.options = e || f;
873
+ }
874
+ space(e) {
875
+ return "";
876
+ }
877
+ code({ text: e, lang: t, escaped: n }) {
878
+ let r = (t || "").match(_.notSpaceStart)?.[0], i = e.replace(_.endingNewline, "") + "\n";
879
+ return r ? "<pre><code class=\"language-" + M(r) + "\">" + (n ? i : M(i, !0)) + "</code></pre>\n" : "<pre><code>" + (n ? i : M(i, !0)) + "</code></pre>\n";
880
+ }
881
+ blockquote({ tokens: e }) {
882
+ return `<blockquote>
883
+ ${this.parser.parse(e)}</blockquote>
884
+ `;
885
+ }
886
+ html({ text: e }) {
887
+ return e;
888
+ }
889
+ def(e) {
890
+ return "";
891
+ }
892
+ heading({ tokens: e, depth: t }) {
893
+ return `<h${t}>${this.parser.parseInline(e)}</h${t}>
894
+ `;
895
+ }
896
+ hr(e) {
897
+ return "<hr>\n";
898
+ }
899
+ list(e) {
900
+ let t = e.ordered, n = e.start, r = "";
901
+ for (let t = 0; t < e.items.length; t++) {
902
+ let n = e.items[t];
903
+ r += this.listitem(n);
904
+ }
905
+ let i = t ? "ol" : "ul", a = t && n !== 1 ? " start=\"" + n + "\"" : "";
906
+ return "<" + i + a + ">\n" + r + "</" + i + ">\n";
907
+ }
908
+ listitem(e) {
909
+ let t = "";
910
+ if (e.task) {
911
+ let n = this.checkbox({ checked: !!e.checked });
912
+ e.loose ? e.tokens[0]?.type === "paragraph" ? (e.tokens[0].text = n + " " + 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 = n + " " + M(e.tokens[0].tokens[0].text), e.tokens[0].tokens[0].escaped = !0)) : e.tokens.unshift({
913
+ type: "text",
914
+ raw: n + " ",
915
+ text: n + " ",
916
+ escaped: !0
917
+ }) : t += n + " ";
918
+ }
919
+ return t += this.parser.parse(e.tokens, !!e.loose), `<li>${t}</li>
920
+ `;
921
+ }
922
+ checkbox({ checked: e }) {
923
+ return "<input " + (e ? "checked=\"\" " : "") + "disabled=\"\" type=\"checkbox\">";
924
+ }
925
+ paragraph({ tokens: e }) {
926
+ return `<p>${this.parser.parseInline(e)}</p>
927
+ `;
928
+ }
929
+ table(e) {
930
+ let t = "", n = "";
931
+ for (let t = 0; t < e.header.length; t++) n += this.tablecell(e.header[t]);
932
+ t += this.tablerow({ text: n });
933
+ let r = "";
934
+ for (let t = 0; t < e.rows.length; t++) {
935
+ let i = e.rows[t];
936
+ n = "";
937
+ for (let e = 0; e < i.length; e++) n += this.tablecell(i[e]);
938
+ r += this.tablerow({ text: n });
939
+ }
940
+ return r &&= `<tbody>${r}</tbody>`, "<table>\n<thead>\n" + t + "</thead>\n" + r + "</table>\n";
941
+ }
942
+ tablerow({ text: e }) {
943
+ return `<tr>
944
+ ${e}</tr>
945
+ `;
946
+ }
947
+ tablecell(e) {
948
+ let t = this.parser.parseInline(e.tokens), n = e.header ? "th" : "td";
949
+ return (e.align ? `<${n} align="${e.align}">` : `<${n}>`) + t + `</${n}>
950
+ `;
951
+ }
952
+ strong({ tokens: e }) {
953
+ return `<strong>${this.parser.parseInline(e)}</strong>`;
954
+ }
955
+ em({ tokens: e }) {
956
+ return `<em>${this.parser.parseInline(e)}</em>`;
957
+ }
958
+ codespan({ text: e }) {
959
+ return `<code>${M(e, !0)}</code>`;
960
+ }
961
+ br(e) {
962
+ return "<br>";
963
+ }
964
+ del({ tokens: e }) {
965
+ return `<del>${this.parser.parseInline(e)}</del>`;
966
+ }
967
+ link({ href: e, title: t, tokens: n }) {
968
+ let r = this.parser.parseInline(n), i = Ge(e);
969
+ if (i === null) return r;
970
+ e = i;
971
+ let a = "<a href=\"" + e + "\"";
972
+ return t && (a += " title=\"" + M(t) + "\""), a += ">" + r + "</a>", a;
973
+ }
974
+ image({ href: e, title: t, text: n, tokens: r }) {
975
+ r && (n = this.parser.parseInline(r, this.parser.textRenderer));
976
+ let i = Ge(e);
977
+ if (i === null) return M(n);
978
+ e = i;
979
+ let a = `<img src="${e}" alt="${n}"`;
980
+ return t && (a += ` title="${M(t)}"`), a += ">", a;
981
+ }
982
+ text(e) {
983
+ return "tokens" in e && e.tokens ? this.parser.parseInline(e.tokens) : "escaped" in e && e.escaped ? e.text : M(e.text);
984
+ }
985
+ }, L = class {
986
+ strong({ text: e }) {
987
+ return e;
988
+ }
989
+ em({ text: e }) {
990
+ return e;
991
+ }
992
+ codespan({ text: e }) {
993
+ return e;
994
+ }
995
+ del({ text: e }) {
996
+ return e;
997
+ }
998
+ html({ text: e }) {
999
+ return e;
1000
+ }
1001
+ text({ text: e }) {
1002
+ return e;
1003
+ }
1004
+ link({ text: e }) {
1005
+ return "" + e;
1006
+ }
1007
+ image({ text: e }) {
1008
+ return "" + e;
1009
+ }
1010
+ br() {
1011
+ return "";
1012
+ }
1013
+ }, R = class e {
1014
+ options;
1015
+ renderer;
1016
+ textRenderer;
1017
+ constructor(e) {
1018
+ this.options = e || f, this.options.renderer = this.options.renderer || new I(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new L();
1019
+ }
1020
+ static parse(t, n) {
1021
+ return new e(n).parse(t);
1022
+ }
1023
+ static parseInline(t, n) {
1024
+ return new e(n).parseInline(t);
1025
+ }
1026
+ parse(e, t = !0) {
1027
+ let n = "";
1028
+ for (let r = 0; r < e.length; r++) {
1029
+ let i = e[r];
1030
+ if (this.options.extensions?.renderers?.[i.type]) {
1031
+ let e = i, t = this.options.extensions.renderers[e.type].call({ parser: this }, e);
1032
+ if (t !== !1 || ![
1033
+ "space",
1034
+ "hr",
1035
+ "heading",
1036
+ "code",
1037
+ "table",
1038
+ "blockquote",
1039
+ "list",
1040
+ "html",
1041
+ "def",
1042
+ "paragraph",
1043
+ "text"
1044
+ ].includes(e.type)) {
1045
+ n += t || "";
1046
+ continue;
1047
+ }
1048
+ }
1049
+ let a = i;
1050
+ switch (a.type) {
1051
+ case "space":
1052
+ n += this.renderer.space(a);
1053
+ continue;
1054
+ case "hr":
1055
+ n += this.renderer.hr(a);
1056
+ continue;
1057
+ case "heading":
1058
+ n += this.renderer.heading(a);
1059
+ continue;
1060
+ case "code":
1061
+ n += this.renderer.code(a);
1062
+ continue;
1063
+ case "table":
1064
+ n += this.renderer.table(a);
1065
+ continue;
1066
+ case "blockquote":
1067
+ n += this.renderer.blockquote(a);
1068
+ continue;
1069
+ case "list":
1070
+ n += this.renderer.list(a);
1071
+ continue;
1072
+ case "html":
1073
+ n += this.renderer.html(a);
1074
+ continue;
1075
+ case "def":
1076
+ n += this.renderer.def(a);
1077
+ continue;
1078
+ case "paragraph":
1079
+ n += this.renderer.paragraph(a);
1080
+ continue;
1081
+ case "text": {
1082
+ let i = a, o = this.renderer.text(i);
1083
+ for (; r + 1 < e.length && e[r + 1].type === "text";) i = e[++r], o += "\n" + this.renderer.text(i);
1084
+ t ? n += this.renderer.paragraph({
1085
+ type: "paragraph",
1086
+ raw: o,
1087
+ text: o,
1088
+ tokens: [{
1089
+ type: "text",
1090
+ raw: o,
1091
+ text: o,
1092
+ escaped: !0
1093
+ }]
1094
+ }) : n += o;
1095
+ continue;
1096
+ }
1097
+ default: {
1098
+ let e = "Token with \"" + a.type + "\" type was not found.";
1099
+ if (this.options.silent) return console.error(e), "";
1100
+ throw Error(e);
1101
+ }
1102
+ }
1103
+ }
1104
+ return n;
1105
+ }
1106
+ parseInline(e, t = this.renderer) {
1107
+ let n = "";
1108
+ for (let r = 0; r < e.length; r++) {
1109
+ let i = e[r];
1110
+ if (this.options.extensions?.renderers?.[i.type]) {
1111
+ let e = this.options.extensions.renderers[i.type].call({ parser: this }, i);
1112
+ if (e !== !1 || ![
1113
+ "escape",
1114
+ "html",
1115
+ "link",
1116
+ "image",
1117
+ "strong",
1118
+ "em",
1119
+ "codespan",
1120
+ "br",
1121
+ "del",
1122
+ "text"
1123
+ ].includes(i.type)) {
1124
+ n += e || "";
1125
+ continue;
1126
+ }
1127
+ }
1128
+ let a = i;
1129
+ switch (a.type) {
1130
+ case "escape":
1131
+ n += t.text(a);
1132
+ break;
1133
+ case "html":
1134
+ n += t.html(a);
1135
+ break;
1136
+ case "link":
1137
+ n += t.link(a);
1138
+ break;
1139
+ case "image":
1140
+ n += t.image(a);
1141
+ break;
1142
+ case "strong":
1143
+ n += t.strong(a);
1144
+ break;
1145
+ case "em":
1146
+ n += t.em(a);
1147
+ break;
1148
+ case "codespan":
1149
+ n += t.codespan(a);
1150
+ break;
1151
+ case "br":
1152
+ n += t.br(a);
1153
+ break;
1154
+ case "del":
1155
+ n += t.del(a);
1156
+ break;
1157
+ case "text":
1158
+ n += t.text(a);
1159
+ break;
1160
+ default: {
1161
+ let e = "Token with \"" + a.type + "\" type was not found.";
1162
+ if (this.options.silent) return console.error(e), "";
1163
+ throw Error(e);
1164
+ }
1165
+ }
1166
+ }
1167
+ return n;
1168
+ }
1169
+ }, z = class {
1170
+ options;
1171
+ block;
1172
+ constructor(e) {
1173
+ this.options = e || f;
1174
+ }
1175
+ static passThroughHooks = /* @__PURE__ */ new Set([
1176
+ "preprocess",
1177
+ "postprocess",
1178
+ "processAllTokens",
1179
+ "emStrongMask"
1180
+ ]);
1181
+ static passThroughHooksRespectAsync = /* @__PURE__ */ new Set([
1182
+ "preprocess",
1183
+ "postprocess",
1184
+ "processAllTokens"
1185
+ ]);
1186
+ preprocess(e) {
1187
+ return e;
1188
+ }
1189
+ postprocess(e) {
1190
+ return e;
1191
+ }
1192
+ processAllTokens(e) {
1193
+ return e;
1194
+ }
1195
+ emStrongMask(e) {
1196
+ return e;
1197
+ }
1198
+ provideLexer() {
1199
+ return this.block ? F.lex : F.lexInline;
1200
+ }
1201
+ provideParser() {
1202
+ return this.block ? R.parse : R.parseInline;
1203
+ }
1204
+ }, B = new class {
1205
+ defaults = d();
1206
+ options = this.setOptions;
1207
+ parse = this.parseMarkdown(!0);
1208
+ parseInline = this.parseMarkdown(!1);
1209
+ Parser = R;
1210
+ Renderer = I;
1211
+ TextRenderer = L;
1212
+ Lexer = F;
1213
+ Tokenizer = P;
1214
+ Hooks = z;
1215
+ constructor(...e) {
1216
+ this.use(...e);
1217
+ }
1218
+ walkTokens(e, t) {
1219
+ let n = [];
1220
+ for (let r of e) switch (n = n.concat(t.call(this, r)), r.type) {
1221
+ case "table": {
1222
+ let e = r;
1223
+ for (let r of e.header) n = n.concat(this.walkTokens(r.tokens, t));
1224
+ for (let r of e.rows) for (let e of r) n = n.concat(this.walkTokens(e.tokens, t));
1225
+ break;
1226
+ }
1227
+ case "list": {
1228
+ let e = r;
1229
+ n = n.concat(this.walkTokens(e.items, t));
1230
+ break;
1231
+ }
1232
+ default: {
1233
+ let e = r;
1234
+ this.defaults.extensions?.childTokens?.[e.type] ? this.defaults.extensions.childTokens[e.type].forEach((r) => {
1235
+ let i = e[r].flat(Infinity);
1236
+ n = n.concat(this.walkTokens(i, t));
1237
+ }) : e.tokens && (n = n.concat(this.walkTokens(e.tokens, t)));
1238
+ }
1239
+ }
1240
+ return n;
1241
+ }
1242
+ use(...e) {
1243
+ let t = this.defaults.extensions || {
1244
+ renderers: {},
1245
+ childTokens: {}
1246
+ };
1247
+ return e.forEach((e) => {
1248
+ let n = { ...e };
1249
+ if (n.async = this.defaults.async || n.async || !1, e.extensions && (e.extensions.forEach((e) => {
1250
+ if (!e.name) throw Error("extension name required");
1251
+ if ("renderer" in e) {
1252
+ let n = t.renderers[e.name];
1253
+ n ? t.renderers[e.name] = function(...t) {
1254
+ let r = e.renderer.apply(this, t);
1255
+ return r === !1 && (r = n.apply(this, t)), r;
1256
+ } : t.renderers[e.name] = e.renderer;
1257
+ }
1258
+ if ("tokenizer" in e) {
1259
+ if (!e.level || e.level !== "block" && e.level !== "inline") throw Error("extension level must be 'block' or 'inline'");
1260
+ let n = t[e.level];
1261
+ 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]));
1262
+ }
1263
+ "childTokens" in e && e.childTokens && (t.childTokens[e.name] = e.childTokens);
1264
+ }), n.extensions = t), e.renderer) {
1265
+ let t = this.defaults.renderer || new I(this.defaults);
1266
+ for (let n in e.renderer) {
1267
+ if (!(n in t)) throw Error(`renderer '${n}' does not exist`);
1268
+ if (["options", "parser"].includes(n)) continue;
1269
+ let r = n, i = e.renderer[r], a = t[r];
1270
+ t[r] = (...e) => {
1271
+ let n = i.apply(t, e);
1272
+ return n === !1 && (n = a.apply(t, e)), n || "";
1273
+ };
1274
+ }
1275
+ n.renderer = t;
1276
+ }
1277
+ if (e.tokenizer) {
1278
+ let t = this.defaults.tokenizer || new P(this.defaults);
1279
+ for (let n in e.tokenizer) {
1280
+ if (!(n in t)) throw Error(`tokenizer '${n}' does not exist`);
1281
+ if ([
1282
+ "options",
1283
+ "rules",
1284
+ "lexer"
1285
+ ].includes(n)) continue;
1286
+ let r = n, i = e.tokenizer[r], a = t[r];
1287
+ t[r] = (...e) => {
1288
+ let n = i.apply(t, e);
1289
+ return n === !1 && (n = a.apply(t, e)), n;
1290
+ };
1291
+ }
1292
+ n.tokenizer = t;
1293
+ }
1294
+ if (e.hooks) {
1295
+ let t = this.defaults.hooks || new z();
1296
+ for (let n in e.hooks) {
1297
+ if (!(n in t)) throw Error(`hook '${n}' does not exist`);
1298
+ if (["options", "block"].includes(n)) continue;
1299
+ let r = n, i = e.hooks[r], a = t[r];
1300
+ z.passThroughHooks.has(n) ? t[r] = (e) => {
1301
+ if (this.defaults.async && z.passThroughHooksRespectAsync.has(n)) return (async () => {
1302
+ let n = await i.call(t, e);
1303
+ return a.call(t, n);
1304
+ })();
1305
+ let r = i.call(t, e);
1306
+ return a.call(t, r);
1307
+ } : t[r] = (...e) => {
1308
+ if (this.defaults.async) return (async () => {
1309
+ let n = await i.apply(t, e);
1310
+ return n === !1 && (n = await a.apply(t, e)), n;
1311
+ })();
1312
+ let n = i.apply(t, e);
1313
+ return n === !1 && (n = a.apply(t, e)), n;
1314
+ };
1315
+ }
1316
+ n.hooks = t;
1317
+ }
1318
+ if (e.walkTokens) {
1319
+ let t = this.defaults.walkTokens, r = e.walkTokens;
1320
+ n.walkTokens = function(e) {
1321
+ let n = [];
1322
+ return n.push(r.call(this, e)), t && (n = n.concat(t.call(this, e))), n;
1323
+ };
1324
+ }
1325
+ this.defaults = {
1326
+ ...this.defaults,
1327
+ ...n
1328
+ };
1329
+ }), this;
1330
+ }
1331
+ setOptions(e) {
1332
+ return this.defaults = {
1333
+ ...this.defaults,
1334
+ ...e
1335
+ }, this;
1336
+ }
1337
+ lexer(e, t) {
1338
+ return F.lex(e, t ?? this.defaults);
1339
+ }
1340
+ parser(e, t) {
1341
+ return R.parse(e, t ?? this.defaults);
1342
+ }
1343
+ parseMarkdown(e) {
1344
+ return (t, n) => {
1345
+ let r = { ...n }, i = {
1346
+ ...this.defaults,
1347
+ ...r
1348
+ }, a = this.onError(!!i.silent, !!i.async);
1349
+ if (this.defaults.async === !0 && r.async === !1) return a(/* @__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."));
1350
+ if (typeof t > "u" || t === null) return a(/* @__PURE__ */ Error("marked(): input parameter is undefined or null"));
1351
+ if (typeof t != "string") return a(/* @__PURE__ */ Error("marked(): input parameter is of type " + Object.prototype.toString.call(t) + ", string expected"));
1352
+ if (i.hooks && (i.hooks.options = i, i.hooks.block = e), i.async) return (async () => {
1353
+ let n = i.hooks ? await i.hooks.preprocess(t) : t, r = await (i.hooks ? await i.hooks.provideLexer() : e ? F.lex : F.lexInline)(n, i), a = i.hooks ? await i.hooks.processAllTokens(r) : r;
1354
+ i.walkTokens && await Promise.all(this.walkTokens(a, i.walkTokens));
1355
+ let o = await (i.hooks ? await i.hooks.provideParser() : e ? R.parse : R.parseInline)(a, i);
1356
+ return i.hooks ? await i.hooks.postprocess(o) : o;
1357
+ })().catch(a);
1358
+ try {
1359
+ i.hooks && (t = i.hooks.preprocess(t));
1360
+ let n = (i.hooks ? i.hooks.provideLexer() : e ? F.lex : F.lexInline)(t, i);
1361
+ i.hooks && (n = i.hooks.processAllTokens(n)), i.walkTokens && this.walkTokens(n, i.walkTokens);
1362
+ let r = (i.hooks ? i.hooks.provideParser() : e ? R.parse : R.parseInline)(n, i);
1363
+ return i.hooks && (r = i.hooks.postprocess(r)), r;
1364
+ } catch (e) {
1365
+ return a(e);
1366
+ }
1367
+ };
1368
+ }
1369
+ onError(e, t) {
1370
+ return (n) => {
1371
+ if (n.message += "\nPlease report this to https://github.com/markedjs/marked.", e) {
1372
+ let e = "<p>An error occurred:</p><pre>" + M(n.message + "", !0) + "</pre>";
1373
+ return t ? Promise.resolve(e) : e;
1374
+ }
1375
+ if (t) return Promise.reject(n);
1376
+ throw n;
1377
+ };
1378
+ }
1379
+ }();
1380
+ function V(e, t) {
1381
+ return B.parse(e, t);
1382
+ }
1383
+ V.options = V.setOptions = function(e) {
1384
+ return B.setOptions(e), V.defaults = B.defaults, p(V.defaults), V;
1385
+ }, V.getDefaults = d, V.defaults = f, V.use = function(...e) {
1386
+ return B.use(...e), V.defaults = B.defaults, p(V.defaults), V;
1387
+ }, V.walkTokens = function(e, t) {
1388
+ return B.walkTokens(e, t);
1389
+ }, V.parseInline = B.parseInline, V.Parser = R, V.parser = R.parse, V.Renderer = I, V.TextRenderer = L, V.Lexer = F, V.lexer = F.lex, V.Tokenizer = P, V.Hooks = z, V.parse = V, V.options, V.setOptions, V.use, V.walkTokens, V.parseInline, R.parse, F.lex;
1390
+ //#endregion
1391
+ //#region node_modules/ts-dedent/esm/index.js
1392
+ function Xe(e) {
1393
+ var t = [...arguments].slice(1), n = Array.from(typeof e == "string" ? [e] : e);
1394
+ n[n.length - 1] = n[n.length - 1].replace(/\r?\n([\t ]*)$/, "");
1395
+ var r = n.reduce(function(e, t) {
1396
+ var n = t.match(/\n([\t ]+|(?!\s).)/g);
1397
+ return n ? e.concat(n.map(function(e) {
1398
+ return e.match(/[\t ]/g)?.length ?? 0;
1399
+ })) : e;
1400
+ }, []);
1401
+ if (r.length) {
1402
+ var i = RegExp(`
1403
+ [ ]{${Math.min.apply(Math, r)}}`, "g");
1404
+ n = n.map(function(e) {
1405
+ return e.replace(i, "\n");
1406
+ });
1407
+ }
1408
+ n[0] = n[0].replace(/^\r?\n/, "");
1409
+ var a = n[0];
1410
+ return t.forEach(function(e, t) {
1411
+ var r = a.match(/(?:^|\n)( *)$/), i = r ? r[1] : "", o = e;
1412
+ typeof e == "string" && e.includes("\n") && (o = String(e).split("\n").map(function(e, t) {
1413
+ return t === 0 ? e : `${i}${e}`;
1414
+ }).join("\n")), a += o + n[t + 1];
1415
+ }), a;
1416
+ }
1417
+ //#endregion
1418
+ //#region node_modules/mermaid/dist/chunks/mermaid.core/chunk-MBY4JIJT.mjs
1419
+ var H = typeof performance < "u" && typeof performance.now == "function", U = /* @__PURE__ */ r(() => H ? performance.now() : 0, "now"), W = "🧜 ", Ze = "Mermaid render", Qe = "Mermaid", $e = {
1420
+ parse: "tertiary",
1421
+ prepare: "secondary",
1422
+ measure: "primary",
1423
+ layout: "primary-dark",
1424
+ layoutCore: "error",
1425
+ draw: "primary-light",
1426
+ paint: "secondary-dark",
1427
+ serialize: "tertiary-dark",
1428
+ render: "primary-light"
1429
+ };
1430
+ (class {
1431
+ constructor() {
1432
+ this.enabled = !1, this.autoPrint = !0, this.records = [], this.maxRecords = 200, this.roots = [], this.stack = [], this.buckets = {};
1433
+ }
1434
+ static {
1435
+ r(this, "Profiler");
1436
+ }
1437
+ enable() {
1438
+ return this.enabled = !0, this;
1439
+ }
1440
+ disable() {
1441
+ return this.enabled = !1, this;
1442
+ }
1443
+ start(e) {
1444
+ this.enabled && (this.roots = [], this.stack = [], this.buckets = {}, this.begin(e));
1445
+ }
1446
+ tickSync(e, t) {
1447
+ if (!this.enabled) return t();
1448
+ let n = U();
1449
+ try {
1450
+ return t();
1451
+ } finally {
1452
+ this.buckets[e] = (this.buckets[e] ?? 0) + (U() - n);
1453
+ }
1454
+ }
1455
+ async tick(e, t) {
1456
+ if (!this.enabled) return t();
1457
+ let n = U();
1458
+ try {
1459
+ return await t();
1460
+ } finally {
1461
+ this.buckets[e] = (this.buckets[e] ?? 0) + (U() - n);
1462
+ }
1463
+ }
1464
+ stop() {
1465
+ if (!this.enabled) return;
1466
+ for (; this.stack.length > 0;) this.end();
1467
+ let e = this.roots.at(-1), t = this.runLabel ?? e?.name;
1468
+ return e && (this.records.push({
1469
+ label: t ?? e.name,
1470
+ tree: e,
1471
+ buckets: { ...this.buckets }
1472
+ }), this.records.length > this.maxRecords && this.records.splice(0, this.records.length - this.maxRecords), this.autoPrint && this.printSummary(e, t)), this.runLabel = void 0, e;
1473
+ }
1474
+ begin(e) {
1475
+ if (!this.enabled) return;
1476
+ let t = {
1477
+ name: e,
1478
+ start: U(),
1479
+ duration: -1,
1480
+ children: []
1481
+ }, n = this.stack.at(-1);
1482
+ if (n ? n.children.push(t) : this.roots.push(t), this.stack.push(t), H && typeof performance.mark == "function") try {
1483
+ performance.mark(`${W}${e} \u25B6`);
1484
+ } catch {}
1485
+ }
1486
+ end() {
1487
+ if (!this.enabled) return;
1488
+ let e = this.stack.pop();
1489
+ if (!e) return;
1490
+ let t = U();
1491
+ if (e.duration = t - e.start, H && typeof performance.measure == "function") try {
1492
+ performance.measure(`${W}${e.name}`, {
1493
+ start: e.start,
1494
+ end: t,
1495
+ detail: { devtools: {
1496
+ dataType: "track-entry",
1497
+ track: Ze,
1498
+ trackGroup: Qe,
1499
+ color: $e[e.name] ?? "primary",
1500
+ tooltipText: `${e.name} \u2014 ${e.duration.toFixed(1)} ms`
1501
+ } }
1502
+ });
1503
+ } catch {}
1504
+ }
1505
+ async span(e, t) {
1506
+ if (!this.enabled) return t();
1507
+ this.begin(e);
1508
+ try {
1509
+ return await t();
1510
+ } finally {
1511
+ this.end();
1512
+ }
1513
+ }
1514
+ report() {
1515
+ return this.records.at(-1)?.tree ?? this.roots.at(-1);
1516
+ }
1517
+ clear() {
1518
+ this.records.length = 0, this.roots = [], this.stack = [], this.runLabel = void 0;
1519
+ }
1520
+ reset() {
1521
+ this.roots = [], this.stack = [];
1522
+ }
1523
+ printSummary(e = this.report(), t) {
1524
+ if (!e) return;
1525
+ let n = e.duration, i = t && t !== e.name ? `${e.name} [${t}]` : e.name, a = ["ms % phase"], o = /* @__PURE__ */ r((e, t) => {
1526
+ let r = " ".repeat(t), i = e.duration.toFixed(1).padStart(8), s = n > 0 ? `${(e.duration / n * 100).toFixed(0).padStart(3)}%` : " -";
1527
+ a.push(`${i} ${s} ${r}${e.name}`);
1528
+ for (let n of e.children) o(n, t + 1);
1529
+ if (e.children.length > 0) {
1530
+ let t = e.children.reduce((e, t) => e + t.duration, 0), n = e.duration - t;
1531
+ if (n > .5) {
1532
+ let e = n.toFixed(1).padStart(8);
1533
+ a.push(`${e} ${r} (self)`);
1534
+ }
1535
+ }
1536
+ }, "walk");
1537
+ o(e, 0);
1538
+ let s = Object.keys(this.buckets);
1539
+ if (s.length > 0) {
1540
+ a.push("—— buckets (summed) ——");
1541
+ for (let e of s) a.push(`${this.buckets[e].toFixed(1).padStart(8)} ${e}`);
1542
+ }
1543
+ console.log(`${W}mermaid render profile \xB7 ${i}
1544
+ ${a.join("\n")}`);
1545
+ }
1546
+ }), globalThis.injected ??= {
1547
+ includeLargeFeatures: !0,
1548
+ profiling: !1,
1549
+ version: "0.0.0"
1550
+ };
1551
+ function et(e, { markdownAutoWrap: t }) {
1552
+ return Xe(e.replace(/<br\/>/g, "\n").replace(/\n{2,}/g, "\n"));
1553
+ }
1554
+ r(et, "preprocessMarkdown");
1555
+ function tt(e) {
1556
+ return e.split(/\\n|\n|<br\s*\/?>/gi).map((e) => e.trim().match(/<[^>]+>|[^\s<>]+/g)?.map((e) => ({
1557
+ content: e,
1558
+ type: "normal"
1559
+ })) ?? []);
1560
+ }
1561
+ r(tt, "nonMarkdownToLines");
1562
+ function G(e, t = {}) {
1563
+ let n = et(e, t), i = V.lexer(n), a = [[]], o = 0;
1564
+ function s(e, t = "normal") {
1565
+ e.type === "text" ? e.text.split("\n").forEach((e, n) => {
1566
+ n !== 0 && (o++, a.push([])), e.split(" ").forEach((e) => {
1567
+ e = e.replace(/&#39;/g, "'"), e && a[o].push({
1568
+ content: e,
1569
+ type: t
1570
+ });
1571
+ });
1572
+ }) : e.type === "strong" || e.type === "em" ? e.tokens.forEach((t) => {
1573
+ s(t, e.type);
1574
+ }) : e.type === "html" && a[o].push({
1575
+ content: e.text,
1576
+ type: "normal"
1577
+ });
1578
+ }
1579
+ return r(s, "processNode"), i.forEach((e) => {
1580
+ e.type === "paragraph" ? e.tokens?.forEach((e) => {
1581
+ s(e);
1582
+ }) : e.type === "html" ? a[o].push({
1583
+ content: e.text,
1584
+ type: "normal"
1585
+ }) : a[o].push({
1586
+ content: e.raw,
1587
+ type: "normal"
1588
+ });
1589
+ }), a;
1590
+ }
1591
+ r(G, "markdownToLines");
1592
+ function nt(e) {
1593
+ return e ? `<p>${e.replace(/\\n|\n/g, "<br />")}</p>` : "";
1594
+ }
1595
+ r(nt, "nonMarkdownToHTML");
1596
+ function rt(t, { markdownAutoWrap: n } = {}) {
1597
+ let i = V.lexer(t);
1598
+ function a(t) {
1599
+ return t.type === "text" ? n === !1 ? t.text.replace(/\n */g, "<br/>").replace(/ /g, "&nbsp;") : t.text.replace(/\n */g, "<br/>") : t.type === "strong" ? `<strong>${t.tokens?.map(a).join("")}</strong>` : t.type === "em" ? `<em>${t.tokens?.map(a).join("")}</em>` : t.type === "paragraph" ? `<p>${t.tokens?.map(a).join("")}</p>` : t.type === "space" ? "" : t.type === "html" ? `${t.text}` : t.type === "escape" ? t.text : (e.warn(`Unsupported markdown: ${t.type}`), t.raw);
1600
+ }
1601
+ return r(a, "output"), i.map(a).join("");
1602
+ }
1603
+ r(rt, "markdownToHTML");
1604
+ var it = (function(e) {
1605
+ var t = e.requestAnimationFrame || e.webkitRequestAnimationFrame || e.mozRequestAnimationFrame || e.msRequestAnimationFrame || function(e) {
1606
+ return setTimeout(e, 16);
1607
+ };
1608
+ function n() {
1609
+ var n = this;
1610
+ n.reads = [], n.writes = [], n.raf = t.bind(e);
1611
+ }
1612
+ r(n, "FastDom"), n.prototype = {
1613
+ constructor: n,
1614
+ runTasks: /* @__PURE__ */ r(function(e) {
1615
+ for (var t; t = e.shift();) t();
1616
+ }, "runTasks"),
1617
+ measure: /* @__PURE__ */ r(function(e, t) {
1618
+ var n = t ? e.bind(t) : e;
1619
+ return this.reads.push(n), i(this), n;
1620
+ }, "measure"),
1621
+ mutate: /* @__PURE__ */ r(function(e, t) {
1622
+ var n = t ? e.bind(t) : e;
1623
+ return this.writes.push(n), i(this), n;
1624
+ }, "mutate"),
1625
+ clear: /* @__PURE__ */ r(function(e) {
1626
+ return o(this.reads, e) || o(this.writes, e);
1627
+ }, "clear"),
1628
+ extend: /* @__PURE__ */ r(function(e) {
1629
+ if (typeof e != "object") throw Error("expected object");
1630
+ var t = Object.create(this);
1631
+ return s(t, e), t.fastdom = this, t.initialize && t.initialize(), t;
1632
+ }, "extend"),
1633
+ catch: null
1634
+ };
1635
+ function i(e) {
1636
+ e.scheduled || (e.scheduled = !0, e.raf(a.bind(null, e)));
1637
+ }
1638
+ r(i, "scheduleFlush");
1639
+ function a(e) {
1640
+ var t = e.writes, n = e.reads, r;
1641
+ try {
1642
+ n.length, e.runTasks(n), t.length, e.runTasks(t);
1643
+ } catch (e) {
1644
+ r = e;
1645
+ }
1646
+ if (e.scheduled = !1, (n.length || t.length) && i(e), r) if (r.message, e.catch) e.catch(r);
1647
+ else throw r;
1648
+ }
1649
+ r(a, "flush");
1650
+ function o(e, t) {
1651
+ var n = e.indexOf(t);
1652
+ return !!~n && !!e.splice(n, 1);
1653
+ }
1654
+ r(o, "remove");
1655
+ function s(e, t) {
1656
+ for (var n in t) t.hasOwnProperty(n) && (e[n] = t[n]);
1657
+ }
1658
+ return r(s, "mixin"), e.fastdom = e.fastdom || new n();
1659
+ })(typeof window < "u" ? window : globalThis), at = {
1660
+ initialize: /* @__PURE__ */ r(function() {
1661
+ this._tasks = /* @__PURE__ */ new Map();
1662
+ }, "initialize"),
1663
+ mutate: /* @__PURE__ */ r(function(e, t) {
1664
+ return K(this, "mutate", e, t);
1665
+ }, "mutate"),
1666
+ measure: /* @__PURE__ */ r(function(e, t) {
1667
+ return K(this, "measure", e, t);
1668
+ }, "measure"),
1669
+ clear: /* @__PURE__ */ r(function(e) {
1670
+ var t = this._tasks, n = t.get(e);
1671
+ this.fastdom.clear(n), t.delete(e);
1672
+ }, "clear")
1673
+ };
1674
+ function K(e, t, n, r) {
1675
+ var i = e._tasks, a = e.fastdom, o, s = new Promise(function(e, c) {
1676
+ o = a[t](function() {
1677
+ i.delete(s);
1678
+ try {
1679
+ e(r ? n.call(r) : n());
1680
+ } catch (e) {
1681
+ c(e);
1682
+ }
1683
+ }, r);
1684
+ });
1685
+ return i.set(s, o), s;
1686
+ }
1687
+ r(K, "create");
1688
+ var { initialize: ot, mutate: st, measure: ct, clear: lt } = at, ut = at, dt = it.extend({ raf(e) {
1689
+ typeof queueMicrotask == "function" ? queueMicrotask(e) : setTimeout(e, 0);
1690
+ } }).extend(ut);
1691
+ function ft(e) {
1692
+ return Intl.Segmenter ? [...new Intl.Segmenter().segment(e)].map((e) => e.segment) : [...e];
1693
+ }
1694
+ r(ft, "splitTextToChars");
1695
+ function pt(e, t) {
1696
+ return q(e, [], ft(t.content), t.type);
1697
+ }
1698
+ r(pt, "splitWordToFitWidth");
1699
+ function q(e, t, n, r) {
1700
+ if (n.length === 0) return [{
1701
+ content: t.join(""),
1702
+ type: r
1703
+ }, {
1704
+ content: "",
1705
+ type: r
1706
+ }];
1707
+ let [i, ...a] = n, o = [...t, i];
1708
+ return e([{
1709
+ content: o.join(""),
1710
+ type: r
1711
+ }]) ? q(e, o, a, r) : (t.length === 0 && i && (t.push(i), n.shift()), [{
1712
+ content: t.join(""),
1713
+ type: r
1714
+ }, {
1715
+ content: n.join(""),
1716
+ type: r
1717
+ }]);
1718
+ }
1719
+ r(q, "splitWordToFitWidthRecursion");
1720
+ function mt(e, t) {
1721
+ if (e.some(({ content: e }) => e.includes("\n"))) throw Error("splitLineToFitWidth does not support newlines in the line");
1722
+ return J(e, t);
1723
+ }
1724
+ r(mt, "splitLineToFitWidth");
1725
+ function J(e, t, n = [], r = []) {
1726
+ if (e.length === 0) return r.length > 0 && n.push(r), n.length > 0 ? n : [];
1727
+ let i = "";
1728
+ e[0].content === " " && (i = " ", e.shift());
1729
+ let a = e.shift() ?? {
1730
+ content: " ",
1731
+ type: "normal"
1732
+ }, o = [...r];
1733
+ if (i !== "" && o.push({
1734
+ content: i,
1735
+ type: "normal"
1736
+ }), o.push(a), t(o)) return J(e, t, n, o);
1737
+ if (r.length > 0) n.push(r), e.unshift(a);
1738
+ else if (a.content) {
1739
+ let [r, i] = pt(t, a);
1740
+ n.push([r]), i.content && e.unshift(i);
1741
+ }
1742
+ return J(e, t, n);
1743
+ }
1744
+ r(J, "splitLineToFitWidthRecursion");
1745
+ function Y(e, t) {
1746
+ t && e.attr("style", t);
1747
+ }
1748
+ r(Y, "applyStyle");
1749
+ var ht = 16384;
1750
+ async function X(e, t, n, r, l = !1, u = o(), d = 0) {
1751
+ let f = e.append("foreignObject");
1752
+ f.attr("width", `${Math.min(10 * n, ht)}px`), f.attr("height", `${Math.min(10 * n, ht)}px`);
1753
+ let p = f.append("xhtml:div"), m = i(t.label) ? await a(t.label.replace(s.lineBreakRegex, "\n"), u) : c(t.label, u), h = t.isNode ? "nodeLabel" : "edgeLabel", g = p.append("span");
1754
+ g.html(m), Y(g, t.labelStyle), g.attr("class", `${h} ${r}`), Y(p, t.labelStyle), p.style("display", "table-cell"), p.style("white-space", "nowrap"), p.style("line-height", "1.5"), n !== Infinity && (p.style("max-width", n + "px"), p.style("text-align", "center")), p.attr("xmlns", "http://www.w3.org/1999/xhtml"), l && p.attr("class", "labelBkg");
1755
+ let _ = await dt.measure(() => p.node().getBoundingClientRect());
1756
+ return _.width === n ? (p.style("display", "table"), p.style("white-space", "break-spaces"), p.style("width", n + "px")) : _.width < d && (p.style("display", "table"), p.style("width", d + "px"), p.style("text-align", "center")), f.node();
1757
+ }
1758
+ r(X, "addHtmlSpan");
1759
+ function Z(e, t, n, r = !1) {
1760
+ let i = e.append("tspan").attr("class", "text-outer-tspan").attr("x", 0).attr("y", t * n - .1 + "em").attr("dy", n + "em");
1761
+ return r && i.attr("text-anchor", "middle"), i;
1762
+ }
1763
+ r(Z, "createTspan");
1764
+ function gt(e, t, n) {
1765
+ let r = e.append("text"), i = Z(r, 1, t);
1766
+ $(i, n);
1767
+ let a = i.node().getComputedTextLength();
1768
+ return r.remove(), a;
1769
+ }
1770
+ r(gt, "computeWidthOfText");
1771
+ function _t(e, t, n) {
1772
+ let r = e.append("text"), i = Z(r, 1, t);
1773
+ $(i, [{
1774
+ content: n,
1775
+ type: "normal"
1776
+ }]);
1777
+ let a = i.node()?.getBoundingClientRect();
1778
+ return a && r.remove(), a;
1779
+ }
1780
+ r(_t, "computeDimensionOfText");
1781
+ function vt(e, t, n, i = !1, a = !1) {
1782
+ let o = 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");
1783
+ a && l.attr("text-anchor", "middle");
1784
+ let u = 0;
1785
+ for (let t of n) {
1786
+ let n = /* @__PURE__ */ r((t) => gt(s, o, t) <= e, "checkWidth"), i = n(t) ? [t] : mt(t, n);
1787
+ for (let e of i) $(Z(l, u, o, a), e), u++;
1788
+ }
1789
+ if (i) {
1790
+ let e = l.node().getBBox();
1791
+ return c.attr("x", e.x - 2).attr("y", e.y - 2).attr("width", e.width + 4).attr("height", e.height + 4), s.node();
1792
+ } else return l.node();
1793
+ }
1794
+ r(vt, "createFormattedText");
1795
+ function Q(e) {
1796
+ return e.replace(/&(amp|lt|gt);/g, (e, t) => {
1797
+ switch (t) {
1798
+ case "amp": return "&";
1799
+ case "lt": return "<";
1800
+ case "gt": return ">";
1801
+ default: return e;
1802
+ }
1803
+ });
1804
+ }
1805
+ r(Q, "decodeHTMLEntities");
1806
+ function $(e, t) {
1807
+ e.text(""), t.forEach((t, n) => {
1808
+ 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");
1809
+ n === 0 ? r.text(Q(t.content)) : r.text(" " + Q(t.content));
1810
+ });
1811
+ }
1812
+ r($, "updateTextContentAndStyles");
1813
+ async function yt(e, t = {}) {
1814
+ let n = [];
1815
+ e.replace(/(fa[bklrs]?):fa-([\w-]+)/g, (e, r, i) => (n.push((async () => {
1816
+ let n = `${r}:${i}`;
1817
+ return await l(n) ? await u(n, void 0, { class: "label-icon" }) : `<i class='${c(e, t).replace(":", " ")}'></i>`;
1818
+ })()), e));
1819
+ let r = await Promise.all(n);
1820
+ return e.replace(/(fa[bklrs]?):fa-([\w-]+)/g, () => r.shift() ?? "");
1821
+ }
1822
+ r(yt, "replaceIconSubstring");
1823
+ var bt = /* @__PURE__ */ r(async (r, a = "", { style: o = "", isTitle: s = !1, classes: c = "", useHtmlLabels: l = !0, markdown: u = !0, isNode: d = !0, width: f = 200, minWidth: p = 0, addSvgBackground: m = !1 } = {}, h) => {
1824
+ if (e.debug("XYZ createText", a, o, s, c, l, d, "addSvgBackground: ", m), l) {
1825
+ let e = await yt(n(u ? rt(a, h) : nt(a)), h), t = a.replace(/\\\\/g, "\\");
1826
+ return await X(r, {
1827
+ isNode: d,
1828
+ label: i(a) ? t : e,
1829
+ labelStyle: o.replace("fill:", "color:")
1830
+ }, f, c, m, h, p);
1831
+ } else {
1832
+ let e = n(a.replace(/<br\s*\/?>/g, "<br/>")), i = vt(f, r, u ? G(e.replace("<br>", "<br/>"), h) : tt(e), a ? m : !1, !d);
1833
+ if (d) {
1834
+ /stroke:/.exec(o) && (o = o.replace("stroke:", "lineColor:"));
1835
+ let e = o.replace(/stroke:[^;]+;?/g, "").replace(/stroke-width:[^;]+;?/g, "").replace(/fill:[^;]+;?/g, "").replace(/color:/g, "fill:");
1836
+ t(i).attr("style", e);
1837
+ } else {
1838
+ let e = o.replace(/stroke:[^;]+;?/g, "").replace(/stroke-width:[^;]+;?/g, "").replace(/fill:[^;]+;?/g, "").replace(/background:/g, "fill:");
1839
+ t(i).select("rect").attr("style", e.replace(/background:/g, "fill:"));
1840
+ let n = o.replace(/stroke:[^;]+;?/g, "").replace(/stroke-width:[^;]+;?/g, "").replace(/fill:[^;]+;?/g, "").replace(/color:/g, "fill:");
1841
+ t(i).select("text").attr("style", n);
1842
+ }
1843
+ return s ? t(i).selectAll("tspan.text-outer-tspan").classed("title-row", !0) : t(i).selectAll("tspan.text-outer-tspan").classed("row", !0), i;
1844
+ }
1845
+ }, "createText");
1846
+ //#endregion
1847
+ export { Xe as a, G as i, bt as n, dt as r, _t as t };