@yeepay/yee-boss-ui 0.1.7 → 0.1.8

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.
@@ -0,0 +1,1563 @@
1
+ function H() {
2
+ return {
3
+ async: !1,
4
+ baseUrl: null,
5
+ breaks: !1,
6
+ extensions: null,
7
+ gfm: !0,
8
+ headerIds: !0,
9
+ headerPrefix: "",
10
+ highlight: null,
11
+ hooks: null,
12
+ langPrefix: "language-",
13
+ mangle: !0,
14
+ pedantic: !1,
15
+ renderer: null,
16
+ sanitize: !1,
17
+ sanitizer: null,
18
+ silent: !1,
19
+ smartypants: !1,
20
+ tokenizer: null,
21
+ walkTokens: null,
22
+ xhtml: !1
23
+ };
24
+ }
25
+ let I = H();
26
+ function K(o) {
27
+ I = o;
28
+ }
29
+ const F = /[&<>"']/, Y = new RegExp(F.source, "g"), X = /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, ee = new RegExp(X.source, "g"), te = {
30
+ "&": "&amp;",
31
+ "<": "&lt;",
32
+ ">": "&gt;",
33
+ '"': "&quot;",
34
+ "'": "&#39;"
35
+ }, U = (o) => te[o];
36
+ function b(o, n) {
37
+ if (n) {
38
+ if (F.test(o))
39
+ return o.replace(Y, U);
40
+ } else if (X.test(o))
41
+ return o.replace(ee, U);
42
+ return o;
43
+ }
44
+ const ne = /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;
45
+ function W(o) {
46
+ return o.replace(ne, (n, t) => (t = t.toLowerCase(), t === "colon" ? ":" : t.charAt(0) === "#" ? t.charAt(1) === "x" ? String.fromCharCode(parseInt(t.substring(2), 16)) : String.fromCharCode(+t.substring(1)) : ""));
47
+ }
48
+ const ie = /(^|[^\[])\^/g;
49
+ function m(o, n) {
50
+ o = typeof o == "string" ? o : o.source, n = n || "";
51
+ const t = {
52
+ replace: (e, i) => (i = i.source || i, i = i.replace(ie, "$1"), o = o.replace(e, i), t),
53
+ getRegex: () => new RegExp(o, n)
54
+ };
55
+ return t;
56
+ }
57
+ const se = /[^\w:]/g, re = /^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;
58
+ function M(o, n, t) {
59
+ if (o) {
60
+ let e;
61
+ try {
62
+ e = decodeURIComponent(W(t)).replace(se, "").toLowerCase();
63
+ } catch {
64
+ return null;
65
+ }
66
+ if (e.indexOf("javascript:") === 0 || e.indexOf("vbscript:") === 0 || e.indexOf("data:") === 0)
67
+ return null;
68
+ }
69
+ n && !re.test(t) && (t = he(n, t));
70
+ try {
71
+ t = encodeURI(t).replace(/%25/g, "%");
72
+ } catch {
73
+ return null;
74
+ }
75
+ return t;
76
+ }
77
+ const L = {}, le = /^[^:]+:\/*[^/]*$/, oe = /^([^:]+:)[\s\S]*$/, ae = /^([^:]+:\/*[^/]*)[\s\S]*$/;
78
+ function he(o, n) {
79
+ L[" " + o] || (le.test(o) ? L[" " + o] = o + "/" : L[" " + o] = Z(o, "/", !0)), o = L[" " + o];
80
+ const t = o.indexOf(":") === -1;
81
+ return n.substring(0, 2) === "//" ? t ? n : o.replace(oe, "$1") + n : n.charAt(0) === "/" ? t ? n : o.replace(ae, "$1") + n : o + n;
82
+ }
83
+ const q = { exec: function() {
84
+ } };
85
+ function P(o, n) {
86
+ const t = o.replace(/\|/g, (s, r, l) => {
87
+ let h = !1, d = r;
88
+ for (; --d >= 0 && l[d] === "\\"; ) h = !h;
89
+ return h ? "|" : " |";
90
+ }), e = t.split(/ \|/);
91
+ let i = 0;
92
+ if (e[0].trim() || e.shift(), e.length > 0 && !e[e.length - 1].trim() && e.pop(), e.length > n)
93
+ e.splice(n);
94
+ else
95
+ for (; e.length < n; ) e.push("");
96
+ for (; i < e.length; i++)
97
+ e[i] = e[i].trim().replace(/\\\|/g, "|");
98
+ return e;
99
+ }
100
+ function Z(o, n, t) {
101
+ const e = o.length;
102
+ if (e === 0)
103
+ return "";
104
+ let i = 0;
105
+ for (; i < e; ) {
106
+ const s = o.charAt(e - i - 1);
107
+ if (s === n && !t)
108
+ i++;
109
+ else if (s !== n && t)
110
+ i++;
111
+ else
112
+ break;
113
+ }
114
+ return o.slice(0, e - i);
115
+ }
116
+ function ce(o, n) {
117
+ if (o.indexOf(n[1]) === -1)
118
+ return -1;
119
+ const t = o.length;
120
+ let e = 0, i = 0;
121
+ for (; i < t; i++)
122
+ if (o[i] === "\\")
123
+ i++;
124
+ else if (o[i] === n[0])
125
+ e++;
126
+ else if (o[i] === n[1] && (e--, e < 0))
127
+ return i;
128
+ return -1;
129
+ }
130
+ function ue(o) {
131
+ o && o.sanitize && !o.silent && console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options");
132
+ }
133
+ function Q(o, n) {
134
+ if (n < 1)
135
+ return "";
136
+ let t = "";
137
+ for (; n > 1; )
138
+ n & 1 && (t += o), n >>= 1, o += o;
139
+ return t + o;
140
+ }
141
+ function j(o, n, t, e) {
142
+ const i = n.href, s = n.title ? b(n.title) : null, r = o[1].replace(/\\([\[\]])/g, "$1");
143
+ if (o[0].charAt(0) !== "!") {
144
+ e.state.inLink = !0;
145
+ const l = {
146
+ type: "link",
147
+ raw: t,
148
+ href: i,
149
+ title: s,
150
+ text: r,
151
+ tokens: e.inlineTokens(r)
152
+ };
153
+ return e.state.inLink = !1, l;
154
+ }
155
+ return {
156
+ type: "image",
157
+ raw: t,
158
+ href: i,
159
+ title: s,
160
+ text: b(r)
161
+ };
162
+ }
163
+ function pe(o, n) {
164
+ const t = o.match(/^(\s+)(?:```)/);
165
+ if (t === null)
166
+ return n;
167
+ const e = t[1];
168
+ return n.split(`
169
+ `).map((i) => {
170
+ const s = i.match(/^\s+/);
171
+ if (s === null)
172
+ return i;
173
+ const [r] = s;
174
+ return r.length >= e.length ? i.slice(e.length) : i;
175
+ }).join(`
176
+ `);
177
+ }
178
+ class D {
179
+ constructor(n) {
180
+ this.options = n || I;
181
+ }
182
+ space(n) {
183
+ const t = this.rules.block.newline.exec(n);
184
+ if (t && t[0].length > 0)
185
+ return {
186
+ type: "space",
187
+ raw: t[0]
188
+ };
189
+ }
190
+ code(n) {
191
+ const t = this.rules.block.code.exec(n);
192
+ if (t) {
193
+ const e = t[0].replace(/^ {1,4}/gm, "");
194
+ return {
195
+ type: "code",
196
+ raw: t[0],
197
+ codeBlockStyle: "indented",
198
+ text: this.options.pedantic ? e : Z(e, `
199
+ `)
200
+ };
201
+ }
202
+ }
203
+ fences(n) {
204
+ const t = this.rules.block.fences.exec(n);
205
+ if (t) {
206
+ const e = t[0], i = pe(e, t[3] || "");
207
+ return {
208
+ type: "code",
209
+ raw: e,
210
+ lang: t[2] ? t[2].trim().replace(this.rules.inline._escapes, "$1") : t[2],
211
+ text: i
212
+ };
213
+ }
214
+ }
215
+ heading(n) {
216
+ const t = this.rules.block.heading.exec(n);
217
+ if (t) {
218
+ let e = t[2].trim();
219
+ if (/#$/.test(e)) {
220
+ const i = Z(e, "#");
221
+ (this.options.pedantic || !i || / $/.test(i)) && (e = i.trim());
222
+ }
223
+ return {
224
+ type: "heading",
225
+ raw: t[0],
226
+ depth: t[1].length,
227
+ text: e,
228
+ tokens: this.lexer.inline(e)
229
+ };
230
+ }
231
+ }
232
+ hr(n) {
233
+ const t = this.rules.block.hr.exec(n);
234
+ if (t)
235
+ return {
236
+ type: "hr",
237
+ raw: t[0]
238
+ };
239
+ }
240
+ blockquote(n) {
241
+ const t = this.rules.block.blockquote.exec(n);
242
+ if (t) {
243
+ const e = t[0].replace(/^ *>[ \t]?/gm, ""), i = this.lexer.state.top;
244
+ this.lexer.state.top = !0;
245
+ const s = this.lexer.blockTokens(e);
246
+ return this.lexer.state.top = i, {
247
+ type: "blockquote",
248
+ raw: t[0],
249
+ tokens: s,
250
+ text: e
251
+ };
252
+ }
253
+ }
254
+ list(n) {
255
+ let t = this.rules.block.list.exec(n);
256
+ if (t) {
257
+ let e, i, s, r, l, h, d, f, g, k, c, z, _ = t[1].trim();
258
+ const R = _.length > 1, x = {
259
+ type: "list",
260
+ raw: "",
261
+ ordered: R,
262
+ start: R ? +_.slice(0, -1) : "",
263
+ loose: !1,
264
+ items: []
265
+ };
266
+ _ = R ? `\\d{1,9}\\${_.slice(-1)}` : `\\${_}`, this.options.pedantic && (_ = R ? _ : "[*+-]");
267
+ const w = new RegExp(`^( {0,3}${_})((?:[ ][^\\n]*)?(?:\\n|$))`);
268
+ for (; n && (z = !1, !(!(t = w.exec(n)) || this.rules.block.hr.test(n))); ) {
269
+ if (e = t[0], n = n.substring(e.length), f = t[2].split(`
270
+ `, 1)[0].replace(/^\t+/, (S) => " ".repeat(3 * S.length)), g = n.split(`
271
+ `, 1)[0], this.options.pedantic ? (r = 2, c = f.trimLeft()) : (r = t[2].search(/[^ ]/), r = r > 4 ? 1 : r, c = f.slice(r), r += t[1].length), h = !1, !f && /^ *$/.test(g) && (e += g + `
272
+ `, n = n.substring(g.length + 1), z = !0), !z) {
273
+ const S = new RegExp(`^ {0,${Math.min(3, r - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), y = new RegExp(`^ {0,${Math.min(3, r - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), $ = new RegExp(`^ {0,${Math.min(3, r - 1)}}(?:\`\`\`|~~~)`), C = new RegExp(`^ {0,${Math.min(3, r - 1)}}#`);
274
+ for (; n && (k = n.split(`
275
+ `, 1)[0], g = k, this.options.pedantic && (g = g.replace(/^ {1,4}(?=( {4})*[^ ])/g, " ")), !($.test(g) || C.test(g) || S.test(g) || y.test(n))); ) {
276
+ if (g.search(/[^ ]/) >= r || !g.trim())
277
+ c += `
278
+ ` + g.slice(r);
279
+ else {
280
+ if (h || f.search(/[^ ]/) >= 4 || $.test(f) || C.test(f) || y.test(f))
281
+ break;
282
+ c += `
283
+ ` + g;
284
+ }
285
+ !h && !g.trim() && (h = !0), e += k + `
286
+ `, n = n.substring(k.length + 1), f = g.slice(r);
287
+ }
288
+ }
289
+ x.loose || (d ? x.loose = !0 : /\n *\n *$/.test(e) && (d = !0)), this.options.gfm && (i = /^\[[ xX]\] /.exec(c), i && (s = i[0] !== "[ ] ", c = c.replace(/^\[[ xX]\] +/, ""))), x.items.push({
290
+ type: "list_item",
291
+ raw: e,
292
+ task: !!i,
293
+ checked: s,
294
+ loose: !1,
295
+ text: c
296
+ }), x.raw += e;
297
+ }
298
+ x.items[x.items.length - 1].raw = e.trimRight(), x.items[x.items.length - 1].text = c.trimRight(), x.raw = x.raw.trimRight();
299
+ const E = x.items.length;
300
+ for (l = 0; l < E; l++)
301
+ if (this.lexer.state.top = !1, x.items[l].tokens = this.lexer.blockTokens(x.items[l].text, []), !x.loose) {
302
+ const S = x.items[l].tokens.filter(($) => $.type === "space"), y = S.length > 0 && S.some(($) => /\n.*\n/.test($.raw));
303
+ x.loose = y;
304
+ }
305
+ if (x.loose)
306
+ for (l = 0; l < E; l++)
307
+ x.items[l].loose = !0;
308
+ return x;
309
+ }
310
+ }
311
+ html(n) {
312
+ const t = this.rules.block.html.exec(n);
313
+ if (t) {
314
+ const e = {
315
+ type: "html",
316
+ raw: t[0],
317
+ pre: !this.options.sanitizer && (t[1] === "pre" || t[1] === "script" || t[1] === "style"),
318
+ text: t[0]
319
+ };
320
+ if (this.options.sanitize) {
321
+ const i = this.options.sanitizer ? this.options.sanitizer(t[0]) : b(t[0]);
322
+ e.type = "paragraph", e.text = i, e.tokens = this.lexer.inline(i);
323
+ }
324
+ return e;
325
+ }
326
+ }
327
+ def(n) {
328
+ const t = this.rules.block.def.exec(n);
329
+ if (t) {
330
+ const e = t[1].toLowerCase().replace(/\s+/g, " "), i = t[2] ? t[2].replace(/^<(.*)>$/, "$1").replace(this.rules.inline._escapes, "$1") : "", s = t[3] ? t[3].substring(1, t[3].length - 1).replace(this.rules.inline._escapes, "$1") : t[3];
331
+ return {
332
+ type: "def",
333
+ tag: e,
334
+ raw: t[0],
335
+ href: i,
336
+ title: s
337
+ };
338
+ }
339
+ }
340
+ table(n) {
341
+ const t = this.rules.block.table.exec(n);
342
+ if (t) {
343
+ const e = {
344
+ type: "table",
345
+ header: P(t[1]).map((i) => ({ text: i })),
346
+ align: t[2].replace(/^ *|\| *$/g, "").split(/ *\| */),
347
+ rows: t[3] && t[3].trim() ? t[3].replace(/\n[ \t]*$/, "").split(`
348
+ `) : []
349
+ };
350
+ if (e.header.length === e.align.length) {
351
+ e.raw = t[0];
352
+ let i = e.align.length, s, r, l, h;
353
+ for (s = 0; s < i; s++)
354
+ /^ *-+: *$/.test(e.align[s]) ? e.align[s] = "right" : /^ *:-+: *$/.test(e.align[s]) ? e.align[s] = "center" : /^ *:-+ *$/.test(e.align[s]) ? e.align[s] = "left" : e.align[s] = null;
355
+ for (i = e.rows.length, s = 0; s < i; s++)
356
+ e.rows[s] = P(e.rows[s], e.header.length).map((d) => ({ text: d }));
357
+ for (i = e.header.length, r = 0; r < i; r++)
358
+ e.header[r].tokens = this.lexer.inline(e.header[r].text);
359
+ for (i = e.rows.length, r = 0; r < i; r++)
360
+ for (h = e.rows[r], l = 0; l < h.length; l++)
361
+ h[l].tokens = this.lexer.inline(h[l].text);
362
+ return e;
363
+ }
364
+ }
365
+ }
366
+ lheading(n) {
367
+ const t = this.rules.block.lheading.exec(n);
368
+ if (t)
369
+ return {
370
+ type: "heading",
371
+ raw: t[0],
372
+ depth: t[2].charAt(0) === "=" ? 1 : 2,
373
+ text: t[1],
374
+ tokens: this.lexer.inline(t[1])
375
+ };
376
+ }
377
+ paragraph(n) {
378
+ const t = this.rules.block.paragraph.exec(n);
379
+ if (t) {
380
+ const e = t[1].charAt(t[1].length - 1) === `
381
+ ` ? t[1].slice(0, -1) : t[1];
382
+ return {
383
+ type: "paragraph",
384
+ raw: t[0],
385
+ text: e,
386
+ tokens: this.lexer.inline(e)
387
+ };
388
+ }
389
+ }
390
+ text(n) {
391
+ const t = this.rules.block.text.exec(n);
392
+ if (t)
393
+ return {
394
+ type: "text",
395
+ raw: t[0],
396
+ text: t[0],
397
+ tokens: this.lexer.inline(t[0])
398
+ };
399
+ }
400
+ escape(n) {
401
+ const t = this.rules.inline.escape.exec(n);
402
+ if (t)
403
+ return {
404
+ type: "escape",
405
+ raw: t[0],
406
+ text: b(t[1])
407
+ };
408
+ }
409
+ tag(n) {
410
+ const t = this.rules.inline.tag.exec(n);
411
+ if (t)
412
+ return !this.lexer.state.inLink && /^<a /i.test(t[0]) ? this.lexer.state.inLink = !0 : this.lexer.state.inLink && /^<\/a>/i.test(t[0]) && (this.lexer.state.inLink = !1), !this.lexer.state.inRawBlock && /^<(pre|code|kbd|script)(\s|>)/i.test(t[0]) ? this.lexer.state.inRawBlock = !0 : this.lexer.state.inRawBlock && /^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0]) && (this.lexer.state.inRawBlock = !1), {
413
+ type: this.options.sanitize ? "text" : "html",
414
+ raw: t[0],
415
+ inLink: this.lexer.state.inLink,
416
+ inRawBlock: this.lexer.state.inRawBlock,
417
+ text: this.options.sanitize ? this.options.sanitizer ? this.options.sanitizer(t[0]) : b(t[0]) : t[0]
418
+ };
419
+ }
420
+ link(n) {
421
+ const t = this.rules.inline.link.exec(n);
422
+ if (t) {
423
+ const e = t[2].trim();
424
+ if (!this.options.pedantic && /^</.test(e)) {
425
+ if (!/>$/.test(e))
426
+ return;
427
+ const r = Z(e.slice(0, -1), "\\");
428
+ if ((e.length - r.length) % 2 === 0)
429
+ return;
430
+ } else {
431
+ const r = ce(t[2], "()");
432
+ if (r > -1) {
433
+ const h = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + r;
434
+ t[2] = t[2].substring(0, r), t[0] = t[0].substring(0, h).trim(), t[3] = "";
435
+ }
436
+ }
437
+ let i = t[2], s = "";
438
+ if (this.options.pedantic) {
439
+ const r = /^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(i);
440
+ r && (i = r[1], s = r[3]);
441
+ } else
442
+ s = t[3] ? t[3].slice(1, -1) : "";
443
+ return i = i.trim(), /^</.test(i) && (this.options.pedantic && !/>$/.test(e) ? i = i.slice(1) : i = i.slice(1, -1)), j(t, {
444
+ href: i && i.replace(this.rules.inline._escapes, "$1"),
445
+ title: s && s.replace(this.rules.inline._escapes, "$1")
446
+ }, t[0], this.lexer);
447
+ }
448
+ }
449
+ reflink(n, t) {
450
+ let e;
451
+ if ((e = this.rules.inline.reflink.exec(n)) || (e = this.rules.inline.nolink.exec(n))) {
452
+ let i = (e[2] || e[1]).replace(/\s+/g, " ");
453
+ if (i = t[i.toLowerCase()], !i) {
454
+ const s = e[0].charAt(0);
455
+ return {
456
+ type: "text",
457
+ raw: s,
458
+ text: s
459
+ };
460
+ }
461
+ return j(e, i, e[0], this.lexer);
462
+ }
463
+ }
464
+ emStrong(n, t, e = "") {
465
+ let i = this.rules.inline.emStrong.lDelim.exec(n);
466
+ if (!i || i[3] && e.match(/[\p{L}\p{N}]/u)) return;
467
+ const s = i[1] || i[2] || "";
468
+ if (!s || s && (e === "" || this.rules.inline.punctuation.exec(e))) {
469
+ const r = i[0].length - 1;
470
+ let l, h, d = r, f = 0;
471
+ const g = i[0][0] === "*" ? this.rules.inline.emStrong.rDelimAst : this.rules.inline.emStrong.rDelimUnd;
472
+ for (g.lastIndex = 0, t = t.slice(-1 * n.length + r); (i = g.exec(t)) != null; ) {
473
+ if (l = i[1] || i[2] || i[3] || i[4] || i[5] || i[6], !l) continue;
474
+ if (h = l.length, i[3] || i[4]) {
475
+ d += h;
476
+ continue;
477
+ } else if ((i[5] || i[6]) && r % 3 && !((r + h) % 3)) {
478
+ f += h;
479
+ continue;
480
+ }
481
+ if (d -= h, d > 0) continue;
482
+ h = Math.min(h, h + d + f);
483
+ const k = n.slice(0, r + i.index + (i[0].length - l.length) + h);
484
+ if (Math.min(r, h) % 2) {
485
+ const z = k.slice(1, -1);
486
+ return {
487
+ type: "em",
488
+ raw: k,
489
+ text: z,
490
+ tokens: this.lexer.inlineTokens(z)
491
+ };
492
+ }
493
+ const c = k.slice(2, -2);
494
+ return {
495
+ type: "strong",
496
+ raw: k,
497
+ text: c,
498
+ tokens: this.lexer.inlineTokens(c)
499
+ };
500
+ }
501
+ }
502
+ }
503
+ codespan(n) {
504
+ const t = this.rules.inline.code.exec(n);
505
+ if (t) {
506
+ let e = t[2].replace(/\n/g, " ");
507
+ const i = /[^ ]/.test(e), s = /^ /.test(e) && / $/.test(e);
508
+ return i && s && (e = e.substring(1, e.length - 1)), e = b(e, !0), {
509
+ type: "codespan",
510
+ raw: t[0],
511
+ text: e
512
+ };
513
+ }
514
+ }
515
+ br(n) {
516
+ const t = this.rules.inline.br.exec(n);
517
+ if (t)
518
+ return {
519
+ type: "br",
520
+ raw: t[0]
521
+ };
522
+ }
523
+ del(n) {
524
+ const t = this.rules.inline.del.exec(n);
525
+ if (t)
526
+ return {
527
+ type: "del",
528
+ raw: t[0],
529
+ text: t[2],
530
+ tokens: this.lexer.inlineTokens(t[2])
531
+ };
532
+ }
533
+ autolink(n, t) {
534
+ const e = this.rules.inline.autolink.exec(n);
535
+ if (e) {
536
+ let i, s;
537
+ return e[2] === "@" ? (i = b(this.options.mangle ? t(e[1]) : e[1]), s = "mailto:" + i) : (i = b(e[1]), s = i), {
538
+ type: "link",
539
+ raw: e[0],
540
+ text: i,
541
+ href: s,
542
+ tokens: [
543
+ {
544
+ type: "text",
545
+ raw: i,
546
+ text: i
547
+ }
548
+ ]
549
+ };
550
+ }
551
+ }
552
+ url(n, t) {
553
+ let e;
554
+ if (e = this.rules.inline.url.exec(n)) {
555
+ let i, s;
556
+ if (e[2] === "@")
557
+ i = b(this.options.mangle ? t(e[0]) : e[0]), s = "mailto:" + i;
558
+ else {
559
+ let r;
560
+ do
561
+ r = e[0], e[0] = this.rules.inline._backpedal.exec(e[0])[0];
562
+ while (r !== e[0]);
563
+ i = b(e[0]), e[1] === "www." ? s = "http://" + e[0] : s = e[0];
564
+ }
565
+ return {
566
+ type: "link",
567
+ raw: e[0],
568
+ text: i,
569
+ href: s,
570
+ tokens: [
571
+ {
572
+ type: "text",
573
+ raw: i,
574
+ text: i
575
+ }
576
+ ]
577
+ };
578
+ }
579
+ }
580
+ inlineText(n, t) {
581
+ const e = this.rules.inline.text.exec(n);
582
+ if (e) {
583
+ let i;
584
+ return this.lexer.state.inRawBlock ? i = this.options.sanitize ? this.options.sanitizer ? this.options.sanitizer(e[0]) : b(e[0]) : e[0] : i = b(this.options.smartypants ? t(e[0]) : e[0]), {
585
+ type: "text",
586
+ raw: e[0],
587
+ text: i
588
+ };
589
+ }
590
+ }
591
+ }
592
+ const u = {
593
+ newline: /^(?: *(?:\n|$))+/,
594
+ code: /^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,
595
+ fences: /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,
596
+ hr: /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,
597
+ heading: /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,
598
+ blockquote: /^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,
599
+ list: /^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,
600
+ html: "^ {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|$))",
601
+ def: /^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,
602
+ table: q,
603
+ lheading: /^((?:.|\n(?!\n))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
604
+ // regex template, placeholders will be replaced according to different paragraph
605
+ // interruption rules of commonmark and the original markdown spec:
606
+ _paragraph: /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,
607
+ text: /^[^\n]+/
608
+ };
609
+ u._label = /(?!\s*\])(?:\\.|[^\[\]\\])+/;
610
+ u._title = /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;
611
+ u.def = m(u.def).replace("label", u._label).replace("title", u._title).getRegex();
612
+ u.bullet = /(?:[*+-]|\d{1,9}[.)])/;
613
+ u.listItemStart = m(/^( *)(bull) */).replace("bull", u.bullet).getRegex();
614
+ u.list = m(u.list).replace(/bull/g, u.bullet).replace("hr", "\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def", "\\n+(?=" + u.def.source + ")").getRegex();
615
+ u._tag = "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|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";
616
+ u._comment = /<!--(?!-?>)[\s\S]*?(?:-->|$)/;
617
+ u.html = m(u.html, "i").replace("comment", u._comment).replace("tag", u._tag).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();
618
+ u.paragraph = m(u._paragraph).replace("hr", u.hr).replace("heading", " {0,3}#{1,6} ").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", u._tag).getRegex();
619
+ u.blockquote = m(u.blockquote).replace("paragraph", u.paragraph).getRegex();
620
+ u.normal = { ...u };
621
+ u.gfm = {
622
+ ...u.normal,
623
+ table: "^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"
624
+ // Cells
625
+ };
626
+ u.gfm.table = m(u.gfm.table).replace("hr", u.hr).replace("heading", " {0,3}#{1,6} ").replace("blockquote", " {0,3}>").replace("code", " {4}[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", u._tag).getRegex();
627
+ u.gfm.paragraph = m(u._paragraph).replace("hr", u.hr).replace("heading", " {0,3}#{1,6} ").replace("|lheading", "").replace("table", u.gfm.table).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", u._tag).getRegex();
628
+ u.pedantic = {
629
+ ...u.normal,
630
+ html: m(
631
+ `^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`
632
+ ).replace("comment", u._comment).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(),
633
+ def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
634
+ heading: /^(#{1,6})(.*)(?:\n+|$)/,
635
+ fences: q,
636
+ // fences not supported
637
+ lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
638
+ paragraph: m(u.normal._paragraph).replace("hr", u.hr).replace("heading", ` *#{1,6} *[^
639
+ ]`).replace("lheading", u.lheading).replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").getRegex()
640
+ };
641
+ const a = {
642
+ escape: /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,
643
+ autolink: /^<(scheme:[^\s\x00-\x1f<>]*|email)>/,
644
+ url: q,
645
+ tag: "^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",
646
+ // CDATA section
647
+ link: /^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,
648
+ reflink: /^!?\[(label)\]\[(ref)\]/,
649
+ nolink: /^!?\[(ref)\](?:\[\])?/,
650
+ reflinkSearch: "reflink|nolink(?!\\()",
651
+ emStrong: {
652
+ lDelim: /^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,
653
+ // (1) and (2) can only be a Right Delimiter. (3) and (4) can only be Left. (5) and (6) can be either Left or Right.
654
+ // () Skip orphan inside strong () Consume to delim (1) #*** (2) a***#, a*** (3) #***a, ***a (4) ***# (5) #***# (6) a***a
655
+ rDelimAst: /^(?:[^_*\\]|\\.)*?\_\_(?:[^_*\\]|\\.)*?\*(?:[^_*\\]|\\.)*?(?=\_\_)|(?:[^*\\]|\\.)+(?=[^*])|[punct_](\*+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|(?:[^punct*_\s\\]|\\.)(\*+)(?=[^punct*_\s])/,
656
+ rDelimUnd: /^(?:[^_*\\]|\\.)*?\*\*(?:[^_*\\]|\\.)*?\_(?:[^_*\\]|\\.)*?(?=\*\*)|(?:[^_\\]|\\.)+(?=[^_])|[punct*](\_+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/
657
+ // ^- Not allowed for _
658
+ },
659
+ code: /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,
660
+ br: /^( {2,}|\\)\n(?!\s*$)/,
661
+ del: q,
662
+ text: /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,
663
+ punctuation: /^([\spunctuation])/
664
+ };
665
+ a._punctuation = "!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~";
666
+ a.punctuation = m(a.punctuation).replace(/punctuation/g, a._punctuation).getRegex();
667
+ a.blockSkip = /\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g;
668
+ a.escapedEmSt = /(?:^|[^\\])(?:\\\\)*\\[*_]/g;
669
+ a._comment = m(u._comment).replace("(?:-->|$)", "-->").getRegex();
670
+ a.emStrong.lDelim = m(a.emStrong.lDelim).replace(/punct/g, a._punctuation).getRegex();
671
+ a.emStrong.rDelimAst = m(a.emStrong.rDelimAst, "g").replace(/punct/g, a._punctuation).getRegex();
672
+ a.emStrong.rDelimUnd = m(a.emStrong.rDelimUnd, "g").replace(/punct/g, a._punctuation).getRegex();
673
+ a._escapes = /\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g;
674
+ a._scheme = /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;
675
+ a._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])?)+(?![-_])/;
676
+ a.autolink = m(a.autolink).replace("scheme", a._scheme).replace("email", a._email).getRegex();
677
+ a._attribute = /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;
678
+ a.tag = m(a.tag).replace("comment", a._comment).replace("attribute", a._attribute).getRegex();
679
+ a._label = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;
680
+ a._href = /<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;
681
+ a._title = /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;
682
+ a.link = m(a.link).replace("label", a._label).replace("href", a._href).replace("title", a._title).getRegex();
683
+ a.reflink = m(a.reflink).replace("label", a._label).replace("ref", u._label).getRegex();
684
+ a.nolink = m(a.nolink).replace("ref", u._label).getRegex();
685
+ a.reflinkSearch = m(a.reflinkSearch, "g").replace("reflink", a.reflink).replace("nolink", a.nolink).getRegex();
686
+ a.normal = { ...a };
687
+ a.pedantic = {
688
+ ...a.normal,
689
+ strong: {
690
+ start: /^__|\*\*/,
691
+ middle: /^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,
692
+ endAst: /\*\*(?!\*)/g,
693
+ endUnd: /__(?!_)/g
694
+ },
695
+ em: {
696
+ start: /^_|\*/,
697
+ middle: /^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,
698
+ endAst: /\*(?!\*)/g,
699
+ endUnd: /_(?!_)/g
700
+ },
701
+ link: m(/^!?\[(label)\]\((.*?)\)/).replace("label", a._label).getRegex(),
702
+ reflink: m(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", a._label).getRegex()
703
+ };
704
+ a.gfm = {
705
+ ...a.normal,
706
+ escape: m(a.escape).replace("])", "~|])").getRegex(),
707
+ _extended_email: /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,
708
+ url: /^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,
709
+ _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
710
+ del: /^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,
711
+ text: /^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/
712
+ };
713
+ a.gfm.url = m(a.gfm.url, "i").replace("email", a.gfm._extended_email).getRegex();
714
+ a.breaks = {
715
+ ...a.gfm,
716
+ br: m(a.br).replace("{2,}", "*").getRegex(),
717
+ text: m(a.gfm.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
718
+ };
719
+ function fe(o) {
720
+ return o.replace(/---/g, "—").replace(/--/g, "–").replace(/(^|[-\u2014/(\[{"\s])'/g, "$1‘").replace(/'/g, "’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g, "$1“").replace(/"/g, "”").replace(/\.{3}/g, "…");
721
+ }
722
+ function N(o) {
723
+ let n = "", t, e;
724
+ const i = o.length;
725
+ for (t = 0; t < i; t++)
726
+ e = o.charCodeAt(t), Math.random() > 0.5 && (e = "x" + e.toString(16)), n += "&#" + e + ";";
727
+ return n;
728
+ }
729
+ class T {
730
+ constructor(n) {
731
+ this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = n || I, this.options.tokenizer = this.options.tokenizer || new D(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
732
+ inLink: !1,
733
+ inRawBlock: !1,
734
+ top: !0
735
+ };
736
+ const t = {
737
+ block: u.normal,
738
+ inline: a.normal
739
+ };
740
+ this.options.pedantic ? (t.block = u.pedantic, t.inline = a.pedantic) : this.options.gfm && (t.block = u.gfm, this.options.breaks ? t.inline = a.breaks : t.inline = a.gfm), this.tokenizer.rules = t;
741
+ }
742
+ /**
743
+ * Expose Rules
744
+ */
745
+ static get rules() {
746
+ return {
747
+ block: u,
748
+ inline: a
749
+ };
750
+ }
751
+ /**
752
+ * Static Lex Method
753
+ */
754
+ static lex(n, t) {
755
+ return new T(t).lex(n);
756
+ }
757
+ /**
758
+ * Static Lex Inline Method
759
+ */
760
+ static lexInline(n, t) {
761
+ return new T(t).inlineTokens(n);
762
+ }
763
+ /**
764
+ * Preprocessing
765
+ */
766
+ lex(n) {
767
+ n = n.replace(/\r\n|\r/g, `
768
+ `), this.blockTokens(n, this.tokens);
769
+ let t;
770
+ for (; t = this.inlineQueue.shift(); )
771
+ this.inlineTokens(t.src, t.tokens);
772
+ return this.tokens;
773
+ }
774
+ /**
775
+ * Lexing
776
+ */
777
+ blockTokens(n, t = []) {
778
+ this.options.pedantic ? n = n.replace(/\t/g, " ").replace(/^ +$/gm, "") : n = n.replace(/^( *)(\t+)/gm, (l, h, d) => h + " ".repeat(d.length));
779
+ let e, i, s, r;
780
+ for (; n; )
781
+ if (!(this.options.extensions && this.options.extensions.block && this.options.extensions.block.some((l) => (e = l.call({ lexer: this }, n, t)) ? (n = n.substring(e.raw.length), t.push(e), !0) : !1))) {
782
+ if (e = this.tokenizer.space(n)) {
783
+ n = n.substring(e.raw.length), e.raw.length === 1 && t.length > 0 ? t[t.length - 1].raw += `
784
+ ` : t.push(e);
785
+ continue;
786
+ }
787
+ if (e = this.tokenizer.code(n)) {
788
+ n = n.substring(e.raw.length), i = t[t.length - 1], i && (i.type === "paragraph" || i.type === "text") ? (i.raw += `
789
+ ` + e.raw, i.text += `
790
+ ` + e.text, this.inlineQueue[this.inlineQueue.length - 1].src = i.text) : t.push(e);
791
+ continue;
792
+ }
793
+ if (e = this.tokenizer.fences(n)) {
794
+ n = n.substring(e.raw.length), t.push(e);
795
+ continue;
796
+ }
797
+ if (e = this.tokenizer.heading(n)) {
798
+ n = n.substring(e.raw.length), t.push(e);
799
+ continue;
800
+ }
801
+ if (e = this.tokenizer.hr(n)) {
802
+ n = n.substring(e.raw.length), t.push(e);
803
+ continue;
804
+ }
805
+ if (e = this.tokenizer.blockquote(n)) {
806
+ n = n.substring(e.raw.length), t.push(e);
807
+ continue;
808
+ }
809
+ if (e = this.tokenizer.list(n)) {
810
+ n = n.substring(e.raw.length), t.push(e);
811
+ continue;
812
+ }
813
+ if (e = this.tokenizer.html(n)) {
814
+ n = n.substring(e.raw.length), t.push(e);
815
+ continue;
816
+ }
817
+ if (e = this.tokenizer.def(n)) {
818
+ n = n.substring(e.raw.length), i = t[t.length - 1], i && (i.type === "paragraph" || i.type === "text") ? (i.raw += `
819
+ ` + e.raw, i.text += `
820
+ ` + e.raw, this.inlineQueue[this.inlineQueue.length - 1].src = i.text) : this.tokens.links[e.tag] || (this.tokens.links[e.tag] = {
821
+ href: e.href,
822
+ title: e.title
823
+ });
824
+ continue;
825
+ }
826
+ if (e = this.tokenizer.table(n)) {
827
+ n = n.substring(e.raw.length), t.push(e);
828
+ continue;
829
+ }
830
+ if (e = this.tokenizer.lheading(n)) {
831
+ n = n.substring(e.raw.length), t.push(e);
832
+ continue;
833
+ }
834
+ if (s = n, this.options.extensions && this.options.extensions.startBlock) {
835
+ let l = 1 / 0;
836
+ const h = n.slice(1);
837
+ let d;
838
+ this.options.extensions.startBlock.forEach(function(f) {
839
+ d = f.call({ lexer: this }, h), typeof d == "number" && d >= 0 && (l = Math.min(l, d));
840
+ }), l < 1 / 0 && l >= 0 && (s = n.substring(0, l + 1));
841
+ }
842
+ if (this.state.top && (e = this.tokenizer.paragraph(s))) {
843
+ i = t[t.length - 1], r && i.type === "paragraph" ? (i.raw += `
844
+ ` + e.raw, i.text += `
845
+ ` + e.text, this.inlineQueue.pop(), this.inlineQueue[this.inlineQueue.length - 1].src = i.text) : t.push(e), r = s.length !== n.length, n = n.substring(e.raw.length);
846
+ continue;
847
+ }
848
+ if (e = this.tokenizer.text(n)) {
849
+ n = n.substring(e.raw.length), i = t[t.length - 1], i && i.type === "text" ? (i.raw += `
850
+ ` + e.raw, i.text += `
851
+ ` + e.text, this.inlineQueue.pop(), this.inlineQueue[this.inlineQueue.length - 1].src = i.text) : t.push(e);
852
+ continue;
853
+ }
854
+ if (n) {
855
+ const l = "Infinite loop on byte: " + n.charCodeAt(0);
856
+ if (this.options.silent) {
857
+ console.error(l);
858
+ break;
859
+ } else
860
+ throw new Error(l);
861
+ }
862
+ }
863
+ return this.state.top = !0, t;
864
+ }
865
+ inline(n, t = []) {
866
+ return this.inlineQueue.push({ src: n, tokens: t }), t;
867
+ }
868
+ /**
869
+ * Lexing/Compiling
870
+ */
871
+ inlineTokens(n, t = []) {
872
+ let e, i, s, r = n, l, h, d;
873
+ if (this.tokens.links) {
874
+ const f = Object.keys(this.tokens.links);
875
+ if (f.length > 0)
876
+ for (; (l = this.tokenizer.rules.inline.reflinkSearch.exec(r)) != null; )
877
+ f.includes(l[0].slice(l[0].lastIndexOf("[") + 1, -1)) && (r = r.slice(0, l.index) + "[" + Q("a", l[0].length - 2) + "]" + r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
878
+ }
879
+ for (; (l = this.tokenizer.rules.inline.blockSkip.exec(r)) != null; )
880
+ r = r.slice(0, l.index) + "[" + Q("a", l[0].length - 2) + "]" + r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
881
+ for (; (l = this.tokenizer.rules.inline.escapedEmSt.exec(r)) != null; )
882
+ r = r.slice(0, l.index + l[0].length - 2) + "++" + r.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex), this.tokenizer.rules.inline.escapedEmSt.lastIndex--;
883
+ for (; n; )
884
+ if (h || (d = ""), h = !1, !(this.options.extensions && this.options.extensions.inline && this.options.extensions.inline.some((f) => (e = f.call({ lexer: this }, n, t)) ? (n = n.substring(e.raw.length), t.push(e), !0) : !1))) {
885
+ if (e = this.tokenizer.escape(n)) {
886
+ n = n.substring(e.raw.length), t.push(e);
887
+ continue;
888
+ }
889
+ if (e = this.tokenizer.tag(n)) {
890
+ n = n.substring(e.raw.length), i = t[t.length - 1], i && e.type === "text" && i.type === "text" ? (i.raw += e.raw, i.text += e.text) : t.push(e);
891
+ continue;
892
+ }
893
+ if (e = this.tokenizer.link(n)) {
894
+ n = n.substring(e.raw.length), t.push(e);
895
+ continue;
896
+ }
897
+ if (e = this.tokenizer.reflink(n, this.tokens.links)) {
898
+ n = n.substring(e.raw.length), i = t[t.length - 1], i && e.type === "text" && i.type === "text" ? (i.raw += e.raw, i.text += e.text) : t.push(e);
899
+ continue;
900
+ }
901
+ if (e = this.tokenizer.emStrong(n, r, d)) {
902
+ n = n.substring(e.raw.length), t.push(e);
903
+ continue;
904
+ }
905
+ if (e = this.tokenizer.codespan(n)) {
906
+ n = n.substring(e.raw.length), t.push(e);
907
+ continue;
908
+ }
909
+ if (e = this.tokenizer.br(n)) {
910
+ n = n.substring(e.raw.length), t.push(e);
911
+ continue;
912
+ }
913
+ if (e = this.tokenizer.del(n)) {
914
+ n = n.substring(e.raw.length), t.push(e);
915
+ continue;
916
+ }
917
+ if (e = this.tokenizer.autolink(n, N)) {
918
+ n = n.substring(e.raw.length), t.push(e);
919
+ continue;
920
+ }
921
+ if (!this.state.inLink && (e = this.tokenizer.url(n, N))) {
922
+ n = n.substring(e.raw.length), t.push(e);
923
+ continue;
924
+ }
925
+ if (s = n, this.options.extensions && this.options.extensions.startInline) {
926
+ let f = 1 / 0;
927
+ const g = n.slice(1);
928
+ let k;
929
+ this.options.extensions.startInline.forEach(function(c) {
930
+ k = c.call({ lexer: this }, g), typeof k == "number" && k >= 0 && (f = Math.min(f, k));
931
+ }), f < 1 / 0 && f >= 0 && (s = n.substring(0, f + 1));
932
+ }
933
+ if (e = this.tokenizer.inlineText(s, fe)) {
934
+ n = n.substring(e.raw.length), e.raw.slice(-1) !== "_" && (d = e.raw.slice(-1)), h = !0, i = t[t.length - 1], i && i.type === "text" ? (i.raw += e.raw, i.text += e.text) : t.push(e);
935
+ continue;
936
+ }
937
+ if (n) {
938
+ const f = "Infinite loop on byte: " + n.charCodeAt(0);
939
+ if (this.options.silent) {
940
+ console.error(f);
941
+ break;
942
+ } else
943
+ throw new Error(f);
944
+ }
945
+ }
946
+ return t;
947
+ }
948
+ }
949
+ class v {
950
+ constructor(n) {
951
+ this.options = n || I;
952
+ }
953
+ code(n, t, e) {
954
+ const i = (t || "").match(/\S*/)[0];
955
+ if (this.options.highlight) {
956
+ const s = this.options.highlight(n, i);
957
+ s != null && s !== n && (e = !0, n = s);
958
+ }
959
+ return n = n.replace(/\n$/, "") + `
960
+ `, i ? '<pre><code class="' + this.options.langPrefix + b(i) + '">' + (e ? n : b(n, !0)) + `</code></pre>
961
+ ` : "<pre><code>" + (e ? n : b(n, !0)) + `</code></pre>
962
+ `;
963
+ }
964
+ /**
965
+ * @param {string} quote
966
+ */
967
+ blockquote(n) {
968
+ return `<blockquote>
969
+ ${n}</blockquote>
970
+ `;
971
+ }
972
+ html(n) {
973
+ return n;
974
+ }
975
+ /**
976
+ * @param {string} text
977
+ * @param {string} level
978
+ * @param {string} raw
979
+ * @param {any} slugger
980
+ */
981
+ heading(n, t, e, i) {
982
+ if (this.options.headerIds) {
983
+ const s = this.options.headerPrefix + i.slug(e);
984
+ return `<h${t} id="${s}">${n}</h${t}>
985
+ `;
986
+ }
987
+ return `<h${t}>${n}</h${t}>
988
+ `;
989
+ }
990
+ hr() {
991
+ return this.options.xhtml ? `<hr/>
992
+ ` : `<hr>
993
+ `;
994
+ }
995
+ list(n, t, e) {
996
+ const i = t ? "ol" : "ul", s = t && e !== 1 ? ' start="' + e + '"' : "";
997
+ return "<" + i + s + `>
998
+ ` + n + "</" + i + `>
999
+ `;
1000
+ }
1001
+ /**
1002
+ * @param {string} text
1003
+ */
1004
+ listitem(n) {
1005
+ return `<li>${n}</li>
1006
+ `;
1007
+ }
1008
+ checkbox(n) {
1009
+ return "<input " + (n ? 'checked="" ' : "") + 'disabled="" type="checkbox"' + (this.options.xhtml ? " /" : "") + "> ";
1010
+ }
1011
+ /**
1012
+ * @param {string} text
1013
+ */
1014
+ paragraph(n) {
1015
+ return `<p>${n}</p>
1016
+ `;
1017
+ }
1018
+ /**
1019
+ * @param {string} header
1020
+ * @param {string} body
1021
+ */
1022
+ table(n, t) {
1023
+ return t && (t = `<tbody>${t}</tbody>`), `<table>
1024
+ <thead>
1025
+ ` + n + `</thead>
1026
+ ` + t + `</table>
1027
+ `;
1028
+ }
1029
+ /**
1030
+ * @param {string} content
1031
+ */
1032
+ tablerow(n) {
1033
+ return `<tr>
1034
+ ${n}</tr>
1035
+ `;
1036
+ }
1037
+ tablecell(n, t) {
1038
+ const e = t.header ? "th" : "td";
1039
+ return (t.align ? `<${e} align="${t.align}">` : `<${e}>`) + n + `</${e}>
1040
+ `;
1041
+ }
1042
+ /**
1043
+ * span level renderer
1044
+ * @param {string} text
1045
+ */
1046
+ strong(n) {
1047
+ return `<strong>${n}</strong>`;
1048
+ }
1049
+ /**
1050
+ * @param {string} text
1051
+ */
1052
+ em(n) {
1053
+ return `<em>${n}</em>`;
1054
+ }
1055
+ /**
1056
+ * @param {string} text
1057
+ */
1058
+ codespan(n) {
1059
+ return `<code>${n}</code>`;
1060
+ }
1061
+ br() {
1062
+ return this.options.xhtml ? "<br/>" : "<br>";
1063
+ }
1064
+ /**
1065
+ * @param {string} text
1066
+ */
1067
+ del(n) {
1068
+ return `<del>${n}</del>`;
1069
+ }
1070
+ /**
1071
+ * @param {string} href
1072
+ * @param {string} title
1073
+ * @param {string} text
1074
+ */
1075
+ link(n, t, e) {
1076
+ if (n = M(this.options.sanitize, this.options.baseUrl, n), n === null)
1077
+ return e;
1078
+ let i = '<a href="' + n + '"';
1079
+ return t && (i += ' title="' + t + '"'), i += ">" + e + "</a>", i;
1080
+ }
1081
+ /**
1082
+ * @param {string} href
1083
+ * @param {string} title
1084
+ * @param {string} text
1085
+ */
1086
+ image(n, t, e) {
1087
+ if (n = M(this.options.sanitize, this.options.baseUrl, n), n === null)
1088
+ return e;
1089
+ let i = `<img src="${n}" alt="${e}"`;
1090
+ return t && (i += ` title="${t}"`), i += this.options.xhtml ? "/>" : ">", i;
1091
+ }
1092
+ text(n) {
1093
+ return n;
1094
+ }
1095
+ }
1096
+ class G {
1097
+ // no need for block level renderers
1098
+ strong(n) {
1099
+ return n;
1100
+ }
1101
+ em(n) {
1102
+ return n;
1103
+ }
1104
+ codespan(n) {
1105
+ return n;
1106
+ }
1107
+ del(n) {
1108
+ return n;
1109
+ }
1110
+ html(n) {
1111
+ return n;
1112
+ }
1113
+ text(n) {
1114
+ return n;
1115
+ }
1116
+ link(n, t, e) {
1117
+ return "" + e;
1118
+ }
1119
+ image(n, t, e) {
1120
+ return "" + e;
1121
+ }
1122
+ br() {
1123
+ return "";
1124
+ }
1125
+ }
1126
+ class V {
1127
+ constructor() {
1128
+ this.seen = {};
1129
+ }
1130
+ /**
1131
+ * @param {string} value
1132
+ */
1133
+ serialize(n) {
1134
+ return n.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig, "").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g, "").replace(/\s/g, "-");
1135
+ }
1136
+ /**
1137
+ * Finds the next safe (unique) slug to use
1138
+ * @param {string} originalSlug
1139
+ * @param {boolean} isDryRun
1140
+ */
1141
+ getNextSafeSlug(n, t) {
1142
+ let e = n, i = 0;
1143
+ if (this.seen.hasOwnProperty(e)) {
1144
+ i = this.seen[n];
1145
+ do
1146
+ i++, e = n + "-" + i;
1147
+ while (this.seen.hasOwnProperty(e));
1148
+ }
1149
+ return t || (this.seen[n] = i, this.seen[e] = 0), e;
1150
+ }
1151
+ /**
1152
+ * Convert string to unique id
1153
+ * @param {object} [options]
1154
+ * @param {boolean} [options.dryrun] Generates the next unique slug without
1155
+ * updating the internal accumulator.
1156
+ */
1157
+ slug(n, t = {}) {
1158
+ const e = this.serialize(n);
1159
+ return this.getNextSafeSlug(e, t.dryrun);
1160
+ }
1161
+ }
1162
+ class A {
1163
+ constructor(n) {
1164
+ this.options = n || I, this.options.renderer = this.options.renderer || new v(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.textRenderer = new G(), this.slugger = new V();
1165
+ }
1166
+ /**
1167
+ * Static Parse Method
1168
+ */
1169
+ static parse(n, t) {
1170
+ return new A(t).parse(n);
1171
+ }
1172
+ /**
1173
+ * Static Parse Inline Method
1174
+ */
1175
+ static parseInline(n, t) {
1176
+ return new A(t).parseInline(n);
1177
+ }
1178
+ /**
1179
+ * Parse Loop
1180
+ */
1181
+ parse(n, t = !0) {
1182
+ let e = "", i, s, r, l, h, d, f, g, k, c, z, _, R, x, w, E, S, y, $;
1183
+ const C = n.length;
1184
+ for (i = 0; i < C; i++) {
1185
+ if (c = n[i], this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[c.type] && ($ = this.options.extensions.renderers[c.type].call({ parser: this }, c), $ !== !1 || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "paragraph", "text"].includes(c.type))) {
1186
+ e += $ || "";
1187
+ continue;
1188
+ }
1189
+ switch (c.type) {
1190
+ case "space":
1191
+ continue;
1192
+ case "hr": {
1193
+ e += this.renderer.hr();
1194
+ continue;
1195
+ }
1196
+ case "heading": {
1197
+ e += this.renderer.heading(
1198
+ this.parseInline(c.tokens),
1199
+ c.depth,
1200
+ W(this.parseInline(c.tokens, this.textRenderer)),
1201
+ this.slugger
1202
+ );
1203
+ continue;
1204
+ }
1205
+ case "code": {
1206
+ e += this.renderer.code(
1207
+ c.text,
1208
+ c.lang,
1209
+ c.escaped
1210
+ );
1211
+ continue;
1212
+ }
1213
+ case "table": {
1214
+ for (g = "", f = "", l = c.header.length, s = 0; s < l; s++)
1215
+ f += this.renderer.tablecell(
1216
+ this.parseInline(c.header[s].tokens),
1217
+ { header: !0, align: c.align[s] }
1218
+ );
1219
+ for (g += this.renderer.tablerow(f), k = "", l = c.rows.length, s = 0; s < l; s++) {
1220
+ for (d = c.rows[s], f = "", h = d.length, r = 0; r < h; r++)
1221
+ f += this.renderer.tablecell(
1222
+ this.parseInline(d[r].tokens),
1223
+ { header: !1, align: c.align[r] }
1224
+ );
1225
+ k += this.renderer.tablerow(f);
1226
+ }
1227
+ e += this.renderer.table(g, k);
1228
+ continue;
1229
+ }
1230
+ case "blockquote": {
1231
+ k = this.parse(c.tokens), e += this.renderer.blockquote(k);
1232
+ continue;
1233
+ }
1234
+ case "list": {
1235
+ for (z = c.ordered, _ = c.start, R = c.loose, l = c.items.length, k = "", s = 0; s < l; s++)
1236
+ w = c.items[s], E = w.checked, S = w.task, x = "", w.task && (y = this.renderer.checkbox(E), R ? w.tokens.length > 0 && w.tokens[0].type === "paragraph" ? (w.tokens[0].text = y + " " + w.tokens[0].text, w.tokens[0].tokens && w.tokens[0].tokens.length > 0 && w.tokens[0].tokens[0].type === "text" && (w.tokens[0].tokens[0].text = y + " " + w.tokens[0].tokens[0].text)) : w.tokens.unshift({
1237
+ type: "text",
1238
+ text: y
1239
+ }) : x += y), x += this.parse(w.tokens, R), k += this.renderer.listitem(x, S, E);
1240
+ e += this.renderer.list(k, z, _);
1241
+ continue;
1242
+ }
1243
+ case "html": {
1244
+ e += this.renderer.html(c.text);
1245
+ continue;
1246
+ }
1247
+ case "paragraph": {
1248
+ e += this.renderer.paragraph(this.parseInline(c.tokens));
1249
+ continue;
1250
+ }
1251
+ case "text": {
1252
+ for (k = c.tokens ? this.parseInline(c.tokens) : c.text; i + 1 < C && n[i + 1].type === "text"; )
1253
+ c = n[++i], k += `
1254
+ ` + (c.tokens ? this.parseInline(c.tokens) : c.text);
1255
+ e += t ? this.renderer.paragraph(k) : k;
1256
+ continue;
1257
+ }
1258
+ default: {
1259
+ const O = 'Token with "' + c.type + '" type was not found.';
1260
+ if (this.options.silent) {
1261
+ console.error(O);
1262
+ return;
1263
+ } else
1264
+ throw new Error(O);
1265
+ }
1266
+ }
1267
+ }
1268
+ return e;
1269
+ }
1270
+ /**
1271
+ * Parse Inline Tokens
1272
+ */
1273
+ parseInline(n, t) {
1274
+ t = t || this.renderer;
1275
+ let e = "", i, s, r;
1276
+ const l = n.length;
1277
+ for (i = 0; i < l; i++) {
1278
+ if (s = n[i], this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[s.type] && (r = this.options.extensions.renderers[s.type].call({ parser: this }, s), r !== !1 || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(s.type))) {
1279
+ e += r || "";
1280
+ continue;
1281
+ }
1282
+ switch (s.type) {
1283
+ case "escape": {
1284
+ e += t.text(s.text);
1285
+ break;
1286
+ }
1287
+ case "html": {
1288
+ e += t.html(s.text);
1289
+ break;
1290
+ }
1291
+ case "link": {
1292
+ e += t.link(s.href, s.title, this.parseInline(s.tokens, t));
1293
+ break;
1294
+ }
1295
+ case "image": {
1296
+ e += t.image(s.href, s.title, s.text);
1297
+ break;
1298
+ }
1299
+ case "strong": {
1300
+ e += t.strong(this.parseInline(s.tokens, t));
1301
+ break;
1302
+ }
1303
+ case "em": {
1304
+ e += t.em(this.parseInline(s.tokens, t));
1305
+ break;
1306
+ }
1307
+ case "codespan": {
1308
+ e += t.codespan(s.text);
1309
+ break;
1310
+ }
1311
+ case "br": {
1312
+ e += t.br();
1313
+ break;
1314
+ }
1315
+ case "del": {
1316
+ e += t.del(this.parseInline(s.tokens, t));
1317
+ break;
1318
+ }
1319
+ case "text": {
1320
+ e += t.text(s.text);
1321
+ break;
1322
+ }
1323
+ default: {
1324
+ const h = 'Token with "' + s.type + '" type was not found.';
1325
+ if (this.options.silent) {
1326
+ console.error(h);
1327
+ return;
1328
+ } else
1329
+ throw new Error(h);
1330
+ }
1331
+ }
1332
+ }
1333
+ return e;
1334
+ }
1335
+ }
1336
+ class B {
1337
+ constructor(n) {
1338
+ this.options = n || I;
1339
+ }
1340
+ static passThroughHooks = /* @__PURE__ */ new Set([
1341
+ "preprocess",
1342
+ "postprocess"
1343
+ ]);
1344
+ /**
1345
+ * Process markdown before marked
1346
+ */
1347
+ preprocess(n) {
1348
+ return n;
1349
+ }
1350
+ /**
1351
+ * Process HTML after marked is finished
1352
+ */
1353
+ postprocess(n) {
1354
+ return n;
1355
+ }
1356
+ }
1357
+ function ge(o, n, t) {
1358
+ return (e) => {
1359
+ if (e.message += `
1360
+ Please report this to https://github.com/markedjs/marked.`, o) {
1361
+ const i = "<p>An error occurred:</p><pre>" + b(e.message + "", !0) + "</pre>";
1362
+ if (n)
1363
+ return Promise.resolve(i);
1364
+ if (t) {
1365
+ t(null, i);
1366
+ return;
1367
+ }
1368
+ return i;
1369
+ }
1370
+ if (n)
1371
+ return Promise.reject(e);
1372
+ if (t) {
1373
+ t(e);
1374
+ return;
1375
+ }
1376
+ throw e;
1377
+ };
1378
+ }
1379
+ function J(o, n) {
1380
+ return (t, e, i) => {
1381
+ typeof e == "function" && (i = e, e = null);
1382
+ const s = { ...e };
1383
+ e = { ...p.defaults, ...s };
1384
+ const r = ge(e.silent, e.async, i);
1385
+ if (typeof t > "u" || t === null)
1386
+ return r(new Error("marked(): input parameter is undefined or null"));
1387
+ if (typeof t != "string")
1388
+ return r(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(t) + ", string expected"));
1389
+ if (ue(e), e.hooks && (e.hooks.options = e), i) {
1390
+ const l = e.highlight;
1391
+ let h;
1392
+ try {
1393
+ e.hooks && (t = e.hooks.preprocess(t)), h = o(t, e);
1394
+ } catch (g) {
1395
+ return r(g);
1396
+ }
1397
+ const d = function(g) {
1398
+ let k;
1399
+ if (!g)
1400
+ try {
1401
+ e.walkTokens && p.walkTokens(h, e.walkTokens), k = n(h, e), e.hooks && (k = e.hooks.postprocess(k));
1402
+ } catch (c) {
1403
+ g = c;
1404
+ }
1405
+ return e.highlight = l, g ? r(g) : i(null, k);
1406
+ };
1407
+ if (!l || l.length < 3 || (delete e.highlight, !h.length)) return d();
1408
+ let f = 0;
1409
+ p.walkTokens(h, function(g) {
1410
+ g.type === "code" && (f++, setTimeout(() => {
1411
+ l(g.text, g.lang, function(k, c) {
1412
+ if (k)
1413
+ return d(k);
1414
+ c != null && c !== g.text && (g.text = c, g.escaped = !0), f--, f === 0 && d();
1415
+ });
1416
+ }, 0));
1417
+ }), f === 0 && d();
1418
+ return;
1419
+ }
1420
+ if (e.async)
1421
+ return Promise.resolve(e.hooks ? e.hooks.preprocess(t) : t).then((l) => o(l, e)).then((l) => e.walkTokens ? Promise.all(p.walkTokens(l, e.walkTokens)).then(() => l) : l).then((l) => n(l, e)).then((l) => e.hooks ? e.hooks.postprocess(l) : l).catch(r);
1422
+ try {
1423
+ e.hooks && (t = e.hooks.preprocess(t));
1424
+ const l = o(t, e);
1425
+ e.walkTokens && p.walkTokens(l, e.walkTokens);
1426
+ let h = n(l, e);
1427
+ return e.hooks && (h = e.hooks.postprocess(h)), h;
1428
+ } catch (l) {
1429
+ return r(l);
1430
+ }
1431
+ };
1432
+ }
1433
+ function p(o, n, t) {
1434
+ return J(T.lex, A.parse)(o, n, t);
1435
+ }
1436
+ p.options = p.setOptions = function(o) {
1437
+ return p.defaults = { ...p.defaults, ...o }, K(p.defaults), p;
1438
+ };
1439
+ p.getDefaults = H;
1440
+ p.defaults = I;
1441
+ p.use = function(...o) {
1442
+ const n = p.defaults.extensions || { renderers: {}, childTokens: {} };
1443
+ o.forEach((t) => {
1444
+ const e = { ...t };
1445
+ if (e.async = p.defaults.async || e.async || !1, t.extensions && (t.extensions.forEach((i) => {
1446
+ if (!i.name)
1447
+ throw new Error("extension name required");
1448
+ if (i.renderer) {
1449
+ const s = n.renderers[i.name];
1450
+ s ? n.renderers[i.name] = function(...r) {
1451
+ let l = i.renderer.apply(this, r);
1452
+ return l === !1 && (l = s.apply(this, r)), l;
1453
+ } : n.renderers[i.name] = i.renderer;
1454
+ }
1455
+ if (i.tokenizer) {
1456
+ if (!i.level || i.level !== "block" && i.level !== "inline")
1457
+ throw new Error("extension level must be 'block' or 'inline'");
1458
+ n[i.level] ? n[i.level].unshift(i.tokenizer) : n[i.level] = [i.tokenizer], i.start && (i.level === "block" ? n.startBlock ? n.startBlock.push(i.start) : n.startBlock = [i.start] : i.level === "inline" && (n.startInline ? n.startInline.push(i.start) : n.startInline = [i.start]));
1459
+ }
1460
+ i.childTokens && (n.childTokens[i.name] = i.childTokens);
1461
+ }), e.extensions = n), t.renderer) {
1462
+ const i = p.defaults.renderer || new v();
1463
+ for (const s in t.renderer) {
1464
+ const r = i[s];
1465
+ i[s] = (...l) => {
1466
+ let h = t.renderer[s].apply(i, l);
1467
+ return h === !1 && (h = r.apply(i, l)), h;
1468
+ };
1469
+ }
1470
+ e.renderer = i;
1471
+ }
1472
+ if (t.tokenizer) {
1473
+ const i = p.defaults.tokenizer || new D();
1474
+ for (const s in t.tokenizer) {
1475
+ const r = i[s];
1476
+ i[s] = (...l) => {
1477
+ let h = t.tokenizer[s].apply(i, l);
1478
+ return h === !1 && (h = r.apply(i, l)), h;
1479
+ };
1480
+ }
1481
+ e.tokenizer = i;
1482
+ }
1483
+ if (t.hooks) {
1484
+ const i = p.defaults.hooks || new B();
1485
+ for (const s in t.hooks) {
1486
+ const r = i[s];
1487
+ B.passThroughHooks.has(s) ? i[s] = (l) => {
1488
+ if (p.defaults.async)
1489
+ return Promise.resolve(t.hooks[s].call(i, l)).then((d) => r.call(i, d));
1490
+ const h = t.hooks[s].call(i, l);
1491
+ return r.call(i, h);
1492
+ } : i[s] = (...l) => {
1493
+ let h = t.hooks[s].apply(i, l);
1494
+ return h === !1 && (h = r.apply(i, l)), h;
1495
+ };
1496
+ }
1497
+ e.hooks = i;
1498
+ }
1499
+ if (t.walkTokens) {
1500
+ const i = p.defaults.walkTokens;
1501
+ e.walkTokens = function(s) {
1502
+ let r = [];
1503
+ return r.push(t.walkTokens.call(this, s)), i && (r = r.concat(i.call(this, s))), r;
1504
+ };
1505
+ }
1506
+ p.setOptions(e);
1507
+ });
1508
+ };
1509
+ p.walkTokens = function(o, n) {
1510
+ let t = [];
1511
+ for (const e of o)
1512
+ switch (t = t.concat(n.call(p, e)), e.type) {
1513
+ case "table": {
1514
+ for (const i of e.header)
1515
+ t = t.concat(p.walkTokens(i.tokens, n));
1516
+ for (const i of e.rows)
1517
+ for (const s of i)
1518
+ t = t.concat(p.walkTokens(s.tokens, n));
1519
+ break;
1520
+ }
1521
+ case "list": {
1522
+ t = t.concat(p.walkTokens(e.items, n));
1523
+ break;
1524
+ }
1525
+ default:
1526
+ p.defaults.extensions && p.defaults.extensions.childTokens && p.defaults.extensions.childTokens[e.type] ? p.defaults.extensions.childTokens[e.type].forEach(function(i) {
1527
+ t = t.concat(p.walkTokens(e[i], n));
1528
+ }) : e.tokens && (t = t.concat(p.walkTokens(e.tokens, n)));
1529
+ }
1530
+ return t;
1531
+ };
1532
+ p.parseInline = J(T.lexInline, A.parseInline);
1533
+ p.Parser = A;
1534
+ p.parser = A.parse;
1535
+ p.Renderer = v;
1536
+ p.TextRenderer = G;
1537
+ p.Lexer = T;
1538
+ p.lexer = T.lex;
1539
+ p.Tokenizer = D;
1540
+ p.Slugger = V;
1541
+ p.Hooks = B;
1542
+ p.parse = p;
1543
+ const de = p.options, ke = p.setOptions, me = p.use, xe = p.walkTokens, we = p.parseInline, be = p, _e = A.parse, ye = T.lex;
1544
+ export {
1545
+ B as Hooks,
1546
+ T as Lexer,
1547
+ A as Parser,
1548
+ v as Renderer,
1549
+ V as Slugger,
1550
+ G as TextRenderer,
1551
+ D as Tokenizer,
1552
+ I as defaults,
1553
+ H as getDefaults,
1554
+ ye as lexer,
1555
+ p as marked,
1556
+ de as options,
1557
+ be as parse,
1558
+ we as parseInline,
1559
+ _e as parser,
1560
+ ke as setOptions,
1561
+ me as use,
1562
+ xe as walkTokens
1563
+ };