mark-deco-cli 0.13.0 → 0.14.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 CHANGED
@@ -2,12 +2,12 @@
2
2
  "use strict";
3
3
  /*!
4
4
  * name: mark-deco-cli
5
- * version: 0.13.0
5
+ * version: 0.14.0
6
6
  * description: Command-line interface for mark-deco Markdown to HTML conversion processor
7
7
  * author: Kouji Matsui (@kekyo@mi.kekyo.net)
8
8
  * license: MIT
9
9
  * repository.url: https://github.com/kekyo/mark-deco.git
10
- * git.commit.hash: a57a326430fda951da873116177f76aa783d4413
10
+ * git.commit.hash: 090ae78518ae17207fdb90e6fca59893315672fb
11
11
  */
12
12
  const commander = require("commander");
13
13
  const promises = require("fs/promises");
@@ -21417,12 +21417,12 @@ var load = loader.load;
21417
21417
  var dump = dumper.dump;
21418
21418
  /*!
21419
21419
  * name: mark-deco
21420
- * version: 0.13.0
21420
+ * version: 0.14.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: a57a326430fda951da873116177f76aa783d4413
21425
+ * git.commit.hash: 090ae78518ae17207fdb90e6fca59893315672fb
21426
21426
  */
21427
21427
  const qd = (e) => {
21428
21428
  try {
@@ -21751,31 +21751,31 @@ const Gd = async (e, t, u, r, a) => {
21751
21751
  "oembed-thumbnail"
21752
21752
  )
21753
21753
  }), r.embeddedContent !== void 0 && c) {
21754
- const M2 = f ? f.trim() : "";
21754
+ const M = f ? f.trim() : "";
21755
21755
  T.push({
21756
21756
  order: r.embeddedContent,
21757
21757
  html: ou(
21758
21758
  R(c),
21759
21759
  R(i),
21760
21760
  void 0,
21761
- M2
21761
+ M
21762
21762
  )
21763
21763
  });
21764
21764
  }
21765
21765
  if (r.externalLink !== void 0) {
21766
- const M2 = a.useMetadataUrlLink && e.web_page || t;
21766
+ const M = a.useMetadataUrlLink && e.web_page || t;
21767
21767
  T.push({
21768
21768
  order: r.externalLink,
21769
21769
  html: `<div class="oembed-external-link">
21770
- <a href="${R(M2)}" target="_blank" rel="noopener noreferrer">
21770
+ <a href="${R(M)}" target="_blank" rel="noopener noreferrer">
21771
21771
  Visit ${R(u)}
21772
21772
  </a>
21773
21773
  </div>`
21774
21774
  });
21775
21775
  }
