@boldare/askdare 0.3.0 → 0.5.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 (52) hide show
  1. package/CHANGELOG.md +63 -0
  2. package/README.md +14 -4
  3. package/dist/cli.js +111 -26
  4. package/dist/define-tool.js +1006 -8
  5. package/dist/embed.d.ts +19 -0
  6. package/dist/embed.js +250 -0
  7. package/dist/{store.d.ts → events.d.ts} +163 -54
  8. package/dist/index.d.ts +28 -2
  9. package/dist/index.js +74 -158
  10. package/dist/next.d.ts +70 -9
  11. package/dist/next.js +767 -169
  12. package/dist/react-marked.js +648 -624
  13. package/dist/react.d.ts +63 -77
  14. package/dist/react.js +148 -1854
  15. package/dist/root.js +2254 -0
  16. package/dist/tool-results.d.ts +140 -0
  17. package/dist/ui/askdare.css +21 -1
  18. package/dist/ui/avatar.tsx +1 -1
  19. package/dist/ui/chat.tsx +1 -1
  20. package/dist/ui/confirm.tsx +1 -1
  21. package/dist/ui/context.ts +1 -1
  22. package/dist/ui/feedback.tsx +1 -1
  23. package/dist/ui/footer.tsx +3 -15
  24. package/dist/ui/header.tsx +1 -1
  25. package/dist/ui/icons.tsx +1 -1
  26. package/dist/ui/index.ts +1 -1
  27. package/dist/ui/message.tsx +6 -4
  28. package/dist/ui/panel.tsx +17 -6
  29. package/dist/ui/welcome.tsx +1 -1
  30. package/docs/accessibility.md +83 -0
  31. package/docs/cli.md +5 -3
  32. package/docs/compliance.md +160 -0
  33. package/docs/configuration.md +58 -2
  34. package/docs/costs.md +8 -1
  35. package/docs/custom-store.md +2 -0
  36. package/docs/embedding.md +104 -0
  37. package/docs/events.md +1 -1
  38. package/docs/feedback.md +1 -1
  39. package/docs/going-public.md +15 -3
  40. package/docs/guardrails.md +128 -0
  41. package/docs/migrating-from-openai-assistant.md +1 -1
  42. package/docs/privacy.md +27 -3
  43. package/docs/protocol.md +15 -1
  44. package/docs/react.md +57 -3
  45. package/docs/styling.md +4 -3
  46. package/docs/support.md +3 -3
  47. package/docs/texts.md +127 -98
  48. package/docs/tools.md +20 -0
  49. package/docs/troubleshooting.md +30 -3
  50. package/llms.txt +14 -11
  51. package/package.json +10 -6
  52. package/skills/askdare/SKILL.md +12 -2
@@ -1,7 +1,7 @@
1
1
  'use client';
2
- // ../../node_modules/.pnpm/marked@18.1.3/node_modules/marked/lib/marked.esm.js
2
+ // ../../node_modules/.pnpm/marked@18.2.0/node_modules/marked/lib/marked.esm.js
3
3
  /**
4
- * marked v18.1.3 - a markdown parser
4
+ * marked v18.2.0 - a markdown parser
5
5
  * Copyright (c) 2018-2026, MarkedJS. (MIT License)
6
6
  * Copyright (c) 2011-2018, Christopher Jeffrey. (MIT License)
7
7
  * https://github.com/markedjs/marked
@@ -10,7 +10,7 @@
10
10
  * DO NOT EDIT THIS FILE
11
11
  * The code in this file is generated from files in ./src/
12
12
  */
