mark-deco-cli 0.9.0 → 0.13.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.
- package/dist/cli.cjs +698 -610
- package/dist/cli.cjs.map +1 -1
- package/package.json +10 -9
package/dist/cli.cjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
2
3
|
/*!
|
|
3
4
|
* name: mark-deco-cli
|
|
4
|
-
* version: 0.
|
|
5
|
+
* version: 0.13.0
|
|
5
6
|
* description: Command-line interface for mark-deco Markdown to HTML conversion processor
|
|
6
7
|
* author: Kouji Matsui (@kekyo@mi.kekyo.net)
|
|
7
8
|
* license: MIT
|
|
8
9
|
* repository.url: https://github.com/kekyo/mark-deco.git
|
|
9
|
-
* git.commit.hash:
|
|
10
|
+
* git.commit.hash: a57a326430fda951da873116177f76aa783d4413
|
|
10
11
|
*/
|
|
11
|
-
"use strict";
|
|
12
12
|
const commander = require("commander");
|
|
13
13
|
const promises = require("fs/promises");
|
|
14
14
|
const path$1 = require("path");
|
|
@@ -4338,7 +4338,7 @@ function requireJs() {
|
|
|
4338
4338
|
return js$1.exports;
|
|
4339
4339
|
}
|
|
4340
4340
|
var jsExports = requireJs();
|
|
4341
|
-
const
|
|
4341
|
+
const at$1 = /* @__PURE__ */ getDefaultExportFromCjs(jsExports);
|
|
4342
4342
|
const htmlVoidElements = [
|
|
4343
4343
|
"area",
|
|
4344
4344
|
"base",
|
|
@@ -6082,12 +6082,12 @@ function stringify$1(values, options2) {
|
|
|
6082
6082
|
function stringify(values) {
|
|
6083
6083
|
return values.join(" ").trim();
|
|
6084
6084
|
}
|
|
6085
|
-
const re$
|
|
6085
|
+
const re$2 = /[ \t\n\f\r]/g;
|
|
6086
6086
|
function whitespace(thing) {
|
|
6087
6087
|
return typeof thing === "object" ? thing.type === "text" ? empty$1(thing.value) : false : empty$1(thing);
|
|
6088
6088
|
}
|
|
6089
6089
|
function empty$1(value) {
|
|
6090
|
-
return value.replace(re$
|
|
6090
|
+
return value.replace(re$2, "") === "";
|
|
6091
6091
|
}
|
|
6092
6092
|
const siblingAfter = siblings(1);
|
|
6093
6093
|
const siblingBefore = siblings(-1);
|
|
@@ -21417,12 +21417,12 @@ var load = loader.load;
|
|
|
21417
21417
|
var dump = dumper.dump;
|
|
21418
21418
|
/*!
|
|
21419
21419
|
* name: mark-deco
|
|
21420
|
-
* version: 0.
|
|
21420
|
+
* version: 0.13.0
|
|
21421
21421
|
* description: Flexible Markdown to HTML conversion library
|
|
21422
21422
|
* author: Kouji Matsui (@kekyo@mi.kekyo.net)
|
|
21423
21423
|
* license: MIT
|
|
21424
21424
|
* repository.url: https://github.com/kekyo/mark-deco.git
|
|
21425
|
-
* git.commit.hash:
|
|
21425
|
+
* git.commit.hash: a57a326430fda951da873116177f76aa783d4413
|
|
21426
21426
|
*/
|
|
21427
21427
|
const qd = (e) => {
|
|
21428
21428
|
try {
|
|
@@ -21460,12 +21460,12 @@ const qd = (e) => {
|
|
|
21460
21460
|
}, Ys = () => "width: 100%; height: auto; display: block; object-fit: contain; object-position: center;", ou = (e, t, u, r) => {
|
|
21461
21461
|
const a = Ys(), i = "", n = r ? ` ${r}` : "";
|
|
21462
21462
|
return `<img src="${e}" alt="${t}"${i} style="${a}"${n} />`;
|
|
21463
|
-
}, At = (e, t, u, r, a) => {
|
|
21463
|
+
}, At$1 = (e, t, u, r, a) => {
|
|
21464
21464
|
const i = ou(e, t, r, a);
|
|
21465
21465
|
return `<div class="${u}">
|
|
21466
21466
|
${i}
|
|
21467
21467
|
</div>`;
|
|
21468
|
-
}, vt
|
|
21468
|
+
}, vt = (e) => {
|
|
21469
21469
|
if (e instanceof TypeError) {
|
|
21470
21470
|
const t = e.message.toLowerCase();
|
|
21471
21471
|
return t.includes("cors") || t.includes("network") || t.includes("fetch");
|
|
@@ -21592,7 +21592,7 @@ const qd = (e) => {
|
|
|
21592
21592
|
}
|
|
21593
21593
|
}
|
|
21594
21594
|
} catch (c) {
|
|
21595
|
-
vt
|
|
21595
|
+
vt(c) ? u.debug(
|
|
21596
21596
|
"getOEmbedUrl: Discovery blocked by CORS restrictions for",
|
|
21597
21597
|
e
|
|
21598
21598
|
) : u.warn("getOEmbedUrl: Discovery failed for", e, ":", c);
|
|
@@ -21621,7 +21621,7 @@ const qd = (e) => {
|
|
|
21621
21621
|
}
|
|
21622
21622
|
break;
|
|
21623
21623
|
} catch (h) {
|
|
21624
|
-
return vt
|
|
21624
|
+
return vt(h) ? a.debug(
|
|
21625
21625
|
"resolveRedirects: Browser CORS restrictions prevent redirect resolution for URL:",
|
|
21626
21626
|
n
|
|
21627
21627
|
) : a.warn(
|
|
@@ -21663,7 +21663,7 @@ const Gd = async (e, t, u, r, a) => {
|
|
|
21663
21663
|
);
|
|
21664
21664
|
return i.info("fetchOEmbedData: Parsed JSON data:", T), T.web_page || (T.web_page = h), T;
|
|
21665
21665
|
} catch (h) {
|
|
21666
|
-
throw vt
|
|
21666
|
+
throw vt(h) ? (typeof window < "u" ? i.debug(
|
|
21667
21667
|
"fetchOEmbedData: Browser CORS restrictions block oEmbed API access for URL:",
|
|
21668
21668
|
e
|
|
21669
21669
|
) : i.warn(
|
|
@@ -21745,7 +21745,7 @@ const Gd = async (e, t, u, r, a) => {
|
|
|
21745
21745
|
html: `<div class="oembed-description">${R(e.author_name)}</div>`
|
|
21746
21746
|
}), r.thumbnail !== void 0 && e.thumbnail_url && T.push({
|
|
21747
21747
|
order: r.thumbnail,
|
|
21748
|
-
html: At(
|
|
21748
|
+
html: At$1(
|
|
21749
21749
|
R(e.thumbnail_url),
|
|
21750
21750
|
R(i),
|
|
21751
21751
|
"oembed-thumbnail"
|
|
@@ -21802,7 +21802,7 @@ const Gd = async (e, t, u, r, a) => {
|
|
|
21802
21802
|
html: `<div class="oembed-description">${R(e.author_name)}</div>`
|
|
21803
21803
|
}), r.thumbnail !== void 0 && e.thumbnail_url && m.push({
|
|
21804
21804
|
order: r.thumbnail,
|
|
21805
|
-
html: At(
|
|
21805
|
+
html: At$1(
|
|
21806
21806
|
R(e.thumbnail_url),
|
|
21807
21807
|
R(i),
|
|
21808
21808
|
"oembed-thumbnail"
|
|
@@ -21850,7 +21850,7 @@ const Gd = async (e, t, u, r, a) => {
|
|
|
21850
21850
|
html: `<div class="oembed-description">${R(n)}</div>`
|
|
21851
21851
|
}), r.thumbnail !== void 0 && c && h.push({
|
|
21852
21852
|
order: r.thumbnail,
|
|
21853
|
-
html: At(
|
|
21853
|
+
html: At$1(
|
|
21854
21854
|
R(c),
|
|
21855
21855
|
R(i),
|
|
21856
21856
|
"oembed-thumbnail"
|
|
@@ -21910,14 +21910,14 @@ const Gd = async (e, t, u, r, a) => {
|
|
|
21910
21910
|
} else
|
|
21911
21911
|
return `<div class="oembed-responsive-content">${e}</div>`;
|
|
21912
21912
|
};
|
|
21913
|
-
var L
|
|
21913
|
+
var L;
|
|
21914
21914
|
(function(e) {
|
|
21915
21915
|
e.Root = "root", e.Text = "text", e.Directive = "directive", e.Comment = "comment", e.Script = "script", e.Style = "style", e.Tag = "tag", e.CDATA = "cdata", e.Doctype = "doctype";
|
|
21916
|
-
})(L
|
|
21916
|
+
})(L || (L = {}));
|
|
21917
21917
|
function aa(e) {
|
|
21918
|
-
return e.type === L
|
|
21918
|
+
return e.type === L.Tag || e.type === L.Script || e.type === L.Style;
|
|
21919
21919
|
}
|
|
21920
|
-
const cu = L
|
|
21920
|
+
const cu = L.Root, gr = L.Text, ia = L.Directive, Ar = L.Comment, na = L.Script, oa = L.Style, zt = L.Tag, ca = L.CDATA, da = L.Doctype;
|
|
21921
21921
|
class vr {
|
|
21922
21922
|
constructor() {
|
|
21923
21923
|
this.parent = null, this.prev = null, this.next = null, this.startIndex = null, this.endIndex = null;
|
|
@@ -21983,7 +21983,7 @@ class du extends vr {
|
|
|
21983
21983
|
}
|
|
21984
21984
|
class We extends du {
|
|
21985
21985
|
constructor() {
|
|
21986
|
-
super(...arguments), this.type = L
|
|
21986
|
+
super(...arguments), this.type = L.Text;
|
|
21987
21987
|
}
|
|
21988
21988
|
get nodeType() {
|
|
21989
21989
|
return 3;
|
|
@@ -21991,7 +21991,7 @@ class We extends du {
|
|
|
21991
21991
|
}
|
|
21992
21992
|
class hu extends du {
|
|
21993
21993
|
constructor() {
|
|
21994
|
-
super(...arguments), this.type = L
|
|
21994
|
+
super(...arguments), this.type = L.Comment;
|
|
21995
21995
|
}
|
|
21996
21996
|
get nodeType() {
|
|
21997
21997
|
return 8;
|
|
@@ -21999,7 +21999,7 @@ class hu extends du {
|
|
|
21999
21999
|
}
|
|
22000
22000
|
class lu extends du {
|
|
22001
22001
|
constructor(t, u) {
|
|
22002
|
-
super(u), this.name = t, this.type = L
|
|
22002
|
+
super(u), this.name = t, this.type = L.Directive;
|
|
22003
22003
|
}
|
|
22004
22004
|
get nodeType() {
|
|
22005
22005
|
return 1;
|
|
@@ -22035,7 +22035,7 @@ class mu extends vr {
|
|
|
22035
22035
|
}
|
|
22036
22036
|
class wr extends mu {
|
|
22037
22037
|
constructor() {
|
|
22038
|
-
super(...arguments), this.type = L
|
|
22038
|
+
super(...arguments), this.type = L.CDATA;
|
|
22039
22039
|
}
|
|
22040
22040
|
get nodeType() {
|
|
22041
22041
|
return 4;
|
|
@@ -22043,7 +22043,7 @@ class wr extends mu {
|
|
|
22043
22043
|
}
|
|
22044
22044
|
class Ne extends mu {
|
|
22045
22045
|
constructor() {
|
|
22046
|
-
super(...arguments), this.type = L
|
|
22046
|
+
super(...arguments), this.type = L.Root;
|
|
22047
22047
|
}
|
|
22048
22048
|
get nodeType() {
|
|
22049
22049
|
return 9;
|
|
@@ -22055,7 +22055,7 @@ class pu extends mu {
|
|
|
22055
22055
|
* @param attribs Object mapping attribute names to attribute values.
|
|
22056
22056
|
* @param children Children of the node.
|
|
22057
22057
|
*/
|
|
22058
|
-
constructor(t, u, r = [], a = t === "script" ? L
|
|
22058
|
+
constructor(t, u, r = [], a = t === "script" ? L.Script : t === "style" ? L.Style : L.Tag) {
|
|
22059
22059
|
super(r), this.name = t, this.attribs = u, this.type = a;
|
|
22060
22060
|
}
|
|
22061
22061
|
get nodeType() {
|
|
@@ -22087,20 +22087,20 @@ class pu extends mu {
|
|
|
22087
22087
|
function I(e) {
|
|
22088
22088
|
return aa(e);
|
|
22089
22089
|
}
|
|
22090
|
-
function wt
|
|
22091
|
-
return e.type === L
|
|
22090
|
+
function wt(e) {
|
|
22091
|
+
return e.type === L.CDATA;
|
|
22092
22092
|
}
|
|
22093
22093
|
function se(e) {
|
|
22094
|
-
return e.type === L
|
|
22094
|
+
return e.type === L.Text;
|
|
22095
22095
|
}
|
|
22096
22096
|
function Nt$1(e) {
|
|
22097
|
-
return e.type === L
|
|
22097
|
+
return e.type === L.Comment;
|
|
22098
22098
|
}
|
|
22099
22099
|
function Qt$1(e) {
|
|
22100
|
-
return e.type === L
|
|
22100
|
+
return e.type === L.Directive;
|
|
22101
22101
|
}
|
|
22102
22102
|
function Te(e) {
|
|
22103
|
-
return e.type === L
|
|
22103
|
+
return e.type === L.Root;
|
|
22104
22104
|
}
|
|
22105
22105
|
function B(e) {
|
|
22106
22106
|
return Object.prototype.hasOwnProperty.call(e, "children");
|
|
@@ -22114,7 +22114,7 @@ function ze(e, t = false) {
|
|
|
22114
22114
|
else if (I(e)) {
|
|
22115
22115
|
const r = t ? Mt(e.children) : [], a = new pu(e.name, { ...e.attribs }, r);
|
|
22116
22116
|
r.forEach((i) => i.parent = a), e.namespace != null && (a.namespace = e.namespace), e["x-attribsNamespace"] && (a["x-attribsNamespace"] = { ...e["x-attribsNamespace"] }), e["x-attribsPrefix"] && (a["x-attribsPrefix"] = { ...e["x-attribsPrefix"] }), u = a;
|
|
22117
|
-
} else if (wt
|
|
22117
|
+
} else if (wt(e)) {
|
|
22118
22118
|
const r = t ? Mt(e.children) : [], a = new wr(r);
|
|
22119
22119
|
r.forEach((i) => i.parent = a), u = a;
|
|
22120
22120
|
} else if (Te(e)) {
|
|
@@ -22167,12 +22167,12 @@ class ha {
|
|
|
22167
22167
|
this.options.withEndIndices && (t.endIndex = this.parser.endIndex), this.elementCB && this.elementCB(t);
|
|
22168
22168
|
}
|
|
22169
22169
|
onopentag(t, u) {
|
|
22170
|
-
const r = this.options.xmlMode ? L
|
|
22170
|
+
const r = this.options.xmlMode ? L.Tag : void 0, a = new pu(t, u, void 0, r);
|
|
22171
22171
|
this.addNode(a), this.tagStack.push(a);
|
|
22172
22172
|
}
|
|
22173
22173
|
ontext(t) {
|
|
22174
22174
|
const { lastNode: u } = this;
|
|
22175
|
-
if (u && u.type === L
|
|
22175
|
+
if (u && u.type === L.Text)
|
|
22176
22176
|
u.data += t, this.options.withEndIndices && (u.endIndex = this.parser.endIndex);
|
|
22177
22177
|
else {
|
|
22178
22178
|
const r = new We(t);
|
|
@@ -22180,7 +22180,7 @@ class ha {
|
|
|
22180
22180
|
}
|
|
22181
22181
|
}
|
|
22182
22182
|
oncomment(t) {
|
|
22183
|
-
if (this.lastNode && this.lastNode.type === L
|
|
22183
|
+
if (this.lastNode && this.lastNode.type === L.Comment) {
|
|
22184
22184
|
this.lastNode.data += t;
|
|
22185
22185
|
return;
|
|
22186
22186
|
}
|
|
@@ -22466,13 +22466,13 @@ function ya(e, t) {
|
|
|
22466
22466
|
}
|
|
22467
22467
|
function ot(e) {
|
|
22468
22468
|
return Array.isArray(e) ? e.map(ot).join("") : I(e) ? e.name === "br" ? `
|
|
22469
|
-
` : ot(e.children) : wt
|
|
22469
|
+
` : ot(e.children) : wt(e) ? ot(e.children) : se(e) ? e.data : "";
|
|
22470
22470
|
}
|
|
22471
22471
|
function Le(e) {
|
|
22472
22472
|
return Array.isArray(e) ? e.map(Le).join("") : B(e) && !Nt$1(e) ? Le(e.children) : se(e) ? e.data : "";
|
|
22473
22473
|
}
|
|
22474
22474
|
function dt(e) {
|
|
22475
|
-
return Array.isArray(e) ? e.map(dt).join("") : B(e) && (e.type === L
|
|
22475
|
+
return Array.isArray(e) ? e.map(dt).join("") : B(e) && (e.type === L.Tag || wt(e)) ? dt(e.children) : se(e) ? e.data : "";
|
|
22476
22476
|
}
|
|
22477
22477
|
function It$1(e) {
|
|
22478
22478
|
return B(e) ? e.children : [];
|
|
@@ -22813,7 +22813,7 @@ const St$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty
|
|
|
22813
22813
|
hasAttrib: La,
|
|
22814
22814
|
hasChildren: B,
|
|
22815
22815
|
innerText: dt,
|
|
22816
|
-
isCDATA: wt
|
|
22816
|
+
isCDATA: wt,
|
|
22817
22817
|
isComment: Nt$1,
|
|
22818
22818
|
isDocument: Te,
|
|
22819
22819
|
isTag: I,
|
|
@@ -22831,7 +22831,7 @@ const St$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty
|
|
|
22831
22831
|
}, Symbol.toStringTag, { value: "Module" })), Ja = {
|
|
22832
22832
|
_useHtmlParser2: false
|
|
22833
22833
|
};
|
|
22834
|
-
function Kt
|
|
22834
|
+
function Kt(e, t) {
|
|
22835
22835
|
if (!e)
|
|
22836
22836
|
return t ?? Ja;
|
|
22837
22837
|
const u = {
|
|
@@ -22850,7 +22850,7 @@ function ei(e, t) {
|
|
|
22850
22850
|
function ti(e, t) {
|
|
22851
22851
|
const u = ei(e) ? (t = e, void 0) : e, r = {
|
|
22852
22852
|
...this === null || this === void 0 ? void 0 : this._options,
|
|
22853
|
-
...Kt
|
|
22853
|
+
...Kt(t)
|
|
22854
22854
|
};
|
|
22855
22855
|
return Dr(this, u, r);
|
|
22856
22856
|
}
|
|
@@ -22936,7 +22936,7 @@ var ve;
|
|
|
22936
22936
|
(function(e) {
|
|
22937
22937
|
e[e.LowerA = 97] = "LowerA", e[e.LowerZ = 122] = "LowerZ", e[e.UpperA = 65] = "UpperA", e[e.UpperZ = 90] = "UpperZ", e[e.Exclamation = 33] = "Exclamation";
|
|
22938
22938
|
})(ve || (ve = {}));
|
|
22939
|
-
function Xt(e) {
|
|
22939
|
+
function Xt$1(e) {
|
|
22940
22940
|
const t = e.indexOf("<");
|
|
22941
22941
|
if (t === -1 || t > e.length - 3)
|
|
22942
22942
|
return false;
|
|
@@ -23001,14 +23001,14 @@ var be;
|
|
|
23001
23001
|
(function(e) {
|
|
23002
23002
|
e[e.VALUE_LENGTH = 49152] = "VALUE_LENGTH", e[e.BRANCH_LENGTH = 16256] = "BRANCH_LENGTH", e[e.JUMP_TABLE = 127] = "JUMP_TABLE";
|
|
23003
23003
|
})(be || (be = {}));
|
|
23004
|
-
function Zt(e) {
|
|
23004
|
+
function Zt$1(e) {
|
|
23005
23005
|
return e >= V$1.ZERO && e <= V$1.NINE;
|
|
23006
23006
|
}
|
|
23007
23007
|
function fi(e) {
|
|
23008
23008
|
return e >= V$1.UPPER_A && e <= V$1.UPPER_F || e >= V$1.LOWER_A && e <= V$1.LOWER_F;
|
|
23009
23009
|
}
|
|
23010
23010
|
function bi(e) {
|
|
23011
|
-
return e >= V$1.UPPER_A && e <= V$1.UPPER_Z || e >= V$1.LOWER_A && e <= V$1.LOWER_Z || Zt(e);
|
|
23011
|
+
return e >= V$1.UPPER_A && e <= V$1.UPPER_Z || e >= V$1.LOWER_A && e <= V$1.LOWER_Z || Zt$1(e);
|
|
23012
23012
|
}
|
|
23013
23013
|
function Ei(e) {
|
|
23014
23014
|
return e === V$1.EQUALS || bi(e);
|
|
@@ -23085,7 +23085,7 @@ let Ti = class {
|
|
|
23085
23085
|
const r = u;
|
|
23086
23086
|
for (; u < t.length; ) {
|
|
23087
23087
|
const a = t.charCodeAt(u);
|
|
23088
|
-
if (Zt(a) || fi(a))
|
|
23088
|
+
if (Zt$1(a) || fi(a))
|
|
23089
23089
|
u += 1;
|
|
23090
23090
|
else
|
|
23091
23091
|
return this.addToNumericResult(t, r, u, 16), this.emitNumericEntity(a, 3);
|
|
@@ -23105,7 +23105,7 @@ let Ti = class {
|
|
|
23105
23105
|
const r = u;
|
|
23106
23106
|
for (; u < t.length; ) {
|
|
23107
23107
|
const a = t.charCodeAt(u);
|
|
23108
|
-
if (Zt(a))
|
|
23108
|
+
if (Zt$1(a))
|
|
23109
23109
|
u += 1;
|
|
23110
23110
|
else
|
|
23111
23111
|
return this.addToNumericResult(t, r, u, 10), this.emitNumericEntity(a, 2);
|
|
@@ -23246,10 +23246,10 @@ function st(e) {
|
|
|
23246
23246
|
function gi(e) {
|
|
23247
23247
|
return e >= x.LowerA && e <= x.LowerZ || e >= x.UpperA && e <= x.UpperZ;
|
|
23248
23248
|
}
|
|
23249
|
-
var re;
|
|
23249
|
+
var re$1;
|
|
23250
23250
|
(function(e) {
|
|
23251
23251
|
e[e.NoValue = 0] = "NoValue", e[e.Unquoted = 1] = "Unquoted", e[e.Single = 2] = "Single", e[e.Double = 3] = "Double";
|
|
23252
|
-
})(re || (re = {}));
|
|
23252
|
+
})(re$1 || (re$1 = {}));
|
|
23253
23253
|
const F = {
|
|
23254
23254
|
Cdata: new Uint8Array([67, 68, 65, 84, 65, 91]),
|
|
23255
23255
|
// CDATA[
|
|
@@ -23403,13 +23403,13 @@ let Ai = class {
|
|
|
23403
23403
|
(t === x.Eq || st(t)) && (this.cbs.onattribname(this.sectionStart, this.index), this.sectionStart = this.index, this.state = _$1.AfterAttributeName, this.stateAfterAttributeName(t));
|
|
23404
23404
|
}
|
|
23405
23405
|
stateAfterAttributeName(t) {
|
|
23406
|
-
t === x.Eq ? this.state = _$1.BeforeAttributeValue : t === x.Slash || t === x.Gt ? (this.cbs.onattribend(re.NoValue, this.sectionStart), this.sectionStart = -1, this.state = _$1.BeforeAttributeName, this.stateBeforeAttributeName(t)) : ne(t) || (this.cbs.onattribend(re.NoValue, this.sectionStart), this.state = _$1.InAttributeName, this.sectionStart = this.index);
|
|
23406
|
+
t === x.Eq ? this.state = _$1.BeforeAttributeValue : t === x.Slash || t === x.Gt ? (this.cbs.onattribend(re$1.NoValue, this.sectionStart), this.sectionStart = -1, this.state = _$1.BeforeAttributeName, this.stateBeforeAttributeName(t)) : ne(t) || (this.cbs.onattribend(re$1.NoValue, this.sectionStart), this.state = _$1.InAttributeName, this.sectionStart = this.index);
|
|
23407
23407
|
}
|
|
23408
23408
|
stateBeforeAttributeValue(t) {
|
|
23409
23409
|
t === x.DoubleQuote ? (this.state = _$1.InAttributeValueDq, this.sectionStart = this.index + 1) : t === x.SingleQuote ? (this.state = _$1.InAttributeValueSq, this.sectionStart = this.index + 1) : ne(t) || (this.sectionStart = this.index, this.state = _$1.InAttributeValueNq, this.stateInAttributeValueNoQuotes(t));
|
|
23410
23410
|
}
|
|
23411
23411
|
handleInAttributeValue(t, u) {
|
|
23412
|
-
t === u || !this.decodeEntities && this.fastForwardTo(u) ? (this.cbs.onattribdata(this.sectionStart, this.index), this.sectionStart = -1, this.cbs.onattribend(u === x.DoubleQuote ? re.Double : re.Single, this.index + 1), this.state = _$1.BeforeAttributeName) : this.decodeEntities && t === x.Amp && this.startEntity();
|
|
23412
|
+
t === u || !this.decodeEntities && this.fastForwardTo(u) ? (this.cbs.onattribdata(this.sectionStart, this.index), this.sectionStart = -1, this.cbs.onattribend(u === x.DoubleQuote ? re$1.Double : re$1.Single, this.index + 1), this.state = _$1.BeforeAttributeName) : this.decodeEntities && t === x.Amp && this.startEntity();
|
|
23413
23413
|
}
|
|
23414
23414
|
stateInAttributeValueDoubleQuotes(t) {
|
|
23415
23415
|
this.handleInAttributeValue(t, x.DoubleQuote);
|
|
@@ -23418,7 +23418,7 @@ let Ai = class {
|
|
|
23418
23418
|
this.handleInAttributeValue(t, x.SingleQuote);
|
|
23419
23419
|
}
|
|
23420
23420
|
stateInAttributeValueNoQuotes(t) {
|
|
23421
|
-
ne(t) || t === x.Gt ? (this.cbs.onattribdata(this.sectionStart, this.index), this.sectionStart = -1, this.cbs.onattribend(re.Unquoted, this.index), this.state = _$1.BeforeAttributeName, this.stateBeforeAttributeName(t)) : this.decodeEntities && t === x.Amp && this.startEntity();
|
|
23421
|
+
ne(t) || t === x.Gt ? (this.cbs.onattribdata(this.sectionStart, this.index), this.sectionStart = -1, this.cbs.onattribend(re$1.Unquoted, this.index), this.state = _$1.BeforeAttributeName, this.stateBeforeAttributeName(t)) : this.decodeEntities && t === x.Amp && this.startEntity();
|
|
23422
23422
|
}
|
|
23423
23423
|
stateBeforeDeclaration(t) {
|
|
23424
23424
|
t === x.OpeningSquareBracket ? (this.state = _$1.CDATASequence, this.sequenceIndex = 0) : this.state = t === x.Dash ? _$1.BeforeComment : _$1.InDeclaration;
|
|
@@ -23783,7 +23783,7 @@ let xi = class {
|
|
|
23783
23783
|
/** @internal */
|
|
23784
23784
|
onattribend(t, u) {
|
|
23785
23785
|
var r, a;
|
|
23786
|
-
this.endIndex = u, (a = (r = this.cbs).onattribute) === null || a === void 0 || a.call(r, this.attribname, this.attribvalue, t === re.Double ? '"' : t === re.Single ? "'" : t === re.NoValue ? void 0 : null), this.attribs && !Object.prototype.hasOwnProperty.call(this.attribs, this.attribname) && (this.attribs[this.attribname] = this.attribvalue), this.attribvalue = "";
|
|
23786
|
+
this.endIndex = u, (a = (r = this.cbs).onattribute) === null || a === void 0 || a.call(r, this.attribname, this.attribvalue, t === re$1.Double ? '"' : t === re$1.Single ? "'" : t === re$1.NoValue ? void 0 : null), this.attribs && !Object.prototype.hasOwnProperty.call(this.attribs, this.attribname) && (this.attribs[this.attribname] = this.attribvalue), this.attribvalue = "";
|
|
23787
23787
|
}
|
|
23788
23788
|
getInstructionName(t) {
|
|
23789
23789
|
const u = t.search(Ni);
|
|
@@ -24210,21 +24210,21 @@ const Mi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
24210
24210
|
toggleClass: Fr,
|
|
24211
24211
|
val: Di
|
|
24212
24212
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
24213
|
-
var N;
|
|
24213
|
+
var N$1;
|
|
24214
24214
|
(function(e) {
|
|
24215
24215
|
e.Attribute = "attribute", e.Pseudo = "pseudo", e.PseudoElement = "pseudo-element", e.Tag = "tag", e.Universal = "universal", e.Adjacent = "adjacent", e.Child = "child", e.Descendant = "descendant", e.Parent = "parent", e.Sibling = "sibling", e.ColumnCombinator = "column-combinator";
|
|
24216
|
-
})(N || (N = {}));
|
|
24217
|
-
var H
|
|
24216
|
+
})(N$1 || (N$1 = {}));
|
|
24217
|
+
var H;
|
|
24218
24218
|
(function(e) {
|
|
24219
24219
|
e.Any = "any", e.Element = "element", e.End = "end", e.Equals = "equals", e.Exists = "exists", e.Hyphen = "hyphen", e.Not = "not", e.Start = "start";
|
|
24220
|
-
})(H
|
|
24220
|
+
})(H || (H = {}));
|
|
24221
24221
|
const Wu = /^[^\\#]?(?:\\(?:[\da-f]{1,6}\s?|.)|[\w\-\u00b0-\uFFFF])+/, Bi = /\\([\da-f]{1,6}\s?|(\s)|.)/gi, Ui = /* @__PURE__ */ new Map([
|
|
24222
|
-
[126, H
|
|
24223
|
-
[94, H
|
|
24224
|
-
[36, H
|
|
24225
|
-
[42, H
|
|
24226
|
-
[33, H
|
|
24227
|
-
[124, H
|
|
24222
|
+
[126, H.Element],
|
|
24223
|
+
[94, H.Start],
|
|
24224
|
+
[36, H.End],
|
|
24225
|
+
[42, H.Any],
|
|
24226
|
+
[33, H.Not],
|
|
24227
|
+
[124, H.Hyphen]
|
|
24228
24228
|
]), Fi = /* @__PURE__ */ new Set([
|
|
24229
24229
|
"has",
|
|
24230
24230
|
"not",
|
|
@@ -24236,12 +24236,12 @@ const Wu = /^[^\\#]?(?:\\(?:[\da-f]{1,6}\s?|.)|[\w\-\u00b0-\uFFFF])+/, Bi = /\\(
|
|
|
24236
24236
|
]);
|
|
24237
24237
|
function qe(e) {
|
|
24238
24238
|
switch (e.type) {
|
|
24239
|
-
case N.Adjacent:
|
|
24240
|
-
case N.Child:
|
|
24241
|
-
case N.Descendant:
|
|
24242
|
-
case N.Parent:
|
|
24243
|
-
case N.Sibling:
|
|
24244
|
-
case N.ColumnCombinator:
|
|
24239
|
+
case N$1.Adjacent:
|
|
24240
|
+
case N$1.Child:
|
|
24241
|
+
case N$1.Descendant:
|
|
24242
|
+
case N$1.Parent:
|
|
24243
|
+
case N$1.Sibling:
|
|
24244
|
+
case N$1.ColumnCombinator:
|
|
24245
24245
|
return true;
|
|
24246
24246
|
default:
|
|
24247
24247
|
return false;
|
|
@@ -24307,7 +24307,7 @@ function Hr(e, t, u) {
|
|
|
24307
24307
|
throw new Error("Did not expect successive traversals.");
|
|
24308
24308
|
}
|
|
24309
24309
|
function m(A) {
|
|
24310
|
-
if (r.length > 0 && r[r.length - 1].type === N.Descendant) {
|
|
24310
|
+
if (r.length > 0 && r[r.length - 1].type === N$1.Descendant) {
|
|
24311
24311
|
r[r.length - 1].type = A;
|
|
24312
24312
|
return;
|
|
24313
24313
|
}
|
|
@@ -24315,7 +24315,7 @@ function Hr(e, t, u) {
|
|
|
24315
24315
|
}
|
|
24316
24316
|
function f(A, w) {
|
|
24317
24317
|
r.push({
|
|
24318
|
-
type: N.Attribute,
|
|
24318
|
+
type: N$1.Attribute,
|
|
24319
24319
|
name: A,
|
|
24320
24320
|
action: w,
|
|
24321
24321
|
value: a(1),
|
|
@@ -24324,7 +24324,7 @@ function Hr(e, t, u) {
|
|
|
24324
24324
|
});
|
|
24325
24325
|
}
|
|
24326
24326
|
function T() {
|
|
24327
|
-
if (r.length && r[r.length - 1].type === N.Descendant && r.pop(), r.length === 0)
|
|
24327
|
+
if (r.length && r[r.length - 1].type === N$1.Descendant && r.pop(), r.length === 0)
|
|
24328
24328
|
throw new Error("Empty sub-selector");
|
|
24329
24329
|
e.push(r);
|
|
24330
24330
|
}
|
|
@@ -24339,46 +24339,46 @@ function Hr(e, t, u) {
|
|
|
24339
24339
|
case 10:
|
|
24340
24340
|
case 12:
|
|
24341
24341
|
case 13: {
|
|
24342
|
-
(r.length === 0 || r[0].type !== N.Descendant) && (h(), r.push({ type: N.Descendant })), i(1);
|
|
24342
|
+
(r.length === 0 || r[0].type !== N$1.Descendant) && (h(), r.push({ type: N$1.Descendant })), i(1);
|
|
24343
24343
|
break;
|
|
24344
24344
|
}
|
|
24345
24345
|
// Traversals
|
|
24346
24346
|
case 62: {
|
|
24347
|
-
m(N.Child), i(1);
|
|
24347
|
+
m(N$1.Child), i(1);
|
|
24348
24348
|
break;
|
|
24349
24349
|
}
|
|
24350
24350
|
case 60: {
|
|
24351
|
-
m(N.Parent), i(1);
|
|
24351
|
+
m(N$1.Parent), i(1);
|
|
24352
24352
|
break;
|
|
24353
24353
|
}
|
|
24354
24354
|
case 126: {
|
|
24355
|
-
m(N.Sibling), i(1);
|
|
24355
|
+
m(N$1.Sibling), i(1);
|
|
24356
24356
|
break;
|
|
24357
24357
|
}
|
|
24358
24358
|
case 43: {
|
|
24359
|
-
m(N.Adjacent), i(1);
|
|
24359
|
+
m(N$1.Adjacent), i(1);
|
|
24360
24360
|
break;
|
|
24361
24361
|
}
|
|
24362
24362
|
// Special attribute selectors: .class, #id
|
|
24363
24363
|
case 46: {
|
|
24364
|
-
f("class", H
|
|
24364
|
+
f("class", H.Element);
|
|
24365
24365
|
break;
|
|
24366
24366
|
}
|
|
24367
24367
|
case 35: {
|
|
24368
|
-
f("id", H
|
|
24368
|
+
f("id", H.Equals);
|
|
24369
24369
|
break;
|
|
24370
24370
|
}
|
|
24371
24371
|
case 91: {
|
|
24372
24372
|
i(1);
|
|
24373
24373
|
let w, v = null;
|
|
24374
24374
|
t.charCodeAt(u) === 124 ? w = a(1) : t.startsWith("*|", u) ? (v = "*", w = a(2)) : (w = a(0), t.charCodeAt(u) === 124 && t.charCodeAt(u + 1) !== 61 && (v = w, w = a(1))), i(0);
|
|
24375
|
-
let S = H
|
|
24375
|
+
let S = H.Exists;
|
|
24376
24376
|
const U2 = Ui.get(t.charCodeAt(u));
|
|
24377
24377
|
if (U2) {
|
|
24378
24378
|
if (S = U2, t.charCodeAt(u + 1) !== 61)
|
|
24379
24379
|
throw new Error("Expected `=`");
|
|
24380
24380
|
i(2);
|
|
24381
|
-
} else t.charCodeAt(u) === 61 && (S = H
|
|
24381
|
+
} else t.charCodeAt(u) === 61 && (S = H.Equals, i(1));
|
|
24382
24382
|
let M2 = "", ee = null;
|
|
24383
24383
|
if (S !== "exists") {
|
|
24384
24384
|
if (Ht$1(t.charCodeAt(u))) {
|
|
@@ -24403,7 +24403,7 @@ function Hr(e, t, u) {
|
|
|
24403
24403
|
throw new Error("Attribute selector didn't terminate");
|
|
24404
24404
|
u += 1;
|
|
24405
24405
|
const he = {
|
|
24406
|
-
type: N.Attribute,
|
|
24406
|
+
type: N$1.Attribute,
|
|
24407
24407
|
name: w,
|
|
24408
24408
|
action: S,
|
|
24409
24409
|
value: M2,
|
|
@@ -24416,7 +24416,7 @@ function Hr(e, t, u) {
|
|
|
24416
24416
|
case 58: {
|
|
24417
24417
|
if (t.charCodeAt(u + 1) === 58) {
|
|
24418
24418
|
r.push({
|
|
24419
|
-
type: N.PseudoElement,
|
|
24419
|
+
type: N$1.PseudoElement,
|
|
24420
24420
|
name: a(2).toLowerCase(),
|
|
24421
24421
|
data: t.charCodeAt(u) === 40 ? n() : null
|
|
24422
24422
|
});
|
|
@@ -24438,7 +24438,7 @@ function Hr(e, t, u) {
|
|
|
24438
24438
|
}
|
|
24439
24439
|
v = Be(v);
|
|
24440
24440
|
}
|
|
24441
|
-
r.push({ type: N.Pseudo, name: w, data: v });
|
|
24441
|
+
r.push({ type: N$1.Pseudo, name: w, data: v });
|
|
24442
24442
|
break;
|
|
24443
24443
|
}
|
|
24444
24444
|
case 44: {
|
|
@@ -24458,14 +24458,14 @@ function Hr(e, t, u) {
|
|
|
24458
24458
|
u += 1, v = "*";
|
|
24459
24459
|
else if (A === 124) {
|
|
24460
24460
|
if (v = "", t.charCodeAt(u + 1) === 124) {
|
|
24461
|
-
m(N.ColumnCombinator), i(2);
|
|
24461
|
+
m(N$1.ColumnCombinator), i(2);
|
|
24462
24462
|
break;
|
|
24463
24463
|
}
|
|
24464
24464
|
} else if (Wu.test(t.slice(u)))
|
|
24465
24465
|
v = a(0);
|
|
24466
24466
|
else
|
|
24467
24467
|
break e;
|
|
24468
|
-
t.charCodeAt(u) === 124 && t.charCodeAt(u + 1) !== 124 && (w = v, t.charCodeAt(u + 1) === 42 ? (v = "*", u += 2) : v = a(1)), r.push(v === "*" ? { type: N.Universal, namespace: w } : { type: N.Tag, name: v, namespace: w });
|
|
24468
|
+
t.charCodeAt(u) === 124 && t.charCodeAt(u + 1) !== 124 && (w = v, t.charCodeAt(u + 1) === 42 ? (v = "*", u += 2) : v = a(1)), r.push(v === "*" ? { type: N$1.Universal, namespace: w } : { type: N$1.Tag, name: v, namespace: w });
|
|
24469
24469
|
}
|
|
24470
24470
|
}
|
|
24471
24471
|
}
|
|
@@ -24487,21 +24487,21 @@ function ji() {
|
|
|
24487
24487
|
}
|
|
24488
24488
|
var ft = ji();
|
|
24489
24489
|
const C = /* @__PURE__ */ Yi(ft), qr = /* @__PURE__ */ new Map([
|
|
24490
|
-
[N.Universal, 50],
|
|
24491
|
-
[N.Tag, 30],
|
|
24492
|
-
[N.Attribute, 1],
|
|
24493
|
-
[N.Pseudo, 0]
|
|
24490
|
+
[N$1.Universal, 50],
|
|
24491
|
+
[N$1.Tag, 30],
|
|
24492
|
+
[N$1.Attribute, 1],
|
|
24493
|
+
[N$1.Pseudo, 0]
|
|
24494
24494
|
]);
|
|
24495
24495
|
function Au(e) {
|
|
24496
24496
|
return !qr.has(e.type);
|
|
24497
24497
|
}
|
|
24498
24498
|
const Vi = /* @__PURE__ */ new Map([
|
|
24499
|
-
[H
|
|
24500
|
-
[H
|
|
24501
|
-
[H
|
|
24502
|
-
[H
|
|
24503
|
-
[H
|
|
24504
|
-
[H
|
|
24499
|
+
[H.Exists, 10],
|
|
24500
|
+
[H.Equals, 8],
|
|
24501
|
+
[H.Not, 7],
|
|
24502
|
+
[H.Start, 6],
|
|
24503
|
+
[H.End, 6],
|
|
24504
|
+
[H.Any, 5]
|
|
24505
24505
|
]);
|
|
24506
24506
|
function $i(e) {
|
|
24507
24507
|
const t = e.map(Yr);
|
|
@@ -24517,7 +24517,7 @@ function $i(e) {
|
|
|
24517
24517
|
function Yr(e) {
|
|
24518
24518
|
var t, u;
|
|
24519
24519
|
let r = (t = qr.get(e.type)) !== null && t !== void 0 ? t : -1;
|
|
24520
|
-
return e.type === N.Attribute ? (r = (u = Vi.get(e.action)) !== null && u !== void 0 ? u : 4, e.action === H
|
|
24520
|
+
return e.type === N$1.Attribute ? (r = (u = Vi.get(e.action)) !== null && u !== void 0 ? u : 4, e.action === H.Equals && e.name === "id" && (r = 9), e.ignoreCase && (r >>= 1)) : e.type === N$1.Pseudo && (e.data ? e.name === "has" || e.name === "contains" ? r = 0 : Array.isArray(e.data) ? (r = Math.min(...e.data.map((a) => Math.min(...a.map(Yr)))), r < 0 && (r = 0)) : r = 2 : r = 3), r;
|
|
24521
24521
|
}
|
|
24522
24522
|
const Gi = /[-[\]{}()*+?.,\\^$|#\s]/g;
|
|
24523
24523
|
function Ku(e) {
|
|
@@ -24900,16 +24900,16 @@ function tu(e) {
|
|
|
24900
24900
|
equals: e.equals
|
|
24901
24901
|
};
|
|
24902
24902
|
}
|
|
24903
|
-
const jt = (e, t, u, r, a) => {
|
|
24903
|
+
const jt$1 = (e, t, u, r, a) => {
|
|
24904
24904
|
const i = a(t, tu(u), r);
|
|
24905
24905
|
return i === C.trueFunc ? e : i === C.falseFunc ? C.falseFunc : (n) => i(n) && e(n);
|
|
24906
24906
|
}, Vt$1 = {
|
|
24907
|
-
is: jt,
|
|
24907
|
+
is: jt$1,
|
|
24908
24908
|
/**
|
|
24909
24909
|
* `:matches` and `:where` are aliases for `:is`.
|
|
24910
24910
|
*/
|
|
24911
|
-
matches: jt,
|
|
24912
|
-
where: jt,
|
|
24911
|
+
matches: jt$1,
|
|
24912
|
+
where: jt$1,
|
|
24913
24913
|
not(e, t, u, r, a) {
|
|
24914
24914
|
const i = a(t, tu(u), r);
|
|
24915
24915
|
return i === C.falseFunc ? e : i === C.trueFunc ? C.falseFunc : (n) => !i(n) && e(n);
|
|
@@ -24969,19 +24969,19 @@ function $t$1(e, t) {
|
|
|
24969
24969
|
function un(e, t, u, r, a) {
|
|
24970
24970
|
const { adapter: i, equals: n } = u;
|
|
24971
24971
|
switch (t.type) {
|
|
24972
|
-
case N.PseudoElement:
|
|
24972
|
+
case N$1.PseudoElement:
|
|
24973
24973
|
throw new Error("Pseudo-elements are not supported by css-select");
|
|
24974
|
-
case N.ColumnCombinator:
|
|
24974
|
+
case N$1.ColumnCombinator:
|
|
24975
24975
|
throw new Error("Column combinators are not yet supported by css-select");
|
|
24976
|
-
case N.Attribute: {
|
|
24976
|
+
case N$1.Attribute: {
|
|
24977
24977
|
if (t.namespace != null)
|
|
24978
24978
|
throw new Error("Namespaced attributes are not yet supported by css-select");
|
|
24979
24979
|
return (!u.xmlMode || u.lowerCaseAttributeNames) && (t.name = t.name.toLowerCase()), zi[t.action](e, t, u);
|
|
24980
24980
|
}
|
|
24981
|
-
case N.Pseudo:
|
|
24981
|
+
case N$1.Pseudo:
|
|
24982
24982
|
return tn(e, t, u, r, a);
|
|
24983
24983
|
// Tags
|
|
24984
|
-
case N.Tag: {
|
|
24984
|
+
case N$1.Tag: {
|
|
24985
24985
|
if (t.namespace != null)
|
|
24986
24986
|
throw new Error("Namespaced tag names are not yet supported by css-select");
|
|
24987
24987
|
let { name: c } = t;
|
|
@@ -24990,7 +24990,7 @@ function un(e, t, u, r, a) {
|
|
|
24990
24990
|
};
|
|
24991
24991
|
}
|
|
24992
24992
|
// Traversal
|
|
24993
|
-
case N.Descendant: {
|
|
24993
|
+
case N$1.Descendant: {
|
|
24994
24994
|
if (u.cacheResults === false || typeof WeakSet > "u")
|
|
24995
24995
|
return function(m) {
|
|
24996
24996
|
let f = m;
|
|
@@ -25020,16 +25020,16 @@ function un(e, t, u, r, a) {
|
|
|
25020
25020
|
while (m = $t$1(m, i));
|
|
25021
25021
|
return false;
|
|
25022
25022
|
};
|
|
25023
|
-
case N.Parent:
|
|
25023
|
+
case N$1.Parent:
|
|
25024
25024
|
return function(h) {
|
|
25025
25025
|
return i.getChildren(h).some((m) => i.isTag(m) && e(m));
|
|
25026
25026
|
};
|
|
25027
|
-
case N.Child:
|
|
25027
|
+
case N$1.Child:
|
|
25028
25028
|
return function(h) {
|
|
25029
25029
|
const m = i.getParent(h);
|
|
25030
25030
|
return m != null && i.isTag(m) && e(m);
|
|
25031
25031
|
};
|
|
25032
|
-
case N.Sibling:
|
|
25032
|
+
case N$1.Sibling:
|
|
25033
25033
|
return function(h) {
|
|
25034
25034
|
const m = i.getSiblings(h);
|
|
25035
25035
|
for (let f = 0; f < m.length; f++) {
|
|
@@ -25041,7 +25041,7 @@ function un(e, t, u, r, a) {
|
|
|
25041
25041
|
}
|
|
25042
25042
|
return false;
|
|
25043
25043
|
};
|
|
25044
|
-
case N.Adjacent:
|
|
25044
|
+
case N$1.Adjacent:
|
|
25045
25045
|
return i.prevElementSibling ? function(h) {
|
|
25046
25046
|
const m = i.prevElementSibling(h);
|
|
25047
25047
|
return m != null && e(m);
|
|
@@ -25056,7 +25056,7 @@ function un(e, t, u, r, a) {
|
|
|
25056
25056
|
}
|
|
25057
25057
|
return !!f && e(f);
|
|
25058
25058
|
};
|
|
25059
|
-
case N.Universal: {
|
|
25059
|
+
case N$1.Universal: {
|
|
25060
25060
|
if (t.namespace != null && t.namespace !== "*")
|
|
25061
25061
|
throw new Error("Namespaced universal selectors are not yet supported by css-select");
|
|
25062
25062
|
return e;
|
|
@@ -25064,12 +25064,12 @@ function un(e, t, u, r, a) {
|
|
|
25064
25064
|
}
|
|
25065
25065
|
}
|
|
25066
25066
|
function $r(e) {
|
|
25067
|
-
return e.type === N.Pseudo && (e.name === "scope" || Array.isArray(e.data) && e.data.some((t) => t.some($r)));
|
|
25067
|
+
return e.type === N$1.Pseudo && (e.name === "scope" || Array.isArray(e.data) && e.data.some((t) => t.some($r)));
|
|
25068
25068
|
}
|
|
25069
|
-
const rn = { type: N.Descendant }, sn = {
|
|
25069
|
+
const rn = { type: N$1.Descendant }, sn = {
|
|
25070
25070
|
type: "_flexibleDescendant"
|
|
25071
25071
|
}, an = {
|
|
25072
|
-
type: N.Pseudo,
|
|
25072
|
+
type: N$1.Pseudo,
|
|
25073
25073
|
name: "scope",
|
|
25074
25074
|
data: null
|
|
25075
25075
|
};
|
|
@@ -25079,7 +25079,7 @@ function nn(e, { adapter: t }, u) {
|
|
|
25079
25079
|
return a === jr || i && t.isTag(i);
|
|
25080
25080
|
});
|
|
25081
25081
|
for (const a of e) {
|
|
25082
|
-
if (!(a.length > 0 && Au(a[0]) && a[0].type !== N.Descendant)) if (r && !a.some($r))
|
|
25082
|
+
if (!(a.length > 0 && Au(a[0]) && a[0].type !== N$1.Descendant)) if (r && !a.some($r))
|
|
25083
25083
|
a.unshift(rn);
|
|
25084
25084
|
else
|
|
25085
25085
|
continue;
|
|
@@ -25098,7 +25098,7 @@ function Gr(e, t, u) {
|
|
|
25098
25098
|
const c = e.map((h) => {
|
|
25099
25099
|
if (h.length >= 2) {
|
|
25100
25100
|
const [m, f] = h;
|
|
25101
|
-
m.type !== N.Pseudo || m.name !== "scope" || (a && f.type === N.Descendant ? h[1] = sn : (f.type === N.Adjacent || f.type === N.Sibling) && (n = true));
|
|
25101
|
+
m.type !== N$1.Pseudo || m.name !== "scope" || (a && f.type === N$1.Descendant ? h[1] = sn : (f.type === N$1.Adjacent || f.type === N$1.Sibling) && (n = true));
|
|
25102
25102
|
}
|
|
25103
25103
|
return on(h, t, i);
|
|
25104
25104
|
}).reduce(cn, C.falseFunc);
|
|
@@ -25150,8 +25150,8 @@ const pn = /* @__PURE__ */ new Set([
|
|
|
25150
25150
|
"even",
|
|
25151
25151
|
"odd"
|
|
25152
25152
|
]);
|
|
25153
|
-
function bt
|
|
25154
|
-
return e.type !== "pseudo" ? false : pn.has(e.name) ? true : e.name === "not" && Array.isArray(e.data) ? e.data.some((t) => t.some(bt
|
|
25153
|
+
function bt(e) {
|
|
25154
|
+
return e.type !== "pseudo" ? false : pn.has(e.name) ? true : e.name === "not" && Array.isArray(e.data) ? e.data.some((t) => t.some(bt)) : false;
|
|
25155
25155
|
}
|
|
25156
25156
|
function fn(e, t, u) {
|
|
25157
25157
|
const r = t != null ? parseInt(t, 10) : NaN;
|
|
@@ -25182,14 +25182,14 @@ function bn(e) {
|
|
|
25182
25182
|
function wu(e) {
|
|
25183
25183
|
const t = [], u = [];
|
|
25184
25184
|
for (const r of e)
|
|
25185
|
-
r.some(bt
|
|
25185
|
+
r.some(bt) ? t.push(r) : u.push(r);
|
|
25186
25186
|
return [u, t];
|
|
25187
25187
|
}
|
|
25188
25188
|
const En = {
|
|
25189
|
-
type: N.Universal,
|
|
25189
|
+
type: N$1.Universal,
|
|
25190
25190
|
namespace: null
|
|
25191
25191
|
}, Tn = {
|
|
25192
|
-
type: N.Pseudo,
|
|
25192
|
+
type: N$1.Pseudo,
|
|
25193
25193
|
name: "scope",
|
|
25194
25194
|
data: null
|
|
25195
25195
|
};
|
|
@@ -25262,18 +25262,18 @@ function Jr(e, t, u) {
|
|
|
25262
25262
|
var r;
|
|
25263
25263
|
if (e.some(qe)) {
|
|
25264
25264
|
const a = (r = u.root) !== null && r !== void 0 ? r : bn(t[0]), i = { ...u, context: t, relativeSelector: false };
|
|
25265
|
-
return e.push(Tn), Et
|
|
25265
|
+
return e.push(Tn), Et(a, e, i, true, t.length);
|
|
25266
25266
|
}
|
|
25267
|
-
return Et
|
|
25267
|
+
return Et(t, e, u, false, t.length);
|
|
25268
25268
|
}
|
|
25269
25269
|
function gn(e, t, u = {}, r = 1 / 0) {
|
|
25270
25270
|
if (typeof e == "function")
|
|
25271
25271
|
return es(t, e);
|
|
25272
|
-
const [a, i] = wu(Ct$1(e)), n = i.map((c) => Et
|
|
25272
|
+
const [a, i] = wu(Ct$1(e)), n = i.map((c) => Et(t, c, u, true, r));
|
|
25273
25273
|
return a.length && n.push(uu(t, a, u, r)), n.length === 0 ? [] : n.length === 1 ? n[0] : ke(n.reduce((c, h) => [...c, ...h]));
|
|
25274
25274
|
}
|
|
25275
|
-
function Et
|
|
25276
|
-
const i = t.findIndex(bt
|
|
25275
|
+
function Et(e, t, u, r, a) {
|
|
25276
|
+
const i = t.findIndex(bt), n = t.slice(0, i), c = t[i], h = t.length - 1 === i ? a : 1 / 0, m = fn(c.name, c.data, h);
|
|
25277
25277
|
if (m === 0)
|
|
25278
25278
|
return [];
|
|
25279
25279
|
const T = (n.length === 0 && !Array.isArray(e) ? It$1(e).filter(I) : n.length === 0 ? (Array.isArray(e) ? e : [e]).filter(I) : r || n.some(qe) ? uu(e, [n], u, m) : ru(e, [n], u)).slice(0, m);
|
|
@@ -25284,7 +25284,7 @@ function Et$1(e, t, u, r, a) {
|
|
|
25284
25284
|
if (v) {
|
|
25285
25285
|
if (qe(w[0])) {
|
|
25286
25286
|
const { type: S } = w[0];
|
|
25287
|
-
(S === N.Sibling || S === N.Adjacent) && (A = zr(A, St$1, true)), w.unshift(En);
|
|
25287
|
+
(S === N$1.Sibling || S === N$1.Adjacent) && (A = zr(A, St$1, true)), w.unshift(En);
|
|
25288
25288
|
}
|
|
25289
25289
|
u = {
|
|
25290
25290
|
...u,
|
|
@@ -25297,7 +25297,7 @@ function Et$1(e, t, u, r, a) {
|
|
|
25297
25297
|
rootFunc: (S) => A.includes(S)
|
|
25298
25298
|
};
|
|
25299
25299
|
} else u.rootFunc && u.rootFunc !== ft.trueFunc && (u = { ...u, rootFunc: ft.trueFunc });
|
|
25300
|
-
return w.some(bt
|
|
25300
|
+
return w.some(bt) ? Et(A, w, u, false, a) : v ? (
|
|
25301
25301
|
// Query existing elements to resolve traversal.
|
|
25302
25302
|
uu(A, [w], u, a)
|
|
25303
25303
|
) : (
|
|
@@ -25356,7 +25356,7 @@ function Nu(e) {
|
|
|
25356
25356
|
};
|
|
25357
25357
|
};
|
|
25358
25358
|
}
|
|
25359
|
-
const et = Nu((e, t) => {
|
|
25359
|
+
const et$1 = Nu((e, t) => {
|
|
25360
25360
|
let u = [];
|
|
25361
25361
|
for (let r = 0; r < t.length; r++) {
|
|
25362
25362
|
const a = e(t[r]);
|
|
@@ -25381,7 +25381,7 @@ function Iu(e, ...t) {
|
|
|
25381
25381
|
}), n;
|
|
25382
25382
|
})(e, ...t);
|
|
25383
25383
|
return function(a, i) {
|
|
25384
|
-
u = typeof a == "string" ? (c) => Qr(c, a, this.options) : a ? tt(a) : null;
|
|
25384
|
+
u = typeof a == "string" ? (c) => Qr(c, a, this.options) : a ? tt$1(a) : null;
|
|
25385
25385
|
const n = r.call(this, i);
|
|
25386
25386
|
return u = null, n;
|
|
25387
25387
|
};
|
|
@@ -25389,7 +25389,7 @@ function Iu(e, ...t) {
|
|
|
25389
25389
|
function Pe(e) {
|
|
25390
25390
|
return e.length > 1 ? Array.from(new Set(e)) : e;
|
|
25391
25391
|
}
|
|
25392
|
-
const Nn = xu(({ parent: e }) => e && !Te(e) ? e : null, Pe), xn = et((e) => {
|
|
25392
|
+
const Nn = xu(({ parent: e }) => e && !Te(e) ? e : null, Pe), xn = et$1((e) => {
|
|
25393
25393
|
const t = [];
|
|
25394
25394
|
for (; e.parent && !Te(e.parent); )
|
|
25395
25395
|
t.push(e.parent), e = e.parent;
|
|
@@ -25403,7 +25403,7 @@ function Sn(e) {
|
|
|
25403
25403
|
const r = {
|
|
25404
25404
|
xmlMode: this.options.xmlMode,
|
|
25405
25405
|
root: (t = this._root) === null || t === void 0 ? void 0 : t[0]
|
|
25406
|
-
}, a = typeof e == "string" ? (i) => Qr(i, e, r) : tt(e);
|
|
25406
|
+
}, a = typeof e == "string" ? (i) => Qr(i, e, r) : tt$1(e);
|
|
25407
25407
|
return P(this, (i) => {
|
|
25408
25408
|
for (i && !Te(i) && !I(i) && (i = i.parent); i && I(i); ) {
|
|
25409
25409
|
if (a(i, 0)) {
|
|
@@ -25414,17 +25414,17 @@ function Sn(e) {
|
|
|
25414
25414
|
}
|
|
25415
25415
|
}), this._make(u);
|
|
25416
25416
|
}
|
|
25417
|
-
const Cn = xu((e) => fu(e)), yn = et((e) => {
|
|
25417
|
+
const Cn = xu((e) => fu(e)), yn = et$1((e) => {
|
|
25418
25418
|
const t = [];
|
|
25419
25419
|
for (; e.next; )
|
|
25420
25420
|
e = e.next, I(e) && t.push(e);
|
|
25421
25421
|
return t;
|
|
25422
|
-
}, Pe), On = Iu((e) => fu(e), Pe), Ln = xu((e) => bu(e)), Rn = et((e) => {
|
|
25422
|
+
}, Pe), On = Iu((e) => fu(e), Pe), Ln = xu((e) => bu(e)), Rn = et$1((e) => {
|
|
25423
25423
|
const t = [];
|
|
25424
25424
|
for (; e.prev; )
|
|
25425
25425
|
e = e.prev, I(e) && t.push(e);
|
|
25426
25426
|
return t;
|
|
25427
|
-
}, Pe), Dn = Iu((e) => bu(e), Pe), kn = et((e) => Cr(e).filter((t) => I(t) && t !== e), ke), Pn = et((e) => It$1(e).filter(I), Pe);
|
|
25427
|
+
}, Pe), Dn = Iu((e) => bu(e), Pe), kn = et$1((e) => Cr(e).filter((t) => I(t) && t !== e), ke), Pn = et$1((e) => It$1(e).filter(I), Pe);
|
|
25428
25428
|
function Mn() {
|
|
25429
25429
|
const e = this.toArray().reduce((t, u) => B(u) ? t.concat(u.children) : t, []);
|
|
25430
25430
|
return this._make(e);
|
|
@@ -25444,7 +25444,7 @@ function Un(e) {
|
|
|
25444
25444
|
}
|
|
25445
25445
|
return this._make(t);
|
|
25446
25446
|
}
|
|
25447
|
-
function tt(e) {
|
|
25447
|
+
function tt$1(e) {
|
|
25448
25448
|
return typeof e == "function" ? (t, u) => e.call(t, u, t) : de(e) ? (t) => Array.prototype.includes.call(e, t) : function(t) {
|
|
25449
25449
|
return e === t;
|
|
25450
25450
|
};
|
|
@@ -25454,11 +25454,11 @@ function Fn(e) {
|
|
|
25454
25454
|
return this._make(Su(this.toArray(), e, this.options.xmlMode, (t = this._root) === null || t === void 0 ? void 0 : t[0]));
|
|
25455
25455
|
}
|
|
25456
25456
|
function Su(e, t, u, r) {
|
|
25457
|
-
return typeof t == "string" ? Xr(t, e, { xmlMode: u, root: r }) : e.filter(tt(t));
|
|
25457
|
+
return typeof t == "string" ? Xr(t, e, { xmlMode: u, root: r }) : e.filter(tt$1(t));
|
|
25458
25458
|
}
|
|
25459
25459
|
function Hn(e) {
|
|
25460
25460
|
const t = this.toArray();
|
|
25461
|
-
return typeof e == "string" ? Kr(t.filter(I), e, this.options) : e ? t.some(tt(e)) : false;
|
|
25461
|
+
return typeof e == "string" ? Kr(t.filter(I), e, this.options) : e ? t.some(tt$1(e)) : false;
|
|
25462
25462
|
}
|
|
25463
25463
|
function qn(e) {
|
|
25464
25464
|
let t = this.toArray();
|
|
@@ -25466,7 +25466,7 @@ function qn(e) {
|
|
|
25466
25466
|
const u = new Set(Xr(e, t, this.options));
|
|
25467
25467
|
t = t.filter((r) => !u.has(r));
|
|
25468
25468
|
} else {
|
|
25469
|
-
const u = tt(e);
|
|
25469
|
+
const u = tt$1(e);
|
|
25470
25470
|
t = t.filter((r, a) => !u(r, a));
|
|
25471
25471
|
}
|
|
25472
25472
|
return this._make(t);
|
|
@@ -25634,7 +25634,7 @@ function us(e) {
|
|
|
25634
25634
|
return function(t) {
|
|
25635
25635
|
const u = this.length - 1, r = this.parents().last();
|
|
25636
25636
|
for (let a = 0; a < this.length; a++) {
|
|
25637
|
-
const i = this[a], n = typeof t == "function" ? t.call(i, a, i) : typeof t == "string" && !Xt(t) ? r.find(t).clone() : t, [c] = this._makeDomArray(n, a < u);
|
|
25637
|
+
const i = this[a], n = typeof t == "function" ? t.call(i, a, i) : typeof t == "string" && !Xt$1(t) ? r.find(t).clone() : t, [c] = this._makeDomArray(n, a < u);
|
|
25638
25638
|
if (!c || !B(c))
|
|
25639
25639
|
continue;
|
|
25640
25640
|
let h = c, m = 0;
|
|
@@ -25943,7 +25943,7 @@ function ko(e, t) {
|
|
|
25943
25943
|
return function u(r, a, i = true) {
|
|
25944
25944
|
if (r == null)
|
|
25945
25945
|
throw new Error("cheerio.load() expects a string");
|
|
25946
|
-
const n = Kt
|
|
25946
|
+
const n = Kt(a), c = e(r, n, i, null);
|
|
25947
25947
|
class h extends ut {
|
|
25948
25948
|
_make(T, A) {
|
|
25949
25949
|
const w = m(T, A);
|
|
@@ -25959,10 +25959,10 @@ function ko(e, t) {
|
|
|
25959
25959
|
function m(f, T, A = c, w) {
|
|
25960
25960
|
if (f && de(f))
|
|
25961
25961
|
return f;
|
|
25962
|
-
const v = Kt
|
|
25962
|
+
const v = Kt(w, n), S = typeof A == "string" ? [e(A, v, false, null)] : "length" in A ? A : [A], U2 = de(S) ? S : new h(S, null, v);
|
|
25963
25963
|
if (U2._root = U2, !f)
|
|
25964
25964
|
return new h(void 0, U2, v);
|
|
25965
|
-
const M2 = typeof f == "string" && Xt(f) ? (
|
|
25965
|
+
const M2 = typeof f == "string" && Xt$1(f) ? (
|
|
25966
25966
|
// $(<html>)
|
|
25967
25967
|
e(f, v, false, null).children
|
|
25968
25968
|
) : Po(f) ? (
|
|
@@ -25979,7 +25979,7 @@ function ko(e, t) {
|
|
|
25979
25979
|
let he = f;
|
|
25980
25980
|
const ae = T ? (
|
|
25981
25981
|
// If we don't have a context, maybe we have a root, from loading
|
|
25982
|
-
typeof T == "string" ? Xt(T) ? (
|
|
25982
|
+
typeof T == "string" ? Xt$1(T) ? (
|
|
25983
25983
|
// $('li', '<ul>...</ul>')
|
|
25984
25984
|
new h([e(T, v, false, null)], U2, v)
|
|
25985
25985
|
) : (
|
|
@@ -26166,10 +26166,10 @@ class Ho {
|
|
|
26166
26166
|
this.isEol = false;
|
|
26167
26167
|
}
|
|
26168
26168
|
}
|
|
26169
|
-
var O;
|
|
26169
|
+
var O$1;
|
|
26170
26170
|
(function(e) {
|
|
26171
26171
|
e[e.CHARACTER = 0] = "CHARACTER", e[e.NULL_CHARACTER = 1] = "NULL_CHARACTER", e[e.WHITESPACE_CHARACTER = 2] = "WHITESPACE_CHARACTER", e[e.START_TAG = 3] = "START_TAG", e[e.END_TAG = 4] = "END_TAG", e[e.COMMENT = 5] = "COMMENT", e[e.DOCTYPE = 6] = "DOCTYPE", e[e.EOF = 7] = "EOF", e[e.HIBERNATION = 8] = "HIBERNATION";
|
|
26172
|
-
})(O || (O = {}));
|
|
26172
|
+
})(O$1 || (O$1 = {}));
|
|
26173
26173
|
function os(e, t) {
|
|
26174
26174
|
for (let u = e.attrs.length - 1; u >= 0; u--)
|
|
26175
26175
|
if (e.attrs[u].name === t)
|
|
@@ -26235,21 +26235,21 @@ function Go(e) {
|
|
|
26235
26235
|
function Wo(e) {
|
|
26236
26236
|
return e === $.EQUALS || Go(e);
|
|
26237
26237
|
}
|
|
26238
|
-
var Y;
|
|
26238
|
+
var Y$1;
|
|
26239
26239
|
(function(e) {
|
|
26240
26240
|
e[e.EntityStart = 0] = "EntityStart", e[e.NumericStart = 1] = "NumericStart", e[e.NumericDecimal = 2] = "NumericDecimal", e[e.NumericHex = 3] = "NumericHex", e[e.NamedEntity = 4] = "NamedEntity";
|
|
26241
|
-
})(Y || (Y = {}));
|
|
26241
|
+
})(Y$1 || (Y$1 = {}));
|
|
26242
26242
|
var ce;
|
|
26243
26243
|
(function(e) {
|
|
26244
26244
|
e[e.Legacy = 0] = "Legacy", e[e.Strict = 1] = "Strict", e[e.Attribute = 2] = "Attribute";
|
|
26245
26245
|
})(ce || (ce = {}));
|
|
26246
26246
|
class zo {
|
|
26247
26247
|
constructor(t, u, r) {
|
|
26248
|
-
this.decodeTree = t, this.emitCodePoint = u, this.errors = r, this.state = Y.EntityStart, this.consumed = 1, this.result = 0, this.treeIndex = 0, this.excess = 1, this.decodeMode = ce.Strict;
|
|
26248
|
+
this.decodeTree = t, this.emitCodePoint = u, this.errors = r, this.state = Y$1.EntityStart, this.consumed = 1, this.result = 0, this.treeIndex = 0, this.excess = 1, this.decodeMode = ce.Strict;
|
|
26249
26249
|
}
|
|
26250
26250
|
/** Resets the instance to make it reusable. */
|
|
26251
26251
|
startEntity(t) {
|
|
26252
|
-
this.decodeMode = t, this.state = Y.EntityStart, this.result = 0, this.treeIndex = 0, this.excess = 1, this.consumed = 1;
|
|
26252
|
+
this.decodeMode = t, this.state = Y$1.EntityStart, this.result = 0, this.treeIndex = 0, this.excess = 1, this.consumed = 1;
|
|
26253
26253
|
}
|
|
26254
26254
|
/**
|
|
26255
26255
|
* Write an entity to the decoder. This can be called multiple times with partial entities.
|
|
@@ -26264,15 +26264,15 @@ class zo {
|
|
|
26264
26264
|
*/
|
|
26265
26265
|
write(t, u) {
|
|
26266
26266
|
switch (this.state) {
|
|
26267
|
-
case Y.EntityStart:
|
|
26268
|
-
return t.charCodeAt(u) === $.NUM ? (this.state = Y.NumericStart, this.consumed += 1, this.stateNumericStart(t, u + 1)) : (this.state = Y.NamedEntity, this.stateNamedEntity(t, u));
|
|
26269
|
-
case Y.NumericStart:
|
|
26267
|
+
case Y$1.EntityStart:
|
|
26268
|
+
return t.charCodeAt(u) === $.NUM ? (this.state = Y$1.NumericStart, this.consumed += 1, this.stateNumericStart(t, u + 1)) : (this.state = Y$1.NamedEntity, this.stateNamedEntity(t, u));
|
|
26269
|
+
case Y$1.NumericStart:
|
|
26270
26270
|
return this.stateNumericStart(t, u);
|
|
26271
|
-
case Y.NumericDecimal:
|
|
26271
|
+
case Y$1.NumericDecimal:
|
|
26272
26272
|
return this.stateNumericDecimal(t, u);
|
|
26273
|
-
case Y.NumericHex:
|
|
26273
|
+
case Y$1.NumericHex:
|
|
26274
26274
|
return this.stateNumericHex(t, u);
|
|
26275
|
-
case Y.NamedEntity:
|
|
26275
|
+
case Y$1.NamedEntity:
|
|
26276
26276
|
return this.stateNamedEntity(t, u);
|
|
26277
26277
|
}
|
|
26278
26278
|
}
|
|
@@ -26286,7 +26286,7 @@ class zo {
|
|
|
26286
26286
|
* @returns The number of characters that were consumed, or -1 if the entity is incomplete.
|
|
26287
26287
|
*/
|
|
26288
26288
|
stateNumericStart(t, u) {
|
|
26289
|
-
return u >= t.length ? -1 : (t.charCodeAt(u) | Vo) === $.LOWER_X ? (this.state = Y.NumericHex, this.consumed += 1, this.stateNumericHex(t, u + 1)) : (this.state = Y.NumericDecimal, this.stateNumericDecimal(t, u));
|
|
26289
|
+
return u >= t.length ? -1 : (t.charCodeAt(u) | Vo) === $.LOWER_X ? (this.state = Y$1.NumericHex, this.consumed += 1, this.stateNumericHex(t, u + 1)) : (this.state = Y$1.NumericDecimal, this.stateNumericDecimal(t, u));
|
|
26290
26290
|
}
|
|
26291
26291
|
addToNumericResult(t, u, r, a) {
|
|
26292
26292
|
if (u !== r) {
|
|
@@ -26417,16 +26417,16 @@ class zo {
|
|
|
26417
26417
|
end() {
|
|
26418
26418
|
var t;
|
|
26419
26419
|
switch (this.state) {
|
|
26420
|
-
case Y.NamedEntity:
|
|
26420
|
+
case Y$1.NamedEntity:
|
|
26421
26421
|
return this.result !== 0 && (this.decodeMode !== ce.Attribute || this.result === this.treeIndex) ? this.emitNotTerminatedNamedEntity() : 0;
|
|
26422
26422
|
// Otherwise, emit a numeric entity if we have one.
|
|
26423
|
-
case Y.NumericDecimal:
|
|
26423
|
+
case Y$1.NumericDecimal:
|
|
26424
26424
|
return this.emitNumericEntity(0, 2);
|
|
26425
|
-
case Y.NumericHex:
|
|
26425
|
+
case Y$1.NumericHex:
|
|
26426
26426
|
return this.emitNumericEntity(0, 3);
|
|
26427
|
-
case Y.NumericStart:
|
|
26427
|
+
case Y$1.NumericStart:
|
|
26428
26428
|
return (t = this.errors) === null || t === void 0 || t.absenceOfDigitsInNumericCharacterReference(this.consumed), 0;
|
|
26429
|
-
case Y.EntityStart:
|
|
26429
|
+
case Y$1.EntityStart:
|
|
26430
26430
|
return 0;
|
|
26431
26431
|
}
|
|
26432
26432
|
}
|
|
@@ -26459,10 +26459,10 @@ var we;
|
|
|
26459
26459
|
(function(e) {
|
|
26460
26460
|
e.TYPE = "type", e.ACTION = "action", e.ENCODING = "encoding", e.PROMPT = "prompt", e.NAME = "name", e.COLOR = "color", e.FACE = "face", e.SIZE = "size";
|
|
26461
26461
|
})(we || (we = {}));
|
|
26462
|
-
var X;
|
|
26462
|
+
var X$1;
|
|
26463
26463
|
(function(e) {
|
|
26464
26464
|
e.NO_QUIRKS = "no-quirks", e.QUIRKS = "quirks", e.LIMITED_QUIRKS = "limited-quirks";
|
|
26465
|
-
})(X || (X = {}));
|
|
26465
|
+
})(X$1 || (X$1 = {}));
|
|
26466
26466
|
var p;
|
|
26467
26467
|
(function(e) {
|
|
26468
26468
|
e.A = "a", e.ADDRESS = "address", e.ANNOTATION_XML = "annotation-xml", e.APPLET = "applet", e.AREA = "area", e.ARTICLE = "article", e.ASIDE = "aside", e.B = "b", e.BASE = "base", e.BASEFONT = "basefont", e.BGSOUND = "bgsound", e.BIG = "big", e.BLOCKQUOTE = "blockquote", e.BODY = "body", e.BR = "br", e.BUTTON = "button", e.CAPTION = "caption", e.CENTER = "center", e.CODE = "code", e.COL = "col", e.COLGROUP = "colgroup", e.DD = "dd", e.DESC = "desc", e.DETAILS = "details", e.DIALOG = "dialog", e.DIR = "dir", e.DIV = "div", e.DL = "dl", e.DT = "dt", e.EM = "em", e.EMBED = "embed", e.FIELDSET = "fieldset", e.FIGCAPTION = "figcaption", e.FIGURE = "figure", e.FONT = "font", e.FOOTER = "footer", e.FOREIGN_OBJECT = "foreignObject", e.FORM = "form", e.FRAME = "frame", e.FRAMESET = "frameset", e.H1 = "h1", e.H2 = "h2", e.H3 = "h3", e.H4 = "h4", e.H5 = "h5", e.H6 = "h6", e.HEAD = "head", e.HEADER = "header", e.HGROUP = "hgroup", e.HR = "hr", e.HTML = "html", e.I = "i", e.IMG = "img", e.IMAGE = "image", e.INPUT = "input", e.IFRAME = "iframe", e.KEYGEN = "keygen", e.LABEL = "label", e.LI = "li", e.LINK = "link", e.LISTING = "listing", e.MAIN = "main", e.MALIGNMARK = "malignmark", e.MARQUEE = "marquee", e.MATH = "math", e.MENU = "menu", e.META = "meta", e.MGLYPH = "mglyph", e.MI = "mi", e.MO = "mo", e.MN = "mn", e.MS = "ms", e.MTEXT = "mtext", e.NAV = "nav", e.NOBR = "nobr", e.NOFRAMES = "noframes", e.NOEMBED = "noembed", e.NOSCRIPT = "noscript", e.OBJECT = "object", e.OL = "ol", e.OPTGROUP = "optgroup", e.OPTION = "option", e.P = "p", e.PARAM = "param", e.PLAINTEXT = "plaintext", e.PRE = "pre", e.RB = "rb", e.RP = "rp", e.RT = "rt", e.RTC = "rtc", e.RUBY = "ruby", e.S = "s", e.SCRIPT = "script", e.SEARCH = "search", e.SECTION = "section", e.SELECT = "select", e.SOURCE = "source", e.SMALL = "small", e.SPAN = "span", e.STRIKE = "strike", e.STRONG = "strong", e.STYLE = "style", e.SUB = "sub", e.SUMMARY = "summary", e.SUP = "sup", e.TABLE = "table", e.TBODY = "tbody", e.TEMPLATE = "template", e.TEXTAREA = "textarea", e.TFOOT = "tfoot", e.TD = "td", e.TH = "th", e.THEAD = "thead", e.TITLE = "title", e.TR = "tr", e.TRACK = "track", e.TT = "tt", e.U = "u", e.UL = "ul", e.SVG = "svg", e.VAR = "var", e.WBR = "wbr", e.XMP = "xmp";
|
|
@@ -26817,7 +26817,7 @@ class rc {
|
|
|
26817
26817
|
//Token creation
|
|
26818
26818
|
_createStartTagToken() {
|
|
26819
26819
|
this.currentToken = {
|
|
26820
|
-
type: O.START_TAG,
|
|
26820
|
+
type: O$1.START_TAG,
|
|
26821
26821
|
tagName: "",
|
|
26822
26822
|
tagID: s.UNKNOWN,
|
|
26823
26823
|
selfClosing: false,
|
|
@@ -26828,7 +26828,7 @@ class rc {
|
|
|
26828
26828
|
}
|
|
26829
26829
|
_createEndTagToken() {
|
|
26830
26830
|
this.currentToken = {
|
|
26831
|
-
type: O.END_TAG,
|
|
26831
|
+
type: O$1.END_TAG,
|
|
26832
26832
|
tagName: "",
|
|
26833
26833
|
tagID: s.UNKNOWN,
|
|
26834
26834
|
selfClosing: false,
|
|
@@ -26839,14 +26839,14 @@ class rc {
|
|
|
26839
26839
|
}
|
|
26840
26840
|
_createCommentToken(t) {
|
|
26841
26841
|
this.currentToken = {
|
|
26842
|
-
type: O.COMMENT,
|
|
26842
|
+
type: O$1.COMMENT,
|
|
26843
26843
|
data: "",
|
|
26844
26844
|
location: this.getCurrentLocation(t)
|
|
26845
26845
|
};
|
|
26846
26846
|
}
|
|
26847
26847
|
_createDoctypeToken(t) {
|
|
26848
26848
|
this.currentToken = {
|
|
26849
|
-
type: O.DOCTYPE,
|
|
26849
|
+
type: O$1.DOCTYPE,
|
|
26850
26850
|
name: t,
|
|
26851
26851
|
forceQuirks: false,
|
|
26852
26852
|
publicId: null,
|
|
@@ -26888,7 +26888,7 @@ class rc {
|
|
|
26888
26888
|
}
|
|
26889
26889
|
emitCurrentTagToken() {
|
|
26890
26890
|
const t = this.currentToken;
|
|
26891
|
-
this.prepareToken(t), t.tagID = yt(t.tagName), t.type === O.START_TAG ? (this.lastStartTagName = t.tagName, this.handler.onStartTag(t)) : (t.attrs.length > 0 && this._err(b.endTagWithAttributes), t.selfClosing && this._err(b.endTagWithTrailingSolidus), this.handler.onEndTag(t)), this.preprocessor.dropParsedChunk();
|
|
26891
|
+
this.prepareToken(t), t.tagID = yt(t.tagName), t.type === O$1.START_TAG ? (this.lastStartTagName = t.tagName, this.handler.onStartTag(t)) : (t.attrs.length > 0 && this._err(b.endTagWithAttributes), t.selfClosing && this._err(b.endTagWithTrailingSolidus), this.handler.onEndTag(t)), this.preprocessor.dropParsedChunk();
|
|
26892
26892
|
}
|
|
26893
26893
|
emitCurrentComment(t) {
|
|
26894
26894
|
this.prepareToken(t), this.handler.onComment(t), this.preprocessor.dropParsedChunk();
|
|
@@ -26899,15 +26899,15 @@ class rc {
|
|
|
26899
26899
|
_emitCurrentCharacterToken(t) {
|
|
26900
26900
|
if (this.currentCharacterToken) {
|
|
26901
26901
|
switch (t && this.currentCharacterToken.location && (this.currentCharacterToken.location.endLine = t.startLine, this.currentCharacterToken.location.endCol = t.startCol, this.currentCharacterToken.location.endOffset = t.startOffset), this.currentCharacterToken.type) {
|
|
26902
|
-
case O.CHARACTER: {
|
|
26902
|
+
case O$1.CHARACTER: {
|
|
26903
26903
|
this.handler.onCharacter(this.currentCharacterToken);
|
|
26904
26904
|
break;
|
|
26905
26905
|
}
|
|
26906
|
-
case O.NULL_CHARACTER: {
|
|
26906
|
+
case O$1.NULL_CHARACTER: {
|
|
26907
26907
|
this.handler.onNullCharacter(this.currentCharacterToken);
|
|
26908
26908
|
break;
|
|
26909
26909
|
}
|
|
26910
|
-
case O.WHITESPACE_CHARACTER: {
|
|
26910
|
+
case O$1.WHITESPACE_CHARACTER: {
|
|
26911
26911
|
this.handler.onWhitespaceCharacter(this.currentCharacterToken);
|
|
26912
26912
|
break;
|
|
26913
26913
|
}
|
|
@@ -26917,7 +26917,7 @@ class rc {
|
|
|
26917
26917
|
}
|
|
26918
26918
|
_emitEOFToken() {
|
|
26919
26919
|
const t = this.getCurrentLocation(0);
|
|
26920
|
-
t && (t.endLine = t.startLine, t.endCol = t.startCol, t.endOffset = t.startOffset), this._emitCurrentCharacterToken(t), this.handler.onEof({ type: O.EOF, location: t }), this.active = false;
|
|
26920
|
+
t && (t.endLine = t.startLine, t.endCol = t.startCol, t.endOffset = t.startOffset), this._emitCurrentCharacterToken(t), this.handler.onEof({ type: O$1.EOF, location: t }), this.active = false;
|
|
26921
26921
|
}
|
|
26922
26922
|
//Characters emission
|
|
26923
26923
|
//OPTIMIZATION: The specification uses only one type of character token (one token per character).
|
|
@@ -26938,13 +26938,13 @@ class rc {
|
|
|
26938
26938
|
this._createCharacterToken(t, u);
|
|
26939
26939
|
}
|
|
26940
26940
|
_emitCodePoint(t) {
|
|
26941
|
-
const u = cs(t) ? O.WHITESPACE_CHARACTER : t === o.NULL ? O.NULL_CHARACTER : O.CHARACTER;
|
|
26941
|
+
const u = cs(t) ? O$1.WHITESPACE_CHARACTER : t === o.NULL ? O$1.NULL_CHARACTER : O$1.CHARACTER;
|
|
26942
26942
|
this._appendCharToCurrentCharacterToken(u, String.fromCodePoint(t));
|
|
26943
26943
|
}
|
|
26944
26944
|
//NOTE: used when we emit characters explicitly.
|
|
26945
26945
|
//This is always for non-whitespace and non-null characters, which allows us to avoid additional checks.
|
|
26946
26946
|
_emitChars(t) {
|
|
26947
|
-
this._appendCharToCurrentCharacterToken(O.CHARACTER, t);
|
|
26947
|
+
this._appendCharToCurrentCharacterToken(O$1.CHARACTER, t);
|
|
26948
26948
|
}
|
|
26949
26949
|
// Character reference helpers
|
|
26950
26950
|
_startCharacterReference() {
|
|
@@ -28866,7 +28866,7 @@ class dc {
|
|
|
28866
28866
|
this.pop();
|
|
28867
28867
|
}
|
|
28868
28868
|
}
|
|
28869
|
-
const Gt
|
|
28869
|
+
const Gt = 3;
|
|
28870
28870
|
var te;
|
|
28871
28871
|
(function(e) {
|
|
28872
28872
|
e[e.Marker = 0] = "Marker", e[e.Element = 1] = "Element";
|
|
@@ -28894,16 +28894,16 @@ class hc {
|
|
|
28894
28894
|
return r;
|
|
28895
28895
|
}
|
|
28896
28896
|
_ensureNoahArkCondition(t) {
|
|
28897
|
-
if (this.entries.length < Gt
|
|
28897
|
+
if (this.entries.length < Gt)
|
|
28898
28898
|
return;
|
|
28899
28899
|
const u = this.treeAdapter.getAttrList(t), r = this._getNoahArkConditionCandidates(t, u);
|
|
28900
|
-
if (r.length < Gt
|
|
28900
|
+
if (r.length < Gt)
|
|
28901
28901
|
return;
|
|
28902
28902
|
const a = new Map(u.map((n) => [n.name, n.value]));
|
|
28903
28903
|
let i = 0;
|
|
28904
28904
|
for (let n = 0; n < r.length; n++) {
|
|
28905
28905
|
const c = r[n];
|
|
28906
|
-
c.attrs.every((h) => a.get(h.name) === h.value) && (i += 1, i >= Gt
|
|
28906
|
+
c.attrs.every((h) => a.get(h.name) === h.value) && (i += 1, i >= Gt && this.entries.splice(c.idx, 1));
|
|
28907
28907
|
}
|
|
28908
28908
|
}
|
|
28909
28909
|
//Mutations
|
|
@@ -28952,7 +28952,7 @@ const oe = {
|
|
|
28952
28952
|
createDocument() {
|
|
28953
28953
|
return {
|
|
28954
28954
|
nodeName: "#document",
|
|
28955
|
-
mode: X.NO_QUIRKS,
|
|
28955
|
+
mode: X$1.NO_QUIRKS,
|
|
28956
28956
|
childNodes: []
|
|
28957
28957
|
};
|
|
28958
28958
|
},
|
|
@@ -29181,21 +29181,21 @@ function Ec(e) {
|
|
|
29181
29181
|
}
|
|
29182
29182
|
function Tc(e) {
|
|
29183
29183
|
if (e.name !== hs)
|
|
29184
|
-
return X.QUIRKS;
|
|
29184
|
+
return X$1.QUIRKS;
|
|
29185
29185
|
const { systemId: t } = e;
|
|
29186
29186
|
if (t && t.toLowerCase() === mc)
|
|
29187
|
-
return X.QUIRKS;
|
|
29187
|
+
return X$1.QUIRKS;
|
|
29188
29188
|
let { publicId: u } = e;
|
|
29189
29189
|
if (u !== null) {
|
|
29190
29190
|
if (u = u.toLowerCase(), fc.has(u))
|
|
29191
|
-
return X.QUIRKS;
|
|
29191
|
+
return X$1.QUIRKS;
|
|
29192
29192
|
let r = t === null ? pc : ls;
|
|
29193
29193
|
if (or(u, r))
|
|
29194
|
-
return X.QUIRKS;
|
|
29194
|
+
return X$1.QUIRKS;
|
|
29195
29195
|
if (r = t === null ? ms : bc, or(u, r))
|
|
29196
|
-
return X.LIMITED_QUIRKS;
|
|
29196
|
+
return X$1.LIMITED_QUIRKS;
|
|
29197
29197
|
}
|
|
29198
|
-
return X.NO_QUIRKS;
|
|
29198
|
+
return X$1.NO_QUIRKS;
|
|
29199
29199
|
}
|
|
29200
29200
|
const cr = {
|
|
29201
29201
|
TEXT_HTML: "text/html",
|
|
@@ -29606,7 +29606,7 @@ class Es {
|
|
|
29606
29606
|
const r = u.location, a = this.treeAdapter.getTagName(t), i = (
|
|
29607
29607
|
// NOTE: For cases like <p> <p> </p> - First 'p' closes without a closing
|
|
29608
29608
|
// tag and for cases like <td> <p> </td> - 'p' closes without a closing tag.
|
|
29609
|
-
u.type === O.END_TAG && a === u.tagName ? {
|
|
29609
|
+
u.type === O$1.END_TAG && a === u.tagName ? {
|
|
29610
29610
|
endTag: { ...r },
|
|
29611
29611
|
endLine: r.endLine,
|
|
29612
29612
|
endCol: r.endCol,
|
|
@@ -29635,35 +29635,35 @@ class Es {
|
|
|
29635
29635
|
/** @protected */
|
|
29636
29636
|
_processToken(t) {
|
|
29637
29637
|
switch (t.type) {
|
|
29638
|
-
case O.CHARACTER: {
|
|
29638
|
+
case O$1.CHARACTER: {
|
|
29639
29639
|
this.onCharacter(t);
|
|
29640
29640
|
break;
|
|
29641
29641
|
}
|
|
29642
|
-
case O.NULL_CHARACTER: {
|
|
29642
|
+
case O$1.NULL_CHARACTER: {
|
|
29643
29643
|
this.onNullCharacter(t);
|
|
29644
29644
|
break;
|
|
29645
29645
|
}
|
|
29646
|
-
case O.COMMENT: {
|
|
29646
|
+
case O$1.COMMENT: {
|
|
29647
29647
|
this.onComment(t);
|
|
29648
29648
|
break;
|
|
29649
29649
|
}
|
|
29650
|
-
case O.DOCTYPE: {
|
|
29650
|
+
case O$1.DOCTYPE: {
|
|
29651
29651
|
this.onDoctype(t);
|
|
29652
29652
|
break;
|
|
29653
29653
|
}
|
|
29654
|
-
case O.START_TAG: {
|
|
29654
|
+
case O$1.START_TAG: {
|
|
29655
29655
|
this._processStartTag(t);
|
|
29656
29656
|
break;
|
|
29657
29657
|
}
|
|
29658
|
-
case O.END_TAG: {
|
|
29658
|
+
case O$1.END_TAG: {
|
|
29659
29659
|
this.onEndTag(t);
|
|
29660
29660
|
break;
|
|
29661
29661
|
}
|
|
29662
|
-
case O.EOF: {
|
|
29662
|
+
case O$1.EOF: {
|
|
29663
29663
|
this.onEof(t);
|
|
29664
29664
|
break;
|
|
29665
29665
|
}
|
|
29666
|
-
case O.WHITESPACE_CHARACTER: {
|
|
29666
|
+
case O$1.WHITESPACE_CHARACTER: {
|
|
29667
29667
|
this.onWhitespaceCharacter(t);
|
|
29668
29668
|
break;
|
|
29669
29669
|
}
|
|
@@ -29860,7 +29860,7 @@ class Es {
|
|
|
29860
29860
|
case l.IN_TABLE:
|
|
29861
29861
|
case l.IN_TABLE_BODY:
|
|
29862
29862
|
case l.IN_ROW: {
|
|
29863
|
-
Wt
|
|
29863
|
+
Wt(this, t);
|
|
29864
29864
|
break;
|
|
29865
29865
|
}
|
|
29866
29866
|
case l.IN_TABLE_TEXT: {
|
|
@@ -29868,7 +29868,7 @@ class Es {
|
|
|
29868
29868
|
break;
|
|
29869
29869
|
}
|
|
29870
29870
|
case l.IN_COLUMN_GROUP: {
|
|
29871
|
-
_t(this, t);
|
|
29871
|
+
_t$1(this, t);
|
|
29872
29872
|
break;
|
|
29873
29873
|
}
|
|
29874
29874
|
case l.AFTER_BODY: {
|
|
@@ -29919,11 +29919,11 @@ class Es {
|
|
|
29919
29919
|
case l.IN_TABLE:
|
|
29920
29920
|
case l.IN_TABLE_BODY:
|
|
29921
29921
|
case l.IN_ROW: {
|
|
29922
|
-
Wt
|
|
29922
|
+
Wt(this, t);
|
|
29923
29923
|
break;
|
|
29924
29924
|
}
|
|
29925
29925
|
case l.IN_COLUMN_GROUP: {
|
|
29926
|
-
_t(this, t);
|
|
29926
|
+
_t$1(this, t);
|
|
29927
29927
|
break;
|
|
29928
29928
|
}
|
|
29929
29929
|
case l.AFTER_BODY: {
|
|
@@ -30045,7 +30045,7 @@ class Es {
|
|
|
30045
30045
|
break;
|
|
30046
30046
|
}
|
|
30047
30047
|
case l.IN_BODY: {
|
|
30048
|
-
G
|
|
30048
|
+
G(this, t);
|
|
30049
30049
|
break;
|
|
30050
30050
|
}
|
|
30051
30051
|
case l.IN_TABLE: {
|
|
@@ -30065,7 +30065,7 @@ class Es {
|
|
|
30065
30065
|
break;
|
|
30066
30066
|
}
|
|
30067
30067
|
case l.IN_TABLE_BODY: {
|
|
30068
|
-
Rt(this, t);
|
|
30068
|
+
Rt$1(this, t);
|
|
30069
30069
|
break;
|
|
30070
30070
|
}
|
|
30071
30071
|
case l.IN_ROW: {
|
|
@@ -30305,7 +30305,7 @@ class Es {
|
|
|
30305
30305
|
case l.IN_TABLE:
|
|
30306
30306
|
case l.IN_TABLE_BODY:
|
|
30307
30307
|
case l.IN_ROW: {
|
|
30308
|
-
Wt
|
|
30308
|
+
Wt(this, t);
|
|
30309
30309
|
break;
|
|
30310
30310
|
}
|
|
30311
30311
|
case l.IN_TABLE_TEXT: {
|
|
@@ -30393,11 +30393,11 @@ function Ou(e, t) {
|
|
|
30393
30393
|
}
|
|
30394
30394
|
function Yc(e, t) {
|
|
30395
30395
|
e._setDocumentType(t);
|
|
30396
|
-
const u = t.forceQuirks ? X.QUIRKS : Tc(t);
|
|
30396
|
+
const u = t.forceQuirks ? X$1.QUIRKS : Tc(t);
|
|
30397
30397
|
Ec(t) || e._err(t, b.nonConformingDoctype), e.treeAdapter.setDocumentMode(e.document, u), e.insertionMode = l.BEFORE_HTML;
|
|
30398
30398
|
}
|
|
30399
30399
|
function Ue(e, t) {
|
|
30400
|
-
e._err(t, b.missingDoctype, true), e.treeAdapter.setDocumentMode(e.document, X.QUIRKS), e.insertionMode = l.BEFORE_HTML, e._processToken(t);
|
|
30400
|
+
e._err(t, b.missingDoctype, true), e.treeAdapter.setDocumentMode(e.document, X$1.QUIRKS), e.insertionMode = l.BEFORE_HTML, e._processToken(t);
|
|
30401
30401
|
}
|
|
30402
30402
|
function jc(e, t) {
|
|
30403
30403
|
t.tagID === s.HTML ? (e._insertElement(t, E.HTML), e.insertionMode = l.BEFORE_HEAD) : Ye(e, t);
|
|
@@ -30412,7 +30412,7 @@ function Ye(e, t) {
|
|
|
30412
30412
|
function $c(e, t) {
|
|
30413
30413
|
switch (t.tagID) {
|
|
30414
30414
|
case s.HTML: {
|
|
30415
|
-
G
|
|
30415
|
+
G(e, t);
|
|
30416
30416
|
break;
|
|
30417
30417
|
}
|
|
30418
30418
|
case s.HEAD: {
|
|
@@ -30433,7 +30433,7 @@ function je(e, t) {
|
|
|
30433
30433
|
function J(e, t) {
|
|
30434
30434
|
switch (t.tagID) {
|
|
30435
30435
|
case s.HTML: {
|
|
30436
|
-
G
|
|
30436
|
+
G(e, t);
|
|
30437
30437
|
break;
|
|
30438
30438
|
}
|
|
30439
30439
|
case s.BASE:
|
|
@@ -30502,7 +30502,7 @@ function Ve(e, t) {
|
|
|
30502
30502
|
function zc(e, t) {
|
|
30503
30503
|
switch (t.tagID) {
|
|
30504
30504
|
case s.HTML: {
|
|
30505
|
-
G
|
|
30505
|
+
G(e, t);
|
|
30506
30506
|
break;
|
|
30507
30507
|
}
|
|
30508
30508
|
case s.BASEFONT:
|
|
@@ -30538,13 +30538,13 @@ function Qc(e, t) {
|
|
|
30538
30538
|
}
|
|
30539
30539
|
}
|
|
30540
30540
|
function $e(e, t) {
|
|
30541
|
-
const u = t.type === O.EOF ? b.openElementsLeftAfterEof : b.disallowedContentInNoscriptInHead;
|
|
30541
|
+
const u = t.type === O$1.EOF ? b.openElementsLeftAfterEof : b.disallowedContentInNoscriptInHead;
|
|
30542
30542
|
e._err(t, u), e.openElements.pop(), e.insertionMode = l.IN_HEAD, e._processToken(t);
|
|
30543
30543
|
}
|
|
30544
30544
|
function Kc(e, t) {
|
|
30545
30545
|
switch (t.tagID) {
|
|
30546
30546
|
case s.HTML: {
|
|
30547
|
-
G
|
|
30547
|
+
G(e, t);
|
|
30548
30548
|
break;
|
|
30549
30549
|
}
|
|
30550
30550
|
case s.BODY: {
|
|
@@ -30597,27 +30597,27 @@ function Ge(e, t) {
|
|
|
30597
30597
|
}
|
|
30598
30598
|
function Ot$1(e, t) {
|
|
30599
30599
|
switch (t.type) {
|
|
30600
|
-
case O.CHARACTER: {
|
|
30600
|
+
case O$1.CHARACTER: {
|
|
30601
30601
|
_s(e, t);
|
|
30602
30602
|
break;
|
|
30603
30603
|
}
|
|
30604
|
-
case O.WHITESPACE_CHARACTER: {
|
|
30604
|
+
case O$1.WHITESPACE_CHARACTER: {
|
|
30605
30605
|
Ts(e, t);
|
|
30606
30606
|
break;
|
|
30607
30607
|
}
|
|
30608
|
-
case O.COMMENT: {
|
|
30608
|
+
case O$1.COMMENT: {
|
|
30609
30609
|
iu(e, t);
|
|
30610
30610
|
break;
|
|
30611
30611
|
}
|
|
30612
|
-
case O.START_TAG: {
|
|
30613
|
-
G
|
|
30612
|
+
case O$1.START_TAG: {
|
|
30613
|
+
G(e, t);
|
|
30614
30614
|
break;
|
|
30615
30615
|
}
|
|
30616
|
-
case O.END_TAG: {
|
|
30616
|
+
case O$1.END_TAG: {
|
|
30617
30617
|
Lt$1(e, t);
|
|
30618
30618
|
break;
|
|
30619
30619
|
}
|
|
30620
|
-
case O.EOF: {
|
|
30620
|
+
case O$1.EOF: {
|
|
30621
30621
|
ws(e, t);
|
|
30622
30622
|
break;
|
|
30623
30623
|
}
|
|
@@ -30687,7 +30687,7 @@ function h0(e, t) {
|
|
|
30687
30687
|
e._reconstructActiveFormattingElements(), e._insertElement(t, E.HTML), e.activeFormattingElements.insertMarker(), e.framesetOk = false;
|
|
30688
30688
|
}
|
|
30689
30689
|
function l0(e, t) {
|
|
30690
|
-
e.treeAdapter.getDocumentMode(e.document) !== X.QUIRKS && e.openElements.hasInButtonScope(s.P) && e._closePElement(), e._insertElement(t, E.HTML), e.framesetOk = false, e.insertionMode = l.IN_TABLE;
|
|
30690
|
+
e.treeAdapter.getDocumentMode(e.document) !== X$1.QUIRKS && e.openElements.hasInButtonScope(s.P) && e._closePElement(), e._insertElement(t, E.HTML), e.framesetOk = false, e.insertionMode = l.IN_TABLE;
|
|
30691
30691
|
}
|
|
30692
30692
|
function gs(e, t) {
|
|
30693
30693
|
e._reconstructActiveFormattingElements(), e._appendElement(t, E.HTML), e.framesetOk = false, t.ackSelfClosing = true;
|
|
@@ -30741,7 +30741,7 @@ function x0(e, t) {
|
|
|
30741
30741
|
function lr(e, t) {
|
|
30742
30742
|
e._reconstructActiveFormattingElements(), e._insertElement(t, E.HTML);
|
|
30743
30743
|
}
|
|
30744
|
-
function G
|
|
30744
|
+
function G(e, t) {
|
|
30745
30745
|
switch (t.tagID) {
|
|
30746
30746
|
case s.I:
|
|
30747
30747
|
case s.S:
|
|
@@ -31111,14 +31111,14 @@ function M0(e, t) {
|
|
|
31111
31111
|
function B0(e, t) {
|
|
31112
31112
|
e._err(t, b.eofInElementThatCanContainOnlyText), e.openElements.pop(), e.insertionMode = e.originalInsertionMode, e.onEof(t);
|
|
31113
31113
|
}
|
|
31114
|
-
function Wt
|
|
31114
|
+
function Wt(e, t) {
|
|
31115
31115
|
if (e.openElements.currentTagId !== void 0 && bs.has(e.openElements.currentTagId))
|
|
31116
31116
|
switch (e.pendingCharacterTokens.length = 0, e.hasNonWhitespacePendingCharacterToken = false, e.originalInsertionMode = e.insertionMode, e.insertionMode = l.IN_TABLE_TEXT, t.type) {
|
|
31117
|
-
case O.CHARACTER: {
|
|
31117
|
+
case O$1.CHARACTER: {
|
|
31118
31118
|
xs(e, t);
|
|
31119
31119
|
break;
|
|
31120
31120
|
}
|
|
31121
|
-
case O.WHITESPACE_CHARACTER: {
|
|
31121
|
+
case O$1.WHITESPACE_CHARACTER: {
|
|
31122
31122
|
Ns(e, t);
|
|
31123
31123
|
break;
|
|
31124
31124
|
}
|
|
@@ -31139,7 +31139,7 @@ function q0(e, t) {
|
|
|
31139
31139
|
e.openElements.clearBackToTableContext(), e._insertElement(t, E.HTML), e.insertionMode = l.IN_TABLE_BODY;
|
|
31140
31140
|
}
|
|
31141
31141
|
function Y0(e, t) {
|
|
31142
|
-
e.openElements.clearBackToTableContext(), e._insertFakeElement(p.TBODY, s.TBODY), e.insertionMode = l.IN_TABLE_BODY, Rt(e, t);
|
|
31142
|
+
e.openElements.clearBackToTableContext(), e._insertFakeElement(p.TBODY, s.TBODY), e.insertionMode = l.IN_TABLE_BODY, Rt$1(e, t);
|
|
31143
31143
|
}
|
|
31144
31144
|
function j0(e, t) {
|
|
31145
31145
|
e.openElements.hasInTableScope(s.TABLE) && (e.openElements.popUntilTagNamePopped(s.TABLE), e._resetInsertionMode(), e._processStartTag(t));
|
|
@@ -31247,7 +31247,7 @@ function Fe(e, t) {
|
|
|
31247
31247
|
const Is = /* @__PURE__ */ new Set([s.CAPTION, s.COL, s.COLGROUP, s.TBODY, s.TD, s.TFOOT, s.TH, s.THEAD, s.TR]);
|
|
31248
31248
|
function G0(e, t) {
|
|
31249
31249
|
const u = t.tagID;
|
|
31250
|
-
Is.has(u) ? e.openElements.hasInTableScope(s.CAPTION) && (e.openElements.generateImpliedEndTags(), e.openElements.popUntilTagNamePopped(s.CAPTION), e.activeFormattingElements.clearToLastMarker(), e.insertionMode = l.IN_TABLE, Re(e, t)) : G
|
|
31250
|
+
Is.has(u) ? e.openElements.hasInTableScope(s.CAPTION) && (e.openElements.generateImpliedEndTags(), e.openElements.popUntilTagNamePopped(s.CAPTION), e.activeFormattingElements.clearToLastMarker(), e.insertionMode = l.IN_TABLE, Re(e, t)) : G(e, t);
|
|
31251
31251
|
}
|
|
31252
31252
|
function W0(e, t) {
|
|
31253
31253
|
const u = t.tagID;
|
|
@@ -31275,7 +31275,7 @@ function W0(e, t) {
|
|
|
31275
31275
|
function Lu(e, t) {
|
|
31276
31276
|
switch (t.tagID) {
|
|
31277
31277
|
case s.HTML: {
|
|
31278
|
-
G
|
|
31278
|
+
G(e, t);
|
|
31279
31279
|
break;
|
|
31280
31280
|
}
|
|
31281
31281
|
case s.COL: {
|
|
@@ -31287,7 +31287,7 @@ function Lu(e, t) {
|
|
|
31287
31287
|
break;
|
|
31288
31288
|
}
|
|
31289
31289
|
default:
|
|
31290
|
-
_t(e, t);
|
|
31290
|
+
_t$1(e, t);
|
|
31291
31291
|
}
|
|
31292
31292
|
}
|
|
31293
31293
|
function z0(e, t) {
|
|
@@ -31303,13 +31303,13 @@ function z0(e, t) {
|
|
|
31303
31303
|
case s.COL:
|
|
31304
31304
|
break;
|
|
31305
31305
|
default:
|
|
31306
|
-
_t(e, t);
|
|
31306
|
+
_t$1(e, t);
|
|
31307
31307
|
}
|
|
31308
31308
|
}
|
|
31309
|
-
function _t(e, t) {
|
|
31309
|
+
function _t$1(e, t) {
|
|
31310
31310
|
e.openElements.currentTagId === s.COLGROUP && (e.openElements.pop(), e.insertionMode = l.IN_TABLE, e._processToken(t));
|
|
31311
31311
|
}
|
|
31312
|
-
function Rt(e, t) {
|
|
31312
|
+
function Rt$1(e, t) {
|
|
31313
31313
|
switch (t.tagID) {
|
|
31314
31314
|
case s.TR: {
|
|
31315
31315
|
e.openElements.clearBackToTableBodyContext(), e._insertElement(t, E.HTML), e.insertionMode = l.IN_ROW;
|
|
@@ -31373,7 +31373,7 @@ function Dt(e, t) {
|
|
|
31373
31373
|
case s.TFOOT:
|
|
31374
31374
|
case s.THEAD:
|
|
31375
31375
|
case s.TR: {
|
|
31376
|
-
e.openElements.hasInTableScope(s.TR) && (e.openElements.clearBackToTableRowContext(), e.openElements.pop(), e.insertionMode = l.IN_TABLE_BODY, Rt(e, t));
|
|
31376
|
+
e.openElements.hasInTableScope(s.TR) && (e.openElements.clearBackToTableRowContext(), e.openElements.pop(), e.insertionMode = l.IN_TABLE_BODY, Rt$1(e, t));
|
|
31377
31377
|
break;
|
|
31378
31378
|
}
|
|
31379
31379
|
default:
|
|
@@ -31410,7 +31410,7 @@ function Ss(e, t) {
|
|
|
31410
31410
|
}
|
|
31411
31411
|
function Q0(e, t) {
|
|
31412
31412
|
const u = t.tagID;
|
|
31413
|
-
Is.has(u) ? (e.openElements.hasInTableScope(s.TD) || e.openElements.hasInTableScope(s.TH)) && (e._closeTableCell(), Dt(e, t)) : G
|
|
31413
|
+
Is.has(u) ? (e.openElements.hasInTableScope(s.TD) || e.openElements.hasInTableScope(s.TH)) && (e._closeTableCell(), Dt(e, t)) : G(e, t);
|
|
31414
31414
|
}
|
|
31415
31415
|
function K0(e, t) {
|
|
31416
31416
|
const u = t.tagID;
|
|
@@ -31441,7 +31441,7 @@ function K0(e, t) {
|
|
|
31441
31441
|
function Cs(e, t) {
|
|
31442
31442
|
switch (t.tagID) {
|
|
31443
31443
|
case s.HTML: {
|
|
31444
|
-
G
|
|
31444
|
+
G(e, t);
|
|
31445
31445
|
break;
|
|
31446
31446
|
}
|
|
31447
31447
|
case s.OPTION: {
|
|
@@ -31528,7 +31528,7 @@ function J0(e, t) {
|
|
|
31528
31528
|
break;
|
|
31529
31529
|
}
|
|
31530
31530
|
case s.TR: {
|
|
31531
|
-
e.tmplInsertionModeStack[0] = l.IN_TABLE_BODY, e.insertionMode = l.IN_TABLE_BODY, Rt(e, t);
|
|
31531
|
+
e.tmplInsertionModeStack[0] = l.IN_TABLE_BODY, e.insertionMode = l.IN_TABLE_BODY, Rt$1(e, t);
|
|
31532
31532
|
break;
|
|
31533
31533
|
}
|
|
31534
31534
|
case s.TD:
|
|
@@ -31537,7 +31537,7 @@ function J0(e, t) {
|
|
|
31537
31537
|
break;
|
|
31538
31538
|
}
|
|
31539
31539
|
default:
|
|
31540
|
-
e.tmplInsertionModeStack[0] = l.IN_BODY, e.insertionMode = l.IN_BODY, G
|
|
31540
|
+
e.tmplInsertionModeStack[0] = l.IN_BODY, e.insertionMode = l.IN_BODY, G(e, t);
|
|
31541
31541
|
}
|
|
31542
31542
|
}
|
|
31543
31543
|
function ed(e, t) {
|
|
@@ -31547,7 +31547,7 @@ function Os(e, t) {
|
|
|
31547
31547
|
e.openElements.tmplCount > 0 ? (e.openElements.popUntilTagNamePopped(s.TEMPLATE), e.activeFormattingElements.clearToLastMarker(), e.tmplInsertionModeStack.shift(), e._resetInsertionMode(), e.onEof(t)) : Ou(e, t);
|
|
31548
31548
|
}
|
|
31549
31549
|
function td(e, t) {
|
|
31550
|
-
t.tagID === s.HTML ? G
|
|
31550
|
+
t.tagID === s.HTML ? G(e, t) : gt(e, t);
|
|
31551
31551
|
}
|
|
31552
31552
|
function Ls(e, t) {
|
|
31553
31553
|
var u;
|
|
@@ -31566,7 +31566,7 @@ function gt(e, t) {
|
|
|
31566
31566
|
function ud(e, t) {
|
|
31567
31567
|
switch (t.tagID) {
|
|
31568
31568
|
case s.HTML: {
|
|
31569
|
-
G
|
|
31569
|
+
G(e, t);
|
|
31570
31570
|
break;
|
|
31571
31571
|
}
|
|
31572
31572
|
case s.FRAMESET: {
|
|
@@ -31589,7 +31589,7 @@ function rd(e, t) {
|
|
|
31589
31589
|
function sd(e, t) {
|
|
31590
31590
|
switch (t.tagID) {
|
|
31591
31591
|
case s.HTML: {
|
|
31592
|
-
G
|
|
31592
|
+
G(e, t);
|
|
31593
31593
|
break;
|
|
31594
31594
|
}
|
|
31595
31595
|
case s.NOFRAMES: {
|
|
@@ -31602,7 +31602,7 @@ function ad(e, t) {
|
|
|
31602
31602
|
t.tagID === s.HTML && (e.insertionMode = l.AFTER_AFTER_FRAMESET);
|
|
31603
31603
|
}
|
|
31604
31604
|
function id(e, t) {
|
|
31605
|
-
t.tagID === s.HTML ? G
|
|
31605
|
+
t.tagID === s.HTML ? G(e, t) : ct(e, t);
|
|
31606
31606
|
}
|
|
31607
31607
|
function ct(e, t) {
|
|
31608
31608
|
e.insertionMode = l.IN_BODY, Ot$1(e, t);
|
|
@@ -31610,7 +31610,7 @@ function ct(e, t) {
|
|
|
31610
31610
|
function nd(e, t) {
|
|
31611
31611
|
switch (t.tagID) {
|
|
31612
31612
|
case s.HTML: {
|
|
31613
|
-
G
|
|
31613
|
+
G(e, t);
|
|
31614
31614
|
break;
|
|
31615
31615
|
}
|
|
31616
31616
|
case s.NOFRAMES: {
|
|
@@ -31775,7 +31775,7 @@ const pe = {
|
|
|
31775
31775
|
//Node construction
|
|
31776
31776
|
createDocument() {
|
|
31777
31777
|
const e = new Ne([]);
|
|
31778
|
-
return e["x-mode"] = X.NO_QUIRKS, e;
|
|
31778
|
+
return e["x-mode"] = X$1.NO_QUIRKS, e;
|
|
31779
31779
|
},
|
|
31780
31780
|
createDocumentFragment() {
|
|
31781
31781
|
return new Ne([]);
|
|
@@ -32315,7 +32315,7 @@ const Ld = (e) => {
|
|
|
32315
32315
|
} catch {
|
|
32316
32316
|
return false;
|
|
32317
32317
|
}
|
|
32318
|
-
}, j
|
|
32318
|
+
}, j = (e) => {
|
|
32319
32319
|
const t = {
|
|
32320
32320
|
"&": "&",
|
|
32321
32321
|
"<": "<",
|
|
@@ -32387,7 +32387,7 @@ const Ld = (e) => {
|
|
|
32387
32387
|
fieldCount: Object.keys(h).length
|
|
32388
32388
|
}), h;
|
|
32389
32389
|
} catch (n) {
|
|
32390
|
-
throw vt
|
|
32390
|
+
throw vt(n) ? typeof window < "u" ? r.debug(
|
|
32391
32391
|
"fetchMetadata: Browser CORS restrictions prevent fetching metadata for URL:",
|
|
32392
32392
|
e
|
|
32393
32393
|
) : r.warn(
|
|
@@ -32407,14 +32407,14 @@ const Ld = (e) => {
|
|
|
32407
32407
|
<div class="card-body">
|
|
32408
32408
|
<div class="card-header">
|
|
32409
32409
|
<div class="card-title">📄 External Content</div>
|
|
32410
|
-
<div class="card-provider">${j
|
|
32410
|
+
<div class="card-provider">${j(u)}</div>
|
|
32411
32411
|
</div>
|
|
32412
32412
|
<div class="card-description">
|
|
32413
32413
|
${r}${a ? ` - ${a}` : ""}
|
|
32414
32414
|
</div>
|
|
32415
32415
|
<div class="card-content">
|
|
32416
|
-
<a href="${j
|
|
32417
|
-
→ Open ${j
|
|
32416
|
+
<a href="${j(e)}" target="_blank" rel="noopener noreferrer" class="card-external-link">
|
|
32417
|
+
→ Open ${j(u)} in new tab
|
|
32418
32418
|
</a>
|
|
32419
32419
|
</div>
|
|
32420
32420
|
</div>
|
|
@@ -32439,9 +32439,9 @@ const Ld = (e) => {
|
|
|
32439
32439
|
h && a.image !== void 0 && v.push({
|
|
32440
32440
|
order: a.image,
|
|
32441
32441
|
section: "image",
|
|
32442
|
-
html: At(
|
|
32443
|
-
j
|
|
32444
|
-
j
|
|
32442
|
+
html: At$1(
|
|
32443
|
+
j(h),
|
|
32444
|
+
j(A),
|
|
32445
32445
|
"card-image",
|
|
32446
32446
|
void 0,
|
|
32447
32447
|
'loading="lazy"'
|
|
@@ -32449,7 +32449,7 @@ const Ld = (e) => {
|
|
|
32449
32449
|
});
|
|
32450
32450
|
let S = "";
|
|
32451
32451
|
m && a.favicon !== void 0 && (S = ou(
|
|
32452
|
-
j
|
|
32452
|
+
j(m),
|
|
32453
32453
|
"",
|
|
32454
32454
|
void 0,
|
|
32455
32455
|
'class="card-favicon"'
|
|
@@ -32459,19 +32459,19 @@ const Ld = (e) => {
|
|
|
32459
32459
|
order: a.title,
|
|
32460
32460
|
section: "header",
|
|
32461
32461
|
isHeader: true,
|
|
32462
|
-
html: `<div class="card-title">${j
|
|
32462
|
+
html: `<div class="card-title">${j(A)}</div>`
|
|
32463
32463
|
}), a.siteName !== void 0 && U2.push({
|
|
32464
32464
|
order: a.siteName,
|
|
32465
32465
|
section: "header",
|
|
32466
32466
|
isHeader: true,
|
|
32467
32467
|
html: `<div class="card-provider">
|
|
32468
32468
|
${a.favicon !== void 0 ? S : ""}
|
|
32469
|
-
<span>${j
|
|
32469
|
+
<span>${j(T)}</span>
|
|
32470
32470
|
</div>`
|
|
32471
32471
|
}), w && a.description !== void 0 && v.push({
|
|
32472
32472
|
order: a.description,
|
|
32473
32473
|
section: "body",
|
|
32474
|
-
html: `<div class="card-description">${j
|
|
32474
|
+
html: `<div class="card-description">${j(w)}</div>`
|
|
32475
32475
|
});
|
|
32476
32476
|
for (const [y, W2] of Object.entries(e)) {
|
|
32477
32477
|
if ([
|
|
@@ -32489,15 +32489,15 @@ const Ld = (e) => {
|
|
|
32489
32489
|
if (Ce !== void 0) {
|
|
32490
32490
|
let Me = "";
|
|
32491
32491
|
if (Array.isArray(W2)) {
|
|
32492
|
-
const
|
|
32492
|
+
const Pt2 = W2.slice(0, 3).map((Hs) => `<li>${j(String(Hs))}</li>`).join("");
|
|
32493
32493
|
Me = `<div class="card-field card-${y}">
|
|
32494
|
-
<div class="field-label">${j
|
|
32495
|
-
<ul class="field-list">${
|
|
32494
|
+
<div class="field-label">${j(y)}:</div>
|
|
32495
|
+
<ul class="field-list">${Pt2}</ul>
|
|
32496
32496
|
</div>`;
|
|
32497
32497
|
} else
|
|
32498
32498
|
Me = `<div class="card-field card-${y}">
|
|
32499
|
-
<span class="field-label">${j
|
|
32500
|
-
<span class="field-value">${j
|
|
32499
|
+
<span class="field-label">${j(y)}:</span>
|
|
32500
|
+
<span class="field-value">${j(String(W2))}</span>
|
|
32501
32501
|
</div>`;
|
|
32502
32502
|
v.push({
|
|
32503
32503
|
order: Ce,
|
|
@@ -32523,15 +32523,15 @@ const Ld = (e) => {
|
|
|
32523
32523
|
const W2 = e[y];
|
|
32524
32524
|
let Ce = "";
|
|
32525
32525
|
if (Array.isArray(W2)) {
|
|
32526
|
-
const Me = W2.slice(0, 3).map((
|
|
32526
|
+
const Me = W2.slice(0, 3).map((Pt2) => `<li>${j(String(Pt2))}</li>`).join("");
|
|
32527
32527
|
Ce = `<div class="card-field card-${y}">
|
|
32528
|
-
<div class="field-label">${j
|
|
32528
|
+
<div class="field-label">${j(y)}:</div>
|
|
32529
32529
|
<ul class="field-list">${Me}</ul>
|
|
32530
32530
|
</div>`;
|
|
32531
32531
|
} else
|
|
32532
32532
|
Ce = `<div class="card-field card-${y}">
|
|
32533
|
-
<span class="field-label">${j
|
|
32534
|
-
<span class="field-value">${j
|
|
32533
|
+
<span class="field-label">${j(y)}:</span>
|
|
32534
|
+
<span class="field-value">${j(String(W2))}</span>
|
|
32535
32535
|
</div>`;
|
|
32536
32536
|
v.push({
|
|
32537
32537
|
order: ee++,
|
|
@@ -32552,7 +32552,7 @@ const Ld = (e) => {
|
|
|
32552
32552
|
const ku = ae || kt2 ? `<div class="card-body">
|
|
32553
32553
|
${ae}
|
|
32554
32554
|
${kt2}
|
|
32555
|
-
</div>` : "", Us = i("siteName")?.toLowerCase().includes("amazon") ? "card-container card-amazon" : "card-container", Fs = a.url !== void 0 ? `<a href="${j
|
|
32555
|
+
</div>` : "", Us = i("siteName")?.toLowerCase().includes("amazon") ? "card-container card-amazon" : "card-container", Fs = a.url !== void 0 ? `<a href="${j(f)}" target="_blank" rel="noopener noreferrer" class="card-link">
|
|
32556
32556
|
${Du}
|
|
32557
32557
|
${ku}
|
|
32558
32558
|
</a>` : `${Du}
|
|
@@ -32563,33 +32563,33 @@ const Ld = (e) => {
|
|
|
32563
32563
|
};
|
|
32564
32564
|
/*!
|
|
32565
32565
|
* name: mark-deco
|
|
32566
|
-
* version: 0.
|
|
32566
|
+
* version: 0.13.0
|
|
32567
32567
|
* description: Flexible Markdown to HTML conversion library
|
|
32568
32568
|
* author: Kouji Matsui (@kekyo@mi.kekyo.net)
|
|
32569
32569
|
* license: MIT
|
|
32570
32570
|
* repository.url: https://github.com/kekyo/mark-deco.git
|
|
32571
|
-
* git.commit.hash:
|
|
32571
|
+
* git.commit.hash: a57a326430fda951da873116177f76aa783d4413
|
|
32572
32572
|
*/
|
|
32573
|
-
function
|
|
32573
|
+
function Q(e) {
|
|
32574
32574
|
const t = /^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/, n = e.match(t);
|
|
32575
32575
|
if (!n)
|
|
32576
32576
|
return {
|
|
32577
32577
|
data: {},
|
|
32578
32578
|
content: e
|
|
32579
32579
|
};
|
|
32580
|
-
const
|
|
32580
|
+
const a = n[1] || "", r = e.slice(n[0].length);
|
|
32581
32581
|
try {
|
|
32582
|
-
const s2 = load(
|
|
32582
|
+
const s2 = load(a, { schema: JSON_SCHEMA });
|
|
32583
32583
|
return {
|
|
32584
32584
|
data: s2 && typeof s2 == "object" && !Array.isArray(s2) ? s2 : {},
|
|
32585
32585
|
content: r
|
|
32586
32586
|
};
|
|
32587
32587
|
} catch (s2) {
|
|
32588
|
-
const
|
|
32589
|
-
throw new Error(`Failed to parse frontmatter YAML: ${
|
|
32588
|
+
const d2 = s2 instanceof Error ? s2.message : "Unknown YAML parsing error";
|
|
32589
|
+
throw new Error(`Failed to parse frontmatter YAML: ${d2}`);
|
|
32590
32590
|
}
|
|
32591
32591
|
}
|
|
32592
|
-
function
|
|
32592
|
+
function kt(e) {
|
|
32593
32593
|
if (!e || Object.keys(e).length === 0)
|
|
32594
32594
|
return "";
|
|
32595
32595
|
const t = dump(e, { lineWidth: 0 });
|
|
@@ -32597,58 +32597,58 @@ function wt(e) {
|
|
|
32597
32597
|
`) ? t : `${t}
|
|
32598
32598
|
`;
|
|
32599
32599
|
}
|
|
32600
|
-
function
|
|
32600
|
+
function V(e, t) {
|
|
32601
32601
|
const n = t ?? "";
|
|
32602
32602
|
return `${`---
|
|
32603
|
-
${
|
|
32603
|
+
${kt(e)}---
|
|
32604
32604
|
`}${n}`;
|
|
32605
32605
|
}
|
|
32606
32606
|
const _ = () => {
|
|
32607
|
-
},
|
|
32607
|
+
}, St = {
|
|
32608
32608
|
debug: _,
|
|
32609
32609
|
info: _,
|
|
32610
32610
|
warn: _,
|
|
32611
32611
|
error: _
|
|
32612
|
-
},
|
|
32612
|
+
}, $t = {
|
|
32613
32613
|
debug: console.debug,
|
|
32614
32614
|
info: console.info,
|
|
32615
32615
|
warn: console.warn,
|
|
32616
32616
|
error: console.error
|
|
32617
|
-
},
|
|
32618
|
-
const t = {}, n = e.slice(1, -1).trim(),
|
|
32619
|
-
if (
|
|
32620
|
-
const
|
|
32621
|
-
t.class =
|
|
32617
|
+
}, xt = () => St, Qt = () => $t, O = (e) => {
|
|
32618
|
+
const t = {}, n = e.slice(1, -1).trim(), a = n.match(/\.([a-zA-Z0-9_-]+)/g);
|
|
32619
|
+
if (a) {
|
|
32620
|
+
const d2 = a.map((p2) => p2.slice(1));
|
|
32621
|
+
t.class = d2.join(" ");
|
|
32622
32622
|
}
|
|
32623
32623
|
const r = n.match(/#([a-zA-Z0-9_-]+)/);
|
|
32624
32624
|
r && r[1] && (t.id = r[1]);
|
|
32625
32625
|
const s2 = n.match(/([a-zA-Z0-9_-]+)=["']?([^"'\s]*)["']?/g);
|
|
32626
32626
|
if (s2)
|
|
32627
|
-
for (const
|
|
32628
|
-
const [
|
|
32629
|
-
|
|
32627
|
+
for (const d2 of s2) {
|
|
32628
|
+
const [p2, u] = d2.split("=");
|
|
32629
|
+
p2 && u && p2 !== "class" && p2 !== "id" && (t[p2] = u.replace(/["']/g, ""));
|
|
32630
32630
|
}
|
|
32631
32631
|
return t;
|
|
32632
|
-
},
|
|
32632
|
+
}, Ht = (e) => {
|
|
32633
32633
|
const t = e.lang ? ` class="language-${e.lang}"` : "", n = e.value.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
32634
32634
|
return `<pre><code${t}>${n}</code></pre>`;
|
|
32635
|
-
},
|
|
32636
|
-
e.data || (e.data = {}), e.data.hProperties || (e.data.hProperties = {}), Object.entries(t).forEach(([n,
|
|
32635
|
+
}, N = (e, t) => {
|
|
32636
|
+
e.data || (e.data = {}), e.data.hProperties || (e.data.hProperties = {}), Object.entries(t).forEach(([n, a]) => {
|
|
32637
32637
|
if (n === "class") {
|
|
32638
32638
|
const r = e.data.hProperties.class;
|
|
32639
|
-
r ? typeof r == "string" && r.startsWith("language-") ? e.data.hProperties.class = `${r} ${
|
|
32639
|
+
r ? typeof r == "string" && r.startsWith("language-") ? e.data.hProperties.class = `${r} ${a}` : e.data.hProperties.class = `${r} ${a}` : e.data.hProperties.class = a;
|
|
32640
32640
|
} else
|
|
32641
|
-
e.data.hProperties[n] =
|
|
32641
|
+
e.data.hProperties[n] = a;
|
|
32642
32642
|
});
|
|
32643
|
-
},
|
|
32644
|
-
visit(e, (t, n,
|
|
32643
|
+
}, Tt = () => (e) => {
|
|
32644
|
+
visit(e, (t, n, a) => {
|
|
32645
32645
|
if (t.type === "heading" && t.children?.length > 0) {
|
|
32646
32646
|
const r = t.children[t.children.length - 1];
|
|
32647
32647
|
if (r?.type === "text" && r.value) {
|
|
32648
32648
|
const s2 = r.value.match(/^(.*?)\s*(\{[^}]+\})\s*$/);
|
|
32649
32649
|
if (s2) {
|
|
32650
|
-
const
|
|
32651
|
-
r.value =
|
|
32650
|
+
const d2 = s2[1].trim(), p2 = s2[2], u = O(p2);
|
|
32651
|
+
r.value = d2, N(t, u);
|
|
32652
32652
|
}
|
|
32653
32653
|
}
|
|
32654
32654
|
}
|
|
@@ -32657,28 +32657,28 @@ const _ = () => {
|
|
|
32657
32657
|
if (r?.type === "text" && r.value) {
|
|
32658
32658
|
const s2 = r.value.match(/^(.*?)\s*(\{[^}]+\})\s*$/);
|
|
32659
32659
|
if (s2) {
|
|
32660
|
-
const
|
|
32661
|
-
r.value =
|
|
32660
|
+
const d2 = s2[1].trim(), p2 = s2[2], u = O(p2);
|
|
32661
|
+
r.value = d2, N(t, u);
|
|
32662
32662
|
}
|
|
32663
32663
|
}
|
|
32664
32664
|
}
|
|
32665
|
-
if (t.type === "link" &&
|
|
32666
|
-
const r =
|
|
32665
|
+
if (t.type === "link" && a && typeof n == "number") {
|
|
32666
|
+
const r = a.children[n + 1];
|
|
32667
32667
|
if (r?.type === "text" && r.value) {
|
|
32668
32668
|
const s2 = r.value.match(/^\s*(\{[^}]+\})/);
|
|
32669
32669
|
if (s2) {
|
|
32670
|
-
const
|
|
32671
|
-
|
|
32670
|
+
const d2 = s2[1], p2 = O(d2);
|
|
32671
|
+
N(t, p2), r.value = r.value.replace(s2[0], "");
|
|
32672
32672
|
}
|
|
32673
32673
|
}
|
|
32674
32674
|
}
|
|
32675
|
-
if (t.type === "image" &&
|
|
32676
|
-
const r =
|
|
32675
|
+
if (t.type === "image" && a && typeof n == "number") {
|
|
32676
|
+
const r = a.children[n + 1];
|
|
32677
32677
|
if (r?.type === "text" && r.value) {
|
|
32678
32678
|
const s2 = r.value.match(/^\s*(\{[^}]+\})/);
|
|
32679
32679
|
if (s2) {
|
|
32680
|
-
const
|
|
32681
|
-
|
|
32680
|
+
const d2 = s2[1], p2 = O(d2);
|
|
32681
|
+
N(t, p2), r.value = r.value.replace(s2[0], "");
|
|
32682
32682
|
}
|
|
32683
32683
|
}
|
|
32684
32684
|
}
|
|
@@ -32687,23 +32687,23 @@ const _ = () => {
|
|
|
32687
32687
|
if (r?.type === "paragraph" && r.children?.length > 0) {
|
|
32688
32688
|
const s2 = r.children[r.children.length - 1];
|
|
32689
32689
|
if (s2?.type === "text" && s2.value) {
|
|
32690
|
-
const
|
|
32691
|
-
if (
|
|
32692
|
-
const
|
|
32693
|
-
s2.value =
|
|
32690
|
+
const d2 = s2.value.match(/^(.*?)\s*(\{[^}]+\})\s*$/);
|
|
32691
|
+
if (d2) {
|
|
32692
|
+
const p2 = d2[1].trim(), u = d2[2], i = O(u);
|
|
32693
|
+
s2.value = p2, N(t, i);
|
|
32694
32694
|
}
|
|
32695
32695
|
}
|
|
32696
32696
|
}
|
|
32697
32697
|
}
|
|
32698
|
-
if (t.type === "list" &&
|
|
32699
|
-
const r =
|
|
32698
|
+
if (t.type === "list" && a && typeof n == "number") {
|
|
32699
|
+
const r = a.children[n + 1];
|
|
32700
32700
|
if (r?.type === "paragraph" && r.children?.length === 1) {
|
|
32701
32701
|
const s2 = r.children[0];
|
|
32702
32702
|
if (s2?.type === "text" && s2.value) {
|
|
32703
|
-
const
|
|
32704
|
-
if (
|
|
32705
|
-
const
|
|
32706
|
-
|
|
32703
|
+
const d2 = s2.value.match(/^\s*(\{[^}]+\})\s*$/);
|
|
32704
|
+
if (d2) {
|
|
32705
|
+
const p2 = d2[1], u = O(p2);
|
|
32706
|
+
N(t, u), a.children.splice(n + 1, 1);
|
|
32707
32707
|
}
|
|
32708
32708
|
}
|
|
32709
32709
|
}
|
|
@@ -32713,60 +32713,123 @@ const _ = () => {
|
|
|
32713
32713
|
if (r?.type === "paragraph" && r.children?.length > 0) {
|
|
32714
32714
|
const s2 = r.children[r.children.length - 1];
|
|
32715
32715
|
if (s2?.type === "text" && s2.value) {
|
|
32716
|
-
const
|
|
32717
|
-
if (
|
|
32718
|
-
const
|
|
32719
|
-
s2.value =
|
|
32716
|
+
const d2 = s2.value.match(/^(.*?)\s*(\{[^}]+\})\s*$/);
|
|
32717
|
+
if (d2) {
|
|
32718
|
+
const p2 = d2[1].trim(), u = d2[2], i = O(u);
|
|
32719
|
+
s2.value = p2, N(t, i);
|
|
32720
32720
|
}
|
|
32721
32721
|
}
|
|
32722
32722
|
}
|
|
32723
32723
|
}
|
|
32724
|
-
if (t.type === "blockquote" &&
|
|
32725
|
-
const r =
|
|
32724
|
+
if (t.type === "blockquote" && a && typeof n == "number") {
|
|
32725
|
+
const r = a.children[n + 1];
|
|
32726
32726
|
if (r?.type === "paragraph" && r.children?.length === 1) {
|
|
32727
32727
|
const s2 = r.children[0];
|
|
32728
32728
|
if (s2?.type === "text" && s2.value) {
|
|
32729
|
-
const
|
|
32730
|
-
if (
|
|
32731
|
-
const
|
|
32732
|
-
|
|
32729
|
+
const d2 = s2.value.match(/^\s*(\{[^}]+\})\s*$/);
|
|
32730
|
+
if (d2) {
|
|
32731
|
+
const p2 = d2[1], u = O(p2);
|
|
32732
|
+
N(t, u), a.children.splice(n + 1, 1);
|
|
32733
32733
|
}
|
|
32734
32734
|
}
|
|
32735
32735
|
}
|
|
32736
32736
|
}
|
|
32737
|
-
if (t.type === "inlineCode" &&
|
|
32738
|
-
const r =
|
|
32737
|
+
if (t.type === "inlineCode" && a && typeof n == "number") {
|
|
32738
|
+
const r = a.children[n + 1];
|
|
32739
32739
|
if (r?.type === "text" && r.value) {
|
|
32740
32740
|
const s2 = r.value.match(/^\s*(\{[^}]+\})/);
|
|
32741
32741
|
if (s2) {
|
|
32742
|
-
const
|
|
32743
|
-
|
|
32742
|
+
const d2 = s2[1], p2 = O(d2);
|
|
32743
|
+
N(t, p2), r.value = r.value.replace(s2[0], "");
|
|
32744
32744
|
}
|
|
32745
32745
|
}
|
|
32746
32746
|
}
|
|
32747
32747
|
if (t.type === "code" && t.meta) {
|
|
32748
32748
|
const r = t.meta.match(/\{([^}]+)\}/);
|
|
32749
32749
|
if (r) {
|
|
32750
|
-
const s2 = `{${r[1]}}`,
|
|
32750
|
+
const s2 = `{${r[1]}}`, d2 = O(s2), p2 = {
|
|
32751
32751
|
type: "html",
|
|
32752
|
-
value: `<div class="${
|
|
32753
|
-
|
|
32754
|
-
).filter(([
|
|
32752
|
+
value: `<div class="${d2.class || ""}" ${Object.entries(
|
|
32753
|
+
d2
|
|
32754
|
+
).filter(([u]) => u !== "class").map(([u, i]) => `${u}="${i}"`).join(" ")}>${Ht(t)}</div>`
|
|
32755
32755
|
};
|
|
32756
|
-
|
|
32756
|
+
a && typeof n == "number" && (a.children[n] = p2), t.meta = t.meta.replace(r[0], "").trim() || null;
|
|
32757
32757
|
}
|
|
32758
32758
|
}
|
|
32759
32759
|
});
|
|
32760
|
-
},
|
|
32760
|
+
}, Ct = () => (e) => {
|
|
32761
32761
|
visit(e, "element", (t) => {
|
|
32762
32762
|
if (t.tagName === "img") {
|
|
32763
32763
|
const n = Ys();
|
|
32764
32764
|
t.properties || (t.properties = {});
|
|
32765
|
-
const
|
|
32765
|
+
const a = t.properties.style || "", r = a ? `${a}; ${n}` : n;
|
|
32766
32766
|
t.properties.style = r;
|
|
32767
32767
|
}
|
|
32768
32768
|
});
|
|
32769
|
-
},
|
|
32769
|
+
}, U = (e) => e ? "value" in e && typeof e.value == "string" ? e.value : "children" in e && Array.isArray(e.children) ? e.children.map((t) => U(t)).join("") : "" : "", Ft = (e) => {
|
|
32770
|
+
const {
|
|
32771
|
+
frontmatter: t,
|
|
32772
|
+
hasTitle: n,
|
|
32773
|
+
transform: a,
|
|
32774
|
+
allowTitleWrite: r,
|
|
32775
|
+
onHeadingApplied: s2
|
|
32776
|
+
} = e, d2 = a === "extractAndRemove";
|
|
32777
|
+
return (p2) => {
|
|
32778
|
+
if (!t || !p2.children || p2.children.length === 0)
|
|
32779
|
+
return;
|
|
32780
|
+
let u = 0;
|
|
32781
|
+
for (; u < p2.children.length; u++) {
|
|
32782
|
+
const i = p2.children[u];
|
|
32783
|
+
if (i.type === "heading" && i.depth === 1) {
|
|
32784
|
+
const l2 = i, c = p2.children[u + 1], o2 = c && c.position ? c.position.start?.offset : void 0, h = U(l2).trim();
|
|
32785
|
+
d2 && p2.children.splice(u, 1);
|
|
32786
|
+
let f = false;
|
|
32787
|
+
!n && r && h.length > 0 && (t.title = h, f = true), s2 && s2({
|
|
32788
|
+
headingText: h,
|
|
32789
|
+
position: l2.position,
|
|
32790
|
+
nextNodeStartOffset: o2,
|
|
32791
|
+
titleWritten: f,
|
|
32792
|
+
headingRemoved: d2
|
|
32793
|
+
});
|
|
32794
|
+
break;
|
|
32795
|
+
}
|
|
32796
|
+
if (!(i.type === "thematicBreak" || i.type === "html" && typeof i.value == "string" && i.value.trim() === "") && !(i.type === "paragraph" && i.children?.length === 0))
|
|
32797
|
+
break;
|
|
32798
|
+
}
|
|
32799
|
+
};
|
|
32800
|
+
}, Z = (e, t, n) => {
|
|
32801
|
+
const { transform: a, allowTitleWrite: r } = n;
|
|
32802
|
+
if (a === "none")
|
|
32803
|
+
return {
|
|
32804
|
+
content: e,
|
|
32805
|
+
headingRemoved: false,
|
|
32806
|
+
titleWritten: false
|
|
32807
|
+
};
|
|
32808
|
+
const s2 = t != null && Object.prototype.hasOwnProperty.call(t, "title") && t.title !== void 0 && t.title !== null;
|
|
32809
|
+
let d2 = false, p2 = false, u, i;
|
|
32810
|
+
const l2 = unified().use(remarkParse).use(Ft, {
|
|
32811
|
+
frontmatter: t,
|
|
32812
|
+
hasTitle: s2,
|
|
32813
|
+
transform: a,
|
|
32814
|
+
allowTitleWrite: r,
|
|
32815
|
+
onHeadingApplied: (o2) => {
|
|
32816
|
+
if (d2 = o2.headingRemoved, p2 = o2.titleWritten, !o2.headingRemoved)
|
|
32817
|
+
return;
|
|
32818
|
+
const h = o2.position?.start?.offset ?? 0;
|
|
32819
|
+
let f = o2.position?.end?.offset ?? h;
|
|
32820
|
+
typeof o2.nextNodeStartOffset == "number" && o2.nextNodeStartOffset >= f ? f = o2.nextNodeStartOffset : f = e.length, u = h, i = f;
|
|
32821
|
+
}
|
|
32822
|
+
}), c = l2.parse(e);
|
|
32823
|
+
return l2.runSync(c), d2 && u !== void 0 && i !== void 0 ? {
|
|
32824
|
+
content: e.slice(0, u) + e.slice(i),
|
|
32825
|
+
headingRemoved: true,
|
|
32826
|
+
titleWritten: p2
|
|
32827
|
+
} : {
|
|
32828
|
+
content: e,
|
|
32829
|
+
headingRemoved: false,
|
|
32830
|
+
titleWritten: false
|
|
32831
|
+
};
|
|
32832
|
+
}, { html: Ot } = at$1, Rt = {
|
|
32770
32833
|
indent_size: 2,
|
|
32771
32834
|
indent_char: " ",
|
|
32772
32835
|
max_preserve_newlines: 2,
|
|
@@ -32778,51 +32841,51 @@ const _ = () => {
|
|
|
32778
32841
|
unformatted: ["code", "pre", "textarea"],
|
|
32779
32842
|
content_unformatted: ["pre", "code", "textarea"],
|
|
32780
32843
|
extra_liners: []
|
|
32781
|
-
},
|
|
32844
|
+
}, W = (e) => {
|
|
32782
32845
|
if (e instanceof Date)
|
|
32783
32846
|
return e.toISOString();
|
|
32784
32847
|
if (Array.isArray(e))
|
|
32785
|
-
return e.map(
|
|
32848
|
+
return e.map(W);
|
|
32786
32849
|
if (e && typeof e == "object") {
|
|
32787
|
-
const t = Object.entries(e).filter(([,
|
|
32788
|
-
for (const [
|
|
32789
|
-
n[
|
|
32850
|
+
const t = Object.entries(e).filter(([, a]) => a !== void 0).sort(([a], [r]) => a < r ? -1 : a > r ? 1 : 0), n = {};
|
|
32851
|
+
for (const [a, r] of t)
|
|
32852
|
+
n[a] = W(r);
|
|
32790
32853
|
return n;
|
|
32791
32854
|
}
|
|
32792
32855
|
return e;
|
|
32793
|
-
},
|
|
32856
|
+
}, M = (e) => JSON.stringify(W(e ?? {})), It = (e, t) => `${e}-${t.join("-")}`, Nt = (e) => {
|
|
32794
32857
|
const t = [], n = [];
|
|
32795
|
-
for (const
|
|
32796
|
-
const r =
|
|
32858
|
+
for (const a of e) {
|
|
32859
|
+
const r = a.level;
|
|
32797
32860
|
for (; n.length > r; )
|
|
32798
32861
|
n.pop();
|
|
32799
32862
|
for (; n.length < r; )
|
|
32800
32863
|
n.push(0);
|
|
32801
32864
|
const s2 = r - 1;
|
|
32802
32865
|
n[s2] = (n[s2] || 0) + 1;
|
|
32803
|
-
const
|
|
32866
|
+
const d2 = n.slice(0, r);
|
|
32804
32867
|
t.push({
|
|
32805
|
-
level:
|
|
32806
|
-
text:
|
|
32807
|
-
numbers:
|
|
32868
|
+
level: a.level,
|
|
32869
|
+
text: a.text,
|
|
32870
|
+
numbers: d2
|
|
32808
32871
|
});
|
|
32809
32872
|
}
|
|
32810
32873
|
return t;
|
|
32811
|
-
},
|
|
32812
|
-
const
|
|
32813
|
-
return
|
|
32814
|
-
},
|
|
32874
|
+
}, X = (e, t, n) => {
|
|
32875
|
+
const a = jd(t);
|
|
32876
|
+
return a !== void 0 ? `${e}-${a}` : n();
|
|
32877
|
+
}, Lt = (e) => {
|
|
32815
32878
|
const t = [], n = [];
|
|
32816
|
-
for (const
|
|
32879
|
+
for (const a of e) {
|
|
32817
32880
|
const r = {
|
|
32818
|
-
level:
|
|
32819
|
-
text:
|
|
32820
|
-
id:
|
|
32881
|
+
level: a.level,
|
|
32882
|
+
text: a.text,
|
|
32883
|
+
id: a.id,
|
|
32821
32884
|
children: []
|
|
32822
32885
|
};
|
|
32823
32886
|
for (; n.length > 0; ) {
|
|
32824
32887
|
const s2 = n[n.length - 1];
|
|
32825
|
-
if (s2 && s2.level >=
|
|
32888
|
+
if (s2 && s2.level >= a.level)
|
|
32826
32889
|
n.pop();
|
|
32827
32890
|
else
|
|
32828
32891
|
break;
|
|
@@ -32836,250 +32899,267 @@ const _ = () => {
|
|
|
32836
32899
|
n.push(r);
|
|
32837
32900
|
}
|
|
32838
32901
|
return t;
|
|
32839
|
-
},
|
|
32840
|
-
const { plugins: t = [], logger: n =
|
|
32841
|
-
for (const
|
|
32842
|
-
if (r.has(
|
|
32902
|
+
}, Vt = (e) => {
|
|
32903
|
+
const { plugins: t = [], logger: n = xt(), fetcher: a } = e, r = /* @__PURE__ */ new Map();
|
|
32904
|
+
for (const o2 of t) {
|
|
32905
|
+
if (r.has(o2.name))
|
|
32843
32906
|
throw new Error(
|
|
32844
|
-
`Plugin with name '${
|
|
32907
|
+
`Plugin with name '${o2.name}' is already registered`
|
|
32845
32908
|
);
|
|
32846
|
-
r.set(
|
|
32909
|
+
r.set(o2.name, o2);
|
|
32847
32910
|
}
|
|
32848
|
-
const s2 = async (
|
|
32849
|
-
const
|
|
32850
|
-
return
|
|
32851
|
-
},
|
|
32852
|
-
const
|
|
32911
|
+
const s2 = async (o2, h, f) => {
|
|
32912
|
+
const m = r.get(o2);
|
|
32913
|
+
return m ? await m.processBlock(h, f) : `<pre><code class="language-${o2}">${R(h)}</code></pre>`;
|
|
32914
|
+
}, d2 = (o2, h, f) => {
|
|
32915
|
+
const m = {
|
|
32853
32916
|
logger: n,
|
|
32854
32917
|
signal: h,
|
|
32855
|
-
frontmatter:
|
|
32856
|
-
getUniqueId:
|
|
32857
|
-
fetcher:
|
|
32918
|
+
frontmatter: o2,
|
|
32919
|
+
getUniqueId: f,
|
|
32920
|
+
fetcher: a
|
|
32858
32921
|
};
|
|
32859
32922
|
return () => async (y) => {
|
|
32860
32923
|
const g2 = [];
|
|
32861
32924
|
visit(
|
|
32862
32925
|
y,
|
|
32863
32926
|
"code",
|
|
32864
|
-
(w,
|
|
32927
|
+
(w, v, $2) => {
|
|
32865
32928
|
if (!w.lang || !r.has(w.lang))
|
|
32866
32929
|
return;
|
|
32867
|
-
const
|
|
32868
|
-
const
|
|
32930
|
+
const S = (async () => {
|
|
32931
|
+
const E2 = {
|
|
32869
32932
|
type: "html",
|
|
32870
32933
|
value: await s2(
|
|
32871
32934
|
w.lang,
|
|
32872
32935
|
w.value,
|
|
32873
|
-
|
|
32936
|
+
m
|
|
32874
32937
|
)
|
|
32875
32938
|
};
|
|
32876
|
-
|
|
32939
|
+
$2 && typeof v == "number" && ($2.children[v] = E2);
|
|
32877
32940
|
})();
|
|
32878
|
-
g2.push(
|
|
32941
|
+
g2.push(S);
|
|
32879
32942
|
}
|
|
32880
32943
|
), await Promise.all(g2);
|
|
32881
32944
|
};
|
|
32882
|
-
},
|
|
32883
|
-
const w = [],
|
|
32884
|
-
visit(g2, "heading", (
|
|
32885
|
-
|
|
32945
|
+
}, p2 = (o2, h, f = false, m = false, y = "") => () => (g2) => {
|
|
32946
|
+
const w = [], v = [];
|
|
32947
|
+
visit(g2, "heading", (E2) => {
|
|
32948
|
+
E2.depth >= 1 && E2.depth <= 6 && v.push(E2);
|
|
32886
32949
|
});
|
|
32887
|
-
let
|
|
32888
|
-
if (
|
|
32889
|
-
const
|
|
32890
|
-
level:
|
|
32891
|
-
text:
|
|
32950
|
+
let $2 = [];
|
|
32951
|
+
if (f) {
|
|
32952
|
+
const E2 = v.map((R2) => ({
|
|
32953
|
+
level: R2.depth,
|
|
32954
|
+
text: U(R2)
|
|
32892
32955
|
}));
|
|
32893
|
-
|
|
32956
|
+
$2 = Nt(E2);
|
|
32894
32957
|
}
|
|
32895
|
-
const
|
|
32896
|
-
|
|
32897
|
-
const
|
|
32958
|
+
const S = [];
|
|
32959
|
+
v.forEach((E2, R2) => {
|
|
32960
|
+
const C2 = U(E2), F2 = E2.data?.hProperties?.id;
|
|
32898
32961
|
let k2;
|
|
32899
|
-
if (
|
|
32900
|
-
k2 =
|
|
32901
|
-
else if (
|
|
32902
|
-
const
|
|
32962
|
+
if (F2)
|
|
32963
|
+
k2 = F2;
|
|
32964
|
+
else if (f && m) {
|
|
32965
|
+
const I2 = X(
|
|
32903
32966
|
y,
|
|
32904
|
-
|
|
32905
|
-
() => h(
|
|
32967
|
+
C2,
|
|
32968
|
+
() => h(C2)
|
|
32906
32969
|
).replace(`${y}-`, "");
|
|
32907
|
-
for (;
|
|
32908
|
-
const
|
|
32909
|
-
if (
|
|
32910
|
-
|
|
32970
|
+
for (; S.length > 0; ) {
|
|
32971
|
+
const b2 = S[S.length - 1];
|
|
32972
|
+
if (b2 && b2.level >= E2.depth)
|
|
32973
|
+
S.pop();
|
|
32911
32974
|
else
|
|
32912
32975
|
break;
|
|
32913
32976
|
}
|
|
32914
|
-
const
|
|
32915
|
-
k2 =
|
|
32916
|
-
level:
|
|
32917
|
-
contentId:
|
|
32977
|
+
const L2 = S.map((b2) => b2.contentId);
|
|
32978
|
+
k2 = L2.length > 0 ? `${y}-${L2.join("-")}-${I2}` : `${y}-${I2}`, S.push({
|
|
32979
|
+
level: E2.depth,
|
|
32980
|
+
contentId: I2
|
|
32918
32981
|
});
|
|
32919
|
-
} else if (
|
|
32920
|
-
const
|
|
32921
|
-
|
|
32982
|
+
} else if (f && R2 < $2.length) {
|
|
32983
|
+
const I2 = $2[R2];
|
|
32984
|
+
I2 ? k2 = It(
|
|
32922
32985
|
y,
|
|
32923
|
-
|
|
32924
|
-
) : k2 = h(
|
|
32986
|
+
I2.numbers
|
|
32987
|
+
) : k2 = h(C2);
|
|
32925
32988
|
} else
|
|
32926
|
-
k2 = h(
|
|
32927
|
-
|
|
32928
|
-
level:
|
|
32929
|
-
text:
|
|
32989
|
+
k2 = h(C2);
|
|
32990
|
+
E2.data || (E2.data = {}), E2.data.hProperties || (E2.data.hProperties = {}), F2 || (E2.data.hProperties.id = k2), w.push({
|
|
32991
|
+
level: E2.depth,
|
|
32992
|
+
text: C2,
|
|
32930
32993
|
id: k2
|
|
32931
32994
|
});
|
|
32932
32995
|
});
|
|
32933
|
-
const
|
|
32934
|
-
|
|
32935
|
-
},
|
|
32996
|
+
const x2 = Lt(w);
|
|
32997
|
+
o2.push(...x2);
|
|
32998
|
+
}, u = (o2) => {
|
|
32936
32999
|
throw n.error(
|
|
32937
|
-
`Failed to process markdown: ${
|
|
33000
|
+
`Failed to process markdown: ${o2 instanceof Error ? o2.message : "Unknown error"}`
|
|
32938
33001
|
), new Error(
|
|
32939
|
-
`Failed to process markdown: ${
|
|
33002
|
+
`Failed to process markdown: ${o2 instanceof Error ? o2.message : "Unknown error"}`
|
|
32940
33003
|
);
|
|
32941
|
-
},
|
|
33004
|
+
}, i = async (o2, h, f, m, y, g2) => {
|
|
32942
33005
|
const {
|
|
32943
33006
|
signal: w,
|
|
32944
|
-
useContentStringHeaderId:
|
|
32945
|
-
useHierarchicalHeadingId:
|
|
32946
|
-
advancedOptions:
|
|
32947
|
-
} =
|
|
32948
|
-
allowDangerousHtml:
|
|
32949
|
-
htmlOptions:
|
|
32950
|
-
gfmOptions:
|
|
32951
|
-
remarkPlugins:
|
|
32952
|
-
rehypePlugins:
|
|
32953
|
-
} =
|
|
32954
|
-
let
|
|
32955
|
-
const
|
|
33007
|
+
useContentStringHeaderId: v = false,
|
|
33008
|
+
useHierarchicalHeadingId: $2 = true,
|
|
33009
|
+
advancedOptions: S
|
|
33010
|
+
} = f ?? {}, {
|
|
33011
|
+
allowDangerousHtml: x2 = true,
|
|
33012
|
+
htmlOptions: E2 = Rt,
|
|
33013
|
+
gfmOptions: R2 = {},
|
|
33014
|
+
remarkPlugins: C2 = [],
|
|
33015
|
+
rehypePlugins: F2 = []
|
|
33016
|
+
} = S || {}, k2 = [];
|
|
33017
|
+
let I2 = 0;
|
|
33018
|
+
const L2 = () => `${h}-${++I2}`;
|
|
32956
33019
|
let T = unified().use(remarkParse);
|
|
32957
|
-
if (
|
|
32958
|
-
for (const
|
|
32959
|
-
Array.isArray(
|
|
32960
|
-
let
|
|
32961
|
-
|
|
33020
|
+
if (C2)
|
|
33021
|
+
for (const H2 of C2)
|
|
33022
|
+
Array.isArray(H2) ? T = T.use(H2[0], H2[1]) : T = T.use(H2);
|
|
33023
|
+
let b2 = T.use(remarkGfm, R2).use(Tt).use(
|
|
33024
|
+
p2(
|
|
32962
33025
|
k2,
|
|
32963
|
-
|
|
32964
|
-
|
|
32965
|
-
|
|
33026
|
+
v ? (H2) => X(h, H2, L2) : L2,
|
|
33027
|
+
$2,
|
|
33028
|
+
v,
|
|
32966
33029
|
h
|
|
32967
33030
|
)
|
|
32968
|
-
).use(
|
|
32969
|
-
if (
|
|
32970
|
-
for (const
|
|
32971
|
-
Array.isArray(
|
|
32972
|
-
const
|
|
33031
|
+
).use(d2(m, w, L2)).use(remarkRehype, { allowDangerousHtml: x2 }).use(Ct).use(rehypeStringify, { allowDangerousHtml: x2 });
|
|
33032
|
+
if (F2)
|
|
33033
|
+
for (const H2 of F2)
|
|
33034
|
+
Array.isArray(H2) ? b2 = b2.use(H2[0], H2[1]) : b2 = b2.use(H2);
|
|
33035
|
+
const B2 = await b2.process(y), P2 = String(B2);
|
|
32973
33036
|
return {
|
|
32974
|
-
html:
|
|
32975
|
-
frontmatter:
|
|
33037
|
+
html: Ot(P2, E2),
|
|
33038
|
+
frontmatter: m,
|
|
32976
33039
|
changed: g2,
|
|
32977
33040
|
headingTree: k2,
|
|
32978
|
-
composeMarkdown: () => g2 ?
|
|
33041
|
+
composeMarkdown: () => g2 ? V(m, y) : o2,
|
|
32979
33042
|
uniqueIdPrefix: h
|
|
32980
33043
|
};
|
|
32981
33044
|
};
|
|
32982
33045
|
return {
|
|
32983
|
-
process: async (
|
|
33046
|
+
process: async (o2, h, f = {}) => {
|
|
32984
33047
|
try {
|
|
32985
|
-
const { data:
|
|
32986
|
-
|
|
32987
|
-
|
|
33048
|
+
const { data: m, content: y } = Q(o2), g2 = f.h1TitleTransform ?? "extractAndRemove";
|
|
33049
|
+
let w = y, v = false, $2 = false;
|
|
33050
|
+
if (g2 !== "none") {
|
|
33051
|
+
const x2 = Z(w, m, {
|
|
33052
|
+
allowTitleWrite: true,
|
|
33053
|
+
transform: g2
|
|
33054
|
+
});
|
|
33055
|
+
w = x2.content, v = x2.headingRemoved, $2 = x2.titleWritten;
|
|
33056
|
+
}
|
|
33057
|
+
return await i(
|
|
33058
|
+
o2,
|
|
32988
33059
|
h,
|
|
32989
|
-
|
|
32990
|
-
|
|
32991
|
-
|
|
32992
|
-
|
|
33060
|
+
f,
|
|
33061
|
+
m,
|
|
33062
|
+
w,
|
|
33063
|
+
v || $2
|
|
32993
33064
|
);
|
|
32994
|
-
} catch (
|
|
32995
|
-
return
|
|
33065
|
+
} catch (m) {
|
|
33066
|
+
return u(m);
|
|
32996
33067
|
}
|
|
32997
33068
|
},
|
|
32998
|
-
processWithFrontmatterTransform: async (
|
|
33069
|
+
processWithFrontmatterTransform: async (o2, h, f, m, y = {}) => {
|
|
32999
33070
|
try {
|
|
33000
|
-
const { data: g2, content: w } =
|
|
33071
|
+
const { data: g2, content: w } = Q(o2), v = M(g2), S = await f({
|
|
33001
33072
|
originalFrontmatter: g2,
|
|
33002
33073
|
markdownContent: w,
|
|
33003
33074
|
uniqueIdPrefix: h
|
|
33004
33075
|
});
|
|
33005
|
-
if (
|
|
33076
|
+
if (S === void 0)
|
|
33006
33077
|
return;
|
|
33007
|
-
const { frontmatter:
|
|
33008
|
-
|
|
33009
|
-
|
|
33078
|
+
const { frontmatter: x2, uniqueIdPrefix: E2 } = S, R2 = E2 ?? h, C2 = y.h1TitleTransform ?? "extractAndRemove";
|
|
33079
|
+
let F2 = w, k2 = false;
|
|
33080
|
+
if (C2 !== "none") {
|
|
33081
|
+
const A = Z(F2, x2, {
|
|
33082
|
+
allowTitleWrite: true,
|
|
33083
|
+
transform: C2
|
|
33084
|
+
});
|
|
33085
|
+
F2 = A.content, k2 = A.headingRemoved || k2;
|
|
33086
|
+
}
|
|
33087
|
+
const L2 = M(x2) !== v || k2, T = await i(
|
|
33088
|
+
o2,
|
|
33089
|
+
R2,
|
|
33010
33090
|
y,
|
|
33091
|
+
x2,
|
|
33011
33092
|
F2,
|
|
33012
|
-
|
|
33013
|
-
N2
|
|
33093
|
+
L2
|
|
33014
33094
|
);
|
|
33015
|
-
let b2 =
|
|
33016
|
-
if (
|
|
33095
|
+
let b2 = T.frontmatter;
|
|
33096
|
+
if (m) {
|
|
33017
33097
|
const A = {
|
|
33018
33098
|
frontmatter: b2,
|
|
33019
|
-
headingTree:
|
|
33099
|
+
headingTree: T.headingTree
|
|
33020
33100
|
};
|
|
33021
|
-
b2 =
|
|
33101
|
+
b2 = await m(A);
|
|
33022
33102
|
}
|
|
33023
|
-
const
|
|
33103
|
+
const P2 = M(b2) !== v || k2, J2 = () => P2 ? V(b2, F2) : o2;
|
|
33024
33104
|
return {
|
|
33025
|
-
html:
|
|
33105
|
+
html: T.html,
|
|
33026
33106
|
frontmatter: b2,
|
|
33027
|
-
changed:
|
|
33028
|
-
headingTree:
|
|
33029
|
-
composeMarkdown:
|
|
33030
|
-
uniqueIdPrefix:
|
|
33107
|
+
changed: P2,
|
|
33108
|
+
headingTree: T.headingTree,
|
|
33109
|
+
composeMarkdown: J2,
|
|
33110
|
+
uniqueIdPrefix: T.uniqueIdPrefix
|
|
33031
33111
|
};
|
|
33032
33112
|
} catch (g2) {
|
|
33033
|
-
return
|
|
33113
|
+
return u(g2);
|
|
33034
33114
|
}
|
|
33035
33115
|
}
|
|
33036
33116
|
};
|
|
33037
|
-
},
|
|
33038
|
-
const { maxRedirects: n = 5, timeoutEachRedirect:
|
|
33117
|
+
}, Zt = (e, t = {}) => {
|
|
33118
|
+
const { maxRedirects: n = 5, timeoutEachRedirect: a = 1e4 } = t;
|
|
33039
33119
|
return {
|
|
33040
33120
|
name: "oembed",
|
|
33041
|
-
processBlock: async (s2,
|
|
33042
|
-
const
|
|
33043
|
-
if (!qd(
|
|
33044
|
-
throw new Error(`Invalid URL: ${
|
|
33121
|
+
processBlock: async (s2, d2) => {
|
|
33122
|
+
const p2 = s2.trim();
|
|
33123
|
+
if (!qd(p2))
|
|
33124
|
+
throw new Error(`Invalid URL: ${p2}`);
|
|
33045
33125
|
try {
|
|
33046
|
-
const
|
|
33047
|
-
|
|
33126
|
+
const u = await Gd(
|
|
33127
|
+
p2,
|
|
33048
33128
|
n,
|
|
33049
|
-
|
|
33050
|
-
|
|
33129
|
+
a,
|
|
33130
|
+
d2,
|
|
33051
33131
|
e
|
|
33052
33132
|
);
|
|
33053
|
-
return Wd(
|
|
33054
|
-
} catch (
|
|
33055
|
-
|
|
33056
|
-
const
|
|
33057
|
-
return typeof window < "u" ? Xs(
|
|
33133
|
+
return Wd(u, p2, t);
|
|
33134
|
+
} catch (u) {
|
|
33135
|
+
d2.logger.warn("oEmbed fetch failed for URL:", p2, u);
|
|
33136
|
+
const i = Vd(u);
|
|
33137
|
+
return typeof window < "u" ? Xs(p2, i) : Xs(p2, i);
|
|
33058
33138
|
}
|
|
33059
33139
|
}
|
|
33060
33140
|
};
|
|
33061
|
-
},
|
|
33141
|
+
}, Xt = (e = {}) => ({
|
|
33062
33142
|
name: "card",
|
|
33063
|
-
processBlock: async (n,
|
|
33143
|
+
processBlock: async (n, a) => {
|
|
33064
33144
|
const r = n.trim();
|
|
33065
33145
|
if (!Xd(r))
|
|
33066
33146
|
throw new Error(`Invalid URL: ${r}`);
|
|
33067
33147
|
try {
|
|
33068
|
-
const s2 = await Jd(r, e,
|
|
33148
|
+
const s2 = await Jd(r, e, a);
|
|
33069
33149
|
return th(s2, r, e);
|
|
33070
33150
|
} catch (s2) {
|
|
33071
|
-
|
|
33072
|
-
const
|
|
33073
|
-
return typeof window < "u" ? eh(r,
|
|
33151
|
+
a.logger.warn("Card plugin fetch failed for URL:", r, s2);
|
|
33152
|
+
const d2 = Vd(s2);
|
|
33153
|
+
return typeof window < "u" ? eh(r, d2) : eh(r, d2);
|
|
33074
33154
|
}
|
|
33075
33155
|
}
|
|
33076
|
-
}),
|
|
33156
|
+
}), Yt = (e = {}) => {
|
|
33077
33157
|
const { className: t = "mermaid", includeId: n = true } = e;
|
|
33078
33158
|
return {
|
|
33079
33159
|
name: "mermaid",
|
|
33080
33160
|
processBlock: async (r, s2) => {
|
|
33081
|
-
const
|
|
33082
|
-
if (!
|
|
33161
|
+
const d2 = r.trim();
|
|
33162
|
+
if (!d2) {
|
|
33083
33163
|
s2.logger.warn("Mermaid plugin received empty content");
|
|
33084
33164
|
const l2 = n ? ` id="${s2.getUniqueId()}"` : "";
|
|
33085
33165
|
return `<div class="${t}-wrapper">
|
|
@@ -33093,7 +33173,7 @@ const _ = () => {
|
|
|
33093
33173
|
<div class="${t}"${l2}><!-- Empty mermaid content --></div>
|
|
33094
33174
|
</div>`;
|
|
33095
33175
|
}
|
|
33096
|
-
const
|
|
33176
|
+
const p2 = n ? ` id="${s2.getUniqueId()}"` : "", u = d2.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'"), i = `<div class="${t}-wrapper">
|
|
33097
33177
|
<style>
|
|
33098
33178
|
.${t}-wrapper .${t} > svg {
|
|
33099
33179
|
width: auto !important;
|
|
@@ -33101,61 +33181,62 @@ const _ = () => {
|
|
|
33101
33181
|
max-width: none !important;
|
|
33102
33182
|
}
|
|
33103
33183
|
</style>
|
|
33104
|
-
<div class="${t}"${
|
|
33184
|
+
<div class="${t}"${p2}>${u}</div>
|
|
33105
33185
|
</div>`;
|
|
33106
33186
|
return s2.logger.debug("Mermaid plugin processed content:", {
|
|
33107
|
-
contentLength:
|
|
33187
|
+
contentLength: d2.length,
|
|
33108
33188
|
className: t,
|
|
33109
33189
|
includeId: n
|
|
33110
|
-
}),
|
|
33190
|
+
}), i;
|
|
33111
33191
|
}
|
|
33112
33192
|
};
|
|
33113
33193
|
};
|
|
33114
33194
|
/*!
|
|
33115
33195
|
* name: async-primitives
|
|
33116
|
-
* version: 1.
|
|
33196
|
+
* version: 1.5.0
|
|
33117
33197
|
* description: A collection of primitive functions for asynchronous operations
|
|
33118
33198
|
* author: Kouji Matsui (@kekyo@mi.kekyo.net)
|
|
33119
33199
|
* license: MIT
|
|
33120
33200
|
* repository.url: https://github.com/kekyo/async-primitives.git
|
|
33121
|
-
* git.commit.hash:
|
|
33201
|
+
* git.commit.hash: cd35465b7e9b9945049186e7eaeecc0bfba65766
|
|
33122
33202
|
*/
|
|
33123
|
-
const
|
|
33124
|
-
},
|
|
33125
|
-
release:
|
|
33126
|
-
[Symbol.dispose]:
|
|
33127
|
-
},
|
|
33203
|
+
const Y = () => {
|
|
33204
|
+
}, tt = {
|
|
33205
|
+
release: Y,
|
|
33206
|
+
[Symbol.dispose]: Y
|
|
33207
|
+
}, et = (e) => e instanceof Error ? e : typeof e == "string" ? new Error(e) : new Error("Operation aborted"), At = (e, t) => {
|
|
33128
33208
|
if (!e)
|
|
33129
|
-
return
|
|
33209
|
+
return tt;
|
|
33130
33210
|
if (e.aborted) {
|
|
33131
33211
|
try {
|
|
33132
|
-
t();
|
|
33212
|
+
t(et(e.reason));
|
|
33133
33213
|
} catch (s2) {
|
|
33134
33214
|
console.warn("AbortHook callback error: ", s2);
|
|
33135
33215
|
}
|
|
33136
|
-
return
|
|
33216
|
+
return tt;
|
|
33137
33217
|
}
|
|
33138
33218
|
let n;
|
|
33139
33219
|
n = () => {
|
|
33140
33220
|
if (n) {
|
|
33221
|
+
const s2 = e.reason;
|
|
33141
33222
|
e.removeEventListener("abort", n), n = void 0;
|
|
33142
33223
|
try {
|
|
33143
|
-
t();
|
|
33144
|
-
} catch (
|
|
33145
|
-
console.warn("AbortHook callback error: ",
|
|
33224
|
+
t(et(s2));
|
|
33225
|
+
} catch (d2) {
|
|
33226
|
+
console.warn("AbortHook callback error: ", d2);
|
|
33146
33227
|
}
|
|
33147
33228
|
}
|
|
33148
33229
|
};
|
|
33149
|
-
const
|
|
33230
|
+
const a = () => {
|
|
33150
33231
|
n && (e.removeEventListener("abort", n), n = void 0);
|
|
33151
33232
|
};
|
|
33152
33233
|
return e.addEventListener("abort", n, { once: true }), {
|
|
33153
|
-
release:
|
|
33154
|
-
[Symbol.dispose]:
|
|
33234
|
+
release: a,
|
|
33235
|
+
[Symbol.dispose]: a
|
|
33155
33236
|
};
|
|
33156
|
-
},
|
|
33237
|
+
}, Pt = (e) => {
|
|
33157
33238
|
typeof setImmediate == "function" ? setImmediate(e) : setTimeout(e, 0);
|
|
33158
|
-
},
|
|
33239
|
+
}, q = () => new Error("Lock acquisition was aborted"), _t = (e) => {
|
|
33159
33240
|
let t = true;
|
|
33160
33241
|
const n = () => {
|
|
33161
33242
|
t && (t = false, e());
|
|
@@ -33170,56 +33251,56 @@ const V = () => {
|
|
|
33170
33251
|
}, z = (e = 20) => {
|
|
33171
33252
|
let t = false;
|
|
33172
33253
|
const n = [];
|
|
33173
|
-
let
|
|
33254
|
+
let a = 0;
|
|
33174
33255
|
const r = () => {
|
|
33175
33256
|
var l2;
|
|
33176
33257
|
if (t || n.length === 0)
|
|
33177
33258
|
return;
|
|
33178
|
-
const
|
|
33179
|
-
if ((l2 =
|
|
33180
|
-
|
|
33259
|
+
const c = n.shift();
|
|
33260
|
+
if ((l2 = c.signal) != null && l2.aborted) {
|
|
33261
|
+
c.reject(q()), s2();
|
|
33181
33262
|
return;
|
|
33182
33263
|
}
|
|
33183
33264
|
t = true;
|
|
33184
|
-
const
|
|
33185
|
-
|
|
33265
|
+
const o2 = _t(d2);
|
|
33266
|
+
c.resolve(o2);
|
|
33186
33267
|
}, s2 = () => {
|
|
33187
|
-
|
|
33188
|
-
},
|
|
33268
|
+
a++, a >= e ? (a = 0, Pt(r)) : r();
|
|
33269
|
+
}, d2 = () => {
|
|
33189
33270
|
t && (t = false, s2());
|
|
33190
|
-
},
|
|
33191
|
-
const
|
|
33192
|
-
|
|
33193
|
-
},
|
|
33271
|
+
}, p2 = (l2) => {
|
|
33272
|
+
const c = n.indexOf(l2);
|
|
33273
|
+
c !== -1 && n.splice(c, 1);
|
|
33274
|
+
}, u = async (l2) => {
|
|
33194
33275
|
if (l2) {
|
|
33195
33276
|
if (l2.aborted)
|
|
33196
|
-
throw
|
|
33197
|
-
return new Promise((
|
|
33277
|
+
throw q();
|
|
33278
|
+
return new Promise((c, o2) => {
|
|
33198
33279
|
const h = {
|
|
33199
33280
|
resolve: void 0,
|
|
33200
33281
|
reject: void 0,
|
|
33201
33282
|
signal: l2
|
|
33202
|
-
},
|
|
33203
|
-
|
|
33283
|
+
}, f = At(l2, () => {
|
|
33284
|
+
p2(h), o2(q());
|
|
33204
33285
|
});
|
|
33205
|
-
h.resolve = (
|
|
33206
|
-
|
|
33207
|
-
}, h.reject = (
|
|
33208
|
-
|
|
33286
|
+
h.resolve = (m) => {
|
|
33287
|
+
f.release(), c(m);
|
|
33288
|
+
}, h.reject = (m) => {
|
|
33289
|
+
f.release(), o2(m);
|
|
33209
33290
|
}, n.push(h), r();
|
|
33210
33291
|
});
|
|
33211
33292
|
} else
|
|
33212
|
-
return new Promise((
|
|
33293
|
+
return new Promise((c, o2) => {
|
|
33213
33294
|
n.push({
|
|
33214
|
-
resolve:
|
|
33215
|
-
reject:
|
|
33295
|
+
resolve: c,
|
|
33296
|
+
reject: o2
|
|
33216
33297
|
}), r();
|
|
33217
33298
|
});
|
|
33218
33299
|
};
|
|
33219
33300
|
return {
|
|
33220
|
-
lock:
|
|
33301
|
+
lock: u,
|
|
33221
33302
|
waiter: {
|
|
33222
|
-
wait:
|
|
33303
|
+
wait: u
|
|
33223
33304
|
},
|
|
33224
33305
|
get isLocked() {
|
|
33225
33306
|
return t;
|
|
@@ -33228,92 +33309,92 @@ const V = () => {
|
|
|
33228
33309
|
return n.length;
|
|
33229
33310
|
}
|
|
33230
33311
|
};
|
|
33231
|
-
},
|
|
33232
|
-
const e = /* @__PURE__ */ new Map(), t = z(), n = (
|
|
33233
|
-
const
|
|
33234
|
-
for (const [l2,
|
|
33235
|
-
|
|
33236
|
-
for (const l2 of
|
|
33312
|
+
}, jt = () => {
|
|
33313
|
+
const e = /* @__PURE__ */ new Map(), t = z(), n = (u = Date.now()) => {
|
|
33314
|
+
const i = [];
|
|
33315
|
+
for (const [l2, c] of e.entries())
|
|
33316
|
+
c.ttl !== void 0 && (c.ttl === 0 || u > c.timestamp + c.ttl) && i.push(l2);
|
|
33317
|
+
for (const l2 of i)
|
|
33237
33318
|
e.delete(l2);
|
|
33238
|
-
return
|
|
33319
|
+
return i;
|
|
33239
33320
|
};
|
|
33240
33321
|
return {
|
|
33241
|
-
get: async (
|
|
33242
|
-
const
|
|
33243
|
-
if (!
|
|
33322
|
+
get: async (u) => {
|
|
33323
|
+
const i = e.get(u);
|
|
33324
|
+
if (!i)
|
|
33244
33325
|
return null;
|
|
33245
|
-
if (
|
|
33246
|
-
const
|
|
33326
|
+
if (i.ttl !== void 0 && (i.ttl === 0 || Date.now() > i.timestamp + i.ttl)) {
|
|
33327
|
+
const c = await t.lock();
|
|
33247
33328
|
try {
|
|
33248
|
-
const
|
|
33249
|
-
if (
|
|
33329
|
+
const o2 = e.get(u);
|
|
33330
|
+
if (o2 && o2.ttl !== void 0) {
|
|
33250
33331
|
const h = Date.now();
|
|
33251
|
-
(
|
|
33332
|
+
(o2.ttl === 0 || h > o2.timestamp + o2.ttl) && e.delete(u);
|
|
33252
33333
|
}
|
|
33253
33334
|
return null;
|
|
33254
33335
|
} finally {
|
|
33255
|
-
|
|
33336
|
+
c.release();
|
|
33256
33337
|
}
|
|
33257
33338
|
}
|
|
33258
|
-
return
|
|
33339
|
+
return i.data;
|
|
33259
33340
|
},
|
|
33260
|
-
set: async (
|
|
33261
|
-
const
|
|
33262
|
-
data:
|
|
33341
|
+
set: async (u, i, l2) => {
|
|
33342
|
+
const c = {
|
|
33343
|
+
data: i,
|
|
33263
33344
|
timestamp: Date.now()
|
|
33264
33345
|
};
|
|
33265
|
-
l2 !== void 0 && (
|
|
33266
|
-
const
|
|
33346
|
+
l2 !== void 0 && (c.ttl = l2);
|
|
33347
|
+
const o2 = await t.lock();
|
|
33267
33348
|
try {
|
|
33268
|
-
e.set(
|
|
33349
|
+
e.set(u, c);
|
|
33269
33350
|
} finally {
|
|
33270
|
-
|
|
33351
|
+
o2.release();
|
|
33271
33352
|
}
|
|
33272
33353
|
},
|
|
33273
|
-
delete: async (
|
|
33274
|
-
const
|
|
33354
|
+
delete: async (u) => {
|
|
33355
|
+
const i = await t.lock();
|
|
33275
33356
|
try {
|
|
33276
|
-
e.delete(
|
|
33357
|
+
e.delete(u);
|
|
33277
33358
|
} finally {
|
|
33278
|
-
|
|
33359
|
+
i.release();
|
|
33279
33360
|
}
|
|
33280
33361
|
},
|
|
33281
33362
|
clear: async () => {
|
|
33282
|
-
const
|
|
33363
|
+
const u = await t.lock();
|
|
33283
33364
|
try {
|
|
33284
33365
|
e.clear();
|
|
33285
33366
|
} finally {
|
|
33286
|
-
|
|
33367
|
+
u.release();
|
|
33287
33368
|
}
|
|
33288
33369
|
},
|
|
33289
33370
|
size: async () => {
|
|
33290
33371
|
if (Array.from(e.entries()).length === 0)
|
|
33291
33372
|
return 0;
|
|
33292
|
-
const
|
|
33373
|
+
const i = await t.lock();
|
|
33293
33374
|
try {
|
|
33294
33375
|
return n(), e.size;
|
|
33295
33376
|
} finally {
|
|
33296
|
-
|
|
33377
|
+
i.release();
|
|
33297
33378
|
}
|
|
33298
33379
|
}
|
|
33299
33380
|
};
|
|
33300
33381
|
};
|
|
33301
|
-
function
|
|
33382
|
+
function D(e, t, n) {
|
|
33302
33383
|
return `fetch:${e}:${t}:${n}`;
|
|
33303
33384
|
}
|
|
33304
|
-
const
|
|
33385
|
+
const re = (e, t = 6e4, n, a) => {
|
|
33305
33386
|
const {
|
|
33306
33387
|
cache: r = true,
|
|
33307
33388
|
cacheTTL: s2 = 3600 * 1e3,
|
|
33308
33389
|
// 1 hour default
|
|
33309
|
-
cacheFailures:
|
|
33310
|
-
failureCacheTTL:
|
|
33390
|
+
cacheFailures: d2 = true,
|
|
33391
|
+
failureCacheTTL: p2 = 300 * 1e3
|
|
33311
33392
|
// 5 minutes default for failures
|
|
33312
|
-
} = {},
|
|
33393
|
+
} = {}, u = r ? n || jt() : void 0;
|
|
33313
33394
|
return {
|
|
33314
|
-
rawFetcher: async (l2,
|
|
33315
|
-
if (r &&
|
|
33316
|
-
const y =
|
|
33395
|
+
rawFetcher: async (l2, c, o2, h) => {
|
|
33396
|
+
if (r && u) {
|
|
33397
|
+
const y = D(l2, c, e), g2 = await u.get(y);
|
|
33317
33398
|
if (g2)
|
|
33318
33399
|
try {
|
|
33319
33400
|
const w = JSON.parse(g2);
|
|
@@ -33322,14 +33403,14 @@ const Yt = (e, t = 6e4, n, o2) => {
|
|
|
33322
33403
|
status: 200,
|
|
33323
33404
|
statusText: "OK",
|
|
33324
33405
|
headers: {
|
|
33325
|
-
"Content-Type":
|
|
33406
|
+
"Content-Type": c,
|
|
33326
33407
|
"X-Cache": "HIT"
|
|
33327
33408
|
}
|
|
33328
33409
|
});
|
|
33329
|
-
if (w.type === "error" &&
|
|
33410
|
+
if (w.type === "error" && d2)
|
|
33330
33411
|
throw h?.info(`Cache HIT (error) for URL: ${l2}`), new Error("Cached error");
|
|
33331
33412
|
h?.debug(
|
|
33332
|
-
`Cache entry type ${w.type} not eligible for use, cacheFailures: ${
|
|
33413
|
+
`Cache entry type ${w.type} not eligible for use, cacheFailures: ${d2}`
|
|
33333
33414
|
);
|
|
33334
33415
|
} catch (w) {
|
|
33335
33416
|
if (h?.warn(
|
|
@@ -33343,50 +33424,50 @@ const Yt = (e, t = 6e4, n, o2) => {
|
|
|
33343
33424
|
else
|
|
33344
33425
|
h?.info(`Cache MISS for URL: ${l2}`);
|
|
33345
33426
|
}
|
|
33346
|
-
let
|
|
33427
|
+
let f, m = null;
|
|
33347
33428
|
try {
|
|
33348
|
-
|
|
33429
|
+
f = await Yd(
|
|
33349
33430
|
l2,
|
|
33350
|
-
|
|
33431
|
+
c,
|
|
33351
33432
|
e,
|
|
33352
33433
|
t,
|
|
33353
|
-
|
|
33434
|
+
o2,
|
|
33354
33435
|
h
|
|
33355
33436
|
);
|
|
33356
33437
|
} catch (y) {
|
|
33357
|
-
if (
|
|
33438
|
+
if (m = y, r && u && d2)
|
|
33358
33439
|
try {
|
|
33359
|
-
const g2 =
|
|
33440
|
+
const g2 = D(l2, c, e), w = {
|
|
33360
33441
|
type: "error",
|
|
33361
33442
|
data: "",
|
|
33362
33443
|
error: {
|
|
33363
|
-
message:
|
|
33364
|
-
...
|
|
33444
|
+
message: m.message,
|
|
33445
|
+
...m.message.includes("HTTP error, status:") && {
|
|
33365
33446
|
status: parseInt(
|
|
33366
|
-
|
|
33447
|
+
m.message.match(/status: (\d+)/)?.[1] || "0"
|
|
33367
33448
|
)
|
|
33368
33449
|
}
|
|
33369
33450
|
},
|
|
33370
33451
|
timestamp: Date.now()
|
|
33371
33452
|
};
|
|
33372
|
-
await
|
|
33453
|
+
await u.set(
|
|
33373
33454
|
g2,
|
|
33374
33455
|
JSON.stringify(w),
|
|
33375
|
-
|
|
33456
|
+
p2
|
|
33376
33457
|
), h?.debug(`Cached error for URL: ${l2}`);
|
|
33377
33458
|
} catch (g2) {
|
|
33378
33459
|
h?.warn(`Failed to cache error for URL ${l2}:`, g2), console.warn("Failed to cache error:", g2);
|
|
33379
33460
|
}
|
|
33380
|
-
throw
|
|
33461
|
+
throw m;
|
|
33381
33462
|
}
|
|
33382
|
-
if (r &&
|
|
33463
|
+
if (r && u && f.ok)
|
|
33383
33464
|
try {
|
|
33384
|
-
const y = await
|
|
33465
|
+
const y = await f.clone().text(), g2 = D(l2, c, e), w = {
|
|
33385
33466
|
type: "success",
|
|
33386
33467
|
data: y,
|
|
33387
33468
|
timestamp: Date.now()
|
|
33388
33469
|
};
|
|
33389
|
-
await
|
|
33470
|
+
await u.set(
|
|
33390
33471
|
g2,
|
|
33391
33472
|
JSON.stringify(w),
|
|
33392
33473
|
s2
|
|
@@ -33394,30 +33475,30 @@ const Yt = (e, t = 6e4, n, o2) => {
|
|
|
33394
33475
|
} catch (y) {
|
|
33395
33476
|
h?.warn(`Failed to cache response for URL ${l2}:`, y), console.warn("Failed to cache response:", y);
|
|
33396
33477
|
}
|
|
33397
|
-
return
|
|
33478
|
+
return f;
|
|
33398
33479
|
},
|
|
33399
33480
|
userAgent: e
|
|
33400
33481
|
};
|
|
33401
33482
|
};
|
|
33402
33483
|
function setupProcessor(config) {
|
|
33403
33484
|
const plugins = [];
|
|
33404
|
-
const logger =
|
|
33405
|
-
const fetcher =
|
|
33485
|
+
const logger = Qt();
|
|
33486
|
+
const fetcher = re(
|
|
33406
33487
|
"mark-deco-cli/0.0.1",
|
|
33407
33488
|
5e3,
|
|
33408
|
-
|
|
33489
|
+
jt()
|
|
33409
33490
|
);
|
|
33410
33491
|
const enabledPlugins = config.noPlugins ? [] : Array.isArray(config.plugins) ? config.plugins : ["oembed", "card", "mermaid"];
|
|
33411
33492
|
if (enabledPlugins.includes("oembed") && config.oembed?.enabled !== false) {
|
|
33412
|
-
plugins.push(
|
|
33493
|
+
plugins.push(Zt($d, {}));
|
|
33413
33494
|
}
|
|
33414
33495
|
if (enabledPlugins.includes("card") && config.card?.enabled !== false) {
|
|
33415
|
-
plugins.push(
|
|
33496
|
+
plugins.push(Xt({}));
|
|
33416
33497
|
}
|
|
33417
33498
|
if (enabledPlugins.includes("mermaid") && config.mermaid?.enabled !== false) {
|
|
33418
|
-
plugins.push(
|
|
33499
|
+
plugins.push(Yt({}));
|
|
33419
33500
|
}
|
|
33420
|
-
return
|
|
33501
|
+
return Vt({
|
|
33421
33502
|
plugins,
|
|
33422
33503
|
logger,
|
|
33423
33504
|
fetcher
|
|
@@ -33452,6 +33533,11 @@ async function main() {
|
|
|
33452
33533
|
"--content-based-heading-id",
|
|
33453
33534
|
"Use content-based heading IDs"
|
|
33454
33535
|
).default(false)
|
|
33536
|
+
).addOption(
|
|
33537
|
+
new commander.Option(
|
|
33538
|
+
"--h1-title-transform <mode>",
|
|
33539
|
+
"Control how the first H1 heading is applied to frontmatter.title (extract, extractAndRemove, none)"
|
|
33540
|
+
).choices(["extract", "extractAndRemove", "none"])
|
|
33455
33541
|
).addOption(
|
|
33456
33542
|
new commander.Option(
|
|
33457
33543
|
"--frontmatter-output <file>",
|
|
@@ -33469,12 +33555,14 @@ async function main() {
|
|
|
33469
33555
|
const mergedOptions = { ...config, ...options2 };
|
|
33470
33556
|
const markdown = await readInput(options2.input);
|
|
33471
33557
|
const processor = setupProcessor(mergedOptions);
|
|
33558
|
+
const h1TitleTransform = options2.h1TitleTransform ?? config.h1TitleTransform ?? "extractAndRemove";
|
|
33472
33559
|
const result = await processor.process(
|
|
33473
33560
|
markdown,
|
|
33474
33561
|
options2.uniqueIdPrefix || "section",
|
|
33475
33562
|
{
|
|
33476
33563
|
useHierarchicalHeadingId: options2.hierarchicalHeadingId ?? true,
|
|
33477
|
-
useContentStringHeaderId: options2.contentBasedHeadingId ?? false
|
|
33564
|
+
useContentStringHeaderId: options2.contentBasedHeadingId ?? false,
|
|
33565
|
+
h1TitleTransform
|
|
33478
33566
|
}
|
|
33479
33567
|
);
|
|
33480
33568
|
await writeOutput(result.html, options2.output);
|