@blueking/ai-blueking 2.0.0-dev.2 → 2.0.0-dev.3

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 (183) hide show
  1. package/dist/vue2/_baseFor-DAbrc8SN.js +309 -0
  2. package/dist/vue2/arc-BqlAOiZb.js +78 -0
  3. package/dist/vue2/architecture-U656AL7Q-Dtuq8BzO.js +7 -0
  4. package/dist/vue2/architectureDiagram-VXUJARFQ-BQS5Ixrn.js +4052 -0
  5. package/dist/vue2/array-TB8zN_HT.js +5 -0
  6. package/dist/vue2/blockDiagram-VD42YOAC-Bp6L6c6e.js +3013 -0
  7. package/dist/vue2/c4Diagram-YG6GDRKO-B15ZDn3Z.js +2956 -0
  8. package/dist/vue2/channel-edTl5mpN.js +3 -0
  9. package/dist/vue2/chunk-4BX2VUAB-eAYYj1bL.js +6 -0
  10. package/dist/vue2/chunk-55IACEB6-CTzuTcHv.js +6 -0
  11. package/dist/vue2/chunk-76Q3JFCE-BrJX66ha.js +19 -0
  12. package/dist/vue2/chunk-ABZYJK2D-gsx40GnJ.js +1971 -0
  13. package/dist/vue2/chunk-ATLVNIR6-CTTwtx-5.js +65 -0
  14. package/dist/vue2/chunk-B4BG7PRW-D8o7VxRH.js +3108 -0
  15. package/dist/vue2/chunk-CVBHYZKI-Cs8lCw3u.js +10 -0
  16. package/dist/vue2/chunk-DI55MBZ5-Dl59YBtR.js +1994 -0
  17. package/dist/vue2/chunk-DNh5sLlG.js +18 -0
  18. package/dist/vue2/chunk-EXTU4WIE-BPc8ye_N.js +7 -0
  19. package/dist/vue2/chunk-FMBD7UC4-PFlLPz_s.js +3 -0
  20. package/dist/vue2/chunk-FPAJGGOC-DPvjUKQ8.js +13428 -0
  21. package/dist/vue2/chunk-FWNWRKHM-BlUTFsPK.js +56 -0
  22. package/dist/vue2/chunk-HN2XXSSU-DueSY85P.js +74 -0
  23. package/dist/vue2/chunk-JA3XYJ7Z-CRet4f6a.js +1845 -0
  24. package/dist/vue2/chunk-JZLCHNYA-Df0-MseJ.js +4861 -0
  25. package/dist/vue2/chunk-LBM3YZW2-B0-w2HZs.js +19 -0
  26. package/dist/vue2/chunk-LHMN2FUI-BOH3yE2u.js +19 -0
  27. package/dist/vue2/chunk-MI3HLSF2-6-T1J0MS.js +1140 -0
  28. package/dist/vue2/chunk-N4CR4FBY-jNnt5D3v.js +39 -0
  29. package/dist/vue2/chunk-O7ZBX7Z2-BEP34BEE.js +26 -0
  30. package/dist/vue2/chunk-QN33PNHL-DsC-XeM9.js +23 -0
  31. package/dist/vue2/chunk-QXUST7PY-DxFRymyS.js +486 -0
  32. package/dist/vue2/chunk-QZHKN3VN-D9B5jQvg.js +11 -0
  33. package/dist/vue2/chunk-S3R3BYOJ-Bs_r55Kk.js +1222 -0
  34. package/dist/vue2/chunk-S6J4BHB3-XXfWHJvh.js +19 -0
  35. package/dist/vue2/chunk-T53DSG4Q-CNvqP6Iy.js +24 -0
  36. package/dist/vue2/chunk-TZMSLE5B-C5ccYWGN.js +55 -0
  37. package/dist/vue2/chunk-XAJISQIX-XsDvU4jW.js +135 -0
  38. package/dist/vue2/classDiagram-2ON5EDUG-Cgf9yVXj.js +33 -0
  39. package/dist/vue2/classDiagram-v2-WZHVMYZB-BtF1_0UK.js +33 -0
  40. package/dist/vue2/clone-Bbr3WSpg.js +7 -0
  41. package/dist/vue2/cose-bilkent-S5V4N54A-Cmf6WLkk.js +2250 -0
  42. package/dist/vue2/cytoscape.esm-nrcriBSO.js +18100 -0
  43. package/dist/vue2/dagre-6UL2VRFP-CTl_U96l.js +298 -0
  44. package/dist/vue2/dagre-DUjlMe_B.js +1496 -0
  45. package/dist/vue2/defaultLocale-BLATqOV5.js +177 -0
  46. package/dist/vue2/diagram-PSM6KHXK-Bl7brR-1.js +497 -0
  47. package/dist/vue2/diagram-QEK2KX5R-CAeywSxy.js +226 -0
  48. package/dist/vue2/diagram-S2PKOQOG-6I6J4WRC.js +144 -0
  49. package/dist/vue2/dist-xWJvauxf.js +49 -0
  50. package/dist/vue2/erDiagram-Q2GNP2WA-C8EbfuTj.js +1603 -0
  51. package/dist/vue2/flatten-CfPhNHUL.js +34 -0
  52. package/dist/vue2/flowDiagram-NV44I4VS-lFr4G2WN.js +4132 -0
  53. package/dist/vue2/ganttDiagram-JELNMOA3-Bvtip7yn.js +3010 -0
  54. package/dist/vue2/gitGraph-F6HP7TQM-OQvD95bN.js +7 -0
  55. package/dist/vue2/gitGraphDiagram-NY62KEGX-Cjvy4fHM.js +634 -0
  56. package/dist/vue2/graphlib-KDKEjVHX.js +344 -0
  57. package/dist/vue2/index.es.min.js +26703 -786
  58. package/dist/vue2/index.umd.min.js +2796 -9
  59. package/dist/vue2/info-NVLQJR56-DBsOnIKy.js +7 -0
  60. package/dist/vue2/infoDiagram-WHAUD3N6-D_isj7oC.js +31 -0
  61. package/dist/vue2/init-hAkIK9Bd.js +13 -0
  62. package/dist/vue2/isEmpty-z27q3o-D.js +32 -0
  63. package/dist/vue2/journeyDiagram-XKPGCS4Q-DlXHMS3v.js +885 -0
  64. package/dist/vue2/kanban-definition-3W4ZIXB7-CV6572lv.js +971 -0
  65. package/dist/vue2/katex-CEAw-xiA.js +22097 -0
  66. package/dist/vue2/katex-D8o5-F7C.js +2 -0
  67. package/dist/vue2/line-wvheYP7S.js +30 -0
  68. package/dist/vue2/linear-STTevhnH.js +250 -0
  69. package/dist/vue2/math-DF_v6dOl.js +8 -0
  70. package/dist/vue2/mermaid-parser.core-VAa8Vi1g.js +48 -0
  71. package/dist/vue2/mermaid.core-vqI6KB9k.js +895 -0
  72. package/dist/vue2/mindmap-definition-VGOIOE7T-gtjvHqQ-.js +960 -0
  73. package/dist/vue2/ordinal-DOM6Fa9P.js +61 -0
  74. package/dist/vue2/packet-BFZMPI3H-CG049KmZ.js +7 -0
  75. package/dist/vue2/path-CW_-_Ti7.js +79 -0
  76. package/dist/vue2/pie-7BOR55EZ-BHq0KcLP.js +7 -0
  77. package/dist/vue2/pieDiagram-ADFJNKIX-CTUoM-kp.js +172 -0
  78. package/dist/vue2/purify.es-Cm_tUMzZ.js +547 -0
  79. package/dist/vue2/quadrantDiagram-AYHSOK5B-Njl7BMW7.js +1971 -0
  80. package/dist/vue2/radar-NHE76QYJ-CUoVtrAx.js +7 -0
  81. package/dist/vue2/reduce-BFKSG9Rs.js +451 -0
  82. package/dist/vue2/requirementDiagram-UZGBJVZJ-DKjE3cDK.js +2194 -0
  83. package/dist/vue2/sankeyDiagram-TZEHDZUN-DW2ap3zY.js +885 -0
  84. package/dist/vue2/sequenceDiagram-WL72ISMW-BjMq4OjH.js +3561 -0
  85. package/dist/vue2/src-VlKYSsxJ.js +1975 -0
  86. package/dist/vue2/stateDiagram-FKZM4ZOC-CnvtGM9U.js +224 -0
  87. package/dist/vue2/stateDiagram-v2-4FDKWEC3-C15xi-04.js +32 -0
  88. package/dist/vue2/style.css +1 -1
  89. package/dist/vue2/timeline-definition-IT6M3QCI-C7q6jdLA.js +831 -0
  90. package/dist/vue2/treemap-KMMF4GRG--FdijCcy.js +7 -0
  91. package/dist/vue2/xychartDiagram-PRI3JC2R-UcfQmj72.js +2022 -0
  92. package/dist/vue3/_baseFor-DAbrc8SN.js +309 -0
  93. package/dist/vue3/arc-BqlAOiZb.js +78 -0
  94. package/dist/vue3/architecture-U656AL7Q-Dtuq8BzO.js +7 -0
  95. package/dist/vue3/architectureDiagram-VXUJARFQ-BQS5Ixrn.js +4052 -0
  96. package/dist/vue3/array-TB8zN_HT.js +5 -0
  97. package/dist/vue3/blockDiagram-VD42YOAC-Bp6L6c6e.js +3013 -0
  98. package/dist/vue3/c4Diagram-YG6GDRKO-B15ZDn3Z.js +2956 -0
  99. package/dist/vue3/channel-edTl5mpN.js +3 -0
  100. package/dist/vue3/chunk-4BX2VUAB-eAYYj1bL.js +6 -0
  101. package/dist/vue3/chunk-55IACEB6-CTzuTcHv.js +6 -0
  102. package/dist/vue3/chunk-76Q3JFCE-BrJX66ha.js +19 -0
  103. package/dist/vue3/chunk-ABZYJK2D-gsx40GnJ.js +1971 -0
  104. package/dist/vue3/chunk-ATLVNIR6-CTTwtx-5.js +65 -0
  105. package/dist/vue3/chunk-B4BG7PRW-D8o7VxRH.js +3108 -0
  106. package/dist/vue3/chunk-CVBHYZKI-Cs8lCw3u.js +10 -0
  107. package/dist/vue3/chunk-DI55MBZ5-Dl59YBtR.js +1994 -0
  108. package/dist/vue3/chunk-DNh5sLlG.js +18 -0
  109. package/dist/vue3/chunk-EXTU4WIE-BPc8ye_N.js +7 -0
  110. package/dist/vue3/chunk-FMBD7UC4-PFlLPz_s.js +3 -0
  111. package/dist/vue3/chunk-FPAJGGOC-DPvjUKQ8.js +13428 -0
  112. package/dist/vue3/chunk-FWNWRKHM-BlUTFsPK.js +56 -0
  113. package/dist/vue3/chunk-HN2XXSSU-DueSY85P.js +74 -0
  114. package/dist/vue3/chunk-JA3XYJ7Z-CRet4f6a.js +1845 -0
  115. package/dist/vue3/chunk-JZLCHNYA-Df0-MseJ.js +4861 -0
  116. package/dist/vue3/chunk-LBM3YZW2-B0-w2HZs.js +19 -0
  117. package/dist/vue3/chunk-LHMN2FUI-BOH3yE2u.js +19 -0
  118. package/dist/vue3/chunk-MI3HLSF2-6-T1J0MS.js +1140 -0
  119. package/dist/vue3/chunk-N4CR4FBY-jNnt5D3v.js +39 -0
  120. package/dist/vue3/chunk-O7ZBX7Z2-BEP34BEE.js +26 -0
  121. package/dist/vue3/chunk-QN33PNHL-DsC-XeM9.js +23 -0
  122. package/dist/vue3/chunk-QXUST7PY-DxFRymyS.js +486 -0
  123. package/dist/vue3/chunk-QZHKN3VN-D9B5jQvg.js +11 -0
  124. package/dist/vue3/chunk-S3R3BYOJ-Bs_r55Kk.js +1222 -0
  125. package/dist/vue3/chunk-S6J4BHB3-XXfWHJvh.js +19 -0
  126. package/dist/vue3/chunk-T53DSG4Q-CNvqP6Iy.js +24 -0
  127. package/dist/vue3/chunk-TZMSLE5B-C5ccYWGN.js +55 -0
  128. package/dist/vue3/chunk-XAJISQIX-XsDvU4jW.js +135 -0
  129. package/dist/vue3/classDiagram-2ON5EDUG-Cgf9yVXj.js +33 -0
  130. package/dist/vue3/classDiagram-v2-WZHVMYZB-BtF1_0UK.js +33 -0
  131. package/dist/vue3/clone-Bbr3WSpg.js +7 -0
  132. package/dist/vue3/cose-bilkent-S5V4N54A-Cmf6WLkk.js +2250 -0
  133. package/dist/vue3/cytoscape.esm-nrcriBSO.js +18100 -0
  134. package/dist/vue3/dagre-6UL2VRFP-CTl_U96l.js +298 -0
  135. package/dist/vue3/dagre-DUjlMe_B.js +1496 -0
  136. package/dist/vue3/defaultLocale-BLATqOV5.js +177 -0
  137. package/dist/vue3/diagram-PSM6KHXK-Bl7brR-1.js +497 -0
  138. package/dist/vue3/diagram-QEK2KX5R-CAeywSxy.js +226 -0
  139. package/dist/vue3/diagram-S2PKOQOG-6I6J4WRC.js +144 -0
  140. package/dist/vue3/dist-xWJvauxf.js +49 -0
  141. package/dist/vue3/erDiagram-Q2GNP2WA-C8EbfuTj.js +1603 -0
  142. package/dist/vue3/flatten-CfPhNHUL.js +34 -0
  143. package/dist/vue3/flowDiagram-NV44I4VS-lFr4G2WN.js +4132 -0
  144. package/dist/vue3/ganttDiagram-JELNMOA3-Bvtip7yn.js +3010 -0
  145. package/dist/vue3/gitGraph-F6HP7TQM-OQvD95bN.js +7 -0
  146. package/dist/vue3/gitGraphDiagram-NY62KEGX-Cjvy4fHM.js +634 -0
  147. package/dist/vue3/graphlib-KDKEjVHX.js +344 -0
  148. package/dist/vue3/index.es.min.js +26730 -813
  149. package/dist/vue3/index.umd.min.js +2796 -9
  150. package/dist/vue3/info-NVLQJR56-DBsOnIKy.js +7 -0
  151. package/dist/vue3/infoDiagram-WHAUD3N6-D_isj7oC.js +31 -0
  152. package/dist/vue3/init-hAkIK9Bd.js +13 -0
  153. package/dist/vue3/isEmpty-z27q3o-D.js +32 -0
  154. package/dist/vue3/journeyDiagram-XKPGCS4Q-DlXHMS3v.js +885 -0
  155. package/dist/vue3/kanban-definition-3W4ZIXB7-CV6572lv.js +971 -0
  156. package/dist/vue3/katex-CEAw-xiA.js +22097 -0
  157. package/dist/vue3/katex-D8o5-F7C.js +2 -0
  158. package/dist/vue3/line-wvheYP7S.js +30 -0
  159. package/dist/vue3/linear-STTevhnH.js +250 -0
  160. package/dist/vue3/math-DF_v6dOl.js +8 -0
  161. package/dist/vue3/mermaid-parser.core-VAa8Vi1g.js +48 -0
  162. package/dist/vue3/mermaid.core-vqI6KB9k.js +895 -0
  163. package/dist/vue3/mindmap-definition-VGOIOE7T-gtjvHqQ-.js +960 -0
  164. package/dist/vue3/ordinal-DOM6Fa9P.js +61 -0
  165. package/dist/vue3/packet-BFZMPI3H-CG049KmZ.js +7 -0
  166. package/dist/vue3/path-CW_-_Ti7.js +79 -0
  167. package/dist/vue3/pie-7BOR55EZ-BHq0KcLP.js +7 -0
  168. package/dist/vue3/pieDiagram-ADFJNKIX-CTUoM-kp.js +172 -0
  169. package/dist/vue3/purify.es-Cm_tUMzZ.js +547 -0
  170. package/dist/vue3/quadrantDiagram-AYHSOK5B-Njl7BMW7.js +1971 -0
  171. package/dist/vue3/radar-NHE76QYJ-CUoVtrAx.js +7 -0
  172. package/dist/vue3/reduce-BFKSG9Rs.js +451 -0
  173. package/dist/vue3/requirementDiagram-UZGBJVZJ-DKjE3cDK.js +2194 -0
  174. package/dist/vue3/sankeyDiagram-TZEHDZUN-DW2ap3zY.js +885 -0
  175. package/dist/vue3/sequenceDiagram-WL72ISMW-BjMq4OjH.js +3561 -0
  176. package/dist/vue3/src-VlKYSsxJ.js +1975 -0
  177. package/dist/vue3/stateDiagram-FKZM4ZOC-CnvtGM9U.js +224 -0
  178. package/dist/vue3/stateDiagram-v2-4FDKWEC3-C15xi-04.js +32 -0
  179. package/dist/vue3/style.css +1 -1
  180. package/dist/vue3/timeline-definition-IT6M3QCI-C7q6jdLA.js +831 -0
  181. package/dist/vue3/treemap-KMMF4GRG--FdijCcy.js +7 -0
  182. package/dist/vue3/xychartDiagram-PRI3JC2R-UcfQmj72.js +2022 -0
  183. package/package.json +1 -1
