@dotss/tictoccroc 0.3.2 → 0.4.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.
@@ -1,1009 +1,460 @@
1
- var Hn = Object.defineProperty;
2
- var Gn = (n, e, t) => e in n ? Hn(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
3
- var _ = (n, e, t) => Gn(n, typeof e != "symbol" ? e + "" : e, t);
4
- /*! @license DOMPurify 3.3.1 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.1/LICENSE */
5
- const {
6
- entries: hn,
7
- setPrototypeOf: Vt,
8
- isFrozen: Wn,
9
- getPrototypeOf: qn,
10
- getOwnPropertyDescriptor: Zn
11
- } = Object;
12
- let {
13
- freeze: z,
14
- seal: F,
15
- create: ht
16
- } = Object, {
17
- apply: ft,
18
- construct: gt
19
- } = typeof Reflect < "u" && Reflect;
20
- z || (z = function(e) {
21
- return e;
22
- });
23
- F || (F = function(e) {
24
- return e;
25
- });
26
- ft || (ft = function(e, t) {
27
- for (var r = arguments.length, s = new Array(r > 2 ? r - 2 : 0), a = 2; a < r; a++)
28
- s[a - 2] = arguments[a];
29
- return e.apply(t, s);
30
- });
31
- gt || (gt = function(e) {
32
- for (var t = arguments.length, r = new Array(t > 1 ? t - 1 : 0), s = 1; s < t; s++)
33
- r[s - 1] = arguments[s];
34
- return new e(...r);
35
- });
36
- const Me = $(Array.prototype.forEach), Yn = $(Array.prototype.lastIndexOf), Kt = $(Array.prototype.pop), xe = $(Array.prototype.push), jn = $(Array.prototype.splice), Ue = $(String.prototype.toLowerCase), lt = $(String.prototype.toString), at = $(String.prototype.match), Te = $(String.prototype.replace), Xn = $(String.prototype.indexOf), Qn = $(String.prototype.trim), B = $(Object.prototype.hasOwnProperty), M = $(RegExp.prototype.test), we = Vn(TypeError);
37
- function $(n) {
38
- return function(e) {
39
- e instanceof RegExp && (e.lastIndex = 0);
40
- for (var t = arguments.length, r = new Array(t > 1 ? t - 1 : 0), s = 1; s < t; s++)
41
- r[s - 1] = arguments[s];
42
- return ft(n, e, r);
43
- };
44
- }
45
- function Vn(n) {
46
- return function() {
47
- for (var e = arguments.length, t = new Array(e), r = 0; r < e; r++)
48
- t[r] = arguments[r];
49
- return gt(n, t);
50
- };
51
- }
52
- function b(n, e) {
53
- let t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : Ue;
54
- Vt && Vt(n, null);
55
- let r = e.length;
56
- for (; r--; ) {
57
- let s = e[r];
58
- if (typeof s == "string") {
59
- const a = t(s);
60
- a !== s && (Wn(e) || (e[r] = a), s = a);
61
- }
62
- n[s] = !0;
63
- }
64
- return n;
65
- }
66
- function Kn(n) {
67
- for (let e = 0; e < n.length; e++)
68
- B(n, e) || (n[e] = null);
69
- return n;
70
- }
71
- function Z(n) {
72
- const e = ht(null);
73
- for (const [t, r] of hn(n))
74
- B(n, t) && (Array.isArray(r) ? e[t] = Kn(r) : r && typeof r == "object" && r.constructor === Object ? e[t] = Z(r) : e[t] = r);
75
- return e;
76
- }
77
- function Ae(n, e) {
78
- for (; n !== null; ) {
79
- const r = Zn(n, e);
80
- if (r) {
81
- if (r.get)
82
- return $(r.get);
83
- if (typeof r.value == "function")
84
- return $(r.value);
85
- }
86
- n = qn(n);
87
- }
88
- function t() {
89
- return null;
90
- }
91
- return t;
92
- }
93
- const Jt = z(["a", "abbr", "acronym", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "decorator", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "element", "em", "fieldset", "figcaption", "figure", "font", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "marquee", "menu", "menuitem", "meter", "nav", "nobr", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "search", "section", "select", "shadow", "slot", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"]), ot = z(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "enterkeyhint", "exportparts", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "inputmode", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "part", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]), ct = z(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence"]), Jn = z(["animate", "color-profile", "cursor", "discard", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignobject", "hatch", "hatchpath", "mesh", "meshgradient", "meshpatch", "meshrow", "missing-glyph", "script", "set", "solidcolor", "unknown", "use"]), ut = z(["math", "menclose", "merror", "mfenced", "mfrac", "mglyph", "mi", "mlabeledtr", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mphantom", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msup", "msubsup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover", "mprescripts"]), er = z(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), en = z(["#text"]), tn = z(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "exportparts", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inert", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "part", "pattern", "placeholder", "playsinline", "popover", "popovertarget", "popovertargetaction", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "slot", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "wrap", "xmlns", "slot"]), pt = z(["accent-height", "accumulate", "additive", "alignment-baseline", "amplitude", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "exponent", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "intercept", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "mask-type", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "slope", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "tablevalues", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]), nn = z(["accent", "accentunder", "align", "bevelled", "close", "columnsalign", "columnlines", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lspace", "lquote", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns"]), ve = z(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), tr = F(/\{\{[\w\W]*|[\w\W]*\}\}/gm), nr = F(/<%[\w\W]*|[\w\W]*%>/gm), rr = F(/\$\{[\w\W]*/gm), sr = F(/^data-[\-\w.\u00B7-\uFFFF]+$/), ir = F(/^aria-[\-\w]+$/), fn = F(
94
- /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
95
- // eslint-disable-line no-useless-escape
96
- ), lr = F(/^(?:\w+script|data):/i), ar = F(
97
- /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
98
- // eslint-disable-line no-control-regex
99
- ), gn = F(/^html$/i), or = F(/^[a-z][.\w]*(-[.\w]+)+$/i);
100
- var rn = /* @__PURE__ */ Object.freeze({
101
- __proto__: null,
102
- ARIA_ATTR: ir,
103
- ATTR_WHITESPACE: ar,
104
- CUSTOM_ELEMENT: or,
105
- DATA_ATTR: sr,
106
- DOCTYPE_NAME: gn,
107
- ERB_EXPR: nr,
108
- IS_ALLOWED_URI: fn,
109
- IS_SCRIPT_OR_DATA: lr,
110
- MUSTACHE_EXPR: tr,
111
- TMPLIT_EXPR: rr
112
- });
113
- const _e = {
114
- element: 1,
115
- text: 3,
116
- // Deprecated
117
- progressingInstruction: 7,
118
- comment: 8,
119
- document: 9
120
- }, cr = function() {
121
- return typeof window > "u" ? null : window;
122
- }, ur = function(e, t) {
123
- if (typeof e != "object" || typeof e.createPolicy != "function")
124
- return null;
125
- let r = null;
126
- const s = "data-tt-policy-suffix";
127
- t && t.hasAttribute(s) && (r = t.getAttribute(s));
128
- const a = "dompurify" + (r ? "#" + r : "");
129
- try {
130
- return e.createPolicy(a, {
131
- createHTML(o) {
132
- return o;
133
- },
134
- createScriptURL(o) {
135
- return o;
136
- }
137
- });
138
- } catch {
139
- return console.warn("TrustedTypes policy " + a + " could not be created."), null;
140
- }
141
- }, sn = function() {
142
- return {
143
- afterSanitizeAttributes: [],
144
- afterSanitizeElements: [],
145
- afterSanitizeShadowDOM: [],
146
- beforeSanitizeAttributes: [],
147
- beforeSanitizeElements: [],
148
- beforeSanitizeShadowDOM: [],
149
- uponSanitizeAttribute: [],
150
- uponSanitizeElement: [],
151
- uponSanitizeShadowNode: []
152
- };
153
- };
154
- function dn() {
155
- let n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : cr();
156
- const e = (d) => dn(d);
157
- if (e.version = "3.3.1", e.removed = [], !n || !n.document || n.document.nodeType !== _e.document || !n.Element)
158
- return e.isSupported = !1, e;
159
- let {
160
- document: t
161
- } = n;
162
- const r = t, s = r.currentScript, {
163
- DocumentFragment: a,
164
- HTMLTemplateElement: o,
165
- Node: l,
166
- Element: h,
167
- NodeFilter: c,
168
- NamedNodeMap: f = n.NamedNodeMap || n.MozNamedAttrMap,
169
- HTMLFormElement: k,
170
- DOMParser: m,
171
- trustedTypes: p
172
- } = n, w = h.prototype, x = Ae(w, "cloneNode"), S = Ae(w, "remove"), V = Ae(w, "nextSibling"), le = Ae(w, "childNodes"), K = Ae(w, "parentNode");
173
- if (typeof o == "function") {
174
- const d = t.createElement("template");
175
- d.content && d.content.ownerDocument && (t = d.content.ownerDocument);
176
- }
177
- let I, J = "";
178
- const {
179
- implementation: ge,
180
- createNodeIterator: de,
181
- createDocumentFragment: ee,
182
- getElementsByTagName: Ln
183
- } = t, {
184
- importNode: In
185
- } = r;
186
- let P = sn();
187
- e.isSupported = typeof hn == "function" && typeof K == "function" && ge && ge.createHTMLDocument !== void 0;
188
- const {
189
- MUSTACHE_EXPR: qe,
190
- ERB_EXPR: Ze,
191
- TMPLIT_EXPR: Ye,
192
- DATA_ATTR: Dn,
193
- ARIA_ATTR: Cn,
194
- IS_SCRIPT_OR_DATA: On,
195
- ATTR_WHITESPACE: yt,
196
- CUSTOM_ELEMENT: Nn
197
- } = rn;
198
- let {
199
- IS_ALLOWED_URI: Lt
200
- } = rn, D = null;
201
- const It = b({}, [...Jt, ...ot, ...ct, ...ut, ...en]);
202
- let C = null;
203
- const Dt = b({}, [...tn, ...pt, ...nn, ...ve]);
204
- let R = Object.seal(ht(null, {
205
- tagNameCheck: {
206
- writable: !0,
207
- configurable: !1,
208
- enumerable: !0,
209
- value: null
210
- },
211
- attributeNameCheck: {
212
- writable: !0,
213
- configurable: !1,
214
- enumerable: !0,
215
- value: null
216
- },
217
- allowCustomizedBuiltInElements: {
218
- writable: !0,
219
- configurable: !1,
220
- enumerable: !0,
221
- value: !1
222
- }
223
- })), me = null, je = null;
224
- const ae = Object.seal(ht(null, {
225
- tagCheck: {
226
- writable: !0,
227
- configurable: !1,
228
- enumerable: !0,
229
- value: null
230
- },
231
- attributeCheck: {
232
- writable: !0,
233
- configurable: !1,
234
- enumerable: !0,
235
- value: null
236
- }
237
- }));
238
- let Ct = !0, Xe = !0, Ot = !1, Nt = !0, oe = !1, Le = !0, te = !1, Qe = !1, Ve = !1, ce = !1, Ie = !1, De = !1, Pt = !0, Mt = !1;
239
- const Pn = "user-content-";
240
- let Ke = !0, ke = !1, ue = {}, W = null;
241
- const Je = b({}, ["annotation-xml", "audio", "colgroup", "desc", "foreignobject", "head", "iframe", "math", "mi", "mn", "mo", "ms", "mtext", "noembed", "noframes", "noscript", "plaintext", "script", "style", "svg", "template", "thead", "title", "video", "xmp"]);
242
- let vt = null;
243
- const zt = b({}, ["audio", "video", "img", "source", "image", "track"]);
244
- let et = null;
245
- const $t = b({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), Ce = "http://www.w3.org/1998/Math/MathML", Oe = "http://www.w3.org/2000/svg", j = "http://www.w3.org/1999/xhtml";
246
- let pe = j, tt = !1, nt = null;
247
- const Mn = b({}, [Ce, Oe, j], lt);
248
- let Ne = b({}, ["mi", "mo", "mn", "ms", "mtext"]), Pe = b({}, ["annotation-xml"]);
249
- const vn = b({}, ["title", "style", "font", "a", "script"]);
250
- let be = null;
251
- const zn = ["application/xhtml+xml", "text/html"], $n = "text/html";
252
- let L = null, he = null;
253
- const Un = t.createElement("form"), Ut = function(i) {
254
- return i instanceof RegExp || i instanceof Function;
255
- }, rt = function() {
256
- let i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
257
- if (!(he && he === i)) {
258
- if ((!i || typeof i != "object") && (i = {}), i = Z(i), be = // eslint-disable-next-line unicorn/prefer-includes
259
- zn.indexOf(i.PARSER_MEDIA_TYPE) === -1 ? $n : i.PARSER_MEDIA_TYPE, L = be === "application/xhtml+xml" ? lt : Ue, D = B(i, "ALLOWED_TAGS") ? b({}, i.ALLOWED_TAGS, L) : It, C = B(i, "ALLOWED_ATTR") ? b({}, i.ALLOWED_ATTR, L) : Dt, nt = B(i, "ALLOWED_NAMESPACES") ? b({}, i.ALLOWED_NAMESPACES, lt) : Mn, et = B(i, "ADD_URI_SAFE_ATTR") ? b(Z($t), i.ADD_URI_SAFE_ATTR, L) : $t, vt = B(i, "ADD_DATA_URI_TAGS") ? b(Z(zt), i.ADD_DATA_URI_TAGS, L) : zt, W = B(i, "FORBID_CONTENTS") ? b({}, i.FORBID_CONTENTS, L) : Je, me = B(i, "FORBID_TAGS") ? b({}, i.FORBID_TAGS, L) : Z({}), je = B(i, "FORBID_ATTR") ? b({}, i.FORBID_ATTR, L) : Z({}), ue = B(i, "USE_PROFILES") ? i.USE_PROFILES : !1, Ct = i.ALLOW_ARIA_ATTR !== !1, Xe = i.ALLOW_DATA_ATTR !== !1, Ot = i.ALLOW_UNKNOWN_PROTOCOLS || !1, Nt = i.ALLOW_SELF_CLOSE_IN_ATTR !== !1, oe = i.SAFE_FOR_TEMPLATES || !1, Le = i.SAFE_FOR_XML !== !1, te = i.WHOLE_DOCUMENT || !1, ce = i.RETURN_DOM || !1, Ie = i.RETURN_DOM_FRAGMENT || !1, De = i.RETURN_TRUSTED_TYPE || !1, Ve = i.FORCE_BODY || !1, Pt = i.SANITIZE_DOM !== !1, Mt = i.SANITIZE_NAMED_PROPS || !1, Ke = i.KEEP_CONTENT !== !1, ke = i.IN_PLACE || !1, Lt = i.ALLOWED_URI_REGEXP || fn, pe = i.NAMESPACE || j, Ne = i.MATHML_TEXT_INTEGRATION_POINTS || Ne, Pe = i.HTML_INTEGRATION_POINTS || Pe, R = i.CUSTOM_ELEMENT_HANDLING || {}, i.CUSTOM_ELEMENT_HANDLING && Ut(i.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (R.tagNameCheck = i.CUSTOM_ELEMENT_HANDLING.tagNameCheck), i.CUSTOM_ELEMENT_HANDLING && Ut(i.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (R.attributeNameCheck = i.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), i.CUSTOM_ELEMENT_HANDLING && typeof i.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (R.allowCustomizedBuiltInElements = i.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), oe && (Xe = !1), Ie && (ce = !0), ue && (D = b({}, en), C = [], ue.html === !0 && (b(D, Jt), b(C, tn)), ue.svg === !0 && (b(D, ot), b(C, pt), b(C, ve)), ue.svgFilters === !0 && (b(D, ct), b(C, pt), b(C, ve)), ue.mathMl === !0 && (b(D, ut), b(C, nn), b(C, ve))), i.ADD_TAGS && (typeof i.ADD_TAGS == "function" ? ae.tagCheck = i.ADD_TAGS : (D === It && (D = Z(D)), b(D, i.ADD_TAGS, L))), i.ADD_ATTR && (typeof i.ADD_ATTR == "function" ? ae.attributeCheck = i.ADD_ATTR : (C === Dt && (C = Z(C)), b(C, i.ADD_ATTR, L))), i.ADD_URI_SAFE_ATTR && b(et, i.ADD_URI_SAFE_ATTR, L), i.FORBID_CONTENTS && (W === Je && (W = Z(W)), b(W, i.FORBID_CONTENTS, L)), i.ADD_FORBID_CONTENTS && (W === Je && (W = Z(W)), b(W, i.ADD_FORBID_CONTENTS, L)), Ke && (D["#text"] = !0), te && b(D, ["html", "head", "body"]), D.table && (b(D, ["tbody"]), delete me.tbody), i.TRUSTED_TYPES_POLICY) {
260
- if (typeof i.TRUSTED_TYPES_POLICY.createHTML != "function")
261
- throw we('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
262
- if (typeof i.TRUSTED_TYPES_POLICY.createScriptURL != "function")
263
- throw we('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
264
- I = i.TRUSTED_TYPES_POLICY, J = I.createHTML("");
265
- } else
266
- I === void 0 && (I = ur(p, s)), I !== null && typeof J == "string" && (J = I.createHTML(""));
267
- z && z(i), he = i;
268
- }
269
- }, Ft = b({}, [...ot, ...ct, ...Jn]), Bt = b({}, [...ut, ...er]), Fn = function(i) {
270
- let u = K(i);
271
- (!u || !u.tagName) && (u = {
272
- namespaceURI: pe,
273
- tagName: "template"
274
- });
275
- const g = Ue(i.tagName), E = Ue(u.tagName);
276
- return nt[i.namespaceURI] ? i.namespaceURI === Oe ? u.namespaceURI === j ? g === "svg" : u.namespaceURI === Ce ? g === "svg" && (E === "annotation-xml" || Ne[E]) : !!Ft[g] : i.namespaceURI === Ce ? u.namespaceURI === j ? g === "math" : u.namespaceURI === Oe ? g === "math" && Pe[E] : !!Bt[g] : i.namespaceURI === j ? u.namespaceURI === Oe && !Pe[E] || u.namespaceURI === Ce && !Ne[E] ? !1 : !Bt[g] && (vn[g] || !Ft[g]) : !!(be === "application/xhtml+xml" && nt[i.namespaceURI]) : !1;
277
- }, q = function(i) {
278
- xe(e.removed, {
279
- element: i
280
- });
281
- try {
282
- K(i).removeChild(i);
283
- } catch {
284
- S(i);
285
- }
286
- }, ne = function(i, u) {
287
- try {
288
- xe(e.removed, {
289
- attribute: u.getAttributeNode(i),
290
- from: u
291
- });
292
- } catch {
293
- xe(e.removed, {
294
- attribute: null,
295
- from: u
296
- });
297
- }
298
- if (u.removeAttribute(i), i === "is")
299
- if (ce || Ie)
300
- try {
301
- q(u);
302
- } catch {
303
- }
304
- else
305
- try {
306
- u.setAttribute(i, "");
307
- } catch {
308
- }
309
- }, Ht = function(i) {
310
- let u = null, g = null;
311
- if (Ve)
312
- i = "<remove></remove>" + i;
313
- else {
314
- const y = at(i, /^[\r\n\t ]+/);
315
- g = y && y[0];
316
- }
317
- be === "application/xhtml+xml" && pe === j && (i = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + i + "</body></html>");
318
- const E = I ? I.createHTML(i) : i;
319
- if (pe === j)
320
- try {
321
- u = new m().parseFromString(E, be);
322
- } catch {
323
- }
324
- if (!u || !u.documentElement) {
325
- u = ge.createDocument(pe, "template", null);
326
- try {
327
- u.documentElement.innerHTML = tt ? J : E;
328
- } catch {
329
- }
330
- }
331
- const N = u.body || u.documentElement;
332
- return i && g && N.insertBefore(t.createTextNode(g), N.childNodes[0] || null), pe === j ? Ln.call(u, te ? "html" : "body")[0] : te ? u.documentElement : N;
333
- }, Gt = function(i) {
334
- return de.call(
335
- i.ownerDocument || i,
336
- i,
337
- // eslint-disable-next-line no-bitwise
338
- c.SHOW_ELEMENT | c.SHOW_COMMENT | c.SHOW_TEXT | c.SHOW_PROCESSING_INSTRUCTION | c.SHOW_CDATA_SECTION,
339
- null
340
- );
341
- }, st = function(i) {
342
- return i instanceof k && (typeof i.nodeName != "string" || typeof i.textContent != "string" || typeof i.removeChild != "function" || !(i.attributes instanceof f) || typeof i.removeAttribute != "function" || typeof i.setAttribute != "function" || typeof i.namespaceURI != "string" || typeof i.insertBefore != "function" || typeof i.hasChildNodes != "function");
343
- }, Wt = function(i) {
344
- return typeof l == "function" && i instanceof l;
345
- };
346
- function X(d, i, u) {
347
- Me(d, (g) => {
348
- g.call(e, i, u, he);
349
- });
350
- }
351
- const qt = function(i) {
352
- let u = null;
353
- if (X(P.beforeSanitizeElements, i, null), st(i))
354
- return q(i), !0;
355
- const g = L(i.nodeName);
356
- if (X(P.uponSanitizeElement, i, {
357
- tagName: g,
358
- allowedTags: D
359
- }), Le && i.hasChildNodes() && !Wt(i.firstElementChild) && M(/<[/\w!]/g, i.innerHTML) && M(/<[/\w!]/g, i.textContent) || i.nodeType === _e.progressingInstruction || Le && i.nodeType === _e.comment && M(/<[/\w]/g, i.data))
360
- return q(i), !0;
361
- if (!(ae.tagCheck instanceof Function && ae.tagCheck(g)) && (!D[g] || me[g])) {
362
- if (!me[g] && Yt(g) && (R.tagNameCheck instanceof RegExp && M(R.tagNameCheck, g) || R.tagNameCheck instanceof Function && R.tagNameCheck(g)))
363
- return !1;
364
- if (Ke && !W[g]) {
365
- const E = K(i) || i.parentNode, N = le(i) || i.childNodes;
366
- if (N && E) {
367
- const y = N.length;
368
- for (let U = y - 1; U >= 0; --U) {
369
- const Q = x(N[U], !0);
370
- Q.__removalCount = (i.__removalCount || 0) + 1, E.insertBefore(Q, V(i));
371
- }
372
- }
373
- }
374
- return q(i), !0;
375
- }
376
- return i instanceof h && !Fn(i) || (g === "noscript" || g === "noembed" || g === "noframes") && M(/<\/no(script|embed|frames)/i, i.innerHTML) ? (q(i), !0) : (oe && i.nodeType === _e.text && (u = i.textContent, Me([qe, Ze, Ye], (E) => {
377
- u = Te(u, E, " ");
378
- }), i.textContent !== u && (xe(e.removed, {
379
- element: i.cloneNode()
380
- }), i.textContent = u)), X(P.afterSanitizeElements, i, null), !1);
381
- }, Zt = function(i, u, g) {
382
- if (Pt && (u === "id" || u === "name") && (g in t || g in Un))
383
- return !1;
384
- if (!(Xe && !je[u] && M(Dn, u))) {
385
- if (!(Ct && M(Cn, u))) {
386
- if (!(ae.attributeCheck instanceof Function && ae.attributeCheck(u, i))) {
387
- if (!C[u] || je[u]) {
388
- if (
389
- // First condition does a very basic check if a) it's basically a valid custom element tagname AND
390
- // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
391
- // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
392
- !(Yt(i) && (R.tagNameCheck instanceof RegExp && M(R.tagNameCheck, i) || R.tagNameCheck instanceof Function && R.tagNameCheck(i)) && (R.attributeNameCheck instanceof RegExp && M(R.attributeNameCheck, u) || R.attributeNameCheck instanceof Function && R.attributeNameCheck(u, i)) || // Alternative, second condition checks if it's an `is`-attribute, AND
393
- // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
394
- u === "is" && R.allowCustomizedBuiltInElements && (R.tagNameCheck instanceof RegExp && M(R.tagNameCheck, g) || R.tagNameCheck instanceof Function && R.tagNameCheck(g)))
395
- ) return !1;
396
- } else if (!et[u]) {
397
- if (!M(Lt, Te(g, yt, ""))) {
398
- if (!((u === "src" || u === "xlink:href" || u === "href") && i !== "script" && Xn(g, "data:") === 0 && vt[i])) {
399
- if (!(Ot && !M(On, Te(g, yt, "")))) {
400
- if (g)
401
- return !1;
402
- }
403
- }
404
- }
405
- }
406
- }
407
- }
408
- }
409
- return !0;
410
- }, Yt = function(i) {
411
- return i !== "annotation-xml" && at(i, Nn);
412
- }, jt = function(i) {
413
- X(P.beforeSanitizeAttributes, i, null);
414
- const {
415
- attributes: u
416
- } = i;
417
- if (!u || st(i))
418
- return;
419
- const g = {
420
- attrName: "",
421
- attrValue: "",
422
- keepAttr: !0,
423
- allowedAttributes: C,
424
- forceKeepAttr: void 0
425
- };
426
- let E = u.length;
427
- for (; E--; ) {
428
- const N = u[E], {
429
- name: y,
430
- namespaceURI: U,
431
- value: Q
432
- } = N, fe = L(y), it = Q;
433
- let O = y === "value" ? it : Qn(it);
434
- if (g.attrName = fe, g.attrValue = O, g.keepAttr = !0, g.forceKeepAttr = void 0, X(P.uponSanitizeAttribute, i, g), O = g.attrValue, Mt && (fe === "id" || fe === "name") && (ne(y, i), O = Pn + O), Le && M(/((--!?|])>)|<\/(style|title|textarea)/i, O)) {
435
- ne(y, i);
436
- continue;
437
- }
438
- if (fe === "attributename" && at(O, "href")) {
439
- ne(y, i);
440
- continue;
441
- }
442
- if (g.forceKeepAttr)
443
- continue;
444
- if (!g.keepAttr) {
445
- ne(y, i);
446
- continue;
447
- }
448
- if (!Nt && M(/\/>/i, O)) {
449
- ne(y, i);
450
- continue;
451
- }
452
- oe && Me([qe, Ze, Ye], (Qt) => {
453
- O = Te(O, Qt, " ");
454
- });
455
- const Xt = L(i.nodeName);
456
- if (!Zt(Xt, fe, O)) {
457
- ne(y, i);
458
- continue;
459
- }
460
- if (I && typeof p == "object" && typeof p.getAttributeType == "function" && !U)
461
- switch (p.getAttributeType(Xt, fe)) {
462
- case "TrustedHTML": {
463
- O = I.createHTML(O);
464
- break;
465
- }
466
- case "TrustedScriptURL": {
467
- O = I.createScriptURL(O);
468
- break;
469
- }
470
- }
471
- if (O !== it)
472
- try {
473
- U ? i.setAttributeNS(U, y, O) : i.setAttribute(y, O), st(i) ? q(i) : Kt(e.removed);
474
- } catch {
475
- ne(y, i);
476
- }
477
- }
478
- X(P.afterSanitizeAttributes, i, null);
479
- }, Bn = function d(i) {
480
- let u = null;
481
- const g = Gt(i);
482
- for (X(P.beforeSanitizeShadowDOM, i, null); u = g.nextNode(); )
483
- X(P.uponSanitizeShadowNode, u, null), qt(u), jt(u), u.content instanceof a && d(u.content);
484
- X(P.afterSanitizeShadowDOM, i, null);
485
- };
486
- return e.sanitize = function(d) {
487
- let i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, u = null, g = null, E = null, N = null;
488
- if (tt = !d, tt && (d = "<!-->"), typeof d != "string" && !Wt(d))
489
- if (typeof d.toString == "function") {
490
- if (d = d.toString(), typeof d != "string")
491
- throw we("dirty is not a string, aborting");
492
- } else
493
- throw we("toString is not a function");
494
- if (!e.isSupported)
495
- return d;
496
- if (Qe || rt(i), e.removed = [], typeof d == "string" && (ke = !1), ke) {
497
- if (d.nodeName) {
498
- const Q = L(d.nodeName);
499
- if (!D[Q] || me[Q])
500
- throw we("root node is forbidden and cannot be sanitized in-place");
501
- }
502
- } else if (d instanceof l)
503
- u = Ht("<!---->"), g = u.ownerDocument.importNode(d, !0), g.nodeType === _e.element && g.nodeName === "BODY" || g.nodeName === "HTML" ? u = g : u.appendChild(g);
504
- else {
505
- if (!ce && !oe && !te && // eslint-disable-next-line unicorn/prefer-includes
506
- d.indexOf("<") === -1)
507
- return I && De ? I.createHTML(d) : d;
508
- if (u = Ht(d), !u)
509
- return ce ? null : De ? J : "";
510
- }
511
- u && Ve && q(u.firstChild);
512
- const y = Gt(ke ? d : u);
513
- for (; E = y.nextNode(); )
514
- qt(E), jt(E), E.content instanceof a && Bn(E.content);
515
- if (ke)
516
- return d;
517
- if (ce) {
518
- if (Ie)
519
- for (N = ee.call(u.ownerDocument); u.firstChild; )
520
- N.appendChild(u.firstChild);
521
- else
522
- N = u;
523
- return (C.shadowroot || C.shadowrootmode) && (N = In.call(r, N, !0)), N;
524
- }
525
- let U = te ? u.outerHTML : u.innerHTML;
526
- return te && D["!doctype"] && u.ownerDocument && u.ownerDocument.doctype && u.ownerDocument.doctype.name && M(gn, u.ownerDocument.doctype.name) && (U = "<!DOCTYPE " + u.ownerDocument.doctype.name + `>
527
- ` + U), oe && Me([qe, Ze, Ye], (Q) => {
528
- U = Te(U, Q, " ");
529
- }), I && De ? I.createHTML(U) : U;
530
- }, e.setConfig = function() {
531
- let d = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
532
- rt(d), Qe = !0;
533
- }, e.clearConfig = function() {
534
- he = null, Qe = !1;
535
- }, e.isValidAttribute = function(d, i, u) {
536
- he || rt({});
537
- const g = L(d), E = L(i);
538
- return Zt(g, E, u);
539
- }, e.addHook = function(d, i) {
540
- typeof i == "function" && xe(P[d], i);
541
- }, e.removeHook = function(d, i) {
542
- if (i !== void 0) {
543
- const u = Yn(P[d], i);
544
- return u === -1 ? void 0 : jn(P[d], u, 1)[0];
545
- }
546
- return Kt(P[d]);
547
- }, e.removeHooks = function(d) {
548
- P[d] = [];
549
- }, e.removeAllHooks = function() {
550
- P = sn();
551
- }, e;
552
- }
553
- var pr = dn();
554
- function bt() {
1
+ var Se = Object.defineProperty;
2
+ var $e = (r, e, t) => e in r ? Se(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
3
+ var x = (r, e, t) => $e(r, typeof e != "symbol" ? e + "" : e, t);
4
+ import { p as Re } from "../../../../purify.es-BGaRrCfO.js";
5
+ function G() {
555
6
  return { async: !1, breaks: !1, extensions: null, gfm: !0, hooks: null, pedantic: !1, renderer: null, silent: !1, tokenizer: null, walkTokens: null };
556
7
  }
557
- var ie = bt();
558
- function mn(n) {
559
- ie = n;
8
+ var z = G();
9
+ function oe(r) {
10
+ z = r;
560
11
  }
561
- var re = { exec: () => null };
562
- function T(n, e = "") {
563
- let t = typeof n == "string" ? n : n.source, r = { replace: (s, a) => {
564
- let o = typeof a == "string" ? a : a.source;
565
- return o = o.replace(v.caret, "$1"), t = t.replace(s, o), r;
12
+ var R = { exec: () => null };
13
+ function f(r, e = "") {
14
+ let t = typeof r == "string" ? r : r.source, s = { replace: (n, i) => {
15
+ let a = typeof i == "string" ? i : i.source;
16
+ return a = a.replace(m.caret, "$1"), t = t.replace(n, a), s;
566
17
  }, getRegex: () => new RegExp(t, e) };
567
- return r;
18
+ return s;
568
19
  }
569
- var hr = (() => {
20
+ var Te = (() => {
570
21
  try {
571
22
  return !!new RegExp("(?<=1)(?<!1)");
572
23
  } catch {
573
24
  return !1;
574
25
  }
575
- })(), v = { 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, listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g, listIsTask: /^\[[ xX]\] +\S/, listReplaceTask: /^\[[ xX]\] +/, listTaskCheckbox: /\[[ 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: (n) => new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`), nextBulletRegex: (n) => new RegExp(`^ {0,${Math.min(3, n - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), hrRegex: (n) => new RegExp(`^ {0,${Math.min(3, n - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), fencesBeginRegex: (n) => new RegExp(`^ {0,${Math.min(3, n - 1)}}(?:\`\`\`|~~~)`), headingBeginRegex: (n) => new RegExp(`^ {0,${Math.min(3, n - 1)}}#`), htmlBeginRegex: (n) => new RegExp(`^ {0,${Math.min(3, n - 1)}}<(?:[a-z].*>|!--)`, "i"), blockquoteBeginRegex: (n) => new RegExp(`^ {0,${Math.min(3, n - 1)}}>`) }, fr = /^(?:[ \t]*(?:\n|$))+/, gr = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, dr = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, ye = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, mr = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, xt = / {0,3}(?:[*+-]|\d{1,9}[.)])/, kn = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, bn = T(kn).replace(/bull/g, xt).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(), kr = T(kn).replace(/bull/g, xt).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(), Tt = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, br = /^[^\n]+/, wt = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, xr = T(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", wt).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Tr = T(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, xt).getRegex(), Ge = "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", At = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, wr = T("^ {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", At).replace("tag", Ge).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), xn = T(Tt).replace("hr", ye).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[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Ge).getRegex(), Ar = T(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", xn).getRegex(), _t = { blockquote: Ar, code: gr, def: xr, fences: dr, heading: mr, hr: ye, html: wr, lheading: bn, list: Tr, newline: fr, paragraph: xn, table: re, text: br }, ln = T("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", ye).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[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Ge).getRegex(), _r = { ..._t, lheading: kr, table: ln, paragraph: T(Tt).replace("hr", ye).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", ln).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Ge).getRegex() }, Er = { ..._t, html: T(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", At).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: re, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: T(Tt).replace("hr", ye).replace("heading", ` *#{1,6} *[^
576
- ]`).replace("lheading", bn).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, Sr = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Rr = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, Tn = /^( {2,}|\\)\n(?!\s*$)/, yr = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, We = /[\p{P}\p{S}]/u, Et = /[\s\p{P}\p{S}]/u, wn = /[^\s\p{P}\p{S}]/u, Lr = T(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, Et).getRegex(), An = /(?!~)[\p{P}\p{S}]/u, Ir = /(?!~)[\s\p{P}\p{S}]/u, Dr = /(?:[^\s\p{P}\p{S}]|~)/u, _n = /(?![*_])[\p{P}\p{S}]/u, Cr = /(?![*_])[\s\p{P}\p{S}]/u, Or = /(?:[^\s\p{P}\p{S}]|[*_])/u, Nr = T(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", hr ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), En = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/, Pr = T(En, "u").replace(/punct/g, We).getRegex(), Mr = T(En, "u").replace(/punct/g, An).getRegex(), Sn = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", vr = T(Sn, "gu").replace(/notPunctSpace/g, wn).replace(/punctSpace/g, Et).replace(/punct/g, We).getRegex(), zr = T(Sn, "gu").replace(/notPunctSpace/g, Dr).replace(/punctSpace/g, Ir).replace(/punct/g, An).getRegex(), $r = T("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, wn).replace(/punctSpace/g, Et).replace(/punct/g, We).getRegex(), Ur = T(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, _n).getRegex(), Fr = "^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", Br = T(Fr, "gu").replace(/notPunctSpace/g, Or).replace(/punctSpace/g, Cr).replace(/punct/g, _n).getRegex(), Hr = T(/\\(punct)/, "gu").replace(/punct/g, We).getRegex(), Gr = T(/^<(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(), Wr = T(At).replace("(?:-->|$)", "-->").getRegex(), qr = T("^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", Wr).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), Fe = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/, Zr = T(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label", Fe).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), Rn = T(/^!?\[(label)\]\[(ref)\]/).replace("label", Fe).replace("ref", wt).getRegex(), yn = T(/^!?\[(ref)\](?:\[\])?/).replace("ref", wt).getRegex(), Yr = T("reflink|nolink(?!\\()", "g").replace("reflink", Rn).replace("nolink", yn).getRegex(), an = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, St = { _backpedal: re, anyPunctuation: Hr, autolink: Gr, blockSkip: Nr, br: Tn, code: Rr, del: re, delLDelim: re, delRDelim: re, emStrongLDelim: Pr, emStrongRDelimAst: vr, emStrongRDelimUnd: $r, escape: Sr, link: Zr, nolink: yn, punctuation: Lr, reflink: Rn, reflinkSearch: Yr, tag: qr, text: yr, url: re }, jr = { ...St, link: T(/^!?\[(label)\]\((.*?)\)/).replace("label", Fe).getRegex(), reflink: T(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", Fe).getRegex() }, dt = { ...St, emStrongRDelimAst: zr, emStrongLDelim: Mr, delLDelim: Ur, delRDelim: Br, url: T(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", an).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\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/, text: T(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", an).getRegex() }, Xr = { ...dt, br: T(Tn).replace("{2,}", "*").getRegex(), text: T(dt.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() }, ze = { normal: _t, gfm: _r, pedantic: Er }, Ee = { normal: St, gfm: dt, breaks: Xr, pedantic: jr }, Qr = { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" }, on = (n) => Qr[n];
577
- function Y(n, e) {
26
+ })(), 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, listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g, listIsTask: /^\[[ xX]\] +\S/, listReplaceTask: /^\[[ xX]\] +/, listTaskCheckbox: /\[[ 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: (r) => new RegExp(`^( {0,3}${r})((?:[ ][^\\n]*)?(?:\\n|$))`), nextBulletRegex: (r) => new RegExp(`^ {0,${Math.min(3, r - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), hrRegex: (r) => new RegExp(`^ {0,${Math.min(3, r - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), fencesBeginRegex: (r) => new RegExp(`^ {0,${Math.min(3, r - 1)}}(?:\`\`\`|~~~)`), headingBeginRegex: (r) => new RegExp(`^ {0,${Math.min(3, r - 1)}}#`), htmlBeginRegex: (r) => new RegExp(`^ {0,${Math.min(3, r - 1)}}<(?:[a-z].*>|!--)`, "i"), blockquoteBeginRegex: (r) => new RegExp(`^ {0,${Math.min(3, r - 1)}}>`) }, ze = /^(?:[ \t]*(?:\n|$))+/, Ae = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, _e = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, B = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, Pe = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, X = / {0,3}(?:[*+-]|\d{1,9}[.)])/, ce = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, he = f(ce).replace(/bull/g, X).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(), Ie = f(ce).replace(/bull/g, X).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]+)*)/, Le = /^[^\n]+/, W = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, Be = f(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", W).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Ce = f(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, X).getRegex(), M = "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]*?(?:-->|$))/, qe = f("^ {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", M).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), pe = f(F).replace("hr", B).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[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", M).getRegex(), ve = f(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", pe).getRegex(), J = { blockquote: ve, code: Ae, def: Be, fences: _e, heading: Pe, hr: B, html: qe, lheading: he, list: Ce, newline: ze, paragraph: pe, table: R, text: Le }, re = f("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", B).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[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", M).getRegex(), Ee = { ...J, lheading: Ie, table: re, paragraph: f(F).replace("hr", B).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[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", M).getRegex() }, Ze = { ...J, html: f(`^ *(?: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: R, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: f(F).replace("hr", B).replace("heading", ` *#{1,6} *[^
27
+ ]`).replace("lheading", he).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, De = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Me = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, ue = /^( {2,}|\\)\n(?!\s*$)/, Qe = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, Q = /[\p{P}\p{S}]/u, K = /[\s\p{P}\p{S}]/u, ge = /[^\s\p{P}\p{S}]/u, He = f(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, K).getRegex(), ke = /(?!~)[\p{P}\p{S}]/u, Ne = /(?!~)[\s\p{P}\p{S}]/u, Oe = /(?:[^\s\p{P}\p{S}]|~)/u, fe = /(?![*_])[\p{P}\p{S}]/u, je = /(?![*_])[\s\p{P}\p{S}]/u, Ge = /(?:[^\s\p{P}\p{S}]|[*_])/u, Xe = f(/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(), de = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/, Fe = f(de, "u").replace(/punct/g, Q).getRegex(), We = f(de, "u").replace(/punct/g, ke).getRegex(), xe = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", Ue = f(xe, "gu").replace(/notPunctSpace/g, ge).replace(/punctSpace/g, K).replace(/punct/g, Q).getRegex(), Je = f(xe, "gu").replace(/notPunctSpace/g, Oe).replace(/punctSpace/g, Ne).replace(/punct/g, ke).getRegex(), Ke = f("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, ge).replace(/punctSpace/g, K).replace(/punct/g, Q).getRegex(), Ve = f(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, fe).getRegex(), Ye = "^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", et = f(Ye, "gu").replace(/notPunctSpace/g, Ge).replace(/punctSpace/g, je).replace(/punct/g, fe).getRegex(), tt = f(/\\(punct)/, "gu").replace(/punct/g, Q).getRegex(), rt = f(/^<(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(), nt = f(U).replace("(?:-->|$)", "-->").getRegex(), st = f("^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", nt).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), E = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/, lt = f(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label", E).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), be = f(/^!?\[(label)\]\[(ref)\]/).replace("label", E).replace("ref", W).getRegex(), we = f(/^!?\[(ref)\](?:\[\])?/).replace("ref", W).getRegex(), it = f("reflink|nolink(?!\\()", "g").replace("reflink", be).replace("nolink", we).getRegex(), ne = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, V = { _backpedal: R, anyPunctuation: tt, autolink: rt, blockSkip: Xe, br: ue, code: Me, del: R, delLDelim: R, delRDelim: R, emStrongLDelim: Fe, emStrongRDelimAst: Ue, emStrongRDelimUnd: Ke, escape: De, link: lt, nolink: we, punctuation: He, reflink: be, reflinkSearch: it, tag: st, text: Qe, url: R }, at = { ...V, link: f(/^!?\[(label)\]\((.*?)\)/).replace("label", E).getRegex(), reflink: f(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", E).getRegex() }, N = { ...V, emStrongRDelimAst: Je, emStrongLDelim: We, delLDelim: Ve, delRDelim: et, url: f(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", ne).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\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/, text: f(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", ne).getRegex() }, ot = { ...N, br: f(ue).replace("{2,}", "*").getRegex(), text: f(N.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() }, q = { normal: J, gfm: Ee, pedantic: Ze }, P = { normal: V, gfm: N, breaks: ot, pedantic: at }, ct = { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" }, se = (r) => ct[r];
28
+ function $(r, e) {
578
29
  if (e) {
579
- if (v.escapeTest.test(n)) return n.replace(v.escapeReplace, on);
580
- } else if (v.escapeTestNoEncode.test(n)) return n.replace(v.escapeReplaceNoEncode, on);
581
- return n;
30
+ if (m.escapeTest.test(r)) return r.replace(m.escapeReplace, se);
31
+ } else if (m.escapeTestNoEncode.test(r)) return r.replace(m.escapeReplaceNoEncode, se);
32
+ return r;
582
33
  }
583
- function cn(n) {
34
+ function le(r) {
584
35
  try {
585
- n = encodeURI(n).replace(v.percentDecode, "%");
36
+ r = encodeURI(r).replace(m.percentDecode, "%");
586
37
  } catch {
587
38
  return null;
588
39
  }
589
- return n;
590
- }
591
- function un(n, e) {
592
- var a;
593
- let t = n.replace(v.findPipe, (o, l, h) => {
594
- let c = !1, f = l;
595
- for (; --f >= 0 && h[f] === "\\"; ) c = !c;
596
- return c ? "|" : " |";
597
- }), r = t.split(v.splitPipe), s = 0;
598
- if (r[0].trim() || r.shift(), r.length > 0 && !((a = r.at(-1)) != null && a.trim()) && r.pop(), e) if (r.length > e) r.splice(e);
599
- else for (; r.length < e; ) r.push("");
600
- for (; s < r.length; s++) r[s] = r[s].trim().replace(v.slashPipe, "|");
601
40
  return r;
602
41
  }
603
- function Se(n, e, t) {
604
- let r = n.length;
605
- if (r === 0) return "";
606
- let s = 0;
607
- for (; s < r && n.charAt(r - s - 1) === e; )
608
- s++;
609
- return n.slice(0, r - s);
42
+ function ie(r, e) {
43
+ var i;
44
+ let t = r.replace(m.findPipe, (a, l, h) => {
45
+ let o = !1, p = l;
46
+ for (; --p >= 0 && h[p] === "\\"; ) o = !o;
47
+ return o ? "|" : " |";
48
+ }), s = t.split(m.splitPipe), n = 0;
49
+ if (s[0].trim() || s.shift(), s.length > 0 && !((i = s.at(-1)) != null && i.trim()) && s.pop(), e) if (s.length > e) s.splice(e);
50
+ else for (; s.length < e; ) s.push("");
51
+ for (; n < s.length; n++) s[n] = s[n].trim().replace(m.slashPipe, "|");
52
+ return s;
53
+ }
54
+ function I(r, e, t) {
55
+ let s = r.length;
56
+ if (s === 0) return "";
57
+ let n = 0;
58
+ for (; n < s && r.charAt(s - n - 1) === e; )
59
+ n++;
60
+ return r.slice(0, s - n);
610
61
  }
611
- function Vr(n, e) {
612
- if (n.indexOf(e[1]) === -1) return -1;
62
+ function ht(r, e) {
63
+ if (r.indexOf(e[1]) === -1) return -1;
613
64
  let t = 0;
614
- for (let r = 0; r < n.length; r++) if (n[r] === "\\") r++;
615
- else if (n[r] === e[0]) t++;
616
- else if (n[r] === e[1] && (t--, t < 0)) return r;
65
+ for (let s = 0; s < r.length; s++) if (r[s] === "\\") s++;
66
+ else if (r[s] === e[0]) t++;
67
+ else if (r[s] === e[1] && (t--, t < 0)) return s;
617
68
  return t > 0 ? -2 : -1;
618
69
  }
619
- function Kr(n, e = 0) {
620
- let t = e, r = "";
621
- for (let s of n) if (s === " ") {
622
- let a = 4 - t % 4;
623
- r += " ".repeat(a), t += a;
624
- } else r += s, t++;
625
- return r;
70
+ function pt(r, e = 0) {
71
+ let t = e, s = "";
72
+ for (let n of r) if (n === " ") {
73
+ let i = 4 - t % 4;
74
+ s += " ".repeat(i), t += i;
75
+ } else s += n, t++;
76
+ return s;
626
77
  }
627
- function pn(n, e, t, r, s) {
628
- let a = e.href, o = e.title || null, l = n[1].replace(s.other.outputLinkReplace, "$1");
629
- r.state.inLink = !0;
630
- let h = { type: n[0].charAt(0) === "!" ? "image" : "link", raw: t, href: a, title: o, text: l, tokens: r.inlineTokens(l) };
631
- return r.state.inLink = !1, h;
78
+ function ae(r, e, t, s, n) {
79
+ let i = e.href, a = e.title || null, l = r[1].replace(n.other.outputLinkReplace, "$1");
80
+ s.state.inLink = !0;
81
+ let h = { type: r[0].charAt(0) === "!" ? "image" : "link", raw: t, href: i, title: a, text: l, tokens: s.inlineTokens(l) };
82
+ return s.state.inLink = !1, h;
632
83
  }
633
- function Jr(n, e, t) {
634
- let r = n.match(t.other.indentCodeCompensation);
635
- if (r === null) return e;
636
- let s = r[1];
84
+ function ut(r, e, t) {
85
+ let s = r.match(t.other.indentCodeCompensation);
86
+ if (s === null) return e;
87
+ let n = s[1];
637
88
  return e.split(`
638
- `).map((a) => {
639
- let o = a.match(t.other.beginningSpace);
640
- if (o === null) return a;
641
- let [l] = o;
642
- return l.length >= s.length ? a.slice(s.length) : a;
89
+ `).map((i) => {
90
+ let a = i.match(t.other.beginningSpace);
91
+ if (a === null) return i;
92
+ let [l] = a;
93
+ return l.length >= n.length ? i.slice(n.length) : i;
643
94
  }).join(`
644
95
  `);
645
96
  }
646
- var Be = class {
647
- constructor(n) {
648
- _(this, "options");
649
- _(this, "rules");
650
- _(this, "lexer");
651
- this.options = n || ie;
652
- }
653
- space(n) {
654
- let e = this.rules.block.newline.exec(n);
97
+ var Z = class {
98
+ constructor(r) {
99
+ x(this, "options");
100
+ x(this, "rules");
101
+ x(this, "lexer");
102
+ this.options = r || z;
103
+ }
104
+ space(r) {
105
+ let e = this.rules.block.newline.exec(r);
655
106
  if (e && e[0].length > 0) return { type: "space", raw: e[0] };
656
107
  }
657
- code(n) {
658
- let e = this.rules.block.code.exec(n);
108
+ code(r) {
109
+ let e = this.rules.block.code.exec(r);
659
110
  if (e) {
660
111
  let t = e[0].replace(this.rules.other.codeRemoveIndent, "");
661
- return { type: "code", raw: e[0], codeBlockStyle: "indented", text: this.options.pedantic ? t : Se(t, `
112
+ return { type: "code", raw: e[0], codeBlockStyle: "indented", text: this.options.pedantic ? t : I(t, `
662
113
  `) };
663
114
  }
664
115
  }
665
- fences(n) {
666
- let e = this.rules.block.fences.exec(n);
116
+ fences(r) {
117
+ let e = this.rules.block.fences.exec(r);
667
118
  if (e) {
668
- let t = e[0], r = Jr(t, e[3] || "", this.rules);
669
- return { type: "code", raw: t, lang: e[2] ? e[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : e[2], text: r };
119
+ let t = e[0], s = ut(t, e[3] || "", this.rules);
120
+ return { type: "code", raw: t, lang: e[2] ? e[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : e[2], text: s };
670
121
  }
671
122
  }
672
- heading(n) {
673
- let e = this.rules.block.heading.exec(n);
123
+ heading(r) {
124
+ let e = this.rules.block.heading.exec(r);
674
125
  if (e) {
675
126
  let t = e[2].trim();
676
127
  if (this.rules.other.endingHash.test(t)) {
677
- let r = Se(t, "#");
678
- (this.options.pedantic || !r || this.rules.other.endingSpaceChar.test(r)) && (t = r.trim());
128
+ let s = I(t, "#");
129
+ (this.options.pedantic || !s || this.rules.other.endingSpaceChar.test(s)) && (t = s.trim());
679
130
  }
680
131
  return { type: "heading", raw: e[0], depth: e[1].length, text: t, tokens: this.lexer.inline(t) };
681
132
  }
682
133
  }
683
- hr(n) {
684
- let e = this.rules.block.hr.exec(n);
685
- if (e) return { type: "hr", raw: Se(e[0], `
134
+ hr(r) {
135
+ let e = this.rules.block.hr.exec(r);
136
+ if (e) return { type: "hr", raw: I(e[0], `
686
137
  `) };
687
138
  }
688
- blockquote(n) {
689
- let e = this.rules.block.blockquote.exec(n);
139
+ blockquote(r) {
140
+ let e = this.rules.block.blockquote.exec(r);
690
141
  if (e) {
691
- let t = Se(e[0], `
142
+ let t = I(e[0], `
692
143
  `).split(`
693
- `), r = "", s = "", a = [];
144
+ `), s = "", n = "", i = [];
694
145
  for (; t.length > 0; ) {
695
- let o = !1, l = [], h;
696
- for (h = 0; h < t.length; h++) if (this.rules.other.blockquoteStart.test(t[h])) l.push(t[h]), o = !0;
697
- else if (!o) l.push(t[h]);
146
+ let a = !1, l = [], h;
147
+ for (h = 0; h < t.length; h++) if (this.rules.other.blockquoteStart.test(t[h])) l.push(t[h]), a = !0;
148
+ else if (!a) l.push(t[h]);
698
149
  else break;
699
150
  t = t.slice(h);
700
- let c = l.join(`
701
- `), f = c.replace(this.rules.other.blockquoteSetextReplace, `
151
+ let o = l.join(`
152
+ `), p = o.replace(this.rules.other.blockquoteSetextReplace, `
702
153
  $1`).replace(this.rules.other.blockquoteSetextReplace2, "");
703
- r = r ? `${r}
704
- ${c}` : c, s = s ? `${s}
705
- ${f}` : f;
706
- let k = this.lexer.state.top;
707
- if (this.lexer.state.top = !0, this.lexer.blockTokens(f, a, !0), this.lexer.state.top = k, t.length === 0) break;
708
- let m = a.at(-1);
709
- if ((m == null ? void 0 : m.type) === "code") break;
710
- if ((m == null ? void 0 : m.type) === "blockquote") {
711
- let p = m, w = p.raw + `
154
+ s = s ? `${s}
155
+ ${o}` : o, n = n ? `${n}
156
+ ${p}` : p;
157
+ let g = this.lexer.state.top;
158
+ if (this.lexer.state.top = !0, this.lexer.blockTokens(p, i, !0), this.lexer.state.top = g, t.length === 0) break;
159
+ let u = i.at(-1);
160
+ if ((u == null ? void 0 : u.type) === "code") break;
161
+ if ((u == null ? void 0 : u.type) === "blockquote") {
162
+ let c = u, b = c.raw + `
712
163
  ` + t.join(`
713
- `), x = this.blockquote(w);
714
- a[a.length - 1] = x, r = r.substring(0, r.length - p.raw.length) + x.raw, s = s.substring(0, s.length - p.text.length) + x.text;
164
+ `), k = this.blockquote(b);
165
+ i[i.length - 1] = k, s = s.substring(0, s.length - c.raw.length) + k.raw, n = n.substring(0, n.length - c.text.length) + k.text;
715
166
  break;
716
- } else if ((m == null ? void 0 : m.type) === "list") {
717
- let p = m, w = p.raw + `
167
+ } else if ((u == null ? void 0 : u.type) === "list") {
168
+ let c = u, b = c.raw + `
718
169
  ` + t.join(`
719
- `), x = this.list(w);
720
- a[a.length - 1] = x, r = r.substring(0, r.length - m.raw.length) + x.raw, s = s.substring(0, s.length - p.raw.length) + x.raw, t = w.substring(a.at(-1).raw.length).split(`
170
+ `), k = this.list(b);
171
+ i[i.length - 1] = k, s = s.substring(0, s.length - u.raw.length) + k.raw, n = n.substring(0, n.length - c.raw.length) + k.raw, t = b.substring(i.at(-1).raw.length).split(`
721
172
  `);
722
173
  continue;
723
174
  }
724
175
  }
725
- return { type: "blockquote", raw: r, tokens: a, text: s };
176
+ return { type: "blockquote", raw: s, tokens: i, text: n };
726
177
  }
727
178
  }
728
- list(n) {
729
- var t, r;
730
- let e = this.rules.block.list.exec(n);
179
+ list(r) {
180
+ var t, s;
181
+ let e = this.rules.block.list.exec(r);
731
182
  if (e) {
732
- let s = e[1].trim(), a = s.length > 1, o = { type: "list", raw: "", ordered: a, start: a ? +s.slice(0, -1) : "", loose: !1, items: [] };
733
- s = a ? `\\d{1,9}\\${s.slice(-1)}` : `\\${s}`, this.options.pedantic && (s = a ? s : "[*+-]");
734
- let l = this.rules.other.listItemRegex(s), h = !1;
735
- for (; n; ) {
736
- let f = !1, k = "", m = "";
737
- if (!(e = l.exec(n)) || this.rules.block.hr.test(n)) break;
738
- k = e[0], n = n.substring(k.length);
739
- let p = Kr(e[2].split(`
740
- `, 1)[0], e[1].length), w = n.split(`
741
- `, 1)[0], x = !p.trim(), S = 0;
742
- if (this.options.pedantic ? (S = 2, m = p.trimStart()) : x ? S = e[1].length + 1 : (S = p.search(this.rules.other.nonSpaceChar), S = S > 4 ? 1 : S, m = p.slice(S), S += e[1].length), x && this.rules.other.blankLine.test(w) && (k += w + `
743
- `, n = n.substring(w.length + 1), f = !0), !f) {
744
- let V = this.rules.other.nextBulletRegex(S), le = this.rules.other.hrRegex(S), K = this.rules.other.fencesBeginRegex(S), I = this.rules.other.headingBeginRegex(S), J = this.rules.other.htmlBeginRegex(S), ge = this.rules.other.blockquoteBeginRegex(S);
745
- for (; n; ) {
746
- let de = n.split(`
747
- `, 1)[0], ee;
748
- if (w = de, this.options.pedantic ? (w = w.replace(this.rules.other.listReplaceNesting, " "), ee = w) : ee = w.replace(this.rules.other.tabCharGlobal, " "), K.test(w) || I.test(w) || J.test(w) || ge.test(w) || V.test(w) || le.test(w)) break;
749
- if (ee.search(this.rules.other.nonSpaceChar) >= S || !w.trim()) m += `
750
- ` + ee.slice(S);
183
+ let n = e[1].trim(), i = n.length > 1, a = { type: "list", raw: "", ordered: i, start: i ? +n.slice(0, -1) : "", loose: !1, items: [] };
184
+ n = i ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = i ? n : "[*+-]");
185
+ let l = this.rules.other.listItemRegex(n), h = !1;
186
+ for (; r; ) {
187
+ let p = !1, g = "", u = "";
188
+ if (!(e = l.exec(r)) || this.rules.block.hr.test(r)) break;
189
+ g = e[0], r = r.substring(g.length);
190
+ let c = pt(e[2].split(`
191
+ `, 1)[0], e[1].length), b = r.split(`
192
+ `, 1)[0], k = !c.trim(), w = 0;
193
+ if (this.options.pedantic ? (w = 2, u = c.trimStart()) : k ? w = e[1].length + 1 : (w = c.search(this.rules.other.nonSpaceChar), w = w > 4 ? 1 : w, u = c.slice(w), w += e[1].length), k && this.rules.other.blankLine.test(b) && (g += b + `
194
+ `, r = r.substring(b.length + 1), p = !0), !p) {
195
+ let A = this.rules.other.nextBulletRegex(w), C = this.rules.other.hrRegex(w), ee = this.rules.other.fencesBeginRegex(w), te = this.rules.other.headingBeginRegex(w), me = this.rules.other.htmlBeginRegex(w), ye = this.rules.other.blockquoteBeginRegex(w);
196
+ for (; r; ) {
197
+ let H = r.split(`
198
+ `, 1)[0], _;
199
+ if (b = H, this.options.pedantic ? (b = b.replace(this.rules.other.listReplaceNesting, " "), _ = b) : _ = b.replace(this.rules.other.tabCharGlobal, " "), ee.test(b) || te.test(b) || me.test(b) || ye.test(b) || A.test(b) || C.test(b)) break;
200
+ if (_.search(this.rules.other.nonSpaceChar) >= w || !b.trim()) u += `
201
+ ` + _.slice(w);
751
202
  else {
752
- if (x || p.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || K.test(p) || I.test(p) || le.test(p)) break;
753
- m += `
754
- ` + w;
203
+ if (k || c.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || ee.test(c) || te.test(c) || C.test(c)) break;
204
+ u += `
205
+ ` + b;
755
206
  }
756
- x = !w.trim(), k += de + `
757
- `, n = n.substring(de.length + 1), p = ee.slice(S);
207
+ k = !b.trim(), g += H + `
208
+ `, r = r.substring(H.length + 1), c = _.slice(w);
758
209
  }
759
210
  }
760
- o.loose || (h ? o.loose = !0 : this.rules.other.doubleBlankLine.test(k) && (h = !0)), o.items.push({ type: "list_item", raw: k, task: !!this.options.gfm && this.rules.other.listIsTask.test(m), loose: !1, text: m, tokens: [] }), o.raw += k;
211
+ a.loose || (h ? a.loose = !0 : this.rules.other.doubleBlankLine.test(g) && (h = !0)), a.items.push({ type: "list_item", raw: g, task: !!this.options.gfm && this.rules.other.listIsTask.test(u), loose: !1, text: u, tokens: [] }), a.raw += g;
761
212
  }
762
- let c = o.items.at(-1);
763
- if (c) c.raw = c.raw.trimEnd(), c.text = c.text.trimEnd();
213
+ let o = a.items.at(-1);
214
+ if (o) o.raw = o.raw.trimEnd(), o.text = o.text.trimEnd();
764
215
  else return;
765
- o.raw = o.raw.trimEnd();
766
- for (let f of o.items) {
767
- if (this.lexer.state.top = !1, f.tokens = this.lexer.blockTokens(f.text, []), f.task) {
768
- if (f.text = f.text.replace(this.rules.other.listReplaceTask, ""), ((t = f.tokens[0]) == null ? void 0 : t.type) === "text" || ((r = f.tokens[0]) == null ? void 0 : r.type) === "paragraph") {
769
- f.tokens[0].raw = f.tokens[0].raw.replace(this.rules.other.listReplaceTask, ""), f.tokens[0].text = f.tokens[0].text.replace(this.rules.other.listReplaceTask, "");
770
- for (let m = this.lexer.inlineQueue.length - 1; m >= 0; m--) if (this.rules.other.listIsTask.test(this.lexer.inlineQueue[m].src)) {
771
- this.lexer.inlineQueue[m].src = this.lexer.inlineQueue[m].src.replace(this.rules.other.listReplaceTask, "");
216
+ a.raw = a.raw.trimEnd();
217
+ for (let p of a.items) {
218
+ if (this.lexer.state.top = !1, p.tokens = this.lexer.blockTokens(p.text, []), p.task) {
219
+ if (p.text = p.text.replace(this.rules.other.listReplaceTask, ""), ((t = p.tokens[0]) == null ? void 0 : t.type) === "text" || ((s = p.tokens[0]) == null ? void 0 : s.type) === "paragraph") {
220
+ p.tokens[0].raw = p.tokens[0].raw.replace(this.rules.other.listReplaceTask, ""), p.tokens[0].text = p.tokens[0].text.replace(this.rules.other.listReplaceTask, "");
221
+ for (let u = this.lexer.inlineQueue.length - 1; u >= 0; u--) if (this.rules.other.listIsTask.test(this.lexer.inlineQueue[u].src)) {
222
+ this.lexer.inlineQueue[u].src = this.lexer.inlineQueue[u].src.replace(this.rules.other.listReplaceTask, "");
772
223
  break;
773
224
  }
774
225
  }
775
- let k = this.rules.other.listTaskCheckbox.exec(f.raw);
776
- if (k) {
777
- let m = { type: "checkbox", raw: k[0] + " ", checked: k[0] !== "[ ]" };
778
- f.checked = m.checked, o.loose ? f.tokens[0] && ["paragraph", "text"].includes(f.tokens[0].type) && "tokens" in f.tokens[0] && f.tokens[0].tokens ? (f.tokens[0].raw = m.raw + f.tokens[0].raw, f.tokens[0].text = m.raw + f.tokens[0].text, f.tokens[0].tokens.unshift(m)) : f.tokens.unshift({ type: "paragraph", raw: m.raw, text: m.raw, tokens: [m] }) : f.tokens.unshift(m);
226
+ let g = this.rules.other.listTaskCheckbox.exec(p.raw);
227
+ if (g) {
228
+ let u = { type: "checkbox", raw: g[0] + " ", checked: g[0] !== "[ ]" };
229
+ p.checked = u.checked, a.loose ? p.tokens[0] && ["paragraph", "text"].includes(p.tokens[0].type) && "tokens" in p.tokens[0] && p.tokens[0].tokens ? (p.tokens[0].raw = u.raw + p.tokens[0].raw, p.tokens[0].text = u.raw + p.tokens[0].text, p.tokens[0].tokens.unshift(u)) : p.tokens.unshift({ type: "paragraph", raw: u.raw, text: u.raw, tokens: [u] }) : p.tokens.unshift(u);
779
230
  }
780
231
  }
781
- if (!o.loose) {
782
- let k = f.tokens.filter((p) => p.type === "space"), m = k.length > 0 && k.some((p) => this.rules.other.anyLine.test(p.raw));
783
- o.loose = m;
232
+ if (!a.loose) {
233
+ let g = p.tokens.filter((c) => c.type === "space"), u = g.length > 0 && g.some((c) => this.rules.other.anyLine.test(c.raw));
234
+ a.loose = u;
784
235
  }
785
236
  }
786
- if (o.loose) for (let f of o.items) {
787
- f.loose = !0;
788
- for (let k of f.tokens) k.type === "text" && (k.type = "paragraph");
237
+ if (a.loose) for (let p of a.items) {
238
+ p.loose = !0;
239
+ for (let g of p.tokens) g.type === "text" && (g.type = "paragraph");
789
240
  }
790
- return o;
241
+ return a;
791
242
  }
792
243
  }
793
- html(n) {
794
- let e = this.rules.block.html.exec(n);
244
+ html(r) {
245
+ let e = this.rules.block.html.exec(r);
795
246
  if (e) return { type: "html", block: !0, raw: e[0], pre: e[1] === "pre" || e[1] === "script" || e[1] === "style", text: e[0] };
796
247
  }
797
- def(n) {
798
- let e = this.rules.block.def.exec(n);
248
+ def(r) {
249
+ let e = this.rules.block.def.exec(r);
799
250
  if (e) {
800
- let t = e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal, " "), r = e[2] ? e[2].replace(this.rules.other.hrefBrackets, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "", s = e[3] ? e[3].substring(1, e[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : e[3];
801
- return { type: "def", tag: t, raw: e[0], href: r, title: s };
251
+ let t = e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal, " "), s = e[2] ? e[2].replace(this.rules.other.hrefBrackets, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "", n = e[3] ? e[3].substring(1, e[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : e[3];
252
+ return { type: "def", tag: t, raw: e[0], href: s, title: n };
802
253
  }
803
254
  }
804
- table(n) {
805
- var o;
806
- let e = this.rules.block.table.exec(n);
255
+ table(r) {
256
+ var a;
257
+ let e = this.rules.block.table.exec(r);
807
258
  if (!e || !this.rules.other.tableDelimiter.test(e[2])) return;
808
- let t = un(e[1]), r = e[2].replace(this.rules.other.tableAlignChars, "").split("|"), s = (o = e[3]) != null && o.trim() ? e[3].replace(this.rules.other.tableRowBlankLine, "").split(`
809
- `) : [], a = { type: "table", raw: e[0], header: [], align: [], rows: [] };
810
- if (t.length === r.length) {
811
- for (let l of r) this.rules.other.tableAlignRight.test(l) ? a.align.push("right") : this.rules.other.tableAlignCenter.test(l) ? a.align.push("center") : this.rules.other.tableAlignLeft.test(l) ? a.align.push("left") : a.align.push(null);
812
- for (let l = 0; l < t.length; l++) a.header.push({ text: t[l], tokens: this.lexer.inline(t[l]), header: !0, align: a.align[l] });
813
- for (let l of s) a.rows.push(un(l, a.header.length).map((h, c) => ({ text: h, tokens: this.lexer.inline(h), header: !1, align: a.align[c] })));
814
- return a;
259
+ let t = ie(e[1]), s = e[2].replace(this.rules.other.tableAlignChars, "").split("|"), n = (a = e[3]) != null && a.trim() ? e[3].replace(this.rules.other.tableRowBlankLine, "").split(`
260
+ `) : [], i = { type: "table", raw: e[0], header: [], align: [], rows: [] };
261
+ if (t.length === s.length) {
262
+ for (let l of s) this.rules.other.tableAlignRight.test(l) ? i.align.push("right") : this.rules.other.tableAlignCenter.test(l) ? i.align.push("center") : this.rules.other.tableAlignLeft.test(l) ? i.align.push("left") : i.align.push(null);
263
+ for (let l = 0; l < t.length; l++) i.header.push({ text: t[l], tokens: this.lexer.inline(t[l]), header: !0, align: i.align[l] });
264
+ for (let l of n) i.rows.push(ie(l, i.header.length).map((h, o) => ({ text: h, tokens: this.lexer.inline(h), header: !1, align: i.align[o] })));
265
+ return i;
815
266
  }
816
267
  }
817
- lheading(n) {
818
- let e = this.rules.block.lheading.exec(n);
268
+ lheading(r) {
269
+ let e = this.rules.block.lheading.exec(r);
819
270
  if (e) return { type: "heading", raw: e[0], depth: e[2].charAt(0) === "=" ? 1 : 2, text: e[1], tokens: this.lexer.inline(e[1]) };
820
271
  }
821
- paragraph(n) {
822
- let e = this.rules.block.paragraph.exec(n);
272
+ paragraph(r) {
273
+ let e = this.rules.block.paragraph.exec(r);
823
274
  if (e) {
824
275
  let t = e[1].charAt(e[1].length - 1) === `
825
276
  ` ? e[1].slice(0, -1) : e[1];
826
277
  return { type: "paragraph", raw: e[0], text: t, tokens: this.lexer.inline(t) };
827
278
  }
828
279
  }
829
- text(n) {
830
- let e = this.rules.block.text.exec(n);
280
+ text(r) {
281
+ let e = this.rules.block.text.exec(r);
831
282
  if (e) return { type: "text", raw: e[0], text: e[0], tokens: this.lexer.inline(e[0]) };
832
283
  }
833
- escape(n) {
834
- let e = this.rules.inline.escape.exec(n);
284
+ escape(r) {
285
+ let e = this.rules.inline.escape.exec(r);
835
286
  if (e) return { type: "escape", raw: e[0], text: e[1] };
836
287
  }
837
- tag(n) {
838
- let e = this.rules.inline.tag.exec(n);
288
+ tag(r) {
289
+ let e = this.rules.inline.tag.exec(r);
839
290
  if (e) return !this.lexer.state.inLink && this.rules.other.startATag.test(e[0]) ? this.lexer.state.inLink = !0 : this.lexer.state.inLink && this.rules.other.endATag.test(e[0]) && (this.lexer.state.inLink = !1), !this.lexer.state.inRawBlock && this.rules.other.startPreScriptTag.test(e[0]) ? this.lexer.state.inRawBlock = !0 : this.lexer.state.inRawBlock && this.rules.other.endPreScriptTag.test(e[0]) && (this.lexer.state.inRawBlock = !1), { type: "html", raw: e[0], inLink: this.lexer.state.inLink, inRawBlock: this.lexer.state.inRawBlock, block: !1, text: e[0] };
840
291
  }
841
- link(n) {
842
- let e = this.rules.inline.link.exec(n);
292
+ link(r) {
293
+ let e = this.rules.inline.link.exec(r);
843
294
  if (e) {
844
295
  let t = e[2].trim();
845
296
  if (!this.options.pedantic && this.rules.other.startAngleBracket.test(t)) {
846
297
  if (!this.rules.other.endAngleBracket.test(t)) return;
847
- let a = Se(t.slice(0, -1), "\\");
848
- if ((t.length - a.length) % 2 === 0) return;
298
+ let i = I(t.slice(0, -1), "\\");
299
+ if ((t.length - i.length) % 2 === 0) return;
849
300
  } else {
850
- let a = Vr(e[2], "()");
851
- if (a === -2) return;
852
- if (a > -1) {
853
- let o = (e[0].indexOf("!") === 0 ? 5 : 4) + e[1].length + a;
854
- e[2] = e[2].substring(0, a), e[0] = e[0].substring(0, o).trim(), e[3] = "";
301
+ let i = ht(e[2], "()");
302
+ if (i === -2) return;
303
+ if (i > -1) {
304
+ let a = (e[0].indexOf("!") === 0 ? 5 : 4) + e[1].length + i;
305
+ e[2] = e[2].substring(0, i), e[0] = e[0].substring(0, a).trim(), e[3] = "";
855
306
  }
856
307
  }
857
- let r = e[2], s = "";
308
+ let s = e[2], n = "";
858
309
  if (this.options.pedantic) {
859
- let a = this.rules.other.pedanticHrefTitle.exec(r);
860
- a && (r = a[1], s = a[3]);
861
- } else s = e[3] ? e[3].slice(1, -1) : "";
862
- return r = r.trim(), this.rules.other.startAngleBracket.test(r) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(t) ? r = r.slice(1) : r = r.slice(1, -1)), pn(e, { href: r && r.replace(this.rules.inline.anyPunctuation, "$1"), title: s && s.replace(this.rules.inline.anyPunctuation, "$1") }, e[0], this.lexer, this.rules);
310
+ let i = this.rules.other.pedanticHrefTitle.exec(s);
311
+ i && (s = i[1], n = i[3]);
312
+ } else n = e[3] ? e[3].slice(1, -1) : "";
313
+ return s = s.trim(), this.rules.other.startAngleBracket.test(s) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(t) ? s = s.slice(1) : s = s.slice(1, -1)), ae(e, { href: s && s.replace(this.rules.inline.anyPunctuation, "$1"), title: n && n.replace(this.rules.inline.anyPunctuation, "$1") }, e[0], this.lexer, this.rules);
863
314
  }
864
315
  }
865
- reflink(n, e) {
316
+ reflink(r, e) {
866
317
  let t;
867
- if ((t = this.rules.inline.reflink.exec(n)) || (t = this.rules.inline.nolink.exec(n))) {
868
- let r = (t[2] || t[1]).replace(this.rules.other.multipleSpaceGlobal, " "), s = e[r.toLowerCase()];
869
- if (!s) {
870
- let a = t[0].charAt(0);
871
- return { type: "text", raw: a, text: a };
318
+ if ((t = this.rules.inline.reflink.exec(r)) || (t = this.rules.inline.nolink.exec(r))) {
319
+ let s = (t[2] || t[1]).replace(this.rules.other.multipleSpaceGlobal, " "), n = e[s.toLowerCase()];
320
+ if (!n) {
321
+ let i = t[0].charAt(0);
322
+ return { type: "text", raw: i, text: i };
872
323
  }
873
- return pn(t, s, t[0], this.lexer, this.rules);
324
+ return ae(t, n, t[0], this.lexer, this.rules);
874
325
  }
875
326
  }
876
- emStrong(n, e, t = "") {
877
- let r = this.rules.inline.emStrongLDelim.exec(n);
878
- if (!(!r || r[3] && t.match(this.rules.other.unicodeAlphaNumeric)) && (!(r[1] || r[2]) || !t || this.rules.inline.punctuation.exec(t))) {
879
- let s = [...r[0]].length - 1, a, o, l = s, h = 0, c = r[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
880
- for (c.lastIndex = 0, e = e.slice(-1 * n.length + s); (r = c.exec(e)) != null; ) {
881
- if (a = r[1] || r[2] || r[3] || r[4] || r[5] || r[6], !a) continue;
882
- if (o = [...a].length, r[3] || r[4]) {
883
- l += o;
327
+ emStrong(r, e, t = "") {
328
+ let s = this.rules.inline.emStrongLDelim.exec(r);
329
+ if (!(!s || s[3] && t.match(this.rules.other.unicodeAlphaNumeric)) && (!(s[1] || s[2]) || !t || this.rules.inline.punctuation.exec(t))) {
330
+ let n = [...s[0]].length - 1, i, a, l = n, h = 0, o = s[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
331
+ for (o.lastIndex = 0, e = e.slice(-1 * r.length + n); (s = o.exec(e)) != null; ) {
332
+ if (i = s[1] || s[2] || s[3] || s[4] || s[5] || s[6], !i) continue;
333
+ if (a = [...i].length, s[3] || s[4]) {
334
+ l += a;
884
335
  continue;
885
- } else if ((r[5] || r[6]) && s % 3 && !((s + o) % 3)) {
886
- h += o;
336
+ } else if ((s[5] || s[6]) && n % 3 && !((n + a) % 3)) {
337
+ h += a;
887
338
  continue;
888
339
  }
889
- if (l -= o, l > 0) continue;
890
- o = Math.min(o, o + l + h);
891
- let f = [...r[0]][0].length, k = n.slice(0, s + r.index + f + o);
892
- if (Math.min(s, o) % 2) {
893
- let p = k.slice(1, -1);
894
- return { type: "em", raw: k, text: p, tokens: this.lexer.inlineTokens(p) };
340
+ if (l -= a, l > 0) continue;
341
+ a = Math.min(a, a + l + h);
342
+ let p = [...s[0]][0].length, g = r.slice(0, n + s.index + p + a);
343
+ if (Math.min(n, a) % 2) {
344
+ let c = g.slice(1, -1);
345
+ return { type: "em", raw: g, text: c, tokens: this.lexer.inlineTokens(c) };
895
346
  }
896
- let m = k.slice(2, -2);
897
- return { type: "strong", raw: k, text: m, tokens: this.lexer.inlineTokens(m) };
347
+ let u = g.slice(2, -2);
348
+ return { type: "strong", raw: g, text: u, tokens: this.lexer.inlineTokens(u) };
898
349
  }
899
350
  }
900
351
  }
901
- codespan(n) {
902
- let e = this.rules.inline.code.exec(n);
352
+ codespan(r) {
353
+ let e = this.rules.inline.code.exec(r);
903
354
  if (e) {
904
- let t = e[2].replace(this.rules.other.newLineCharGlobal, " "), r = this.rules.other.nonSpaceChar.test(t), s = this.rules.other.startingSpaceChar.test(t) && this.rules.other.endingSpaceChar.test(t);
905
- return r && s && (t = t.substring(1, t.length - 1)), { type: "codespan", raw: e[0], text: t };
355
+ let t = e[2].replace(this.rules.other.newLineCharGlobal, " "), s = this.rules.other.nonSpaceChar.test(t), n = this.rules.other.startingSpaceChar.test(t) && this.rules.other.endingSpaceChar.test(t);
356
+ return s && n && (t = t.substring(1, t.length - 1)), { type: "codespan", raw: e[0], text: t };
906
357
  }
907
358
  }
908
- br(n) {
909
- let e = this.rules.inline.br.exec(n);
359
+ br(r) {
360
+ let e = this.rules.inline.br.exec(r);
910
361
  if (e) return { type: "br", raw: e[0] };
911
362
  }
912
- del(n, e, t = "") {
913
- let r = this.rules.inline.delLDelim.exec(n);
914
- if (r && (!r[1] || !t || this.rules.inline.punctuation.exec(t))) {
915
- let s = [...r[0]].length - 1, a, o, l = s, h = this.rules.inline.delRDelim;
916
- for (h.lastIndex = 0, e = e.slice(-1 * n.length + s); (r = h.exec(e)) != null; ) {
917
- if (a = r[1] || r[2] || r[3] || r[4] || r[5] || r[6], !a || (o = [...a].length, o !== s)) continue;
918
- if (r[3] || r[4]) {
919
- l += o;
363
+ del(r, e, t = "") {
364
+ let s = this.rules.inline.delLDelim.exec(r);
365
+ if (s && (!s[1] || !t || this.rules.inline.punctuation.exec(t))) {
366
+ let n = [...s[0]].length - 1, i, a, l = n, h = this.rules.inline.delRDelim;
367
+ for (h.lastIndex = 0, e = e.slice(-1 * r.length + n); (s = h.exec(e)) != null; ) {
368
+ if (i = s[1] || s[2] || s[3] || s[4] || s[5] || s[6], !i || (a = [...i].length, a !== n)) continue;
369
+ if (s[3] || s[4]) {
370
+ l += a;
920
371
  continue;
921
372
  }
922
- if (l -= o, l > 0) continue;
923
- o = Math.min(o, o + l);
924
- let c = [...r[0]][0].length, f = n.slice(0, s + r.index + c + o), k = f.slice(s, -s);
925
- return { type: "del", raw: f, text: k, tokens: this.lexer.inlineTokens(k) };
373
+ if (l -= a, l > 0) continue;
374
+ a = Math.min(a, a + l);
375
+ let o = [...s[0]][0].length, p = r.slice(0, n + s.index + o + a), g = p.slice(n, -n);
376
+ return { type: "del", raw: p, text: g, tokens: this.lexer.inlineTokens(g) };
926
377
  }
927
378
  }
928
379
  }
929
- autolink(n) {
930
- let e = this.rules.inline.autolink.exec(n);
380
+ autolink(r) {
381
+ let e = this.rules.inline.autolink.exec(r);
931
382
  if (e) {
932
- let t, r;
933
- return e[2] === "@" ? (t = e[1], r = "mailto:" + t) : (t = e[1], r = t), { type: "link", raw: e[0], text: t, href: r, tokens: [{ type: "text", raw: t, text: t }] };
383
+ let t, s;
384
+ return e[2] === "@" ? (t = e[1], s = "mailto:" + t) : (t = e[1], s = t), { type: "link", raw: e[0], text: t, href: s, tokens: [{ type: "text", raw: t, text: t }] };
934
385
  }
935
386
  }
936
- url(n) {
387
+ url(r) {
937
388
  var t;
938
389
  let e;
939
- if (e = this.rules.inline.url.exec(n)) {
940
- let r, s;
941
- if (e[2] === "@") r = e[0], s = "mailto:" + r;
390
+ if (e = this.rules.inline.url.exec(r)) {
391
+ let s, n;
392
+ if (e[2] === "@") s = e[0], n = "mailto:" + s;
942
393
  else {
943
- let a;
394
+ let i;
944
395
  do
945
- a = e[0], e[0] = ((t = this.rules.inline._backpedal.exec(e[0])) == null ? void 0 : t[0]) ?? "";
946
- while (a !== e[0]);
947
- r = e[0], e[1] === "www." ? s = "http://" + e[0] : s = e[0];
396
+ i = e[0], e[0] = ((t = this.rules.inline._backpedal.exec(e[0])) == null ? void 0 : t[0]) ?? "";
397
+ while (i !== e[0]);
398
+ s = e[0], e[1] === "www." ? n = "http://" + e[0] : n = e[0];
948
399
  }
949
- return { type: "link", raw: e[0], text: r, href: s, tokens: [{ type: "text", raw: r, text: r }] };
400
+ return { type: "link", raw: e[0], text: s, href: n, tokens: [{ type: "text", raw: s, text: s }] };
950
401
  }
951
402
  }
952
- inlineText(n) {
953
- let e = this.rules.inline.text.exec(n);
403
+ inlineText(r) {
404
+ let e = this.rules.inline.text.exec(r);
954
405
  if (e) {
955
406
  let t = this.lexer.state.inRawBlock;
956
407
  return { type: "text", raw: e[0], text: e[0], escaped: t };
957
408
  }
958
409
  }
959
- }, H = class mt {
410
+ }, y = class O {
960
411
  constructor(e) {
961
- _(this, "tokens");
962
- _(this, "options");
963
- _(this, "state");
964
- _(this, "inlineQueue");
965
- _(this, "tokenizer");
966
- this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e || ie, this.options.tokenizer = this.options.tokenizer || new Be(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: !1, inRawBlock: !1, top: !0 };
967
- let t = { other: v, block: ze.normal, inline: Ee.normal };
968
- this.options.pedantic ? (t.block = ze.pedantic, t.inline = Ee.pedantic) : this.options.gfm && (t.block = ze.gfm, this.options.breaks ? t.inline = Ee.breaks : t.inline = Ee.gfm), this.tokenizer.rules = t;
412
+ x(this, "tokens");
413
+ x(this, "options");
414
+ x(this, "state");
415
+ x(this, "inlineQueue");
416
+ x(this, "tokenizer");
417
+ this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e || z, this.options.tokenizer = this.options.tokenizer || new Z(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: !1, inRawBlock: !1, top: !0 };
418
+ let t = { other: m, block: q.normal, inline: P.normal };
419
+ this.options.pedantic ? (t.block = q.pedantic, t.inline = P.pedantic) : this.options.gfm && (t.block = q.gfm, this.options.breaks ? t.inline = P.breaks : t.inline = P.gfm), this.tokenizer.rules = t;
969
420
  }
970
421
  static get rules() {
971
- return { block: ze, inline: Ee };
422
+ return { block: q, inline: P };
972
423
  }
973
424
  static lex(e, t) {
974
- return new mt(t).lex(e);
425
+ return new O(t).lex(e);
975
426
  }
976
427
  static lexInline(e, t) {
977
- return new mt(t).inlineTokens(e);
428
+ return new O(t).inlineTokens(e);
978
429
  }
979
430
  lex(e) {
980
- e = e.replace(v.carriageReturn, `
431
+ e = e.replace(m.carriageReturn, `
981
432
  `), this.blockTokens(e, this.tokens);
982
433
  for (let t = 0; t < this.inlineQueue.length; t++) {
983
- let r = this.inlineQueue[t];
984
- this.inlineTokens(r.src, r.tokens);
434
+ let s = this.inlineQueue[t];
435
+ this.inlineTokens(s.src, s.tokens);
985
436
  }
986
437
  return this.inlineQueue = [], this.tokens;
987
438
  }
988
- blockTokens(e, t = [], r = !1) {
989
- var s, a, o;
990
- for (this.options.pedantic && (e = e.replace(v.tabCharGlobal, " ").replace(v.spaceLine, "")); e; ) {
439
+ blockTokens(e, t = [], s = !1) {
440
+ var n, i, a;
441
+ for (this.options.pedantic && (e = e.replace(m.tabCharGlobal, " ").replace(m.spaceLine, "")); e; ) {
991
442
  let l;
992
- if ((a = (s = this.options.extensions) == null ? void 0 : s.block) != null && a.some((c) => (l = c.call({ lexer: this }, e, t)) ? (e = e.substring(l.raw.length), t.push(l), !0) : !1)) continue;
443
+ if ((i = (n = this.options.extensions) == null ? void 0 : n.block) != null && i.some((o) => (l = o.call({ lexer: this }, e, t)) ? (e = e.substring(l.raw.length), t.push(l), !0) : !1)) continue;
993
444
  if (l = this.tokenizer.space(e)) {
994
445
  e = e.substring(l.raw.length);
995
- let c = t.at(-1);
996
- l.raw.length === 1 && c !== void 0 ? c.raw += `
446
+ let o = t.at(-1);
447
+ l.raw.length === 1 && o !== void 0 ? o.raw += `
997
448
  ` : t.push(l);
998
449
  continue;
999
450
  }
1000
451
  if (l = this.tokenizer.code(e)) {
1001
452
  e = e.substring(l.raw.length);
1002
- let c = t.at(-1);
1003
- (c == null ? void 0 : c.type) === "paragraph" || (c == null ? void 0 : c.type) === "text" ? (c.raw += (c.raw.endsWith(`
453
+ let o = t.at(-1);
454
+ (o == null ? void 0 : o.type) === "paragraph" || (o == null ? void 0 : o.type) === "text" ? (o.raw += (o.raw.endsWith(`
1004
455
  `) ? "" : `
1005
- `) + l.raw, c.text += `
1006
- ` + l.text, this.inlineQueue.at(-1).src = c.text) : t.push(l);
456
+ `) + l.raw, o.text += `
457
+ ` + l.text, this.inlineQueue.at(-1).src = o.text) : t.push(l);
1007
458
  continue;
1008
459
  }
1009
460
  if (l = this.tokenizer.fences(e)) {
@@ -1032,11 +483,11 @@ ${f}` : f;
1032
483
  }
1033
484
  if (l = this.tokenizer.def(e)) {
1034
485
  e = e.substring(l.raw.length);
1035
- let c = t.at(-1);
1036
- (c == null ? void 0 : c.type) === "paragraph" || (c == null ? void 0 : c.type) === "text" ? (c.raw += (c.raw.endsWith(`
486
+ let o = t.at(-1);
487
+ (o == null ? void 0 : o.type) === "paragraph" || (o == null ? void 0 : o.type) === "text" ? (o.raw += (o.raw.endsWith(`
1037
488
  `) ? "" : `
1038
- `) + l.raw, c.text += `
1039
- ` + l.raw, this.inlineQueue.at(-1).src = c.text) : this.tokens.links[l.tag] || (this.tokens.links[l.tag] = { href: l.href, title: l.title }, t.push(l));
489
+ `) + l.raw, o.text += `
490
+ ` + l.raw, this.inlineQueue.at(-1).src = o.text) : this.tokens.links[l.tag] || (this.tokens.links[l.tag] = { href: l.href, title: l.title }, t.push(l));
1040
491
  continue;
1041
492
  }
1042
493
  if (l = this.tokenizer.table(e)) {
@@ -1048,35 +499,35 @@ ${f}` : f;
1048
499
  continue;
1049
500
  }
1050
501
  let h = e;
1051
- if ((o = this.options.extensions) != null && o.startBlock) {
1052
- let c = 1 / 0, f = e.slice(1), k;
1053
- this.options.extensions.startBlock.forEach((m) => {
1054
- k = m.call({ lexer: this }, f), typeof k == "number" && k >= 0 && (c = Math.min(c, k));
1055
- }), c < 1 / 0 && c >= 0 && (h = e.substring(0, c + 1));
502
+ if ((a = this.options.extensions) != null && a.startBlock) {
503
+ let o = 1 / 0, p = e.slice(1), g;
504
+ this.options.extensions.startBlock.forEach((u) => {
505
+ g = u.call({ lexer: this }, p), typeof g == "number" && g >= 0 && (o = Math.min(o, g));
506
+ }), o < 1 / 0 && o >= 0 && (h = e.substring(0, o + 1));
1056
507
  }
1057
508
  if (this.state.top && (l = this.tokenizer.paragraph(h))) {
1058
- let c = t.at(-1);
1059
- r && (c == null ? void 0 : c.type) === "paragraph" ? (c.raw += (c.raw.endsWith(`
509
+ let o = t.at(-1);
510
+ s && (o == null ? void 0 : o.type) === "paragraph" ? (o.raw += (o.raw.endsWith(`
1060
511
  `) ? "" : `
1061
- `) + l.raw, c.text += `
1062
- ` + l.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = c.text) : t.push(l), r = h.length !== e.length, e = e.substring(l.raw.length);
512
+ `) + l.raw, o.text += `
513
+ ` + l.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = o.text) : t.push(l), s = h.length !== e.length, e = e.substring(l.raw.length);
1063
514
  continue;
1064
515
  }
1065
516
  if (l = this.tokenizer.text(e)) {
1066
517
  e = e.substring(l.raw.length);
1067
- let c = t.at(-1);
1068
- (c == null ? void 0 : c.type) === "text" ? (c.raw += (c.raw.endsWith(`
518
+ let o = t.at(-1);
519
+ (o == null ? void 0 : o.type) === "text" ? (o.raw += (o.raw.endsWith(`
1069
520
  `) ? "" : `
1070
- `) + l.raw, c.text += `
1071
- ` + l.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = c.text) : t.push(l);
521
+ `) + l.raw, o.text += `
522
+ ` + l.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = o.text) : t.push(l);
1072
523
  continue;
1073
524
  }
1074
525
  if (e) {
1075
- let c = "Infinite loop on byte: " + e.charCodeAt(0);
526
+ let o = "Infinite loop on byte: " + e.charCodeAt(0);
1076
527
  if (this.options.silent) {
1077
- console.error(c);
528
+ console.error(o);
1078
529
  break;
1079
- } else throw new Error(c);
530
+ } else throw new Error(o);
1080
531
  }
1081
532
  }
1082
533
  return this.state.top = !0, t;
@@ -1085,261 +536,261 @@ ${f}` : f;
1085
536
  return this.inlineQueue.push({ src: e, tokens: t }), t;
1086
537
  }
1087
538
  inlineTokens(e, t = []) {
1088
- var h, c, f, k, m;
1089
- let r = e, s = null;
539
+ var h, o, p, g, u;
540
+ let s = e, n = null;
1090
541
  if (this.tokens.links) {
1091
- let p = Object.keys(this.tokens.links);
1092
- if (p.length > 0) for (; (s = this.tokenizer.rules.inline.reflinkSearch.exec(r)) != null; ) p.includes(s[0].slice(s[0].lastIndexOf("[") + 1, -1)) && (r = r.slice(0, s.index) + "[" + "a".repeat(s[0].length - 2) + "]" + r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
542
+ let c = Object.keys(this.tokens.links);
543
+ if (c.length > 0) for (; (n = this.tokenizer.rules.inline.reflinkSearch.exec(s)) != null; ) c.includes(n[0].slice(n[0].lastIndexOf("[") + 1, -1)) && (s = s.slice(0, n.index) + "[" + "a".repeat(n[0].length - 2) + "]" + s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
1093
544
  }
1094
- for (; (s = this.tokenizer.rules.inline.anyPunctuation.exec(r)) != null; ) r = r.slice(0, s.index) + "++" + r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
1095
- let a;
1096
- for (; (s = this.tokenizer.rules.inline.blockSkip.exec(r)) != null; ) a = s[2] ? s[2].length : 0, r = r.slice(0, s.index + a) + "[" + "a".repeat(s[0].length - a - 2) + "]" + r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
1097
- r = ((c = (h = this.options.hooks) == null ? void 0 : h.emStrongMask) == null ? void 0 : c.call({ lexer: this }, r)) ?? r;
1098
- let o = !1, l = "";
545
+ for (; (n = this.tokenizer.rules.inline.anyPunctuation.exec(s)) != null; ) s = s.slice(0, n.index) + "++" + s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
546
+ let i;
547
+ for (; (n = this.tokenizer.rules.inline.blockSkip.exec(s)) != null; ) i = n[2] ? n[2].length : 0, s = s.slice(0, n.index + i) + "[" + "a".repeat(n[0].length - i - 2) + "]" + s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
548
+ s = ((o = (h = this.options.hooks) == null ? void 0 : h.emStrongMask) == null ? void 0 : o.call({ lexer: this }, s)) ?? s;
549
+ let a = !1, l = "";
1099
550
  for (; e; ) {
1100
- o || (l = ""), o = !1;
1101
- let p;
1102
- if ((k = (f = this.options.extensions) == null ? void 0 : f.inline) != null && k.some((x) => (p = x.call({ lexer: this }, e, t)) ? (e = e.substring(p.raw.length), t.push(p), !0) : !1)) continue;
1103
- if (p = this.tokenizer.escape(e)) {
1104
- e = e.substring(p.raw.length), t.push(p);
551
+ a || (l = ""), a = !1;
552
+ let c;
553
+ if ((g = (p = this.options.extensions) == null ? void 0 : p.inline) != null && g.some((k) => (c = k.call({ lexer: this }, e, t)) ? (e = e.substring(c.raw.length), t.push(c), !0) : !1)) continue;
554
+ if (c = this.tokenizer.escape(e)) {
555
+ e = e.substring(c.raw.length), t.push(c);
1105
556
  continue;
1106
557
  }
1107
- if (p = this.tokenizer.tag(e)) {
1108
- e = e.substring(p.raw.length), t.push(p);
558
+ if (c = this.tokenizer.tag(e)) {
559
+ e = e.substring(c.raw.length), t.push(c);
1109
560
  continue;
1110
561
  }
1111
- if (p = this.tokenizer.link(e)) {
1112
- e = e.substring(p.raw.length), t.push(p);
562
+ if (c = this.tokenizer.link(e)) {
563
+ e = e.substring(c.raw.length), t.push(c);
1113
564
  continue;
1114
565
  }
1115
- if (p = this.tokenizer.reflink(e, this.tokens.links)) {
1116
- e = e.substring(p.raw.length);
1117
- let x = t.at(-1);
1118
- p.type === "text" && (x == null ? void 0 : x.type) === "text" ? (x.raw += p.raw, x.text += p.text) : t.push(p);
566
+ if (c = this.tokenizer.reflink(e, this.tokens.links)) {
567
+ e = e.substring(c.raw.length);
568
+ let k = t.at(-1);
569
+ c.type === "text" && (k == null ? void 0 : k.type) === "text" ? (k.raw += c.raw, k.text += c.text) : t.push(c);
1119
570
  continue;
1120
571
  }
1121
- if (p = this.tokenizer.emStrong(e, r, l)) {
1122
- e = e.substring(p.raw.length), t.push(p);
572
+ if (c = this.tokenizer.emStrong(e, s, l)) {
573
+ e = e.substring(c.raw.length), t.push(c);
1123
574
  continue;
1124
575
  }
1125
- if (p = this.tokenizer.codespan(e)) {
1126
- e = e.substring(p.raw.length), t.push(p);
576
+ if (c = this.tokenizer.codespan(e)) {
577
+ e = e.substring(c.raw.length), t.push(c);
1127
578
  continue;
1128
579
  }
1129
- if (p = this.tokenizer.br(e)) {
1130
- e = e.substring(p.raw.length), t.push(p);
580
+ if (c = this.tokenizer.br(e)) {
581
+ e = e.substring(c.raw.length), t.push(c);
1131
582
  continue;
1132
583
  }
1133
- if (p = this.tokenizer.del(e, r, l)) {
1134
- e = e.substring(p.raw.length), t.push(p);
584
+ if (c = this.tokenizer.del(e, s, l)) {
585
+ e = e.substring(c.raw.length), t.push(c);
1135
586
  continue;
1136
587
  }
1137
- if (p = this.tokenizer.autolink(e)) {
1138
- e = e.substring(p.raw.length), t.push(p);
588
+ if (c = this.tokenizer.autolink(e)) {
589
+ e = e.substring(c.raw.length), t.push(c);
1139
590
  continue;
1140
591
  }
1141
- if (!this.state.inLink && (p = this.tokenizer.url(e))) {
1142
- e = e.substring(p.raw.length), t.push(p);
592
+ if (!this.state.inLink && (c = this.tokenizer.url(e))) {
593
+ e = e.substring(c.raw.length), t.push(c);
1143
594
  continue;
1144
595
  }
1145
- let w = e;
1146
- if ((m = this.options.extensions) != null && m.startInline) {
1147
- let x = 1 / 0, S = e.slice(1), V;
1148
- this.options.extensions.startInline.forEach((le) => {
1149
- V = le.call({ lexer: this }, S), typeof V == "number" && V >= 0 && (x = Math.min(x, V));
1150
- }), x < 1 / 0 && x >= 0 && (w = e.substring(0, x + 1));
596
+ let b = e;
597
+ if ((u = this.options.extensions) != null && u.startInline) {
598
+ let k = 1 / 0, w = e.slice(1), A;
599
+ this.options.extensions.startInline.forEach((C) => {
600
+ A = C.call({ lexer: this }, w), typeof A == "number" && A >= 0 && (k = Math.min(k, A));
601
+ }), k < 1 / 0 && k >= 0 && (b = e.substring(0, k + 1));
1151
602
  }
1152
- if (p = this.tokenizer.inlineText(w)) {
1153
- e = e.substring(p.raw.length), p.raw.slice(-1) !== "_" && (l = p.raw.slice(-1)), o = !0;
1154
- let x = t.at(-1);
1155
- (x == null ? void 0 : x.type) === "text" ? (x.raw += p.raw, x.text += p.text) : t.push(p);
603
+ if (c = this.tokenizer.inlineText(b)) {
604
+ e = e.substring(c.raw.length), c.raw.slice(-1) !== "_" && (l = c.raw.slice(-1)), a = !0;
605
+ let k = t.at(-1);
606
+ (k == null ? void 0 : k.type) === "text" ? (k.raw += c.raw, k.text += c.text) : t.push(c);
1156
607
  continue;
1157
608
  }
1158
609
  if (e) {
1159
- let x = "Infinite loop on byte: " + e.charCodeAt(0);
610
+ let k = "Infinite loop on byte: " + e.charCodeAt(0);
1160
611
  if (this.options.silent) {
1161
- console.error(x);
612
+ console.error(k);
1162
613
  break;
1163
- } else throw new Error(x);
614
+ } else throw new Error(k);
1164
615
  }
1165
616
  }
1166
617
  return t;
1167
618
  }
1168
- }, He = class {
1169
- constructor(n) {
1170
- _(this, "options");
1171
- _(this, "parser");
1172
- this.options = n || ie;
619
+ }, D = class {
620
+ constructor(r) {
621
+ x(this, "options");
622
+ x(this, "parser");
623
+ this.options = r || z;
1173
624
  }
1174
- space(n) {
625
+ space(r) {
1175
626
  return "";
1176
627
  }
1177
- code({ text: n, lang: e, escaped: t }) {
1178
- var a;
1179
- let r = (a = (e || "").match(v.notSpaceStart)) == null ? void 0 : a[0], s = n.replace(v.endingNewline, "") + `
628
+ code({ text: r, lang: e, escaped: t }) {
629
+ var i;
630
+ let s = (i = (e || "").match(m.notSpaceStart)) == null ? void 0 : i[0], n = r.replace(m.endingNewline, "") + `
1180
631
  `;
1181
- return r ? '<pre><code class="language-' + Y(r) + '">' + (t ? s : Y(s, !0)) + `</code></pre>
1182
- ` : "<pre><code>" + (t ? s : Y(s, !0)) + `</code></pre>
632
+ return s ? '<pre><code class="language-' + $(s) + '">' + (t ? n : $(n, !0)) + `</code></pre>
633
+ ` : "<pre><code>" + (t ? n : $(n, !0)) + `</code></pre>
1183
634
  `;
1184
635
  }
1185
- blockquote({ tokens: n }) {
636
+ blockquote({ tokens: r }) {
1186
637
  return `<blockquote>
1187
- ${this.parser.parse(n)}</blockquote>
638
+ ${this.parser.parse(r)}</blockquote>
1188
639
  `;
1189
640
  }
1190
- html({ text: n }) {
1191
- return n;
641
+ html({ text: r }) {
642
+ return r;
1192
643
  }
1193
- def(n) {
644
+ def(r) {
1194
645
  return "";
1195
646
  }
1196
- heading({ tokens: n, depth: e }) {
1197
- return `<h${e}>${this.parser.parseInline(n)}</h${e}>
647
+ heading({ tokens: r, depth: e }) {
648
+ return `<h${e}>${this.parser.parseInline(r)}</h${e}>
1198
649
  `;
1199
650
  }
1200
- hr(n) {
651
+ hr(r) {
1201
652
  return `<hr>
1202
653
  `;
1203
654
  }
1204
- list(n) {
1205
- let e = n.ordered, t = n.start, r = "";
1206
- for (let o = 0; o < n.items.length; o++) {
1207
- let l = n.items[o];
1208
- r += this.listitem(l);
655
+ list(r) {
656
+ let e = r.ordered, t = r.start, s = "";
657
+ for (let a = 0; a < r.items.length; a++) {
658
+ let l = r.items[a];
659
+ s += this.listitem(l);
1209
660
  }
1210
- let s = e ? "ol" : "ul", a = e && t !== 1 ? ' start="' + t + '"' : "";
1211
- return "<" + s + a + `>
1212
- ` + r + "</" + s + `>
661
+ let n = e ? "ol" : "ul", i = e && t !== 1 ? ' start="' + t + '"' : "";
662
+ return "<" + n + i + `>
663
+ ` + s + "</" + n + `>
1213
664
  `;
1214
665
  }
1215
- listitem(n) {
1216
- return `<li>${this.parser.parse(n.tokens)}</li>
666
+ listitem(r) {
667
+ return `<li>${this.parser.parse(r.tokens)}</li>
1217
668
  `;
1218
669
  }
1219
- checkbox({ checked: n }) {
1220
- return "<input " + (n ? 'checked="" ' : "") + 'disabled="" type="checkbox"> ';
670
+ checkbox({ checked: r }) {
671
+ return "<input " + (r ? 'checked="" ' : "") + 'disabled="" type="checkbox"> ';
1221
672
  }
1222
- paragraph({ tokens: n }) {
1223
- return `<p>${this.parser.parseInline(n)}</p>
673
+ paragraph({ tokens: r }) {
674
+ return `<p>${this.parser.parseInline(r)}</p>
1224
675
  `;
1225
676
  }
1226
- table(n) {
677
+ table(r) {
1227
678
  let e = "", t = "";
1228
- for (let s = 0; s < n.header.length; s++) t += this.tablecell(n.header[s]);
679
+ for (let n = 0; n < r.header.length; n++) t += this.tablecell(r.header[n]);
1229
680
  e += this.tablerow({ text: t });
1230
- let r = "";
1231
- for (let s = 0; s < n.rows.length; s++) {
1232
- let a = n.rows[s];
681
+ let s = "";
682
+ for (let n = 0; n < r.rows.length; n++) {
683
+ let i = r.rows[n];
1233
684
  t = "";
1234
- for (let o = 0; o < a.length; o++) t += this.tablecell(a[o]);
1235
- r += this.tablerow({ text: t });
685
+ for (let a = 0; a < i.length; a++) t += this.tablecell(i[a]);
686
+ s += this.tablerow({ text: t });
1236
687
  }
1237
- return r && (r = `<tbody>${r}</tbody>`), `<table>
688
+ return s && (s = `<tbody>${s}</tbody>`), `<table>
1238
689
  <thead>
1239
690
  ` + e + `</thead>
1240
- ` + r + `</table>
691
+ ` + s + `</table>
1241
692
  `;
1242
693
  }
1243
- tablerow({ text: n }) {
694
+ tablerow({ text: r }) {
1244
695
  return `<tr>
1245
- ${n}</tr>
696
+ ${r}</tr>
1246
697
  `;
1247
698
  }
1248
- tablecell(n) {
1249
- let e = this.parser.parseInline(n.tokens), t = n.header ? "th" : "td";
1250
- return (n.align ? `<${t} align="${n.align}">` : `<${t}>`) + e + `</${t}>
699
+ tablecell(r) {
700
+ let e = this.parser.parseInline(r.tokens), t = r.header ? "th" : "td";
701
+ return (r.align ? `<${t} align="${r.align}">` : `<${t}>`) + e + `</${t}>
1251
702
  `;
1252
703
  }
1253
- strong({ tokens: n }) {
1254
- return `<strong>${this.parser.parseInline(n)}</strong>`;
704
+ strong({ tokens: r }) {
705
+ return `<strong>${this.parser.parseInline(r)}</strong>`;
1255
706
  }
1256
- em({ tokens: n }) {
1257
- return `<em>${this.parser.parseInline(n)}</em>`;
707
+ em({ tokens: r }) {
708
+ return `<em>${this.parser.parseInline(r)}</em>`;
1258
709
  }
1259
- codespan({ text: n }) {
1260
- return `<code>${Y(n, !0)}</code>`;
710
+ codespan({ text: r }) {
711
+ return `<code>${$(r, !0)}</code>`;
1261
712
  }
1262
- br(n) {
713
+ br(r) {
1263
714
  return "<br>";
1264
715
  }
1265
- del({ tokens: n }) {
1266
- return `<del>${this.parser.parseInline(n)}</del>`;
1267
- }
1268
- link({ href: n, title: e, tokens: t }) {
1269
- let r = this.parser.parseInline(t), s = cn(n);
1270
- if (s === null) return r;
1271
- n = s;
1272
- let a = '<a href="' + n + '"';
1273
- return e && (a += ' title="' + Y(e) + '"'), a += ">" + r + "</a>", a;
1274
- }
1275
- image({ href: n, title: e, text: t, tokens: r }) {
1276
- r && (t = this.parser.parseInline(r, this.parser.textRenderer));
1277
- let s = cn(n);
1278
- if (s === null) return Y(t);
1279
- n = s;
1280
- let a = `<img src="${n}" alt="${Y(t)}"`;
1281
- return e && (a += ` title="${Y(e)}"`), a += ">", a;
1282
- }
1283
- text(n) {
1284
- return "tokens" in n && n.tokens ? this.parser.parseInline(n.tokens) : "escaped" in n && n.escaped ? n.text : Y(n.text);
1285
- }
1286
- }, Rt = class {
1287
- strong({ text: n }) {
1288
- return n;
716
+ del({ tokens: r }) {
717
+ return `<del>${this.parser.parseInline(r)}</del>`;
718
+ }
719
+ link({ href: r, title: e, tokens: t }) {
720
+ let s = this.parser.parseInline(t), n = le(r);
721
+ if (n === null) return s;
722
+ r = n;
723
+ let i = '<a href="' + r + '"';
724
+ return e && (i += ' title="' + $(e) + '"'), i += ">" + s + "</a>", i;
725
+ }
726
+ image({ href: r, title: e, text: t, tokens: s }) {
727
+ s && (t = this.parser.parseInline(s, this.parser.textRenderer));
728
+ let n = le(r);
729
+ if (n === null) return $(t);
730
+ r = n;
731
+ let i = `<img src="${r}" alt="${$(t)}"`;
732
+ return e && (i += ` title="${$(e)}"`), i += ">", i;
733
+ }
734
+ text(r) {
735
+ return "tokens" in r && r.tokens ? this.parser.parseInline(r.tokens) : "escaped" in r && r.escaped ? r.text : $(r.text);
736
+ }
737
+ }, Y = class {
738
+ strong({ text: r }) {
739
+ return r;
1289
740
  }
1290
- em({ text: n }) {
1291
- return n;
741
+ em({ text: r }) {
742
+ return r;
1292
743
  }
1293
- codespan({ text: n }) {
1294
- return n;
744
+ codespan({ text: r }) {
745
+ return r;
1295
746
  }
1296
- del({ text: n }) {
1297
- return n;
747
+ del({ text: r }) {
748
+ return r;
1298
749
  }
1299
- html({ text: n }) {
1300
- return n;
750
+ html({ text: r }) {
751
+ return r;
1301
752
  }
1302
- text({ text: n }) {
1303
- return n;
753
+ text({ text: r }) {
754
+ return r;
1304
755
  }
1305
- link({ text: n }) {
1306
- return "" + n;
756
+ link({ text: r }) {
757
+ return "" + r;
1307
758
  }
1308
- image({ text: n }) {
1309
- return "" + n;
759
+ image({ text: r }) {
760
+ return "" + r;
1310
761
  }
1311
762
  br() {
1312
763
  return "";
1313
764
  }
1314
- checkbox({ raw: n }) {
1315
- return n;
765
+ checkbox({ raw: r }) {
766
+ return r;
1316
767
  }
1317
- }, G = class kt {
768
+ }, S = class j {
1318
769
  constructor(e) {
1319
- _(this, "options");
1320
- _(this, "renderer");
1321
- _(this, "textRenderer");
1322
- this.options = e || ie, this.options.renderer = this.options.renderer || new He(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new Rt();
770
+ x(this, "options");
771
+ x(this, "renderer");
772
+ x(this, "textRenderer");
773
+ this.options = e || z, this.options.renderer = this.options.renderer || new D(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new Y();
1323
774
  }
1324
775
  static parse(e, t) {
1325
- return new kt(t).parse(e);
776
+ return new j(t).parse(e);
1326
777
  }
1327
778
  static parseInline(e, t) {
1328
- return new kt(t).parseInline(e);
779
+ return new j(t).parseInline(e);
1329
780
  }
1330
781
  parse(e) {
1331
- var r, s;
782
+ var s, n;
1332
783
  let t = "";
1333
- for (let a = 0; a < e.length; a++) {
1334
- let o = e[a];
1335
- if ((s = (r = this.options.extensions) == null ? void 0 : r.renderers) != null && s[o.type]) {
1336
- let h = o, c = this.options.extensions.renderers[h.type].call({ parser: this }, h);
1337
- if (c !== !1 || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "def", "paragraph", "text"].includes(h.type)) {
1338
- t += c || "";
784
+ for (let i = 0; i < e.length; i++) {
785
+ let a = e[i];
786
+ if ((n = (s = this.options.extensions) == null ? void 0 : s.renderers) != null && n[a.type]) {
787
+ let h = a, o = this.options.extensions.renderers[h.type].call({ parser: this }, h);
788
+ if (o !== !1 || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "def", "paragraph", "text"].includes(h.type)) {
789
+ t += o || "";
1339
790
  continue;
1340
791
  }
1341
792
  }
1342
- let l = o;
793
+ let l = a;
1343
794
  switch (l.type) {
1344
795
  case "space": {
1345
796
  t += this.renderer.space(l);
@@ -1399,294 +850,294 @@ ${n}</tr>
1399
850
  return t;
1400
851
  }
1401
852
  parseInline(e, t = this.renderer) {
1402
- var s, a;
1403
- let r = "";
1404
- for (let o = 0; o < e.length; o++) {
1405
- let l = e[o];
1406
- if ((a = (s = this.options.extensions) == null ? void 0 : s.renderers) != null && a[l.type]) {
1407
- let c = this.options.extensions.renderers[l.type].call({ parser: this }, l);
1408
- if (c !== !1 || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(l.type)) {
1409
- r += c || "";
853
+ var n, i;
854
+ let s = "";
855
+ for (let a = 0; a < e.length; a++) {
856
+ let l = e[a];
857
+ if ((i = (n = this.options.extensions) == null ? void 0 : n.renderers) != null && i[l.type]) {
858
+ let o = this.options.extensions.renderers[l.type].call({ parser: this }, l);
859
+ if (o !== !1 || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(l.type)) {
860
+ s += o || "";
1410
861
  continue;
1411
862
  }
1412
863
  }
1413
864
  let h = l;
1414
865
  switch (h.type) {
1415
866
  case "escape": {
1416
- r += t.text(h);
867
+ s += t.text(h);
1417
868
  break;
1418
869
  }
1419
870
  case "html": {
1420
- r += t.html(h);
871
+ s += t.html(h);
1421
872
  break;
1422
873
  }
1423
874
  case "link": {
1424
- r += t.link(h);
875
+ s += t.link(h);
1425
876
  break;
1426
877
  }
1427
878
  case "image": {
1428
- r += t.image(h);
879
+ s += t.image(h);
1429
880
  break;
1430
881
  }
1431
882
  case "checkbox": {
1432
- r += t.checkbox(h);
883
+ s += t.checkbox(h);
1433
884
  break;
1434
885
  }
1435
886
  case "strong": {
1436
- r += t.strong(h);
887
+ s += t.strong(h);
1437
888
  break;
1438
889
  }
1439
890
  case "em": {
1440
- r += t.em(h);
891
+ s += t.em(h);
1441
892
  break;
1442
893
  }
1443
894
  case "codespan": {
1444
- r += t.codespan(h);
895
+ s += t.codespan(h);
1445
896
  break;
1446
897
  }
1447
898
  case "br": {
1448
- r += t.br(h);
899
+ s += t.br(h);
1449
900
  break;
1450
901
  }
1451
902
  case "del": {
1452
- r += t.del(h);
903
+ s += t.del(h);
1453
904
  break;
1454
905
  }
1455
906
  case "text": {
1456
- r += t.text(h);
907
+ s += t.text(h);
1457
908
  break;
1458
909
  }
1459
910
  default: {
1460
- let c = 'Token with "' + h.type + '" type was not found.';
1461
- if (this.options.silent) return console.error(c), "";
1462
- throw new Error(c);
911
+ let o = 'Token with "' + h.type + '" type was not found.';
912
+ if (this.options.silent) return console.error(o), "";
913
+ throw new Error(o);
1463
914
  }
1464
915
  }
1465
916
  }
1466
- return r;
917
+ return s;
1467
918
  }
1468
- }, $e, Re = ($e = class {
1469
- constructor(n) {
1470
- _(this, "options");
1471
- _(this, "block");
1472
- this.options = n || ie;
919
+ }, v, L = (v = class {
920
+ constructor(r) {
921
+ x(this, "options");
922
+ x(this, "block");
923
+ this.options = r || z;
1473
924
  }
1474
- preprocess(n) {
1475
- return n;
925
+ preprocess(r) {
926
+ return r;
1476
927
  }
1477
- postprocess(n) {
1478
- return n;
928
+ postprocess(r) {
929
+ return r;
1479
930
  }
1480
- processAllTokens(n) {
1481
- return n;
931
+ processAllTokens(r) {
932
+ return r;
1482
933
  }
1483
- emStrongMask(n) {
1484
- return n;
934
+ emStrongMask(r) {
935
+ return r;
1485
936
  }
1486
937
  provideLexer() {
1487
- return this.block ? H.lex : H.lexInline;
938
+ return this.block ? y.lex : y.lexInline;
1488
939
  }
1489
940
  provideParser() {
1490
- return this.block ? G.parse : G.parseInline;
1491
- }
1492
- }, _($e, "passThroughHooks", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens", "emStrongMask"])), _($e, "passThroughHooksRespectAsync", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens"])), $e), es = class {
1493
- constructor(...n) {
1494
- _(this, "defaults", bt());
1495
- _(this, "options", this.setOptions);
1496
- _(this, "parse", this.parseMarkdown(!0));
1497
- _(this, "parseInline", this.parseMarkdown(!1));
1498
- _(this, "Parser", G);
1499
- _(this, "Renderer", He);
1500
- _(this, "TextRenderer", Rt);
1501
- _(this, "Lexer", H);
1502
- _(this, "Tokenizer", Be);
1503
- _(this, "Hooks", Re);
1504
- this.use(...n);
1505
- }
1506
- walkTokens(n, e) {
1507
- var r, s;
941
+ return this.block ? S.parse : S.parseInline;
942
+ }
943
+ }, x(v, "passThroughHooks", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens", "emStrongMask"])), x(v, "passThroughHooksRespectAsync", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens"])), v), gt = class {
944
+ constructor(...r) {
945
+ x(this, "defaults", G());
946
+ x(this, "options", this.setOptions);
947
+ x(this, "parse", this.parseMarkdown(!0));
948
+ x(this, "parseInline", this.parseMarkdown(!1));
949
+ x(this, "Parser", S);
950
+ x(this, "Renderer", D);
951
+ x(this, "TextRenderer", Y);
952
+ x(this, "Lexer", y);
953
+ x(this, "Tokenizer", Z);
954
+ x(this, "Hooks", L);
955
+ this.use(...r);
956
+ }
957
+ walkTokens(r, e) {
958
+ var s, n;
1508
959
  let t = [];
1509
- for (let a of n) switch (t = t.concat(e.call(this, a)), a.type) {
960
+ for (let i of r) switch (t = t.concat(e.call(this, i)), i.type) {
1510
961
  case "table": {
1511
- let o = a;
1512
- for (let l of o.header) t = t.concat(this.walkTokens(l.tokens, e));
1513
- for (let l of o.rows) for (let h of l) t = t.concat(this.walkTokens(h.tokens, e));
962
+ let a = i;
963
+ for (let l of a.header) t = t.concat(this.walkTokens(l.tokens, e));
964
+ for (let l of a.rows) for (let h of l) t = t.concat(this.walkTokens(h.tokens, e));
1514
965
  break;
1515
966
  }
1516
967
  case "list": {
1517
- let o = a;
1518
- t = t.concat(this.walkTokens(o.items, e));
968
+ let a = i;
969
+ t = t.concat(this.walkTokens(a.items, e));
1519
970
  break;
1520
971
  }
1521
972
  default: {
1522
- let o = a;
1523
- (s = (r = this.defaults.extensions) == null ? void 0 : r.childTokens) != null && s[o.type] ? this.defaults.extensions.childTokens[o.type].forEach((l) => {
1524
- let h = o[l].flat(1 / 0);
973
+ let a = i;
974
+ (n = (s = this.defaults.extensions) == null ? void 0 : s.childTokens) != null && n[a.type] ? this.defaults.extensions.childTokens[a.type].forEach((l) => {
975
+ let h = a[l].flat(1 / 0);
1525
976
  t = t.concat(this.walkTokens(h, e));
1526
- }) : o.tokens && (t = t.concat(this.walkTokens(o.tokens, e)));
977
+ }) : a.tokens && (t = t.concat(this.walkTokens(a.tokens, e)));
1527
978
  }
1528
979
  }
1529
980
  return t;
1530
981
  }
1531
- use(...n) {
982
+ use(...r) {
1532
983
  let e = this.defaults.extensions || { renderers: {}, childTokens: {} };
1533
- return n.forEach((t) => {
1534
- let r = { ...t };
1535
- if (r.async = this.defaults.async || r.async || !1, t.extensions && (t.extensions.forEach((s) => {
1536
- if (!s.name) throw new Error("extension name required");
1537
- if ("renderer" in s) {
1538
- let a = e.renderers[s.name];
1539
- a ? e.renderers[s.name] = function(...o) {
1540
- let l = s.renderer.apply(this, o);
1541
- return l === !1 && (l = a.apply(this, o)), l;
1542
- } : e.renderers[s.name] = s.renderer;
984
+ return r.forEach((t) => {
985
+ let s = { ...t };
986
+ if (s.async = this.defaults.async || s.async || !1, t.extensions && (t.extensions.forEach((n) => {
987
+ if (!n.name) throw new Error("extension name required");
988
+ if ("renderer" in n) {
989
+ let i = e.renderers[n.name];
990
+ i ? e.renderers[n.name] = function(...a) {
991
+ let l = n.renderer.apply(this, a);
992
+ return l === !1 && (l = i.apply(this, a)), l;
993
+ } : e.renderers[n.name] = n.renderer;
1543
994
  }
1544
- if ("tokenizer" in s) {
1545
- if (!s.level || s.level !== "block" && s.level !== "inline") throw new Error("extension level must be 'block' or 'inline'");
1546
- let a = e[s.level];
1547
- a ? a.unshift(s.tokenizer) : e[s.level] = [s.tokenizer], s.start && (s.level === "block" ? e.startBlock ? e.startBlock.push(s.start) : e.startBlock = [s.start] : s.level === "inline" && (e.startInline ? e.startInline.push(s.start) : e.startInline = [s.start]));
995
+ if ("tokenizer" in n) {
996
+ if (!n.level || n.level !== "block" && n.level !== "inline") throw new Error("extension level must be 'block' or 'inline'");
997
+ let i = e[n.level];
998
+ i ? i.unshift(n.tokenizer) : e[n.level] = [n.tokenizer], n.start && (n.level === "block" ? e.startBlock ? e.startBlock.push(n.start) : e.startBlock = [n.start] : n.level === "inline" && (e.startInline ? e.startInline.push(n.start) : e.startInline = [n.start]));
1548
999
  }
1549
- "childTokens" in s && s.childTokens && (e.childTokens[s.name] = s.childTokens);
1550
- }), r.extensions = e), t.renderer) {
1551
- let s = this.defaults.renderer || new He(this.defaults);
1552
- for (let a in t.renderer) {
1553
- if (!(a in s)) throw new Error(`renderer '${a}' does not exist`);
1554
- if (["options", "parser"].includes(a)) continue;
1555
- let o = a, l = t.renderer[o], h = s[o];
1556
- s[o] = (...c) => {
1557
- let f = l.apply(s, c);
1558
- return f === !1 && (f = h.apply(s, c)), f || "";
1000
+ "childTokens" in n && n.childTokens && (e.childTokens[n.name] = n.childTokens);
1001
+ }), s.extensions = e), t.renderer) {
1002
+ let n = this.defaults.renderer || new D(this.defaults);
1003
+ for (let i in t.renderer) {
1004
+ if (!(i in n)) throw new Error(`renderer '${i}' does not exist`);
1005
+ if (["options", "parser"].includes(i)) continue;
1006
+ let a = i, l = t.renderer[a], h = n[a];
1007
+ n[a] = (...o) => {
1008
+ let p = l.apply(n, o);
1009
+ return p === !1 && (p = h.apply(n, o)), p || "";
1559
1010
  };
1560
1011
  }
1561
- r.renderer = s;
1012
+ s.renderer = n;
1562
1013
  }
1563
1014
  if (t.tokenizer) {
1564
- let s = this.defaults.tokenizer || new Be(this.defaults);
1565
- for (let a in t.tokenizer) {
1566
- if (!(a in s)) throw new Error(`tokenizer '${a}' does not exist`);
1567
- if (["options", "rules", "lexer"].includes(a)) continue;
1568
- let o = a, l = t.tokenizer[o], h = s[o];
1569
- s[o] = (...c) => {
1570
- let f = l.apply(s, c);
1571
- return f === !1 && (f = h.apply(s, c)), f;
1015
+ let n = this.defaults.tokenizer || new Z(this.defaults);
1016
+ for (let i in t.tokenizer) {
1017
+ if (!(i in n)) throw new Error(`tokenizer '${i}' does not exist`);
1018
+ if (["options", "rules", "lexer"].includes(i)) continue;
1019
+ let a = i, l = t.tokenizer[a], h = n[a];
1020
+ n[a] = (...o) => {
1021
+ let p = l.apply(n, o);
1022
+ return p === !1 && (p = h.apply(n, o)), p;
1572
1023
  };
1573
1024
  }
1574
- r.tokenizer = s;
1025
+ s.tokenizer = n;
1575
1026
  }
1576
1027
  if (t.hooks) {
1577
- let s = this.defaults.hooks || new Re();
1578
- for (let a in t.hooks) {
1579
- if (!(a in s)) throw new Error(`hook '${a}' does not exist`);
1580
- if (["options", "block"].includes(a)) continue;
1581
- let o = a, l = t.hooks[o], h = s[o];
1582
- Re.passThroughHooks.has(a) ? s[o] = (c) => {
1583
- if (this.defaults.async && Re.passThroughHooksRespectAsync.has(a)) return (async () => {
1584
- let k = await l.call(s, c);
1585
- return h.call(s, k);
1028
+ let n = this.defaults.hooks || new L();
1029
+ for (let i in t.hooks) {
1030
+ if (!(i in n)) throw new Error(`hook '${i}' does not exist`);
1031
+ if (["options", "block"].includes(i)) continue;
1032
+ let a = i, l = t.hooks[a], h = n[a];
1033
+ L.passThroughHooks.has(i) ? n[a] = (o) => {
1034
+ if (this.defaults.async && L.passThroughHooksRespectAsync.has(i)) return (async () => {
1035
+ let g = await l.call(n, o);
1036
+ return h.call(n, g);
1586
1037
  })();
1587
- let f = l.call(s, c);
1588
- return h.call(s, f);
1589
- } : s[o] = (...c) => {
1038
+ let p = l.call(n, o);
1039
+ return h.call(n, p);
1040
+ } : n[a] = (...o) => {
1590
1041
  if (this.defaults.async) return (async () => {
1591
- let k = await l.apply(s, c);
1592
- return k === !1 && (k = await h.apply(s, c)), k;
1042
+ let g = await l.apply(n, o);
1043
+ return g === !1 && (g = await h.apply(n, o)), g;
1593
1044
  })();
1594
- let f = l.apply(s, c);
1595
- return f === !1 && (f = h.apply(s, c)), f;
1045
+ let p = l.apply(n, o);
1046
+ return p === !1 && (p = h.apply(n, o)), p;
1596
1047
  };
1597
1048
  }
1598
- r.hooks = s;
1049
+ s.hooks = n;
1599
1050
  }
1600
1051
  if (t.walkTokens) {
1601
- let s = this.defaults.walkTokens, a = t.walkTokens;
1602
- r.walkTokens = function(o) {
1052
+ let n = this.defaults.walkTokens, i = t.walkTokens;
1053
+ s.walkTokens = function(a) {
1603
1054
  let l = [];
1604
- return l.push(a.call(this, o)), s && (l = l.concat(s.call(this, o))), l;
1055
+ return l.push(i.call(this, a)), n && (l = l.concat(n.call(this, a))), l;
1605
1056
  };
1606
1057
  }
1607
- this.defaults = { ...this.defaults, ...r };
1058
+ this.defaults = { ...this.defaults, ...s };
1608
1059
  }), this;
1609
1060
  }
1610
- setOptions(n) {
1611
- return this.defaults = { ...this.defaults, ...n }, this;
1061
+ setOptions(r) {
1062
+ return this.defaults = { ...this.defaults, ...r }, this;
1612
1063
  }
1613
- lexer(n, e) {
1614
- return H.lex(n, e ?? this.defaults);
1064
+ lexer(r, e) {
1065
+ return y.lex(r, e ?? this.defaults);
1615
1066
  }
1616
- parser(n, e) {
1617
- return G.parse(n, e ?? this.defaults);
1067
+ parser(r, e) {
1068
+ return S.parse(r, e ?? this.defaults);
1618
1069
  }
1619
- parseMarkdown(n) {
1070
+ parseMarkdown(r) {
1620
1071
  return (e, t) => {
1621
- let r = { ...t }, s = { ...this.defaults, ...r }, a = this.onError(!!s.silent, !!s.async);
1622
- if (this.defaults.async === !0 && r.async === !1) return a(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."));
1623
- if (typeof e > "u" || e === null) return a(new Error("marked(): input parameter is undefined or null"));
1624
- if (typeof e != "string") return a(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(e) + ", string expected"));
1625
- if (s.hooks && (s.hooks.options = s, s.hooks.block = n), s.async) return (async () => {
1626
- let o = s.hooks ? await s.hooks.preprocess(e) : e, l = await (s.hooks ? await s.hooks.provideLexer() : n ? H.lex : H.lexInline)(o, s), h = s.hooks ? await s.hooks.processAllTokens(l) : l;
1627
- s.walkTokens && await Promise.all(this.walkTokens(h, s.walkTokens));
1628
- let c = await (s.hooks ? await s.hooks.provideParser() : n ? G.parse : G.parseInline)(h, s);
1629
- return s.hooks ? await s.hooks.postprocess(c) : c;
1630
- })().catch(a);
1072
+ let s = { ...t }, n = { ...this.defaults, ...s }, i = this.onError(!!n.silent, !!n.async);
1073
+ if (this.defaults.async === !0 && s.async === !1) return i(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."));
1074
+ if (typeof e > "u" || e === null) return i(new Error("marked(): input parameter is undefined or null"));
1075
+ if (typeof e != "string") return i(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(e) + ", string expected"));
1076
+ if (n.hooks && (n.hooks.options = n, n.hooks.block = r), n.async) return (async () => {
1077
+ let a = n.hooks ? await n.hooks.preprocess(e) : e, l = await (n.hooks ? await n.hooks.provideLexer() : r ? y.lex : y.lexInline)(a, n), h = n.hooks ? await n.hooks.processAllTokens(l) : l;
1078
+ n.walkTokens && await Promise.all(this.walkTokens(h, n.walkTokens));
1079
+ let o = await (n.hooks ? await n.hooks.provideParser() : r ? S.parse : S.parseInline)(h, n);
1080
+ return n.hooks ? await n.hooks.postprocess(o) : o;
1081
+ })().catch(i);
1631
1082
  try {
1632
- s.hooks && (e = s.hooks.preprocess(e));
1633
- let o = (s.hooks ? s.hooks.provideLexer() : n ? H.lex : H.lexInline)(e, s);
1634
- s.hooks && (o = s.hooks.processAllTokens(o)), s.walkTokens && this.walkTokens(o, s.walkTokens);
1635
- let l = (s.hooks ? s.hooks.provideParser() : n ? G.parse : G.parseInline)(o, s);
1636
- return s.hooks && (l = s.hooks.postprocess(l)), l;
1637
- } catch (o) {
1638
- return a(o);
1083
+ n.hooks && (e = n.hooks.preprocess(e));
1084
+ let a = (n.hooks ? n.hooks.provideLexer() : r ? y.lex : y.lexInline)(e, n);
1085
+ n.hooks && (a = n.hooks.processAllTokens(a)), n.walkTokens && this.walkTokens(a, n.walkTokens);
1086
+ let l = (n.hooks ? n.hooks.provideParser() : r ? S.parse : S.parseInline)(a, n);
1087
+ return n.hooks && (l = n.hooks.postprocess(l)), l;
1088
+ } catch (a) {
1089
+ return i(a);
1639
1090
  }
1640
1091
  };
1641
1092
  }
1642
- onError(n, e) {
1093
+ onError(r, e) {
1643
1094
  return (t) => {
1644
1095
  if (t.message += `
1645
- Please report this to https://github.com/markedjs/marked.`, n) {
1646
- let r = "<p>An error occurred:</p><pre>" + Y(t.message + "", !0) + "</pre>";
1647
- return e ? Promise.resolve(r) : r;
1096
+ Please report this to https://github.com/markedjs/marked.`, r) {
1097
+ let s = "<p>An error occurred:</p><pre>" + $(t.message + "", !0) + "</pre>";
1098
+ return e ? Promise.resolve(s) : s;
1648
1099
  }
1649
1100
  if (e) return Promise.reject(t);
1650
1101
  throw t;
1651
1102
  };
1652
1103
  }
1653
- }, se = new es();
1654
- function A(n, e) {
1655
- return se.parse(n, e);
1104
+ }, T = new gt();
1105
+ function d(r, e) {
1106
+ return T.parse(r, e);
1656
1107
  }
1657
- A.options = A.setOptions = function(n) {
1658
- return se.setOptions(n), A.defaults = se.defaults, mn(A.defaults), A;
1108
+ d.options = d.setOptions = function(r) {
1109
+ return T.setOptions(r), d.defaults = T.defaults, oe(d.defaults), d;
1659
1110
  };
1660
- A.getDefaults = bt;
1661
- A.defaults = ie;
1662
- A.use = function(...n) {
1663
- return se.use(...n), A.defaults = se.defaults, mn(A.defaults), A;
1111
+ d.getDefaults = G;
1112
+ d.defaults = z;
1113
+ d.use = function(...r) {
1114
+ return T.use(...r), d.defaults = T.defaults, oe(d.defaults), d;
1664
1115
  };
1665
- A.walkTokens = function(n, e) {
1666
- return se.walkTokens(n, e);
1116
+ d.walkTokens = function(r, e) {
1117
+ return T.walkTokens(r, e);
1667
1118
  };
1668
- A.parseInline = se.parseInline;
1669
- A.Parser = G;
1670
- A.parser = G.parse;
1671
- A.Renderer = He;
1672
- A.TextRenderer = Rt;
1673
- A.Lexer = H;
1674
- A.lexer = H.lex;
1675
- A.Tokenizer = Be;
1676
- A.Hooks = Re;
1677
- A.parse = A;
1678
- A.options;
1679
- A.setOptions;
1680
- A.use;
1681
- A.walkTokens;
1682
- A.parseInline;
1683
- G.parse;
1684
- H.lex;
1685
- function ns(n) {
1686
- if (!n) return "";
1687
- const e = A.parse(n);
1688
- return pr.sanitize(e);
1119
+ d.parseInline = T.parseInline;
1120
+ d.Parser = S;
1121
+ d.parser = S.parse;
1122
+ d.Renderer = D;
1123
+ d.TextRenderer = Y;
1124
+ d.Lexer = y;
1125
+ d.lexer = y.lex;
1126
+ d.Tokenizer = Z;
1127
+ d.Hooks = L;
1128
+ d.parse = d;
1129
+ d.options;
1130
+ d.setOptions;
1131
+ d.use;
1132
+ d.walkTokens;
1133
+ d.parseInline;
1134
+ S.parse;
1135
+ y.lex;
1136
+ function dt(r) {
1137
+ if (!r) return "";
1138
+ const e = d.parse(r);
1139
+ return Re.sanitize(e);
1689
1140
  }
1690
1141
  export {
1691
- ns as default
1142
+ dt as default
1692
1143
  };