13
- function H() {
13
+ function j() {
14
14
  return {
15
15
  async: !1,
16
16
  breaks: !1,
@@ -24,37 +24,38 @@ function H() {
24
24
  walkTokens: null
25
25
  };
26
26
  }
27
- var S = H();
28
- function se(a) {
29
- S = a;
27
+ var y = j();
28
+ function ie(l) {
29
+ y = l;
30
30
  }
31
- var B = { exec: () => null };
32
- function D(a) {
31
+ var D = { exec: () => null };
32
+ function B(l) {
33
33
  let e = [];
34
34
  return (t) => {
35
35
  let n = Math.max(0, Math.min(3, t - 1)), s = e[n];
36
- return s || (s = a(n), e[n] = s), s;
36
+ return s || (s = l(n), e[n] = s), s;
37
37
  };
38
38
  }
39
- function c(a, e = "") {
40
- let t = typeof a == "string" ? a : a.source, n = {
41
- replace: (s, r) => {
42
- let o = typeof r == "string" ? r : r.source;
43
- return o = o.replace(T.caret, "$1"), t = t.replace(s, o), n;
39
+ function h(l, e = "") {
40
+ let t = typeof l == "string" ? l : l.source, n = {
41
+ replace: (s, i) => {
42
+ let r = typeof i == "string" ? i : i.source;
43
+ return r = r.replace(T.caret, "$1"), t = t.replace(s, r), n;
44
44
  },
45
45
  getRegex: () => new RegExp(t, e)
46
46
  };
47
47
  return n;
48
48
  }
49
- var Te = ((a = "") => {
49
+ var we = ((l = "") => {
50
50
  try {
51
- return !!new RegExp("(?<=1)(?<!1)" + a);
51
+ return !!new RegExp("(?<=1)(?<!1)" + l);
52
52
  } catch {
53
53
  return !1;
54
54
  }
55
55
  })();
56
56
  var T = {
57
57
  codeRemoveIndent: /^(?: {0,3}\t| {1,4})/gm,
58
+ listInterruptsParagraph: /^ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/,
58
59
  outputLinkReplace: /\\([\[\]])/g,
59
60
  indentCodeCompensation: /^(\s+)(?:```)/,
60
61
  beginningSpace: /^\s+/,
@@ -108,286 +109,287 @@ var T = {
108
109
  spaceLine: /^ +$/gm,
109
110
  notSpaceStart: /^\S*/,
110
111
  endingNewline: /\n$/,
111
- listItemRegex: (a) => new RegExp(`^( {0,3}${a})((?:[ ][^\\n]*)?(?:\\n|$))`),
112
- nextBulletRegex: D((a) => new RegExp(`^ {0,${a}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),
113
- hrRegex: D((a) => new RegExp(`^ {0,${a}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),
114
- fencesBeginRegex: D((a) => new RegExp(`^ {0,${a}}(?:\`\`\`|~~~)`)),
115
- headingBeginRegex: D((a) => new RegExp(`^ {0,${a}}#{1,6}(?:\\s|$)`)),
116
- pedanticHeadingBeginRegex: D((a) => new RegExp(`^ {0,${a}}#`)),
117
- htmlBeginRegex: D((a) => new RegExp(`^ {0,${a}}(?:</?(?:${K})(?: +|$|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`, "i")),
118
- blockquoteBeginRegex: D((a) => new RegExp(`^ {0,${a}}>`))
112
+ listItemRegex: (l) => new RegExp(`^( {0,3}${l})((?:[ ][^\\n]*)?(?:\\n|$))`),
113
+ nextBulletRegex: B((l) => new RegExp(`^ {0,${l}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),
114
+ hrRegex: B((l) => new RegExp(`^ {0,${l}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),
115
+ fencesBeginRegex: B((l) => new RegExp(`^ {0,${l}}(?:\`\`\`|~~~)`)),
116
+ headingBeginRegex: B((l) => new RegExp(`^ {0,${l}}#{1,6}(?:\\s|$)`)),
117
+ pedanticHeadingBeginRegex: B((l) => new RegExp(`^ {0,${l}}#`)),
118
+ htmlBeginRegex: B((l) => new RegExp(`^ {0,${l}}(?:</?(?:${K})(?: +|$|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`, "i")),
119
+ blockquoteBeginRegex: B((l) => new RegExp(`^ {0,${l}}>`)),
120
+ nestedContainerMarkers: /^(?: {0,3}(?:(?:[*+-]|\d{1,9}[.)])[ \t]+|>[ \t]?))+/
119
121
  };
120
- var ve = /^(?:[ \t]*(?:\n|$))+/;
121
- var Ze = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/;
122
- var He = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}(?:(?=`)\1`*|(?=~)\1~*) *(?=\n|$)|$)/;
122
+ var He = /^(?:[ \t]*(?:\n|$))+/;
123
+ var je = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/;
124
+ var Ge = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}(?:(?=`)\1`*|(?=~)\1~*) *(?=\n|$)|$)/;
123
125
  var W = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/;
124
- var je = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/;
125
- var oe = / {0,3}(?:[*+-]|\d{1,9}[.)])/;
126
- var Oe = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+)[ \t]*(?:\n+|$)/;
127
- var we = c(Oe).replace(/bull/g, oe).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}(?:\s|$)/).replace(/hr/g, / {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex();
128
- var Ge = c(Oe).replace(/bull/g, oe).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}(?:\s|$)/).replace(/hr/g, / {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex();
129
- var ae = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/;
130
- var Ne = /^[^\n]+/;
131
- var le = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\\n]|\n(?![ \t]*\n))+/;
132
- var Fe = c(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", le).replace("title", /(?:"(?:\\[\s\S]|[^"\\])*"|'(?:\\[\s\S]|[^'\\\n]|\n(?!\n))*'|\((?:\\[\s\S]|[^()\\])*\))/).getRegex();
133
- var Qe = c(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g, oe).getRegex();
126
+ var Ne = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/;
127
+ var ae = / {0,3}(?:[*+-]|\d{1,9}[.)])/;
128
+ var Pe = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+)[ \t]*(?:\n+|$)/;
129
+ var ye = h(Pe).replace(/bull/g, ae).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}(?:\s|$)/).replace(/hr/g, / {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex();
130
+ var Fe = h(Pe).replace(/bull/g, ae).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}(?:\s|$)/).replace(/hr/g, / {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex();
131
+ var le = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/;
132
+ var Qe = /^[^\n]+/;
133
+ var ue = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\\n]|\n(?![ \t]*\n))+/;
134
+ var Ue = h(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", ue).replace("title", /(?:"(?:\\[\s\S]|[^"\\])*"|'(?:\\[\s\S]|[^'\\\n]|\n(?!\n))*'|\((?:\\[\s\S]|[^()\\])*\))/).getRegex();
135
+ var We = h(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g, ae).getRegex();
134
136
  var K = "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";
135
- var ue = /<!--(?:-?>|[\s\S]*?(?:-->|$))/;
136
- var Ue = c("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?:[ \\t]+|\\n|/?>|$)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!(?:script|pre|style|textarea)(?![a-z0-9-]))([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", ue).replace("tag", K).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();
137
- var Pe = (a) => c(ae).replace("hr", W).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", a).replace("html", " {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag", K).getRegex();
138
- var We = Pe(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/);
139
- var Ke = Pe(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/);
140
- var pe = {
141
- blockquote: c(/^( {0,3}> ?(?:(?![ \t]*(?:\n|$))(paragraph)|[^\n]*)(?:\n|$))+/).replace("paragraph", Ke).getRegex(),
142
- code: Ze,
143
- def: Fe,
144
- fences: He,
145
- heading: je,
137
+ var pe = /<!--(?:-?>|[\s\S]*?(?:-->|$))/;
138
+ var Ke = h("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?:[ \\t]+|\\n|/?>|$)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!(?:script|pre|style|textarea)(?![a-z0-9-]))([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", pe).replace("tag", K).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();
139
+ var Se = (l) => h(le).replace("hr", W).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", l).replace("html", " {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag", K).getRegex();
140
+ var Xe = Se(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/);
141
+ var Ve = Se(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/);
142
+ var ce = {
143
+ blockquote: h(/^( {0,3}> ?(?:(?![ \t]*(?:\n|$))(paragraph)|[^\n]*)(?:\n|$))+/).replace("paragraph", Ve).getRegex(),
144
+ code: je,
145
+ def: Ue,
146
+ fences: Ge,
147
+ heading: Ne,
146
148
  hr: W,
147
- html: Ue,
148
- lheading: we,
149
- list: Qe,
150
- newline: ve,
151
- paragraph: We,
152
- table: B,
153
- text: Ne
149
+ html: Ke,
150
+ lheading: ye,
151
+ list: We,
152
+ newline: He,
153
+ paragraph: Xe,
154
+ table: D,
155
+ text: Qe
154
156
  };
155
- var xe = c("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", W).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", " {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag", K).getRegex();
156
- var Ve = {
157
- ...pe,
158
- lheading: Ge,
159
- table: xe,
160
- paragraph: c(ae).replace("hr", W).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", xe).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html", " {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag", K).getRegex()
157
+ var Re = h("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", W).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", " {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag", K).getRegex();
158
+ var Ye = {
159
+ ...ce,
160
+ lheading: Fe,
161
+ table: Re,
162
+ paragraph: h(le).replace("hr", W).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", Re).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html", " {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag", K).getRegex()
161
163
  };
162
- var Je = {
163
- ...pe,
164
- html: c(`^ *(?:comment(?: *\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1>(?: *\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?>(?: *\\n{2,}|\\s*$))`).replace("comment", ue).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(),
164
+ var et = {
165
+ ...ce,
166
+ html: h(`^ *(?:comment(?: *\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1>(?: *\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?>(?: *\\n{2,}|\\s*$))`).replace("comment", pe).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(),
165
167
  def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
166
168
  heading: /^(#{1,6})(.*)(?:\n+|$)/,
167
- fences: B,
169
+ fences: D,
168
170
  lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
169
- paragraph: c(ae).replace("hr", W).replace("heading", ` *#{1,6} *[^
170
- ]`).replace("lheading", we).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
171
+ paragraph: h(le).replace("hr", W).replace("heading", ` *#{1,6} *[^
172
+ ]`).replace("lheading", ye).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
171
173
  };
172
- var Ye = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/;
173
- var et = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/;
174
- var Se = /^( {2,}|\\)\n(?!\s*$)[ \t]*/;
175
- var tt = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/;
174
+ var tt = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/;
175
+ var nt = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/;
176
+ var _e = /^( {2,}|\\)\n(?!\s*$)[ \t]*/;
177
+ var rt = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/;
176
178
  var $ = /[\p{P}\p{S}]/u;
177
- var j = /[\s\p{P}\p{S}]/u;
179
+ var G = /[\s\p{P}\p{S}]/u;
178
180
  var X = /[^\s\p{P}\p{S}]/u;
179
- var nt = c(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, j).getRegex();
180
- var rt = /[\p{Pi}\p{Ps}"']/u;
181
- var ye = /(?!~)[\p{P}\p{S}]/u;
182
- var st = /(?!~)[\s\p{P}\p{S}]/u;
183
- var it = /(?:[^\s\p{P}\p{S}]|~)/u;
184
- var ot = c(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", Te ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex();
185
- var _e = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/;
186
- var at = c(_e, "u").replace(/punct/g, $).getRegex();
187
- var lt = c(_e, "u").replace(/punct/g, ye).getRegex();
188
- var pt = c(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/, "u").replace(/openQuote/g, rt).replace(/punct/g, $).getRegex();
189
- var $e = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)";
190
- var ct = c($e, "gu").replace(/notPunctSpace/g, X).replace(/punctSpace/g, j).replace(/punct/g, $).getRegex();
191
- var ht = c($e, "gu").replace(/notPunctSpace/g, it).replace(/punctSpace/g, st).replace(/punct/g, ye).getRegex();
192
- var gt = c("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, X).replace(/punctSpace/g, j).replace(/punct/g, $).getRegex();
193
- var kt = c("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, X).replace(/punctSpace/g, j).replace(/punct/g, $).getRegex();
194
- var mt = c("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, X).replace(/punctSpace/g, j).replace(/punct/g, $).getRegex();
195
- var xt = c(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, $).getRegex();
196
- var Rt = c("^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, X).replace(/punctSpace/g, j).replace(/punct/g, $).getRegex();
197
- var Tt = c(/\\(punct)/, "gu").replace(/punct/g, $).getRegex();
198
- var Ot = c(/(`+)(?:[^`]|[^`][\s\S]*?[^`])\1(?!`)|`+|\\(punct)/, "gu").replace(/punct/g, $).getRegex();
199
- var wt = c(/^<(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();
200
- var Pt = c(ue).replace("(?:-->|$)", "-->").getRegex();
201
- var St = c("^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", Pt).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex();
202
- var Le = /\[(?:\\[\s\S]|[^\[\]\\])*\]/;
203
- var re = c(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets", Le).getRegex();
204
- var yt = c(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace("label", re).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title", /"(?:\\[\s\S]|[^"\\])*"|'(?:\\[\s\S]|[^'\\])*'|\((?:\\[\s\S]|[^)\\])*\)/).getRegex();
205
- var _t = c(/^!?\[(label)\]\[(ref)\]/).replace("label", re).replace("ref", le).getRegex();
206
- var $t = c(/^!?\[(ref)\](?:\[\])?/).replace("ref", le).getRegex();
207
- var be = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/;
208
- var Lt = c(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets", Le).getRegex();
209
- var Ct = c("reflink|nolink(?!\\()", "g").replace("reflink", c(/^!?\[(label)\]\[(ref)\]/).replace("label", Lt).replace("ref", be).getRegex()).replace("nolink", c(/^!?\[(ref)\](?:\[\])?/).replace("ref", be).getRegex()).getRegex();
210
- var Re = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/;
211
- var At = c(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g, /[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex();
212
- var ce = {
213
- _backpedal: B,
214
- anyPunctuation: Tt,
215
- anyPunctuationOutsideCode: Ot,
216
- autolink: wt,
217
- blockSkip: ot,
218
- br: Se,
219
- code: et,
220
- del: B,
221
- delLDelim: B,
222
- delRDelim: B,
223
- emStrongLDelim: at,
224
- emStrongRDelimAst: ct,
225
- emStrongRDelimUnd: kt,
226
- escape: Ye,
227
- link: yt,
228
- nolink: $t,
229
- punctuation: nt,
230
- reflink: _t,
231
- reflinkSearch: Ct,
232
- tag: St,
233
- text: tt,
234
- url: B
235
- };
236
- var Et = {
237
- ...ce,
238
- emStrongLDelim: pt,
239
- emStrongRDelimAst: gt,
181
+ var st = h(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, G).getRegex();
182
+ var it = /[\p{Pi}\p{Ps}"']/u;
183
+ var $e = /(?!~)[\p{P}\p{S}]/u;
184
+ var ot = /(?!~)[\s\p{P}\p{S}]/u;
185
+ var at = /(?:[^\s\p{P}\p{S}]|~)/u;
186
+ var lt = h(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", we ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex();
187
+ var Le = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/;
188
+ var ut = h(Le, "u").replace(/punct/g, $).getRegex();
189
+ var pt = h(Le, "u").replace(/punct/g, $e).getRegex();
190
+ var ht = h(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/, "u").replace(/openQuote/g, it).replace(/punct/g, $).getRegex();
191
+ var Ce = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)";
192
+ var dt = h(Ce, "gu").replace(/notPunctSpace/g, X).replace(/punctSpace/g, G).replace(/punct/g, $).getRegex();
193
+ var gt = h(Ce, "gu").replace(/notPunctSpace/g, at).replace(/punctSpace/g, ot).replace(/punct/g, $e).getRegex();
194
+ var ft = h("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, X).replace(/punctSpace/g, G).replace(/punct/g, $).getRegex();
195
+ var mt = h("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, X).replace(/punctSpace/g, G).replace(/punct/g, $).getRegex();
196
+ var bt = h("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, X).replace(/punctSpace/g, G).replace(/punct/g, $).getRegex();
197
+ var Rt = h(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, $).getRegex();
198
+ var Ot = h("^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, X).replace(/punctSpace/g, G).replace(/punct/g, $).getRegex();
199
+ var wt = h(/\\(punct)/, "gu").replace(/punct/g, $).getRegex();
200
+ var Pt = h(/(`+)(?:[^`]|[^`][\s\S]*?[^`])\1(?!`)|`+|\\(punct)/, "gu").replace(/punct/g, $).getRegex();
201
+ var yt = 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();
202
+ var St = h(pe).replace("(?:-->|$)", "-->").getRegex();
203
+ var _t = h("^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", St).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex();
204
+ var Ie = /\[(?:\\[\s\S]|[^\[\]\\])*\]/;
205
+ var re = h(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets", Ie).getRegex();
206
+ var $t = h(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace("label", re).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title", /"(?:\\[\s\S]|[^"\\])*"|'(?:\\[\s\S]|[^'\\])*'|\((?:\\[\s\S]|[^)\\])*\)/).getRegex();
207
+ var Lt = h(/^!?\[(label)\]\[(ref)\]/).replace("label", re).replace("ref", ue).getRegex();
208
+ var Ct = h(/^!?\[(ref)\](?:\[\])?/).replace("ref", ue).getRegex();
209
+ var Te = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/;
210
+ var It = h(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets", Ie).getRegex();
211
+ var At = h("reflink|nolink(?!\\()", "g").replace("reflink", h(/^!?\[(label)\]\[(ref)\]/).replace("label", It).replace("ref", Te).getRegex()).replace("nolink", h(/^!?\[(ref)\](?:\[\])?/).replace("ref", Te).getRegex()).getRegex();
212
+ var Oe = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/;
213
+ var zt = h(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g, /[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex();
214
+ var he = {
215
+ _backpedal: D,
216
+ anyPunctuation: wt,
217
+ anyPunctuationOutsideCode: Pt,
218
+ autolink: yt,
219
+ blockSkip: lt,
220
+ br: _e,
221
+ code: nt,
222
+ del: D,
223
+ delLDelim: D,
224
+ delRDelim: D,
225
+ emStrongLDelim: ut,
226
+ emStrongRDelimAst: dt,
240
227
  emStrongRDelimUnd: mt,
241
- link: c(/^!?\[(label)\]\((.*?)\)/).replace("label", re).getRegex(),
242
- reflink: c(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", re).getRegex()
228
+ escape: tt,
229
+ link: $t,
230
+ nolink: Ct,
231
+ punctuation: st,
232
+ reflink: Lt,
233
+ reflinkSearch: At,
234
+ tag: _t,
235
+ text: rt,
236
+ url: D
243
237
  };
244
- var ie = {
245
- ...ce,
246
- emStrongRDelimAst: ht,
247
- emStrongLDelim: lt,
248
- delLDelim: xt,
249
- delRDelim: Rt,
250
- url: c(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol", At).replace("protocol", Re).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),
238
+ var Mt = {
239
+ ...he,
240
+ emStrongLDelim: ht,
241
+ emStrongRDelimAst: ft,
242
+ emStrongRDelimUnd: bt,
243
+ link: h(/^!?\[(label)\]\((.*?)\)/).replace("label", re).getRegex(),
244
+ reflink: h(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", re).getRegex()
245
+ };
246
+ var oe = {
247
+ ...he,
248
+ emStrongRDelimAst: gt,
249
+ emStrongLDelim: pt,
250
+ delLDelim: Rt,
251
+ delRDelim: Ot,
252
+ url: h(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol", zt).replace("protocol", Oe).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),
251
253
  _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
252
254
  del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,
253
- text: c(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|wwwStart|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace("protocol", Re).replace(/emailProtocol/g, /(?:mailto|xmpp):/).replace("wwwStart", Te ? "(?<![^\\s*_~(])www\\." : "www\\.").getRegex()
255
+ text: h(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|wwwStart|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace("protocol", Oe).replace(/emailProtocol/g, /(?:mailto|xmpp):/).replace("wwwStart", we ? "(?<![^\\s*_~(])www\\." : "www\\.").getRegex()
254
256
  };
255
- var zt = {
256
- ...ie,
257
- br: c(Se).replace("{2,}", "*").getRegex(),
258
- text: c(ie.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
257
+ var Bt = {
258
+ ...oe,
259
+ br: h(_e).replace("{2,}", "*").getRegex(),
260
+ text: h(oe.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
259
261
  };
260
262
  var V = {
261
- normal: pe,
262
- gfm: Ve,
263
- pedantic: Je
264
- };
265
- var G = {
266
263
  normal: ce,
267
- gfm: ie,
268
- breaks: zt,
269
- pedantic: Et
264
+ gfm: Ye,
265
+ pedantic: et
270
266
  };
271
- var Mt = {
267
+ var N = {
268
+ normal: he,
269
+ gfm: oe,
270
+ breaks: Bt,
271
+ pedantic: Mt
272
+ };
273
+ var Dt = {
272
274
  "&": "&amp;",
273
275
  "<": "&lt;",
274
276
  ">": "&gt;",
275
277
  "\"": "&quot;",
276
278
  "'": "&#39;"
277
279
  };
278
- var Ce = (a) => Mt[a];
279
- function P(a, e) {
280
+ var Ae = (l) => Dt[l];
281
+ function P(l, e) {
280
282
  if (e) {
281
- if (T.escapeTest.test(a)) return a.replace(T.escapeReplace, Ce);
282
- } else if (T.escapeTestNoEncode.test(a)) return a.replace(T.escapeReplaceNoEncode, Ce);
283
- return a;
283
+ if (T.escapeTest.test(l)) return l.replace(T.escapeReplace, Ae);
284
+ } else if (T.escapeTestNoEncode.test(l)) return l.replace(T.escapeReplaceNoEncode, Ae);
285
+ return l;
284
286
  }
285
- function Ie(a) {
286
- return T.numericCharacterReference.test(a) ? a.replace(T.numericCharacterReferenceOrAmpersand, (e, t, n) => {
287
+ function Ee(l) {
288
+ return T.numericCharacterReference.test(l) ? l.replace(T.numericCharacterReferenceOrAmpersand, (e, t, n) => {
287
289
  if (t === void 0 && n === void 0) return "&amp;";
288
290
  let s = t === void 0 ? Number.parseInt(n, 16) : Number.parseInt(t, 10);
289
291
  return s === 0 || s > 1114111 || s >= 55296 && s <= 57343 ? "�" : s === 38 ? "&amp;" : String.fromCodePoint(s);
290
- }) : a;
292
+ }) : l;
291
293
  }
292
- function he(a) {
294
+ function de(l) {
293
295
  try {
294
- a = encodeURI(a).replace(T.percentDecode, "%");
296
+ l = encodeURI(l).replace(T.percentDecode, "%");
295
297
  } catch {
296
298
  return null;
297
299
  }
298
- return a;
300
+ return l;
299
301
  }
300
- function de(a, e) {
301
- let n = a.replace(T.findPipe, (r, o, i) => {
302
- let l = !1, p = o;
303
- for (; --p >= 0 && i[p] === "\\";) l = !l;
304
- return l ? "|" : " |";
302
+ function ge(l, e) {
303
+ let n = l.replace(T.findPipe, (i, r, o) => {
304
+ let a = !1, p = r;
305
+ for (; --p >= 0 && o[p] === "\\";) a = !a;
306
+ return a ? "|" : " |";
305
307
  }).split(T.splitPipe), s = 0;
306
308
  if (n[0].trim() || n.shift(), n.length > 0 && !n.at(-1)?.trim() && n.pop(), e) if (n.length > e) n.splice(e);
307
309
  else for (; n.length < e;) n.push("");
308
310
  for (; s < n.length; s++) n[s] = n[s].trim().replace(T.slashPipe, "|");
309
311
  return n;
310
312
  }
311
- function L(a, e, t) {
312
- let n = a.length;
313
+ function L(l, e, t) {
314
+ let n = l.length;
313
315
  if (n === 0) return "";
314
316
  let s = 0;
315
317
  for (; s < n;) {
316
- let r = a.charAt(n - s - 1);
317
- if (r === e && !t) s++;
318
- else if (r !== e && t) s++;
318
+ let i = l.charAt(n - s - 1);
319
+ if (i === e && !t) s++;
320
+ else if (i !== e && t) s++;
319
321
  else break;
320
322
  }
321
- return a.slice(0, n - s);
323
+ return l.slice(0, n - s);
322
324
  }
323
- function ge(a) {
324
- let e = a.split(`
325
+ function ke(l) {
326
+ let e = l.split(`
325
327
  `), t = e.length - 1;
326
328
  for (; t >= 0 && T.blankLine.test(e[t]);) t--;
327
- return e.length - t <= 2 ? a : e.slice(0, t + 1).join(`
329
+ return e.length - t <= 2 ? l : e.slice(0, t + 1).join(`
328
330
  `);
329
331
  }
330
- function F(a) {
331
- return a.trim().replace(T.multipleSpaceGlobal, " ").toLowerCase().toUpperCase().toLowerCase();
332
+ function Q(l) {
333
+ return l.trim().replace(T.multipleSpaceGlobal, " ").toLowerCase().toUpperCase().toLowerCase();
332
334
  }
333
- function ke(a, e) {
334
- if (a.indexOf(e[0]) === -1 && a.indexOf(e[1]) === -1) return -1;
335
+ function fe(l, e) {
336
+ if (l.indexOf(e[0]) === -1 && l.indexOf(e[1]) === -1) return -1;
335
337
  let t = 0;
336
- for (let n = 0; n < a.length; n++) if (a[n] === "\\") n++;
337
- else if (a[n] === e[0]) t++;
338
- else if (a[n] === e[1] && (t--, t < 0)) return n;
338
+ for (let n = 0; n < l.length; n++) if (l[n] === "\\") n++;
339
+ else if (l[n] === e[0]) t++;
340
+ else if (l[n] === e[1] && (t--, t < 0)) return n;
339
341
  return t > 0 ? -2 : -1;
340
342
  }
341
- var N = /* @__PURE__ */ new WeakMap();
342
- function fe(a) {
343
+ var F = /* @__PURE__ */ new WeakMap();
344
+ function me(l) {
343
345
  let e = {
344
346
  "*": -1,
345
347
  _: -1
346
- }, t = -1, n = a.length;
348
+ }, t = -1, n = l.length;
347
349
  for (let s = 0; s < n; s++) {
348
- let r = a[s];
349
- if (r !== "*" && r !== "_" && r !== "~") continue;
350
- let o = s === 0 ? `
351
- ` : a[s - 1], i = s + 1;
352
- for (; i < n && a[i] === r;) i++;
353
- o !== " " && o !== " " && o !== `
354
- ` && o !== "\r" && o !== "\f" && (r === "~" ? t = s : e[r] = s), s = i - 1;
350
+ let i = l[s];
351
+ if (i !== "*" && i !== "_" && i !== "~") continue;
352
+ let r = s === 0 ? `
353
+ ` : l[s - 1], o = s + 1;
354
+ for (; o < n && l[o] === i;) o++;
355
+ r !== " " && r !== " " && r !== `
356
+ ` && r !== "\r" && r !== "\f" && (i === "~" ? t = s : e[i] = s), s = o - 1;
355
357
  }
356
358
  return {
357
- maskedSrc: a,
359
+ maskedSrc: l,
358
360
  lastPossibleEmStrongCloserIndex: e,
359
361
  lastPossibleDelCloserIndex: t
360
362
  };
361
363
  }
362
- function Ae(a, e) {
363
- let t = fe(e), n = N.get(a);
364
- n ? n.push(t) : N.set(a, [t]);
364
+ function ze(l, e) {
365
+ let t = me(e), n = F.get(l);
366
+ n ? n.push(t) : F.set(l, [t]);
365
367
  }
366
- function Ee(a) {
367
- let e = N.get(a);
368
- e && (e.pop(), e.length === 0 && N.delete(a));
368
+ function Me(l) {
369
+ let e = F.get(l);
370
+ e && (e.pop(), e.length === 0 && F.delete(l));
369
371
  }
370
- function ze(a, e, t) {
371
- let n = N.get(a)?.at(-1);
372
- return n && n.maskedSrc === e ? n.lastPossibleEmStrongCloserIndex[t] : fe(e).lastPossibleEmStrongCloserIndex[t];
372
+ function Be(l, e, t) {
373
+ let n = F.get(l)?.at(-1);
374
+ return n && n.maskedSrc === e ? n.lastPossibleEmStrongCloserIndex[t] : me(e).lastPossibleEmStrongCloserIndex[t];
373
375
  }
374
- function Me(a, e) {
375
- let t = N.get(a)?.at(-1);
376
- return t && t.maskedSrc === e ? t.lastPossibleDelCloserIndex : fe(e).lastPossibleDelCloserIndex;
376
+ function De(l, e) {
377
+ let t = F.get(l)?.at(-1);
378
+ return t && t.maskedSrc === e ? t.lastPossibleDelCloserIndex : me(e).lastPossibleDelCloserIndex;
377
379
  }
378
- function J(a, e = 0) {
380
+ function J(l, e = 0) {
379
381
  let t = e, n = "";
380
- for (let s of a) if (s === " ") {
381
- let r = 4 - t % 4;
382
- n += " ".repeat(r), t += r;
382
+ for (let s of l) if (s === " ") {
383
+ let i = 4 - t % 4;
384
+ n += " ".repeat(i), t += i;
383
385
  } else n += s, t++;
384
386
  return n;
385
387
  }
386
- function De(a, e, t, n, s) {
387
- let r = e.href, o = e.title || null, i = a[1].replace(s.other.outputLinkReplace, "$1"), l = a[0].charAt(0) === "!", p = n.state.inLink, h = n.state.linkEmitted, u = n.state.inRawBlock;
388
+ function qe(l, e, t, n, s) {
389
+ let i = e.href, r = e.title || null, o = l[1].replace(s.other.outputLinkReplace, "$1"), a = l[0].charAt(0) === "!", p = n.state.inLink, c = n.state.linkEmitted, u = n.state.inRawBlock;
388
390
  n.state.inLink = !0, n.state.linkEmitted = !1;
389
- let d = n.inlineTokens(i), k = n.state.linkEmitted;
390
- if (n.state.linkEmitted = h, n.state.inLink = p, !l) {
391
+ let d = n.inlineTokens(o), k = n.state.linkEmitted;
392
+ if (n.state.linkEmitted = c, n.state.inLink = p, !a) {
391
393
  if (k) {
392
394
  n.state.inRawBlock = u;
393
395
  return;
@@ -395,28 +397,28 @@ function De(a, e, t, n, s) {
395
397
  n.state.linkEmitted = !0;
396
398
  }
397
399
  return {
398
- type: l ? "image" : "link",
400
+ type: a ? "image" : "link",
399
401
  raw: t,
400
- href: r,
401
- title: o,
402
- text: i,
402
+ href: i,
403
+ title: r,
404
+ text: o,
403
405
  tokens: d
404
406
  };
405
407
  }
406
- function Dt(a, e, t) {
407
- let n = a.match(t.other.indentCodeCompensation);
408
+ function qt(l, e, t) {
409
+ let n = l.match(t.other.indentCodeCompensation);
408
410
  if (n === null) return e;
409
411
  let s = n[1];
410
412
  return e.split(`
411
- `).map((r) => {
412
- let o = r.match(t.other.beginningSpace);
413
- if (o === null) return r;
414
- let [i] = o;
415
- return r.slice(Math.min(i.length, s.length));
413
+ `).map((i) => {
414
+ let r = i.match(t.other.beginningSpace);
415
+ if (r === null) return i;
416
+ let [o] = r;
417
+ return i.slice(Math.min(o.length, s.length));
416
418
  }).join(`
417
419
  `);
418
420
  }
419
- function Be(a, e, t, n) {
421
+ function ve(l, e, t, n) {
420
422
  if (!e.includes("<")) return !1;
421
423
  for (let s = 0; s < e.length; s++) {
422
424
  if (e[s] === "\\") {
@@ -424,17 +426,17 @@ function Be(a, e, t, n) {
424
426
  continue;
425
427
  }
426
428
  if (e[s] === "`") {
427
- let i = n.inline.code.exec(e.slice(s));
428
- if (i) {
429
- s += i[0].length - 1;
429
+ let o = n.inline.code.exec(e.slice(s));
430
+ if (o) {
431
+ s += o[0].length - 1;
430
432
  continue;
431
433
  }
432
434
  }
433
435
  if (e[s] !== "<") continue;
434
- let r = a.slice(t + s), o = n.inline.tag.exec(r) || n.inline.autolink.exec(r);
435
- if (o) {
436
- if (o[0].length > e.length - s) return !0;
437
- s += o[0].length - 1;
436
+ let i = l.slice(t + s), r = n.inline.tag.exec(i) || n.inline.autolink.exec(i);
437
+ if (r) {
438
+ if (r[0].length > e.length - s) return !0;
439
+ s += r[0].length - 1;
438
440
  }
439
441
  }
440
442
  return !1;
@@ -444,7 +446,7 @@ var _ = class {
444
446
  rules;
445
447
  lexer;
446
448
  constructor(e) {
447
- this.options = e || S;
449
+ this.options = e || y;
448
450
  }
449
451
  space(e) {
450
452
  let t = this.rules.block.newline.exec(e);
@@ -456,7 +458,7 @@ var _ = class {
456
458
  code(e) {
457
459
  let t = this.rules.block.code.exec(e);
458
460
  if (t) {
459
- let n = this.options.pedantic ? t[0] : ge(t[0]);
461
+ let n = this.options.pedantic ? t[0] : ke(t[0]);
460
462
  return {
461
463
  type: "code",
462
464
  raw: n,
@@ -468,7 +470,7 @@ var _ = class {
468
470
  fences(e) {
469
471
  let t = this.rules.block.fences.exec(e);
470
472
  if (t) {
471
- let n = t[0], s = Dt(n, t[3] || "", this.rules);
473
+ let n = t[0], s = qt(n, t[3] || "", this.rules);
472
474
  return {
473
475
  type: "code",
474
476
  raw: n,
@@ -508,101 +510,106 @@ var _ = class {
508
510
  if (t) {
509
511
  let n = L(t[0], `
510
512
  `).split(`
511
- `), s = "", r = "", o = [];
513
+ `), s = "", i = "", r = [];
512
514
  for (; n.length > 0;) {
513
- let i = !1, l = [], p = 0;
514
- for (; p < n.length; p++) if (this.rules.other.blockquoteStart.test(n[p])) l.push(n[p]), i = !0;
515
- else if (!i) l.push(n[p]);
515
+ let o = !1, a = [], p = 0;
516
+ for (; p < n.length; p++) if (this.rules.other.blockquoteStart.test(n[p])) a.push(n[p]), o = !0;
517
+ else if (!o) a.push(n[p]);
516
518
  else break;
517
519
  n = n.slice(p);
518
- let h = l.join(`
519
- `), u = h.replace(this.rules.other.blockquoteMarkerWhitespace, (g, b, m) => b + J(m, b.length)).replace(this.rules.other.blockquoteSetextReplace, `
520
+ let c = a.join(`
521
+ `), u = c.replace(this.rules.other.blockquoteMarkerWhitespace, (g, b, f) => b + J(f, b.length)).replace(this.rules.other.blockquoteSetextReplace, `
520
522
  $1`).replace(this.rules.other.blockquoteSetextReplace2, "");
521
523
  s = s ? `${s}
522
- ${h}` : h, r = r ? `${r}
524
+ ${c}` : c, i = i ? `${i}
523
525
  ${u}` : u;
524
526
  let d = this.lexer.state.top;
525
- if (this.lexer.state.top = !0, this.lexer.blockTokens(u, o, !0), this.lexer.state.top = d, n.length === 0) break;
526
- let k = o.at(-1);
527
+ if (this.lexer.state.top = !0, this.lexer.blockTokens(u, r, !0), this.lexer.state.top = d, n.length === 0) break;
528
+ let k = r.at(-1);
527
529
  if (k?.type === "code" || k?.type === "heading" || k?.type === "hr" || k?.type === "html" || k?.type === "table") break;
528
530
  if (k?.type === "blockquote") {
529
531
  let g = k, b = n.join(`
530
- `), m = g.raw + `
531
- ` + b.replace(this.rules.other.blockquoteSetextReplace2, ""), f = this.blockquote(m);
532
- o[o.length - 1] = f;
533
- let y = m.substring(f.raw.length).replace(/^\n/, ""), R = y ? y.split(`
532
+ `), f = g.raw + `
533
+ ` + b.replace(this.rules.other.blockquoteSetextReplace2, ""), m = this.blockquote(f);
534
+ r[r.length - 1] = m;
535
+ let S = f.substring(m.raw.length).replace(/^\n/, ""), R = S ? S.split(`
534
536
  `).length : 0, A = R ? n.slice(0, -R) : n;
535
537
  if (A.length > 0 && (s = `${s}
536
538
  ${A.join(`
537
- `)}`), r = r.substring(0, r.length - g.text.length) + f.text, n = n.slice(A.length), n.length > 0 && this.rules.other.blockquoteStart.test(n[0])) continue;
539
+ `)}`), i = i.substring(0, i.length - g.text.length) + m.text, n = n.slice(A.length), n.length > 0 && this.rules.other.blockquoteStart.test(n[0])) continue;
538
540
  break;
539
541
  } else if (k?.type === "list") {
540
542
  let g = k, b = g.raw + `
541
543
  ` + n.join(`
542
- `), m = this.list(b);
543
- o[o.length - 1] = m;
544
- let f = m.raw.length > g.raw.length ? b.slice(g.raw.length + 1, m.raw.length).split(`
544
+ `), f = this.list(b);
545
+ r[r.length - 1] = f;
546
+ let m = f.raw.length > g.raw.length ? b.slice(g.raw.length + 1, f.raw.length).split(`
545
547
  `).length : 0;
546
- if (f > 0) {
547
- let y = n.slice(0, f).join(`
548
+ if (m > 0) {
549
+ let S = n.slice(0, m).join(`
548
550
  `);
549
551
  s = `${s}
550
- ${y}`, r = `${r}
551
- ${y}`;
552
+ ${S}`, i = `${i}
553
+ ${S}`;
552
554
  }
553
- n = n.slice(f);
555
+ n = n.slice(m);
554
556
  continue;
555
557
  }
556
558
  }
557
559
  return {
558
560
  type: "blockquote",
559
561
  raw: s,
560
- tokens: o,
561
- text: r
562
+ tokens: r,
563
+ text: i
562
564
  };
563
565
  }
564
566
  }
565
567
  list(e) {
566
568
  let t = this.rules.block.list.exec(e);
567
569
  if (t) {
568
- let n = e, s = () => n.length - e.length, r = t[1].trim(), o = r.length > 1, i = {
570
+ if (!this.options.pedantic && this.lexer.state.lastToken?.type === "text" && !this.rules.other.listInterruptsParagraph.test(e)) return;
571
+ let n = e, s = () => n.length - e.length, i = t[1].trim(), r = i.length > 1, o = {
569
572
  type: "list",
570
573
  raw: "",
571
- ordered: o,
572
- start: o ? +r.slice(0, -1) : "",
574
+ ordered: r,
575
+ start: r ? +i.slice(0, -1) : "",
573
576
  loose: !1,
574
577
  items: []
575
578
  };
576
- r = o ? `\\d{1,9}\\${r.slice(-1)}` : `\\${r}`, this.options.pedantic && (r = o ? r : "[*+-]");
577
- let l = this.rules.other.listItemRegex(r), p = !1;
579
+ i = r ? `\\d{1,9}\\${i.slice(-1)}` : `\\${i}`, this.options.pedantic && (i = r ? i : "[*+-]");
580
+ let a = this.rules.other.listItemRegex(i), p = !1;
578
581
  for (; e;) {
579
582
  let u = !1, d = "";
580
- if (!(t = l.exec(e)) || this.rules.block.hr.test(e)) break;
583
+ if (!(t = a.exec(e)) || this.rules.block.hr.test(e)) break;
581
584
  let k = s();
582
585
  e = e.substring(t[0].length);
583
586
  let g = t[2].split(`
584
- `, 1)[0], b = t[1].length, m = this.options.pedantic ? J(g, b) : g.replace(this.rules.other.leadingSpaceTab, (v) => J(v, b)), f = e.split(`
585
- `, 1)[0], y = !m.trim(), R = 0;
586
- if (this.options.pedantic ? (R = 2, d = m.trimStart()) : y ? R = b + 1 : (R = m.search(this.rules.other.nonSpaceChar), R = R > 4 ? 1 : R, d = m.slice(R), R += b), y && this.rules.other.blankLine.test(f) && (e = e.substring(f.length + 1), u = !0), !u) {
587
- let v = this.rules.other.nextBulletRegex(R), Q = this.rules.other.hrRegex(R), ee = this.rules.other.fencesBeginRegex(R), te = this.options.pedantic ? this.rules.other.pedanticHeadingBeginRegex(R) : this.rules.other.headingBeginRegex(R), M = this.rules.other.htmlBeginRegex(R), ne = this.rules.other.blockquoteBeginRegex(R);
587
+ `, 1)[0], b = t[1].length, f = this.options.pedantic ? J(g, b) : g.replace(this.rules.other.leadingSpaceTab, (v) => J(v, b)), m = e.split(`
588
+ `, 1)[0], S = !f.trim(), R = 0;
589
+ if (this.options.pedantic ? (R = 2, d = f.trimStart()) : S ? R = b + 1 : (R = f.search(this.rules.other.nonSpaceChar), R = R > 4 ? 1 : R, d = f.slice(R), R += b), S && this.rules.other.blankLine.test(m) && (e = e.substring(m.length + 1), u = !0), !u) {
590
+ let v = this.rules.other.nextBulletRegex(R), U = this.rules.other.hrRegex(R), ee = this.rules.other.fencesBeginRegex(R), te = this.options.pedantic ? this.rules.other.pedanticHeadingBeginRegex(R) : this.rules.other.headingBeginRegex(R), M = this.rules.other.htmlBeginRegex(R), ne = this.rules.other.blockquoteBeginRegex(R), Z = !1;
588
591
  for (; e;) {
589
- let U = e.split(`
590
- `, 1)[0], Z;
591
- if (f = U, this.options.pedantic ? (f = f.replace(this.rules.other.listReplaceNesting, " "), Z = f) : Z = f.replace(this.rules.other.leadingSpaceTab, (me) => J(me)), ee.test(f) || te.test(f) || M.test(f) || ne.test(f) || v.test(f) || Q.test(f)) break;
592
- if (Z.search(this.rules.other.nonSpaceChar) >= R || !f.trim()) d += `
593
- ` + Z.slice(R);
592
+ let xe = e.split(`
593
+ `, 1)[0], H;
594
+ if (m = xe, this.options.pedantic ? (m = m.replace(this.rules.other.listReplaceNesting, " "), H = m) : H = m.replace(this.rules.other.leadingSpaceTab, (be) => J(be)), ee.test(m) || te.test(m) || M.test(m) || ne.test(m) || v.test(m) || U.test(m)) break;
595
+ if (H.search(this.rules.other.nonSpaceChar) >= R || !m.trim()) d += `
596
+ ` + H.slice(R), Z = !1;
594
597
  else {
595
- if (y || m.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || ee.test(m) || te.test(m) || M.test(m) || Q.test(m)) break;
596
- let qe = !this.options.pedantic && /^ {0,3}(?:=+|-+) *$/.test(f) && this.rules.block.lheading.test(`${m}
597
- ${f}`) ? ` ${Z.replace(/^ {0,3}/, "")}` : f;
598
+ if (S || f.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || ee.test(f) || te.test(f) || M.test(f) || U.test(f)) break;
599
+ if (!this.options.pedantic && !Z) {
600
+ let se = f.replace(this.rules.other.nestedContainerMarkers, "");
601
+ if (this.rules.block.fences.test(se) || this.rules.block.heading.test(se) || this.rules.block.hr.test(se)) break;
602
+ }
603
+ let Ze = !this.options.pedantic && /^ {0,3}(?:=+|-+) *$/.test(m) && this.rules.block.lheading.test(`${f}
604
+ ${m}`) ? ` ${H.replace(/^ {0,3}/, "")}` : m;
598
605
  d += `
599
- ` + qe;
606
+ ` + Ze, Z = !0;
600
607
  }
601
- y = !f.trim(), e = e.substring(U.length + 1), m = Z.slice(R);
608
+ S = !m.trim(), e = e.substring(xe.length + 1), f = H.slice(R);
602
609
  }
603
610
  }
604
611
  let A = n.slice(k, s());
605
- i.loose || (p ? i.loose = !0 : this.rules.other.doubleBlankLine.test(A) && (p = !0)), i.items.push({
612
+ o.loose || (p ? o.loose = !0 : this.rules.other.doubleBlankLine.test(A) && (p = !0)), o.items.push({
606
613
  type: "list_item",
607
614
  raw: A,
608
615
  task: !!this.options.gfm && this.rules.other.listIsTask.test(d),
@@ -611,15 +618,15 @@ ${f}`) ? ` ${Z.replace(/^ {0,3}/, "")}` : f;
611
618
  tokens: []
612
619
  });
613
620
  }
614
- let h = i.items.at(-1);
615
- if (h) h.raw = h.raw.trimEnd(), h.text = h.text.trimEnd();
621
+ let c = o.items.at(-1);
622
+ if (c) c.raw = c.raw.trimEnd(), c.text = c.text.trimEnd();
616
623
  else return;
617
- i.raw = n.slice(0, s()).trimEnd();
618
- for (let u of i.items) if (this.lexer.state.top = !1, u.tokens = this.lexer.blockTokens(u.text, []), !i.loose) {
624
+ o.raw = n.slice(0, s()).trimEnd();
625
+ for (let u of o.items) if (this.lexer.state.top = !1, u.tokens = this.lexer.blockTokens(u.text, []), !o.loose) {
619
626
  let d = u.tokens.filter((g) => g.type === "space");
620
- i.loose = d.length > 0 && d.some((g) => this.rules.other.anyLine.test(g.raw));
627
+ o.loose = d.length > 0 && d.some((g) => this.rules.other.anyLine.test(g.raw));
621
628
  }
622
- for (let u of i.items) {
629
+ for (let u of o.items) {
623
630
  let d = u.tokens[0];
624
631
  if (u.task && (d?.type === "text" || d?.type === "paragraph")) {
625
632
  u.text = u.text.replace(this.rules.other.listReplaceTask, ""), d.raw = d.raw.replace(this.rules.other.listReplaceTask, ""), d.text = d.text.replace(this.rules.other.listReplaceTask, "");
@@ -634,7 +641,7 @@ ${f}`) ? ` ${Z.replace(/^ {0,3}/, "")}` : f;
634
641
  raw: k[0] + " ",
635
642
  checked: k[0] !== "[ ]"
636
643
  };
637
- u.checked = g.checked, i.loose ? u.tokens[0] && ["paragraph", "text"].includes(u.tokens[0].type) && "tokens" in u.tokens[0] && u.tokens[0].tokens ? (u.tokens[0].raw = g.raw + u.tokens[0].raw, u.tokens[0].text = g.raw + u.tokens[0].text, u.tokens[0].tokens.unshift(g)) : u.tokens.unshift({
644
+ u.checked = g.checked, o.loose ? u.tokens[0] && ["paragraph", "text"].includes(u.tokens[0].type) && "tokens" in u.tokens[0] && u.tokens[0].tokens ? (u.tokens[0].raw = g.raw + u.tokens[0].raw, u.tokens[0].text = g.raw + u.tokens[0].text, u.tokens[0].tokens.unshift(g)) : u.tokens.unshift({
638
645
  type: "paragraph",
639
646
  raw: g.raw,
640
647
  text: g.raw,
@@ -643,17 +650,17 @@ ${f}`) ? ` ${Z.replace(/^ {0,3}/, "")}` : f;
643
650
  }
644
651
  } else u.task && (u.task = !1);
645
652
  }
646
- if (i.loose) for (let u of i.items) {
653
+ if (o.loose) for (let u of o.items) {
647
654
  u.loose = !0;
648
655
  for (let d of u.tokens) d.type === "text" && (d.type = "paragraph");
649
656
  }
650
- return i;
657
+ return o;
651
658
  }
652
659
  }
653
660
  html(e) {
654
661
  let t = this.rules.block.html.exec(e);
655
662
  if (t) {
656
- let n = ge(t[0]);
663
+ let n = ke(t[0]);
657
664
  return {
658
665
  type: "html",
659
666
  block: !0,
@@ -666,23 +673,23 @@ ${f}`) ? ` ${Z.replace(/^ {0,3}/, "")}` : f;
666
673
  def(e) {
667
674
  let t = this.rules.block.def.exec(e);
668
675
  if (t) {
669
- if (!this.rules.other.startAngleBracket.test(t[2]) && ke(t[2], "()") !== -1) return;
670
- let n = F(t[1]), s = 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];
676
+ if (!this.rules.other.startAngleBracket.test(t[2]) && fe(t[2], "()") !== -1) return;
677
+ let n = Q(t[1]), s = t[2] ? t[2].replace(this.rules.other.hrefBrackets, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "", i = t[3] ? t[3].substring(1, t[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : t[3];
671
678
  return {
672
679
  type: "def",
673
680
  tag: n,
674
681
  raw: L(t[0], `
675
682
  `),
676
683
  href: s,
677
- title: r
684
+ title: i
678
685
  };
679
686
  }
680
687
  }
681
688
  table(e) {
682
689
  let t = this.rules.block.table.exec(e);
683
690
  if (!t || !this.rules.other.tableDelimiter.test(t[2])) return;
684
- let n = de(t[1]), s = t[2].replace(this.rules.other.tableAlignChars, "").split("|"), r = t[3]?.trim() ? t[3].replace(this.rules.other.tableRowBlankLine, "").split(`
685
- `) : [], o = {
691
+ let n = ge(t[1]), s = t[2].replace(this.rules.other.tableAlignChars, "").split("|"), i = t[3]?.trim() ? t[3].replace(this.rules.other.tableRowBlankLine, "").split(`
692
+ `) : [], r = {
686
693
  type: "table",
687
694
  raw: L(t[0], `
688
695
  `),
@@ -691,20 +698,20 @@ ${f}`) ? ` ${Z.replace(/^ {0,3}/, "")}` : f;
691
698
  rows: []
692
699
  };
693
700
  if (n.length === s.length) {
694
- for (let i of s) this.rules.other.tableAlignRight.test(i) ? o.align.push("right") : this.rules.other.tableAlignCenter.test(i) ? o.align.push("center") : this.rules.other.tableAlignLeft.test(i) ? o.align.push("left") : o.align.push(null);
695
- for (let i = 0; i < n.length; i++) o.header.push({
696
- text: n[i],
697
- tokens: this.lexer.inline(n[i]),
701
+ for (let o of s) this.rules.other.tableAlignRight.test(o) ? r.align.push("right") : this.rules.other.tableAlignCenter.test(o) ? r.align.push("center") : this.rules.other.tableAlignLeft.test(o) ? r.align.push("left") : r.align.push(null);
702
+ for (let o = 0; o < n.length; o++) r.header.push({
703
+ text: n[o],
704
+ tokens: this.lexer.inline(n[o]),
698
705
  header: !0,
699
- align: o.align[i]
706
+ align: r.align[o]
700
707
  });
701
- for (let i of r) o.rows.push(de(i, o.header.length).map((l, p) => ({
702
- text: l,
703
- tokens: this.lexer.inline(l),
708
+ for (let o of i) r.rows.push(ge(o, r.header.length).map((a, p) => ({
709
+ text: a,
710
+ tokens: this.lexer.inline(a),
704
711
  header: !1,
705
- align: o.align[p]
712
+ align: r.align[p]
706
713
  })));
707
- return o;
714
+ return r;
708
715
  }
709
716
  }
710
717
  lheading(e) {
@@ -767,30 +774,30 @@ ${f}`) ? ` ${Z.replace(/^ {0,3}/, "")}` : f;
767
774
  let t = this.rules.inline.link.exec(e);
768
775
  if (t) {
769
776
  let n = t[0].charAt(0) === "!" ? 2 : 1;
770
- if (!this.options.pedantic && Be(e, t[1], n, this.rules)) return;
777
+ if (!this.options.pedantic && ve(e, t[1], n, this.rules)) return;
771
778
  let s = t[2].trim();
772
779
  if (!this.options.pedantic && this.rules.other.startAngleBracket.test(s)) {
773
780
  if (!this.rules.other.endAngleBracket.test(s)) return;
774
- let l = L(s.slice(0, -1), "\\");
775
- if ((s.length - l.length) % 2 === 0) return;
781
+ let a = L(s.slice(0, -1), "\\");
782
+ if ((s.length - a.length) % 2 === 0) return;
776
783
  } else {
777
- let l = ke(t[2], "()");
778
- if (l === -2) return;
779
- if (l > -1) {
780
- let h = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + l;
781
- t[2] = t[2].substring(0, l), t[0] = t[0].substring(0, h).trim(), t[3] = "";
784
+ let a = fe(t[2], "()");
785
+ if (a === -2) return;
786
+ if (a > -1) {
787
+ let c = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + a;
788
+ t[2] = t[2].substring(0, a), t[0] = t[0].substring(0, c).trim(), t[3] = "";
782
789
  }
783
790
  }
784
- let r = L(t[0].slice(0, -1), "\\");
785
- if ((t[0].length - r.length) % 2 === 0) return;
786
- let o = t[2], i = "";
791
+ let i = L(t[0].slice(0, -1), "\\");
792
+ if ((t[0].length - i.length) % 2 === 0) return;
793
+ let r = t[2], o = "";
787
794
  if (this.options.pedantic) {
788
- let l = this.rules.other.pedanticHrefTitle.exec(o);
789
- l && (o = l[1], i = l[3]);
790
- } else i = t[3] ? t[3].slice(1, -1) : "";
791
- return o = o.trim(), this.rules.other.startAngleBracket.test(o) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(s) ? o = o.slice(1) : o = o.slice(1, -1)), De(t, {
792
- href: o && o.replace(this.rules.inline.anyPunctuation, "$1"),
793
- title: i && i.replace(this.rules.inline.anyPunctuation, "$1")
795
+ let a = this.rules.other.pedanticHrefTitle.exec(r);
796
+ a && (r = a[1], o = a[3]);
797
+ } else o = t[3] ? t[3].slice(1, -1) : "";
798
+ return r = r.trim(), this.rules.other.startAngleBracket.test(r) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(s) ? r = r.slice(1) : r = r.slice(1, -1)), qe(t, {
799
+ href: r && r.replace(this.rules.inline.anyPunctuation, "$1"),
800
+ title: o && o.replace(this.rules.inline.anyPunctuation, "$1")
794
801
  }, t[0], this.lexer, this.rules);
795
802
  }
796
803
  }
@@ -798,58 +805,58 @@ ${f}`) ? ` ${Z.replace(/^ {0,3}/, "")}` : f;
798
805
  let n;
799
806
  if ((n = this.rules.inline.reflink.exec(e)) || (n = this.rules.inline.nolink.exec(e))) {
800
807
  let s = n[0].charAt(0) === "!" ? 2 : 1;
801
- if (!this.options.pedantic && Be(e, n[1], s, this.rules)) return;
802
- let r = t[F(n[2] || n[1])];
803
- if (!r) {
804
- let o = n[0].charAt(0);
808
+ if (!this.options.pedantic && ve(e, n[1], s, this.rules)) return;
809
+ let i = t[Q(n[2] || n[1])];
810
+ if (!i) {
811
+ let r = n[0].charAt(0);
805
812
  return {
806
813
  type: "text",
807
- raw: o,
808
- text: o
814
+ raw: r,
815
+ text: r
809
816
  };
810
817
  }
811
- return De(n, r, n[0], this.lexer, this.rules);
818
+ return qe(n, i, n[0], this.lexer, this.rules);
812
819
  }
813
820
  }
814
821
  emStrong(e, t, n = "") {
815
822
  let s = this.rules.inline.emStrongLDelim.exec(e);
816
823
  if (!s || !s[1] && !s[2] && !s[3] && !s[4]) return;
817
- let r = s[0][0], o = n === r, i = t.length - e.length, l = i;
818
- for (; !this.options.pedantic && l > 0 && t[l - 1] === r;) l--;
819
- let p = [...t.slice(Math.max(0, l - 2), l)].at(-1) ?? "", h = p === "*" || p === "_" || !!this.rules.inline.punctuation.exec(p);
820
- l < i && (n = p);
821
- let u = l < i ? h : !!this.rules.inline.punctuation.exec(n);
824
+ let i = s[0][0], r = n === i, o = t.length - e.length, a = o;
825
+ for (; !this.options.pedantic && a > 0 && t[a - 1] === i;) a--;
826
+ let p = [...t.slice(Math.max(0, a - 2), a)].at(-1) ?? "", c = p === "*" || p === "_" || !!this.rules.inline.punctuation.exec(p);
827
+ a < o && (n = p);
828
+ let u = a < o ? c : n === "*" || n === "_" || !!this.rules.inline.punctuation.exec(n);
822
829
  if (s[4] && n.match(this.rules.other.unicodeAlphaNumeric)) return;
823
830
  let d = s[1] || s[3] || "";
824
831
  if (!d || !n || u) {
825
- let k = [...s[0]].length - 1, g, b, m = k, f = 0, y = i - l + k, R = !this.options.pedantic && !!p.trim() && (!!d || r === "*" && !h);
826
- if (r !== "*" && r !== "_") return;
827
- let A = r === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd, v = ze(this, t, r), Q = t.length - e.length + k;
828
- if (v < Q) return;
832
+ let k = [...s[0]].length - 1, g, b, f = k, m = 0, S = o - a + k, R = !this.options.pedantic && !!p.trim() && (!!d || i === "*" && !c);
833
+ if (i !== "*" && i !== "_") return;
834
+ let A = i === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd, v = Be(this, t, i), U = t.length - e.length + k;
835
+ if (v < U) return;
829
836
  t = t.slice(-1 * e.length + k);
830
- let ee = v - Q;
837
+ let ee = v - U;
831
838
  for (A.lastIndex = 0; (s = A.exec(t)) !== null && !(s.index > ee);) {
832
839
  if (g = s[1] || s[2] || s[3] || s[4] || s[5] || s[6], !g) continue;
833
840
  if (b = [...g].length, s[3] || s[4]) {
834
- m += b;
841
+ f += b;
835
842
  continue;
836
843
  } else if (s[5] || s[6] || R) {
837
- if (o && (s[5] || s[6])) break;
838
- if (y % 3 && !((y + b) % 3)) {
839
- f += b;
844
+ if (r && (s[5] || s[6])) break;
845
+ if (S % 3 && !((S + b) % 3)) {
846
+ m += b;
840
847
  continue;
841
848
  }
842
849
  }
843
- if (m -= b, m > 0) continue;
844
- b = Math.min(b, b + m + f);
850
+ if (f -= b, f > 0) continue;
851
+ b = Math.min(b, b + f + m);
845
852
  let te = [...s[0]][0].length, M = e.slice(0, k + s.index + te + b);
846
853
  if (Math.min(k, b) % 2) {
847
- let U = M.slice(1, -1);
854
+ let Z = M.slice(1, -1);
848
855
  return {
849
856
  type: "em",
850
857
  raw: M,
851
- text: U,
852
- tokens: this.lexer.inlineTokens(U)
858
+ text: Z,
859
+ tokens: this.lexer.inlineTokens(Z)
853
860
  };
854
861
  }
855
862
  let ne = M.slice(2, -2);
@@ -865,8 +872,8 @@ ${f}`) ? ` ${Z.replace(/^ {0,3}/, "")}` : f;
865
872
  codespan(e) {
866
873
  let t = this.rules.inline.code.exec(e);
867
874
  if (t) {
868
- let n = t[2].replace(this.rules.other.newLineCharGlobal, " "), s = this.rules.other.nonSpaceChar.test(n), r = this.rules.other.startingSpaceChar.test(n) && this.rules.other.endingSpaceChar.test(n);
869
- return s && r && (n = n.substring(1, n.length - 1)), {
875
+ let n = t[2].replace(this.rules.other.newLineCharGlobal, " "), s = this.rules.other.nonSpaceChar.test(n), i = this.rules.other.startingSpaceChar.test(n) && this.rules.other.endingSpaceChar.test(n);
876
+ return s && i && (n = n.substring(1, n.length - 1)), {
870
877
  type: "codespan",
871
878
  raw: t[0],
872
879
  text: n
@@ -884,24 +891,24 @@ ${f}`) ? ` ${Z.replace(/^ {0,3}/, "")}` : f;
884
891
  let s = this.rules.inline.delLDelim.exec(e);
885
892
  if (!s) return;
886
893
  if (!(s[1] || "") || !n || this.rules.inline.punctuation.exec(n)) {
887
- let o = [...s[0]].length - 1, i, l, p = o, h = this.rules.inline.delRDelim, u = Me(this, t), d = t.length - e.length + o;
894
+ let r = [...s[0]].length - 1, o, a, p = r, c = this.rules.inline.delRDelim, u = De(this, t), d = t.length - e.length + r;
888
895
  if (u < d) return;
889
- t = t.slice(-1 * e.length + o);
896
+ t = t.slice(-1 * e.length + r);
890
897
  let k = u - d;
891
- for (h.lastIndex = 0; (s = h.exec(t)) !== null && !(s.index > k);) {
892
- if (i = s[1] || s[2] || s[3] || s[4] || s[5] || s[6], !i || (l = [...i].length, l !== o)) continue;
898
+ for (c.lastIndex = 0; (s = c.exec(t)) !== null && !(s.index > k);) {
899
+ if (o = s[1] || s[2] || s[3] || s[4] || s[5] || s[6], !o || (a = [...o].length, a !== r)) continue;
893
900
  if (s[3] || s[4]) {
894
- p += l;
901
+ p += a;
895
902
  continue;
896
903
  }
897
- if (p -= l, p > 0) continue;
898
- l = Math.min(l, l + p);
899
- let g = [...s[0]][0].length, b = e.slice(0, o + s.index + g + l), m = b.slice(o, -o);
904
+ if (p -= a, p > 0) continue;
905
+ a = Math.min(a, a + p);
906
+ let g = [...s[0]][0].length, b = e.slice(0, r + s.index + g + a), f = b.slice(r, -r);
900
907
  return {
901
908
  type: "del",
902
909
  raw: b,
903
- text: m,
904
- tokens: this.lexer.inlineTokens(m)
910
+ text: f,
911
+ tokens: this.lexer.inlineTokens(f)
905
912
  };
906
913
  }
907
914
  }
@@ -930,10 +937,10 @@ ${f}`) ? ` ${Z.replace(/^ {0,3}/, "")}` : f;
930
937
  let n, s;
931
938
  if (t[2] === "@") n = t[0], s = "mailto:" + n;
932
939
  else {
933
- let r;
940
+ let i;
934
941
  do
935
- r = t[0], t[0] = this.rules.inline._backpedal.exec(t[0])?.[0] ?? "";
936
- while (r !== t[0]);
942
+ i = t[0], t[0] = this.rules.inline._backpedal.exec(t[0])?.[0] ?? "";
943
+ while (i !== t[0]);
937
944
  n = t[0], t[1] === "www." ? s = "http://" + t[0] : s = t[0];
938
945
  }
939
946
  return {
@@ -957,20 +964,20 @@ ${f}`) ? ` ${Z.replace(/^ {0,3}/, "")}` : f;
957
964
  return {
958
965
  type: "text",
959
966
  raw: t[0],
960
- text: n ? t[0] : Ie(t[0]),
967
+ text: n ? t[0] : Ee(t[0]),
961
968
  escaped: n
962
969
  };
963
970
  }
964
971
  }
965
972
  };
966
- var O = class a {
973
+ var O = class l {
967
974
  tokens;
968
975
  options;
969
976
  state;
970
977
  inlineQueue;
971
978
  tokenizer;
972
979
  constructor(e) {
973
- this.tokens = [], this.tokens.links = Object.create(null), this.options = e || S, this.options.tokenizer = this.options.tokenizer || new _(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
980
+ this.tokens = [], this.tokens.links = Object.create(null), this.options = e || y, this.options.tokenizer = this.options.tokenizer || new _(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
974
981
  inLink: !1,
975
982
  inRawBlock: !1,
976
983
  linkEmitted: !1,
@@ -980,21 +987,21 @@ var O = class a {
980
987
  let t = {
981
988
  other: T,
982
989
  block: V.normal,
983
- inline: G.normal
990
+ inline: N.normal
984
991
  };
985
- this.options.pedantic ? (t.block = V.pedantic, t.inline = G.pedantic) : this.options.gfm && (t.block = V.gfm, this.options.breaks ? t.inline = G.breaks : t.inline = G.gfm), this.tokenizer.rules = t;
992
+ this.options.pedantic ? (t.block = V.pedantic, t.inline = N.pedantic) : this.options.gfm && (t.block = V.gfm, this.options.breaks ? t.inline = N.breaks : t.inline = N.gfm), this.tokenizer.rules = t;
986
993
  }
987
994
  static get rules() {
988
995
  return {
989
996
  block: V,
990
- inline: G
997
+ inline: N
991
998
  };
992
999
  }
993
1000
  static lex(e, t) {
994
- return new a(t).lex(e);
1001
+ return new l(t).lex(e);
995
1002
  }
996
1003
  static lexInline(e, t) {
997
- return new a(t).inlineTokens(e);
1004
+ return new l(t).inlineTokens(e);
998
1005
  }
999
1006
  lex(e) {
1000
1007
  e = e.replace(T.carriageReturn, `
@@ -1006,30 +1013,33 @@ var O = class a {
1006
1013
  return this.inlineQueue = [], this.tokens;
1007
1014
  }
1008
1015
  blockTokens(e, t = [], n = !1) {
1009
- this.tokenizer.lexer = this, this.options.pedantic && (e = e.replace(T.tabCharGlobal, " ").replace(T.spaceLine, ""));
1010
- let s = 1 / 0;
1016
+ this.tokenizer.lexer = this;
1017
+ let s = this.state.lastToken;
1018
+ this.options.pedantic && (e = e.replace(T.tabCharGlobal, " ").replace(T.spaceLine, ""));
1019
+ let i = 1 / 0;
1011
1020
  for (; e;) {
1012
- if (e.length < s) s = e.length;
1021
+ if (e.length < i) i = e.length;
1013
1022
  else {
1014
1023
  this.infiniteLoopError(e.charCodeAt(0));
1015
1024
  break;
1016
1025
  }
1026
+ this.state.lastToken = t.at(-1);
1017
1027
  let r;
1018
- if (this.options.extensions?.block?.some((i) => (r = i.call({ lexer: this }, e, t)) ? (e = e.substring(r.raw.length), t.push(r), !0) : !1)) continue;
1028
+ if (this.options.extensions?.block?.some((a) => (r = a.call({ lexer: this }, e, t)) ? (e = e.substring(r.raw.length), t.push(r), !0) : !1)) continue;
1019
1029
  if (r = this.tokenizer.space(e)) {
1020
1030
  e = e.substring(r.raw.length);
1021
- let i = t.at(-1);
1022
- r.raw.length === 1 && i !== void 0 ? i.raw += `
1031
+ let a = t.at(-1);
1032
+ r.raw.length === 1 && a !== void 0 ? a.raw += `
1023
1033
  ` : t.push(r);
1024
1034
  continue;
1025
1035
  }
1026
1036
  if (r = this.tokenizer.code(e)) {
1027
1037
  e = e.substring(r.raw.length);
1028
- let i = t.at(-1);
1029
- i?.type === "paragraph" || i?.type === "text" ? (i.raw += (i.raw.endsWith(`
1038
+ let a = t.at(-1);
1039
+ a?.type === "paragraph" || a?.type === "text" ? (a.raw += (a.raw.endsWith(`
1030
1040
  `) ? "" : `
1031
- `) + r.raw, i.text += `
1032
- ` + r.text, this.inlineQueue.at(-1).src = i.text) : t.push(r);
1041
+ `) + r.raw, a.text += `
1042
+ ` + r.text, this.inlineQueue.at(-1).src = a.text) : t.push(r);
1033
1043
  continue;
1034
1044
  }
1035
1045
  if (r = this.tokenizer.fences(e)) {
@@ -1058,11 +1068,11 @@ var O = class a {
1058
1068
  }
1059
1069
  if (r = this.tokenizer.def(e)) {
1060
1070
  e = e.substring(r.raw.length);
1061
- let i = t.at(-1);
1062
- i?.type === "paragraph" || i?.type === "text" ? (i.raw += (i.raw.endsWith(`
1071
+ let a = t.at(-1);
1072
+ a?.type === "paragraph" || a?.type === "text" ? (a.raw += (a.raw.endsWith(`
1063
1073
  `) ? "" : `
1064
- `) + r.raw, i.text += `
1065
- ` + r.raw, this.inlineQueue.at(-1).src = i.text) : (this.tokens.links[r.tag] || (this.tokens.links[r.tag] = {
1074
+ `) + r.raw, a.text += `
1075
+ ` + r.raw, this.inlineQueue.at(-1).src = a.text) : (this.tokens.links[r.tag] || (this.tokens.links[r.tag] = {
1066
1076
  href: r.href,
1067
1077
  title: r.title
1068
1078
  }), t.push(r));
@@ -1078,26 +1088,26 @@ var O = class a {
1078
1088
  }
1079
1089
  let o = e;
1080
1090
  if (this.options.extensions?.startBlock) {
1081
- let i = 1 / 0, l = e.slice(1), p;
1082
- this.options.extensions.startBlock.forEach((h) => {
1083
- p = h.call({ lexer: this }, l), typeof p == "number" && p >= 0 && (i = Math.min(i, p));
1084
- }), i < 1 / 0 && i >= 0 && (o = e.substring(0, i + 1));
1091
+ let a = 1 / 0, p = e.slice(1), c;
1092
+ this.options.extensions.startBlock.forEach((u) => {
1093
+ c = u.call({ lexer: this }, p), typeof c == "number" && c >= 0 && (a = Math.min(a, c));
1094
+ }), a < 1 / 0 && a >= 0 && (o = e.substring(0, a + 1));
1085
1095
  }
1086
1096
  if (this.state.top && (r = this.tokenizer.paragraph(o))) {
1087
- let i = t.at(-1);
1088
- n && i?.type === "paragraph" ? (i.raw += (i.raw.endsWith(`
1097
+ let a = t.at(-1);
1098
+ n && a?.type === "paragraph" ? (a.raw += (a.raw.endsWith(`
1089
1099
  `) ? "" : `
1090
- `) + r.raw, i.text += `
1091
- ` + r.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = i.text) : t.push(r), n = o.length !== e.length, e = e.substring(r.raw.length);
1100
+ `) + r.raw, a.text += `
1101
+ ` + r.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = a.text) : t.push(r), n = o.length !== e.length, e = e.substring(r.raw.length);
1092
1102
  continue;
1093
1103
  }
1094
1104
  if (r = this.tokenizer.text(e)) {
1095
1105
  e = e.substring(r.raw.length);
1096
- let i = t.at(-1);
1097
- i?.type === "text" ? (i.raw += (i.raw.endsWith(`
1106
+ let a = t.at(-1);
1107
+ a?.type === "text" ? (a.raw += (a.raw.endsWith(`
1098
1108
  `) ? "" : `
1099
- `) + r.raw, i.text += `
1100
- ` + r.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = i.text) : t.push(r);
1109
+ `) + r.raw, a.text += `
1110
+ ` + r.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = a.text) : t.push(r);
1101
1111
  continue;
1102
1112
  }
1103
1113
  if (e) {
@@ -1105,7 +1115,7 @@ var O = class a {
1105
1115
  break;
1106
1116
  }
1107
1117
  }
1108
- return this.state.top = !0, t;
1118
+ return this.state.top = !0, this.state.lastToken = s, t;
1109
1119
  }
1110
1120
  inline(e, t = []) {
1111
1121
  return this.inlineQueue.push({
@@ -1118,8 +1128,8 @@ var O = class a {
1118
1128
  let t = this.tokenizer.rules.inline.link;
1119
1129
  for (let n of e.matchAll(this.tokenizer.rules.inline.blockSkip)) if (t.test(n[0]) && e.charAt(n.index - 1) !== "!") return !0;
1120
1130
  for (let n of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)) {
1121
- let s = n[0], r = s.lastIndexOf("[");
1122
- if (!(s.charAt(0) === "!" || !Object.hasOwn(this.tokens.links, F(s.slice(r + 1, -1)))) && !(r > 1 && this.linkInText(s.slice(1, r - 1)))) return !0;
1131
+ let s = n[0], i = s.lastIndexOf("[");
1132
+ if (!(s.charAt(0) === "!" || !Object.hasOwn(this.tokens.links, Q(s.slice(i + 1, -1)))) && !(i > 1 && this.linkInText(s.slice(1, i - 1)))) return !0;
1123
1133
  }
1124
1134
  return !1;
1125
1135
  }
@@ -1134,78 +1144,78 @@ var O = class a {
1134
1144
  }
1135
1145
  }
1136
1146
  #e(e, t) {
1137
- let n = e.includes("*") || e.includes("_") || e.includes("~") || this.options.hooks?.emStrongMask || this.tokenizer.emStrong !== _.prototype.emStrong || this.tokenizer.del !== _.prototype.del ? this.#n(e) : e;
1138
- Ae(this.tokenizer, n);
1147
+ let n = e.includes("*") || e.includes("_") || e.includes("~") || this.options.hooks?.emStrongMask || this.tokenizer.emStrong !== _.prototype.emStrong || this.tokenizer.del !== _.prototype.del ? this.#r(e) : e;
1148
+ ze(this.tokenizer, n);
1139
1149
  try {
1140
1150
  return this.#t(e, n, t);
1141
1151
  } finally {
1142
- Ee(this.tokenizer);
1152
+ Me(this.tokenizer);
1143
1153
  }
1144
1154
  }
1145
1155
  #t(e, t, n) {
1146
- let s = !1, r = "", o = 1 / 0;
1156
+ let s = !1, i = "", r = 1 / 0;
1147
1157
  for (; e;) {
1148
- if (e.length < o) o = e.length;
1158
+ if (e.length < r) r = e.length;
1149
1159
  else {
1150
1160
  this.infiniteLoopError(e.charCodeAt(0));
1151
1161
  break;
1152
1162
  }
1153
- s || (r = ""), s = !1;
1154
- let i;
1155
- if (this.options.extensions?.inline?.some((p) => (i = p.call({ lexer: this }, e, n)) ? (e = e.substring(i.raw.length), n.push(i), !0) : !1)) continue;
1156
- if (i = this.tokenizer.escape(e)) {
1157
- e = e.substring(i.raw.length), n.push(i);
1163
+ s || (i = ""), s = !1;
1164
+ let o;
1165
+ if (this.options.extensions?.inline?.some((p) => (o = p.call({ lexer: this }, e, n)) ? (e = e.substring(o.raw.length), n.push(o), !0) : !1)) continue;
1166
+ if (o = this.tokenizer.escape(e)) {
1167
+ e = e.substring(o.raw.length), n.push(o);
1158
1168
  continue;
1159
1169
  }
1160
- if (i = this.tokenizer.tag(e)) {
1161
- e = e.substring(i.raw.length), n.push(i);
1170
+ if (o = this.tokenizer.tag(e)) {
1171
+ e = e.substring(o.raw.length), n.push(o);
1162
1172
  continue;
1163
1173
  }
1164
- if (i = this.tokenizer.link(e)) {
1165
- e = e.substring(i.raw.length), n.push(i);
1174
+ if (o = this.tokenizer.link(e)) {
1175
+ e = e.substring(o.raw.length), n.push(o);
1166
1176
  continue;
1167
1177
  }
1168
- if (i = this.tokenizer.reflink(e, this.tokens.links)) {
1169
- e = e.substring(i.raw.length);
1178
+ if (o = this.tokenizer.reflink(e, this.tokens.links)) {
1179
+ e = e.substring(o.raw.length);
1170
1180
  let p = n.at(-1);
1171
- i.type === "text" && p?.type === "text" ? (p.raw += i.raw, p.text += i.text) : n.push(i);
1181
+ o.type === "text" && p?.type === "text" ? (p.raw += o.raw, p.text += o.text) : n.push(o);
1172
1182
  continue;
1173
1183
  }
1174
- if (i = this.tokenizer.emStrong(e, t, r)) {
1175
- e = e.substring(i.raw.length), n.push(i);
1184
+ if (o = this.tokenizer.emStrong(e, t, i)) {
1185
+ e = e.substring(o.raw.length), n.push(o);
1176
1186
  continue;
1177
1187
  }
1178
- if (i = this.tokenizer.codespan(e)) {
1179
- e = e.substring(i.raw.length), n.push(i);
1188
+ if (o = this.tokenizer.codespan(e)) {
1189
+ e = e.substring(o.raw.length), n.push(o);
1180
1190
  continue;
1181
1191
  }
1182
- if (i = this.tokenizer.br(e)) {
1183
- e = e.substring(i.raw.length), n.push(i);
1192
+ if (o = this.tokenizer.br(e)) {
1193
+ e = e.substring(o.raw.length), n.push(o);
1184
1194
  continue;
1185
1195
  }
1186
- if (i = this.tokenizer.del(e, t, r)) {
1187
- e = e.substring(i.raw.length), n.push(i);
1196
+ if (o = this.tokenizer.del(e, t, i)) {
1197
+ e = e.substring(o.raw.length), n.push(o);
1188
1198
  continue;
1189
1199
  }
1190
- if (i = this.tokenizer.autolink(e)) {
1191
- e = e.substring(i.raw.length), n.push(i);
1200
+ if (o = this.tokenizer.autolink(e)) {
1201
+ e = e.substring(o.raw.length), n.push(o);
1192
1202
  continue;
1193
1203
  }
1194
- if (!this.state.inLink && (i = this.tokenizer.url(e))) {
1195
- e = e.substring(i.raw.length), n.push(i);
1204
+ if (!this.state.inLink && (o = this.tokenizer.url(e))) {
1205
+ e = e.substring(o.raw.length), n.push(o);
1196
1206
  continue;
1197
1207
  }
1198
- let l = e;
1208
+ let a = e;
1199
1209
  if (this.options.extensions?.startInline) {
1200
- let p = 1 / 0, h = e.slice(1), u;
1210
+ let p = 1 / 0, c = e.slice(1), u;
1201
1211
  this.options.extensions.startInline.forEach((d) => {
1202
- u = d.call({ lexer: this }, h), typeof u == "number" && u >= 0 && (p = Math.min(p, u));
1203
- }), p < 1 / 0 && p >= 0 && (l = e.substring(0, p + 1));
1212
+ u = d.call({ lexer: this }, c), typeof u == "number" && u >= 0 && (p = Math.min(p, u));
1213
+ }), p < 1 / 0 && p >= 0 && (a = e.substring(0, p + 1));
1204
1214
  }
1205
- if (i = this.tokenizer.inlineText(l)) {
1206
- e = e.substring(i.raw.length), i.raw.slice(-1) !== "_" && (r = i.raw.slice(-1)), s = !0;
1215
+ if (o = this.tokenizer.inlineText(a)) {
1216
+ e = e.substring(o.raw.length), o.raw.slice(-1) !== "_" && (i = o.raw.slice(-1)), s = !0;
1207
1217
  let p = n.at(-1);
1208
- p?.type === "text" ? (p.raw += i.raw, p.text += i.text) : n.push(i);
1218
+ p?.type === "text" ? (p.raw += o.raw, p.text += o.text) : n.push(o);
1209
1219
  continue;
1210
1220
  }
1211
1221
  if (e) {
@@ -1216,23 +1226,36 @@ var O = class a {
1216
1226
  return n;
1217
1227
  }
1218
1228
  #n(e) {
1229
+ let { blockSkip: t, tag: n, autolink: s } = this.tokenizer.rules.inline, i = "", r = 0, o;
1230
+ for (t.lastIndex = 0; o = t.exec(e);) {
1231
+ let a = o.index + (o[2] ? o[2].length : 0), p = o.index + o[0].length;
1232
+ if (e.charAt(a) === "<") {
1233
+ let c = e.slice(a), u = n.exec(c) || s.exec(c);
1234
+ if (!u) {
1235
+ t.lastIndex = a + 1;
1236
+ continue;
1237
+ }
1238
+ p = a + u[0].length, t.lastIndex = p;
1239
+ }
1240
+ i += e.slice(r, a) + "[" + "a".repeat(p - a - 2) + "]", r = p;
1241
+ }
1242
+ return i + e.slice(r);
1243
+ }
1244
+ #r(e) {
1219
1245
  let t = e;
1220
1246
  if (this.tokens.links && e.includes("[")) {
1221
- let n = this.tokenizer.rules.inline.reflinkSearch, s = (r) => {
1222
- let o = r.lastIndexOf("[");
1223
- if (!Object.hasOwn(this.tokens.links, F(r.slice(o + 1, -1)))) return r;
1224
- if (o > 1 && r.charAt(0) !== "!") {
1225
- let i = r.slice(1, o - 1);
1226
- if (this.linkInText(i)) return "[" + i.replace(n, s) + "][" + "a".repeat(r.length - o - 2) + "]";
1247
+ let n = this.tokenizer.rules.inline.reflinkSearch, s = (i) => {
1248
+ let r = i.lastIndexOf("[");
1249
+ if (!Object.hasOwn(this.tokens.links, Q(i.slice(r + 1, -1)))) return i;
1250
+ if (r > 1 && i.charAt(0) !== "!") {
1251
+ let o = i.slice(1, r - 1);
1252
+ if (this.linkInText(o)) return "[" + o.replace(n, s) + "][" + "a".repeat(i.length - r - 2) + "]";
1227
1253
  }
1228
- return "[" + "a".repeat(r.length - 2) + "]";
1254
+ return "[" + "a".repeat(i.length - 2) + "]";
1229
1255
  };
1230
1256
  t = t.replace(n, s);
1231
1257
  }
1232
- return t = t.replace(this.tokenizer.rules.inline.anyPunctuationOutsideCode, (n, s, r) => r ? "+".repeat(n.length) : s ? s + n.slice(s.length, -s.length).replace(/`/g, "+") + s : n), t = t.replace(this.tokenizer.rules.inline.blockSkip, (n, s, r) => {
1233
- let o = r ? r.length : 0;
1234
- return n.slice(0, o) + "[" + "a".repeat(n.length - o - 2) + "]";
1235
- }), t = this.options.hooks?.emStrongMask?.call({ lexer: this }, t) ?? t, t;
1258
+ return t = t.replace(this.tokenizer.rules.inline.anyPunctuationOutsideCode, (n, s, i) => i ? "+".repeat(n.length) : s ? s + n.slice(s.length, -s.length).replace(/`/g, "+") + s : n), t = this.#n(t), t = this.options.hooks?.emStrongMask?.call({ lexer: this }, t) ?? t, t;
1236
1259
  }
1237
1260
  infiniteLoopError(e) {
1238
1261
  let t = "Infinite loop on byte: " + e;
@@ -1244,16 +1267,16 @@ var C = class {
1244
1267
  options;
1245
1268
  parser;
1246
1269
  constructor(e) {
1247
- this.options = e || S;
1270
+ this.options = e || y;
1248
1271
  }
1249
1272
  space(e) {
1250
1273
  return "";
1251
1274
  }
1252
1275
  code({ text: e, lang: t, escaped: n }) {
1253
- let s = (t || "").match(T.notSpaceStart)?.[0], r = e ? e.replace(T.endingNewline, "") + `
1276
+ let s = (t || "").match(T.notSpaceStart)?.[0], i = e ? e.replace(T.endingNewline, "") + `
1254
1277
  ` : "";
1255
- return s ? "<pre><code class=\"language-" + P(s) + "\">" + (n ? r : P(r, !0)) + `</code></pre>
1256
- ` : "<pre><code>" + (n ? r : P(r, !0)) + `</code></pre>
1278
+ return s ? "<pre><code class=\"language-" + P(s) + "\">" + (n ? i : P(i, !0)) + `</code></pre>
1279
+ ` : "<pre><code>" + (n ? i : P(i, !0)) + `</code></pre>
1257
1280
  `;
1258
1281
  }
1259
1282
  blockquote({ tokens: e }) {
@@ -1277,13 +1300,13 @@ ${this.parser.parse(e)}</blockquote>
1277
1300
  }
1278
1301
  list(e) {
1279
1302
  let t = e.ordered, n = e.start, s = "";
1280
- for (let i = 0; i < e.items.length; i++) {
1281
- let l = e.items[i];
1282
- s += this.listitem(l);
1303
+ for (let o = 0; o < e.items.length; o++) {
1304
+ let a = e.items[o];
1305
+ s += this.listitem(a);
1283
1306
  }
1284
- let r = t ? "ol" : "ul", o = t && n !== 1 ? " start=\"" + n + "\"" : "";
1285
- return "<" + r + o + `>
1286
- ` + s + "</" + r + `>
1307
+ let i = t ? "ol" : "ul", r = t && n !== 1 ? " start=\"" + n + "\"" : "";
1308
+ return "<" + i + r + `>
1309
+ ` + s + "</" + i + `>
1287
1310
  `;
1288
1311
  }
1289
1312
  listitem(e) {
@@ -1299,13 +1322,13 @@ ${this.parser.parse(e)}</blockquote>
1299
1322
  }
1300
1323
  table(e) {
1301
1324
  let t = "", n = "";
1302
- for (let r = 0; r < e.header.length; r++) n += this.tablecell(e.header[r]);
1325
+ for (let i = 0; i < e.header.length; i++) n += this.tablecell(e.header[i]);
1303
1326
  t += this.tablerow({ text: n });
1304
1327
  let s = "";
1305
- for (let r = 0; r < e.rows.length; r++) {
1306
- let o = e.rows[r];
1328
+ for (let i = 0; i < e.rows.length; i++) {
1329
+ let r = e.rows[i];
1307
1330
  n = "";
1308
- for (let i = 0; i < o.length; i++) n += this.tablecell(o[i]);
1331
+ for (let o = 0; o < r.length; o++) n += this.tablecell(r[o]);
1309
1332
  s += this.tablerow({ text: n });
1310
1333
  }
1311
1334
  return s && (s = `<tbody>${s}</tbody>`), `<table>
@@ -1339,20 +1362,20 @@ ${e}</tr>
1339
1362
  del({ tokens: e }) {
1340
1363
  return `<del>${this.parser.parseInline(e)}</del>`;
1341
1364
  }
1342
- link({ href: e, title: t, text: n, tokens: s, autolink: r }) {
1343
- let o = r ? P(n, !0) : this.parser.parseInline(s), i = he(e);
1344
- if (i === null) return o;
1345
- e = P(i, r);
1346
- let l = "<a href=\"" + e + "\"";
1347
- return t && (l += " title=\"" + P(t) + "\""), l += ">" + o + "</a>", l;
1365
+ link({ href: e, title: t, text: n, tokens: s, autolink: i }) {
1366
+ let r = i ? P(n, !0) : this.parser.parseInline(s), o = de(e);
1367
+ if (o === null) return r;
1368
+ e = P(o, i);
1369
+ let a = "<a href=\"" + e + "\"";
1370
+ return t && (a += " title=\"" + P(t) + "\""), a += ">" + r + "</a>", a;
1348
1371
  }
1349
1372
  image({ href: e, title: t, text: n, tokens: s }) {
1350
1373
  s && (n = this.parser.parseInline(s, this.parser.textRenderer));
1351
- let r = he(e);
1352
- if (r === null) return P(n);
1353
- e = r;
1354
- let o = `<img src="${P(e)}" alt="${P(n)}"`;
1355
- return t && (o += ` title="${P(t)}"`), o += ">", o;
1374
+ let i = de(e);
1375
+ if (i === null) return P(n);
1376
+ e = i;
1377
+ let r = `<img src="${P(e)}" alt="${P(n)}"`;
1378
+ return t && (r += ` title="${P(t)}"`), r += ">", r;
1356
1379
  }
1357
1380
  text(e) {
1358
1381
  return "tokens" in e && e.tokens ? this.parser.parseInline(e.tokens) : "escaped" in e && e.escaped ? e.text : P(e.text);
@@ -1385,24 +1408,25 @@ var E = class {
1385
1408
  return t ? this.parser.parseInline(t, this) : e;
1386
1409
  }
1387
1410
  br() {
1388
- return "";
1411
+ return `
1412
+ `;
1389
1413
  }
1390
1414
  checkbox({ raw: e }) {
1391
1415
  return e;
1392
1416
  }
1393
1417
  };
1394
- var w = class a {
1418
+ var w = class l {
1395
1419
  options;
1396
1420
  renderer;
1397
1421
  textRenderer;
1398
1422
  constructor(e) {
1399
- this.options = e || S, this.options.renderer = this.options.renderer || new C(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new E(), this.textRenderer.parser = this;
1423
+ this.options = e || y, this.options.renderer = this.options.renderer || new C(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new E(), this.textRenderer.parser = this;
1400
1424
  }
1401
1425
  static parse(e, t) {
1402
- return new a(t).parse(e);
1426
+ return new l(t).parse(e);
1403
1427
  }
1404
1428
  static parseInline(e, t) {
1405
- return new a(t).parseInline(e);
1429
+ return new l(t).parseInline(e);
1406
1430
  }
1407
1431
  parse(e) {
1408
1432
  this.renderer.parser = this;
@@ -1410,8 +1434,8 @@ var w = class a {
1410
1434
  for (let n = 0; n < e.length; n++) {
1411
1435
  let s = e[n];
1412
1436
  if (this.options.extensions?.renderers?.[s.type]) {
1413
- let o = s, i = this.options.extensions.renderers[o.type].call({ parser: this }, o);
1414
- if (i !== !1 || ![
1437
+ let r = s, o = this.options.extensions.renderers[r.type].call({ parser: this }, r);
1438
+ if (o !== !1 || ![
1415
1439
  "space",
1416
1440
  "hr",
1417
1441
  "heading",
@@ -1424,53 +1448,53 @@ var w = class a {
1424
1448
  "def",
1425
1449
  "paragraph",
1426
1450
  "text"
1427
- ].includes(o.type)) {
1428
- t += i || "";
1451
+ ].includes(r.type)) {
1452
+ t += o === !1 ? "" : o ?? "";
1429
1453
  continue;
1430
1454
  }
1431
1455
  }
1432
- let r = s;
1433
- switch (r.type) {
1456
+ let i = s;
1457
+ switch (i.type) {
1434
1458
  case "space":
1435
- t += this.renderer.space(r);
1459
+ t += this.renderer.space(i);
1436
1460
  break;
1437
1461
  case "hr":
1438
- t += this.renderer.hr(r);
1462
+ t += this.renderer.hr(i);
1439
1463
  break;
1440
1464
  case "heading":
1441
- t += this.renderer.heading(r);
1465
+ t += this.renderer.heading(i);
1442
1466
  break;
1443
1467
  case "code":
1444
- t += this.renderer.code(r);
1468
+ t += this.renderer.code(i);
1445
1469
  break;
1446
1470
  case "table":
1447
- t += this.renderer.table(r);
1471
+ t += this.renderer.table(i);
1448
1472
  break;
1449
1473
  case "blockquote":
1450
- t += this.renderer.blockquote(r);
1474
+ t += this.renderer.blockquote(i);
1451
1475
  break;
1452
1476
  case "list":
1453
- t += this.renderer.list(r);
1477
+ t += this.renderer.list(i);
1454
1478
  break;
1455
1479
  case "checkbox":
1456
- t += this.renderer.checkbox(r);
1480
+ t += this.renderer.checkbox(i);
1457
1481
  break;
1458
1482
  case "html":
1459
- t += this.renderer.html(r);
1483
+ t += this.renderer.html(i);
1460
1484
  break;
1461
1485
  case "def":
1462
- t += this.renderer.def(r);
1486
+ t += this.renderer.def(i);
1463
1487
  break;
1464
1488
  case "paragraph":
1465
- t += this.renderer.paragraph(r);
1489
+ t += this.renderer.paragraph(i);
1466
1490
  break;
1467
1491
  case "text":
1468
- t += this.renderer.text(r);
1492
+ t += this.renderer.text(i);
1469
1493
  break;
1470
1494
  default: {
1471
- let o = "Token with \"" + r.type + "\" type was not found.";
1472
- if (this.options.silent) return console.error(o), "";
1473
- throw new Error(o);
1495
+ let r = "Token with \"" + i.type + "\" type was not found.";
1496
+ if (this.options.silent) return console.error(r), "";
1497
+ throw new Error(r);
1474
1498
  }
1475
1499
  }
1476
1500
  }
@@ -1480,10 +1504,10 @@ var w = class a {
1480
1504
  this.renderer.parser = this;
1481
1505
  let n = "";
1482
1506
  for (let s = 0; s < e.length; s++) {
1483
- let r = e[s];
1484
- if (this.options.extensions?.renderers?.[r.type]) {
1485
- let i = this.options.extensions.renderers[r.type].call({ parser: this }, r);
1486
- if (i !== !1 || ![
1507
+ let i = e[s];
1508
+ if (this.options.extensions?.renderers?.[i.type]) {
1509
+ let o = this.options.extensions.renderers[i.type].call({ parser: this }, i);
1510
+ if (o !== !1 || ![
1487
1511
  "escape",
1488
1512
  "html",
1489
1513
  "link",
@@ -1495,50 +1519,50 @@ var w = class a {
1495
1519
  "br",
1496
1520
  "del",
1497
1521
  "text"
1498
- ].includes(r.type)) {
1499
- n += i || "";
1522
+ ].includes(i.type)) {
1523
+ n += o === !1 ? "" : o ?? "";
1500
1524
  continue;
1501
1525
  }
1502
1526
  }
1503
- let o = r;
1504
- switch (o.type) {
1527
+ let r = i;
1528
+ switch (r.type) {
1505
1529
  case "escape":
1506
- n += t.text(o);
1530
+ n += t.text(r);
1507
1531
  break;
1508
1532
  case "html":
1509
- n += t.html(o);
1533
+ n += t.html(r);
1510
1534
  break;
1511
1535
  case "link":
1512
- n += t.link(o);
1536
+ n += t.link(r);
1513
1537
  break;
1514
1538
  case "image":
1515
- n += t.image(o);
1539
+ n += t.image(r);
1516
1540
  break;
1517
1541
  case "checkbox":
1518
- n += t.checkbox(o);
1542
+ n += t.checkbox(r);
1519
1543
  break;
1520
1544
  case "strong":
1521
- n += t.strong(o);
1545
+ n += t.strong(r);
1522
1546
  break;
1523
1547
  case "em":
1524
- n += t.em(o);
1548
+ n += t.em(r);
1525
1549
  break;
1526
1550
  case "codespan":
1527
- n += t.codespan(o);
1551
+ n += t.codespan(r);
1528
1552
  break;
1529
1553
  case "br":
1530
- n += t.br(o);
1554
+ n += t.br(r);
1531
1555
  break;
1532
1556
  case "del":
1533
- n += t.del(o);
1557
+ n += t.del(r);
1534
1558
  break;
1535
1559
  case "text":
1536
- n += t.text(o);
1560
+ n += t.text(r);
1537
1561
  break;
1538
1562
  default: {
1539
- let i = "Token with \"" + o.type + "\" type was not found.";
1540
- if (this.options.silent) return console.error(i), "";
1541
- throw new Error(i);
1563
+ let o = "Token with \"" + r.type + "\" type was not found.";
1564
+ if (this.options.silent) return console.error(o), "";
1565
+ throw new Error(o);
1542
1566
  }
1543
1567
  }
1544
1568
  }
@@ -1549,7 +1573,7 @@ var I = class {
1549
1573
  options;
1550
1574
  block;
1551
1575
  constructor(e) {
1552
- this.options = e || S;
1576
+ this.options = e || y;
1553
1577
  }
1554
1578
  static passThroughHooks = /* @__PURE__ */ new Set([
1555
1579
  "preprocess",
@@ -1581,12 +1605,12 @@ var I = class {
1581
1605
  return e ? w.parse : w.parseInline;
1582
1606
  }
1583
1607
  };
1584
- function z(a, e) {
1585
- if (Array.isArray(e)) for (let t = 0; t < e.length; t++) a.push(e[t]);
1586
- else a.push(e);
1608
+ function z(l, e) {
1609
+ if (Array.isArray(e)) for (let t = 0; t < e.length; t++) l.push(e[t]);
1610
+ else l.push(e);
1587
1611
  }
1588
1612
  var Y = class {
1589
- defaults = H();
1613
+ defaults = j();
1590
1614
  options = this.setOptions;
1591
1615
  parse = this.parseMarkdown(!0);
1592
1616
  parseInline = this.parseMarkdown(!1);
@@ -1603,22 +1627,22 @@ var Y = class {
1603
1627
  let n = [];
1604
1628
  for (let s of e) switch (z(n, t.call(this, s)), s.type) {
1605
1629
  case "table": {
1606
- let r = s;
1607
- for (let o of r.header) z(n, this.walkTokens(o.tokens, t));
1608
- for (let o of r.rows) for (let i of o) z(n, this.walkTokens(i.tokens, t));
1630
+ let i = s;
1631
+ for (let r of i.header) z(n, this.walkTokens(r.tokens, t));
1632
+ for (let r of i.rows) for (let o of r) z(n, this.walkTokens(o.tokens, t));
1609
1633
  break;
1610
1634
  }
1611
1635
  case "list": {
1612
- let r = s;
1613
- z(n, this.walkTokens(r.items, t));
1636
+ let i = s;
1637
+ z(n, this.walkTokens(i.items, t));
1614
1638
  break;
1615
1639
  }
1616
1640
  default: {
1617
- let r = s;
1618
- this.defaults.extensions?.childTokens?.[r.type] ? this.defaults.extensions.childTokens[r.type].forEach((o) => {
1619
- let i = r[o].flat(1 / 0);
1620
- z(n, this.walkTokens(i, t));
1621
- }) : r.tokens && z(n, this.walkTokens(r.tokens, t));
1641
+ let i = s;
1642
+ this.defaults.extensions?.childTokens?.[i.type] ? this.defaults.extensions.childTokens[i.type].forEach((r) => {
1643
+ let o = i[r].flat(1 / 0);
1644
+ z(n, this.walkTokens(o, t));
1645
+ }) : i.tokens && z(n, this.walkTokens(i.tokens, t));
1622
1646
  }
1623
1647
  }
1624
1648
  return n;
@@ -1630,80 +1654,80 @@ var Y = class {
1630
1654
  };
1631
1655
  return e.forEach((n) => {
1632
1656
  let s = { ...n };
1633
- if (s.async = this.defaults.async || s.async || !1, n.extensions && (n.extensions.forEach((r) => {
1634
- if (!r.name) throw new Error("extension name required");
1635
- if ("renderer" in r) {
1636
- let o = t.renderers[r.name];
1637
- o ? t.renderers[r.name] = function(...i) {
1638
- let l = r.renderer.apply(this, i);
1639
- return l === !1 && (l = o.apply(this, i)), l;
1640
- } : t.renderers[r.name] = r.renderer;
1657
+ if (s.async = this.defaults.async || s.async || !1, n.extensions && (n.extensions.forEach((i) => {
1658
+ if (!i.name) throw new Error("extension name required");
1659
+ if ("renderer" in i) {
1660
+ let r = t.renderers[i.name];
1661
+ r ? t.renderers[i.name] = function(...o) {
1662
+ let a = i.renderer.apply(this, o);
1663
+ return a === !1 && (a = r.apply(this, o)), a;
1664
+ } : t.renderers[i.name] = i.renderer;
1641
1665
  }
1642
- if ("tokenizer" in r) {
1643
- if (!r.level || r.level !== "block" && r.level !== "inline") throw new Error("extension level must be 'block' or 'inline'");
1644
- let o = t[r.level];
1645
- o ? o.unshift(r.tokenizer) : t[r.level] = [r.tokenizer], r.start && (r.level === "block" ? t.startBlock ? t.startBlock.push(r.start) : t.startBlock = [r.start] : r.level === "inline" && (t.startInline ? t.startInline.push(r.start) : t.startInline = [r.start]));
1666
+ if ("tokenizer" in i) {
1667
+ if (!i.level || i.level !== "block" && i.level !== "inline") throw new Error("extension level must be 'block' or 'inline'");
1668
+ let r = t[i.level];
1669
+ r ? r.unshift(i.tokenizer) : t[i.level] = [i.tokenizer], i.start && (i.level === "block" ? t.startBlock ? t.startBlock.push(i.start) : t.startBlock = [i.start] : i.level === "inline" && (t.startInline ? t.startInline.push(i.start) : t.startInline = [i.start]));
1646
1670
  }
1647
- "childTokens" in r && r.childTokens && (t.childTokens[r.name] = r.childTokens);
1671
+ "childTokens" in i && i.childTokens && (t.childTokens[i.name] = i.childTokens);
1648
1672
  }), s.extensions = t), n.renderer) {
1649
- let r = this.defaults.renderer || new C(this.defaults);
1650
- for (let o in n.renderer) {
1651
- if (!(o in r)) throw new Error(`renderer '${o}' does not exist`);
1652
- if (["options", "parser"].includes(o)) continue;
1653
- let i = o, l = n.renderer[i], p = r[i];
1654
- r[i] = (...h) => {
1655
- let u = l.apply(r, h);
1656
- return u === !1 && (u = p.apply(r, h)), u === !1 ? "" : u ?? "";
1673
+ let i = this.defaults.renderer || new C(this.defaults);
1674
+ for (let r in n.renderer) {
1675
+ if (!(r in i)) throw new Error(`renderer '${r}' does not exist`);
1676
+ if (["options", "parser"].includes(r)) continue;
1677
+ let o = r, a = n.renderer[o], p = i[o];
1678
+ i[o] = (...c) => {
1679
+ let u = a.apply(i, c);
1680
+ return u === !1 && (u = p.apply(i, c)), u === !1 ? "" : u ?? "";
1657
1681
  };
1658
1682
  }
1659
- s.renderer = r;
1683
+ s.renderer = i;
1660
1684
  }
1661
1685
  if (n.tokenizer) {
1662
- let r = this.defaults.tokenizer || new _(this.defaults);
1663
- for (let o in n.tokenizer) {
1664
- if (!(o in r)) throw new Error(`tokenizer '${o}' does not exist`);
1686
+ let i = this.defaults.tokenizer || new _(this.defaults);
1687
+ for (let r in n.tokenizer) {
1688
+ if (!(r in i)) throw new Error(`tokenizer '${r}' does not exist`);
1665
1689
  if ([
1666
1690
  "options",
1667
1691
  "rules",
1668
1692
  "lexer"
1669
- ].includes(o)) continue;
1670
- let i = o, l = n.tokenizer[i], p = r[i];
1671
- r[i] = (...h) => {
1672
- let u = l.apply(r, h);
1673
- return u === !1 && (u = p.apply(r, h)), u;
1693
+ ].includes(r)) continue;
1694
+ let o = r, a = n.tokenizer[o], p = i[o];
1695
+ i[o] = (...c) => {
1696
+ let u = a.apply(i, c);
1697
+ return u === !1 && (u = p.apply(i, c)), u;
1674
1698
  };
1675
1699
  }
1676
- s.tokenizer = r;
1700
+ s.tokenizer = i;
1677
1701
  }
1678
1702
  if (n.hooks) {
1679
- let r = this.defaults.hooks || new I();
1680
- for (let o in n.hooks) {
1681
- if (!(o in r)) throw new Error(`hook '${o}' does not exist`);
1682
- if (["options", "block"].includes(o)) continue;
1683
- let i = o, l = n.hooks[i], p = r[i];
1684
- I.passThroughHooks.has(o) ? r[i] = (h) => {
1685
- if (r.options.async && I.passThroughHooksRespectAsync.has(o)) return (async () => {
1686
- let d = await l.call(r, h);
1687
- return p.call(r, d);
1703
+ let i = this.defaults.hooks || new I();
1704
+ for (let r in n.hooks) {
1705
+ if (!(r in i)) throw new Error(`hook '${r}' does not exist`);
1706
+ if (["options", "block"].includes(r)) continue;
1707
+ let o = r, a = n.hooks[o], p = i[o];
1708
+ I.passThroughHooks.has(r) ? i[o] = (c) => {
1709
+ if (i.options.async && I.passThroughHooksRespectAsync.has(r)) return (async () => {
1710
+ let d = await a.call(i, c);
1711
+ return p.call(i, d);
1688
1712
  })();
1689
- let u = l.call(r, h);
1690
- return p.call(r, u);
1691
- } : r[i] = (...h) => {
1692
- if (r.options.async) return (async () => {
1693
- let d = await l.apply(r, h);
1694
- return d === !1 && (d = await p.apply(r, h)), d;
1713
+ let u = a.call(i, c);
1714
+ return p.call(i, u);
1715
+ } : i[o] = (...c) => {
1716
+ if (i.options.async) return (async () => {
1717
+ let d = await a.apply(i, c);
1718
+ return d === !1 && (d = await p.apply(i, c)), d;
1695
1719
  })();
1696
- let u = l.apply(r, h);
1697
- return u === !1 && (u = p.apply(r, h)), u;
1720
+ let u = a.apply(i, c);
1721
+ return u === !1 && (u = p.apply(i, c)), u;
1698
1722
  };
1699
1723
  }
1700
- s.hooks = r;
1724
+ s.hooks = i;
1701
1725
  }
1702
1726
  if (n.walkTokens) {
1703
- let r = this.defaults.walkTokens, o = n.walkTokens;
1704
- s.walkTokens = function(i) {
1705
- let l = [];
1706
- return z(l, o.call(this, i)), r && z(l, r.call(this, i)), l;
1727
+ let i = this.defaults.walkTokens, r = n.walkTokens;
1728
+ s.walkTokens = function(o) {
1729
+ let a = [];
1730
+ return z(a, r.call(this, o)), i && z(a, i.call(this, o)), a;
1707
1731
  };
1708
1732
  }
1709
1733
  this.defaults = {
@@ -1726,27 +1750,27 @@ var Y = class {
1726
1750
  }
1727
1751
  parseMarkdown(e) {
1728
1752
  return (n, s) => {
1729
- let r = { ...s }, o = {
1753
+ let i = { ...s }, r = {
1730
1754
  ...this.defaults,
1731
- ...r
1732
- }, i = this.onError(!!o.silent, !!o.async);
1733
- if (this.defaults.async === !0 && r.async === !1) return i(/* @__PURE__ */ new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));
1734
- if (typeof n > "u" || n === null) return i(/* @__PURE__ */ new Error("marked(): input parameter is undefined or null"));
1735
- if (typeof n != "string") return i(/* @__PURE__ */ new Error("marked(): input parameter is of type " + Object.prototype.toString.call(n) + ", string expected"));
1736
- if (o.hooks && (o.hooks.options = o, o.hooks.block = e), o.async) return (async () => {
1737
- let l = o.hooks ? await o.hooks.preprocess(n) : n, h = await (o.hooks ? await o.hooks.provideLexer(e) : e ? O.lex : O.lexInline)(l, o), u = o.hooks ? await o.hooks.processAllTokens(h) : h;
1738
- o.walkTokens && await Promise.all(this.walkTokens(u, o.walkTokens));
1739
- let k = await (o.hooks ? await o.hooks.provideParser(e) : e ? w.parse : w.parseInline)(u, o);
1740
- return o.hooks ? await o.hooks.postprocess(k) : k;
1741
- })().catch(i);
1755
+ ...i
1756
+ }, o = this.onError(!!r.silent, !!r.async);
1757
+ if (this.defaults.async === !0 && i.async === !1) return o(/* @__PURE__ */ new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));
1758
+ if (typeof n > "u" || n === null) return o(/* @__PURE__ */ new Error("marked(): input parameter is undefined or null"));
1759
+ if (typeof n != "string") return o(/* @__PURE__ */ new Error("marked(): input parameter is of type " + Object.prototype.toString.call(n) + ", string expected"));
1760
+ if (r.hooks && (r.hooks.options = r, r.hooks.block = e), r.async) return (async () => {
1761
+ let a = r.hooks ? await r.hooks.preprocess(n) : n, c = await (r.hooks ? await r.hooks.provideLexer(e) : e ? O.lex : O.lexInline)(a, r), u = r.hooks ? await r.hooks.processAllTokens(c) : c;
1762
+ r.walkTokens && await Promise.all(this.walkTokens(u, r.walkTokens));
1763
+ let k = await (r.hooks ? await r.hooks.provideParser(e) : e ? w.parse : w.parseInline)(u, r);
1764
+ return r.hooks ? await r.hooks.postprocess(k) : k;
1765
+ })().catch(o);
1742
1766
  try {
1743
- o.hooks && (n = o.hooks.preprocess(n));
1744
- let p = (o.hooks ? o.hooks.provideLexer(e) : e ? O.lex : O.lexInline)(n, o);
1745
- o.hooks && (p = o.hooks.processAllTokens(p)), o.walkTokens && this.walkTokens(p, o.walkTokens);
1746
- let u = (o.hooks ? o.hooks.provideParser(e) : e ? w.parse : w.parseInline)(p, o);
1747
- return o.hooks && (u = o.hooks.postprocess(u)), u;
1748
- } catch (l) {
1749
- return i(l);
1767
+ r.hooks && (n = r.hooks.preprocess(n));
1768
+ let p = (r.hooks ? r.hooks.provideLexer(e) : e ? O.lex : O.lexInline)(n, r);
1769
+ r.hooks && (p = r.hooks.processAllTokens(p)), r.walkTokens && this.walkTokens(p, r.walkTokens);
1770
+ let u = (r.hooks ? r.hooks.provideParser(e) : e ? w.parse : w.parseInline)(p, r);
1771
+ return r.hooks && (u = r.hooks.postprocess(u)), u;
1772
+ } catch (a) {
1773
+ return o(a);
1750
1774
  }
1751
1775
  };
1752
1776
  }
@@ -1763,20 +1787,20 @@ Please report this to https://github.com/markedjs/marked.`, e) {
1763
1787
  }
1764
1788
  };
1765
1789
  var q = new Y();
1766
- function x(a, e) {
1767
- return q.parse(a, e);
1790
+ function x(l, e) {
1791
+ return q.parse(l, e);
1768
1792
  }
1769
- x.options = x.setOptions = function(a) {
1770
- return q.setOptions(a), x.defaults = q.defaults, se(x.defaults), x;
1793
+ x.options = x.setOptions = function(l) {
1794
+ return q.setOptions(l), x.defaults = q.defaults, ie(x.defaults), x;
1771
1795
  };
1772
- x.getDefaults = H;
1773
- x.defaults = S;
1774
- function Bt(...a) {
1775
- return q.use(...a), x.defaults = q.defaults, se(x.defaults), x;
1796
+ x.getDefaults = j;
1797
+ x.defaults = y;
1798
+ function vt(...l) {
1799
+ return q.use(...l), x.defaults = q.defaults, ie(x.defaults), x;
1776
1800
  }
1777
- x.use = Bt;
1778
- x.walkTokens = function(a, e) {
1779
- return q.walkTokens(a, e);
1801
+ x.use = vt;
1802
+ x.walkTokens = function(l, e) {
1803
+ return q.walkTokens(l, e);
1780
1804
  };
1781
1805
  x.parseInline = q.parseInline;
1782
1806
  x.Parser = w;