@@ -0,0 +1,1845 @@
1
+ import { g as log, h as __name, p as select_default } from "./src-VlKYSsxJ.js";
2
+ import { I as sanitizeText, N as renderKatexSanitized, O as hasKatex, s as common_default, y as getConfig } from "./chunk-ABZYJK2D-gsx40GnJ.js";
3
+ import { a as decodeEntities } from "./chunk-S3R3BYOJ-Bs_r55Kk.js";
4
+ var defaultIconDimensions = Object.freeze({
5
+ left: 0,
6
+ top: 0,
7
+ width: 16,
8
+ height: 16
9
+ }), defaultIconTransformations = Object.freeze({
10
+ rotate: 0,
11
+ vFlip: !1,
12
+ hFlip: !1
13
+ }), defaultIconProps = Object.freeze({
14
+ ...defaultIconDimensions,
15
+ ...defaultIconTransformations
16
+ }), defaultExtendedIconProps = Object.freeze({
17
+ ...defaultIconProps,
18
+ body: "",
19
+ hidden: !1
20
+ }), defaultIconSizeCustomisations = Object.freeze({
21
+ width: null,
22
+ height: null
23
+ }), defaultIconCustomisations = Object.freeze({
24
+ ...defaultIconSizeCustomisations,
25
+ ...defaultIconTransformations
26
+ }), stringToIcon = (e, o, s, c = "") => {
27
+ let l = e.split(":");
28
+ if (e.slice(0, 1) === "@") {
29
+ if (l.length < 2 || l.length > 3) return null;
30
+ c = l.shift().slice(1);
31
+ }
32
+ if (l.length > 3 || !l.length) return null;
33
+ if (l.length > 1) {
34
+ let e = l.pop(), s = l.pop(), u = {
35
+ provider: l.length > 0 ? l[0] : c,
36
+ prefix: s,
37
+ name: e
38
+ };
39
+ return o && !validateIconName(u) ? null : u;
40
+ }
41
+ let u = l[0], f = u.split("-");
42
+ if (f.length > 1) {
43
+ let e = {
44
+ provider: c,
45
+ prefix: f.shift(),
46
+ name: f.join("-")
47
+ };
48
+ return o && !validateIconName(e) ? null : e;
49
+ }
50
+ if (s && c === "") {
51
+ let e = {
52
+ provider: c,
53
+ prefix: "",
54
+ name: u
55
+ };
56
+ return o && !validateIconName(e, s) ? null : e;
57
+ }
58
+ return null;
59
+ }, validateIconName = (e, o) => e ? !!((o && e.prefix === "" || e.prefix) && e.name) : !1;
60
+ function mergeIconTransformations(e, o) {
61
+ let s = {};
62
+ !e.hFlip != !o.hFlip && (s.hFlip = !0), !e.vFlip != !o.vFlip && (s.vFlip = !0);
63
+ let c = ((e.rotate || 0) + (o.rotate || 0)) % 4;
64
+ return c && (s.rotate = c), s;
65
+ }
66
+ function mergeIconData(e, o) {
67
+ let s = mergeIconTransformations(e, o);
68
+ for (let c in defaultExtendedIconProps) c in defaultIconTransformations ? c in e && !(c in s) && (s[c] = defaultIconTransformations[c]) : c in o ? s[c] = o[c] : c in e && (s[c] = e[c]);
69
+ return s;
70
+ }
71
+ function getIconsTree(e, o) {
72
+ let s = e.icons, c = e.aliases || Object.create(null), l = Object.create(null);
73
+ function u(e) {
74
+ if (s[e]) return l[e] = [];
75
+ if (!(e in l)) {
76
+ l[e] = null;
77
+ let o = c[e] && c[e].parent, s = o && u(o);
78
+ s && (l[e] = [o].concat(s));
79
+ }
80
+ return l[e];
81
+ }
82
+ return (o || Object.keys(s).concat(Object.keys(c))).forEach(u), l;
83
+ }
84
+ function internalGetIconData(e, o, s) {
85
+ let c = e.icons, l = e.aliases || Object.create(null), u = {};
86
+ function f(e) {
87
+ u = mergeIconData(c[e] || l[e], u);
88
+ }
89
+ return f(o), s.forEach(f), mergeIconData(e, u);
90
+ }
91
+ function getIconData(e, o) {
92
+ if (e.icons[o]) return internalGetIconData(e, o, []);
93
+ let s = getIconsTree(e, [o])[o];
94
+ return s ? internalGetIconData(e, o, s) : null;
95
+ }
96
+ var unitsSplit = /(-?[0-9.]*[0-9]+[0-9.]*)/g, unitsTest = /^-?[0-9.]*[0-9]+[0-9.]*$/g;
97
+ function calculateSize(e, o, s) {
98
+ if (o === 1) return e;
99
+ if (s ||= 100, typeof e == "number") return Math.ceil(e * o * s) / s;
100
+ if (typeof e != "string") return e;
101
+ let c = e.split(unitsSplit);
102
+ if (c === null || !c.length) return e;
103
+ let l = [], u = c.shift(), f = unitsTest.test(u);
104
+ for (;;) {
105
+ if (f) {
106
+ let e = parseFloat(u);
107
+ isNaN(e) ? l.push(u) : l.push(Math.ceil(e * o * s) / s);
108
+ } else l.push(u);
109
+ if (u = c.shift(), u === void 0) return l.join("");
110
+ f = !f;
111
+ }
112
+ }
113
+ function splitSVGDefs(e, o = "defs") {
114
+ let s = "", c = e.indexOf("<" + o);
115
+ for (; c >= 0;) {
116
+ let l = e.indexOf(">", c), u = e.indexOf("</" + o);
117
+ if (l === -1 || u === -1) break;
118
+ let f = e.indexOf(">", u);
119
+ if (f === -1) break;
120
+ s += e.slice(l + 1, u).trim(), e = e.slice(0, c).trim() + e.slice(f + 1);
121
+ }
122
+ return {
123
+ defs: s,
124
+ content: e
125
+ };
126
+ }
127
+ function mergeDefsAndContent(e, o) {
128
+ return e ? "<defs>" + e + "</defs>" + o : o;
129
+ }
130
+ function wrapSVGContent(e, o, s) {
131
+ let c = splitSVGDefs(e);
132
+ return mergeDefsAndContent(c.defs, o + c.content + s);
133
+ }
134
+ var isUnsetKeyword = (e) => e === "unset" || e === "undefined" || e === "none";
135
+ function iconToSVG(e, o) {
136
+ let s = {
137
+ ...defaultIconProps,
138
+ ...e
139
+ }, c = {
140
+ ...defaultIconCustomisations,
141
+ ...o
142
+ }, l = {
143
+ left: s.left,
144
+ top: s.top,
145
+ width: s.width,
146
+ height: s.height
147
+ }, u = s.body;
148
+ [s, c].forEach((e) => {
149
+ let o = [], s = e.hFlip, c = e.vFlip, f = e.rotate;
150
+ s ? c ? f += 2 : (o.push("translate(" + (l.width + l.left).toString() + " " + (0 - l.top).toString() + ")"), o.push("scale(-1 1)"), l.top = l.left = 0) : c && (o.push("translate(" + (0 - l.left).toString() + " " + (l.height + l.top).toString() + ")"), o.push("scale(1 -1)"), l.top = l.left = 0);
151
+ let p;
152
+ switch (f < 0 && (f -= Math.floor(f / 4) * 4), f %= 4, f) {
153
+ case 1:
154
+ p = l.height / 2 + l.top, o.unshift("rotate(90 " + p.toString() + " " + p.toString() + ")");
155
+ break;
156
+ case 2:
157
+ o.unshift("rotate(180 " + (l.width / 2 + l.left).toString() + " " + (l.height / 2 + l.top).toString() + ")");
158
+ break;
159
+ case 3:
160
+ p = l.width / 2 + l.left, o.unshift("rotate(-90 " + p.toString() + " " + p.toString() + ")");
161
+ break;
162
+ }
163
+ f % 2 == 1 && (l.left !== l.top && (p = l.left, l.left = l.top, l.top = p), l.width !== l.height && (p = l.width, l.width = l.height, l.height = p)), o.length && (u = wrapSVGContent(u, "<g transform=\"" + o.join(" ") + "\">", "</g>"));
164
+ });
165
+ let f = c.width, p = c.height, h = l.width, g = l.height, O, R;
166
+ f === null ? (R = p === null ? "1em" : p === "auto" ? g : p, O = calculateSize(R, h / g)) : (O = f === "auto" ? h : f, R = p === null ? calculateSize(O, g / h) : p === "auto" ? g : p);
167
+ let B = {}, Y = (e, o) => {
168
+ isUnsetKeyword(o) || (B[e] = o.toString());
169
+ };
170
+ Y("width", O), Y("height", R);
171
+ let Z = [
172
+ l.left,
173
+ l.top,
174
+ h,
175
+ g
176
+ ];
177
+ return B.viewBox = Z.join(" "), {
178
+ attributes: B,
179
+ viewBox: Z,
180
+ body: u
181
+ };
182
+ }
183
+ var regex = /\sid="(\S+)"/g, counters = /* @__PURE__ */ new Map();
184
+ function nextID(e) {
185
+ e = e.replace(/[0-9]+$/, "") || "a";
186
+ let o = counters.get(e) || 0;
187
+ return counters.set(e, o + 1), o ? `${e}${o}` : e;
188
+ }
189
+ function replaceIDs(e) {
190
+ let o = [], s;
191
+ for (; s = regex.exec(e);) o.push(s[1]);
192
+ if (!o.length) return e;
193
+ let c = "suffix" + (Math.random() * 16777216 | Date.now()).toString(16);
194
+ return o.forEach((o) => {
195
+ let s = nextID(o), l = o.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
196
+ e = e.replace(RegExp("([#;\"])(" + l + ")([\")]|\\.[a-z])", "g"), "$1" + s + c + "$3");
197
+ }), e = e.replace(new RegExp(c, "g"), ""), e;
198
+ }
199
+ function iconToHTML(e, o) {
200
+ let s = e.indexOf("xlink:") === -1 ? "" : " xmlns:xlink=\"http://www.w3.org/1999/xlink\"";
201
+ for (let e in o) s += " " + e + "=\"" + o[e] + "\"";
202
+ return "<svg xmlns=\"http://www.w3.org/2000/svg\"" + s + ">" + e + "</svg>";
203
+ }
204
+ function L() {
205
+ return {
206
+ async: !1,
207
+ breaks: !1,
208
+ extensions: null,
209
+ gfm: !0,
210
+ hooks: null,
211
+ pedantic: !1,
212
+ renderer: null,
213
+ silent: !1,
214
+ tokenizer: null,
215
+ walkTokens: null
216
+ };
217
+ }
218
+ var T = L();
219
+ function G(e) {
220
+ T = e;
221
+ }
222
+ var E = { exec: () => null };
223
+ function d(e, o = "") {
224
+ let s = typeof e == "string" ? e : e.source, c = {
225
+ replace: (e, o) => {
226
+ let l = typeof o == "string" ? o : o.source;
227
+ return l = l.replace(m.caret, "$1"), s = s.replace(e, l), c;
228
+ },
229
+ getRegex: () => new RegExp(s, o)
230
+ };
231
+ return c;
232
+ }
233
+ var be = (() => {
234
+ try {
235
+ return !0;
236
+ } catch {
237
+ return !1;
238
+ }
239
+ })(), m = {
240
+ codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm,
241
+ outputLinkReplace: /\\([\[\]])/g,
242
+ indentCodeCompensation: /^(\s+)(?:```)/,
243
+ beginningSpace: /^\s+/,
244
+ endingHash: /#$/,
245
+ startingSpaceChar: /^ /,
246
+ endingSpaceChar: / $/,
247
+ nonSpaceChar: /[^ ]/,
248
+ newLineCharGlobal: /\n/g,
249
+ tabCharGlobal: /\t/g,
250
+ multipleSpaceGlobal: /\s+/g,
251
+ blankLine: /^[ \t]*$/,
252
+ doubleBlankLine: /\n[ \t]*\n[ \t]*$/,
253
+ blockquoteStart: /^ {0,3}>/,
254
+ blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g,
255
+ blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm,
256
+ listReplaceTabs: /^\t+/,
257
+ listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g,
258
+ listIsTask: /^\[[ xX]\] /,
259
+ listReplaceTask: /^\[[ xX]\] +/,
260
+ anyLine: /\n.*\n/,
261
+ hrefBrackets: /^<(.*)>$/,
262
+ tableDelimiter: /[:|]/,
263
+ tableAlignChars: /^\||\| *$/g,
264
+ tableRowBlankLine: /\n[ \t]*$/,
265
+ tableAlignRight: /^ *-+: *$/,
266
+ tableAlignCenter: /^ *:-+: *$/,
267
+ tableAlignLeft: /^ *:-+ *$/,
268
+ startATag: /^<a /i,
269
+ endATag: /^<\/a>/i,
270
+ startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i,
271
+ endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i,
272
+ startAngleBracket: /^</,
273
+ endAngleBracket: />$/,
274
+ pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/,
275
+ unicodeAlphaNumeric: /[\p{L}\p{N}]/u,
276
+ escapeTest: /[&<>"']/,
277
+ escapeReplace: /[&<>"']/g,
278
+ escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,
279
+ escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,
280
+ unescapeTest: /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,
281
+ caret: /(^|[^\[])\^/g,
282
+ percentDecode: /%25/g,
283
+ findPipe: /\|/g,
284
+ splitPipe: / \|/,
285
+ slashPipe: /\\\|/g,
286
+ carriageReturn: /\r\n|\r/g,
287
+ spaceLine: /^ +$/gm,
288
+ notSpaceStart: /^\S*/,
289
+ endingNewline: /\n$/,
290
+ listItemRegex: (e) => /* @__PURE__ */ RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),
291
+ nextBulletRegex: (e) => /* @__PURE__ */ RegExp(`^ {0,${Math.min(3, e - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),
292
+ hrRegex: (e) => /* @__PURE__ */ RegExp(`^ {0,${Math.min(3, e - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),
293
+ fencesBeginRegex: (e) => /* @__PURE__ */ RegExp(`^ {0,${Math.min(3, e - 1)}}(?:\`\`\`|~~~)`),
294
+ headingBeginRegex: (e) => /* @__PURE__ */ RegExp(`^ {0,${Math.min(3, e - 1)}}#`),
295
+ htmlBeginRegex: (e) => RegExp(`^ {0,${Math.min(3, e - 1)}}<(?:[a-z].*>|!--)`, "i")
296
+ }, Re = /^(?:[ \t]*(?:\n|$))+/, Te = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, Oe = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, I = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, we = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, F = /(?:[*+-]|\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+|$)/, oe = d(ie).replace(/bull/g, F).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(), ye = d(ie).replace(/bull/g, F).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(), j = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, Pe = /^[^\n]+/, Q = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, Se = d(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", Q).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), $e = d(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, F).getRegex(), v = "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", U = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, _e = d("^ {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", U).replace("tag", v).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), ae = d(j).replace("hr", I).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", v).getRegex(), K = {
297
+ blockquote: d(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", ae).getRegex(),
298
+ code: Te,
299
+ def: Se,
300
+ fences: Oe,
301
+ heading: we,
302
+ hr: I,
303
+ html: _e,
304
+ lheading: oe,
305
+ list: $e,
306
+ newline: Re,
307
+ paragraph: ae,
308
+ table: E,
309
+ text: Pe
310
+ }, re = d("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", I).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", v).getRegex(), Me = {
311
+ ...K,
312
+ lheading: ye,
313
+ table: re,
314
+ paragraph: d(j).replace("hr", I).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", re).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", v).getRegex()
315
+ }, ze = {
316
+ ...K,
317
+ html: d("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment", U).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(),
318
+ def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
319
+ heading: /^(#{1,6})(.*)(?:\n+|$)/,
320
+ fences: E,
321
+ lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
322
+ paragraph: d(j).replace("hr", I).replace("heading", " *#{1,6} *[^\n]").replace("lheading", oe).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
323
+ }, Ae = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Ee = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, le = /^( {2,}|\\)\n(?!\s*$)/, Ie = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, D = /[\p{P}\p{S}]/u, W = /[\s\p{P}\p{S}]/u, ue = /[^\s\p{P}\p{S}]/u, Ce = d(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, W).getRegex(), pe = /(?!~)[\p{P}\p{S}]/u, Be = /(?!~)[\s\p{P}\p{S}]/u, qe = /(?:[^\s\p{P}\p{S}]|~)/u, ve = d(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", be ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), ce = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/, De = d(ce, "u").replace(/punct/g, D).getRegex(), He = d(ce, "u").replace(/punct/g, pe).getRegex(), he = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", Ze = d(he, "gu").replace(/notPunctSpace/g, ue).replace(/punctSpace/g, W).replace(/punct/g, D).getRegex(), Ge = d(he, "gu").replace(/notPunctSpace/g, qe).replace(/punctSpace/g, Be).replace(/punct/g, pe).getRegex(), Ne = d("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, ue).replace(/punctSpace/g, W).replace(/punct/g, D).getRegex(), Fe = d(/\\(punct)/, "gu").replace(/punct/g, D).getRegex(), je = d(/^<(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(), Qe = d(U).replace("(?:-->|$)", "-->").getRegex(), Ue = d("^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", Qe).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), q = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/, Ke = d(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label", q).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), de = d(/^!?\[(label)\]\[(ref)\]/).replace("label", q).replace("ref", Q).getRegex(), ke = d(/^!?\[(ref)\](?:\[\])?/).replace("ref", Q).getRegex(), We = d("reflink|nolink(?!\\()", "g").replace("reflink", de).replace("nolink", ke).getRegex(), se = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, X = {
324
+ _backpedal: E,
325
+ anyPunctuation: Fe,
326
+ autolink: je,
327
+ blockSkip: ve,
328
+ br: le,
329
+ code: Ee,
330
+ del: E,
331
+ emStrongLDelim: De,
332
+ emStrongRDelimAst: Ze,
333
+ emStrongRDelimUnd: Ne,
334
+ escape: Ae,
335
+ link: Ke,
336
+ nolink: ke,
337
+ punctuation: Ce,
338
+ reflink: de,
339
+ reflinkSearch: We,
340
+ tag: Ue,
341
+ text: Ie,
342
+ url: E
343
+ }, Xe = {
344
+ ...X,
345
+ link: d(/^!?\[(label)\]\((.*?)\)/).replace("label", q).getRegex(),
346
+ reflink: d(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", q).getRegex()
347
+ }, N = {
348
+ ...X,
349
+ emStrongRDelimAst: Ge,
350
+ emStrongLDelim: He,
351
+ url: d(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", se).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),
352
+ _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
353
+ del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,
354
+ text: d(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", se).getRegex()
355
+ }, Je = {
356
+ ...N,
357
+ br: d(le).replace("{2,}", "*").getRegex(),
358
+ text: d(N.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
359
+ }, C = {
360
+ normal: K,
361
+ gfm: Me,
362
+ pedantic: ze
363
+ }, M = {
364
+ normal: X,
365
+ gfm: N,
366
+ breaks: Je,
367
+ pedantic: Xe
368
+ }, Ve = {
369
+ "&": "&amp;",
370
+ "<": "&lt;",
371
+ ">": "&gt;",
372
+ "\"": "&quot;",
373
+ "'": "&#39;"
374
+ }, ge = (e) => Ve[e];
375
+ function w(e, o) {
376
+ if (o) {
377
+ if (m.escapeTest.test(e)) return e.replace(m.escapeReplace, ge);
378
+ } else if (m.escapeTestNoEncode.test(e)) return e.replace(m.escapeReplaceNoEncode, ge);
379
+ return e;
380
+ }
381
+ function J(e) {
382
+ try {
383
+ e = encodeURI(e).replace(m.percentDecode, "%");
384
+ } catch {
385
+ return null;
386
+ }
387
+ return e;
388
+ }
389
+ function V(e, o) {
390
+ let s = e.replace(m.findPipe, (e, o, s) => {
391
+ let c = !1, l = o;
392
+ for (; --l >= 0 && s[l] === "\\";) c = !c;
393
+ return c ? "|" : " |";
394
+ }).split(m.splitPipe), c = 0;
395
+ if (s[0].trim() || s.shift(), s.length > 0 && !s.at(-1)?.trim() && s.pop(), o) if (s.length > o) s.splice(o);
396
+ else for (; s.length < o;) s.push("");
397
+ for (; c < s.length; c++) s[c] = s[c].trim().replace(m.slashPipe, "|");
398
+ return s;
399
+ }
400
+ function z(e, o, s) {
401
+ let c = e.length;
402
+ if (c === 0) return "";
403
+ let l = 0;
404
+ for (; l < c;) {
405
+ let u = e.charAt(c - l - 1);
406
+ if (u === o && !s) l++;
407
+ else if (u !== o && s) l++;
408
+ else break;
409
+ }
410
+ return e.slice(0, c - l);
411
+ }
412
+ function fe(e, o) {
413
+ if (e.indexOf(o[1]) === -1) return -1;
414
+ let s = 0;
415
+ for (let c = 0; c < e.length; c++) if (e[c] === "\\") c++;
416
+ else if (e[c] === o[0]) s++;
417
+ else if (e[c] === o[1] && (s--, s < 0)) return c;
418
+ return s > 0 ? -2 : -1;
419
+ }
420
+ function me(e, o, s, c, l) {
421
+ let u = o.href, f = o.title || null, p = e[1].replace(l.other.outputLinkReplace, "$1");
422
+ c.state.inLink = !0;
423
+ let h = {
424
+ type: e[0].charAt(0) === "!" ? "image" : "link",
425
+ raw: s,
426
+ href: u,
427
+ title: f,
428
+ text: p,
429
+ tokens: c.inlineTokens(p)
430
+ };
431
+ return c.state.inLink = !1, h;
432
+ }
433
+ function Ye(e, o, s) {
434
+ let c = e.match(s.other.indentCodeCompensation);
435
+ if (c === null) return o;
436
+ let l = c[1];
437
+ return o.split("\n").map((e) => {
438
+ let o = e.match(s.other.beginningSpace);
439
+ if (o === null) return e;
440
+ let [c] = o;
441
+ return c.length >= l.length ? e.slice(l.length) : e;
442
+ }).join("\n");
443
+ }
444
+ var y = class {
445
+ options;
446
+ rules;
447
+ lexer;
448
+ constructor(e) {
449
+ this.options = e || T;
450
+ }
451
+ space(e) {
452
+ let o = this.rules.block.newline.exec(e);
453
+ if (o && o[0].length > 0) return {
454
+ type: "space",
455
+ raw: o[0]
456
+ };
457
+ }
458
+ code(e) {
459
+ let o = this.rules.block.code.exec(e);
460
+ if (o) {
461
+ let e = o[0].replace(this.rules.other.codeRemoveIndent, "");
462
+ return {
463
+ type: "code",
464
+ raw: o[0],
465
+ codeBlockStyle: "indented",
466
+ text: this.options.pedantic ? e : z(e, "\n")
467
+ };
468
+ }
469
+ }
470
+ fences(e) {
471
+ let o = this.rules.block.fences.exec(e);
472
+ if (o) {
473
+ let e = o[0], s = Ye(e, o[3] || "", this.rules);
474
+ return {
475
+ type: "code",
476
+ raw: e,
477
+ lang: o[2] ? o[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : o[2],
478
+ text: s
479
+ };
480
+ }
481
+ }
482
+ heading(e) {
483
+ let o = this.rules.block.heading.exec(e);
484
+ if (o) {
485
+ let e = o[2].trim();
486
+ if (this.rules.other.endingHash.test(e)) {
487
+ let o = z(e, "#");
488
+ (this.options.pedantic || !o || this.rules.other.endingSpaceChar.test(o)) && (e = o.trim());
489
+ }
490
+ return {
491
+ type: "heading",
492
+ raw: o[0],
493
+ depth: o[1].length,
494
+ text: e,
495
+ tokens: this.lexer.inline(e)
496
+ };
497
+ }
498
+ }
499
+ hr(e) {
500
+ let o = this.rules.block.hr.exec(e);
501
+ if (o) return {
502
+ type: "hr",
503
+ raw: z(o[0], "\n")
504
+ };
505
+ }
506
+ blockquote(e) {
507
+ let o = this.rules.block.blockquote.exec(e);
508
+ if (o) {
509
+ let e = z(o[0], "\n").split("\n"), s = "", c = "", l = [];
510
+ for (; e.length > 0;) {
511
+ let o = !1, u = [], f;
512
+ for (f = 0; f < e.length; f++) if (this.rules.other.blockquoteStart.test(e[f])) u.push(e[f]), o = !0;
513
+ else if (!o) u.push(e[f]);
514
+ else break;
515
+ e = e.slice(f);
516
+ let p = u.join("\n"), h = p.replace(this.rules.other.blockquoteSetextReplace, "\n $1").replace(this.rules.other.blockquoteSetextReplace2, "");
517
+ s = s ? `${s}
518
+ ${p}` : p, c = c ? `${c}
519
+ ${h}` : h;
520
+ let g = this.lexer.state.top;
521
+ if (this.lexer.state.top = !0, this.lexer.blockTokens(h, l, !0), this.lexer.state.top = g, e.length === 0) break;
522
+ let O = l.at(-1);
523
+ if (O?.type === "code") break;
524
+ if (O?.type === "blockquote") {
525
+ let o = O, u = o.raw + "\n" + e.join("\n"), f = this.blockquote(u);
526
+ l[l.length - 1] = f, s = s.substring(0, s.length - o.raw.length) + f.raw, c = c.substring(0, c.length - o.text.length) + f.text;
527
+ break;
528
+ } else if (O?.type === "list") {
529
+ let o = O, u = o.raw + "\n" + e.join("\n"), f = this.list(u);
530
+ l[l.length - 1] = f, s = s.substring(0, s.length - O.raw.length) + f.raw, c = c.substring(0, c.length - o.raw.length) + f.raw, e = u.substring(l.at(-1).raw.length).split("\n");
531
+ continue;
532
+ }
533
+ }
534
+ return {
535
+ type: "blockquote",
536
+ raw: s,
537
+ tokens: l,
538
+ text: c
539
+ };
540
+ }
541
+ }
542
+ list(e) {
543
+ let o = this.rules.block.list.exec(e);
544
+ if (o) {
545
+ let s = o[1].trim(), c = s.length > 1, l = {
546
+ type: "list",
547
+ raw: "",
548
+ ordered: c,
549
+ start: c ? +s.slice(0, -1) : "",
550
+ loose: !1,
551
+ items: []
552
+ };
553
+ s = c ? `\\d{1,9}\\${s.slice(-1)}` : `\\${s}`, this.options.pedantic && (s = c ? s : "[*+-]");
554
+ let u = this.rules.other.listItemRegex(s), f = !1;
555
+ for (; e;) {
556
+ let s = !1, c = "", p = "";
557
+ if (!(o = u.exec(e)) || this.rules.block.hr.test(e)) break;
558
+ c = o[0], e = e.substring(c.length);
559
+ let h = o[2].split("\n", 1)[0].replace(this.rules.other.listReplaceTabs, (e) => " ".repeat(3 * e.length)), g = e.split("\n", 1)[0], O = !h.trim(), A = 0;
560
+ if (this.options.pedantic ? (A = 2, p = h.trimStart()) : O ? A = o[1].length + 1 : (A = o[2].search(this.rules.other.nonSpaceChar), A = A > 4 ? 1 : A, p = h.slice(A), A += o[1].length), O && this.rules.other.blankLine.test(g) && (c += g + "\n", e = e.substring(g.length + 1), s = !0), !s) {
561
+ let o = this.rules.other.nextBulletRegex(A), s = this.rules.other.hrRegex(A), l = this.rules.other.fencesBeginRegex(A), u = this.rules.other.headingBeginRegex(A), f = this.rules.other.htmlBeginRegex(A);
562
+ for (; e;) {
563
+ let R = e.split("\n", 1)[0], B;
564
+ if (g = R, this.options.pedantic ? (g = g.replace(this.rules.other.listReplaceNesting, " "), B = g) : B = g.replace(this.rules.other.tabCharGlobal, " "), l.test(g) || u.test(g) || f.test(g) || o.test(g) || s.test(g)) break;
565
+ if (B.search(this.rules.other.nonSpaceChar) >= A || !g.trim()) p += "\n" + B.slice(A);
566
+ else {
567
+ if (O || h.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || l.test(h) || u.test(h) || s.test(h)) break;
568
+ p += "\n" + g;
569
+ }
570
+ !O && !g.trim() && (O = !0), c += R + "\n", e = e.substring(R.length + 1), h = B.slice(A);
571
+ }
572
+ }
573
+ l.loose || (f ? l.loose = !0 : this.rules.other.doubleBlankLine.test(c) && (f = !0));
574
+ let R = null, B;
575
+ this.options.gfm && (R = this.rules.other.listIsTask.exec(p), R && (B = R[0] !== "[ ] ", p = p.replace(this.rules.other.listReplaceTask, ""))), l.items.push({
576
+ type: "list_item",
577
+ raw: c,
578
+ task: !!R,
579
+ checked: B,
580
+ loose: !1,
581
+ text: p,
582
+ tokens: []
583
+ }), l.raw += c;
584
+ }
585
+ let p = l.items.at(-1);
586
+ if (p) p.raw = p.raw.trimEnd(), p.text = p.text.trimEnd();
587
+ else return;
588
+ l.raw = l.raw.trimEnd();
589
+ for (let e = 0; e < l.items.length; e++) if (this.lexer.state.top = !1, l.items[e].tokens = this.lexer.blockTokens(l.items[e].text, []), !l.loose) {
590
+ let o = l.items[e].tokens.filter((e) => e.type === "space");
591
+ l.loose = o.length > 0 && o.some((e) => this.rules.other.anyLine.test(e.raw));
592
+ }
593
+ if (l.loose) for (let e = 0; e < l.items.length; e++) l.items[e].loose = !0;
594
+ return l;
595
+ }
596
+ }
597
+ html(e) {
598
+ let o = this.rules.block.html.exec(e);
599
+ if (o) return {
600
+ type: "html",
601
+ block: !0,
602
+ raw: o[0],
603
+ pre: o[1] === "pre" || o[1] === "script" || o[1] === "style",
604
+ text: o[0]
605
+ };
606
+ }
607
+ def(e) {
608
+ let o = this.rules.block.def.exec(e);
609
+ if (o) {
610
+ let e = o[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal, " "), s = o[2] ? o[2].replace(this.rules.other.hrefBrackets, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "", c = o[3] ? o[3].substring(1, o[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : o[3];
611
+ return {
612
+ type: "def",
613
+ tag: e,
614
+ raw: o[0],
615
+ href: s,
616
+ title: c
617
+ };
618
+ }
619
+ }
620
+ table(e) {
621
+ let o = this.rules.block.table.exec(e);
622
+ if (!o || !this.rules.other.tableDelimiter.test(o[2])) return;
623
+ let s = V(o[1]), c = o[2].replace(this.rules.other.tableAlignChars, "").split("|"), l = o[3]?.trim() ? o[3].replace(this.rules.other.tableRowBlankLine, "").split("\n") : [], u = {
624
+ type: "table",
625
+ raw: o[0],
626
+ header: [],
627
+ align: [],
628
+ rows: []
629
+ };
630
+ if (s.length === c.length) {
631
+ for (let e of c) this.rules.other.tableAlignRight.test(e) ? u.align.push("right") : this.rules.other.tableAlignCenter.test(e) ? u.align.push("center") : this.rules.other.tableAlignLeft.test(e) ? u.align.push("left") : u.align.push(null);
632
+ for (let e = 0; e < s.length; e++) u.header.push({
633
+ text: s[e],
634
+ tokens: this.lexer.inline(s[e]),
635
+ header: !0,
636
+ align: u.align[e]
637
+ });
638
+ for (let e of l) u.rows.push(V(e, u.header.length).map((e, o) => ({
639
+ text: e,
640
+ tokens: this.lexer.inline(e),
641
+ header: !1,
642
+ align: u.align[o]
643
+ })));
644
+ return u;
645
+ }
646
+ }
647
+ lheading(e) {
648
+ let o = this.rules.block.lheading.exec(e);
649
+ if (o) return {
650
+ type: "heading",
651
+ raw: o[0],
652
+ depth: o[2].charAt(0) === "=" ? 1 : 2,
653
+ text: o[1],
654
+ tokens: this.lexer.inline(o[1])
655
+ };
656
+ }
657
+ paragraph(e) {
658
+ let o = this.rules.block.paragraph.exec(e);
659
+ if (o) {
660
+ let e = o[1].charAt(o[1].length - 1) === "\n" ? o[1].slice(0, -1) : o[1];
661
+ return {
662
+ type: "paragraph",
663
+ raw: o[0],
664
+ text: e,
665
+ tokens: this.lexer.inline(e)
666
+ };
667
+ }
668
+ }
669
+ text(e) {
670
+ let o = this.rules.block.text.exec(e);
671
+ if (o) return {
672
+ type: "text",
673
+ raw: o[0],
674
+ text: o[0],
675
+ tokens: this.lexer.inline(o[0])
676
+ };
677
+ }
678
+ escape(e) {
679
+ let o = this.rules.inline.escape.exec(e);
680
+ if (o) return {
681
+ type: "escape",
682
+ raw: o[0],
683
+ text: o[1]
684
+ };
685
+ }
686
+ tag(e) {
687
+ let o = this.rules.inline.tag.exec(e);
688
+ if (o) return !this.lexer.state.inLink && this.rules.other.startATag.test(o[0]) ? this.lexer.state.inLink = !0 : this.lexer.state.inLink && this.rules.other.endATag.test(o[0]) && (this.lexer.state.inLink = !1), !this.lexer.state.inRawBlock && this.rules.other.startPreScriptTag.test(o[0]) ? this.lexer.state.inRawBlock = !0 : this.lexer.state.inRawBlock && this.rules.other.endPreScriptTag.test(o[0]) && (this.lexer.state.inRawBlock = !1), {
689
+ type: "html",
690
+ raw: o[0],
691
+ inLink: this.lexer.state.inLink,
692
+ inRawBlock: this.lexer.state.inRawBlock,
693
+ block: !1,
694
+ text: o[0]
695
+ };
696
+ }
697
+ link(e) {
698
+ let o = this.rules.inline.link.exec(e);
699
+ if (o) {
700
+ let e = o[2].trim();
701
+ if (!this.options.pedantic && this.rules.other.startAngleBracket.test(e)) {
702
+ if (!this.rules.other.endAngleBracket.test(e)) return;
703
+ let o = z(e.slice(0, -1), "\\");
704
+ if ((e.length - o.length) % 2 == 0) return;
705
+ } else {
706
+ let e = fe(o[2], "()");
707
+ if (e === -2) return;
708
+ if (e > -1) {
709
+ let s = (o[0].indexOf("!") === 0 ? 5 : 4) + o[1].length + e;
710
+ o[2] = o[2].substring(0, e), o[0] = o[0].substring(0, s).trim(), o[3] = "";
711
+ }
712
+ }
713
+ let s = o[2], c = "";
714
+ if (this.options.pedantic) {
715
+ let e = this.rules.other.pedanticHrefTitle.exec(s);
716
+ e && (s = e[1], c = e[3]);
717
+ } else c = o[3] ? o[3].slice(1, -1) : "";
718
+ return s = s.trim(), this.rules.other.startAngleBracket.test(s) && (s = this.options.pedantic && !this.rules.other.endAngleBracket.test(e) ? s.slice(1) : s.slice(1, -1)), me(o, {
719
+ href: s && s.replace(this.rules.inline.anyPunctuation, "$1"),
720
+ title: c && c.replace(this.rules.inline.anyPunctuation, "$1")
721
+ }, o[0], this.lexer, this.rules);
722
+ }
723
+ }
724
+ reflink(e, o) {
725
+ let s;
726
+ if ((s = this.rules.inline.reflink.exec(e)) || (s = this.rules.inline.nolink.exec(e))) {
727
+ let e = o[(s[2] || s[1]).replace(this.rules.other.multipleSpaceGlobal, " ").toLowerCase()];
728
+ if (!e) {
729
+ let e = s[0].charAt(0);
730
+ return {
731
+ type: "text",
732
+ raw: e,
733
+ text: e
734
+ };
735
+ }
736
+ return me(s, e, s[0], this.lexer, this.rules);
737
+ }
738
+ }
739
+ emStrong(e, o, s = "") {
740
+ let c = this.rules.inline.emStrongLDelim.exec(e);
741
+ if (!(!c || c[3] && s.match(this.rules.other.unicodeAlphaNumeric)) && (!(c[1] || c[2]) || !s || this.rules.inline.punctuation.exec(s))) {
742
+ let s = [...c[0]].length - 1, l, u, f = s, p = 0, h = c[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
743
+ for (h.lastIndex = 0, o = o.slice(-1 * e.length + s); (c = h.exec(o)) != null;) {
744
+ if (l = c[1] || c[2] || c[3] || c[4] || c[5] || c[6], !l) continue;
745
+ if (u = [...l].length, c[3] || c[4]) {
746
+ f += u;
747
+ continue;
748
+ } else if ((c[5] || c[6]) && s % 3 && !((s + u) % 3)) {
749
+ p += u;
750
+ continue;
751
+ }
752
+ if (f -= u, f > 0) continue;
753
+ u = Math.min(u, u + f + p);
754
+ let o = [...c[0]][0].length, h = e.slice(0, s + c.index + o + u);
755
+ if (Math.min(s, u) % 2) {
756
+ let e = h.slice(1, -1);
757
+ return {
758
+ type: "em",
759
+ raw: h,
760
+ text: e,
761
+ tokens: this.lexer.inlineTokens(e)
762
+ };
763
+ }
764
+ let g = h.slice(2, -2);
765
+ return {
766
+ type: "strong",
767
+ raw: h,
768
+ text: g,
769
+ tokens: this.lexer.inlineTokens(g)
770
+ };
771
+ }
772
+ }
773
+ }
774
+ codespan(e) {
775
+ let o = this.rules.inline.code.exec(e);
776
+ if (o) {
777
+ let e = o[2].replace(this.rules.other.newLineCharGlobal, " "), s = this.rules.other.nonSpaceChar.test(e), c = this.rules.other.startingSpaceChar.test(e) && this.rules.other.endingSpaceChar.test(e);
778
+ return s && c && (e = e.substring(1, e.length - 1)), {
779
+ type: "codespan",
780
+ raw: o[0],
781
+ text: e
782
+ };
783
+ }
784
+ }
785
+ br(e) {
786
+ let o = this.rules.inline.br.exec(e);
787
+ if (o) return {
788
+ type: "br",
789
+ raw: o[0]
790
+ };
791
+ }
792
+ del(e) {
793
+ let o = this.rules.inline.del.exec(e);
794
+ if (o) return {
795
+ type: "del",
796
+ raw: o[0],
797
+ text: o[2],
798
+ tokens: this.lexer.inlineTokens(o[2])
799
+ };
800
+ }
801
+ autolink(e) {
802
+ let o = this.rules.inline.autolink.exec(e);
803
+ if (o) {
804
+ let e, s;
805
+ return o[2] === "@" ? (e = o[1], s = "mailto:" + e) : (e = o[1], s = e), {
806
+ type: "link",
807
+ raw: o[0],
808
+ text: e,
809
+ href: s,
810
+ tokens: [{
811
+ type: "text",
812
+ raw: e,
813
+ text: e
814
+ }]
815
+ };
816
+ }
817
+ }
818
+ url(e) {
819
+ let o;
820
+ if (o = this.rules.inline.url.exec(e)) {
821
+ let e, s;
822
+ if (o[2] === "@") e = o[0], s = "mailto:" + e;
823
+ else {
824
+ let c;
825
+ do
826
+ c = o[0], o[0] = this.rules.inline._backpedal.exec(o[0])?.[0] ?? "";
827
+ while (c !== o[0]);
828
+ e = o[0], s = o[1] === "www." ? "http://" + o[0] : o[0];
829
+ }
830
+ return {
831
+ type: "link",
832
+ raw: o[0],
833
+ text: e,
834
+ href: s,
835
+ tokens: [{
836
+ type: "text",
837
+ raw: e,
838
+ text: e
839
+ }]
840
+ };
841
+ }
842
+ }
843
+ inlineText(e) {
844
+ let o = this.rules.inline.text.exec(e);
845
+ if (o) {
846
+ let e = this.lexer.state.inRawBlock;
847
+ return {
848
+ type: "text",
849
+ raw: o[0],
850
+ text: o[0],
851
+ escaped: e
852
+ };
853
+ }
854
+ }
855
+ }, x = class e {
856
+ tokens;
857
+ options;
858
+ state;
859
+ tokenizer;
860
+ inlineQueue;
861
+ constructor(e) {
862
+ this.tokens = [], this.tokens.links = Object.create(null), this.options = e || T, this.options.tokenizer = this.options.tokenizer || new y(), 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 o = {
868
+ other: m,
869
+ block: C.normal,
870
+ inline: M.normal
871
+ };
872
+ this.options.pedantic ? (o.block = C.pedantic, o.inline = M.pedantic) : this.options.gfm && (o.block = C.gfm, this.options.breaks ? o.inline = M.breaks : o.inline = M.gfm), this.tokenizer.rules = o;
873
+ }
874
+ static get rules() {
875
+ return {
876
+ block: C,
877
+ inline: M
878
+ };
879
+ }
880
+ static lex(o, s) {
881
+ return new e(s).lex(o);
882
+ }
883
+ static lexInline(o, s) {
884
+ return new e(s).inlineTokens(o);
885
+ }
886
+ lex(e) {
887
+ e = e.replace(m.carriageReturn, "\n"), this.blockTokens(e, this.tokens);
888
+ for (let e = 0; e < this.inlineQueue.length; e++) {
889
+ let o = this.inlineQueue[e];
890
+ this.inlineTokens(o.src, o.tokens);
891
+ }
892
+ return this.inlineQueue = [], this.tokens;
893
+ }
894
+ blockTokens(e, o = [], s = !1) {
895
+ for (this.options.pedantic && (e = e.replace(m.tabCharGlobal, " ").replace(m.spaceLine, "")); e;) {
896
+ let c;
897
+ if (this.options.extensions?.block?.some((s) => (c = s.call({ lexer: this }, e, o)) ? (e = e.substring(c.raw.length), o.push(c), !0) : !1)) continue;
898
+ if (c = this.tokenizer.space(e)) {
899
+ e = e.substring(c.raw.length);
900
+ let s = o.at(-1);
901
+ c.raw.length === 1 && s !== void 0 ? s.raw += "\n" : o.push(c);
902
+ continue;
903
+ }
904
+ if (c = this.tokenizer.code(e)) {
905
+ e = e.substring(c.raw.length);
906
+ let s = o.at(-1);
907
+ s?.type === "paragraph" || s?.type === "text" ? (s.raw += (s.raw.endsWith("\n") ? "" : "\n") + c.raw, s.text += "\n" + c.text, this.inlineQueue.at(-1).src = s.text) : o.push(c);
908
+ continue;
909
+ }
910
+ if (c = this.tokenizer.fences(e)) {
911
+ e = e.substring(c.raw.length), o.push(c);
912
+ continue;
913
+ }
914
+ if (c = this.tokenizer.heading(e)) {
915
+ e = e.substring(c.raw.length), o.push(c);
916
+ continue;
917
+ }
918
+ if (c = this.tokenizer.hr(e)) {
919
+ e = e.substring(c.raw.length), o.push(c);
920
+ continue;
921
+ }
922
+ if (c = this.tokenizer.blockquote(e)) {
923
+ e = e.substring(c.raw.length), o.push(c);
924
+ continue;
925
+ }
926
+ if (c = this.tokenizer.list(e)) {
927
+ e = e.substring(c.raw.length), o.push(c);
928
+ continue;
929
+ }
930
+ if (c = this.tokenizer.html(e)) {
931
+ e = e.substring(c.raw.length), o.push(c);
932
+ continue;
933
+ }
934
+ if (c = this.tokenizer.def(e)) {
935
+ e = e.substring(c.raw.length);
936
+ let s = o.at(-1);
937
+ s?.type === "paragraph" || s?.type === "text" ? (s.raw += (s.raw.endsWith("\n") ? "" : "\n") + c.raw, s.text += "\n" + c.raw, this.inlineQueue.at(-1).src = s.text) : this.tokens.links[c.tag] || (this.tokens.links[c.tag] = {
938
+ href: c.href,
939
+ title: c.title
940
+ }, o.push(c));
941
+ continue;
942
+ }
943
+ if (c = this.tokenizer.table(e)) {
944
+ e = e.substring(c.raw.length), o.push(c);
945
+ continue;
946
+ }
947
+ if (c = this.tokenizer.lheading(e)) {
948
+ e = e.substring(c.raw.length), o.push(c);
949
+ continue;
950
+ }
951
+ let l = e;
952
+ if (this.options.extensions?.startBlock) {
953
+ let o = Infinity, s = e.slice(1), c;
954
+ this.options.extensions.startBlock.forEach((e) => {
955
+ c = e.call({ lexer: this }, s), typeof c == "number" && c >= 0 && (o = Math.min(o, c));
956
+ }), o < Infinity && o >= 0 && (l = e.substring(0, o + 1));
957
+ }
958
+ if (this.state.top && (c = this.tokenizer.paragraph(l))) {
959
+ let u = o.at(-1);
960
+ s && u?.type === "paragraph" ? (u.raw += (u.raw.endsWith("\n") ? "" : "\n") + c.raw, u.text += "\n" + c.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = u.text) : o.push(c), s = l.length !== e.length, e = e.substring(c.raw.length);
961
+ continue;
962
+ }
963
+ if (c = this.tokenizer.text(e)) {
964
+ e = e.substring(c.raw.length);
965
+ let s = o.at(-1);
966
+ s?.type === "text" ? (s.raw += (s.raw.endsWith("\n") ? "" : "\n") + c.raw, s.text += "\n" + c.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = s.text) : o.push(c);
967
+ continue;
968
+ }
969
+ if (e) {
970
+ let o = "Infinite loop on byte: " + e.charCodeAt(0);
971
+ if (this.options.silent) {
972
+ console.error(o);
973
+ break;
974
+ } else throw Error(o);
975
+ }
976
+ }
977
+ return this.state.top = !0, o;
978
+ }
979
+ inline(e, o = []) {
980
+ return this.inlineQueue.push({
981
+ src: e,
982
+ tokens: o
983
+ }), o;
984
+ }
985
+ inlineTokens(e, o = []) {
986
+ let s = e, c = null;
987
+ if (this.tokens.links) {
988
+ let e = Object.keys(this.tokens.links);
989
+ if (e.length > 0) for (; (c = this.tokenizer.rules.inline.reflinkSearch.exec(s)) != null;) e.includes(c[0].slice(c[0].lastIndexOf("[") + 1, -1)) && (s = s.slice(0, c.index) + "[" + "a".repeat(c[0].length - 2) + "]" + s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
990
+ }
991
+ for (; (c = this.tokenizer.rules.inline.anyPunctuation.exec(s)) != null;) s = s.slice(0, c.index) + "++" + s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
992
+ let l;
993
+ for (; (c = this.tokenizer.rules.inline.blockSkip.exec(s)) != null;) l = c[2] ? c[2].length : 0, s = s.slice(0, c.index + l) + "[" + "a".repeat(c[0].length - l - 2) + "]" + s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
994
+ s = this.options.hooks?.emStrongMask?.call({ lexer: this }, s) ?? s;
995
+ let u = !1, f = "";
996
+ for (; e;) {
997
+ u || (f = ""), u = !1;
998
+ let c;
999
+ if (this.options.extensions?.inline?.some((s) => (c = s.call({ lexer: this }, e, o)) ? (e = e.substring(c.raw.length), o.push(c), !0) : !1)) continue;
1000
+ if (c = this.tokenizer.escape(e)) {
1001
+ e = e.substring(c.raw.length), o.push(c);
1002
+ continue;
1003
+ }
1004
+ if (c = this.tokenizer.tag(e)) {
1005
+ e = e.substring(c.raw.length), o.push(c);
1006
+ continue;
1007
+ }
1008
+ if (c = this.tokenizer.link(e)) {
1009
+ e = e.substring(c.raw.length), o.push(c);
1010
+ continue;
1011
+ }
1012
+ if (c = this.tokenizer.reflink(e, this.tokens.links)) {
1013
+ e = e.substring(c.raw.length);
1014
+ let s = o.at(-1);
1015
+ c.type === "text" && s?.type === "text" ? (s.raw += c.raw, s.text += c.text) : o.push(c);
1016
+ continue;
1017
+ }
1018
+ if (c = this.tokenizer.emStrong(e, s, f)) {
1019
+ e = e.substring(c.raw.length), o.push(c);
1020
+ continue;
1021
+ }
1022
+ if (c = this.tokenizer.codespan(e)) {
1023
+ e = e.substring(c.raw.length), o.push(c);
1024
+ continue;
1025
+ }
1026
+ if (c = this.tokenizer.br(e)) {
1027
+ e = e.substring(c.raw.length), o.push(c);
1028
+ continue;
1029
+ }
1030
+ if (c = this.tokenizer.del(e)) {
1031
+ e = e.substring(c.raw.length), o.push(c);
1032
+ continue;
1033
+ }
1034
+ if (c = this.tokenizer.autolink(e)) {
1035
+ e = e.substring(c.raw.length), o.push(c);
1036
+ continue;
1037
+ }
1038
+ if (!this.state.inLink && (c = this.tokenizer.url(e))) {
1039
+ e = e.substring(c.raw.length), o.push(c);
1040
+ continue;
1041
+ }
1042
+ let l = e;
1043
+ if (this.options.extensions?.startInline) {
1044
+ let o = Infinity, s = e.slice(1), c;
1045
+ this.options.extensions.startInline.forEach((e) => {
1046
+ c = e.call({ lexer: this }, s), typeof c == "number" && c >= 0 && (o = Math.min(o, c));
1047
+ }), o < Infinity && o >= 0 && (l = e.substring(0, o + 1));
1048
+ }
1049
+ if (c = this.tokenizer.inlineText(l)) {
1050
+ e = e.substring(c.raw.length), c.raw.slice(-1) !== "_" && (f = c.raw.slice(-1)), u = !0;
1051
+ let s = o.at(-1);
1052
+ s?.type === "text" ? (s.raw += c.raw, s.text += c.text) : o.push(c);
1053
+ continue;
1054
+ }
1055
+ if (e) {
1056
+ let o = "Infinite loop on byte: " + e.charCodeAt(0);
1057
+ if (this.options.silent) {
1058
+ console.error(o);
1059
+ break;
1060
+ } else throw Error(o);
1061
+ }
1062
+ }
1063
+ return o;
1064
+ }
1065
+ }, P = class {
1066
+ options;
1067
+ parser;
1068
+ constructor(e) {
1069
+ this.options = e || T;
1070
+ }
1071
+ space(e) {
1072
+ return "";
1073
+ }
1074
+ code({ text: e, lang: o, escaped: s }) {
1075
+ let c = (o || "").match(m.notSpaceStart)?.[0], l = e.replace(m.endingNewline, "") + "\n";
1076
+ return c ? "<pre><code class=\"language-" + w(c) + "\">" + (s ? l : w(l, !0)) + "</code></pre>\n" : "<pre><code>" + (s ? l : w(l, !0)) + "</code></pre>\n";
1077
+ }
1078
+ blockquote({ tokens: e }) {
1079
+ return `<blockquote>
1080
+ ${this.parser.parse(e)}</blockquote>
1081
+ `;
1082
+ }
1083
+ html({ text: e }) {
1084
+ return e;
1085
+ }
1086
+ def(e) {
1087
+ return "";
1088
+ }
1089
+ heading({ tokens: e, depth: o }) {
1090
+ return `<h${o}>${this.parser.parseInline(e)}</h${o}>
1091
+ `;
1092
+ }
1093
+ hr(e) {
1094
+ return "<hr>\n";
1095
+ }
1096
+ list(e) {
1097
+ let o = e.ordered, s = e.start, c = "";
1098
+ for (let o = 0; o < e.items.length; o++) {
1099
+ let s = e.items[o];
1100
+ c += this.listitem(s);
1101
+ }
1102
+ let l = o ? "ol" : "ul", u = o && s !== 1 ? " start=\"" + s + "\"" : "";
1103
+ return "<" + l + u + ">\n" + c + "</" + l + ">\n";
1104
+ }
1105
+ listitem(e) {
1106
+ let o = "";
1107
+ if (e.task) {
1108
+ let s = this.checkbox({ checked: !!e.checked });
1109
+ e.loose ? e.tokens[0]?.type === "paragraph" ? (e.tokens[0].text = s + " " + 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 = s + " " + w(e.tokens[0].tokens[0].text), e.tokens[0].tokens[0].escaped = !0)) : e.tokens.unshift({
1110
+ type: "text",
1111
+ raw: s + " ",
1112
+ text: s + " ",
1113
+ escaped: !0
1114
+ }) : o += s + " ";
1115
+ }
1116
+ return o += this.parser.parse(e.tokens, !!e.loose), `<li>${o}</li>
1117
+ `;
1118
+ }
1119
+ checkbox({ checked: e }) {
1120
+ return "<input " + (e ? "checked=\"\" " : "") + "disabled=\"\" type=\"checkbox\">";
1121
+ }
1122
+ paragraph({ tokens: e }) {
1123
+ return `<p>${this.parser.parseInline(e)}</p>
1124
+ `;
1125
+ }
1126
+ table(e) {
1127
+ let o = "", s = "";
1128
+ for (let o = 0; o < e.header.length; o++) s += this.tablecell(e.header[o]);
1129
+ o += this.tablerow({ text: s });
1130
+ let c = "";
1131
+ for (let o = 0; o < e.rows.length; o++) {
1132
+ let l = e.rows[o];
1133
+ s = "";
1134
+ for (let e = 0; e < l.length; e++) s += this.tablecell(l[e]);
1135
+ c += this.tablerow({ text: s });
1136
+ }
1137
+ return c &&= `<tbody>${c}</tbody>`, "<table>\n<thead>\n" + o + "</thead>\n" + c + "</table>\n";
1138
+ }
1139
+ tablerow({ text: e }) {
1140
+ return `<tr>
1141
+ ${e}</tr>
1142
+ `;
1143
+ }
1144
+ tablecell(e) {
1145
+ let o = this.parser.parseInline(e.tokens), s = e.header ? "th" : "td";
1146
+ return (e.align ? `<${s} align="${e.align}">` : `<${s}>`) + o + `</${s}>
1147
+ `;
1148
+ }
1149
+ strong({ tokens: e }) {
1150
+ return `<strong>${this.parser.parseInline(e)}</strong>`;
1151
+ }
1152
+ em({ tokens: e }) {
1153
+ return `<em>${this.parser.parseInline(e)}</em>`;
1154
+ }
1155
+ codespan({ text: e }) {
1156
+ return `<code>${w(e, !0)}</code>`;
1157
+ }
1158
+ br(e) {
1159
+ return "<br>";
1160
+ }
1161
+ del({ tokens: e }) {
1162
+ return `<del>${this.parser.parseInline(e)}</del>`;
1163
+ }
1164
+ link({ href: e, title: o, tokens: s }) {
1165
+ let c = this.parser.parseInline(s), l = J(e);
1166
+ if (l === null) return c;
1167
+ e = l;
1168
+ let u = "<a href=\"" + e + "\"";
1169
+ return o && (u += " title=\"" + w(o) + "\""), u += ">" + c + "</a>", u;
1170
+ }
1171
+ image({ href: e, title: o, text: s, tokens: c }) {
1172
+ c && (s = this.parser.parseInline(c, this.parser.textRenderer));
1173
+ let l = J(e);
1174
+ if (l === null) return w(s);
1175
+ e = l;
1176
+ let u = `<img src="${e}" alt="${s}"`;
1177
+ return o && (u += ` title="${w(o)}"`), u += ">", u;
1178
+ }
1179
+ text(e) {
1180
+ return "tokens" in e && e.tokens ? this.parser.parseInline(e.tokens) : "escaped" in e && e.escaped ? e.text : w(e.text);
1181
+ }
1182
+ }, $ = class {
1183
+ strong({ text: e }) {
1184
+ return e;
1185
+ }
1186
+ em({ text: e }) {
1187
+ return e;
1188
+ }
1189
+ codespan({ text: e }) {
1190
+ return e;
1191
+ }
1192
+ del({ text: e }) {
1193
+ return e;
1194
+ }
1195
+ html({ text: e }) {
1196
+ return e;
1197
+ }
1198
+ text({ text: e }) {
1199
+ return e;
1200
+ }
1201
+ link({ text: e }) {
1202
+ return "" + e;
1203
+ }
1204
+ image({ text: e }) {
1205
+ return "" + e;
1206
+ }
1207
+ br() {
1208
+ return "";
1209
+ }
1210
+ }, b = class e {
1211
+ options;
1212
+ renderer;
1213
+ textRenderer;
1214
+ constructor(e) {
1215
+ this.options = e || T, this.options.renderer = this.options.renderer || new P(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new $();
1216
+ }
1217
+ static parse(o, s) {
1218
+ return new e(s).parse(o);
1219
+ }
1220
+ static parseInline(o, s) {
1221
+ return new e(s).parseInline(o);
1222
+ }
1223
+ parse(e, o = !0) {
1224
+ let s = "";
1225
+ for (let c = 0; c < e.length; c++) {
1226
+ let l = e[c];
1227
+ if (this.options.extensions?.renderers?.[l.type]) {
1228
+ let e = l, o = this.options.extensions.renderers[e.type].call({ parser: this }, e);
1229
+ if (o !== !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
+ s += o || "";
1243
+ continue;
1244
+ }
1245
+ }
1246
+ let u = l;
1247
+ switch (u.type) {
1248
+ case "space":
1249
+ s += this.renderer.space(u);
1250
+ continue;
1251
+ case "hr":
1252
+ s += this.renderer.hr(u);
1253
+ continue;
1254
+ case "heading":
1255
+ s += this.renderer.heading(u);
1256
+ continue;
1257
+ case "code":
1258
+ s += this.renderer.code(u);
1259
+ continue;
1260
+ case "table":
1261
+ s += this.renderer.table(u);
1262
+ continue;
1263
+ case "blockquote":
1264
+ s += this.renderer.blockquote(u);
1265
+ continue;
1266
+ case "list":
1267
+ s += this.renderer.list(u);
1268
+ continue;
1269
+ case "html":
1270
+ s += this.renderer.html(u);
1271
+ continue;
1272
+ case "def":
1273
+ s += this.renderer.def(u);
1274
+ continue;
1275
+ case "paragraph":
1276
+ s += this.renderer.paragraph(u);
1277
+ continue;
1278
+ case "text": {
1279
+ let l = u, f = this.renderer.text(l);
1280
+ for (; c + 1 < e.length && e[c + 1].type === "text";) l = e[++c], f += "\n" + this.renderer.text(l);
1281
+ o ? s += this.renderer.paragraph({
1282
+ type: "paragraph",
1283
+ raw: f,
1284
+ text: f,
1285
+ tokens: [{
1286
+ type: "text",
1287
+ raw: f,
1288
+ text: f,
1289
+ escaped: !0
1290
+ }]
1291
+ }) : s += f;
1292
+ continue;
1293
+ }
1294
+ default: {
1295
+ let e = "Token with \"" + u.type + "\" type was not found.";
1296
+ if (this.options.silent) return console.error(e), "";
1297
+ throw Error(e);
1298
+ }
1299
+ }
1300
+ }
1301
+ return s;
1302
+ }
1303
+ parseInline(e, o = this.renderer) {
1304
+ let s = "";
1305
+ for (let c = 0; c < e.length; c++) {
1306
+ let l = e[c];
1307
+ if (this.options.extensions?.renderers?.[l.type]) {
1308
+ let e = this.options.extensions.renderers[l.type].call({ parser: this }, l);
1309
+ if (e !== !1 || ![
1310
+ "escape",
1311
+ "html",
1312
+ "link",
1313
+ "image",
1314
+ "strong",
1315
+ "em",
1316
+ "codespan",
1317
+ "br",
1318
+ "del",
1319
+ "text"
1320
+ ].includes(l.type)) {
1321
+ s += e || "";
1322
+ continue;
1323
+ }
1324
+ }
1325
+ let u = l;
1326
+ switch (u.type) {
1327
+ case "escape":
1328
+ s += o.text(u);
1329
+ break;
1330
+ case "html":
1331
+ s += o.html(u);
1332
+ break;
1333
+ case "link":
1334
+ s += o.link(u);
1335
+ break;
1336
+ case "image":
1337
+ s += o.image(u);
1338
+ break;
1339
+ case "strong":
1340
+ s += o.strong(u);
1341
+ break;
1342
+ case "em":
1343
+ s += o.em(u);
1344
+ break;
1345
+ case "codespan":
1346
+ s += o.codespan(u);
1347
+ break;
1348
+ case "br":
1349
+ s += o.br(u);
1350
+ break;
1351
+ case "del":
1352
+ s += o.del(u);
1353
+ break;
1354
+ case "text":
1355
+ s += o.text(u);
1356
+ break;
1357
+ default: {
1358
+ let e = "Token with \"" + u.type + "\" type was not found.";
1359
+ if (this.options.silent) return console.error(e), "";
1360
+ throw Error(e);
1361
+ }
1362
+ }
1363
+ }
1364
+ return s;
1365
+ }
1366
+ }, S = class {
1367
+ options;
1368
+ block;
1369
+ constructor(e) {
1370
+ this.options = e || T;
1371
+ }
1372
+ static passThroughHooks = new Set([
1373
+ "preprocess",
1374
+ "postprocess",
1375
+ "processAllTokens",
1376
+ "emStrongMask"
1377
+ ]);
1378
+ static passThroughHooksRespectAsync = new Set([
1379
+ "preprocess",
1380
+ "postprocess",
1381
+ "processAllTokens"
1382
+ ]);
1383
+ preprocess(e) {
1384
+ return e;
1385
+ }
1386
+ postprocess(e) {
1387
+ return e;
1388
+ }
1389
+ processAllTokens(e) {
1390
+ return e;
1391
+ }
1392
+ emStrongMask(e) {
1393
+ return e;
1394
+ }
1395
+ provideLexer() {
1396
+ return this.block ? x.lex : x.lexInline;
1397
+ }
1398
+ provideParser() {
1399
+ return this.block ? b.parse : b.parseInline;
1400
+ }
1401
+ }, _ = new class {
1402
+ defaults = L();
1403
+ options = this.setOptions;
1404
+ parse = this.parseMarkdown(!0);
1405
+ parseInline = this.parseMarkdown(!1);
1406
+ Parser = b;
1407
+ Renderer = P;
1408
+ TextRenderer = $;
1409
+ Lexer = x;
1410
+ Tokenizer = y;
1411
+ Hooks = S;
1412
+ constructor(...e) {
1413
+ this.use(...e);
1414
+ }
1415
+ walkTokens(e, o) {
1416
+ let s = [];
1417
+ for (let c of e) switch (s = s.concat(o.call(this, c)), c.type) {
1418
+ case "table": {
1419
+ let e = c;
1420
+ for (let c of e.header) s = s.concat(this.walkTokens(c.tokens, o));
1421
+ for (let c of e.rows) for (let e of c) s = s.concat(this.walkTokens(e.tokens, o));
1422
+ break;
1423
+ }
1424
+ case "list": {
1425
+ let e = c;
1426
+ s = s.concat(this.walkTokens(e.items, o));
1427
+ break;
1428
+ }
1429
+ default: {
1430
+ let e = c;
1431
+ this.defaults.extensions?.childTokens?.[e.type] ? this.defaults.extensions.childTokens[e.type].forEach((c) => {
1432
+ let l = e[c].flat(Infinity);
1433
+ s = s.concat(this.walkTokens(l, o));
1434
+ }) : e.tokens && (s = s.concat(this.walkTokens(e.tokens, o)));
1435
+ }
1436
+ }
1437
+ return s;
1438
+ }
1439
+ use(...e) {
1440
+ let o = this.defaults.extensions || {
1441
+ renderers: {},
1442
+ childTokens: {}
1443
+ };
1444
+ return e.forEach((e) => {
1445
+ let s = { ...e };
1446
+ if (s.async = this.defaults.async || s.async || !1, e.extensions && (e.extensions.forEach((e) => {
1447
+ if (!e.name) throw Error("extension name required");
1448
+ if ("renderer" in e) {
1449
+ let s = o.renderers[e.name];
1450
+ s ? o.renderers[e.name] = function(...o) {
1451
+ let c = e.renderer.apply(this, o);
1452
+ return c === !1 && (c = s.apply(this, o)), c;
1453
+ } : o.renderers[e.name] = e.renderer;
1454
+ }
1455
+ if ("tokenizer" in e) {
1456
+ if (!e.level || e.level !== "block" && e.level !== "inline") throw Error("extension level must be 'block' or 'inline'");
1457
+ let s = o[e.level];
1458
+ s ? s.unshift(e.tokenizer) : o[e.level] = [e.tokenizer], e.start && (e.level === "block" ? o.startBlock ? o.startBlock.push(e.start) : o.startBlock = [e.start] : e.level === "inline" && (o.startInline ? o.startInline.push(e.start) : o.startInline = [e.start]));
1459
+ }
1460
+ "childTokens" in e && e.childTokens && (o.childTokens[e.name] = e.childTokens);
1461
+ }), s.extensions = o), e.renderer) {
1462
+ let o = this.defaults.renderer || new P(this.defaults);
1463
+ for (let s in e.renderer) {
1464
+ if (!(s in o)) throw Error(`renderer '${s}' does not exist`);
1465
+ if (["options", "parser"].includes(s)) continue;
1466
+ let c = s, l = e.renderer[c], u = o[c];
1467
+ o[c] = (...e) => {
1468
+ let s = l.apply(o, e);
1469
+ return s === !1 && (s = u.apply(o, e)), s || "";
1470
+ };
1471
+ }
1472
+ s.renderer = o;
1473
+ }
1474
+ if (e.tokenizer) {
1475
+ let o = this.defaults.tokenizer || new y(this.defaults);
1476
+ for (let s in e.tokenizer) {
1477
+ if (!(s in o)) throw Error(`tokenizer '${s}' does not exist`);
1478
+ if ([
1479
+ "options",
1480
+ "rules",
1481
+ "lexer"
1482
+ ].includes(s)) continue;
1483
+ let c = s, l = e.tokenizer[c], u = o[c];
1484
+ o[c] = (...e) => {
1485
+ let s = l.apply(o, e);
1486
+ return s === !1 && (s = u.apply(o, e)), s;
1487
+ };
1488
+ }
1489
+ s.tokenizer = o;
1490
+ }
1491
+ if (e.hooks) {
1492
+ let o = this.defaults.hooks || new S();
1493
+ for (let s in e.hooks) {
1494
+ if (!(s in o)) throw Error(`hook '${s}' does not exist`);
1495
+ if (["options", "block"].includes(s)) continue;
1496
+ let c = s, l = e.hooks[c], u = o[c];
1497
+ S.passThroughHooks.has(s) ? o[c] = (e) => {
1498
+ if (this.defaults.async && S.passThroughHooksRespectAsync.has(s)) return (async () => {
1499
+ let s = await l.call(o, e);
1500
+ return u.call(o, s);
1501
+ })();
1502
+ let c = l.call(o, e);
1503
+ return u.call(o, c);
1504
+ } : o[c] = (...e) => {
1505
+ if (this.defaults.async) return (async () => {
1506
+ let s = await l.apply(o, e);
1507
+ return s === !1 && (s = await u.apply(o, e)), s;
1508
+ })();
1509
+ let s = l.apply(o, e);
1510
+ return s === !1 && (s = u.apply(o, e)), s;
1511
+ };
1512
+ }
1513
+ s.hooks = o;
1514
+ }
1515
+ if (e.walkTokens) {
1516
+ let o = this.defaults.walkTokens, c = e.walkTokens;
1517
+ s.walkTokens = function(e) {
1518
+ let s = [];
1519
+ return s.push(c.call(this, e)), o && (s = s.concat(o.call(this, e))), s;
1520
+ };
1521
+ }
1522
+ this.defaults = {
1523
+ ...this.defaults,
1524
+ ...s
1525
+ };
1526
+ }), this;
1527
+ }
1528
+ setOptions(e) {
1529
+ return this.defaults = {
1530
+ ...this.defaults,
1531
+ ...e
1532
+ }, this;
1533
+ }
1534
+ lexer(e, o) {
1535
+ return x.lex(e, o ?? this.defaults);
1536
+ }
1537
+ parser(e, o) {
1538
+ return b.parse(e, o ?? this.defaults);
1539
+ }
1540
+ parseMarkdown(e) {
1541
+ return (o, s) => {
1542
+ let c = { ...s }, l = {
1543
+ ...this.defaults,
1544
+ ...c
1545
+ }, u = this.onError(!!l.silent, !!l.async);
1546
+ if (this.defaults.async === !0 && c.async === !1) return u(/* @__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."));
1547
+ if (typeof o > "u" || o === null) return u(/* @__PURE__ */ Error("marked(): input parameter is undefined or null"));
1548
+ if (typeof o != "string") return u(/* @__PURE__ */ Error("marked(): input parameter is of type " + Object.prototype.toString.call(o) + ", string expected"));
1549
+ if (l.hooks && (l.hooks.options = l, l.hooks.block = e), l.async) return (async () => {
1550
+ let s = l.hooks ? await l.hooks.preprocess(o) : o, c = await (l.hooks ? await l.hooks.provideLexer() : e ? x.lex : x.lexInline)(s, l), u = l.hooks ? await l.hooks.processAllTokens(c) : c;
1551
+ l.walkTokens && await Promise.all(this.walkTokens(u, l.walkTokens));
1552
+ let f = await (l.hooks ? await l.hooks.provideParser() : e ? b.parse : b.parseInline)(u, l);
1553
+ return l.hooks ? await l.hooks.postprocess(f) : f;
1554
+ })().catch(u);
1555
+ try {
1556
+ l.hooks && (o = l.hooks.preprocess(o));
1557
+ let s = (l.hooks ? l.hooks.provideLexer() : e ? x.lex : x.lexInline)(o, l);
1558
+ l.hooks && (s = l.hooks.processAllTokens(s)), l.walkTokens && this.walkTokens(s, l.walkTokens);
1559
+ let c = (l.hooks ? l.hooks.provideParser() : e ? b.parse : b.parseInline)(s, l);
1560
+ return l.hooks && (c = l.hooks.postprocess(c)), c;
1561
+ } catch (e) {
1562
+ return u(e);
1563
+ }
1564
+ };
1565
+ }
1566
+ onError(e, o) {
1567
+ return (s) => {
1568
+ if (s.message += "\nPlease report this to https://github.com/markedjs/marked.", e) {
1569
+ let e = "<p>An error occurred:</p><pre>" + w(s.message + "", !0) + "</pre>";
1570
+ return o ? Promise.resolve(e) : e;
1571
+ }
1572
+ if (o) return Promise.reject(s);
1573
+ throw s;
1574
+ };
1575
+ }
1576
+ }();
1577
+ function k(e, o) {
1578
+ return _.parse(e, o);
1579
+ }
1580
+ k.options = k.setOptions = function(e) {
1581
+ return _.setOptions(e), k.defaults = _.defaults, G(k.defaults), k;
1582
+ }, k.getDefaults = L, k.defaults = T, k.use = function(...e) {
1583
+ return _.use(...e), k.defaults = _.defaults, G(k.defaults), k;
1584
+ }, k.walkTokens = function(e, o) {
1585
+ return _.walkTokens(e, o);
1586
+ }, k.parseInline = _.parseInline, k.Parser = b, k.parser = b.parse, k.Renderer = P, k.TextRenderer = $, k.Lexer = x, k.lexer = x.lex, k.Tokenizer = y, k.Hooks = S, k.parse = k, k.options, k.setOptions, k.use, k.walkTokens, k.parseInline, b.parse, x.lex;
1587
+ function dedent(e) {
1588
+ var o = [...arguments].slice(1), s = Array.from(typeof e == "string" ? [e] : e);
1589
+ s[s.length - 1] = s[s.length - 1].replace(/\r?\n([\t ]*)$/, "");
1590
+ var c = s.reduce(function(e, o) {
1591
+ var s = o.match(/\n([\t ]+|(?!\s).)/g);
1592
+ return s ? e.concat(s.map(function(e) {
1593
+ return e.match(/[\t ]/g)?.length ?? 0;
1594
+ })) : e;
1595
+ }, []);
1596
+ if (c.length) {
1597
+ var l = RegExp("\n[ ]{" + Math.min.apply(Math, c) + "}", "g");
1598
+ s = s.map(function(e) {
1599
+ return e.replace(l, "\n");
1600
+ });
1601
+ }
1602
+ s[0] = s[0].replace(/^\r?\n/, "");
1603
+ var u = s[0];
1604
+ return o.forEach(function(e, o) {
1605
+ var c = u.match(/(?:^|\n)( *)$/), l = c ? c[1] : "", f = e;
1606
+ typeof e == "string" && e.includes("\n") && (f = String(e).split("\n").map(function(e, o) {
1607
+ return o === 0 ? e : "" + l + e;
1608
+ }).join("\n")), u += f + s[o + 1];
1609
+ }), u;
1610
+ }
1611
+ var unknownIcon = {
1612
+ 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>",
1613
+ height: 80,
1614
+ width: 80
1615
+ }, iconsStore = /* @__PURE__ */ new Map(), loaderStore = /* @__PURE__ */ new Map(), registerIconPacks = /* @__PURE__ */ __name((o) => {
1616
+ for (let s of o) {
1617
+ if (!s.name) throw Error("Invalid icon loader. Must have a \"name\" property with non-empty string value.");
1618
+ if (log.debug("Registering icon pack:", s.name), "loader" in s) loaderStore.set(s.name, s.loader);
1619
+ else if ("icons" in s) iconsStore.set(s.name, s.icons);
1620
+ else throw log.error("Invalid icon loader:", s), Error("Invalid icon loader. Must have either \"icons\" or \"loader\" property.");
1621
+ }
1622
+ }, "registerIconPacks"), getRegisteredIconData = /* @__PURE__ */ __name(async (o, s) => {
1623
+ let c = stringToIcon(o, !0, s !== void 0);
1624
+ if (!c) throw Error(`Invalid icon name: ${o}`);
1625
+ let l = c.prefix || s;
1626
+ if (!l) throw Error(`Icon name must contain a prefix: ${o}`);
1627
+ let u = iconsStore.get(l);
1628
+ if (!u) {
1629
+ let o = loaderStore.get(l);
1630
+ if (!o) throw Error(`Icon set not found: ${c.prefix}`);
1631
+ try {
1632
+ u = {
1633
+ ...await o(),
1634
+ prefix: l
1635
+ }, iconsStore.set(l, u);
1636
+ } catch (o) {
1637
+ throw log.error(o), Error(`Failed to load icon set: ${c.prefix}`);
1638
+ }
1639
+ }
1640
+ let f = getIconData(u, c.name);
1641
+ if (!f) throw Error(`Icon not found: ${o}`);
1642
+ return f;
1643
+ }, "getRegisteredIconData"), isIconAvailable = /* @__PURE__ */ __name(async (e) => {
1644
+ try {
1645
+ return await getRegisteredIconData(e), !0;
1646
+ } catch {
1647
+ return !1;
1648
+ }
1649
+ }, "isIconAvailable"), getIconSVG = /* @__PURE__ */ __name(async (o, s, l) => {
1650
+ let u;
1651
+ try {
1652
+ u = await getRegisteredIconData(o, s?.fallbackPrefix);
1653
+ } catch (o) {
1654
+ log.error(o), u = unknownIcon;
1655
+ }
1656
+ let f = iconToSVG(u, s);
1657
+ return sanitizeText(iconToHTML(replaceIDs(f.body), {
1658
+ ...f.attributes,
1659
+ ...l
1660
+ }), getConfig());
1661
+ }, "getIconSVG");
1662
+ function preprocessMarkdown(e, { markdownAutoWrap: o }) {
1663
+ let s = dedent(e.replace(/<br\/>/g, "\n").replace(/\n{2,}/g, "\n"));
1664
+ return o === !1 ? s.replace(/ /g, "&nbsp;") : s;
1665
+ }
1666
+ __name(preprocessMarkdown, "preprocessMarkdown");
1667
+ function markdownToLines(e, s = {}) {
1668
+ let c = preprocessMarkdown(e, s), l = k.lexer(c), u = [[]], f = 0;
1669
+ function p(e, o = "normal") {
1670
+ e.type === "text" ? e.text.split("\n").forEach((e, s) => {
1671
+ s !== 0 && (f++, u.push([])), e.split(" ").forEach((e) => {
1672
+ e = e.replace(/&#39;/g, "'"), e && u[f].push({
1673
+ content: e,
1674
+ type: o
1675
+ });
1676
+ });
1677
+ }) : e.type === "strong" || e.type === "em" ? e.tokens.forEach((o) => {
1678
+ p(o, e.type);
1679
+ }) : e.type === "html" && u[f].push({
1680
+ content: e.text,
1681
+ type: "normal"
1682
+ });
1683
+ }
1684
+ return __name(p, "processNode"), l.forEach((e) => {
1685
+ e.type === "paragraph" ? e.tokens?.forEach((e) => {
1686
+ p(e);
1687
+ }) : e.type === "html" ? u[f].push({
1688
+ content: e.text,
1689
+ type: "normal"
1690
+ }) : u[f].push({
1691
+ content: e.raw,
1692
+ type: "normal"
1693
+ });
1694
+ }), u;
1695
+ }
1696
+ __name(markdownToLines, "markdownToLines");
1697
+ function markdownToHTML(s, { markdownAutoWrap: c } = {}) {
1698
+ let l = k.lexer(s);
1699
+ function u(o) {
1700
+ return o.type === "text" ? c === !1 ? o.text.replace(/\n */g, "<br/>").replace(/ /g, "&nbsp;") : o.text.replace(/\n */g, "<br/>") : o.type === "strong" ? `<strong>${o.tokens?.map(u).join("")}</strong>` : o.type === "em" ? `<em>${o.tokens?.map(u).join("")}</em>` : o.type === "paragraph" ? `<p>${o.tokens?.map(u).join("")}</p>` : o.type === "space" ? "" : o.type === "html" ? `${o.text}` : o.type === "escape" ? o.text : (log.warn(`Unsupported markdown: ${o.type}`), o.raw);
1701
+ }
1702
+ return __name(u, "output"), l.map(u).join("");
1703
+ }
1704
+ __name(markdownToHTML, "markdownToHTML");
1705
+ function splitTextToChars(e) {
1706
+ return Intl.Segmenter ? [...new Intl.Segmenter().segment(e)].map((e) => e.segment) : [...e];
1707
+ }
1708
+ __name(splitTextToChars, "splitTextToChars");
1709
+ function splitWordToFitWidth(e, o) {
1710
+ return splitWordToFitWidthRecursion(e, [], splitTextToChars(o.content), o.type);
1711
+ }
1712
+ __name(splitWordToFitWidth, "splitWordToFitWidth");
1713
+ function splitWordToFitWidthRecursion(e, o, s, c) {
1714
+ if (s.length === 0) return [{
1715
+ content: o.join(""),
1716
+ type: c
1717
+ }, {
1718
+ content: "",
1719
+ type: c
1720
+ }];
1721
+ let [l, ...u] = s, f = [...o, l];
1722
+ return e([{
1723
+ content: f.join(""),
1724
+ type: c
1725
+ }]) ? splitWordToFitWidthRecursion(e, f, u, c) : (o.length === 0 && l && (o.push(l), s.shift()), [{
1726
+ content: o.join(""),
1727
+ type: c
1728
+ }, {
1729
+ content: s.join(""),
1730
+ type: c
1731
+ }]);
1732
+ }
1733
+ __name(splitWordToFitWidthRecursion, "splitWordToFitWidthRecursion");
1734
+ function splitLineToFitWidth(e, o) {
1735
+ if (e.some(({ content: e }) => e.includes("\n"))) throw Error("splitLineToFitWidth does not support newlines in the line");
1736
+ return splitLineToFitWidthRecursion(e, o);
1737
+ }
1738
+ __name(splitLineToFitWidth, "splitLineToFitWidth");
1739
+ function splitLineToFitWidthRecursion(e, o, s = [], c = []) {
1740
+ if (e.length === 0) return c.length > 0 && s.push(c), s.length > 0 ? s : [];
1741
+ let l = "";
1742
+ e[0].content === " " && (l = " ", e.shift());
1743
+ let u = e.shift() ?? {
1744
+ content: " ",
1745
+ type: "normal"
1746
+ }, f = [...c];
1747
+ if (l !== "" && f.push({
1748
+ content: l,
1749
+ type: "normal"
1750
+ }), f.push(u), o(f)) return splitLineToFitWidthRecursion(e, o, s, f);
1751
+ if (c.length > 0) s.push(c), e.unshift(u);
1752
+ else if (u.content) {
1753
+ let [c, l] = splitWordToFitWidth(o, u);
1754
+ s.push([c]), l.content && e.unshift(l);
1755
+ }
1756
+ return splitLineToFitWidthRecursion(e, o, s);
1757
+ }
1758
+ __name(splitLineToFitWidthRecursion, "splitLineToFitWidthRecursion");
1759
+ function applyStyle(e, o) {
1760
+ o && e.attr("style", o);
1761
+ }
1762
+ __name(applyStyle, "applyStyle");
1763
+ async function addHtmlSpan(e, o, s, h, g = !1, O = getConfig()) {
1764
+ let A = e.append("foreignObject");
1765
+ A.attr("width", `${10 * s}px`), A.attr("height", `${10 * s}px`);
1766
+ let R = A.append("xhtml:div"), B = hasKatex(o.label) ? await renderKatexSanitized(o.label.replace(common_default.lineBreakRegex, "\n"), O) : sanitizeText(o.label, O), H = o.isNode ? "nodeLabel" : "edgeLabel", Y = R.append("span");
1767
+ Y.html(B), applyStyle(Y, o.labelStyle), Y.attr("class", `${H} ${h}`), applyStyle(R, o.labelStyle), R.style("display", "table-cell"), R.style("white-space", "nowrap"), R.style("line-height", "1.5"), R.style("max-width", s + "px"), R.style("text-align", "center"), R.attr("xmlns", "http://www.w3.org/1999/xhtml"), g && R.attr("class", "labelBkg");
1768
+ let Z = R.node().getBoundingClientRect();
1769
+ return Z.width === s && (R.style("display", "table"), R.style("white-space", "break-spaces"), R.style("width", s + "px"), Z = R.node().getBoundingClientRect()), A.node();
1770
+ }
1771
+ __name(addHtmlSpan, "addHtmlSpan");
1772
+ function createTspan(e, o, s) {
1773
+ return e.append("tspan").attr("class", "text-outer-tspan").attr("x", 0).attr("y", o * s - .1 + "em").attr("dy", s + "em");
1774
+ }
1775
+ __name(createTspan, "createTspan");
1776
+ function computeWidthOfText(e, o, s) {
1777
+ let c = e.append("text"), l = createTspan(c, 1, o);
1778
+ updateTextContentAndStyles(l, s);
1779
+ let u = l.node().getComputedTextLength();
1780
+ return c.remove(), u;
1781
+ }
1782
+ __name(computeWidthOfText, "computeWidthOfText");
1783
+ function computeDimensionOfText(e, o, s) {
1784
+ let c = e.append("text"), l = createTspan(c, 1, o);
1785
+ updateTextContentAndStyles(l, [{
1786
+ content: s,
1787
+ type: "normal"
1788
+ }]);
1789
+ let u = l.node()?.getBoundingClientRect();
1790
+ return u && c.remove(), u;
1791
+ }
1792
+ __name(computeDimensionOfText, "computeDimensionOfText");
1793
+ function createFormattedText(e, s, c, l = !1) {
1794
+ let u = 1.1, f = s.append("g"), p = f.insert("rect").attr("class", "background").attr("style", "stroke: none"), h = f.append("text").attr("y", "-10.1"), g = 0;
1795
+ for (let s of c) {
1796
+ let c = /* @__PURE__ */ __name((o) => computeWidthOfText(f, u, o) <= e, "checkWidth"), l = c(s) ? [s] : splitLineToFitWidth(s, c);
1797
+ for (let e of l) updateTextContentAndStyles(createTspan(h, g, u), e), g++;
1798
+ }
1799
+ if (l) {
1800
+ let e = h.node().getBBox();
1801
+ return p.attr("x", e.x - 2).attr("y", e.y - 2).attr("width", e.width + 4).attr("height", e.height + 4), f.node();
1802
+ } else return h.node();
1803
+ }
1804
+ __name(createFormattedText, "createFormattedText");
1805
+ function updateTextContentAndStyles(e, o) {
1806
+ e.text(""), o.forEach((o, s) => {
1807
+ let c = e.append("tspan").attr("font-style", o.type === "em" ? "italic" : "normal").attr("class", "text-inner-tspan").attr("font-weight", o.type === "strong" ? "bold" : "normal");
1808
+ s === 0 ? c.text(o.content) : c.text(" " + o.content);
1809
+ });
1810
+ }
1811
+ __name(updateTextContentAndStyles, "updateTextContentAndStyles");
1812
+ async function replaceIconSubstring(e, o = {}) {
1813
+ let s = [];
1814
+ e.replace(/(fa[bklrs]?):fa-([\w-]+)/g, (e, l, u) => (s.push((async () => {
1815
+ let s = `${l}:${u}`;
1816
+ return await isIconAvailable(s) ? await getIconSVG(s, void 0, { class: "label-icon" }) : `<i class='${sanitizeText(e, o).replace(":", " ")}'></i>`;
1817
+ })()), e));
1818
+ let l = await Promise.all(s);
1819
+ return e.replace(/(fa[bklrs]?):fa-([\w-]+)/g, () => l.shift() ?? "");
1820
+ }
1821
+ __name(replaceIconSubstring, "replaceIconSubstring");
1822
+ var createText = /* @__PURE__ */ __name(async (o, c = "", { style: l = "", isTitle: f = !1, classes: p = "", useHtmlLabels: g = !0, isNode: O = !0, width: A = 200, addSvgBackground: R = !1 } = {}, B) => {
1823
+ if (log.debug("XYZ createText", c, l, f, p, g, O, "addSvgBackground: ", R), g) {
1824
+ let e = await replaceIconSubstring(decodeEntities(markdownToHTML(c, B)), B), s = c.replace(/\\\\/g, "\\");
1825
+ return await addHtmlSpan(o, {
1826
+ isNode: O,
1827
+ label: hasKatex(c) ? s : e,
1828
+ labelStyle: l.replace("fill:", "color:")
1829
+ }, A, p, R, B);
1830
+ } else {
1831
+ let e = createFormattedText(A, o, markdownToLines(c.replace(/<br\s*\/?>/g, "<br/>").replace("<br>", "<br/>"), B), c ? R : !1);
1832
+ if (O) {
1833
+ /stroke:/.exec(l) && (l = l.replace("stroke:", "lineColor:"));
1834
+ let o = l.replace(/stroke:[^;]+;?/g, "").replace(/stroke-width:[^;]+;?/g, "").replace(/fill:[^;]+;?/g, "").replace(/color:/g, "fill:");
1835
+ select_default(e).attr("style", o);
1836
+ } else {
1837
+ let o = l.replace(/stroke:[^;]+;?/g, "").replace(/stroke-width:[^;]+;?/g, "").replace(/fill:[^;]+;?/g, "").replace(/background:/g, "fill:");
1838
+ select_default(e).select("rect").attr("style", o.replace(/background:/g, "fill:"));
1839
+ let c = l.replace(/stroke:[^;]+;?/g, "").replace(/stroke-width:[^;]+;?/g, "").replace(/fill:[^;]+;?/g, "").replace(/color:/g, "fill:");
1840
+ select_default(e).select("text").attr("style", c);
1841
+ }
1842
+ return e;
1843
+ }
1844
+ }, "createText");
1845
+ export { replaceIconSubstring as a, registerIconPacks as i, createText as n, unknownIcon as o, getIconSVG as r, dedent as s, computeDimensionOfText as t };