@elmethis/core 0.4.7 → 0.5.1

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 (32) hide show
  1. package/dist/components/containments/ElmConfirmModal.vue2.mjs +2 -4
  2. package/dist/components/form/ElmCheckbox.vue2.mjs +4 -4
  3. package/dist/components/icon/ElmToggleTheme.vue2.mjs +4 -4
  4. package/dist/components/icon/languages/C.vue2.mjs +2 -2
  5. package/dist/components/icon/languages/Cplusplus.vue2.mjs +2 -2
  6. package/dist/components/icon/languages/Csharp.vue2.mjs +2 -2
  7. package/dist/components/icon/languages/Css.vue2.mjs +2 -2
  8. package/dist/components/icon/languages/Go.vue2.mjs +2 -2
  9. package/dist/components/icon/languages/Html.vue2.mjs +2 -2
  10. package/dist/components/icon/languages/Java.vue2.mjs +2 -2
  11. package/dist/components/icon/languages/Javascript.vue2.mjs +2 -2
  12. package/dist/components/icon/languages/Json.vue2.mjs +2 -2
  13. package/dist/components/icon/languages/Kotlin.vue2.mjs +2 -2
  14. package/dist/components/icon/languages/Lua.vue2.mjs +2 -2
  15. package/dist/components/icon/languages/Npm.vue2.mjs +2 -2
  16. package/dist/components/icon/languages/Python.vue2.mjs +2 -2
  17. package/dist/components/icon/languages/Rust.vue2.mjs +2 -2
  18. package/dist/components/icon/languages/Sql.vue2.mjs +2 -2
  19. package/dist/components/icon/languages/Terraform.vue2.mjs +2 -2
  20. package/dist/components/icon/languages/Typescript copy.vue2.mjs +2 -2
  21. package/dist/components/icon/languages/Typescript.vue2.mjs +2 -2
  22. package/dist/components/others/ElmJsonComponentRenderer.vue2.mjs +1 -0
  23. package/dist/components/others/ElmMarkdown.stories.d.ts +6 -0
  24. package/dist/components/others/ElmMarkdown.vue.d.ts +5 -0
  25. package/dist/components/others/ElmMarkdown.vue.mjs +296 -0
  26. package/dist/components/others/ElmMarkdown.vue2.mjs +4 -0
  27. package/dist/components/typography/ElmInlineText.vue.d.ts +20 -2
  28. package/dist/components/typography/ElmInlineText.vue2.mjs +19 -3
  29. package/dist/index.d.ts +2 -0
  30. package/dist/index.mjs +28 -26
  31. package/dist/node_modules/.pnpm/marked@16.2.0/node_modules/marked/lib/marked.esm.mjs +1084 -0
  32. package/package.json +7 -6