21776
- const A = T.sort((M2, ee) => M2.order - ee.order), w = [], v = [];
21777
- A.forEach((M2) => {
21778
- M2.html.includes("oembed-title") || M2.html.includes("oembed-author") || M2.html.includes("oembed-provider") || M2.html.includes("oembed-description") ? w.push(M2.html) : v.push(M2.html);
21776
+ const A = T.sort((M, ee) => M.order - ee.order), w = [], v = [];
21777
+ A.forEach((M) => {
21778
+ M.html.includes("oembed-title") || M.html.includes("oembed-author") || M.html.includes("oembed-provider") || M.html.includes("oembed-description") ? w.push(M.html) : v.push(M.html);
21779
21779
  });
21780
21780
  let S = "";
21781
21781
  w.length > 0 && (S = `<div class="oembed-header">${w.join("")}</div>`);
@@ -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$1;
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 || (L = {}));
21916
+ })(L$1 || (L$1 = {}));
21917
21917
  function aa(e) {
21918
- return e.type === L.Tag || e.type === L.Script || e.type === L.Style;
21918
+ return e.type === L$1.Tag || e.type === L$1.Script || e.type === L$1.Style;
21919
21919
  }
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;
21920
+ const cu = L$1.Root, gr = L$1.Text, ia = L$1.Directive, Ar = L$1.Comment, na = L$1.Script, oa = L$1.Style, zt = L$1.Tag, ca = L$1.CDATA, da = L$1.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.Text;
21986
+ super(...arguments), this.type = L$1.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.Comment;
21994
+ super(...arguments), this.type = L$1.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.Directive;
22002
+ super(u), this.name = t, this.type = L$1.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.CDATA;
22038
+ super(...arguments), this.type = L$1.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.Root;
22046
+ super(...arguments), this.type = L$1.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.Script : t === "style" ? L.Style : L.Tag) {
22058
+ constructor(t, u, r = [], a = t === "script" ? L$1.Script : t === "style" ? L$1.Style : L$1.Tag) {
22059
22059
  super(r), this.name = t, this.attribs = u, this.type = a;
22060
22060
  }
22061
22061
  get nodeType() {
@@ -22088,21 +22088,21 @@ function I(e) {
22088
22088
  return aa(e);
22089
22089
  }
22090
22090
  function wt(e) {
22091
- return e.type === L.CDATA;
22091
+ return e.type === L$1.CDATA;
22092
22092
  }
22093
22093
  function se(e) {
22094
- return e.type === L.Text;
22094
+ return e.type === L$1.Text;
22095
22095
  }
22096
22096
  function Nt$1(e) {
22097
- return e.type === L.Comment;
22097
+ return e.type === L$1.Comment;
22098
22098
  }
22099
22099
  function Qt$1(e) {
22100
- return e.type === L.Directive;
22100
+ return e.type === L$1.Directive;
22101
22101
  }
22102
22102
  function Te(e) {
22103
- return e.type === L.Root;
22103
+ return e.type === L$1.Root;
22104
22104
  }
22105
- function B(e) {
22105
+ function B$1(e) {
22106
22106
  return Object.prototype.hasOwnProperty.call(e, "children");
22107
22107
  }
22108
22108
  function ze(e, t = false) {
@@ -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.Tag : void 0, a = new pu(t, u, void 0, r);
22170
+ const r = this.options.xmlMode ? L$1.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.Text)
22175
+ if (u && u.type === L$1.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.Comment) {
22183
+ if (this.lastNode && this.lastNode.type === L$1.Comment) {
22184
22184
  this.lastNode.data += t;
22185
22185
  return;
22186
22186
  }
@@ -22462,20 +22462,20 @@ function Ir(e, t) {
22462
22462
  return xt$1(e, t);
22463
22463
  }
22464
22464
  function ya(e, t) {
22465
- return B(e) ? e.children.map((u) => Ir(u, t)).join("") : "";
22465
+ return B$1(e) ? e.children.map((u) => Ir(u, t)).join("") : "";
22466
22466
  }
22467
22467
  function ot(e) {
22468
22468
  return Array.isArray(e) ? e.map(ot).join("") : I(e) ? e.name === "br" ? `
22469
22469
  ` : ot(e.children) : wt(e) ? ot(e.children) : se(e) ? e.data : "";
22470
22470
  }
22471
22471
  function Le(e) {
22472
- return Array.isArray(e) ? e.map(Le).join("") : B(e) && !Nt$1(e) ? Le(e.children) : se(e) ? e.data : "";
22472
+ return Array.isArray(e) ? e.map(Le).join("") : B$1(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.Tag || wt(e)) ? dt(e.children) : se(e) ? e.data : "";
22475
+ return Array.isArray(e) ? e.map(dt).join("") : B$1(e) && (e.type === L$1.Tag || wt(e)) ? dt(e.children) : se(e) ? e.data : "";
22476
22476
  }
22477
22477
  function It$1(e) {
22478
- return B(e) ? e.children : [];
22478
+ return B$1(e) ? e.children : [];
22479
22479
  }
22480
22480
  function Sr(e) {
22481
22481
  return e.parent || null;
@@ -22580,7 +22580,7 @@ function Eu(e, t, u, r) {
22580
22580
  const c = i[0][n[0]++];
22581
22581
  if (e(c) && (a.push(c), --r <= 0))
22582
22582
  return a;
22583
- u && B(c) && c.children.length > 0 && (n.unshift(0), i.unshift(c.children));
22583
+ u && B$1(c) && c.children.length > 0 && (n.unshift(0), i.unshift(c.children));
22584
22584
  }
22585
22585
  }
22586
22586
  function Ua(e, t) {
@@ -22592,7 +22592,7 @@ function Tu(e, t, u = true) {
22592
22592
  const i = r[a];
22593
22593
  if (I(i) && e(i))
22594
22594
  return i;
22595
- if (u && B(i) && i.children.length > 0) {
22595
+ if (u && B$1(i) && i.children.length > 0) {
22596
22596
  const n = Tu(e, i.children, true);
22597
22597
  if (n)
22598
22598
  return n;
@@ -22601,7 +22601,7 @@ function Tu(e, t, u = true) {
22601
22601
  return null;
22602
22602
  }
22603
22603
  function yr(e, t) {
22604
- return (Array.isArray(t) ? t : [t]).some((u) => I(u) && e(u) || B(u) && yr(e, u.children));
22604
+ return (Array.isArray(t) ? t : [t]).some((u) => I(u) && e(u) || B$1(u) && yr(e, u.children));
22605
22605
  }
22606
22606
  function Fa(e, t) {
22607
22607
  const u = [], r = [Array.isArray(t) ? t : [t]], a = [0];
@@ -22613,7 +22613,7 @@ function Fa(e, t) {
22613
22613
  continue;
22614
22614
  }
22615
22615
  const i = r[0][a[0]++];
22616
- I(i) && e(i) && u.push(i), B(i) && i.children.length > 0 && (a.unshift(0), r.unshift(i.children));
22616
+ I(i) && e(i) && u.push(i), B$1(i) && i.children.length > 0 && (a.unshift(0), r.unshift(i.children));
22617
22617
  }
22618
22618
  }
22619
22619
  const ht = {
@@ -22684,10 +22684,10 @@ function Lr(e, t) {
22684
22684
  const u = [], r = [];
22685
22685
  if (e === t)
22686
22686
  return 0;
22687
- let a = B(e) ? e : e.parent;
22687
+ let a = B$1(e) ? e : e.parent;
22688
22688
  for (; a; )
22689
22689
  u.unshift(a), a = a.parent;
22690
- for (a = B(t) ? t : t.parent; a; )
22690
+ for (a = B$1(t) ? t : t.parent; a; )
22691
22691
  r.unshift(a), a = a.parent;
22692
22692
  const i = Math.min(u.length, r.length);
22693
22693
  let n = 0;
@@ -22811,7 +22811,7 @@ const St$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty
22811
22811
  getSiblings: Cr,
22812
22812
  getText: ot,
22813
22813
  hasAttrib: La,
22814
- hasChildren: B,
22814
+ hasChildren: B$1,
22815
22815
  innerText: dt,
22816
22816
  isCDATA: wt,
22817
22817
  isComment: Nt$1,
@@ -24379,7 +24379,7 @@ function Hr(e, t, u) {
24379
24379
  throw new Error("Expected `=`");
24380
24380
  i(2);
24381
24381
  } else t.charCodeAt(u) === 61 && (S = H.Equals, i(1));
24382
- let M2 = "", ee = null;
24382
+ let M = "", ee = null;
24383
24383
  if (S !== "exists") {
24384
24384
  if (Ht$1(t.charCodeAt(u))) {
24385
24385
  const ge = t.charCodeAt(u);
@@ -24388,12 +24388,12 @@ function Hr(e, t, u) {
24388
24388
  ie += 1;
24389
24389
  if (t.charCodeAt(ie) !== ge)
24390
24390
  throw new Error("Attribute value didn't end");
24391
- M2 = Be(t.slice(u + 1, ie)), u = ie + 1;
24391
+ M = Be(t.slice(u + 1, ie)), u = ie + 1;
24392
24392
  } else {
24393
24393
  const ge = u;
24394
24394
  for (; u < t.length && (!zu(t.charCodeAt(u)) && t.charCodeAt(u) !== 93 || c(u)); )
24395
24395
  u += 1;
24396
- M2 = Be(t.slice(ge, u));
24396
+ M = Be(t.slice(ge, u));
24397
24397
  }
24398
24398
  i(0);
24399
24399
  const ae = t.charCodeAt(u) | 32;
@@ -24406,7 +24406,7 @@ function Hr(e, t, u) {
24406
24406
  type: N$1.Attribute,
24407
24407
  name: w,
24408
24408
  action: S,
24409
- value: M2,
24409
+ value: M,
24410
24410
  namespace: v,
24411
24411
  ignoreCase: ee
24412
24412
  };
@@ -25356,7 +25356,7 @@ function Nu(e) {
25356
25356
  };
25357
25357
  };
25358
25358
  }
25359
- const et$1 = Nu((e, t) => {
25359
+ const et = Nu((e, t) => {
25360
25360
  let u = [];
25361
25361
  for (let r = 0; r < t.length; r++) {
25362
25362
  const a = e(t[r]);
@@ -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$1((e) => {
25392
+ const Nn = xu(({ parent: e }) => e && !Te(e) ? e : null, Pe), xn = et((e) => {
25393
25393
  const t = [];
25394
25394
  for (; e.parent && !Te(e.parent); )
25395
25395
  t.push(e.parent), e = e.parent;
@@ -25414,19 +25414,19 @@ function Sn(e) {
25414
25414
  }
25415
25415
  }), this._make(u);
25416
25416
  }
25417
- const Cn = xu((e) => fu(e)), yn = et$1((e) => {
25417
+ const Cn = xu((e) => fu(e)), yn = et((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$1((e) => {
25422
+ }, Pe), On = Iu((e) => fu(e), Pe), Ln = xu((e) => bu(e)), Rn = et((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$1((e) => Cr(e).filter((t) => I(t) && t !== e), ke), Pn = et$1((e) => It$1(e).filter(I), Pe);
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);
25428
25428
  function Mn() {
25429
- const e = this.toArray().reduce((t, u) => B(u) ? t.concat(u.children) : t, []);
25429
+ const e = this.toArray().reduce((t, u) => B$1(u) ? t.concat(u.children) : t, []);
25430
25430
  return this._make(e);
25431
25431
  }
25432
25432
  function Bn(e) {
@@ -25595,7 +25595,7 @@ function ts(e) {
25595
25595
  return function(...t) {
25596
25596
  const u = this.length - 1;
25597
25597
  return P(this, (r, a) => {
25598
- if (!B(r))
25598
+ if (!B$1(r))
25599
25599
  return;
25600
25600
  const i = typeof t[0] == "function" ? t[0].call(r, a, this._render(r.children)) : t, n = this._makeDomArray(i, a < u);
25601
25601
  e(n, r.children, r);
@@ -25635,7 +25635,7 @@ function us(e) {
25635
25635
  const u = this.length - 1, r = this.parents().last();
25636
25636
  for (let a = 0; a < this.length; a++) {
25637
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
- if (!c || !B(c))
25638
+ if (!c || !B$1(c))
25639
25639
  continue;
25640
25640
  let h = c, m = 0;
25641
25641
  for (; m < h.children.length; ) {
@@ -25654,7 +25654,7 @@ const io = us((e, t, u) => {
25654
25654
  const a = r.children, i = a.indexOf(e);
25655
25655
  xe([e], t), _e(a, i, 0, u, r);
25656
25656
  }), no = us((e, t, u) => {
25657
- B(e) && (xe(e.children, t), xe(u, e));
25657
+ B$1(e) && (xe(e.children, t), xe(u, e));
25658
25658
  });
25659
25659
  function oo(e) {
25660
25660
  return this.parent(e).not("body").each((t, u) => {
@@ -25680,7 +25680,7 @@ function co(e) {
25680
25680
  function ho(...e) {
25681
25681
  const t = this.length - 1;
25682
25682
  return P(this, (u, r) => {
25683
- if (!B(u) || !u.parent)
25683
+ if (!B$1(u) || !u.parent)
25684
25684
  return;
25685
25685
  const a = u.parent.children, i = a.indexOf(u);
25686
25686
  if (i === -1)
@@ -25704,7 +25704,7 @@ function lo(e) {
25704
25704
  function mo(...e) {
25705
25705
  const t = this.length - 1;
25706
25706
  return P(this, (u, r) => {
25707
- if (!B(u) || !u.parent)
25707
+ if (!B$1(u) || !u.parent)
25708
25708
  return;
25709
25709
  const a = u.parent.children, i = a.indexOf(u);
25710
25710
  if (i === -1)
@@ -25744,7 +25744,7 @@ function bo(e) {
25744
25744
  }
25745
25745
  function Eo() {
25746
25746
  return P(this, (e) => {
25747
- if (B(e)) {
25747
+ if (B$1(e)) {
25748
25748
  for (const t of e.children)
25749
25749
  t.next = t.prev = t.parent = null;
25750
25750
  e.children.length = 0;
@@ -25754,10 +25754,10 @@ function Eo() {
25754
25754
  function To(e) {
25755
25755
  if (e === void 0) {
25756
25756
  const t = this[0];
25757
- return !t || !B(t) ? null : this._render(t.children);
25757
+ return !t || !B$1(t) ? null : this._render(t.children);
25758
25758
  }
25759
25759
  return P(this, (t) => {
25760
- if (!B(t))
25760
+ if (!B$1(t))
25761
25761
  return;
25762
25762
  for (const r of t.children)
25763
25763
  r.next = r.prev = r.parent = null;
@@ -25770,7 +25770,7 @@ function _o() {
25770
25770
  }
25771
25771
  function go(e) {
25772
25772
  return e === void 0 ? Qe(this) : typeof e == "function" ? P(this, (t, u) => this._make(t).text(e.call(t, u, Qe([t])))) : P(this, (t) => {
25773
- if (!B(t))
25773
+ if (!B$1(t))
25774
25774
  return;
25775
25775
  for (const r of t.children)
25776
25776
  r.next = r.prev = r.parent = null;
@@ -25962,7 +25962,7 @@ function ko(e, t) {
25962
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$1(f) ? (
25965
+ const M = typeof f == "string" && Xt$1(f) ? (
25966
25966
  // $(<html>)
25967
25967
  e(f, v, false, null).children
25968
25968
  ) : Po(f) ? (
@@ -25971,8 +25971,8 @@ function ko(e, t) {
25971
25971
  ) : Array.isArray(f) ? (
25972
25972
  // $([dom])
25973
25973
  f
25974
- ) : void 0, ee = new h(M2, U2, v);
25975
- if (M2)
25974
+ ) : void 0, ee = new h(M, U2, v);
25975
+ if (M)
25976
25976
  return ee;
25977
25977
  if (typeof f != "string")
25978
25978
  throw new TypeError("Unexpected type of selector");
@@ -26166,10 +26166,10 @@ class Ho {
26166
26166
  this.isEol = false;
26167
26167
  }
26168
26168
  }
26169
- var O$1;
26169
+ var O;
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$1 || (O$1 = {}));
26172
+ })(O || (O = {}));
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)
@@ -26817,7 +26817,7 @@ class rc {
26817
26817
  //Token creation
26818
26818
  _createStartTagToken() {
26819
26819
  this.currentToken = {
26820
- type: O$1.START_TAG,
26820
+ type: O.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$1.END_TAG,
26831
+ type: O.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$1.COMMENT,
26842
+ type: O.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$1.DOCTYPE,
26849
+ type: O.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$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();
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();
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$1.CHARACTER: {
26902
+ case O.CHARACTER: {
26903
26903
  this.handler.onCharacter(this.currentCharacterToken);
26904
26904
  break;
26905
26905
  }
26906
- case O$1.NULL_CHARACTER: {
26906
+ case O.NULL_CHARACTER: {
26907
26907
  this.handler.onNullCharacter(this.currentCharacterToken);
26908
26908
  break;
26909
26909
  }
26910
- case O$1.WHITESPACE_CHARACTER: {
26910
+ case O.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$1.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.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$1.WHITESPACE_CHARACTER : t === o.NULL ? O$1.NULL_CHARACTER : O$1.CHARACTER;
26941
+ const u = cs(t) ? O.WHITESPACE_CHARACTER : t === o.NULL ? O.NULL_CHARACTER : O.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$1.CHARACTER, t);
26947
+ this._appendCharToCurrentCharacterToken(O.CHARACTER, t);
26948
26948
  }
26949
26949
  // Character reference helpers
26950
26950
  _startCharacterReference() {
@@ -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$1.END_TAG && a === u.tagName ? {
29609
+ u.type === O.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$1.CHARACTER: {
29638
+ case O.CHARACTER: {
29639
29639
  this.onCharacter(t);
29640
29640
  break;
29641
29641
  }
29642
- case O$1.NULL_CHARACTER: {
29642
+ case O.NULL_CHARACTER: {
29643
29643
  this.onNullCharacter(t);
29644
29644
  break;
29645
29645
  }
29646
- case O$1.COMMENT: {
29646
+ case O.COMMENT: {
29647
29647
  this.onComment(t);
29648
29648
  break;
29649
29649
  }
29650
- case O$1.DOCTYPE: {
29650
+ case O.DOCTYPE: {
29651
29651
  this.onDoctype(t);
29652
29652
  break;
29653
29653
  }
29654
- case O$1.START_TAG: {
29654
+ case O.START_TAG: {
29655
29655
  this._processStartTag(t);
29656
29656
  break;
29657
29657
  }
29658
- case O$1.END_TAG: {
29658
+ case O.END_TAG: {
29659
29659
  this.onEndTag(t);
29660
29660
  break;
29661
29661
  }
29662
- case O$1.EOF: {
29662
+ case O.EOF: {
29663
29663
  this.onEof(t);
29664
29664
  break;
29665
29665
  }
29666
- case O$1.WHITESPACE_CHARACTER: {
29666
+ case O.WHITESPACE_CHARACTER: {
29667
29667
  this.onWhitespaceCharacter(t);
29668
29668
  break;
29669
29669
  }
@@ -30045,7 +30045,7 @@ class Es {
30045
30045
  break;
30046
30046
  }
30047
30047
  case l.IN_BODY: {
30048
- G(this, t);
30048
+ G$1(this, t);
30049
30049
  break;
30050
30050
  }
30051
30051
  case l.IN_TABLE: {
@@ -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(e, t);
30415
+ G$1(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(e, t);
30436
+ G$1(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(e, t);
30505
+ G$1(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$1.EOF ? b.openElementsLeftAfterEof : b.disallowedContentInNoscriptInHead;
30541
+ const u = t.type === O.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(e, t);
30547
+ G$1(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$1.CHARACTER: {
30600
+ case O.CHARACTER: {
30601
30601
  _s(e, t);
30602
30602
  break;
30603
30603
  }
30604
- case O$1.WHITESPACE_CHARACTER: {
30604
+ case O.WHITESPACE_CHARACTER: {
30605
30605
  Ts(e, t);
30606
30606
  break;
30607
30607
  }
30608
- case O$1.COMMENT: {
30608
+ case O.COMMENT: {
30609
30609
  iu(e, t);
30610
30610
  break;
30611
30611
  }
30612
- case O$1.START_TAG: {
30613
- G(e, t);
30612
+ case O.START_TAG: {
30613
+ G$1(e, t);
30614
30614
  break;
30615
30615
  }
30616
- case O$1.END_TAG: {
30616
+ case O.END_TAG: {
30617
30617
  Lt$1(e, t);
30618
30618
  break;
30619
30619
  }
30620
- case O$1.EOF: {
30620
+ case O.EOF: {
30621
30621
  ws(e, t);
30622
30622
  break;
30623
30623
  }
@@ -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(e, t) {
30744
+ function G$1(e, t) {
30745
30745
  switch (t.tagID) {
30746
30746
  case s.I:
30747
30747
  case s.S:
@@ -31114,11 +31114,11 @@ function B0(e, t) {
31114
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$1.CHARACTER: {
31117
+ case O.CHARACTER: {
31118
31118
  xs(e, t);
31119
31119
  break;
31120
31120
  }
31121
- case O$1.WHITESPACE_CHARACTER: {
31121
+ case O.WHITESPACE_CHARACTER: {
31122
31122
  Ns(e, t);
31123
31123
  break;
31124
31124
  }
@@ -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(e, t);
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$1(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(e, t);
31278
+ G$1(e, t);
31279
31279
  break;
31280
31280
  }
31281
31281
  case s.COL: {
@@ -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(e, t);
31413
+ Is.has(u) ? (e.openElements.hasInTableScope(s.TD) || e.openElements.hasInTableScope(s.TH)) && (e._closeTableCell(), Dt(e, t)) : G$1(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(e, t);
31444
+ G$1(e, t);
31445
31445
  break;
31446
31446
  }
31447
31447
  case s.OPTION: {
@@ -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(e, t);
31540
+ e.tmplInsertionModeStack[0] = l.IN_BODY, e.insertionMode = l.IN_BODY, G$1(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(e, t) : gt(e, t);
31550
+ t.tagID === s.HTML ? G$1(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(e, t);
31569
+ G$1(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(e, t);
31592
+ G$1(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(e, t) : ct(e, t);
31605
+ t.tagID === s.HTML ? G$1(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(e, t);
31613
+ G$1(e, t);
31614
31614
  break;
31615
31615
  }
31616
31616
  case s.NOFRAMES: {
@@ -32506,7 +32506,7 @@ const Ld = (e) => {
32506
32506
  });
32507
32507
  }
32508
32508
  }
32509
- const M2 = [];
32509
+ const M = [];
32510
32510
  for (const y of Object.keys(e))
32511
32511
  [
32512
32512
  "title",
@@ -32517,9 +32517,9 @@ const Ld = (e) => {
32517
32517
  "type",
32518
32518
  "locale",
32519
32519
  "favicon"
32520
- ].includes(y) || a[y] === void 0 && M2.push(y);
32520
+ ].includes(y) || a[y] === void 0 && M.push(y);
32521
32521
  let ee = 1e3;
32522
- for (const y of M2) {
32522
+ for (const y of M) {
32523
32523
  const W2 = e[y];
32524
32524
  let Ce = "";
32525
32525
  if (Array.isArray(W2)) {
@@ -32563,14 +32563,14 @@ const Ld = (e) => {
32563
32563
  };
32564
32564
  /*!
32565
32565
  * name: mark-deco
32566
- * version: 0.13.0
32566
+ * version: 0.14.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: a57a326430fda951da873116177f76aa783d4413
32571
+ * git.commit.hash: 090ae78518ae17207fdb90e6fca59893315672fb
32572
32572
  */
32573
- function Q(e) {
32573
+ function G(e) {
32574
32574
  const t = /^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/, n = e.match(t);
32575
32575
  if (!n)
32576
32576
  return {
@@ -32597,7 +32597,7 @@ function kt(e) {
32597
32597
  `) ? t : `${t}
32598
32598
  `;
32599
32599
  }
32600
- function V(e, t) {
32600
+ function Q(e, t) {
32601
32601
  const n = t ?? "";
32602
32602
  return `${`---
32603
32603
  ${kt(e)}---
@@ -32614,7 +32614,7 @@ const _ = () => {
32614
32614
  info: console.info,
32615
32615
  warn: console.warn,
32616
32616
  error: console.error
32617
- }, xt = () => St, Qt = () => $t, O = (e) => {
32617
+ }, xt = () => St, Qt = () => $t, N = (e) => {
32618
32618
  const t = {}, n = e.slice(1, -1).trim(), a = n.match(/\.([a-zA-Z0-9_-]+)/g);
32619
32619
  if (a) {
32620
32620
  const d2 = a.map((p2) => p2.slice(1));
@@ -32629,10 +32629,10 @@ const _ = () => {
32629
32629
  p2 && u && p2 !== "class" && p2 !== "id" && (t[p2] = u.replace(/["']/g, ""));
32630
32630
  }
32631
32631
  return t;
32632
- }, Ht = (e) => {
32632
+ }, Tt = (e) => {
32633
32633
  const t = e.lang ? ` class="language-${e.lang}"` : "", n = e.value.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
32634
32634
  return `<pre><code${t}>${n}</code></pre>`;
32635
- }, N = (e, t) => {
32635
+ }, L = (e, t) => {
32636
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;
@@ -32640,15 +32640,15 @@ const _ = () => {
32640
32640
  } else
32641
32641
  e.data.hProperties[n] = a;
32642
32642
  });
32643
- }, Tt = () => (e) => {
32643
+ }, Ht = () => (e) => {
32644
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 d2 = s2[1].trim(), p2 = s2[2], u = O(p2);
32651
- r.value = d2, N(t, u);
32650
+ const d2 = s2[1].trim(), p2 = s2[2], u = N(p2);
32651
+ r.value = d2, L(t, u);
32652
32652
  }
32653
32653
  }
32654
32654
  }
@@ -32657,8 +32657,8 @@ const _ = () => {
32657
32657
  if (r?.type === "text" && r.value) {
32658
32658
  const s2 = r.value.match(/^(.*?)\s*(\{[^}]+\})\s*$/);
32659
32659
  if (s2) {
32660
- const d2 = s2[1].trim(), p2 = s2[2], u = O(p2);
32661
- r.value = d2, N(t, u);
32660
+ const d2 = s2[1].trim(), p2 = s2[2], u = N(p2);
32661
+ r.value = d2, L(t, u);
32662
32662
  }
32663
32663
  }
32664
32664
  }
@@ -32667,8 +32667,8 @@ const _ = () => {
32667
32667
  if (r?.type === "text" && r.value) {
32668
32668
  const s2 = r.value.match(/^\s*(\{[^}]+\})/);
32669
32669
  if (s2) {
32670
- const d2 = s2[1], p2 = O(d2);
32671
- N(t, p2), r.value = r.value.replace(s2[0], "");
32670
+ const d2 = s2[1], p2 = N(d2);
32671
+ L(t, p2), r.value = r.value.replace(s2[0], "");
32672
32672
  }
32673
32673
  }
32674
32674
  }
@@ -32677,8 +32677,8 @@ const _ = () => {
32677
32677
  if (r?.type === "text" && r.value) {
32678
32678
  const s2 = r.value.match(/^\s*(\{[^}]+\})/);
32679
32679
  if (s2) {
32680
- const d2 = s2[1], p2 = O(d2);
32681
- N(t, p2), r.value = r.value.replace(s2[0], "");
32680
+ const d2 = s2[1], p2 = N(d2);
32681
+ L(t, p2), r.value = r.value.replace(s2[0], "");
32682
32682
  }
32683
32683
  }
32684
32684
  }
@@ -32689,8 +32689,8 @@ const _ = () => {
32689
32689
  if (s2?.type === "text" && s2.value) {
32690
32690
  const d2 = s2.value.match(/^(.*?)\s*(\{[^}]+\})\s*$/);
32691
32691
  if (d2) {
32692
- const p2 = d2[1].trim(), u = d2[2], i = O(u);
32693
- s2.value = p2, N(t, i);
32692
+ const p2 = d2[1].trim(), u = d2[2], i = N(u);
32693
+ s2.value = p2, L(t, i);
32694
32694
  }
32695
32695
  }
32696
32696
  }
@@ -32702,8 +32702,8 @@ const _ = () => {
32702
32702
  if (s2?.type === "text" && s2.value) {
32703
32703
  const d2 = s2.value.match(/^\s*(\{[^}]+\})\s*$/);
32704
32704
  if (d2) {
32705
- const p2 = d2[1], u = O(p2);
32706
- N(t, u), a.children.splice(n + 1, 1);
32705
+ const p2 = d2[1], u = N(p2);
32706
+ L(t, u), a.children.splice(n + 1, 1);
32707
32707
  }
32708
32708
  }
32709
32709
  }
@@ -32715,8 +32715,8 @@ const _ = () => {
32715
32715
  if (s2?.type === "text" && s2.value) {
32716
32716
  const d2 = s2.value.match(/^(.*?)\s*(\{[^}]+\})\s*$/);
32717
32717
  if (d2) {
32718
- const p2 = d2[1].trim(), u = d2[2], i = O(u);
32719
- s2.value = p2, N(t, i);
32718
+ const p2 = d2[1].trim(), u = d2[2], i = N(u);
32719
+ s2.value = p2, L(t, i);
32720
32720
  }
32721
32721
  }
32722
32722
  }
@@ -32728,8 +32728,8 @@ const _ = () => {
32728
32728
  if (s2?.type === "text" && s2.value) {
32729
32729
  const d2 = s2.value.match(/^\s*(\{[^}]+\})\s*$/);
32730
32730
  if (d2) {
32731
- const p2 = d2[1], u = O(p2);
32732
- N(t, u), a.children.splice(n + 1, 1);
32731
+ const p2 = d2[1], u = N(p2);
32732
+ L(t, u), a.children.splice(n + 1, 1);
32733
32733
  }
32734
32734
  }
32735
32735
  }
@@ -32739,19 +32739,19 @@ const _ = () => {
32739
32739
  if (r?.type === "text" && r.value) {
32740
32740
  const s2 = r.value.match(/^\s*(\{[^}]+\})/);
32741
32741
  if (s2) {
32742
- const d2 = s2[1], p2 = O(d2);
32743
- N(t, p2), r.value = r.value.replace(s2[0], "");
32742
+ const d2 = s2[1], p2 = N(d2);
32743
+ L(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]}}`, d2 = O(s2), p2 = {
32750
+ const s2 = `{${r[1]}}`, d2 = N(s2), p2 = {
32751
32751
  type: "html",
32752
32752
  value: `<div class="${d2.class || ""}" ${Object.entries(
32753
32753
  d2
32754
- ).filter(([u]) => u !== "class").map(([u, i]) => `${u}="${i}"`).join(" ")}>${Ht(t)}</div>`
32754
+ ).filter(([u]) => u !== "class").map(([u, i]) => `${u}="${i}"`).join(" ")}>${Tt(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
  }
@@ -32781,14 +32781,14 @@ const _ = () => {
32781
32781
  for (; u < p2.children.length; u++) {
32782
32782
  const i = p2.children[u];
32783
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();
32784
+ const h = i, l2 = p2.children[u + 1], o2 = l2 && l2.position ? l2.position.start?.offset : void 0, f = U(h).trim();
32785
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,
32786
+ let c = false;
32787
+ !n && r && f.length > 0 && (t.title = f, c = true), s2 && s2({
32788
+ headingText: f,
32789
+ position: h.position,
32790
32790
  nextNodeStartOffset: o2,
32791
- titleWritten: f,
32791
+ titleWritten: c,
32792
32792
  headingRemoved: d2
32793
32793
  });
32794
32794
  break;
@@ -32797,7 +32797,7 @@ const _ = () => {
32797
32797
  break;
32798
32798
  }
32799
32799
  };
32800
- }, Z = (e, t, n) => {
32800
+ }, V = (e, t, n) => {
32801
32801
  const { transform: a, allowTitleWrite: r } = n;
32802
32802
  if (a === "none")
32803
32803
  return {
@@ -32807,7 +32807,7 @@ const _ = () => {
32807
32807
  };
32808
32808
  const s2 = t != null && Object.prototype.hasOwnProperty.call(t, "title") && t.title !== void 0 && t.title !== null;
32809
32809
  let d2 = false, p2 = false, u, i;
32810
- const l2 = unified().use(remarkParse).use(Ft, {
32810
+ const h = unified().use(remarkParse).use(Ft, {
32811
32811
  frontmatter: t,
32812
32812
  hasTitle: s2,
32813
32813
  transform: a,
@@ -32815,12 +32815,12 @@ const _ = () => {
32815
32815
  onHeadingApplied: (o2) => {
32816
32816
  if (d2 = o2.headingRemoved, p2 = o2.titleWritten, !o2.headingRemoved)
32817
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;
32818
+ const f = o2.position?.start?.offset ?? 0;
32819
+ let c = o2.position?.end?.offset ?? f;
32820
+ typeof o2.nextNodeStartOffset == "number" && o2.nextNodeStartOffset >= c ? c = o2.nextNodeStartOffset : c = e.length, u = f, i = c;
32821
32821
  }
32822
- }), c = l2.parse(e);
32823
- return l2.runSync(c), d2 && u !== void 0 && i !== void 0 ? {
32822
+ }), l2 = h.parse(e);
32823
+ return h.runSync(l2), d2 && u !== void 0 && i !== void 0 ? {
32824
32824
  content: e.slice(0, u) + e.slice(i),
32825
32825
  headingRemoved: true,
32826
32826
  titleWritten: p2
@@ -32841,19 +32841,19 @@ const _ = () => {
32841
32841
  unformatted: ["code", "pre", "textarea"],
32842
32842
  content_unformatted: ["pre", "code", "textarea"],
32843
32843
  extra_liners: []
32844
- }, W = (e) => {
32844
+ }, z = (e) => {
32845
32845
  if (e instanceof Date)
32846
32846
  return e.toISOString();
32847
32847
  if (Array.isArray(e))
32848
- return e.map(W);
32848
+ return e.map(z);
32849
32849
  if (e && typeof e == "object") {
32850
32850
  const t = Object.entries(e).filter(([, a]) => a !== void 0).sort(([a], [r]) => a < r ? -1 : a > r ? 1 : 0), n = {};
32851
32851
  for (const [a, r] of t)
32852
- n[a] = W(r);
32852
+ n[a] = z(r);
32853
32853
  return n;
32854
32854
  }
32855
32855
  return e;
32856
- }, M = (e) => JSON.stringify(W(e ?? {})), It = (e, t) => `${e}-${t.join("-")}`, Nt = (e) => {
32856
+ }, q = (e) => JSON.stringify(z(e ?? {})), It = (e, t) => `${e}-${t.join("-")}`, Nt = (e) => {
32857
32857
  const t = [], n = [];
32858
32858
  for (const a of e) {
32859
32859
  const r = a.level;
@@ -32871,7 +32871,7 @@ const _ = () => {
32871
32871
  });
32872
32872
  }
32873
32873
  return t;
32874
- }, X = (e, t, n) => {
32874
+ }, Z = (e, t, n) => {
32875
32875
  const a = jd(t);
32876
32876
  return a !== void 0 ? `${e}-${a}` : n();
32877
32877
  }, Lt = (e) => {
@@ -32908,209 +32908,213 @@ const _ = () => {
32908
32908
  );
32909
32909
  r.set(o2.name, o2);
32910
32910
  }
32911
- const s2 = async (o2, h, f) => {
32911
+ const s2 = async (o2, f, c) => {
32912
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) => {
32913
+ return m ? await m.processBlock(f, c) : `<pre><code class="language-${o2}">${R(f)}</code></pre>`;
32914
+ }, d2 = (o2, f, c) => {
32915
32915
  const m = {
32916
32916
  logger: n,
32917
- signal: h,
32917
+ signal: f,
32918
32918
  frontmatter: o2,
32919
- getUniqueId: f,
32919
+ getUniqueId: c,
32920
32920
  fetcher: a
32921
32921
  };
32922
32922
  return () => async (y) => {
32923
- const g2 = [];
32923
+ const w = [];
32924
32924
  visit(
32925
32925
  y,
32926
32926
  "code",
32927
- (w, v, $2) => {
32928
- if (!w.lang || !r.has(w.lang))
32927
+ (g2, v, b2) => {
32928
+ if (!g2.lang || !r.has(g2.lang))
32929
32929
  return;
32930
- const S = (async () => {
32930
+ const k2 = (async () => {
32931
32931
  const E2 = {
32932
32932
  type: "html",
32933
32933
  value: await s2(
32934
- w.lang,
32935
- w.value,
32934
+ g2.lang,
32935
+ g2.value,
32936
32936
  m
32937
32937
  )
32938
32938
  };
32939
- $2 && typeof v == "number" && ($2.children[v] = E2);
32939
+ b2 && typeof v == "number" && (b2.children[v] = E2);
32940
32940
  })();
32941
- g2.push(S);
32941
+ w.push(k2);
32942
32942
  }
32943
- ), await Promise.all(g2);
32943
+ ), await Promise.all(w);
32944
32944
  };
32945
- }, p2 = (o2, h, f = false, m = false, y = "") => () => (g2) => {
32946
- const w = [], v = [];
32947
- visit(g2, "heading", (E2) => {
32945
+ }, p2 = (o2, f, c = false, m = false, y = "") => () => (w) => {
32946
+ const g2 = [], v = [];
32947
+ visit(w, "heading", (E2) => {
32948
32948
  E2.depth >= 1 && E2.depth <= 6 && v.push(E2);
32949
32949
  });
32950
- let $2 = [];
32951
- if (f) {
32950
+ let b2 = [];
32951
+ if (c) {
32952
32952
  const E2 = v.map((R2) => ({
32953
32953
  level: R2.depth,
32954
32954
  text: U(R2)
32955
32955
  }));
32956
- $2 = Nt(E2);
32956
+ b2 = Nt(E2);
32957
32957
  }
32958
- const S = [];
32958
+ const k2 = [];
32959
32959
  v.forEach((E2, R2) => {
32960
- const C2 = U(E2), F2 = E2.data?.hProperties?.id;
32961
- let k2;
32962
- if (F2)
32963
- k2 = F2;
32964
- else if (f && m) {
32965
- const I2 = X(
32960
+ const S = U(E2), C2 = E2.data?.hProperties?.id;
32961
+ let F2;
32962
+ if (C2)
32963
+ F2 = C2;
32964
+ else if (c && m) {
32965
+ const I2 = Z(
32966
32966
  y,
32967
- C2,
32968
- () => h(C2)
32967
+ S,
32968
+ () => f(S)
32969
32969
  ).replace(`${y}-`, "");
32970
- for (; S.length > 0; ) {
32971
- const b2 = S[S.length - 1];
32972
- if (b2 && b2.level >= E2.depth)
32973
- S.pop();
32970
+ for (; k2.length > 0; ) {
32971
+ const O2 = k2[k2.length - 1];
32972
+ if (O2 && O2.level >= E2.depth)
32973
+ k2.pop();
32974
32974
  else
32975
32975
  break;
32976
32976
  }
32977
- const L2 = S.map((b2) => b2.contentId);
32978
- k2 = L2.length > 0 ? `${y}-${L2.join("-")}-${I2}` : `${y}-${I2}`, S.push({
32977
+ const $2 = k2.map((O2) => O2.contentId);
32978
+ F2 = $2.length > 0 ? `${y}-${$2.join("-")}-${I2}` : `${y}-${I2}`, k2.push({
32979
32979
  level: E2.depth,
32980
32980
  contentId: I2
32981
32981
  });
32982
- } else if (f && R2 < $2.length) {
32983
- const I2 = $2[R2];
32984
- I2 ? k2 = It(
32982
+ } else if (c && R2 < b2.length) {
32983
+ const I2 = b2[R2];
32984
+ I2 ? F2 = It(
32985
32985
  y,
32986
32986
  I2.numbers
32987
- ) : k2 = h(C2);
32987
+ ) : F2 = f(S);
32988
32988
  } else
32989
- k2 = h(C2);
32990
- E2.data || (E2.data = {}), E2.data.hProperties || (E2.data.hProperties = {}), F2 || (E2.data.hProperties.id = k2), w.push({
32989
+ F2 = f(S);
32990
+ E2.data || (E2.data = {}), E2.data.hProperties || (E2.data.hProperties = {}), C2 || (E2.data.hProperties.id = F2), g2.push({
32991
32991
  level: E2.depth,
32992
- text: C2,
32993
- id: k2
32992
+ text: S,
32993
+ id: F2
32994
32994
  });
32995
32995
  });
32996
- const x2 = Lt(w);
32997
- o2.push(...x2);
32996
+ const H2 = Lt(g2);
32997
+ o2.push(...H2);
32998
32998
  }, u = (o2) => {
32999
32999
  throw n.error(
33000
33000
  `Failed to process markdown: ${o2 instanceof Error ? o2.message : "Unknown error"}`
33001
33001
  ), new Error(
33002
33002
  `Failed to process markdown: ${o2 instanceof Error ? o2.message : "Unknown error"}`
33003
33003
  );
33004
- }, i = async (o2, h, f, m, y, g2) => {
33004
+ }, i = async (o2, f, c, m, y, w) => {
33005
33005
  const {
33006
- signal: w,
33006
+ signal: g2,
33007
33007
  useContentStringHeaderId: v = false,
33008
- useHierarchicalHeadingId: $2 = true,
33009
- advancedOptions: S
33010
- } = f ?? {}, {
33011
- allowDangerousHtml: x2 = true,
33008
+ useHierarchicalHeadingId: b2 = true,
33009
+ advancedOptions: k2
33010
+ } = c ?? {}, {
33011
+ allowDangerousHtml: H2 = true,
33012
33012
  htmlOptions: E2 = Rt,
33013
33013
  gfmOptions: R2 = {},
33014
- remarkPlugins: C2 = [],
33015
- rehypePlugins: F2 = []
33016
- } = S || {}, k2 = [];
33014
+ remarkPlugins: S = [],
33015
+ rehypePlugins: C2 = []
33016
+ } = k2 || {}, F2 = [];
33017
33017
  let I2 = 0;
33018
- const L2 = () => `${h}-${++I2}`;
33019
- let T = unified().use(remarkParse);
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(
33018
+ const $2 = () => `${f}-${++I2}`;
33019
+ let x2 = unified().use(remarkParse);
33020
+ if (S)
33021
+ for (const T of S)
33022
+ Array.isArray(T) ? x2 = x2.use(T[0], T[1]) : x2 = x2.use(T);
33023
+ let O2 = x2.use(remarkGfm, R2).use(Ht).use(
33024
33024
  p2(
33025
- k2,
33026
- v ? (H2) => X(h, H2, L2) : L2,
33027
- $2,
33025
+ F2,
33026
+ v ? (T) => Z(f, T, $2) : $2,
33027
+ b2,
33028
33028
  v,
33029
- h
33029
+ f
33030
33030
  )
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);
33031
+ ).use(d2(m, g2, $2)).use(remarkRehype, { allowDangerousHtml: H2 }).use(Ct).use(rehypeStringify, { allowDangerousHtml: H2 });
33032
+ if (C2)
33033
+ for (const T of C2)
33034
+ Array.isArray(T) ? O2 = O2.use(T[0], T[1]) : O2 = O2.use(T);
33035
+ const P2 = await O2.process(y), M = String(P2);
33036
33036
  return {
33037
- html: Ot(P2, E2),
33037
+ html: Ot(M, E2),
33038
33038
  frontmatter: m,
33039
- changed: g2,
33040
- headingTree: k2,
33041
- composeMarkdown: () => g2 ? V(m, y) : o2,
33042
- uniqueIdPrefix: h
33039
+ changed: w,
33040
+ headingTree: F2,
33041
+ composeMarkdown: () => w ? Q(m, y) : o2,
33042
+ uniqueIdPrefix: f
33043
33043
  };
33044
33044
  };
33045
33045
  return {
33046
- process: async (o2, h, f = {}) => {
33046
+ process: async (o2, f, c = {}) => {
33047
33047
  try {
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, {
33048
+ const { data: m, content: y } = G(o2), w = c.h1TitleTransform ?? "extractAndRemove";
33049
+ let g2 = y, v = false, b2 = false;
33050
+ if (w !== "none") {
33051
+ const H2 = V(g2, m, {
33052
33052
  allowTitleWrite: true,
33053
- transform: g2
33053
+ transform: w
33054
33054
  });
33055
- w = x2.content, v = x2.headingRemoved, $2 = x2.titleWritten;
33055
+ g2 = H2.content, v = H2.headingRemoved, b2 = H2.titleWritten;
33056
33056
  }
33057
33057
  return await i(
33058
33058
  o2,
33059
- h,
33060
33059
  f,
33060
+ c,
33061
33061
  m,
33062
- w,
33063
- v || $2
33062
+ g2,
33063
+ v || b2
33064
33064
  );
33065
33065
  } catch (m) {
33066
33066
  return u(m);
33067
33067
  }
33068
33068
  },
33069
- processWithFrontmatterTransform: async (o2, h, f, m, y = {}) => {
33069
+ processWithFrontmatterTransform: async (o2, f, c) => {
33070
33070
  try {
33071
- const { data: g2, content: w } = Q(o2), v = M(g2), S = await f({
33072
- originalFrontmatter: g2,
33073
- markdownContent: w,
33074
- uniqueIdPrefix: h
33075
- });
33076
- if (S === void 0)
33071
+ const { data: m, content: y } = G(o2), w = q(m), g2 = {
33072
+ originalFrontmatter: m,
33073
+ markdownContent: y,
33074
+ uniqueIdPrefix: f
33075
+ }, v = await c.preTransform(g2);
33076
+ if (v === void 0)
33077
33077
  return;
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, {
33078
+ const {
33079
+ frontmatter: b2,
33080
+ uniqueIdPrefix: k2,
33081
+ h1TitleTransform: H2
33082
+ } = v, E2 = k2 ?? f, R2 = H2 ?? "extractAndRemove";
33083
+ let S = y, C2 = false;
33084
+ if (R2 !== "none") {
33085
+ const A = V(S, b2, {
33082
33086
  allowTitleWrite: true,
33083
- transform: C2
33087
+ transform: R2
33084
33088
  });
33085
- F2 = A.content, k2 = A.headingRemoved || k2;
33089
+ S = A.content, C2 = A.headingRemoved || C2;
33086
33090
  }
33087
- const L2 = M(x2) !== v || k2, T = await i(
33091
+ const I2 = q(b2) !== w || C2, $2 = await i(
33088
33092
  o2,
33089
- R2,
33090
- y,
33091
- x2,
33092
- F2,
33093
- L2
33093
+ E2,
33094
+ c,
33095
+ b2,
33096
+ S,
33097
+ I2
33094
33098
  );
33095
- let b2 = T.frontmatter;
33096
- if (m) {
33099
+ let x2 = $2.frontmatter;
33100
+ if (c.postTransform) {
33097
33101
  const A = {
33098
- frontmatter: b2,
33099
- headingTree: T.headingTree
33102
+ frontmatter: x2,
33103
+ headingTree: $2.headingTree
33100
33104
  };
33101
- b2 = await m(A);
33105
+ x2 = await c.postTransform(A);
33102
33106
  }
33103
- const P2 = M(b2) !== v || k2, J2 = () => P2 ? V(b2, F2) : o2;
33107
+ const P2 = q(x2) !== w || C2, M = () => P2 ? Q(x2, S) : o2;
33104
33108
  return {
33105
- html: T.html,
33106
- frontmatter: b2,
33109
+ html: $2.html,
33110
+ frontmatter: x2,
33107
33111
  changed: P2,
33108
- headingTree: T.headingTree,
33109
- composeMarkdown: J2,
33110
- uniqueIdPrefix: T.uniqueIdPrefix
33112
+ headingTree: $2.headingTree,
33113
+ composeMarkdown: M,
33114
+ uniqueIdPrefix: $2.uniqueIdPrefix
33111
33115
  };
33112
- } catch (g2) {
33113
- return u(g2);
33116
+ } catch (m) {
33117
+ return u(m);
33114
33118
  }
33115
33119
  }
33116
33120
  };
@@ -33161,7 +33165,7 @@ const _ = () => {
33161
33165
  const d2 = r.trim();
33162
33166
  if (!d2) {
33163
33167
  s2.logger.warn("Mermaid plugin received empty content");
33164
- const l2 = n ? ` id="${s2.getUniqueId()}"` : "";
33168
+ const h = n ? ` id="${s2.getUniqueId()}"` : "";
33165
33169
  return `<div class="${t}-wrapper">
33166
33170
  <style>
33167
33171
  .${t}-wrapper .${t} > svg {
@@ -33170,7 +33174,7 @@ const _ = () => {
33170
33174
  max-width: none !important;
33171
33175
  }
33172
33176
  </style>
33173
- <div class="${t}"${l2}><!-- Empty mermaid content --></div>
33177
+ <div class="${t}"${h}><!-- Empty mermaid content --></div>
33174
33178
  </div>`;
33175
33179
  }
33176
33180
  const p2 = n ? ` id="${s2.getUniqueId()}"` : "", u = d2.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;"), i = `<div class="${t}-wrapper">
@@ -33200,20 +33204,20 @@ const _ = () => {
33200
33204
  * repository.url: https://github.com/kekyo/async-primitives.git
33201
33205
  * git.commit.hash: cd35465b7e9b9945049186e7eaeecc0bfba65766
33202
33206
  */
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) => {
33207
+ const X = () => {
33208
+ }, Y = {
33209
+ release: X,
33210
+ [Symbol.dispose]: X
33211
+ }, tt = (e) => e instanceof Error ? e : typeof e == "string" ? new Error(e) : new Error("Operation aborted"), At = (e, t) => {
33208
33212
  if (!e)
33209
- return tt;
33213
+ return Y;
33210
33214
  if (e.aborted) {
33211
33215
  try {
33212
- t(et(e.reason));
33216
+ t(tt(e.reason));
33213
33217
  } catch (s2) {
33214
33218
  console.warn("AbortHook callback error: ", s2);
33215
33219
  }
33216
- return tt;
33220
+ return Y;
33217
33221
  }
33218
33222
  let n;
33219
33223
  n = () => {
@@ -33221,7 +33225,7 @@ const Y = () => {
33221
33225
  const s2 = e.reason;
33222
33226
  e.removeEventListener("abort", n), n = void 0;
33223
33227
  try {
33224
- t(et(s2));
33228
+ t(tt(s2));
33225
33229
  } catch (d2) {
33226
33230
  console.warn("AbortHook callback error: ", d2);
33227
33231
  }
@@ -33236,7 +33240,7 @@ const Y = () => {
33236
33240
  };
33237
33241
  }, Pt = (e) => {
33238
33242
  typeof setImmediate == "function" ? setImmediate(e) : setTimeout(e, 0);
33239
- }, q = () => new Error("Lock acquisition was aborted"), _t = (e) => {
33243
+ }, D = () => new Error("Lock acquisition was aborted"), _t = (e) => {
33240
33244
  let t = true;
33241
33245
  const n = () => {
33242
33246
  t && (t = false, e());
@@ -33248,51 +33252,51 @@ const Y = () => {
33248
33252
  release: n,
33249
33253
  [Symbol.dispose]: n
33250
33254
  };
33251
- }, z = (e = 20) => {
33255
+ }, B = (e = 20) => {
33252
33256
  let t = false;
33253
33257
  const n = [];
33254
33258
  let a = 0;
33255
33259
  const r = () => {
33256
- var l2;
33260
+ var h;
33257
33261
  if (t || n.length === 0)
33258
33262
  return;
33259
- const c = n.shift();
33260
- if ((l2 = c.signal) != null && l2.aborted) {
33261
- c.reject(q()), s2();
33263
+ const l2 = n.shift();
33264
+ if ((h = l2.signal) != null && h.aborted) {
33265
+ l2.reject(D()), s2();
33262
33266
  return;
33263
33267
  }
33264
33268
  t = true;
33265
33269
  const o2 = _t(d2);
33266
- c.resolve(o2);
33270
+ l2.resolve(o2);
33267
33271
  }, s2 = () => {
33268
33272
  a++, a >= e ? (a = 0, Pt(r)) : r();
33269
33273
  }, d2 = () => {
33270
33274
  t && (t = false, s2());
33271
- }, p2 = (l2) => {
33272
- const c = n.indexOf(l2);
33273
- c !== -1 && n.splice(c, 1);
33274
- }, u = async (l2) => {
33275
- if (l2) {
33276
- if (l2.aborted)
33277
- throw q();
33278
- return new Promise((c, o2) => {
33279
- const h = {
33275
+ }, p2 = (h) => {
33276
+ const l2 = n.indexOf(h);
33277
+ l2 !== -1 && n.splice(l2, 1);
33278
+ }, u = async (h) => {
33279
+ if (h) {
33280
+ if (h.aborted)
33281
+ throw D();
33282
+ return new Promise((l2, o2) => {
33283
+ const f = {
33280
33284
  resolve: void 0,
33281
33285
  reject: void 0,
33282
- signal: l2
33283
- }, f = At(l2, () => {
33284
- p2(h), o2(q());
33286
+ signal: h
33287
+ }, c = At(h, () => {
33288
+ p2(f), o2(D());
33285
33289
  });
33286
- h.resolve = (m) => {
33287
- f.release(), c(m);
33288
- }, h.reject = (m) => {
33289
- f.release(), o2(m);
33290
- }, n.push(h), r();
33290
+ f.resolve = (m) => {
33291
+ c.release(), l2(m);
33292
+ }, f.reject = (m) => {
33293
+ c.release(), o2(m);
33294
+ }, n.push(f), r();
33291
33295
  });
33292
33296
  } else
33293
- return new Promise((c, o2) => {
33297
+ return new Promise((l2, o2) => {
33294
33298
  n.push({
33295
- resolve: c,
33299
+ resolve: l2,
33296
33300
  reject: o2
33297
33301
  }), r();
33298
33302
  });
@@ -33310,12 +33314,12 @@ const Y = () => {
33310
33314
  }
33311
33315
  };
33312
33316
  }, jt = () => {
33313
- const e = /* @__PURE__ */ new Map(), t = z(), n = (u = Date.now()) => {
33317
+ const e = /* @__PURE__ */ new Map(), t = B(), n = (u = Date.now()) => {
33314
33318
  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)
33318
- e.delete(l2);
33319
+ for (const [h, l2] of e.entries())
33320
+ l2.ttl !== void 0 && (l2.ttl === 0 || u > l2.timestamp + l2.ttl) && i.push(h);
33321
+ for (const h of i)
33322
+ e.delete(h);
33319
33323
  return i;
33320
33324
  };
33321
33325
  return {
@@ -33324,29 +33328,29 @@ const Y = () => {
33324
33328
  if (!i)
33325
33329
  return null;
33326
33330
  if (i.ttl !== void 0 && (i.ttl === 0 || Date.now() > i.timestamp + i.ttl)) {
33327
- const c = await t.lock();
33331
+ const l2 = await t.lock();
33328
33332
  try {
33329
33333
  const o2 = e.get(u);
33330
33334
  if (o2 && o2.ttl !== void 0) {
33331
- const h = Date.now();
33332
- (o2.ttl === 0 || h > o2.timestamp + o2.ttl) && e.delete(u);
33335
+ const f = Date.now();
33336
+ (o2.ttl === 0 || f > o2.timestamp + o2.ttl) && e.delete(u);
33333
33337
  }
33334
33338
  return null;
33335
33339
  } finally {
33336
- c.release();
33340
+ l2.release();
33337
33341
  }
33338
33342
  }
33339
33343
  return i.data;
33340
33344
  },
33341
- set: async (u, i, l2) => {
33342
- const c = {
33345
+ set: async (u, i, h) => {
33346
+ const l2 = {
33343
33347
  data: i,
33344
33348
  timestamp: Date.now()
33345
33349
  };
33346
- l2 !== void 0 && (c.ttl = l2);
33350
+ h !== void 0 && (l2.ttl = h);
33347
33351
  const o2 = await t.lock();
33348
33352
  try {
33349
- e.set(u, c);
33353
+ e.set(u, l2);
33350
33354
  } finally {
33351
33355
  o2.release();
33352
33356
  }
@@ -33379,7 +33383,7 @@ const Y = () => {
33379
33383
  }
33380
33384
  };
33381
33385
  };
33382
- function D(e, t, n) {
33386
+ function W(e, t, n) {
33383
33387
  return `fetch:${e}:${t}:${n}`;
33384
33388
  }
33385
33389
  const re = (e, t = 6e4, n, a) => {
@@ -33392,52 +33396,52 @@ const re = (e, t = 6e4, n, a) => {
33392
33396
  // 5 minutes default for failures
33393
33397
  } = {}, u = r ? n || jt() : void 0;
33394
33398
  return {
33395
- rawFetcher: async (l2, c, o2, h) => {
33399
+ rawFetcher: async (h, l2, o2, f) => {
33396
33400
  if (r && u) {
33397
- const y = D(l2, c, e), g2 = await u.get(y);
33398
- if (g2)
33401
+ const y = W(h, l2, e), w = await u.get(y);
33402
+ if (w)
33399
33403
  try {
33400
- const w = JSON.parse(g2);
33401
- if (w.type === "success")
33402
- return h?.info(`Cache HIT (success) for URL: ${l2}`), new Response(w.data, {
33404
+ const g2 = JSON.parse(w);
33405
+ if (g2.type === "success")
33406
+ return f?.info(`Cache HIT (success) for URL: ${h}`), new Response(g2.data, {
33403
33407
  status: 200,
33404
33408
  statusText: "OK",
33405
33409
  headers: {
33406
- "Content-Type": c,
33410
+ "Content-Type": l2,
33407
33411
  "X-Cache": "HIT"
33408
33412
  }
33409
33413
  });
33410
- if (w.type === "error" && d2)
33411
- throw h?.info(`Cache HIT (error) for URL: ${l2}`), new Error("Cached error");
33412
- h?.debug(
33413
- `Cache entry type ${w.type} not eligible for use, cacheFailures: ${d2}`
33414
+ if (g2.type === "error" && d2)
33415
+ throw f?.info(`Cache HIT (error) for URL: ${h}`), new Error("Cached error");
33416
+ f?.debug(
33417
+ `Cache entry type ${g2.type} not eligible for use, cacheFailures: ${d2}`
33414
33418
  );
33415
- } catch (w) {
33416
- if (h?.warn(
33417
- `Failed to parse cached entry for URL ${l2}:`,
33418
- w
33419
- ), w instanceof SyntaxError)
33420
- h?.debug("JSON parse error, continuing to network fetch");
33419
+ } catch (g2) {
33420
+ if (f?.warn(
33421
+ `Failed to parse cached entry for URL ${h}:`,
33422
+ g2
33423
+ ), g2 instanceof SyntaxError)
33424
+ f?.debug("JSON parse error, continuing to network fetch");
33421
33425
  else
33422
- throw w;
33426
+ throw g2;
33423
33427
  }
33424
33428
  else
33425
- h?.info(`Cache MISS for URL: ${l2}`);
33429
+ f?.info(`Cache MISS for URL: ${h}`);
33426
33430
  }
33427
- let f, m = null;
33431
+ let c, m = null;
33428
33432
  try {
33429
- f = await Yd(
33433
+ c = await Yd(
33434
+ h,
33430
33435
  l2,
33431
- c,
33432
33436
  e,
33433
33437
  t,
33434
33438
  o2,
33435
- h
33439
+ f
33436
33440
  );
33437
33441
  } catch (y) {
33438
33442
  if (m = y, r && u && d2)
33439
33443
  try {
33440
- const g2 = D(l2, c, e), w = {
33444
+ const w = W(h, l2, e), g2 = {
33441
33445
  type: "error",
33442
33446
  data: "",
33443
33447
  error: {
@@ -33451,31 +33455,31 @@ const re = (e, t = 6e4, n, a) => {
33451
33455
  timestamp: Date.now()
33452
33456
  };
33453
33457
  await u.set(
33454
- g2,
33455
- JSON.stringify(w),
33458
+ w,
33459
+ JSON.stringify(g2),
33456
33460
  p2
33457
- ), h?.debug(`Cached error for URL: ${l2}`);
33458
- } catch (g2) {
33459
- h?.warn(`Failed to cache error for URL ${l2}:`, g2), console.warn("Failed to cache error:", g2);
33461
+ ), f?.debug(`Cached error for URL: ${h}`);
33462
+ } catch (w) {
33463
+ f?.warn(`Failed to cache error for URL ${h}:`, w), console.warn("Failed to cache error:", w);
33460
33464
  }
33461
33465
  throw m;
33462
33466
  }
33463
- if (r && u && f.ok)
33467
+ if (r && u && c.ok)
33464
33468
  try {
33465
- const y = await f.clone().text(), g2 = D(l2, c, e), w = {
33469
+ const y = await c.clone().text(), w = W(h, l2, e), g2 = {
33466
33470
  type: "success",
33467
33471
  data: y,
33468
33472
  timestamp: Date.now()
33469
33473
  };
33470
33474
  await u.set(
33471
- g2,
33472
- JSON.stringify(w),
33475
+ w,
33476
+ JSON.stringify(g2),
33473
33477
  s2
33474
- ), h?.debug(`Cached successful response for URL: ${l2}`);
33478
+ ), f?.debug(`Cached successful response for URL: ${h}`);
33475
33479
  } catch (y) {
33476
- h?.warn(`Failed to cache response for URL ${l2}:`, y), console.warn("Failed to cache response:", y);
33480
+ f?.warn(`Failed to cache response for URL ${h}:`, y), console.warn("Failed to cache response:", y);
33477
33481
  }
33478
- return f;
33482
+ return c;
33479
33483
  },
33480
33484
  userAgent: e
33481
33485
  };