@@ -0,0 +1,1084 @@
1
+ function L() {
2
+ return { async: false, breaks: false, extensions: null, gfm: true, hooks: null, pedantic: false, renderer: null, silent: false, tokenizer: null, walkTokens: null };
3
+ }
4
+ var O = L();
5
+ function H(l3) {
6
+ O = l3;
7
+ }
8
+ var E = { exec: () => null };
9
+ function h(l3, e = "") {
10
+ let t = typeof l3 == "string" ? l3 : l3.source, n = { replace: (r, i) => {
11
+ let s = typeof i == "string" ? i : i.source;
12
+ return s = s.replace(m.caret, "$1"), t = t.replace(r, s), n;
13
+ }, getRegex: () => new RegExp(t, e) };
14
+ return n;
15
+ }
16
+ var m = { codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm, outputLinkReplace: /\\([\[\]])/g, indentCodeCompensation: /^(\s+)(?:```)/, beginningSpace: /^\s+/, endingHash: /#$/, startingSpaceChar: /^ /, endingSpaceChar: / $/, nonSpaceChar: /[^ ]/, newLineCharGlobal: /\n/g, tabCharGlobal: /\t/g, multipleSpaceGlobal: /\s+/g, blankLine: /^[ \t]*$/, doubleBlankLine: /\n[ \t]*\n[ \t]*$/, blockquoteStart: /^ {0,3}>/, blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g, blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm, listReplaceTabs: /^\t+/, listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g, listIsTask: /^\[[ xX]\] /, listReplaceTask: /^\[[ xX]\] +/, anyLine: /\n.*\n/, hrefBrackets: /^<(.*)>$/, tableDelimiter: /[:|]/, tableAlignChars: /^\||\| *$/g, tableRowBlankLine: /\n[ \t]*$/, tableAlignRight: /^ *-+: *$/, tableAlignCenter: /^ *:-+: *$/, tableAlignLeft: /^ *:-+ *$/, startATag: /^<a /i, endATag: /^<\/a>/i, startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i, endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i, startAngleBracket: /^</, endAngleBracket: />$/, pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/, unicodeAlphaNumeric: /[\p{L}\p{N}]/u, escapeTest: /[&<>"']/, escapeReplace: /[&<>"']/g, escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g, unescapeTest: /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig, caret: /(^|[^\[])\^/g, percentDecode: /%25/g, findPipe: /\|/g, splitPipe: / \|/, slashPipe: /\\\|/g, carriageReturn: /\r\n|\r/g, spaceLine: /^ +$/gm, notSpaceStart: /^\S*/, endingNewline: /\n$/, listItemRegex: (l3) => new RegExp(`^( {0,3}${l3})((?:[ ][^\\n]*)?(?:\\n|$))`), nextBulletRegex: (l3) => new RegExp(`^ {0,${Math.min(3, l3 - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), hrRegex: (l3) => new RegExp(`^ {0,${Math.min(3, l3 - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), fencesBeginRegex: (l3) => new RegExp(`^ {0,${Math.min(3, l3 - 1)}}(?:\`\`\`|~~~)`), headingBeginRegex: (l3) => new RegExp(`^ {0,${Math.min(3, l3 - 1)}}#`), htmlBeginRegex: (l3) => new RegExp(`^ {0,${Math.min(3, l3 - 1)}}<(?:[a-z].*>|!--)`, "i") }, xe = /^(?:[ \t]*(?:\n|$))+/, be = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, Re = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, C = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, Oe = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, j = /(?:[*+-]|\d{1,9}[.)])/, se = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, ie = h(se).replace(/bull/g, j).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), Te = h(se).replace(/bull/g, j).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), F = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, we = /^[^\n]+/, Q = /(?!\s*\])(?:\\.|[^\[\]\\])+/, ye = h(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", Q).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Pe = h(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, j).getRegex(), v = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", U = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, Se = h("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", U).replace("tag", v).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), oe = h(F).replace("hr", C).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", v).getRegex(), $e = h(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", oe).getRegex(), K = { blockquote: $e, code: be, def: ye, fences: Re, heading: Oe, hr: C, html: Se, lheading: ie, list: Pe, newline: xe, paragraph: oe, table: E, text: we }, re = h("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", C).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", v).getRegex(), _e = { ...K, lheading: Te, table: re, paragraph: h(F).replace("hr", C).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", re).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", v).getRegex() }, Le = { ...K, html: h(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", U).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(), def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/, heading: /^(#{1,6})(.*)(?:\n+|$)/, fences: E, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: h(F).replace("hr", C).replace("heading", ` *#{1,6} *[^
17
+ ]`).replace("lheading", ie).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, Me = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, ze = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, ae = /^( {2,}|\\)\n(?!\s*$)/, Ae = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, D = /[\p{P}\p{S}]/u, W = /[\s\p{P}\p{S}]/u, le = /[^\s\p{P}\p{S}]/u, Ee = h(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, W).getRegex(), ue = /(?!~)[\p{P}\p{S}]/u, Ce = /(?!~)[\s\p{P}\p{S}]/u, Ie = /(?:[^\s\p{P}\p{S}]|~)/u, Be = /\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<(?! )[^<>]*?>/g, pe = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/, qe = h(pe, "u").replace(/punct/g, D).getRegex(), ve = h(pe, "u").replace(/punct/g, ue).getRegex(), ce = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", De = h(ce, "gu").replace(/notPunctSpace/g, le).replace(/punctSpace/g, W).replace(/punct/g, D).getRegex(), Ze = h(ce, "gu").replace(/notPunctSpace/g, Ie).replace(/punctSpace/g, Ce).replace(/punct/g, ue).getRegex(), Ge = h("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, le).replace(/punctSpace/g, W).replace(/punct/g, D).getRegex(), He = h(/\\(punct)/, "gu").replace(/punct/g, D).getRegex(), Ne = h(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), je = h(U).replace("(?:-->|$)", "-->").getRegex(), Fe = h("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", je).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), q = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/, Qe = h(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label", q).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), he = h(/^!?\[(label)\]\[(ref)\]/).replace("label", q).replace("ref", Q).getRegex(), de = h(/^!?\[(ref)\](?:\[\])?/).replace("ref", Q).getRegex(), Ue = h("reflink|nolink(?!\\()", "g").replace("reflink", he).replace("nolink", de).getRegex(), X = { _backpedal: E, anyPunctuation: He, autolink: Ne, blockSkip: Be, br: ae, code: ze, del: E, emStrongLDelim: qe, emStrongRDelimAst: De, emStrongRDelimUnd: Ge, escape: Me, link: Qe, nolink: de, punctuation: Ee, reflink: he, reflinkSearch: Ue, tag: Fe, text: Ae, url: E }, Ke = { ...X, link: h(/^!?\[(label)\]\((.*?)\)/).replace("label", q).getRegex(), reflink: h(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", q).getRegex() }, N = { ...X, emStrongRDelimAst: Ze, emStrongLDelim: ve, url: h(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/, "i").replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(), _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/, del: /^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/, text: /^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/ }, We = { ...N, br: h(ae).replace("{2,}", "*").getRegex(), text: h(N.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() }, I = { normal: K, gfm: _e, pedantic: Le }, M = { normal: X, gfm: N, breaks: We, pedantic: Ke };
18
+ var Xe = { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" }, ke = (l3) => Xe[l3];
19
+ function w(l3, e) {
20
+ if (e) {
21
+ if (m.escapeTest.test(l3)) return l3.replace(m.escapeReplace, ke);
22
+ } else if (m.escapeTestNoEncode.test(l3)) return l3.replace(m.escapeReplaceNoEncode, ke);
23
+ return l3;
24
+ }
25
+ function J(l3) {
26
+ try {
27
+ l3 = encodeURI(l3).replace(m.percentDecode, "%");
28
+ } catch {
29
+ return null;
30
+ }
31
+ return l3;
32
+ }
33
+ function V(l3, e) {
34
+ let t = l3.replace(m.findPipe, (i, s, o) => {
35
+ let a = false, u = s;
36
+ for (; --u >= 0 && o[u] === "\\"; ) a = !a;
37
+ return a ? "|" : " |";
38
+ }), n = t.split(m.splitPipe), r = 0;
39
+ if (n[0].trim() || n.shift(), n.length > 0 && !n.at(-1)?.trim() && n.pop(), e) if (n.length > e) n.splice(e);
40
+ else for (; n.length < e; ) n.push("");
41
+ for (; r < n.length; r++) n[r] = n[r].trim().replace(m.slashPipe, "|");
42
+ return n;
43
+ }
44
+ function z(l3, e, t) {
45
+ let n = l3.length;
46
+ if (n === 0) return "";
47
+ let r = 0;
48
+ for (; r < n; ) {
49
+ let i = l3.charAt(n - r - 1);
50
+ if (i === e && true) r++;
51
+ else break;
52
+ }
53
+ return l3.slice(0, n - r);
54
+ }
55
+ function ge(l3, e) {
56
+ if (l3.indexOf(e[1]) === -1) return -1;
57
+ let t = 0;
58
+ for (let n = 0; n < l3.length; n++) if (l3[n] === "\\") n++;
59
+ else if (l3[n] === e[0]) t++;
60
+ else if (l3[n] === e[1] && (t--, t < 0)) return n;
61
+ return t > 0 ? -2 : -1;
62
+ }
63
+ function fe(l3, e, t, n, r) {
64
+ let i = e.href, s = e.title || null, o = l3[1].replace(r.other.outputLinkReplace, "$1");
65
+ n.state.inLink = true;
66
+ let a = { type: l3[0].charAt(0) === "!" ? "image" : "link", raw: t, href: i, title: s, text: o, tokens: n.inlineTokens(o) };
67
+ return n.state.inLink = false, a;
68
+ }
69
+ function Je(l3, e, t) {
70
+ let n = l3.match(t.other.indentCodeCompensation);
71
+ if (n === null) return e;
72
+ let r = n[1];
73
+ return e.split(`
74
+ `).map((i) => {
75
+ let s = i.match(t.other.beginningSpace);
76
+ if (s === null) return i;
77
+ let [o] = s;
78
+ return o.length >= r.length ? i.slice(r.length) : i;
79
+ }).join(`
80
+ `);
81
+ }
82
+ var y = class {
83
+ options;
84
+ rules;
85
+ lexer;
86
+ constructor(e) {
87
+ this.options = e || O;
88
+ }
89
+ space(e) {
90
+ let t = this.rules.block.newline.exec(e);
91
+ if (t && t[0].length > 0) return { type: "space", raw: t[0] };
92
+ }
93
+ code(e) {
94
+ let t = this.rules.block.code.exec(e);
95
+ if (t) {
96
+ let n = t[0].replace(this.rules.other.codeRemoveIndent, "");
97
+ return { type: "code", raw: t[0], codeBlockStyle: "indented", text: this.options.pedantic ? n : z(n, `
98
+ `) };
99
+ }
100
+ }
101
+ fences(e) {
102
+ let t = this.rules.block.fences.exec(e);
103
+ if (t) {
104
+ let n = t[0], r = Je(n, t[3] || "", this.rules);
105
+ return { type: "code", raw: n, lang: t[2] ? t[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : t[2], text: r };
106
+ }
107
+ }
108
+ heading(e) {
109
+ let t = this.rules.block.heading.exec(e);
110
+ if (t) {
111
+ let n = t[2].trim();
112
+ if (this.rules.other.endingHash.test(n)) {
113
+ let r = z(n, "#");
114
+ (this.options.pedantic || !r || this.rules.other.endingSpaceChar.test(r)) && (n = r.trim());
115
+ }
116
+ return { type: "heading", raw: t[0], depth: t[1].length, text: n, tokens: this.lexer.inline(n) };
117
+ }
118
+ }
119
+ hr(e) {
120
+ let t = this.rules.block.hr.exec(e);
121
+ if (t) return { type: "hr", raw: z(t[0], `
122
+ `) };
123
+ }
124
+ blockquote(e) {
125
+ let t = this.rules.block.blockquote.exec(e);
126
+ if (t) {
127
+ let n = z(t[0], `
128
+ `).split(`
129
+ `), r = "", i = "", s = [];
130
+ for (; n.length > 0; ) {
131
+ let o = false, a = [], u;
132
+ for (u = 0; u < n.length; u++) if (this.rules.other.blockquoteStart.test(n[u])) a.push(n[u]), o = true;
133
+ else if (!o) a.push(n[u]);
134
+ else break;
135
+ n = n.slice(u);
136
+ let p = a.join(`
137
+ `), c = p.replace(this.rules.other.blockquoteSetextReplace, `
138
+ $1`).replace(this.rules.other.blockquoteSetextReplace2, "");
139
+ r = r ? `${r}
140
+ ${p}` : p, i = i ? `${i}
141
+ ${c}` : c;
142
+ let f = this.lexer.state.top;
143
+ if (this.lexer.state.top = true, this.lexer.blockTokens(c, s, true), this.lexer.state.top = f, n.length === 0) break;
144
+ let k = s.at(-1);
145
+ if (k?.type === "code") break;
146
+ if (k?.type === "blockquote") {
147
+ let x = k, g = x.raw + `
148
+ ` + n.join(`
149
+ `), T = this.blockquote(g);
150
+ s[s.length - 1] = T, r = r.substring(0, r.length - x.raw.length) + T.raw, i = i.substring(0, i.length - x.text.length) + T.text;
151
+ break;
152
+ } else if (k?.type === "list") {
153
+ let x = k, g = x.raw + `
154
+ ` + n.join(`
155
+ `), T = this.list(g);
156
+ s[s.length - 1] = T, r = r.substring(0, r.length - k.raw.length) + T.raw, i = i.substring(0, i.length - x.raw.length) + T.raw, n = g.substring(s.at(-1).raw.length).split(`
157
+ `);
158
+ continue;
159
+ }
160
+ }
161
+ return { type: "blockquote", raw: r, tokens: s, text: i };
162
+ }
163
+ }
164
+ list(e) {
165
+ let t = this.rules.block.list.exec(e);
166
+ if (t) {
167
+ let n = t[1].trim(), r = n.length > 1, i = { type: "list", raw: "", ordered: r, start: r ? +n.slice(0, -1) : "", loose: false, items: [] };
168
+ n = r ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = r ? n : "[*+-]");
169
+ let s = this.rules.other.listItemRegex(n), o = false;
170
+ for (; e; ) {
171
+ let u = false, p = "", c = "";
172
+ if (!(t = s.exec(e)) || this.rules.block.hr.test(e)) break;
173
+ p = t[0], e = e.substring(p.length);
174
+ let f = t[2].split(`
175
+ `, 1)[0].replace(this.rules.other.listReplaceTabs, (Z) => " ".repeat(3 * Z.length)), k = e.split(`
176
+ `, 1)[0], x = !f.trim(), g = 0;
177
+ if (this.options.pedantic ? (g = 2, c = f.trimStart()) : x ? g = t[1].length + 1 : (g = t[2].search(this.rules.other.nonSpaceChar), g = g > 4 ? 1 : g, c = f.slice(g), g += t[1].length), x && this.rules.other.blankLine.test(k) && (p += k + `
178
+ `, e = e.substring(k.length + 1), u = true), !u) {
179
+ let Z = this.rules.other.nextBulletRegex(g), ee = this.rules.other.hrRegex(g), te = this.rules.other.fencesBeginRegex(g), ne = this.rules.other.headingBeginRegex(g), me = this.rules.other.htmlBeginRegex(g);
180
+ for (; e; ) {
181
+ let G = e.split(`
182
+ `, 1)[0], A;
183
+ if (k = G, this.options.pedantic ? (k = k.replace(this.rules.other.listReplaceNesting, " "), A = k) : A = k.replace(this.rules.other.tabCharGlobal, " "), te.test(k) || ne.test(k) || me.test(k) || Z.test(k) || ee.test(k)) break;
184
+ if (A.search(this.rules.other.nonSpaceChar) >= g || !k.trim()) c += `
185
+ ` + A.slice(g);
186
+ else {
187
+ if (x || f.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || te.test(f) || ne.test(f) || ee.test(f)) break;
188
+ c += `
189
+ ` + k;
190
+ }
191
+ !x && !k.trim() && (x = true), p += G + `
192
+ `, e = e.substring(G.length + 1), f = A.slice(g);
193
+ }
194
+ }
195
+ i.loose || (o ? i.loose = true : this.rules.other.doubleBlankLine.test(p) && (o = true));
196
+ let T = null, Y;
197
+ this.options.gfm && (T = this.rules.other.listIsTask.exec(c), T && (Y = T[0] !== "[ ] ", c = c.replace(this.rules.other.listReplaceTask, ""))), i.items.push({ type: "list_item", raw: p, task: !!T, checked: Y, loose: false, text: c, tokens: [] }), i.raw += p;
198
+ }
199
+ let a = i.items.at(-1);
200
+ if (a) a.raw = a.raw.trimEnd(), a.text = a.text.trimEnd();
201
+ else return;
202
+ i.raw = i.raw.trimEnd();
203
+ for (let u = 0; u < i.items.length; u++) if (this.lexer.state.top = false, i.items[u].tokens = this.lexer.blockTokens(i.items[u].text, []), !i.loose) {
204
+ let p = i.items[u].tokens.filter((f) => f.type === "space"), c = p.length > 0 && p.some((f) => this.rules.other.anyLine.test(f.raw));
205
+ i.loose = c;
206
+ }
207
+ if (i.loose) for (let u = 0; u < i.items.length; u++) i.items[u].loose = true;
208
+ return i;
209
+ }
210
+ }
211
+ html(e) {
212
+ let t = this.rules.block.html.exec(e);
213
+ if (t) return { type: "html", block: true, raw: t[0], pre: t[1] === "pre" || t[1] === "script" || t[1] === "style", text: t[0] };
214
+ }
215
+ def(e) {
216
+ let t = this.rules.block.def.exec(e);
217
+ if (t) {
218
+ let n = t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal, " "), r = 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];
219
+ return { type: "def", tag: n, raw: t[0], href: r, title: i };
220
+ }
221
+ }
222
+ table(e) {
223
+ let t = this.rules.block.table.exec(e);
224
+ if (!t || !this.rules.other.tableDelimiter.test(t[2])) return;
225
+ let n = V(t[1]), r = t[2].replace(this.rules.other.tableAlignChars, "").split("|"), i = t[3]?.trim() ? t[3].replace(this.rules.other.tableRowBlankLine, "").split(`
226
+ `) : [], s = { type: "table", raw: t[0], header: [], align: [], rows: [] };
227
+ if (n.length === r.length) {
228
+ for (let o of r) this.rules.other.tableAlignRight.test(o) ? s.align.push("right") : this.rules.other.tableAlignCenter.test(o) ? s.align.push("center") : this.rules.other.tableAlignLeft.test(o) ? s.align.push("left") : s.align.push(null);
229
+ for (let o = 0; o < n.length; o++) s.header.push({ text: n[o], tokens: this.lexer.inline(n[o]), header: true, align: s.align[o] });
230
+ for (let o of i) s.rows.push(V(o, s.header.length).map((a, u) => ({ text: a, tokens: this.lexer.inline(a), header: false, align: s.align[u] })));
231
+ return s;
232
+ }
233
+ }
234
+ lheading(e) {
235
+ let t = this.rules.block.lheading.exec(e);
236
+ if (t) return { type: "heading", raw: t[0], depth: t[2].charAt(0) === "=" ? 1 : 2, text: t[1], tokens: this.lexer.inline(t[1]) };
237
+ }
238
+ paragraph(e) {
239
+ let t = this.rules.block.paragraph.exec(e);
240
+ if (t) {
241
+ let n = t[1].charAt(t[1].length - 1) === `
242
+ ` ? t[1].slice(0, -1) : t[1];
243
+ return { type: "paragraph", raw: t[0], text: n, tokens: this.lexer.inline(n) };
244
+ }
245
+ }
246
+ text(e) {
247
+ let t = this.rules.block.text.exec(e);
248
+ if (t) return { type: "text", raw: t[0], text: t[0], tokens: this.lexer.inline(t[0]) };
249
+ }
250
+ escape(e) {
251
+ let t = this.rules.inline.escape.exec(e);
252
+ if (t) return { type: "escape", raw: t[0], text: t[1] };
253
+ }
254
+ tag(e) {
255
+ let t = this.rules.inline.tag.exec(e);
256
+ if (t) return !this.lexer.state.inLink && this.rules.other.startATag.test(t[0]) ? this.lexer.state.inLink = true : this.lexer.state.inLink && this.rules.other.endATag.test(t[0]) && (this.lexer.state.inLink = false), !this.lexer.state.inRawBlock && this.rules.other.startPreScriptTag.test(t[0]) ? this.lexer.state.inRawBlock = true : this.lexer.state.inRawBlock && this.rules.other.endPreScriptTag.test(t[0]) && (this.lexer.state.inRawBlock = false), { type: "html", raw: t[0], inLink: this.lexer.state.inLink, inRawBlock: this.lexer.state.inRawBlock, block: false, text: t[0] };
257
+ }
258
+ link(e) {
259
+ let t = this.rules.inline.link.exec(e);
260
+ if (t) {
261
+ let n = t[2].trim();
262
+ if (!this.options.pedantic && this.rules.other.startAngleBracket.test(n)) {
263
+ if (!this.rules.other.endAngleBracket.test(n)) return;
264
+ let s = z(n.slice(0, -1), "\\");
265
+ if ((n.length - s.length) % 2 === 0) return;
266
+ } else {
267
+ let s = ge(t[2], "()");
268
+ if (s === -2) return;
269
+ if (s > -1) {
270
+ let a = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + s;
271
+ t[2] = t[2].substring(0, s), t[0] = t[0].substring(0, a).trim(), t[3] = "";
272
+ }
273
+ }
274
+ let r = t[2], i = "";
275
+ if (this.options.pedantic) {
276
+ let s = this.rules.other.pedanticHrefTitle.exec(r);
277
+ s && (r = s[1], i = s[3]);
278
+ } else i = t[3] ? t[3].slice(1, -1) : "";
279
+ return r = r.trim(), this.rules.other.startAngleBracket.test(r) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(n) ? r = r.slice(1) : r = r.slice(1, -1)), fe(t, { href: r && r.replace(this.rules.inline.anyPunctuation, "$1"), title: i && i.replace(this.rules.inline.anyPunctuation, "$1") }, t[0], this.lexer, this.rules);
280
+ }
281
+ }
282
+ reflink(e, t) {
283
+ let n;
284
+ if ((n = this.rules.inline.reflink.exec(e)) || (n = this.rules.inline.nolink.exec(e))) {
285
+ let r = (n[2] || n[1]).replace(this.rules.other.multipleSpaceGlobal, " "), i = t[r.toLowerCase()];
286
+ if (!i) {
287
+ let s = n[0].charAt(0);
288
+ return { type: "text", raw: s, text: s };
289
+ }
290
+ return fe(n, i, n[0], this.lexer, this.rules);
291
+ }
292
+ }
293
+ emStrong(e, t, n = "") {
294
+ let r = this.rules.inline.emStrongLDelim.exec(e);
295
+ if (!r || r[3] && n.match(this.rules.other.unicodeAlphaNumeric)) return;
296
+ if (!(r[1] || r[2] || "") || !n || this.rules.inline.punctuation.exec(n)) {
297
+ let s = [...r[0]].length - 1, o, a, u = s, p = 0, c = r[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
298
+ for (c.lastIndex = 0, t = t.slice(-1 * e.length + s); (r = c.exec(t)) != null; ) {
299
+ if (o = r[1] || r[2] || r[3] || r[4] || r[5] || r[6], !o) continue;
300
+ if (a = [...o].length, r[3] || r[4]) {
301
+ u += a;
302
+ continue;
303
+ } else if ((r[5] || r[6]) && s % 3 && !((s + a) % 3)) {
304
+ p += a;
305
+ continue;
306
+ }
307
+ if (u -= a, u > 0) continue;
308
+ a = Math.min(a, a + u + p);
309
+ let f = [...r[0]][0].length, k = e.slice(0, s + r.index + f + a);
310
+ if (Math.min(s, a) % 2) {
311
+ let g = k.slice(1, -1);
312
+ return { type: "em", raw: k, text: g, tokens: this.lexer.inlineTokens(g) };
313
+ }
314
+ let x = k.slice(2, -2);
315
+ return { type: "strong", raw: k, text: x, tokens: this.lexer.inlineTokens(x) };
316
+ }
317
+ }
318
+ }
319
+ codespan(e) {
320
+ let t = this.rules.inline.code.exec(e);
321
+ if (t) {
322
+ let n = t[2].replace(this.rules.other.newLineCharGlobal, " "), r = this.rules.other.nonSpaceChar.test(n), i = this.rules.other.startingSpaceChar.test(n) && this.rules.other.endingSpaceChar.test(n);
323
+ return r && i && (n = n.substring(1, n.length - 1)), { type: "codespan", raw: t[0], text: n };
324
+ }
325
+ }
326
+ br(e) {
327
+ let t = this.rules.inline.br.exec(e);
328
+ if (t) return { type: "br", raw: t[0] };
329
+ }
330
+ del(e) {
331
+ let t = this.rules.inline.del.exec(e);
332
+ if (t) return { type: "del", raw: t[0], text: t[2], tokens: this.lexer.inlineTokens(t[2]) };
333
+ }
334
+ autolink(e) {
335
+ let t = this.rules.inline.autolink.exec(e);
336
+ if (t) {
337
+ let n, r;
338
+ return t[2] === "@" ? (n = t[1], r = "mailto:" + n) : (n = t[1], r = n), { type: "link", raw: t[0], text: n, href: r, tokens: [{ type: "text", raw: n, text: n }] };
339
+ }
340
+ }
341
+ url(e) {
342
+ let t;
343
+ if (t = this.rules.inline.url.exec(e)) {
344
+ let n, r;
345
+ if (t[2] === "@") n = t[0], r = "mailto:" + n;
346
+ else {
347
+ let i;
348
+ do
349
+ i = t[0], t[0] = this.rules.inline._backpedal.exec(t[0])?.[0] ?? "";
350
+ while (i !== t[0]);
351
+ n = t[0], t[1] === "www." ? r = "http://" + t[0] : r = t[0];
352
+ }
353
+ return { type: "link", raw: t[0], text: n, href: r, tokens: [{ type: "text", raw: n, text: n }] };
354
+ }
355
+ }
356
+ inlineText(e) {
357
+ let t = this.rules.inline.text.exec(e);
358
+ if (t) {
359
+ let n = this.lexer.state.inRawBlock;
360
+ return { type: "text", raw: t[0], text: t[0], escaped: n };
361
+ }
362
+ }
363
+ };
364
+ var b = class l {
365
+ tokens;
366
+ options;
367
+ state;
368
+ tokenizer;
369
+ inlineQueue;
370
+ constructor(e) {
371
+ this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e || O, this.options.tokenizer = this.options.tokenizer || new y(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: false, inRawBlock: false, top: true };
372
+ let t = { other: m, block: I.normal, inline: M.normal };
373
+ this.options.pedantic ? (t.block = I.pedantic, t.inline = M.pedantic) : this.options.gfm && (t.block = I.gfm, this.options.breaks ? t.inline = M.breaks : t.inline = M.gfm), this.tokenizer.rules = t;
374
+ }
375
+ static get rules() {
376
+ return { block: I, inline: M };
377
+ }
378
+ static lex(e, t) {
379
+ return new l(t).lex(e);
380
+ }
381
+ static lexInline(e, t) {
382
+ return new l(t).inlineTokens(e);
383
+ }
384
+ lex(e) {
385
+ e = e.replace(m.carriageReturn, `
386
+ `), this.blockTokens(e, this.tokens);
387
+ for (let t = 0; t < this.inlineQueue.length; t++) {
388
+ let n = this.inlineQueue[t];
389
+ this.inlineTokens(n.src, n.tokens);
390
+ }
391
+ return this.inlineQueue = [], this.tokens;
392
+ }
393
+ blockTokens(e, t = [], n = false) {
394
+ for (this.options.pedantic && (e = e.replace(m.tabCharGlobal, " ").replace(m.spaceLine, "")); e; ) {
395
+ let r;
396
+ if (this.options.extensions?.block?.some((s) => (r = s.call({ lexer: this }, e, t)) ? (e = e.substring(r.raw.length), t.push(r), true) : false)) continue;
397
+ if (r = this.tokenizer.space(e)) {
398
+ e = e.substring(r.raw.length);
399
+ let s = t.at(-1);
400
+ r.raw.length === 1 && s !== void 0 ? s.raw += `
401
+ ` : t.push(r);
402
+ continue;
403
+ }
404
+ if (r = this.tokenizer.code(e)) {
405
+ e = e.substring(r.raw.length);
406
+ let s = t.at(-1);
407
+ s?.type === "paragraph" || s?.type === "text" ? (s.raw += (s.raw.endsWith(`
408
+ `) ? "" : `
409
+ `) + r.raw, s.text += `
410
+ ` + r.text, this.inlineQueue.at(-1).src = s.text) : t.push(r);
411
+ continue;
412
+ }
413
+ if (r = this.tokenizer.fences(e)) {
414
+ e = e.substring(r.raw.length), t.push(r);
415
+ continue;
416
+ }
417
+ if (r = this.tokenizer.heading(e)) {
418
+ e = e.substring(r.raw.length), t.push(r);
419
+ continue;
420
+ }
421
+ if (r = this.tokenizer.hr(e)) {
422
+ e = e.substring(r.raw.length), t.push(r);
423
+ continue;
424
+ }
425
+ if (r = this.tokenizer.blockquote(e)) {
426
+ e = e.substring(r.raw.length), t.push(r);
427
+ continue;
428
+ }
429
+ if (r = this.tokenizer.list(e)) {
430
+ e = e.substring(r.raw.length), t.push(r);
431
+ continue;
432
+ }
433
+ if (r = this.tokenizer.html(e)) {
434
+ e = e.substring(r.raw.length), t.push(r);
435
+ continue;
436
+ }
437
+ if (r = this.tokenizer.def(e)) {
438
+ e = e.substring(r.raw.length);
439
+ let s = t.at(-1);
440
+ s?.type === "paragraph" || s?.type === "text" ? (s.raw += (s.raw.endsWith(`
441
+ `) ? "" : `
442
+ `) + r.raw, s.text += `
443
+ ` + r.raw, this.inlineQueue.at(-1).src = s.text) : this.tokens.links[r.tag] || (this.tokens.links[r.tag] = { href: r.href, title: r.title }, t.push(r));
444
+ continue;
445
+ }
446
+ if (r = this.tokenizer.table(e)) {
447
+ e = e.substring(r.raw.length), t.push(r);
448
+ continue;
449
+ }
450
+ if (r = this.tokenizer.lheading(e)) {
451
+ e = e.substring(r.raw.length), t.push(r);
452
+ continue;
453
+ }
454
+ let i = e;
455
+ if (this.options.extensions?.startBlock) {
456
+ let s = 1 / 0, o = e.slice(1), a;
457
+ this.options.extensions.startBlock.forEach((u) => {
458
+ a = u.call({ lexer: this }, o), typeof a == "number" && a >= 0 && (s = Math.min(s, a));
459
+ }), s < 1 / 0 && s >= 0 && (i = e.substring(0, s + 1));
460
+ }
461
+ if (this.state.top && (r = this.tokenizer.paragraph(i))) {
462
+ let s = t.at(-1);
463
+ n && s?.type === "paragraph" ? (s.raw += (s.raw.endsWith(`
464
+ `) ? "" : `
465
+ `) + r.raw, s.text += `
466
+ ` + r.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = s.text) : t.push(r), n = i.length !== e.length, e = e.substring(r.raw.length);
467
+ continue;
468
+ }
469
+ if (r = this.tokenizer.text(e)) {
470
+ e = e.substring(r.raw.length);
471
+ let s = t.at(-1);
472
+ s?.type === "text" ? (s.raw += (s.raw.endsWith(`
473
+ `) ? "" : `
474
+ `) + r.raw, s.text += `
475
+ ` + r.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = s.text) : t.push(r);
476
+ continue;
477
+ }
478
+ if (e) {
479
+ let s = "Infinite loop on byte: " + e.charCodeAt(0);
480
+ if (this.options.silent) {
481
+ console.error(s);
482
+ break;
483
+ } else throw new Error(s);
484
+ }
485
+ }
486
+ return this.state.top = true, t;
487
+ }
488
+ inline(e, t = []) {
489
+ return this.inlineQueue.push({ src: e, tokens: t }), t;
490
+ }
491
+ inlineTokens(e, t = []) {
492
+ let n = e, r = null;
493
+ if (this.tokens.links) {
494
+ let o = Object.keys(this.tokens.links);
495
+ if (o.length > 0) for (; (r = this.tokenizer.rules.inline.reflinkSearch.exec(n)) != null; ) o.includes(r[0].slice(r[0].lastIndexOf("[") + 1, -1)) && (n = n.slice(0, r.index) + "[" + "a".repeat(r[0].length - 2) + "]" + n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
496
+ }
497
+ for (; (r = this.tokenizer.rules.inline.anyPunctuation.exec(n)) != null; ) n = n.slice(0, r.index) + "++" + n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
498
+ for (; (r = this.tokenizer.rules.inline.blockSkip.exec(n)) != null; ) n = n.slice(0, r.index) + "[" + "a".repeat(r[0].length - 2) + "]" + n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
499
+ let i = false, s = "";
500
+ for (; e; ) {
501
+ i || (s = ""), i = false;
502
+ let o;
503
+ if (this.options.extensions?.inline?.some((u) => (o = u.call({ lexer: this }, e, t)) ? (e = e.substring(o.raw.length), t.push(o), true) : false)) continue;
504
+ if (o = this.tokenizer.escape(e)) {
505
+ e = e.substring(o.raw.length), t.push(o);
506
+ continue;
507
+ }
508
+ if (o = this.tokenizer.tag(e)) {
509
+ e = e.substring(o.raw.length), t.push(o);
510
+ continue;
511
+ }
512
+ if (o = this.tokenizer.link(e)) {
513
+ e = e.substring(o.raw.length), t.push(o);
514
+ continue;
515
+ }
516
+ if (o = this.tokenizer.reflink(e, this.tokens.links)) {
517
+ e = e.substring(o.raw.length);
518
+ let u = t.at(-1);
519
+ o.type === "text" && u?.type === "text" ? (u.raw += o.raw, u.text += o.text) : t.push(o);
520
+ continue;
521
+ }
522
+ if (o = this.tokenizer.emStrong(e, n, s)) {
523
+ e = e.substring(o.raw.length), t.push(o);
524
+ continue;
525
+ }
526
+ if (o = this.tokenizer.codespan(e)) {
527
+ e = e.substring(o.raw.length), t.push(o);
528
+ continue;
529
+ }
530
+ if (o = this.tokenizer.br(e)) {
531
+ e = e.substring(o.raw.length), t.push(o);
532
+ continue;
533
+ }
534
+ if (o = this.tokenizer.del(e)) {
535
+ e = e.substring(o.raw.length), t.push(o);
536
+ continue;
537
+ }
538
+ if (o = this.tokenizer.autolink(e)) {
539
+ e = e.substring(o.raw.length), t.push(o);
540
+ continue;
541
+ }
542
+ if (!this.state.inLink && (o = this.tokenizer.url(e))) {
543
+ e = e.substring(o.raw.length), t.push(o);
544
+ continue;
545
+ }
546
+ let a = e;
547
+ if (this.options.extensions?.startInline) {
548
+ let u = 1 / 0, p = e.slice(1), c;
549
+ this.options.extensions.startInline.forEach((f) => {
550
+ c = f.call({ lexer: this }, p), typeof c == "number" && c >= 0 && (u = Math.min(u, c));
551
+ }), u < 1 / 0 && u >= 0 && (a = e.substring(0, u + 1));
552
+ }
553
+ if (o = this.tokenizer.inlineText(a)) {
554
+ e = e.substring(o.raw.length), o.raw.slice(-1) !== "_" && (s = o.raw.slice(-1)), i = true;
555
+ let u = t.at(-1);
556
+ u?.type === "text" ? (u.raw += o.raw, u.text += o.text) : t.push(o);
557
+ continue;
558
+ }
559
+ if (e) {
560
+ let u = "Infinite loop on byte: " + e.charCodeAt(0);
561
+ if (this.options.silent) {
562
+ console.error(u);
563
+ break;
564
+ } else throw new Error(u);
565
+ }
566
+ }
567
+ return t;
568
+ }
569
+ };
570
+ var P = class {
571
+ options;
572
+ parser;
573
+ constructor(e) {
574
+ this.options = e || O;
575
+ }
576
+ space(e) {
577
+ return "";
578
+ }
579
+ code({ text: e, lang: t, escaped: n }) {
580
+ let r = (t || "").match(m.notSpaceStart)?.[0], i = e.replace(m.endingNewline, "") + `
581
+ `;
582
+ return r ? '<pre><code class="language-' + w(r) + '">' + (n ? i : w(i, true)) + `</code></pre>
583
+ ` : "<pre><code>" + (n ? i : w(i, true)) + `</code></pre>
584
+ `;
585
+ }
586
+ blockquote({ tokens: e }) {
587
+ return `<blockquote>
588
+ ${this.parser.parse(e)}</blockquote>
589
+ `;
590
+ }
591
+ html({ text: e }) {
592
+ return e;
593
+ }
594
+ def(e) {
595
+ return "";
596
+ }
597
+ heading({ tokens: e, depth: t }) {
598
+ return `<h${t}>${this.parser.parseInline(e)}</h${t}>
599
+ `;
600
+ }
601
+ hr(e) {
602
+ return `<hr>
603
+ `;
604
+ }
605
+ list(e) {
606
+ let t = e.ordered, n = e.start, r = "";
607
+ for (let o = 0; o < e.items.length; o++) {
608
+ let a = e.items[o];
609
+ r += this.listitem(a);
610
+ }
611
+ let i = t ? "ol" : "ul", s = t && n !== 1 ? ' start="' + n + '"' : "";
612
+ return "<" + i + s + `>
613
+ ` + r + "</" + i + `>
614
+ `;
615
+ }
616
+ listitem(e) {
617
+ let t = "";
618
+ if (e.task) {
619
+ let n = this.checkbox({ checked: !!e.checked });
620
+ e.loose ? e.tokens[0]?.type === "paragraph" ? (e.tokens[0].text = n + " " + e.tokens[0].text, e.tokens[0].tokens && e.tokens[0].tokens.length > 0 && e.tokens[0].tokens[0].type === "text" && (e.tokens[0].tokens[0].text = n + " " + w(e.tokens[0].tokens[0].text), e.tokens[0].tokens[0].escaped = true)) : e.tokens.unshift({ type: "text", raw: n + " ", text: n + " ", escaped: true }) : t += n + " ";
621
+ }
622
+ return t += this.parser.parse(e.tokens, !!e.loose), `<li>${t}</li>
623
+ `;
624
+ }
625
+ checkbox({ checked: e }) {
626
+ return "<input " + (e ? 'checked="" ' : "") + 'disabled="" type="checkbox">';
627
+ }
628
+ paragraph({ tokens: e }) {
629
+ return `<p>${this.parser.parseInline(e)}</p>
630
+ `;
631
+ }
632
+ table(e) {
633
+ let t = "", n = "";
634
+ for (let i = 0; i < e.header.length; i++) n += this.tablecell(e.header[i]);
635
+ t += this.tablerow({ text: n });
636
+ let r = "";
637
+ for (let i = 0; i < e.rows.length; i++) {
638
+ let s = e.rows[i];
639
+ n = "";
640
+ for (let o = 0; o < s.length; o++) n += this.tablecell(s[o]);
641
+ r += this.tablerow({ text: n });
642
+ }
643
+ return r && (r = `<tbody>${r}</tbody>`), `<table>
644
+ <thead>
645
+ ` + t + `</thead>
646
+ ` + r + `</table>
647
+ `;
648
+ }
649
+ tablerow({ text: e }) {
650
+ return `<tr>
651
+ ${e}</tr>
652
+ `;
653
+ }
654
+ tablecell(e) {
655
+ let t = this.parser.parseInline(e.tokens), n = e.header ? "th" : "td";
656
+ return (e.align ? `<${n} align="${e.align}">` : `<${n}>`) + t + `</${n}>
657
+ `;
658
+ }
659
+ strong({ tokens: e }) {
660
+ return `<strong>${this.parser.parseInline(e)}</strong>`;
661
+ }
662
+ em({ tokens: e }) {
663
+ return `<em>${this.parser.parseInline(e)}</em>`;
664
+ }
665
+ codespan({ text: e }) {
666
+ return `<code>${w(e, true)}</code>`;
667
+ }
668
+ br(e) {
669
+ return "<br>";
670
+ }
671
+ del({ tokens: e }) {
672
+ return `<del>${this.parser.parseInline(e)}</del>`;
673
+ }
674
+ link({ href: e, title: t, tokens: n }) {
675
+ let r = this.parser.parseInline(n), i = J(e);
676
+ if (i === null) return r;
677
+ e = i;
678
+ let s = '<a href="' + e + '"';
679
+ return t && (s += ' title="' + w(t) + '"'), s += ">" + r + "</a>", s;
680
+ }
681
+ image({ href: e, title: t, text: n, tokens: r }) {
682
+ r && (n = this.parser.parseInline(r, this.parser.textRenderer));
683
+ let i = J(e);
684
+ if (i === null) return w(n);
685
+ e = i;
686
+ let s = `<img src="${e}" alt="${n}"`;
687
+ return t && (s += ` title="${w(t)}"`), s += ">", s;
688
+ }
689
+ text(e) {
690
+ return "tokens" in e && e.tokens ? this.parser.parseInline(e.tokens) : "escaped" in e && e.escaped ? e.text : w(e.text);
691
+ }
692
+ };
693
+ var S = class {
694
+ strong({ text: e }) {
695
+ return e;
696
+ }
697
+ em({ text: e }) {
698
+ return e;
699
+ }
700
+ codespan({ text: e }) {
701
+ return e;
702
+ }
703
+ del({ text: e }) {
704
+ return e;
705
+ }
706
+ html({ text: e }) {
707
+ return e;
708
+ }
709
+ text({ text: e }) {
710
+ return e;
711
+ }
712
+ link({ text: e }) {
713
+ return "" + e;
714
+ }
715
+ image({ text: e }) {
716
+ return "" + e;
717
+ }
718
+ br() {
719
+ return "";
720
+ }
721
+ };
722
+ var R = class l2 {
723
+ options;
724
+ renderer;
725
+ textRenderer;
726
+ constructor(e) {
727
+ this.options = e || O, this.options.renderer = this.options.renderer || new P(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new S();
728
+ }
729
+ static parse(e, t) {
730
+ return new l2(t).parse(e);
731
+ }
732
+ static parseInline(e, t) {
733
+ return new l2(t).parseInline(e);
734
+ }
735
+ parse(e, t = true) {
736
+ let n = "";
737
+ for (let r = 0; r < e.length; r++) {
738
+ let i = e[r];
739
+ if (this.options.extensions?.renderers?.[i.type]) {
740
+ let o = i, a = this.options.extensions.renderers[o.type].call({ parser: this }, o);
741
+ if (a !== false || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "def", "paragraph", "text"].includes(o.type)) {
742
+ n += a || "";
743
+ continue;
744
+ }
745
+ }
746
+ let s = i;
747
+ switch (s.type) {
748
+ case "space": {
749
+ n += this.renderer.space(s);
750
+ continue;
751
+ }
752
+ case "hr": {
753
+ n += this.renderer.hr(s);
754
+ continue;
755
+ }
756
+ case "heading": {
757
+ n += this.renderer.heading(s);
758
+ continue;
759
+ }
760
+ case "code": {
761
+ n += this.renderer.code(s);
762
+ continue;
763
+ }
764
+ case "table": {
765
+ n += this.renderer.table(s);
766
+ continue;
767
+ }
768
+ case "blockquote": {
769
+ n += this.renderer.blockquote(s);
770
+ continue;
771
+ }
772
+ case "list": {
773
+ n += this.renderer.list(s);
774
+ continue;
775
+ }
776
+ case "html": {
777
+ n += this.renderer.html(s);
778
+ continue;
779
+ }
780
+ case "def": {
781
+ n += this.renderer.def(s);
782
+ continue;
783
+ }
784
+ case "paragraph": {
785
+ n += this.renderer.paragraph(s);
786
+ continue;
787
+ }
788
+ case "text": {
789
+ let o = s, a = this.renderer.text(o);
790
+ for (; r + 1 < e.length && e[r + 1].type === "text"; ) o = e[++r], a += `
791
+ ` + this.renderer.text(o);
792
+ t ? n += this.renderer.paragraph({ type: "paragraph", raw: a, text: a, tokens: [{ type: "text", raw: a, text: a, escaped: true }] }) : n += a;
793
+ continue;
794
+ }
795
+ default: {
796
+ let o = 'Token with "' + s.type + '" type was not found.';
797
+ if (this.options.silent) return console.error(o), "";
798
+ throw new Error(o);
799
+ }
800
+ }
801
+ }
802
+ return n;
803
+ }
804
+ parseInline(e, t = this.renderer) {
805
+ let n = "";
806
+ for (let r = 0; r < e.length; r++) {
807
+ let i = e[r];
808
+ if (this.options.extensions?.renderers?.[i.type]) {
809
+ let o = this.options.extensions.renderers[i.type].call({ parser: this }, i);
810
+ if (o !== false || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(i.type)) {
811
+ n += o || "";
812
+ continue;
813
+ }
814
+ }
815
+ let s = i;
816
+ switch (s.type) {
817
+ case "escape": {
818
+ n += t.text(s);
819
+ break;
820
+ }
821
+ case "html": {
822
+ n += t.html(s);
823
+ break;
824
+ }
825
+ case "link": {
826
+ n += t.link(s);
827
+ break;
828
+ }
829
+ case "image": {
830
+ n += t.image(s);
831
+ break;
832
+ }
833
+ case "strong": {
834
+ n += t.strong(s);
835
+ break;
836
+ }
837
+ case "em": {
838
+ n += t.em(s);
839
+ break;
840
+ }
841
+ case "codespan": {
842
+ n += t.codespan(s);
843
+ break;
844
+ }
845
+ case "br": {
846
+ n += t.br(s);
847
+ break;
848
+ }
849
+ case "del": {
850
+ n += t.del(s);
851
+ break;
852
+ }
853
+ case "text": {
854
+ n += t.text(s);
855
+ break;
856
+ }
857
+ default: {
858
+ let o = 'Token with "' + s.type + '" type was not found.';
859
+ if (this.options.silent) return console.error(o), "";
860
+ throw new Error(o);
861
+ }
862
+ }
863
+ }
864
+ return n;
865
+ }
866
+ };
867
+ var $ = class {
868
+ options;
869
+ block;
870
+ constructor(e) {
871
+ this.options = e || O;
872
+ }
873
+ static passThroughHooks = /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens"]);
874
+ preprocess(e) {
875
+ return e;
876
+ }
877
+ postprocess(e) {
878
+ return e;
879
+ }
880
+ processAllTokens(e) {
881
+ return e;
882
+ }
883
+ provideLexer() {
884
+ return this.block ? b.lex : b.lexInline;
885
+ }
886
+ provideParser() {
887
+ return this.block ? R.parse : R.parseInline;
888
+ }
889
+ };
890
+ var B = class {
891
+ defaults = L();
892
+ options = this.setOptions;
893
+ parse = this.parseMarkdown(true);
894
+ parseInline = this.parseMarkdown(false);
895
+ Parser = R;
896
+ Renderer = P;
897
+ TextRenderer = S;
898
+ Lexer = b;
899
+ Tokenizer = y;
900
+ Hooks = $;
901
+ constructor(...e) {
902
+ this.use(...e);
903
+ }
904
+ walkTokens(e, t) {
905
+ let n = [];
906
+ for (let r of e) switch (n = n.concat(t.call(this, r)), r.type) {
907
+ case "table": {
908
+ let i = r;
909
+ for (let s of i.header) n = n.concat(this.walkTokens(s.tokens, t));
910
+ for (let s of i.rows) for (let o of s) n = n.concat(this.walkTokens(o.tokens, t));
911
+ break;
912
+ }
913
+ case "list": {
914
+ let i = r;
915
+ n = n.concat(this.walkTokens(i.items, t));
916
+ break;
917
+ }
918
+ default: {
919
+ let i = r;
920
+ this.defaults.extensions?.childTokens?.[i.type] ? this.defaults.extensions.childTokens[i.type].forEach((s) => {
921
+ let o = i[s].flat(1 / 0);
922
+ n = n.concat(this.walkTokens(o, t));
923
+ }) : i.tokens && (n = n.concat(this.walkTokens(i.tokens, t)));
924
+ }
925
+ }
926
+ return n;
927
+ }
928
+ use(...e) {
929
+ let t = this.defaults.extensions || { renderers: {}, childTokens: {} };
930
+ return e.forEach((n) => {
931
+ let r = { ...n };
932
+ if (r.async = this.defaults.async || r.async || false, n.extensions && (n.extensions.forEach((i) => {
933
+ if (!i.name) throw new Error("extension name required");
934
+ if ("renderer" in i) {
935
+ let s = t.renderers[i.name];
936
+ s ? t.renderers[i.name] = function(...o) {
937
+ let a = i.renderer.apply(this, o);
938
+ return a === false && (a = s.apply(this, o)), a;
939
+ } : t.renderers[i.name] = i.renderer;
940
+ }
941
+ if ("tokenizer" in i) {
942
+ if (!i.level || i.level !== "block" && i.level !== "inline") throw new Error("extension level must be 'block' or 'inline'");
943
+ let s = t[i.level];
944
+ s ? s.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]));
945
+ }
946
+ "childTokens" in i && i.childTokens && (t.childTokens[i.name] = i.childTokens);
947
+ }), r.extensions = t), n.renderer) {
948
+ let i = this.defaults.renderer || new P(this.defaults);
949
+ for (let s in n.renderer) {
950
+ if (!(s in i)) throw new Error(`renderer '${s}' does not exist`);
951
+ if (["options", "parser"].includes(s)) continue;
952
+ let o = s, a = n.renderer[o], u = i[o];
953
+ i[o] = (...p) => {
954
+ let c = a.apply(i, p);
955
+ return c === false && (c = u.apply(i, p)), c || "";
956
+ };
957
+ }
958
+ r.renderer = i;
959
+ }
960
+ if (n.tokenizer) {
961
+ let i = this.defaults.tokenizer || new y(this.defaults);
962
+ for (let s in n.tokenizer) {
963
+ if (!(s in i)) throw new Error(`tokenizer '${s}' does not exist`);
964
+ if (["options", "rules", "lexer"].includes(s)) continue;
965
+ let o = s, a = n.tokenizer[o], u = i[o];
966
+ i[o] = (...p) => {
967
+ let c = a.apply(i, p);
968
+ return c === false && (c = u.apply(i, p)), c;
969
+ };
970
+ }
971
+ r.tokenizer = i;
972
+ }
973
+ if (n.hooks) {
974
+ let i = this.defaults.hooks || new $();
975
+ for (let s in n.hooks) {
976
+ if (!(s in i)) throw new Error(`hook '${s}' does not exist`);
977
+ if (["options", "block"].includes(s)) continue;
978
+ let o = s, a = n.hooks[o], u = i[o];
979
+ $.passThroughHooks.has(s) ? i[o] = (p) => {
980
+ if (this.defaults.async) return Promise.resolve(a.call(i, p)).then((f) => u.call(i, f));
981
+ let c = a.call(i, p);
982
+ return u.call(i, c);
983
+ } : i[o] = (...p) => {
984
+ let c = a.apply(i, p);
985
+ return c === false && (c = u.apply(i, p)), c;
986
+ };
987
+ }
988
+ r.hooks = i;
989
+ }
990
+ if (n.walkTokens) {
991
+ let i = this.defaults.walkTokens, s = n.walkTokens;
992
+ r.walkTokens = function(o) {
993
+ let a = [];
994
+ return a.push(s.call(this, o)), i && (a = a.concat(i.call(this, o))), a;
995
+ };
996
+ }
997
+ this.defaults = { ...this.defaults, ...r };
998
+ }), this;
999
+ }
1000
+ setOptions(e) {
1001
+ return this.defaults = { ...this.defaults, ...e }, this;
1002
+ }
1003
+ lexer(e, t) {
1004
+ return b.lex(e, t ?? this.defaults);
1005
+ }
1006
+ parser(e, t) {
1007
+ return R.parse(e, t ?? this.defaults);
1008
+ }
1009
+ parseMarkdown(e) {
1010
+ return (n, r) => {
1011
+ let i = { ...r }, s = { ...this.defaults, ...i }, o = this.onError(!!s.silent, !!s.async);
1012
+ if (this.defaults.async === true && i.async === false) return o(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."));
1013
+ if (typeof n > "u" || n === null) return o(new Error("marked(): input parameter is undefined or null"));
1014
+ if (typeof n != "string") return o(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(n) + ", string expected"));
1015
+ s.hooks && (s.hooks.options = s, s.hooks.block = e);
1016
+ let a = s.hooks ? s.hooks.provideLexer() : e ? b.lex : b.lexInline, u = s.hooks ? s.hooks.provideParser() : e ? R.parse : R.parseInline;
1017
+ if (s.async) return Promise.resolve(s.hooks ? s.hooks.preprocess(n) : n).then((p) => a(p, s)).then((p) => s.hooks ? s.hooks.processAllTokens(p) : p).then((p) => s.walkTokens ? Promise.all(this.walkTokens(p, s.walkTokens)).then(() => p) : p).then((p) => u(p, s)).then((p) => s.hooks ? s.hooks.postprocess(p) : p).catch(o);
1018
+ try {
1019
+ s.hooks && (n = s.hooks.preprocess(n));
1020
+ let p = a(n, s);
1021
+ s.hooks && (p = s.hooks.processAllTokens(p)), s.walkTokens && this.walkTokens(p, s.walkTokens);
1022
+ let c = u(p, s);
1023
+ return s.hooks && (c = s.hooks.postprocess(c)), c;
1024
+ } catch (p) {
1025
+ return o(p);
1026
+ }
1027
+ };
1028
+ }
1029
+ onError(e, t) {
1030
+ return (n) => {
1031
+ if (n.message += `
1032
+ Please report this to https://github.com/markedjs/marked.`, e) {
1033
+ let r = "<p>An error occurred:</p><pre>" + w(n.message + "", true) + "</pre>";
1034
+ return t ? Promise.resolve(r) : r;
1035
+ }
1036
+ if (t) return Promise.reject(n);
1037
+ throw n;
1038
+ };
1039
+ }
1040
+ };
1041
+ var _ = new B();
1042
+ function d(l3, e) {
1043
+ return _.parse(l3, e);
1044
+ }
1045
+ d.options = d.setOptions = function(l3) {
1046
+ return _.setOptions(l3), d.defaults = _.defaults, H(d.defaults), d;
1047
+ };
1048
+ d.getDefaults = L;
1049
+ d.defaults = O;
1050
+ d.use = function(...l3) {
1051
+ return _.use(...l3), d.defaults = _.defaults, H(d.defaults), d;
1052
+ };
1053
+ d.walkTokens = function(l3, e) {
1054
+ return _.walkTokens(l3, e);
1055
+ };
1056
+ d.parseInline = _.parseInline;
1057
+ d.Parser = R;
1058
+ d.parser = R.parse;
1059
+ d.Renderer = P;
1060
+ d.TextRenderer = S;
1061
+ d.Lexer = b;
1062
+ d.lexer = b.lex;
1063
+ d.Tokenizer = y;
1064
+ d.Hooks = $;
1065
+ d.parse = d;
1066
+ d.options;
1067
+ d.setOptions;
1068
+ d.use;
1069
+ d.walkTokens;
1070
+ d.parseInline;
1071
+ R.parse;
1072
+ b.lex;
1073
+ export {
1074
+ $ as Hooks,
1075
+ b as Lexer,
1076
+ B as Marked,
1077
+ R as Parser,
1078
+ P as Renderer,
1079
+ S as TextRenderer,
1080
+ y as Tokenizer,
1081
+ O as defaults,
1082
+ L as getDefaults,
1083
+ d as marked
1084
+ };