akm-cli 0.10.261007-beta → 0.10.261009-beta

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/CHANGELOG.md +72 -0
  2. package/STABILITY.md +10 -4
  3. package/dist/api.d.ts +6 -0
  4. package/dist/api.js +12 -1
  5. package/dist/assets/prompts/consolidate-pair-check.md +2 -0
  6. package/dist/assets/prompts/consolidate-pair-same-age.md +1 -0
  7. package/dist/assets/prompts/consolidate-pair-terms.md +6 -0
  8. package/dist/assets/prompts/consolidate-pair.md +4 -12
  9. package/dist/commands/health.js +1 -2
  10. package/dist/commands/improve/consolidate/pair-pass.js +59 -31
  11. package/dist/commands/improve/extract.js +18 -12
  12. package/dist/commands/improve/memory/memory-belief.js +2 -2
  13. package/dist/commands/proposal/repository.js +44 -13
  14. package/dist/commands/read/curate.js +77 -18
  15. package/dist/commands/read/search-cli.js +25 -11
  16. package/dist/commands/read/search.js +3 -3
  17. package/dist/commands/read/show.js +47 -1
  18. package/dist/core/adapter/adapters/akm-adapter.js +1 -0
  19. package/dist/core/adapter/adapters/llm-wiki-adapter.js +3 -5
  20. package/dist/core/adapter/adapters/okf-adapter.js +3 -16
  21. package/dist/core/asset/markdown-link-targets.js +43 -0
  22. package/dist/core/common.js +17 -2
  23. package/dist/core/config/config-io.js +14 -4
  24. package/dist/indexer/passes/metadata.js +17 -0
  25. package/dist/indexer/scan/doc-to-entry.js +1 -0
  26. package/dist/indexer/search/db-search.js +16 -7
  27. package/dist/indexer/search/search-hit-enrichers.js +3 -3
  28. package/dist/output/shapes/curate.js +3 -1
  29. package/dist/output/shapes/helpers.js +6 -0
  30. package/dist/output/text/show-format.js +7 -0
  31. package/dist/scripts/akm-migrate-node.js +1824 -324
  32. package/dist/scripts/akm-migrate.js +1824 -324
  33. package/dist/storage/repositories/index-entries-repository.js +16 -0
  34. package/dist/storage/repositories/index-fts-repository.js +28 -6
  35. package/dist/storage/repositories/index-vec-repository.js +19 -3
  36. package/docs/architecture/0.10-process-rules.md +4 -4
  37. package/docs/architecture/architecture.md +4 -0
  38. package/docs/architecture/persisted-data-compat.md +1 -1
  39. package/docs/reference/api.md +19 -1
  40. package/docs/reference/cli.md +56 -4
  41. package/docs/reference/data-and-telemetry.md +1 -1
  42. package/docs/reference/memory.md +7 -6
  43. package/package.json +2 -1
@@ -9320,11 +9320,11 @@ var require_DOMException = __commonJS((exports, module) => {
9320
9320
  }
9321
9321
  DOMException2.prototype.__proto__ = Error.prototype;
9322
9322
  for (c in constants) {
9323
- v = { value: constants[c] };
9324
- Object.defineProperty(DOMException2, c, v);
9325
- Object.defineProperty(DOMException2.prototype, c, v);
9323
+ v2 = { value: constants[c] };
9324
+ Object.defineProperty(DOMException2, c, v2);
9325
+ Object.defineProperty(DOMException2.prototype, c, v2);
9326
9326
  }
9327
- var v;
9327
+ var v2;
9328
9328
  var c;
9329
9329
  });
9330
9330
 
@@ -9426,9 +9426,9 @@ var require_utils = __commonJS((exports) => {
9426
9426
  Object.defineProperty(c.prototype, n, { value: src[n], writable: isApiWritable });
9427
9427
  }
9428
9428
  };
9429
- exports.merge = function(a, b) {
9429
+ exports.merge = function(a3, b) {
9430
9430
  for (var n in b) {
9431
- a[n] = b[n];
9431
+ a3[n] = b[n];
9432
9432
  }
9433
9433
  };
9434
9434
  exports.documentOrder = function(n, m) {
@@ -9509,10 +9509,10 @@ var require_EventTarget = __commonJS((exports, module) => {
9509
9509
  if (typeof handler3 === "function") {
9510
9510
  rv = handler3.call(event2.currentTarget, event2);
9511
9511
  } else {
9512
- var f = handler3.handleEvent;
9513
- if (typeof f !== "function")
9512
+ var f2 = handler3.handleEvent;
9513
+ if (typeof f2 !== "function")
9514
9514
  throw new TypeError("handleEvent property of " + "event handler object is" + "not a function.");
9515
- rv = f.call(handler3, event2);
9515
+ rv = f2.call(handler3, event2);
9516
9516
  }
9517
9517
  switch (event2.type) {
9518
9518
  case "mouseover":
@@ -9638,41 +9638,41 @@ var require_EventTarget = __commonJS((exports, module) => {
9638
9638
  var require_LinkedList = __commonJS((exports, module) => {
9639
9639
  var utils = require_utils();
9640
9640
  var LinkedList = module.exports = {
9641
- valid: function(a) {
9642
- utils.assert(a, "list falsy");
9643
- utils.assert(a._previousSibling, "previous falsy");
9644
- utils.assert(a._nextSibling, "next falsy");
9641
+ valid: function(a3) {
9642
+ utils.assert(a3, "list falsy");
9643
+ utils.assert(a3._previousSibling, "previous falsy");
9644
+ utils.assert(a3._nextSibling, "next falsy");
9645
9645
  return true;
9646
9646
  },
9647
- insertBefore: function(a, b) {
9648
- utils.assert(LinkedList.valid(a) && LinkedList.valid(b));
9649
- var a_first = a, a_last = a._previousSibling;
9647
+ insertBefore: function(a3, b) {
9648
+ utils.assert(LinkedList.valid(a3) && LinkedList.valid(b));
9649
+ var a_first = a3, a_last = a3._previousSibling;
9650
9650
  var b_first = b, b_last = b._previousSibling;
9651
9651
  a_first._previousSibling = b_last;
9652
9652
  a_last._nextSibling = b_first;
9653
9653
  b_last._nextSibling = a_first;
9654
9654
  b_first._previousSibling = a_last;
9655
- utils.assert(LinkedList.valid(a) && LinkedList.valid(b));
9655
+ utils.assert(LinkedList.valid(a3) && LinkedList.valid(b));
9656
9656
  },
9657
- replace: function(a, b) {
9658
- utils.assert(LinkedList.valid(a) && (b === null || LinkedList.valid(b)));
9657
+ replace: function(a3, b) {
9658
+ utils.assert(LinkedList.valid(a3) && (b === null || LinkedList.valid(b)));
9659
9659
  if (b !== null) {
9660
- LinkedList.insertBefore(b, a);
9660
+ LinkedList.insertBefore(b, a3);
9661
9661
  }
9662
- LinkedList.remove(a);
9663
- utils.assert(LinkedList.valid(a) && (b === null || LinkedList.valid(b)));
9662
+ LinkedList.remove(a3);
9663
+ utils.assert(LinkedList.valid(a3) && (b === null || LinkedList.valid(b)));
9664
9664
  },
9665
- remove: function(a) {
9666
- utils.assert(LinkedList.valid(a));
9667
- var prev = a._previousSibling;
9668
- if (prev === a) {
9665
+ remove: function(a3) {
9666
+ utils.assert(LinkedList.valid(a3));
9667
+ var prev = a3._previousSibling;
9668
+ if (prev === a3) {
9669
9669
  return;
9670
9670
  }
9671
- var next = a._nextSibling;
9671
+ var next = a3._nextSibling;
9672
9672
  prev._nextSibling = next;
9673
9673
  next._previousSibling = prev;
9674
- a._previousSibling = a._nextSibling = a;
9675
- utils.assert(LinkedList.valid(a));
9674
+ a3._previousSibling = a3._nextSibling = a3;
9675
+ utils.assert(LinkedList.valid(a3));
9676
9676
  }
9677
9677
  };
9678
9678
  });
@@ -9755,21 +9755,21 @@ var require_NodeUtils = __commonJS((exports, module) => {
9755
9755
  }
9756
9756
  });
9757
9757
  }
9758
- function attrname(a) {
9759
- var ns = a.namespaceURI;
9758
+ function attrname(a3) {
9759
+ var ns = a3.namespaceURI;
9760
9760
  if (!ns)
9761
- return a.localName;
9761
+ return a3.localName;
9762
9762
  if (ns === NAMESPACE.XML)
9763
- return "xml:" + a.localName;
9763
+ return "xml:" + a3.localName;
9764
9764
  if (ns === NAMESPACE.XLINK)
9765
- return "xlink:" + a.localName;
9765
+ return "xlink:" + a3.localName;
9766
9766
  if (ns === NAMESPACE.XMLNS) {
9767
- if (a.localName === "xmlns")
9767
+ if (a3.localName === "xmlns")
9768
9768
  return "xmlns";
9769
9769
  else
9770
- return "xmlns:" + a.localName;
9770
+ return "xmlns:" + a3.localName;
9771
9771
  }
9772
- return a.name;
9772
+ return a3.name;
9773
9773
  }
9774
9774
  function escapeMatchingClosingTag(rawText, parentTag) {
9775
9775
  const parentClosingTag = "</" + parentTag;
@@ -9801,11 +9801,11 @@ var require_NodeUtils = __commonJS((exports, module) => {
9801
9801
  var html = ns === NAMESPACE.HTML;
9802
9802
  var tagname = html || ns === NAMESPACE.SVG || ns === NAMESPACE.MATHML ? kid.localName : kid.tagName;
9803
9803
  s += "<" + tagname;
9804
- for (var j = 0, k = kid._numattrs;j < k; j++) {
9805
- var a = kid._attr(j);
9806
- s += " " + attrname(a);
9807
- if (a.value !== undefined)
9808
- s += '="' + escapeAttr(a.value) + '"';
9804
+ for (var j2 = 0, k = kid._numattrs;j2 < k; j2++) {
9805
+ var a3 = kid._attr(j2);
9806
+ s += " " + attrname(a3);
9807
+ if (a3.value !== undefined)
9808
+ s += '="' + escapeAttr(a3.value) + '"';
9809
9809
  }
9810
9810
  s += ">";
9811
9811
  if (!(html && emptyElements[tagname])) {
@@ -9927,13 +9927,13 @@ var require_Node2 = __commonJS((exports, module) => {
9927
9927
  get: function() {
9928
9928
  return null;
9929
9929
  },
9930
- set: function(v) {}
9930
+ set: function(v2) {}
9931
9931
  },
9932
9932
  innerText: {
9933
9933
  get: function() {
9934
9934
  return null;
9935
9935
  },
9936
- set: function(v) {}
9936
+ set: function(v2) {}
9937
9937
  },
9938
9938
  _countChildrenOfType: { value: function(type) {
9939
9939
  var sum = 0;
@@ -10417,11 +10417,11 @@ var require_Node2 = __commonJS((exports, module) => {
10417
10417
  // node_modules/@mixmark-io/domino/lib/NodeList.es6.js
10418
10418
  var require_NodeList_es6 = __commonJS((exports, module) => {
10419
10419
  module.exports = class NodeList extends Array {
10420
- constructor(a) {
10421
- super(a && a.length || 0);
10422
- if (a) {
10423
- for (var idx in a) {
10424
- this[idx] = a[idx];
10420
+ constructor(a3) {
10421
+ super(a3 && a3.length || 0);
10422
+ if (a3) {
10423
+ for (var idx in a3) {
10424
+ this[idx] = a3[idx];
10425
10425
  }
10426
10426
  }
10427
10427
  }
@@ -10436,11 +10436,11 @@ var require_NodeList_es5 = __commonJS((exports, module) => {
10436
10436
  function item(i) {
10437
10437
  return this[i] || null;
10438
10438
  }
10439
- function NodeList(a) {
10440
- if (!a)
10441
- a = [];
10442
- a.item = item;
10443
- return a;
10439
+ function NodeList(a3) {
10440
+ if (!a3)
10441
+ a3 = [];
10442
+ a3.item = item;
10443
+ return a3;
10444
10444
  }
10445
10445
  module.exports = NodeList;
10446
10446
  });
@@ -10592,18 +10592,18 @@ var require_attributes = __commonJS((exports) => {
10592
10592
  }
10593
10593
  return {
10594
10594
  get: function() {
10595
- var v = this._getattr(attr.name);
10596
- if (v === null)
10595
+ var v2 = this._getattr(attr.name);
10596
+ if (v2 === null)
10597
10597
  return missingValueDefault;
10598
- v = valid[v.toLowerCase()];
10599
- if (v !== undefined)
10600
- return v;
10598
+ v2 = valid[v2.toLowerCase()];
10599
+ if (v2 !== undefined)
10600
+ return v2;
10601
10601
  if (invalidValueDefault !== null)
10602
10602
  return invalidValueDefault;
10603
- return v;
10603
+ return v2;
10604
10604
  },
10605
- set: function(v) {
10606
- this._setattr(attr.name, v);
10605
+ set: function(v2) {
10606
+ this._setattr(attr.name, v2);
10607
10607
  }
10608
10608
  };
10609
10609
  } else if (attr.type === Boolean) {
@@ -10611,8 +10611,8 @@ var require_attributes = __commonJS((exports) => {
10611
10611
  get: function() {
10612
10612
  return this.hasAttribute(attr.name);
10613
10613
  },
10614
- set: function(v) {
10615
- if (v) {
10614
+ set: function(v2) {
10615
+ if (v2) {
10616
10616
  this._setattr(attr.name, "");
10617
10617
  } else {
10618
10618
  this.removeAttribute(attr.name);
@@ -10626,11 +10626,11 @@ var require_attributes = __commonJS((exports) => {
10626
10626
  get: function() {
10627
10627
  return this._getattr(attr.name) || "";
10628
10628
  },
10629
- set: function(v) {
10630
- if (attr.treatNullAsEmptyString && v === null) {
10631
- v = "";
10629
+ set: function(v2) {
10630
+ if (attr.treatNullAsEmptyString && v2 === null) {
10631
+ v2 = "";
10632
10632
  }
10633
- this._setattr(attr.name, v);
10633
+ this._setattr(attr.name, v2);
10634
10634
  }
10635
10635
  };
10636
10636
  } else if (typeof attr.type === "function") {
@@ -10638,23 +10638,23 @@ var require_attributes = __commonJS((exports) => {
10638
10638
  }
10639
10639
  throw new Error("Invalid attribute definition");
10640
10640
  };
10641
- function numberPropDesc(a) {
10641
+ function numberPropDesc(a3) {
10642
10642
  var def;
10643
- if (typeof a.default === "function") {
10644
- def = a.default;
10645
- } else if (typeof a.default === "number") {
10643
+ if (typeof a3.default === "function") {
10644
+ def = a3.default;
10645
+ } else if (typeof a3.default === "number") {
10646
10646
  def = function() {
10647
- return a.default;
10647
+ return a3.default;
10648
10648
  };
10649
10649
  } else {
10650
10650
  def = function() {
10651
- utils.assert(false, typeof a.default);
10651
+ utils.assert(false, typeof a3.default);
10652
10652
  };
10653
10653
  }
10654
- var unsigned_long = a.type === "unsigned long";
10655
- var signed_long = a.type === "long";
10656
- var unsigned_fallback = a.type === "limited unsigned long with fallback";
10657
- var { min, max, setmin } = a;
10654
+ var unsigned_long = a3.type === "unsigned long";
10655
+ var signed_long = a3.type === "long";
10656
+ var unsigned_fallback = a3.type === "limited unsigned long with fallback";
10657
+ var { min, max, setmin } = a3;
10658
10658
  if (min === undefined) {
10659
10659
  if (unsigned_long)
10660
10660
  min = 0;
@@ -10669,34 +10669,34 @@ var require_attributes = __commonJS((exports) => {
10669
10669
  }
10670
10670
  return {
10671
10671
  get: function() {
10672
- var v = this._getattr(a.name);
10673
- var n = a.float ? parseFloat(v) : parseInt(v, 10);
10674
- if (v === null || !isFinite(n) || min !== undefined && n < min || max !== undefined && n > max) {
10672
+ var v2 = this._getattr(a3.name);
10673
+ var n = a3.float ? parseFloat(v2) : parseInt(v2, 10);
10674
+ if (v2 === null || !isFinite(n) || min !== undefined && n < min || max !== undefined && n > max) {
10675
10675
  return def.call(this);
10676
10676
  }
10677
10677
  if (unsigned_long || signed_long || unsigned_fallback) {
10678
- if (!/^[ \t\n\f\r]*[-+]?[0-9]/.test(v)) {
10678
+ if (!/^[ \t\n\f\r]*[-+]?[0-9]/.test(v2)) {
10679
10679
  return def.call(this);
10680
10680
  }
10681
10681
  n = n | 0;
10682
10682
  }
10683
10683
  return n;
10684
10684
  },
10685
- set: function(v) {
10686
- if (!a.float) {
10687
- v = Math.floor(v);
10685
+ set: function(v2) {
10686
+ if (!a3.float) {
10687
+ v2 = Math.floor(v2);
10688
10688
  }
10689
- if (setmin !== undefined && v < setmin) {
10690
- utils.IndexSizeError(a.name + " set to " + v);
10689
+ if (setmin !== undefined && v2 < setmin) {
10690
+ utils.IndexSizeError(a3.name + " set to " + v2);
10691
10691
  }
10692
10692
  if (unsigned_long) {
10693
- v = v < 0 || v > 2147483647 ? def.call(this) : v | 0;
10693
+ v2 = v2 < 0 || v2 > 2147483647 ? def.call(this) : v2 | 0;
10694
10694
  } else if (unsigned_fallback) {
10695
- v = v < 1 || v > 2147483647 ? def.call(this) : v | 0;
10695
+ v2 = v2 < 1 || v2 > 2147483647 ? def.call(this) : v2 | 0;
10696
10696
  } else if (signed_long) {
10697
- v = v < -2147483648 || v > 2147483647 ? def.call(this) : v | 0;
10697
+ v2 = v2 < -2147483648 || v2 > 2147483647 ? def.call(this) : v2 | 0;
10698
10698
  }
10699
- this._setattr(a.name, String(v));
10699
+ this._setattr(a3.name, String(v2));
10700
10700
  }
10701
10701
  };
10702
10702
  }
@@ -10871,8 +10871,8 @@ var require_DOMTokenList = __commonJS((exports, module) => {
10871
10871
  get: function() {
10872
10872
  return this._getString();
10873
10873
  },
10874
- set: function(v) {
10875
- this._setString(v);
10874
+ set: function(v2) {
10875
+ this._setString(v2);
10876
10876
  this._update();
10877
10877
  }
10878
10878
  },
@@ -10944,11 +10944,11 @@ var require_select = __commonJS((exports, module) => {
10944
10944
  throw new Error("window.location is not supported.");
10945
10945
  } }
10946
10946
  });
10947
- var compareDocumentPosition = function(a, b) {
10948
- return a.compareDocumentPosition(b);
10947
+ var compareDocumentPosition = function(a3, b) {
10948
+ return a3.compareDocumentPosition(b);
10949
10949
  };
10950
- var order = function(a, b) {
10951
- return compareDocumentPosition(a, b) & 2 ? 1 : -1;
10950
+ var order = function(a3, b) {
10951
+ return compareDocumentPosition(a3, b) & 2 ? 1 : -1;
10952
10952
  };
10953
10953
  var next = function(el) {
10954
10954
  while ((el = el.nextSibling) && el.nodeType !== 1)
@@ -11355,14 +11355,14 @@ var require_select = __commonJS((exports, module) => {
11355
11355
  return attr.indexOf(val) !== -1;
11356
11356
  },
11357
11357
  "~=": function(attr, val) {
11358
- var i, s, f, l;
11358
+ var i, s, f2, l;
11359
11359
  for (s = 0;; s = i + 1) {
11360
11360
  i = attr.indexOf(val, s);
11361
11361
  if (i === -1)
11362
11362
  return false;
11363
- f = attr[i - 1];
11363
+ f2 = attr[i - 1];
11364
11364
  l = attr[i + val.length];
11365
- if ((!f || f === " ") && (!l || l === " "))
11365
+ if ((!f2 || f2 === " ") && (!l || l === " "))
11366
11366
  return true;
11367
11367
  }
11368
11368
  },
@@ -11700,8 +11700,8 @@ var require_ChildNode = __commonJS((exports, module) => {
11700
11700
  if (parentNode === null) {
11701
11701
  return;
11702
11702
  }
11703
- while (nextSibling && argArr.some(function(v) {
11704
- return v === nextSibling;
11703
+ while (nextSibling && argArr.some(function(v2) {
11704
+ return v2 === nextSibling;
11705
11705
  }))
11706
11706
  nextSibling = nextSibling.nextSibling;
11707
11707
  var docFrag = createDocumentFragmentFromArguments(this.doc, argArr);
@@ -11713,8 +11713,8 @@ var require_ChildNode = __commonJS((exports, module) => {
11713
11713
  if (parentNode === null) {
11714
11714
  return;
11715
11715
  }
11716
- while (prevSibling && argArr.some(function(v) {
11717
- return v === prevSibling;
11716
+ while (prevSibling && argArr.some(function(v2) {
11717
+ return v2 === prevSibling;
11718
11718
  }))
11719
11719
  prevSibling = prevSibling.previousSibling;
11720
11720
  var docFrag = createDocumentFragmentFromArguments(this.doc, argArr);
@@ -11755,8 +11755,8 @@ var require_ChildNode = __commonJS((exports, module) => {
11755
11755
  if (parentNode === null) {
11756
11756
  return;
11757
11757
  }
11758
- while (nextSibling && argArr.some(function(v) {
11759
- return v === nextSibling;
11758
+ while (nextSibling && argArr.some(function(v2) {
11759
+ return v2 === nextSibling;
11760
11760
  }))
11761
11761
  nextSibling = nextSibling.nextSibling;
11762
11762
  var docFrag = createDocumentFragmentFromArguments(this.doc, argArr);
@@ -11864,12 +11864,12 @@ var require_Element = __commonJS((exports, module) => {
11864
11864
  this._attrsByLName = Object.create(null);
11865
11865
  this._attrKeys = [];
11866
11866
  }
11867
- function recursiveGetText(node, a) {
11867
+ function recursiveGetText(node, a3) {
11868
11868
  if (node.nodeType === Node.TEXT_NODE) {
11869
- a.push(node._data);
11869
+ a3.push(node._data);
11870
11870
  } else {
11871
11871
  for (var i = 0, n = node.childNodes.length;i < n; i++)
11872
- recursiveGetText(node.childNodes[i], a);
11872
+ recursiveGetText(node.childNodes[i], a3);
11873
11873
  }
11874
11874
  }
11875
11875
  Element.prototype = Object.create(ContainerNode.prototype, {
@@ -11940,7 +11940,7 @@ var require_Element = __commonJS((exports, module) => {
11940
11940
  get: function() {
11941
11941
  return NodeUtils.serializeOne(this, { nodeType: 0 });
11942
11942
  },
11943
- set: function(v) {
11943
+ set: function(v2) {
11944
11944
  var document = this.ownerDocument;
11945
11945
  var parent = this.parentNode;
11946
11946
  if (parent === null) {
@@ -11953,7 +11953,7 @@ var require_Element = __commonJS((exports, module) => {
11953
11953
  parent = parent.ownerDocument.createElement("body");
11954
11954
  }
11955
11955
  var parser2 = document.implementation.mozHTMLParser(document._address, parent);
11956
- parser2.parse(v === null ? "" : String(v), true);
11956
+ parser2.parse(v2 === null ? "" : String(v2), true);
11957
11957
  this.replaceWith(parser2._asDocumentFragment());
11958
11958
  }
11959
11959
  },
@@ -12110,8 +12110,8 @@ var require_Element = __commonJS((exports, module) => {
12110
12110
  }
12111
12111
  for (var i = 0, n = this._attrKeys.length;i < n; i++) {
12112
12112
  var lname = this._attrKeys[i];
12113
- var a = this._attrsByLName[lname];
12114
- var b = a.cloneNode();
12113
+ var a3 = this._attrsByLName[lname];
12114
+ var b = a3.cloneNode();
12115
12115
  b._setOwnerElement(e);
12116
12116
  e._attrsByLName[lname] = b;
12117
12117
  e._addQName(b);
@@ -12123,10 +12123,10 @@ var require_Element = __commonJS((exports, module) => {
12123
12123
  if (this.localName !== that.localName || this.namespaceURI !== that.namespaceURI || this.prefix !== that.prefix || this._numattrs !== that._numattrs)
12124
12124
  return false;
12125
12125
  for (var i = 0, n = this._numattrs;i < n; i++) {
12126
- var a = this._attr(i);
12127
- if (!that.hasAttributeNS(a.namespaceURI, a.localName))
12126
+ var a3 = this._attr(i);
12127
+ if (!that.hasAttributeNS(a3.namespaceURI, a3.localName))
12128
12128
  return false;
12129
- if (that.getAttributeNS(a.namespaceURI, a.localName) !== a.value)
12129
+ if (that.getAttributeNS(a3.namespaceURI, a3.localName) !== a3.value)
12130
12130
  return false;
12131
12131
  }
12132
12132
  return true;
@@ -12136,9 +12136,9 @@ var require_Element = __commonJS((exports, module) => {
12136
12136
  return this.prefix;
12137
12137
  }
12138
12138
  for (var i = 0, n = this._numattrs;i < n; i++) {
12139
- var a = this._attr(i);
12140
- if (a.prefix === "xmlns" && a.value === ns && originalElement.lookupNamespaceURI(a.localName) === ns) {
12141
- return a.localName;
12139
+ var a3 = this._attr(i);
12140
+ if (a3.prefix === "xmlns" && a3.value === ns && originalElement.lookupNamespaceURI(a3.localName) === ns) {
12141
+ return a3.localName;
12142
12142
  }
12143
12143
  }
12144
12144
  var parent = this.parentElement;
@@ -12151,10 +12151,10 @@ var require_Element = __commonJS((exports, module) => {
12151
12151
  if (this.namespaceURI !== null && this.prefix === prefix)
12152
12152
  return this.namespaceURI;
12153
12153
  for (var i = 0, n = this._numattrs;i < n; i++) {
12154
- var a = this._attr(i);
12155
- if (a.namespaceURI === NAMESPACE.XMLNS) {
12156
- if (a.prefix === "xmlns" && a.localName === prefix || prefix === null && a.prefix === null && a.localName === "xmlns") {
12157
- return a.value || null;
12154
+ var a3 = this._attr(i);
12155
+ if (a3.namespaceURI === NAMESPACE.XMLNS) {
12156
+ if (a3.prefix === "xmlns" && a3.localName === prefix || prefix === null && a3.prefix === null && a3.localName === "xmlns") {
12157
+ return a3.value || null;
12158
12158
  }
12159
12159
  }
12160
12160
  }
@@ -12207,8 +12207,8 @@ var require_Element = __commonJS((exports, module) => {
12207
12207
  utils.InvalidCharacterError();
12208
12208
  if (/[A-Z]/.test(qname) && this.isHTML)
12209
12209
  qname = utils.toASCIILowerCase(qname);
12210
- var a = this._attrsByQName[qname];
12211
- if (a === undefined) {
12210
+ var a3 = this._attrsByQName[qname];
12211
+ if (a3 === undefined) {
12212
12212
  if (force === undefined || force === true) {
12213
12213
  this._setAttribute(qname, "");
12214
12214
  return true;
@@ -12295,15 +12295,15 @@ var require_Element = __commonJS((exports, module) => {
12295
12295
  if (!Array.isArray(oldAttrs)) {
12296
12296
  oldAttrs = [oldAttrs];
12297
12297
  }
12298
- if (oldAttrs.some(function(a) {
12299
- return a === attr;
12298
+ if (oldAttrs.some(function(a3) {
12299
+ return a3 === attr;
12300
12300
  })) {
12301
12301
  return attr;
12302
12302
  } else if (attr.ownerElement !== null) {
12303
12303
  throw new DOMException2(DOMException2.INUSE_ATTRIBUTE_ERR);
12304
12304
  }
12305
- oldAttrs.forEach(function(a) {
12306
- this.removeAttributeNode(a);
12305
+ oldAttrs.forEach(function(a3) {
12306
+ this.removeAttributeNode(a3);
12307
12307
  }, this);
12308
12308
  result = oldAttrs[0];
12309
12309
  }
@@ -12483,13 +12483,13 @@ var require_Element = __commonJS((exports, module) => {
12483
12483
  }
12484
12484
  var dtlist = new DOMTokenList(function() {
12485
12485
  return self.className || "";
12486
- }, function(v) {
12487
- self.className = v;
12486
+ }, function(v2) {
12487
+ self.className = v2;
12488
12488
  });
12489
12489
  this._classList = dtlist;
12490
12490
  return dtlist;
12491
- }, set: function(v) {
12492
- this.className = v;
12491
+ }, set: function(v2) {
12492
+ this.className = v2;
12493
12493
  } },
12494
12494
  matches: { value: function(selector) {
12495
12495
  return select.matches(this, selector);
@@ -12587,30 +12587,30 @@ var require_Element = __commonJS((exports, module) => {
12587
12587
  get: function() {
12588
12588
  return this.value;
12589
12589
  },
12590
- set: function(v) {
12591
- this.value = v;
12590
+ set: function(v2) {
12591
+ this.value = v2;
12592
12592
  }
12593
12593
  },
12594
12594
  textContent: {
12595
12595
  get: function() {
12596
12596
  return this.value;
12597
12597
  },
12598
- set: function(v) {
12599
- if (v === null || v === undefined) {
12600
- v = "";
12598
+ set: function(v2) {
12599
+ if (v2 === null || v2 === undefined) {
12600
+ v2 = "";
12601
12601
  }
12602
- this.value = v;
12602
+ this.value = v2;
12603
12603
  }
12604
12604
  },
12605
12605
  innerText: {
12606
12606
  get: function() {
12607
12607
  return this.value;
12608
12608
  },
12609
- set: function(v) {
12610
- if (v === null || v === undefined) {
12611
- v = "";
12609
+ set: function(v2) {
12610
+ if (v2 === null || v2 === undefined) {
12611
+ v2 = "";
12612
12612
  }
12613
- this.value = v;
12613
+ this.value = v2;
12614
12614
  }
12615
12615
  }
12616
12616
  });
@@ -12849,15 +12849,15 @@ var require_Text = __commonJS((exports, module) => {
12849
12849
  get: function() {
12850
12850
  return this._data;
12851
12851
  },
12852
- set: function(v) {
12853
- if (v === null || v === undefined) {
12854
- v = "";
12852
+ set: function(v2) {
12853
+ if (v2 === null || v2 === undefined) {
12854
+ v2 = "";
12855
12855
  } else {
12856
- v = String(v);
12856
+ v2 = String(v2);
12857
12857
  }
12858
- if (v === this._data)
12858
+ if (v2 === this._data)
12859
12859
  return;
12860
- this._data = v;
12860
+ this._data = v2;
12861
12861
  if (this.rooted)
12862
12862
  this.ownerDocument.mutateValue(this);
12863
12863
  if (this.parentNode && this.parentNode._textchangehook)
@@ -12871,8 +12871,8 @@ var require_Text = __commonJS((exports, module) => {
12871
12871
  innerText: nodeValue,
12872
12872
  data: {
12873
12873
  get: nodeValue.get,
12874
- set: function(v) {
12875
- nodeValue.set.call(this, v === null ? "" : String(v));
12874
+ set: function(v2) {
12875
+ nodeValue.set.call(this, v2 === null ? "" : String(v2));
12876
12876
  }
12877
12877
  },
12878
12878
  splitText: { value: function splitText(offset) {
@@ -12917,13 +12917,13 @@ var require_Comment = __commonJS((exports, module) => {
12917
12917
  get: function() {
12918
12918
  return this._data;
12919
12919
  },
12920
- set: function(v) {
12921
- if (v === null || v === undefined) {
12922
- v = "";
12920
+ set: function(v2) {
12921
+ if (v2 === null || v2 === undefined) {
12922
+ v2 = "";
12923
12923
  } else {
12924
- v = String(v);
12924
+ v2 = String(v2);
12925
12925
  }
12926
- this._data = v;
12926
+ this._data = v2;
12927
12927
  if (this.rooted)
12928
12928
  this.ownerDocument.mutateValue(this);
12929
12929
  }
@@ -12935,8 +12935,8 @@ var require_Comment = __commonJS((exports, module) => {
12935
12935
  innerText: nodeValue,
12936
12936
  data: {
12937
12937
  get: nodeValue.get,
12938
- set: function(v) {
12939
- nodeValue.set.call(this, v === null ? "" : String(v));
12938
+ set: function(v2) {
12939
+ nodeValue.set.call(this, v2 === null ? "" : String(v2));
12940
12940
  }
12941
12941
  },
12942
12942
  clone: { value: function clone() {
@@ -13018,13 +13018,13 @@ var require_ProcessingInstruction = __commonJS((exports, module) => {
13018
13018
  get: function() {
13019
13019
  return this._data;
13020
13020
  },
13021
- set: function(v) {
13022
- if (v === null || v === undefined) {
13023
- v = "";
13021
+ set: function(v2) {
13022
+ if (v2 === null || v2 === undefined) {
13023
+ v2 = "";
13024
13024
  } else {
13025
- v = String(v);
13025
+ v2 = String(v2);
13026
13026
  }
13027
- this._data = v;
13027
+ this._data = v2;
13028
13028
  if (this.rooted)
13029
13029
  this.ownerDocument.mutateValue(this);
13030
13030
  }
@@ -13038,8 +13038,8 @@ var require_ProcessingInstruction = __commonJS((exports, module) => {
13038
13038
  innerText: nodeValue,
13039
13039
  data: {
13040
13040
  get: nodeValue.get,
13041
- set: function(v) {
13042
- nodeValue.set.call(this, v === null ? "" : String(v));
13041
+ set: function(v2) {
13042
+ nodeValue.set.call(this, v2 === null ? "" : String(v2));
13043
13043
  }
13044
13044
  },
13045
13045
  clone: { value: function clone() {
@@ -13242,11 +13242,11 @@ var require_TreeWalker = __commonJS((exports, module) => {
13242
13242
  get: function currentNode() {
13243
13243
  return this._currentNode;
13244
13244
  },
13245
- set: function setCurrentNode(v) {
13246
- if (!(v instanceof Node)) {
13245
+ set: function setCurrentNode(v2) {
13246
+ if (!(v2 instanceof Node)) {
13247
13247
  throw new TypeError("Not a Node");
13248
13248
  }
13249
- this._currentNode = v;
13249
+ this._currentNode = v2;
13250
13250
  }
13251
13251
  },
13252
13252
  _internalFilter: { value: function _internalFilter(node) {
@@ -13764,8 +13764,8 @@ var require_style_parser = __commonJS((exports) => {
13764
13764
  }
13765
13765
  exports.parse = parse;
13766
13766
  function hyphenate(value) {
13767
- return value.replace(/[a-z][A-Z]/g, (v) => {
13768
- return v.charAt(0) + "-" + v.charAt(1);
13767
+ return value.replace(/[a-z][A-Z]/g, (v2) => {
13768
+ return v2.charAt(0) + "-" + v2.charAt(1);
13769
13769
  }).toLowerCase();
13770
13770
  }
13771
13771
  exports.hyphenate = hyphenate;
@@ -13964,14 +13964,14 @@ var require_URLUtils = __commonJS((exports, module) => {
13964
13964
  else
13965
13965
  return ":";
13966
13966
  },
13967
- set: function(v) {
13967
+ set: function(v2) {
13968
13968
  var output = this.href;
13969
13969
  var url = new URL2(output);
13970
13970
  if (url.isAbsolute()) {
13971
- v = v.replace(/:+$/, "");
13972
- v = v.replace(/[^-+\.a-zA-Z0-9]/g, URL2.percentEncode);
13973
- if (v.length > 0) {
13974
- url.scheme = v;
13971
+ v2 = v2.replace(/:+$/, "");
13972
+ v2 = v2.replace(/[^-+\.a-zA-Z0-9]/g, URL2.percentEncode);
13973
+ if (v2.length > 0) {
13974
+ url.scheme = v2;
13975
13975
  output = url.toString();
13976
13976
  }
13977
13977
  }
@@ -13986,13 +13986,13 @@ var require_URLUtils = __commonJS((exports, module) => {
13986
13986
  else
13987
13987
  return "";
13988
13988
  },
13989
- set: function(v) {
13989
+ set: function(v2) {
13990
13990
  var output = this.href;
13991
13991
  var url = new URL2(output);
13992
13992
  if (url.isAbsolute() && url.isAuthorityBased()) {
13993
- v = v.replace(/[^-+\._~!$&'()*,;:=a-zA-Z0-9]/g, URL2.percentEncode);
13994
- if (v.length > 0) {
13995
- url.host = v;
13993
+ v2 = v2.replace(/[^-+\._~!$&'()*,;:=a-zA-Z0-9]/g, URL2.percentEncode);
13994
+ if (v2.length > 0) {
13995
+ url.host = v2;
13996
13996
  delete url.port;
13997
13997
  output = url.toString();
13998
13998
  }
@@ -14008,14 +14008,14 @@ var require_URLUtils = __commonJS((exports, module) => {
14008
14008
  else
14009
14009
  return "";
14010
14010
  },
14011
- set: function(v) {
14011
+ set: function(v2) {
14012
14012
  var output = this.href;
14013
14013
  var url = new URL2(output);
14014
14014
  if (url.isAbsolute() && url.isAuthorityBased()) {
14015
- v = v.replace(/^\/+/, "");
14016
- v = v.replace(/[^-+\._~!$&'()*,;:=a-zA-Z0-9]/g, URL2.percentEncode);
14017
- if (v.length > 0) {
14018
- url.host = v;
14015
+ v2 = v2.replace(/^\/+/, "");
14016
+ v2 = v2.replace(/[^-+\._~!$&'()*,;:=a-zA-Z0-9]/g, URL2.percentEncode);
14017
+ if (v2.length > 0) {
14018
+ url.host = v2;
14019
14019
  output = url.toString();
14020
14020
  }
14021
14021
  }
@@ -14030,17 +14030,17 @@ var require_URLUtils = __commonJS((exports, module) => {
14030
14030
  else
14031
14031
  return "";
14032
14032
  },
14033
- set: function(v) {
14033
+ set: function(v2) {
14034
14034
  var output = this.href;
14035
14035
  var url = new URL2(output);
14036
14036
  if (url.isAbsolute() && url.isAuthorityBased()) {
14037
- v = "" + v;
14038
- v = v.replace(/[^0-9].*$/, "");
14039
- v = v.replace(/^0+/, "");
14040
- if (v.length === 0)
14041
- v = "0";
14042
- if (parseInt(v, 10) <= 65535) {
14043
- url.port = v;
14037
+ v2 = "" + v2;
14038
+ v2 = v2.replace(/[^0-9].*$/, "");
14039
+ v2 = v2.replace(/^0+/, "");
14040
+ if (v2.length === 0)
14041
+ v2 = "0";
14042
+ if (parseInt(v2, 10) <= 65535) {
14043
+ url.port = v2;
14044
14044
  output = url.toString();
14045
14045
  }
14046
14046
  }
@@ -14055,14 +14055,14 @@ var require_URLUtils = __commonJS((exports, module) => {
14055
14055
  else
14056
14056
  return "";
14057
14057
  },
14058
- set: function(v) {
14058
+ set: function(v2) {
14059
14059
  var output = this.href;
14060
14060
  var url = new URL2(output);
14061
14061
  if (url.isAbsolute() && url.isHierarchical()) {
14062
- if (v.charAt(0) !== "/")
14063
- v = "/" + v;
14064
- v = v.replace(/[^-+\._~!$&'()*,;:=@\/a-zA-Z0-9]/g, URL2.percentEncode);
14065
- url.path = v;
14062
+ if (v2.charAt(0) !== "/")
14063
+ v2 = "/" + v2;
14064
+ v2 = v2.replace(/[^-+\._~!$&'()*,;:=@\/a-zA-Z0-9]/g, URL2.percentEncode);
14065
+ url.path = v2;
14066
14066
  output = url.toString();
14067
14067
  }
14068
14068
  this.href = output;
@@ -14076,14 +14076,14 @@ var require_URLUtils = __commonJS((exports, module) => {
14076
14076
  else
14077
14077
  return "";
14078
14078
  },
14079
- set: function(v) {
14079
+ set: function(v2) {
14080
14080
  var output = this.href;
14081
14081
  var url = new URL2(output);
14082
14082
  if (url.isAbsolute() && url.isHierarchical()) {
14083
- if (v.charAt(0) === "?")
14084
- v = v.substring(1);
14085
- v = v.replace(/[^-+\._~!$&'()*,;:=@\/?a-zA-Z0-9]/g, URL2.percentEncode);
14086
- url.query = v;
14083
+ if (v2.charAt(0) === "?")
14084
+ v2 = v2.substring(1);
14085
+ v2 = v2.replace(/[^-+\._~!$&'()*,;:=@\/?a-zA-Z0-9]/g, URL2.percentEncode);
14086
+ url.query = v2;
14087
14087
  output = url.toString();
14088
14088
  }
14089
14089
  this.href = output;
@@ -14098,13 +14098,13 @@ var require_URLUtils = __commonJS((exports, module) => {
14098
14098
  return "#" + url.fragment;
14099
14099
  }
14100
14100
  },
14101
- set: function(v) {
14101
+ set: function(v2) {
14102
14102
  var output = this.href;
14103
14103
  var url = new URL2(output);
14104
- if (v.charAt(0) === "#")
14105
- v = v.substring(1);
14106
- v = v.replace(/[^-+\._~!$&'()*,;:=@\/?a-zA-Z0-9]/g, URL2.percentEncode);
14107
- url.fragment = v;
14104
+ if (v2.charAt(0) === "#")
14105
+ v2 = v2.substring(1);
14106
+ v2 = v2.replace(/[^-+\._~!$&'()*,;:=@\/?a-zA-Z0-9]/g, URL2.percentEncode);
14107
+ url.fragment = v2;
14108
14108
  output = url.toString();
14109
14109
  this.href = output;
14110
14110
  }
@@ -14114,12 +14114,12 @@ var require_URLUtils = __commonJS((exports, module) => {
14114
14114
  var url = this._url;
14115
14115
  return url.username || "";
14116
14116
  },
14117
- set: function(v) {
14117
+ set: function(v2) {
14118
14118
  var output = this.href;
14119
14119
  var url = new URL2(output);
14120
14120
  if (url.isAbsolute()) {
14121
- v = v.replace(/[\x00-\x1F\x7F-\uFFFF "#<>?`\/@\\:]/g, URL2.percentEncode);
14122
- url.username = v;
14121
+ v2 = v2.replace(/[\x00-\x1F\x7F-\uFFFF "#<>?`\/@\\:]/g, URL2.percentEncode);
14122
+ url.username = v2;
14123
14123
  output = url.toString();
14124
14124
  }
14125
14125
  this.href = output;
@@ -14130,15 +14130,15 @@ var require_URLUtils = __commonJS((exports, module) => {
14130
14130
  var url = this._url;
14131
14131
  return url.password || "";
14132
14132
  },
14133
- set: function(v) {
14133
+ set: function(v2) {
14134
14134
  var output = this.href;
14135
14135
  var url = new URL2(output);
14136
14136
  if (url.isAbsolute()) {
14137
- if (v === "") {
14137
+ if (v2 === "") {
14138
14138
  url.password = null;
14139
14139
  } else {
14140
- v = v.replace(/[\x00-\x1F\x7F-\uFFFF "#<>?`\/@\\]/g, URL2.percentEncode);
14141
- url.password = v;
14140
+ v2 = v2.replace(/[\x00-\x1F\x7F-\uFFFF "#<>?`\/@\\]/g, URL2.percentEncode);
14141
+ url.password = v2;
14142
14142
  }
14143
14143
  output = url.toString();
14144
14144
  }
@@ -14234,8 +14234,8 @@ var require_defineElement = __commonJS((exports, module) => {
14234
14234
  get: function() {
14235
14235
  return this._getEventHandler(type);
14236
14236
  },
14237
- set: function(v) {
14238
- this._setEventHandler(type, v);
14237
+ set: function(v2) {
14238
+ this._setEventHandler(type, v2);
14239
14239
  }
14240
14240
  });
14241
14241
  attributes.registerChangeHandler(c, "on" + type, EventHandlerChangeHandler);
@@ -14263,12 +14263,12 @@ var require_htmlelts = __commonJS((exports) => {
14263
14263
  function URL2(attr) {
14264
14264
  return {
14265
14265
  get: function() {
14266
- var v = this._getattr(attr);
14267
- if (v === null) {
14266
+ var v2 = this._getattr(attr);
14267
+ if (v2 === null) {
14268
14268
  return "";
14269
14269
  }
14270
- var url = this.doc._resolve(v);
14271
- return url === null ? v : url;
14270
+ var url = this.doc._resolve(v2);
14271
+ return url === null ? v2 : url;
14272
14272
  },
14273
14273
  set: function(value) {
14274
14274
  this._setattr(attr, value);
@@ -14278,11 +14278,11 @@ var require_htmlelts = __commonJS((exports) => {
14278
14278
  function CORS(attr) {
14279
14279
  return {
14280
14280
  get: function() {
14281
- var v = this._getattr(attr);
14282
- if (v === null) {
14281
+ var v2 = this._getattr(attr);
14282
+ if (v2 === null) {
14283
14283
  return null;
14284
14284
  }
14285
- if (v.toLowerCase() === "use-credentials") {
14285
+ if (v2.toLowerCase() === "use-credentials") {
14286
14286
  return "use-credentials";
14287
14287
  }
14288
14288
  return "anonymous";
@@ -14321,17 +14321,17 @@ var require_htmlelts = __commonJS((exports) => {
14321
14321
  },
14322
14322
  props: {
14323
14323
  dangerouslySetInnerHTML: {
14324
- set: function(v) {
14325
- this._innerHTML = v;
14324
+ set: function(v2) {
14325
+ this._innerHTML = v2;
14326
14326
  }
14327
14327
  },
14328
14328
  innerHTML: {
14329
14329
  get: function() {
14330
14330
  return this.serialize();
14331
14331
  },
14332
- set: function(v) {
14332
+ set: function(v2) {
14333
14333
  var parser2 = this.ownerDocument.implementation.mozHTMLParser(this.ownerDocument._address, this);
14334
- parser2.parse(v === null ? "" : String(v), true);
14334
+ parser2.parse(v2 === null ? "" : String(v2), true);
14335
14335
  var target = this instanceof htmlNameToImpl.template ? this.content : this;
14336
14336
  while (target.hasChildNodes())
14337
14337
  target.removeChild(target.firstChild);
@@ -14342,11 +14342,11 @@ var require_htmlelts = __commonJS((exports) => {
14342
14342
  if (!this._style)
14343
14343
  this._style = new CSSStyleDeclaration(this);
14344
14344
  return this._style;
14345
- }, set: function(v) {
14346
- if (v === null || v === undefined) {
14347
- v = "";
14345
+ }, set: function(v2) {
14346
+ if (v2 === null || v2 === undefined) {
14347
+ v2 = "";
14348
14348
  }
14349
- this._setattr("style", String(v));
14349
+ this._setattr("style", String(v2));
14350
14350
  } },
14351
14351
  blur: { value: function() {} },
14352
14352
  focus: { value: function() {} },
@@ -15074,16 +15074,16 @@ var require_htmlelts = __commonJS((exports) => {
15074
15074
  get: function() {
15075
15075
  return this._getattr("value") || this.text;
15076
15076
  },
15077
- set: function(v) {
15078
- this._setattr("value", v);
15077
+ set: function(v2) {
15078
+ this._setattr("value", v2);
15079
15079
  }
15080
15080
  },
15081
15081
  text: {
15082
15082
  get: function() {
15083
15083
  return this.textContent.replace(/[ \t\n\f\r]+/g, " ").trim();
15084
15084
  },
15085
- set: function(v) {
15086
- this.textContent = v;
15085
+ set: function(v2) {
15086
+ this.textContent = v2;
15087
15087
  }
15088
15088
  }
15089
15089
  },
@@ -15374,16 +15374,16 @@ var require_htmlelts = __commonJS((exports) => {
15374
15374
  get: function() {
15375
15375
  return this.textContent;
15376
15376
  },
15377
- set: function(v) {
15378
- this.textContent = v;
15377
+ set: function(v2) {
15378
+ this.textContent = v2;
15379
15379
  }
15380
15380
  },
15381
15381
  value: {
15382
15382
  get: function() {
15383
15383
  return this.defaultValue;
15384
15384
  },
15385
- set: function(v) {
15386
- this.defaultValue = v;
15385
+ set: function(v2) {
15386
+ this.defaultValue = v2;
15387
15387
  }
15388
15388
  },
15389
15389
  textLength: { get: function() {
@@ -15568,8 +15568,8 @@ var require_htmlelts = __commonJS((exports) => {
15568
15568
  }
15569
15569
  return this._label;
15570
15570
  },
15571
- set: function(v) {
15572
- this._setattr("label", v);
15571
+ set: function(v2) {
15572
+ this._setattr("label", v2);
15573
15573
  }
15574
15574
  }
15575
15575
  },
@@ -15903,17 +15903,17 @@ var require_Document2 = __commonJS((exports, module) => {
15903
15903
  mutationevents: "mutationevent",
15904
15904
  uievents: "uievent"
15905
15905
  };
15906
- var mirrorAttr = function(f, name, defaultValue) {
15906
+ var mirrorAttr = function(f2, name, defaultValue) {
15907
15907
  return {
15908
15908
  get: function() {
15909
- var o = f.call(this);
15909
+ var o = f2.call(this);
15910
15910
  if (o) {
15911
15911
  return o[name];
15912
15912
  }
15913
15913
  return defaultValue;
15914
15914
  },
15915
15915
  set: function(value) {
15916
- var o = f.call(this);
15916
+ var o = f2.call(this);
15917
15917
  if (o) {
15918
15918
  o[name] = value;
15919
15919
  }
@@ -15998,8 +15998,8 @@ var require_Document2 = __commonJS((exports, module) => {
15998
15998
  createAttributeNS: { value: function(namespace, qualifiedName) {
15999
15999
  namespace = namespace === null || namespace === undefined || namespace === "" ? null : String(namespace);
16000
16000
  qualifiedName = String(qualifiedName);
16001
- var ve = validateAndExtract(namespace, qualifiedName);
16002
- return new Element._Attr(null, ve.localName, ve.prefix, ve.namespace, "");
16001
+ var ve2 = validateAndExtract(namespace, qualifiedName);
16002
+ return new Element._Attr(null, ve2.localName, ve2.prefix, ve2.namespace, "");
16003
16003
  } },
16004
16004
  createElement: { value: function(localName) {
16005
16005
  localName = String(localName);
@@ -16018,8 +16018,8 @@ var require_Document2 = __commonJS((exports, module) => {
16018
16018
  createElementNS: { value: function(namespace, qualifiedName) {
16019
16019
  namespace = namespace === null || namespace === undefined || namespace === "" ? null : String(namespace);
16020
16020
  qualifiedName = String(qualifiedName);
16021
- var ve = validateAndExtract(namespace, qualifiedName);
16022
- return this._createElementNS(ve.localName, ve.namespace, ve.prefix);
16021
+ var ve2 = validateAndExtract(namespace, qualifiedName);
16022
+ return this._createElementNS(ve2.localName, ve2.namespace, ve2.prefix);
16023
16023
  }, writable: isApiWritable },
16024
16024
  _createElementNS: { value: function(localName, namespace, prefix) {
16025
16025
  if (namespace === NAMESPACE.HTML) {
@@ -16459,8 +16459,8 @@ var require_Document2 = __commonJS((exports, module) => {
16459
16459
  get: function() {
16460
16460
  return this._getEventHandler(type);
16461
16461
  },
16462
- set: function(v) {
16463
- this._setEventHandler(type, v);
16462
+ set: function(v2) {
16463
+ this._setEventHandler(type, v2);
16464
16464
  }
16465
16465
  });
16466
16466
  });
@@ -19550,15 +19550,15 @@ var require_HTMLParser = __commonJS((exports, module) => {
19550
19550
  this.attrs.splice(idx, 1);
19551
19551
  }
19552
19552
  };
19553
- HTMLParser.ActiveFormattingElements.prototype.replace = function(a, b, attrs) {
19554
- var idx = this.list.lastIndexOf(a);
19553
+ HTMLParser.ActiveFormattingElements.prototype.replace = function(a3, b, attrs) {
19554
+ var idx = this.list.lastIndexOf(a3);
19555
19555
  if (idx !== -1) {
19556
19556
  this.list[idx] = b;
19557
19557
  this.attrs[idx] = attrs;
19558
19558
  }
19559
19559
  };
19560
- HTMLParser.ActiveFormattingElements.prototype.insertAfter = function(a, b) {
19561
- var idx = this.list.lastIndexOf(a);
19560
+ HTMLParser.ActiveFormattingElements.prototype.insertAfter = function(a3, b) {
19561
+ var idx = this.list.lastIndexOf(a3);
19562
19562
  if (idx !== -1) {
19563
19563
  this.list.splice(idx, 0, b);
19564
19564
  this.attrs.splice(idx, 0, b);
@@ -20140,8 +20140,8 @@ var require_HTMLParser = __commonJS((exports, module) => {
20140
20140
  var tag = node.localName;
20141
20141
  switch (tag) {
20142
20142
  case "select":
20143
- for (var j = i;j > 0; ) {
20144
- var ancestor = stack.elements[--j];
20143
+ for (var j2 = i;j2 > 0; ) {
20144
+ var ancestor = stack.elements[--j2];
20145
20145
  if (ancestor instanceof impl.HTMLTemplateElement) {
20146
20146
  break;
20147
20147
  } else if (ancestor instanceof impl.HTMLTableElement) {
@@ -24609,11 +24609,11 @@ var require_HTMLParser = __commonJS((exports, module) => {
24609
24609
  case 2:
24610
24610
  var attrs = Object.create(null);
24611
24611
  for (var i2 = 0;i2 < arg3.length; i2++) {
24612
- var a = arg3[i2];
24613
- if (a.length === 1) {
24614
- attrs[a[0]] = "";
24612
+ var a3 = arg3[i2];
24613
+ if (a3.length === 1) {
24614
+ attrs[a3[0]] = "";
24615
24615
  } else {
24616
- attrs[a[0]] = a[1];
24616
+ attrs[a3[0]] = a3[1];
24617
24617
  }
24618
24618
  }
24619
24619
  var token = ["StartTag", value, attrs];
@@ -24661,8 +24661,8 @@ var require_DOMImplementation = __commonJS((exports, module) => {
24661
24661
  };
24662
24662
  DOMImplementation.prototype = {
24663
24663
  hasFeature: function hasFeature(feature, version) {
24664
- var f = supportedFeatures[(feature || "").toLowerCase()];
24665
- return f && f[version || ""] || false;
24664
+ var f2 = supportedFeatures[(feature || "").toLowerCase()];
24665
+ return f2 && f2[version || ""] || false;
24666
24666
  },
24667
24667
  createDocumentType: function createDocumentType(qualifiedName, publicId, systemId) {
24668
24668
  if (!xml.isValidQName(qualifiedName))
@@ -24731,8 +24731,8 @@ var require_Location = __commonJS((exports, module) => {
24731
24731
  get: function() {
24732
24732
  return this._href;
24733
24733
  },
24734
- set: function(v) {
24735
- this.assign(v);
24734
+ set: function(v2) {
24735
+ this.assign(v2);
24736
24736
  }
24737
24737
  },
24738
24738
  assign: { value: function(url) {
@@ -24853,8 +24853,8 @@ var require_Window = __commonJS((exports, module) => {
24853
24853
  get: function() {
24854
24854
  return this._getEventHandler("load");
24855
24855
  },
24856
- set: function(v) {
24857
- this._setEventHandler("load", v);
24856
+ set: function(v2) {
24857
+ this._setEventHandler("load", v2);
24858
24858
  }
24859
24859
  },
24860
24860
  getComputedStyle: { value: function getComputedStyle(elt) {
@@ -26201,8 +26201,14 @@ function writeFileAtomic(target, content, mode) {
26201
26201
  try {
26202
26202
  fd = fs2.openSync(tmp, "wx", fileMode);
26203
26203
  tempOwned = true;
26204
- if (process.platform !== "win32")
26205
- fs2.fchmodSync(fd, fileMode);
26204
+ if (process.platform !== "win32") {
26205
+ try {
26206
+ fs2.fchmodSync(fd, fileMode);
26207
+ } catch (error) {
26208
+ if (!isChmodUnsupported(error))
26209
+ throw error;
26210
+ }
26211
+ }
26206
26212
  let offset = 0;
26207
26213
  while (offset < data.byteLength) {
26208
26214
  const written = fs2.writeSync(fd, data, offset, data.byteLength - offset);
@@ -26351,6 +26357,9 @@ function hasErrnoCode(error, code) {
26351
26357
  return false;
26352
26358
  return error.code === code;
26353
26359
  }
26360
+ function isChmodUnsupported(error) {
26361
+ return hasErrnoCode(error, "EPERM") || hasErrnoCode(error, "ENOTSUP") || hasErrnoCode(error, "EINVAL");
26362
+ }
26354
26363
  function isContainedRelativePath(value) {
26355
26364
  if (value === "" || value.startsWith("/") || value.startsWith("\\") || value.startsWith("~"))
26356
26365
  return false;
@@ -28965,6 +28974,9 @@ function shapeShowOutput(result, detail, shape = "human") {
28965
28974
  "steps",
28966
28975
  "keys",
28967
28976
  "links",
28977
+ "evidence",
28978
+ "evidenceSources",
28979
+ "provenance",
28968
28980
  ...FRAGMENT_PROVENANCE_FIELDS,
28969
28981
  ...FRAGMENT_CONTEXT_FIELDS
28970
28982
  ]);
@@ -28996,6 +29008,9 @@ function shapeShowOutput(result, detail, shape = "human") {
28996
29008
  "activeRun",
28997
29009
  "keys",
28998
29010
  "links",
29011
+ "evidence",
29012
+ "evidenceSources",
29013
+ "provenance",
28999
29014
  ...FRAGMENT_PROVENANCE_FIELDS,
29000
29015
  ...FRAGMENT_CONTEXT_FIELDS,
29001
29016
  "path",
@@ -29021,7 +29036,7 @@ function pickFields(source, fields) {
29021
29036
  }
29022
29037
 
29023
29038
  // src/output/shapes/curate.ts
29024
- var BRIEF_FIELDS = ["source", "type", "name", "ref", "id", "supportRefs", "followUp", "reason"];
29039
+ var BRIEF_FIELDS = ["source", "type", "name", "ref", "id", "supportRefs", "beliefState", "followUp", "reason"];
29025
29040
  var NORMAL_FIELDS = [
29026
29041
  "source",
29027
29042
  "type",
@@ -29037,6 +29052,7 @@ var NORMAL_FIELDS = [
29037
29052
  "parameters",
29038
29053
  "run",
29039
29054
  "supportRefs",
29055
+ "beliefState",
29040
29056
  "followUp",
29041
29057
  "reason",
29042
29058
  "score"
@@ -29052,6 +29068,7 @@ var AGENT_FIELDS = [
29052
29068
  "id",
29053
29069
  "description",
29054
29070
  "supportRefs",
29071
+ "beliefState",
29055
29072
  "followUp",
29056
29073
  "reason",
29057
29074
  "score"
@@ -31065,6 +31082,12 @@ function formatShowPlain(r, detail) {
31065
31082
  }
31066
31083
  if (r.description)
31067
31084
  lines.push(`description: ${String(r.description)}`);
31085
+ if (r.evidence)
31086
+ lines.push(`evidence: ${String(r.evidence).replace(/\s+/g, " ")}`);
31087
+ if (Array.isArray(r.evidenceSources))
31088
+ lines.push(`evidenceSources: ${r.evidenceSources.join(", ")}`);
31089
+ if (r.evidence && r.provenance)
31090
+ lines.push(`provenance: ${JSON.stringify(r.provenance)}`);
31068
31091
  if (r.workflowTitle)
31069
31092
  lines.push(`workflowTitle: ${String(r.workflowTitle)}`);
31070
31093
  if (r.agent)
@@ -39230,7 +39253,7 @@ function backupExistingConfig(configPath, now = new Date) {
39230
39253
  return;
39231
39254
  const backupDir = path20.join(getCacheDir(), "config-backups");
39232
39255
  fs16.mkdirSync(backupDir, { recursive: true, mode: 448 });
39233
- fs16.chmodSync(backupDir, 448);
39256
+ chmodIfSupported(backupDir, 448);
39234
39257
  const timestamp = now.toISOString().replace(/[.:]/g, "-");
39235
39258
  let sequence = 0;
39236
39259
  let timestamped;
@@ -39247,11 +39270,19 @@ function backupExistingConfig(configPath, now = new Date) {
39247
39270
  }
39248
39271
  const latest = path20.join(backupDir, "config.latest.json");
39249
39272
  fs16.copyFileSync(configPath, latest);
39250
- fs16.chmodSync(timestamped, 384);
39251
- fs16.chmodSync(latest, 384);
39273
+ chmodIfSupported(timestamped, 384);
39274
+ chmodIfSupported(latest, 384);
39252
39275
  pruneOldBackups(backupDir);
39253
39276
  return { timestamped, latest };
39254
39277
  }
39278
+ function chmodIfSupported(target, mode) {
39279
+ try {
39280
+ fs16.chmodSync(target, mode);
39281
+ } catch (error2) {
39282
+ if (!isChmodUnsupported(error2))
39283
+ throw error2;
39284
+ }
39285
+ }
39255
39286
  function pruneOldBackups(backupDir) {
39256
39287
  pruneToNewest(backupDir, MAX_CONFIG_BACKUPS, (entry) => entry.isFile() && isTimestampedConfigBackup(entry.name));
39257
39288
  }
@@ -41316,6 +41347,8 @@ function applyCuratedFrontmatter(entry, fmData) {
41316
41347
  const evidenceSources = normalizeNonEmptyStringList(fmData.evidenceSources);
41317
41348
  if (evidenceSources)
41318
41349
  entry.evidenceSources = evidenceSources;
41350
+ if (typeof fmData.evidence === "string" && fmData.evidence.trim().length > 0)
41351
+ entry.evidence = fmData.evidence;
41319
41352
  if (entry.type === "memory") {
41320
41353
  const isDerivedByName = entry.name.toLowerCase().endsWith(".derived");
41321
41354
  const isDerivedByFm = fmData.inferred === true;
@@ -46222,6 +46255,7 @@ var DOCUMENT_JSON_CARRIED_FIELDS = [
46222
46255
  "wikiRole",
46223
46256
  "sources",
46224
46257
  "evidenceSources",
46258
+ "evidence",
46225
46259
  "uses",
46226
46260
  "provenance"
46227
46261
  ];
@@ -47134,6 +47168,1488 @@ var genericFilesAdapter = {
47134
47168
  // src/core/adapter/adapters/llm-wiki-adapter.ts
47135
47169
  import fs30 from "node:fs";
47136
47170
  import path37 from "node:path";
47171
+
47172
+ // node_modules/marked/lib/marked.esm.js
47173
+ function B() {
47174
+ return { async: false, breaks: false, extensions: null, gfm: true, hooks: null, pedantic: false, renderer: null, silent: false, tokenizer: null, walkTokens: null };
47175
+ }
47176
+ var y = B();
47177
+ function V(a) {
47178
+ y = a;
47179
+ }
47180
+ var M = { exec: () => null };
47181
+ function D(a) {
47182
+ let e = [];
47183
+ return (t) => {
47184
+ let n = Math.max(0, Math.min(3, t - 1)), i = e[n];
47185
+ return i || (i = a(n), e[n] = i), i;
47186
+ };
47187
+ }
47188
+ function h(a, e = "") {
47189
+ let t = typeof a == "string" ? a : a.source, n = { replace: (i, r) => {
47190
+ let o = typeof r == "string" ? r : r.source;
47191
+ return o = o.replace(x.caret, "$1"), t = t.replace(i, o), n;
47192
+ }, getRegex: () => new RegExp(t, e) };
47193
+ return n;
47194
+ }
47195
+ var ze = ((a = "") => {
47196
+ try {
47197
+ return !!new RegExp("(?<=1)(?<!1)" + a);
47198
+ } catch {
47199
+ return false;
47200
+ }
47201
+ })();
47202
+ var x = { codeRemoveIndent: /^(?: {0,3}\t| {1,4})/gm, outputLinkReplace: /\\([\[\]])/g, indentCodeCompensation: /^(\s+)(?:```)/, beginningSpace: /^\s+/, endingHash: /#$/, startingSpaceChar: /^ /, endingSpaceChar: / $/, endingSpaceTabChar: /[ \t]$/, nonSpaceChar: /[^ ]/, newLineCharGlobal: /\n/g, tabCharGlobal: /\t/g, leadingSpaceTab: /^[ \t]+/, multipleSpaceGlobal: /\s+/g, blankLine: /^[ \t]*$/, doubleBlankLine: /\n[ \t]*\n[ \t]*$/, blockquoteStart: /^ {0,3}>/, blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g, blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm, listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g, listIsTask: /^\[[ xX]\] +\S/, listReplaceTask: /^\[[ xX]\] +/, listTaskCheckbox: /\[[ xX]\]/, anyLine: /\n.*\n/, hrefBrackets: /^<(.*)>$/, tableDelimiter: /[:|]/, tableAlignChars: /^\||\| *$/g, tableRowBlankLine: /\n[ \t]*$/, tableAlignRight: /^ *-+: *$/, tableAlignCenter: /^ *:-+: *$/, tableAlignLeft: /^ *:-+ *$/, startATag: /^<a /i, endATag: /^<\/a>/i, startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i, endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i, startAngleBracket: /^</, endAngleBracket: />$/, pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/, unicodeAlphaNumeric: /[\p{L}\p{N}]/u, numericCharacterReference: /&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/, numericCharacterReferenceOrAmpersand: /&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g, escapeTest: /[&<>"']/, escapeReplace: /[&<>"']/g, escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g, caret: /(^|[^\[])\^/g, percentDecode: /%25/g, findPipe: /\|/g, splitPipe: / \|/, slashPipe: /\\\|/g, carriageReturn: /\r\n|\r/g, spaceLine: /^ +$/gm, notSpaceStart: /^\S*/, endingNewline: /\n$/, listItemRegex: (a) => new RegExp(`^( {0,3}${a})((?:[ ][^\\n]*)?(?:\\n|$))`), nextBulletRegex: D((a) => new RegExp(`^ {0,${a}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)), hrRegex: D((a) => new RegExp(`^ {0,${a}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)), fencesBeginRegex: D((a) => new RegExp(`^ {0,${a}}(?:\`\`\`|~~~)`)), headingBeginRegex: D((a) => new RegExp(`^ {0,${a}}#`)), htmlBeginRegex: D((a) => new RegExp(`^ {0,${a}}(?:</?(?:${Q})(?: +|$|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`, "i")), blockquoteBeginRegex: D((a) => new RegExp(`^ {0,${a}}>`)) };
47203
+ var Ee = /^(?:[ \t]*(?:\n|$))+/;
47204
+ var Me = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/;
47205
+ var Ce = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/;
47206
+ var N = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/;
47207
+ var Ie = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/;
47208
+ var Y = / {0,3}(?:[*+-]|\d{1,9}[.)])/;
47209
+ var fe = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/;
47210
+ var me = h(fe).replace(/bull/g, Y).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}(?:\s|$)/).replace(/hr/g, / {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex();
47211
+ var Be = h(fe).replace(/bull/g, Y).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}(?:\s|$)/).replace(/hr/g, / {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex();
47212
+ var ee = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/;
47213
+ var De = /^[^\n]+/;
47214
+ var te = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/;
47215
+ var qe = h(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", te).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex();
47216
+ var Ze = h(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g, Y).getRegex();
47217
+ var Q = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";
47218
+ var ne = /<!--(?:-?>|[\s\S]*?(?:-->|$))/;
47219
+ var ve = h("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|<(?!(?:script|pre|style|textarea)(?![a-z0-9-]))([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|</[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$))", "i").replace("comment", ne).replace("tag", Q).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();
47220
+ var xe = (a) => h(ee).replace("hr", N).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", a).replace("html", " {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag", Q).getRegex();
47221
+ var He = xe(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/);
47222
+ var Ge = xe(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/);
47223
+ var Ne = h(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", Ge).getRegex();
47224
+ var re = { blockquote: Ne, code: Me, def: qe, fences: Ce, heading: Ie, hr: N, html: ve, lheading: me, list: Ze, newline: Ee, paragraph: He, table: M, text: De };
47225
+ var de = h("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", N).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3}\t)[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", " {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag", Q).getRegex();
47226
+ var Qe = { ...re, lheading: Be, table: de, paragraph: h(ee).replace("hr", N).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", de).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html", " {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag", Q).getRegex() };
47227
+ var je = { ...re, html: h(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", ne).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(), def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/, heading: /^(#{1,6})(.*)(?:\n+|$)/, fences: M, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: h(ee).replace("hr", N).replace("heading", ` *#{1,6} *[^
47228
+ ]`).replace("lheading", me).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() };
47229
+ var Fe = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/;
47230
+ var Ue = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/;
47231
+ var be = /^( {2,}|\\)\n(?!\s*$)[ \t]*/;
47232
+ var Ke = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/;
47233
+ var S = /[\p{P}\p{S}]/u;
47234
+ var q = /[\s\p{P}\p{S}]/u;
47235
+ var j = /[^\s\p{P}\p{S}]/u;
47236
+ var Xe = h(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, q).getRegex();
47237
+ var We = /[\p{Pi}\p{Ps}"']/u;
47238
+ var Re = /(?!~)[\p{P}\p{S}]/u;
47239
+ var Ve = /(?!~)[\s\p{P}\p{S}]/u;
47240
+ var Je = /(?:[^\s\p{P}\p{S}]|~)/u;
47241
+ var Ye = h(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", ze ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex();
47242
+ var Te = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/;
47243
+ var et = h(Te, "u").replace(/punct/g, S).getRegex();
47244
+ var tt = h(Te, "u").replace(/punct/g, Re).getRegex();
47245
+ var nt = /^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/;
47246
+ var rt = h(nt, "u").replace(/openQuote/g, We).replace(/punct/g, S).getRegex();
47247
+ var Oe = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)";
47248
+ var st = h(Oe, "gu").replace(/notPunctSpace/g, j).replace(/punctSpace/g, q).replace(/punct/g, S).getRegex();
47249
+ var it = h(Oe, "gu").replace(/notPunctSpace/g, Je).replace(/punctSpace/g, Ve).replace(/punct/g, Re).getRegex();
47250
+ var ot = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)";
47251
+ var at = h(ot, "gu").replace(/notPunctSpace/g, j).replace(/punctSpace/g, q).replace(/punct/g, S).getRegex();
47252
+ var lt = h("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, j).replace(/punctSpace/g, q).replace(/punct/g, S).getRegex();
47253
+ var ut = "^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)";
47254
+ var pt = h(ut, "gu").replace(/notPunctSpace/g, j).replace(/punctSpace/g, q).replace(/punct/g, S).getRegex();
47255
+ var ct = h(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, S).getRegex();
47256
+ var ht = "^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)";
47257
+ var dt = h(ht, "gu").replace(/notPunctSpace/g, j).replace(/punctSpace/g, q).replace(/punct/g, S).getRegex();
47258
+ var kt = h(/\\(punct)/, "gu").replace(/punct/g, S).getRegex();
47259
+ var gt = h(/(`+)(?:[^`]|[^`][\s\S]*?[^`])\1(?!`)|`+|\\(punct)/, "gu").replace(/punct/g, S).getRegex();
47260
+ var ft = h(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex();
47261
+ var mt = h(ne).replace("(?:-->|$)", "-->").getRegex();
47262
+ var xt = h("^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", mt).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex();
47263
+ var we = /\[(?:\\[\s\S]|[^\[\]\\])*\]/;
47264
+ var K = h(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets", we).getRegex();
47265
+ var bt = h(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace("label", K).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex();
47266
+ var Rt = h(/^!?\[(label)\]\[(ref)\]/).replace("label", K).replace("ref", te).getRegex();
47267
+ var Tt = h(/^!?\[(ref)\](?:\[\])?/).replace("ref", te).getRegex();
47268
+ var ke = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/;
47269
+ var Ot = h(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets", we).getRegex();
47270
+ var wt = h("reflink|nolink(?!\\()", "g").replace("reflink", h(/^!?\[(label)\]\[(ref)\]/).replace("label", Ot).replace("ref", ke).getRegex()).replace("nolink", h(/^!?\[(ref)\](?:\[\])?/).replace("ref", ke).getRegex()).getRegex();
47271
+ var ge = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/;
47272
+ var Pt = /[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/;
47273
+ var yt = h(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g, Pt).getRegex();
47274
+ var se = { _backpedal: M, anyPunctuation: kt, anyPunctuationOutsideCode: gt, autolink: ft, blockSkip: Ye, br: be, code: Ue, del: M, delLDelim: M, delRDelim: M, emStrongLDelim: et, emStrongRDelimAst: st, emStrongRDelimUnd: lt, escape: Fe, link: bt, nolink: Tt, punctuation: Xe, reflink: Rt, reflinkSearch: wt, tag: xt, text: Ke, url: M };
47275
+ var St = { ...se, emStrongLDelim: rt, emStrongRDelimAst: at, emStrongRDelimUnd: pt, link: h(/^!?\[(label)\]\((.*?)\)/).replace("label", K).getRegex(), reflink: h(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", K).getRegex() };
47276
+ var J = { ...se, emStrongRDelimAst: it, emStrongLDelim: tt, delLDelim: ct, delRDelim: dt, url: h(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol", yt).replace("protocol", ge).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(), _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/, del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/, text: h(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace("protocol", ge).replace(/emailProtocol/g, /(?:mailto|xmpp):/).getRegex() };
47277
+ var _t = { ...J, br: h(be).replace("{2,}", "*").getRegex(), text: h(J.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() };
47278
+ var F = { normal: re, gfm: Qe, pedantic: je };
47279
+ var Z = { normal: se, gfm: J, breaks: _t, pedantic: St };
47280
+ var $t = { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" };
47281
+ var Pe = (a) => $t[a];
47282
+ function w(a, e) {
47283
+ if (e) {
47284
+ if (x.escapeTest.test(a))
47285
+ return a.replace(x.escapeReplace, Pe);
47286
+ } else if (x.escapeTestNoEncode.test(a))
47287
+ return a.replace(x.escapeReplaceNoEncode, Pe);
47288
+ return a;
47289
+ }
47290
+ function ye(a) {
47291
+ return x.numericCharacterReference.test(a) ? a.replace(x.numericCharacterReferenceOrAmpersand, (e, t, n) => {
47292
+ if (t === undefined && n === undefined)
47293
+ return "&amp;";
47294
+ let i = t === undefined ? Number.parseInt(n, 16) : Number.parseInt(t, 10);
47295
+ return i === 0 || i > 1114111 || i >= 55296 && i <= 57343 ? "�" : i === 38 ? "&amp;" : String.fromCodePoint(i);
47296
+ }) : a;
47297
+ }
47298
+ function ie(a) {
47299
+ try {
47300
+ a = encodeURI(a).replace(x.percentDecode, "%");
47301
+ } catch {
47302
+ return null;
47303
+ }
47304
+ return a;
47305
+ }
47306
+ function oe(a, e) {
47307
+ let t = a.replace(x.findPipe, (r, o, s) => {
47308
+ let l = false, u = o;
47309
+ for (;--u >= 0 && s[u] === "\\"; )
47310
+ l = !l;
47311
+ return l ? "|" : " |";
47312
+ }), n = t.split(x.splitPipe), i = 0;
47313
+ if (n[0].trim() || n.shift(), n.length > 0 && !n.at(-1)?.trim() && n.pop(), e)
47314
+ if (n.length > e)
47315
+ n.splice(e);
47316
+ else
47317
+ for (;n.length < e; )
47318
+ n.push("");
47319
+ for (;i < n.length; i++)
47320
+ n[i] = n[i].trim().replace(x.slashPipe, "|");
47321
+ return n;
47322
+ }
47323
+ function A(a, e, t) {
47324
+ let n = a.length;
47325
+ if (n === 0)
47326
+ return "";
47327
+ let i = 0;
47328
+ for (;i < n; ) {
47329
+ let r = a.charAt(n - i - 1);
47330
+ if (r === e && !t)
47331
+ i++;
47332
+ else if (r !== e && t)
47333
+ i++;
47334
+ else
47335
+ break;
47336
+ }
47337
+ return a.slice(0, n - i);
47338
+ }
47339
+ function ae(a) {
47340
+ let e = a.split(`
47341
+ `), t = e.length - 1;
47342
+ for (;t >= 0 && x.blankLine.test(e[t]); )
47343
+ t--;
47344
+ return e.length - t <= 2 ? a : e.slice(0, t + 1).join(`
47345
+ `);
47346
+ }
47347
+ function v(a) {
47348
+ return a.trim().toLowerCase().toUpperCase().toLowerCase();
47349
+ }
47350
+ function le(a, e) {
47351
+ if (a.indexOf(e[0]) === -1 && a.indexOf(e[1]) === -1)
47352
+ return -1;
47353
+ let t = 0;
47354
+ for (let n = 0;n < a.length; n++)
47355
+ if (a[n] === "\\")
47356
+ n++;
47357
+ else if (a[n] === e[0])
47358
+ t++;
47359
+ else if (a[n] === e[1] && (t--, t < 0))
47360
+ return n;
47361
+ return t > 0 ? -2 : -1;
47362
+ }
47363
+ function X(a, e = 0) {
47364
+ let t = e, n = "";
47365
+ for (let i of a)
47366
+ if (i === "\t") {
47367
+ let r = 4 - t % 4;
47368
+ n += " ".repeat(r), t += r;
47369
+ } else
47370
+ n += i, t++;
47371
+ return n;
47372
+ }
47373
+ function Se(a, e, t, n, i) {
47374
+ let r = e.href, o = e.title || null, s = a[1].replace(i.other.outputLinkReplace, "$1"), l = a[0].charAt(0) === "!", u = n.state.inLink, c = n.state.linkEmitted, p = n.state.inRawBlock;
47375
+ n.state.inLink = true, n.state.linkEmitted = false;
47376
+ let d = n.inlineTokens(s), g = n.state.linkEmitted;
47377
+ if (n.state.linkEmitted = c, n.state.inLink = u, !l) {
47378
+ if (g) {
47379
+ n.state.inRawBlock = p;
47380
+ return;
47381
+ }
47382
+ n.state.linkEmitted = true;
47383
+ }
47384
+ return { type: l ? "image" : "link", raw: t, href: r, title: o, text: s, tokens: d };
47385
+ }
47386
+ function Lt(a, e, t) {
47387
+ let n = a.match(t.other.indentCodeCompensation);
47388
+ if (n === null)
47389
+ return e;
47390
+ let i = n[1];
47391
+ return e.split(`
47392
+ `).map((r) => {
47393
+ let o = r.match(t.other.beginningSpace);
47394
+ if (o === null)
47395
+ return r;
47396
+ let [s] = o;
47397
+ return r.slice(Math.min(s.length, i.length));
47398
+ }).join(`
47399
+ `);
47400
+ }
47401
+ function _e(a, e, t, n) {
47402
+ if (!e.includes("<"))
47403
+ return false;
47404
+ for (let i = 0;i < e.length; i++) {
47405
+ if (e[i] === "\\") {
47406
+ i++;
47407
+ continue;
47408
+ }
47409
+ if (e[i] === "`") {
47410
+ let s = n.inline.code.exec(e.slice(i));
47411
+ if (s) {
47412
+ i += s[0].length - 1;
47413
+ continue;
47414
+ }
47415
+ }
47416
+ if (e[i] !== "<")
47417
+ continue;
47418
+ let r = a.slice(t + i), o = n.inline.tag.exec(r) || n.inline.autolink.exec(r);
47419
+ if (o) {
47420
+ if (o[0].length > e.length - i)
47421
+ return true;
47422
+ i += o[0].length - 1;
47423
+ }
47424
+ }
47425
+ return false;
47426
+ }
47427
+ var _ = class {
47428
+ options;
47429
+ rules;
47430
+ lexer;
47431
+ constructor(e) {
47432
+ this.options = e || y;
47433
+ }
47434
+ space(e) {
47435
+ let t = this.rules.block.newline.exec(e);
47436
+ if (t && t[0].length > 0)
47437
+ return { type: "space", raw: t[0] };
47438
+ }
47439
+ code(e) {
47440
+ let t = this.rules.block.code.exec(e);
47441
+ if (t) {
47442
+ let n = this.options.pedantic ? t[0] : ae(t[0]), i = n.replace(this.rules.other.codeRemoveIndent, "");
47443
+ return { type: "code", raw: n, codeBlockStyle: "indented", text: i };
47444
+ }
47445
+ }
47446
+ fences(e) {
47447
+ let t = this.rules.block.fences.exec(e);
47448
+ if (t) {
47449
+ let n = t[0], i = Lt(n, t[3] || "", this.rules);
47450
+ return { type: "code", raw: n, lang: t[2] ? t[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : t[2], text: i };
47451
+ }
47452
+ }
47453
+ heading(e) {
47454
+ let t = this.rules.block.heading.exec(e);
47455
+ if (t) {
47456
+ let n = t[2].trim();
47457
+ if (this.rules.other.endingHash.test(n)) {
47458
+ let i = A(n, "#");
47459
+ (this.options.pedantic || !i || this.rules.other.endingSpaceTabChar.test(i)) && (n = i.trim());
47460
+ }
47461
+ return { type: "heading", raw: A(t[0], `
47462
+ `), depth: t[1].length, text: n, tokens: this.lexer.inline(n) };
47463
+ }
47464
+ }
47465
+ hr(e) {
47466
+ let t = this.rules.block.hr.exec(e);
47467
+ if (t)
47468
+ return { type: "hr", raw: A(t[0], `
47469
+ `) };
47470
+ }
47471
+ blockquote(e) {
47472
+ let t = this.rules.block.blockquote.exec(e);
47473
+ if (t) {
47474
+ let n = A(t[0], `
47475
+ `).split(`
47476
+ `), i = "", r = "", o = [];
47477
+ for (;n.length > 0; ) {
47478
+ let s = false, l = [], u;
47479
+ for (u = 0;u < n.length; u++)
47480
+ if (this.rules.other.blockquoteStart.test(n[u]))
47481
+ l.push(n[u]), s = true;
47482
+ else if (!s)
47483
+ l.push(n[u]);
47484
+ else
47485
+ break;
47486
+ n = n.slice(u);
47487
+ let c = l.join(`
47488
+ `), p = c.replace(this.rules.other.blockquoteSetextReplace, `
47489
+ $1`).replace(this.rules.other.blockquoteSetextReplace2, "");
47490
+ i = i ? `${i}
47491
+ ${c}` : c, r = r ? `${r}
47492
+ ${p}` : p;
47493
+ let d = this.lexer.state.top;
47494
+ if (this.lexer.state.top = true, this.lexer.blockTokens(p, o, true), this.lexer.state.top = d, n.length === 0)
47495
+ break;
47496
+ let g = o.at(-1);
47497
+ if (g?.type === "code" || g?.type === "heading" || g?.type === "hr" || g?.type === "html")
47498
+ break;
47499
+ if (g?.type === "blockquote") {
47500
+ let k = g, P = n.join(`
47501
+ `), R = k.raw + `
47502
+ ` + P.replace(this.rules.other.blockquoteSetextReplace2, ""), m = this.blockquote(R);
47503
+ o[o.length - 1] = m;
47504
+ let E = R.substring(m.raw.length).replace(/^\n/, ""), b = E ? E.split(`
47505
+ `).length : 0, H = b ? n.slice(0, -b) : n;
47506
+ H.length > 0 && (i = `${i}
47507
+ ${H.join(`
47508
+ `)}`), r = r.substring(0, r.length - k.text.length) + m.text;
47509
+ break;
47510
+ } else if (g?.type === "list") {
47511
+ let k = g, P = k.raw + `
47512
+ ` + n.join(`
47513
+ `), R = this.list(P);
47514
+ o[o.length - 1] = R, i = i.substring(0, i.length - g.raw.length) + R.raw, r = r.substring(0, r.length - k.raw.length) + R.raw, n = P.substring(o.at(-1).raw.length).split(`
47515
+ `);
47516
+ continue;
47517
+ }
47518
+ }
47519
+ return { type: "blockquote", raw: i, tokens: o, text: r };
47520
+ }
47521
+ }
47522
+ list(e) {
47523
+ let t = this.rules.block.list.exec(e);
47524
+ if (t) {
47525
+ let n = e, i = () => n.length - e.length, r = t[1].trim(), o = r.length > 1, s = { type: "list", raw: "", ordered: o, start: o ? +r.slice(0, -1) : "", loose: false, items: [] };
47526
+ r = o ? `\\d{1,9}\\${r.slice(-1)}` : `\\${r}`, this.options.pedantic && (r = o ? r : "[*+-]");
47527
+ let l = this.rules.other.listItemRegex(r), u = false;
47528
+ for (;e; ) {
47529
+ let p = false, d = "";
47530
+ if (!(t = l.exec(e)) || this.rules.block.hr.test(e))
47531
+ break;
47532
+ let g = i();
47533
+ e = e.substring(t[0].length);
47534
+ let k = t[2].split(`
47535
+ `, 1)[0], P = t[1].length, R = this.options.pedantic ? X(k, P) : k.replace(this.rules.other.leadingSpaceTab, (W) => X(W, P)), m = e.split(`
47536
+ `, 1)[0], E = !R.trim(), b = 0;
47537
+ if (this.options.pedantic ? (b = 2, d = R.trimStart()) : E ? b = P + 1 : (b = R.search(this.rules.other.nonSpaceChar), b = b > 4 ? 1 : b, d = R.slice(b), b += P), E && this.rules.other.blankLine.test(m) && (e = e.substring(m.length + 1), p = true), !p) {
47538
+ let W = this.rules.other.nextBulletRegex(b), ue = this.rules.other.hrRegex(b), pe = this.rules.other.fencesBeginRegex(b), ce = this.rules.other.headingBeginRegex(b), $e = this.rules.other.htmlBeginRegex(b), Le = this.rules.other.blockquoteBeginRegex(b);
47539
+ for (;e; ) {
47540
+ let he = e.split(`
47541
+ `, 1)[0], G;
47542
+ if (m = he, this.options.pedantic ? (m = m.replace(this.rules.other.listReplaceNesting, " "), G = m) : G = m.replace(this.rules.other.leadingSpaceTab, (Ae) => X(Ae)), pe.test(m) || ce.test(m) || $e.test(m) || Le.test(m) || W.test(m) || ue.test(m))
47543
+ break;
47544
+ if (G.search(this.rules.other.nonSpaceChar) >= b || !m.trim())
47545
+ d += `
47546
+ ` + G.slice(b);
47547
+ else {
47548
+ if (E || R.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || pe.test(R) || ce.test(R) || ue.test(R))
47549
+ break;
47550
+ d += `
47551
+ ` + m;
47552
+ }
47553
+ E = !m.trim(), e = e.substring(he.length + 1), R = G.slice(b);
47554
+ }
47555
+ }
47556
+ let H = n.slice(g, i());
47557
+ s.loose || (u ? s.loose = true : this.rules.other.doubleBlankLine.test(H) && (u = true)), s.items.push({ type: "list_item", raw: H, task: !!this.options.gfm && this.rules.other.listIsTask.test(d), loose: false, text: d, tokens: [] });
47558
+ }
47559
+ let c = s.items.at(-1);
47560
+ if (c)
47561
+ c.raw = c.raw.trimEnd(), c.text = c.text.trimEnd();
47562
+ else
47563
+ return;
47564
+ s.raw = n.slice(0, i()).trimEnd();
47565
+ for (let p of s.items)
47566
+ if (this.lexer.state.top = false, p.tokens = this.lexer.blockTokens(p.text, []), !s.loose) {
47567
+ let d = p.tokens.filter((k) => k.type === "space"), g = d.length > 0 && d.some((k) => this.rules.other.anyLine.test(k.raw));
47568
+ s.loose = g;
47569
+ }
47570
+ for (let p of s.items) {
47571
+ let d = p.tokens[0];
47572
+ if (p.task && (d?.type === "text" || d?.type === "paragraph")) {
47573
+ p.text = p.text.replace(this.rules.other.listReplaceTask, ""), d.raw = d.raw.replace(this.rules.other.listReplaceTask, ""), d.text = d.text.replace(this.rules.other.listReplaceTask, "");
47574
+ for (let k = this.lexer.inlineQueue.length - 1;k >= 0; k--)
47575
+ if (this.rules.other.listIsTask.test(this.lexer.inlineQueue[k].src)) {
47576
+ this.lexer.inlineQueue[k].src = this.lexer.inlineQueue[k].src.replace(this.rules.other.listReplaceTask, "");
47577
+ break;
47578
+ }
47579
+ let g = this.rules.other.listTaskCheckbox.exec(p.raw);
47580
+ if (g) {
47581
+ let k = { type: "checkbox", raw: g[0] + " ", checked: g[0] !== "[ ]" };
47582
+ p.checked = k.checked, s.loose ? p.tokens[0] && ["paragraph", "text"].includes(p.tokens[0].type) && "tokens" in p.tokens[0] && p.tokens[0].tokens ? (p.tokens[0].raw = k.raw + p.tokens[0].raw, p.tokens[0].text = k.raw + p.tokens[0].text, p.tokens[0].tokens.unshift(k)) : p.tokens.unshift({ type: "paragraph", raw: k.raw, text: k.raw, tokens: [k] }) : p.tokens.unshift(k);
47583
+ }
47584
+ } else
47585
+ p.task && (p.task = false);
47586
+ }
47587
+ if (s.loose)
47588
+ for (let p of s.items) {
47589
+ p.loose = true;
47590
+ for (let d of p.tokens)
47591
+ d.type === "text" && (d.type = "paragraph");
47592
+ }
47593
+ return s;
47594
+ }
47595
+ }
47596
+ html(e) {
47597
+ let t = this.rules.block.html.exec(e);
47598
+ if (t) {
47599
+ let n = ae(t[0]);
47600
+ return { type: "html", block: true, raw: n, pre: t[1] === "pre" || t[1] === "script" || t[1] === "style", text: n };
47601
+ }
47602
+ }
47603
+ def(e) {
47604
+ let t = this.rules.block.def.exec(e);
47605
+ if (t) {
47606
+ if (!this.rules.other.startAngleBracket.test(t[2]) && le(t[2], "()") !== -1)
47607
+ return;
47608
+ let n = v(t[1]).replace(this.rules.other.multipleSpaceGlobal, " "), i = t[2] ? t[2].replace(this.rules.other.hrefBrackets, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "", r = t[3] ? t[3].substring(1, t[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : t[3];
47609
+ return { type: "def", tag: n, raw: A(t[0], `
47610
+ `), href: i, title: r };
47611
+ }
47612
+ }
47613
+ table(e) {
47614
+ let t = this.rules.block.table.exec(e);
47615
+ if (!t || !this.rules.other.tableDelimiter.test(t[2]))
47616
+ return;
47617
+ let n = oe(t[1]), i = t[2].replace(this.rules.other.tableAlignChars, "").split("|"), r = t[3]?.trim() ? t[3].replace(this.rules.other.tableRowBlankLine, "").split(`
47618
+ `) : [], o = { type: "table", raw: A(t[0], `
47619
+ `), header: [], align: [], rows: [] };
47620
+ if (n.length === i.length) {
47621
+ for (let s of i)
47622
+ this.rules.other.tableAlignRight.test(s) ? o.align.push("right") : this.rules.other.tableAlignCenter.test(s) ? o.align.push("center") : this.rules.other.tableAlignLeft.test(s) ? o.align.push("left") : o.align.push(null);
47623
+ for (let s = 0;s < n.length; s++)
47624
+ o.header.push({ text: n[s], tokens: this.lexer.inline(n[s]), header: true, align: o.align[s] });
47625
+ for (let s of r)
47626
+ o.rows.push(oe(s, o.header.length).map((l, u) => ({ text: l, tokens: this.lexer.inline(l), header: false, align: o.align[u] })));
47627
+ return o;
47628
+ }
47629
+ }
47630
+ lheading(e) {
47631
+ let t = this.rules.block.lheading.exec(e);
47632
+ if (t) {
47633
+ let n = t[1].trim();
47634
+ return { type: "heading", raw: A(t[0], `
47635
+ `), depth: t[2].charAt(0) === "=" ? 1 : 2, text: n, tokens: this.lexer.inline(n) };
47636
+ }
47637
+ }
47638
+ paragraph(e) {
47639
+ let t = this.rules.block.paragraph.exec(e);
47640
+ if (t) {
47641
+ let n = t[1].charAt(t[1].length - 1) === `
47642
+ ` ? t[1].slice(0, -1) : t[1];
47643
+ return { type: "paragraph", raw: t[0], text: n, tokens: this.lexer.inline(n) };
47644
+ }
47645
+ }
47646
+ text(e) {
47647
+ let t = this.rules.block.text.exec(e);
47648
+ if (t)
47649
+ return { type: "text", raw: t[0], text: t[0], tokens: this.lexer.inline(t[0]) };
47650
+ }
47651
+ escape(e) {
47652
+ let t = this.rules.inline.escape.exec(e);
47653
+ if (t)
47654
+ return { type: "escape", raw: t[0], text: t[1] };
47655
+ }
47656
+ tag(e) {
47657
+ let t = this.rules.inline.tag.exec(e);
47658
+ if (t)
47659
+ return !this.lexer.state.inLink && this.rules.other.startATag.test(t[0]) ? this.lexer.state.inLink = true : this.lexer.state.inLink && this.rules.other.endATag.test(t[0]) && (this.lexer.state.inLink = false), !this.lexer.state.inRawBlock && this.rules.other.startPreScriptTag.test(t[0]) ? this.lexer.state.inRawBlock = true : this.lexer.state.inRawBlock && this.rules.other.endPreScriptTag.test(t[0]) && (this.lexer.state.inRawBlock = false), { type: "html", raw: t[0], inLink: this.lexer.state.inLink, inRawBlock: this.lexer.state.inRawBlock, block: false, text: t[0] };
47660
+ }
47661
+ link(e) {
47662
+ if (this.lexer.state.linkParenPossible === false)
47663
+ return;
47664
+ let t = this.rules.inline.link.exec(e);
47665
+ if (t) {
47666
+ let n = t[0].charAt(0) === "!" ? 2 : 1;
47667
+ if (!this.options.pedantic && _e(e, t[1], n, this.rules))
47668
+ return;
47669
+ let i = t[2].trim();
47670
+ if (!this.options.pedantic && this.rules.other.startAngleBracket.test(i)) {
47671
+ if (!this.rules.other.endAngleBracket.test(i))
47672
+ return;
47673
+ let s = A(i.slice(0, -1), "\\");
47674
+ if ((i.length - s.length) % 2 === 0)
47675
+ return;
47676
+ } else {
47677
+ let s = le(t[2], "()");
47678
+ if (s === -2)
47679
+ return;
47680
+ if (s > -1) {
47681
+ let u = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + s;
47682
+ t[2] = t[2].substring(0, s), t[0] = t[0].substring(0, u).trim(), t[3] = "";
47683
+ }
47684
+ }
47685
+ let r = t[2], o = "";
47686
+ if (this.options.pedantic) {
47687
+ let s = this.rules.other.pedanticHrefTitle.exec(r);
47688
+ s && (r = s[1], o = s[3]);
47689
+ } else
47690
+ o = t[3] ? t[3].slice(1, -1) : "";
47691
+ return r = r.trim(), this.rules.other.startAngleBracket.test(r) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(i) ? r = r.slice(1) : r = r.slice(1, -1)), Se(t, { href: r && r.replace(this.rules.inline.anyPunctuation, "$1"), title: o && o.replace(this.rules.inline.anyPunctuation, "$1") }, t[0], this.lexer, this.rules);
47692
+ }
47693
+ }
47694
+ reflink(e, t) {
47695
+ let n;
47696
+ if ((n = this.rules.inline.reflink.exec(e)) || (n = this.rules.inline.nolink.exec(e))) {
47697
+ let i = n[0].charAt(0) === "!" ? 2 : 1;
47698
+ if (!this.options.pedantic && _e(e, n[1], i, this.rules))
47699
+ return;
47700
+ let r = (n[2] || n[1]).replace(this.rules.other.multipleSpaceGlobal, " "), o = t[v(r)];
47701
+ if (!o) {
47702
+ let s = n[0].charAt(0);
47703
+ return { type: "text", raw: s, text: s };
47704
+ }
47705
+ return Se(n, o, n[0], this.lexer, this.rules);
47706
+ }
47707
+ }
47708
+ emStrong(e, t, n = "") {
47709
+ let i = this.rules.inline.emStrongLDelim.exec(e);
47710
+ if (!i || !i[1] && !i[2] && !i[3] && !i[4] || i[4] && n.match(this.rules.other.unicodeAlphaNumeric))
47711
+ return;
47712
+ if (!(i[1] || i[3] || "") || !n || this.rules.inline.punctuation.exec(n)) {
47713
+ let o = [...i[0]].length - 1, s, l, u = o, c = 0, p = i[0][0], d = n === p, g = p === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
47714
+ for (g.lastIndex = 0, t = t.slice(-1 * e.length + o);(i = g.exec(t)) !== null; ) {
47715
+ if (s = i[1] || i[2] || i[3] || i[4] || i[5] || i[6], !s)
47716
+ continue;
47717
+ if (l = [...s].length, i[3] || i[4]) {
47718
+ u += l;
47719
+ continue;
47720
+ } else if (i[5] || i[6]) {
47721
+ if (o % 3 && !((o + l) % 3)) {
47722
+ c += l;
47723
+ continue;
47724
+ }
47725
+ if (d)
47726
+ break;
47727
+ }
47728
+ if (u -= l, u > 0)
47729
+ continue;
47730
+ l = Math.min(l, l + u + c);
47731
+ let k = [...i[0]][0].length, P = e.slice(0, o + i.index + k + l);
47732
+ if (Math.min(o, l) % 2) {
47733
+ let m = P.slice(1, -1);
47734
+ return { type: "em", raw: P, text: m, tokens: this.lexer.inlineTokens(m) };
47735
+ }
47736
+ let R = P.slice(2, -2);
47737
+ return { type: "strong", raw: P, text: R, tokens: this.lexer.inlineTokens(R) };
47738
+ }
47739
+ }
47740
+ }
47741
+ codespan(e) {
47742
+ let t = this.rules.inline.code.exec(e);
47743
+ if (t) {
47744
+ let n = t[2].replace(this.rules.other.newLineCharGlobal, " "), i = this.rules.other.nonSpaceChar.test(n), r = this.rules.other.startingSpaceChar.test(n) && this.rules.other.endingSpaceChar.test(n);
47745
+ return i && r && (n = n.substring(1, n.length - 1)), { type: "codespan", raw: t[0], text: n };
47746
+ }
47747
+ }
47748
+ br(e) {
47749
+ let t = this.rules.inline.br.exec(e);
47750
+ if (t)
47751
+ return { type: "br", raw: t[0] };
47752
+ }
47753
+ del(e, t, n = "") {
47754
+ let i = this.rules.inline.delLDelim.exec(e);
47755
+ if (!i)
47756
+ return;
47757
+ if (!(i[1] || "") || !n || this.rules.inline.punctuation.exec(n)) {
47758
+ let o = [...i[0]].length - 1, s, l, u = o, c = this.rules.inline.delRDelim;
47759
+ for (c.lastIndex = 0, t = t.slice(-1 * e.length + o);(i = c.exec(t)) !== null; ) {
47760
+ if (s = i[1] || i[2] || i[3] || i[4] || i[5] || i[6], !s || (l = [...s].length, l !== o))
47761
+ continue;
47762
+ if (i[3] || i[4]) {
47763
+ u += l;
47764
+ continue;
47765
+ }
47766
+ if (u -= l, u > 0)
47767
+ continue;
47768
+ l = Math.min(l, l + u);
47769
+ let p = [...i[0]][0].length, d = e.slice(0, o + i.index + p + l), g = d.slice(o, -o);
47770
+ return { type: "del", raw: d, text: g, tokens: this.lexer.inlineTokens(g) };
47771
+ }
47772
+ }
47773
+ }
47774
+ autolink(e) {
47775
+ let t = this.rules.inline.autolink.exec(e);
47776
+ if (t) {
47777
+ let n, i;
47778
+ return t[2] === "@" ? (n = t[1], i = "mailto:" + n) : (n = t[1], i = n), { type: "link", raw: t[0], text: n, href: i, autolink: true, tokens: [{ type: "text", raw: n, text: n }] };
47779
+ }
47780
+ }
47781
+ url(e) {
47782
+ let t;
47783
+ if (t = this.rules.inline.url.exec(e)) {
47784
+ let n, i;
47785
+ if (t[2] === "@")
47786
+ n = t[0], i = "mailto:" + n;
47787
+ else {
47788
+ let r;
47789
+ do
47790
+ r = t[0], t[0] = this.rules.inline._backpedal.exec(t[0])?.[0] ?? "";
47791
+ while (r !== t[0]);
47792
+ n = t[0], t[1] === "www." ? i = "http://" + t[0] : i = t[0];
47793
+ }
47794
+ return { type: "link", raw: t[0], text: n, href: i, autolink: true, tokens: [{ type: "text", raw: n, text: n }] };
47795
+ }
47796
+ }
47797
+ inlineText(e) {
47798
+ let t = this.rules.inline.text.exec(e);
47799
+ if (t) {
47800
+ let n = this.lexer.state.inRawBlock;
47801
+ return { type: "text", raw: t[0], text: n ? t[0] : ye(t[0]), escaped: n };
47802
+ }
47803
+ }
47804
+ };
47805
+ var T = class a {
47806
+ tokens;
47807
+ options;
47808
+ state;
47809
+ inlineQueue;
47810
+ tokenizer;
47811
+ constructor(e) {
47812
+ this.tokens = [], this.tokens.links = Object.create(null), this.options = e || y, this.options.tokenizer = this.options.tokenizer || new _, this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: false, inRawBlock: false, linkEmitted: false, linkParenPossible: true, top: true };
47813
+ let t = { other: x, block: F.normal, inline: Z.normal };
47814
+ this.options.pedantic ? (t.block = F.pedantic, t.inline = Z.pedantic) : this.options.gfm && (t.block = F.gfm, this.options.breaks ? t.inline = Z.breaks : t.inline = Z.gfm), this.tokenizer.rules = t;
47815
+ }
47816
+ static get rules() {
47817
+ return { block: F, inline: Z };
47818
+ }
47819
+ static lex(e, t) {
47820
+ return new a(t).lex(e);
47821
+ }
47822
+ static lexInline(e, t) {
47823
+ return new a(t).inlineTokens(e);
47824
+ }
47825
+ lex(e) {
47826
+ e = e.replace(x.carriageReturn, `
47827
+ `), this.blockTokens(e, this.tokens);
47828
+ for (let t = 0;t < this.inlineQueue.length; t++) {
47829
+ let n = this.inlineQueue[t];
47830
+ this.inlineTokens(n.src, n.tokens);
47831
+ }
47832
+ return this.inlineQueue = [], this.tokens;
47833
+ }
47834
+ blockTokens(e, t = [], n = false) {
47835
+ this.tokenizer.lexer = this, this.options.pedantic && (e = e.replace(x.tabCharGlobal, " ").replace(x.spaceLine, ""));
47836
+ let i = 1 / 0;
47837
+ for (;e; ) {
47838
+ if (e.length < i)
47839
+ i = e.length;
47840
+ else {
47841
+ this.infiniteLoopError(e.charCodeAt(0));
47842
+ break;
47843
+ }
47844
+ let r;
47845
+ if (this.options.extensions?.block?.some((s) => (r = s.call({ lexer: this }, e, t)) ? (e = e.substring(r.raw.length), t.push(r), true) : false))
47846
+ continue;
47847
+ if (r = this.tokenizer.space(e)) {
47848
+ e = e.substring(r.raw.length);
47849
+ let s = t.at(-1);
47850
+ r.raw.length === 1 && s !== undefined ? s.raw += `
47851
+ ` : t.push(r);
47852
+ continue;
47853
+ }
47854
+ if (r = this.tokenizer.code(e)) {
47855
+ e = e.substring(r.raw.length);
47856
+ let s = t.at(-1);
47857
+ s?.type === "paragraph" || s?.type === "text" ? (s.raw += (s.raw.endsWith(`
47858
+ `) ? "" : `
47859
+ `) + r.raw, s.text += `
47860
+ ` + r.text, this.inlineQueue.at(-1).src = s.text) : t.push(r);
47861
+ continue;
47862
+ }
47863
+ if (r = this.tokenizer.fences(e)) {
47864
+ e = e.substring(r.raw.length), t.push(r);
47865
+ continue;
47866
+ }
47867
+ if (r = this.tokenizer.heading(e)) {
47868
+ e = e.substring(r.raw.length), t.push(r);
47869
+ continue;
47870
+ }
47871
+ if (r = this.tokenizer.hr(e)) {
47872
+ e = e.substring(r.raw.length), t.push(r);
47873
+ continue;
47874
+ }
47875
+ if (r = this.tokenizer.blockquote(e)) {
47876
+ e = e.substring(r.raw.length), t.push(r);
47877
+ continue;
47878
+ }
47879
+ if (r = this.tokenizer.list(e)) {
47880
+ e = e.substring(r.raw.length), t.push(r);
47881
+ continue;
47882
+ }
47883
+ if (r = this.tokenizer.html(e)) {
47884
+ e = e.substring(r.raw.length), t.push(r);
47885
+ continue;
47886
+ }
47887
+ if (r = this.tokenizer.def(e)) {
47888
+ e = e.substring(r.raw.length);
47889
+ let s = t.at(-1);
47890
+ s?.type === "paragraph" || s?.type === "text" ? (s.raw += (s.raw.endsWith(`
47891
+ `) ? "" : `
47892
+ `) + r.raw, s.text += `
47893
+ ` + r.raw, this.inlineQueue.at(-1).src = s.text) : this.tokens.links[r.tag] || (this.tokens.links[r.tag] = { href: r.href, title: r.title }, t.push(r));
47894
+ continue;
47895
+ }
47896
+ if (r = this.tokenizer.table(e)) {
47897
+ e = e.substring(r.raw.length), t.push(r);
47898
+ continue;
47899
+ }
47900
+ if (r = this.tokenizer.lheading(e)) {
47901
+ e = e.substring(r.raw.length), t.push(r);
47902
+ continue;
47903
+ }
47904
+ let o = e;
47905
+ if (this.options.extensions?.startBlock) {
47906
+ let s = 1 / 0, l = e.slice(1), u;
47907
+ this.options.extensions.startBlock.forEach((c) => {
47908
+ u = c.call({ lexer: this }, l), typeof u == "number" && u >= 0 && (s = Math.min(s, u));
47909
+ }), s < 1 / 0 && s >= 0 && (o = e.substring(0, s + 1));
47910
+ }
47911
+ if (this.state.top && (r = this.tokenizer.paragraph(o))) {
47912
+ let s = t.at(-1);
47913
+ n && s?.type === "paragraph" ? (s.raw += (s.raw.endsWith(`
47914
+ `) ? "" : `
47915
+ `) + r.raw, s.text += `
47916
+ ` + r.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = s.text) : t.push(r), n = o.length !== e.length, e = e.substring(r.raw.length);
47917
+ continue;
47918
+ }
47919
+ if (r = this.tokenizer.text(e)) {
47920
+ e = e.substring(r.raw.length);
47921
+ let s = t.at(-1);
47922
+ s?.type === "text" ? (s.raw += (s.raw.endsWith(`
47923
+ `) ? "" : `
47924
+ `) + r.raw, s.text += `
47925
+ ` + r.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = s.text) : t.push(r);
47926
+ continue;
47927
+ }
47928
+ if (e) {
47929
+ this.infiniteLoopError(e.charCodeAt(0));
47930
+ break;
47931
+ }
47932
+ }
47933
+ return this.state.top = true, t;
47934
+ }
47935
+ inline(e, t = []) {
47936
+ return this.inlineQueue.push({ src: e, tokens: t }), t;
47937
+ }
47938
+ linkInText(e) {
47939
+ if (!e.includes("["))
47940
+ return false;
47941
+ let t = this.tokenizer.rules.inline.link;
47942
+ for (let n of e.matchAll(this.tokenizer.rules.inline.blockSkip))
47943
+ if (t.test(n[0]) && e.charAt(n.index - 1) !== "!")
47944
+ return true;
47945
+ for (let n of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)) {
47946
+ let i = n[0], r = i.lastIndexOf("[");
47947
+ if (!(i.charAt(0) === "!" || !Object.hasOwn(this.tokens.links, v(i.slice(r + 1, -1)))) && !(r > 1 && this.linkInText(i.slice(1, r - 1))))
47948
+ return true;
47949
+ }
47950
+ return false;
47951
+ }
47952
+ inlineTokens(e, t = []) {
47953
+ this.tokenizer.lexer = this;
47954
+ let n = this.state.linkParenPossible;
47955
+ this.state.linkParenPossible = n && e.includes(")");
47956
+ try {
47957
+ return this.#e(e, t);
47958
+ } finally {
47959
+ this.state.linkParenPossible = n;
47960
+ }
47961
+ }
47962
+ #e(e, t) {
47963
+ let n = e;
47964
+ if (this.tokens.links && e.includes("[")) {
47965
+ let s = this.tokenizer.rules.inline.reflinkSearch, l = (u) => {
47966
+ let c = u.lastIndexOf("[");
47967
+ if (!Object.hasOwn(this.tokens.links, v(u.slice(c + 1, -1))))
47968
+ return u;
47969
+ if (c > 1 && u.charAt(0) !== "!") {
47970
+ let p = u.slice(1, c - 1);
47971
+ if (this.linkInText(p))
47972
+ return "[" + p.replace(s, l) + "][" + "a".repeat(u.length - c - 2) + "]";
47973
+ }
47974
+ return "[" + "a".repeat(u.length - 2) + "]";
47975
+ };
47976
+ n = n.replace(s, l);
47977
+ }
47978
+ n = n.replace(this.tokenizer.rules.inline.anyPunctuationOutsideCode, (s, l, u) => u ? "+".repeat(s.length) : l ? l + s.slice(l.length, -l.length).replace(/`/g, "+") + l : s), n = n.replace(this.tokenizer.rules.inline.blockSkip, (s, l, u) => {
47979
+ let c = u ? u.length : 0;
47980
+ return s.slice(0, c) + "[" + "a".repeat(s.length - c - 2) + "]";
47981
+ }), n = this.options.hooks?.emStrongMask?.call({ lexer: this }, n) ?? n;
47982
+ let i = false, r = "", o = 1 / 0;
47983
+ for (;e; ) {
47984
+ if (e.length < o)
47985
+ o = e.length;
47986
+ else {
47987
+ this.infiniteLoopError(e.charCodeAt(0));
47988
+ break;
47989
+ }
47990
+ i || (r = ""), i = false;
47991
+ let s;
47992
+ if (this.options.extensions?.inline?.some((u) => (s = u.call({ lexer: this }, e, t)) ? (e = e.substring(s.raw.length), t.push(s), true) : false))
47993
+ continue;
47994
+ if (s = this.tokenizer.escape(e)) {
47995
+ e = e.substring(s.raw.length), t.push(s);
47996
+ continue;
47997
+ }
47998
+ if (s = this.tokenizer.tag(e)) {
47999
+ e = e.substring(s.raw.length), t.push(s);
48000
+ continue;
48001
+ }
48002
+ if (s = this.tokenizer.link(e)) {
48003
+ e = e.substring(s.raw.length), t.push(s);
48004
+ continue;
48005
+ }
48006
+ if (s = this.tokenizer.reflink(e, this.tokens.links)) {
48007
+ e = e.substring(s.raw.length);
48008
+ let u = t.at(-1);
48009
+ s.type === "text" && u?.type === "text" ? (u.raw += s.raw, u.text += s.text) : t.push(s);
48010
+ continue;
48011
+ }
48012
+ if (s = this.tokenizer.emStrong(e, n, r)) {
48013
+ e = e.substring(s.raw.length), t.push(s);
48014
+ continue;
48015
+ }
48016
+ if (s = this.tokenizer.codespan(e)) {
48017
+ e = e.substring(s.raw.length), t.push(s);
48018
+ continue;
48019
+ }
48020
+ if (s = this.tokenizer.br(e)) {
48021
+ e = e.substring(s.raw.length), t.push(s);
48022
+ continue;
48023
+ }
48024
+ if (s = this.tokenizer.del(e, n, r)) {
48025
+ e = e.substring(s.raw.length), t.push(s);
48026
+ continue;
48027
+ }
48028
+ if (s = this.tokenizer.autolink(e)) {
48029
+ e = e.substring(s.raw.length), t.push(s);
48030
+ continue;
48031
+ }
48032
+ if (!this.state.inLink && (s = this.tokenizer.url(e))) {
48033
+ e = e.substring(s.raw.length), t.push(s);
48034
+ continue;
48035
+ }
48036
+ let l = e;
48037
+ if (this.options.extensions?.startInline) {
48038
+ let u = 1 / 0, c = e.slice(1), p;
48039
+ this.options.extensions.startInline.forEach((d) => {
48040
+ p = d.call({ lexer: this }, c), typeof p == "number" && p >= 0 && (u = Math.min(u, p));
48041
+ }), u < 1 / 0 && u >= 0 && (l = e.substring(0, u + 1));
48042
+ }
48043
+ if (s = this.tokenizer.inlineText(l)) {
48044
+ e = e.substring(s.raw.length), s.raw.slice(-1) !== "_" && (r = s.raw.slice(-1)), i = true;
48045
+ let u = t.at(-1);
48046
+ u?.type === "text" ? (u.raw += s.raw, u.text += s.text) : t.push(s);
48047
+ continue;
48048
+ }
48049
+ if (e) {
48050
+ this.infiniteLoopError(e.charCodeAt(0));
48051
+ break;
48052
+ }
48053
+ }
48054
+ return t;
48055
+ }
48056
+ infiniteLoopError(e) {
48057
+ let t = "Infinite loop on byte: " + e;
48058
+ if (this.options.silent)
48059
+ console.error(t);
48060
+ else
48061
+ throw new Error(t);
48062
+ }
48063
+ };
48064
+ var $ = class {
48065
+ options;
48066
+ parser;
48067
+ constructor(e) {
48068
+ this.options = e || y;
48069
+ }
48070
+ space(e) {
48071
+ return "";
48072
+ }
48073
+ code({ text: e, lang: t, escaped: n }) {
48074
+ let i = (t || "").match(x.notSpaceStart)?.[0], r = e ? e.replace(x.endingNewline, "") + `
48075
+ ` : "";
48076
+ return i ? '<pre><code class="language-' + w(i) + '">' + (n ? r : w(r, true)) + `</code></pre>
48077
+ ` : "<pre><code>" + (n ? r : w(r, true)) + `</code></pre>
48078
+ `;
48079
+ }
48080
+ blockquote({ tokens: e }) {
48081
+ return `<blockquote>
48082
+ ${this.parser.parse(e)}</blockquote>
48083
+ `;
48084
+ }
48085
+ html({ text: e }) {
48086
+ return e;
48087
+ }
48088
+ def(e) {
48089
+ return "";
48090
+ }
48091
+ heading({ tokens: e, depth: t }) {
48092
+ return `<h${t}>${this.parser.parseInline(e)}</h${t}>
48093
+ `;
48094
+ }
48095
+ hr(e) {
48096
+ return `<hr>
48097
+ `;
48098
+ }
48099
+ list(e) {
48100
+ let { ordered: t, start: n } = e, i = "";
48101
+ for (let s = 0;s < e.items.length; s++) {
48102
+ let l = e.items[s];
48103
+ i += this.listitem(l);
48104
+ }
48105
+ let r = t ? "ol" : "ul", o = t && n !== 1 ? ' start="' + n + '"' : "";
48106
+ return "<" + r + o + `>
48107
+ ` + i + "</" + r + `>
48108
+ `;
48109
+ }
48110
+ listitem(e) {
48111
+ return `<li>${this.parser.parse(e.tokens)}</li>
48112
+ `;
48113
+ }
48114
+ checkbox({ checked: e }) {
48115
+ return "<input " + (e ? 'checked="" ' : "") + 'disabled="" type="checkbox"> ';
48116
+ }
48117
+ paragraph({ tokens: e }) {
48118
+ return `<p>${this.parser.parseInline(e)}</p>
48119
+ `;
48120
+ }
48121
+ table(e) {
48122
+ let t = "", n = "";
48123
+ for (let r = 0;r < e.header.length; r++)
48124
+ n += this.tablecell(e.header[r]);
48125
+ t += this.tablerow({ text: n });
48126
+ let i = "";
48127
+ for (let r = 0;r < e.rows.length; r++) {
48128
+ let o = e.rows[r];
48129
+ n = "";
48130
+ for (let s = 0;s < o.length; s++)
48131
+ n += this.tablecell(o[s]);
48132
+ i += this.tablerow({ text: n });
48133
+ }
48134
+ return i && (i = `<tbody>${i}</tbody>`), `<table>
48135
+ <thead>
48136
+ ` + t + `</thead>
48137
+ ` + i + `</table>
48138
+ `;
48139
+ }
48140
+ tablerow({ text: e }) {
48141
+ return `<tr>
48142
+ ${e}</tr>
48143
+ `;
48144
+ }
48145
+ tablecell(e) {
48146
+ let t = this.parser.parseInline(e.tokens), n = e.header ? "th" : "td";
48147
+ return (e.align ? `<${n} align="${e.align}">` : `<${n}>`) + t + `</${n}>
48148
+ `;
48149
+ }
48150
+ strong({ tokens: e }) {
48151
+ return `<strong>${this.parser.parseInline(e)}</strong>`;
48152
+ }
48153
+ em({ tokens: e }) {
48154
+ return `<em>${this.parser.parseInline(e)}</em>`;
48155
+ }
48156
+ codespan({ text: e }) {
48157
+ return `<code>${w(e, true)}</code>`;
48158
+ }
48159
+ br(e) {
48160
+ return "<br>";
48161
+ }
48162
+ del({ tokens: e }) {
48163
+ return `<del>${this.parser.parseInline(e)}</del>`;
48164
+ }
48165
+ link({ href: e, title: t, text: n, tokens: i, autolink: r }) {
48166
+ let o = r ? w(n, true) : this.parser.parseInline(i), s = ie(e);
48167
+ if (s === null)
48168
+ return o;
48169
+ e = w(s, r);
48170
+ let l = '<a href="' + e + '"';
48171
+ return t && (l += ' title="' + w(t) + '"'), l += ">" + o + "</a>", l;
48172
+ }
48173
+ image({ href: e, title: t, text: n, tokens: i }) {
48174
+ i && (n = this.parser.parseInline(i, this.parser.textRenderer));
48175
+ let r = ie(e);
48176
+ if (r === null)
48177
+ return w(n);
48178
+ e = r;
48179
+ let o = `<img src="${w(e)}" alt="${w(n)}"`;
48180
+ return t && (o += ` title="${w(t)}"`), o += ">", o;
48181
+ }
48182
+ text(e) {
48183
+ return "tokens" in e && e.tokens ? this.parser.parseInline(e.tokens) : ("escaped" in e) && e.escaped ? e.text : w(e.text);
48184
+ }
48185
+ };
48186
+ var z = class {
48187
+ strong({ text: e }) {
48188
+ return e;
48189
+ }
48190
+ em({ text: e }) {
48191
+ return e;
48192
+ }
48193
+ codespan({ text: e }) {
48194
+ return e;
48195
+ }
48196
+ del({ text: e }) {
48197
+ return e;
48198
+ }
48199
+ html({ text: e }) {
48200
+ return e;
48201
+ }
48202
+ text({ text: e }) {
48203
+ return e;
48204
+ }
48205
+ link({ text: e }) {
48206
+ return "" + e;
48207
+ }
48208
+ image({ text: e }) {
48209
+ return "" + e;
48210
+ }
48211
+ br() {
48212
+ return "";
48213
+ }
48214
+ checkbox({ raw: e }) {
48215
+ return e;
48216
+ }
48217
+ };
48218
+ var O = class a2 {
48219
+ options;
48220
+ renderer;
48221
+ textRenderer;
48222
+ constructor(e) {
48223
+ this.options = e || y, this.options.renderer = this.options.renderer || new $, this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new z;
48224
+ }
48225
+ static parse(e, t) {
48226
+ return new a2(t).parse(e);
48227
+ }
48228
+ static parseInline(e, t) {
48229
+ return new a2(t).parseInline(e);
48230
+ }
48231
+ parse(e) {
48232
+ this.renderer.parser = this;
48233
+ let t = "";
48234
+ for (let n = 0;n < e.length; n++) {
48235
+ let i = e[n];
48236
+ if (this.options.extensions?.renderers?.[i.type]) {
48237
+ let o = i, s = this.options.extensions.renderers[o.type].call({ parser: this }, o);
48238
+ if (s !== false || !["space", "hr", "heading", "code", "table", "blockquote", "list", "checkbox", "html", "def", "paragraph", "text"].includes(o.type)) {
48239
+ t += s || "";
48240
+ continue;
48241
+ }
48242
+ }
48243
+ let r = i;
48244
+ switch (r.type) {
48245
+ case "space": {
48246
+ t += this.renderer.space(r);
48247
+ break;
48248
+ }
48249
+ case "hr": {
48250
+ t += this.renderer.hr(r);
48251
+ break;
48252
+ }
48253
+ case "heading": {
48254
+ t += this.renderer.heading(r);
48255
+ break;
48256
+ }
48257
+ case "code": {
48258
+ t += this.renderer.code(r);
48259
+ break;
48260
+ }
48261
+ case "table": {
48262
+ t += this.renderer.table(r);
48263
+ break;
48264
+ }
48265
+ case "blockquote": {
48266
+ t += this.renderer.blockquote(r);
48267
+ break;
48268
+ }
48269
+ case "list": {
48270
+ t += this.renderer.list(r);
48271
+ break;
48272
+ }
48273
+ case "checkbox": {
48274
+ t += this.renderer.checkbox(r);
48275
+ break;
48276
+ }
48277
+ case "html": {
48278
+ t += this.renderer.html(r);
48279
+ break;
48280
+ }
48281
+ case "def": {
48282
+ t += this.renderer.def(r);
48283
+ break;
48284
+ }
48285
+ case "paragraph": {
48286
+ t += this.renderer.paragraph(r);
48287
+ break;
48288
+ }
48289
+ case "text": {
48290
+ t += this.renderer.text(r);
48291
+ break;
48292
+ }
48293
+ default: {
48294
+ let o = 'Token with "' + r.type + '" type was not found.';
48295
+ if (this.options.silent)
48296
+ return console.error(o), "";
48297
+ throw new Error(o);
48298
+ }
48299
+ }
48300
+ }
48301
+ return t;
48302
+ }
48303
+ parseInline(e, t = this.renderer) {
48304
+ this.renderer.parser = this;
48305
+ let n = "";
48306
+ for (let i = 0;i < e.length; i++) {
48307
+ let r = e[i];
48308
+ if (this.options.extensions?.renderers?.[r.type]) {
48309
+ let s = this.options.extensions.renderers[r.type].call({ parser: this }, r);
48310
+ if (s !== false || !["escape", "html", "link", "image", "checkbox", "strong", "em", "codespan", "br", "del", "text"].includes(r.type)) {
48311
+ n += s || "";
48312
+ continue;
48313
+ }
48314
+ }
48315
+ let o = r;
48316
+ switch (o.type) {
48317
+ case "escape": {
48318
+ n += t.text(o);
48319
+ break;
48320
+ }
48321
+ case "html": {
48322
+ n += t.html(o);
48323
+ break;
48324
+ }
48325
+ case "link": {
48326
+ n += t.link(o);
48327
+ break;
48328
+ }
48329
+ case "image": {
48330
+ n += t.image(o);
48331
+ break;
48332
+ }
48333
+ case "checkbox": {
48334
+ n += t.checkbox(o);
48335
+ break;
48336
+ }
48337
+ case "strong": {
48338
+ n += t.strong(o);
48339
+ break;
48340
+ }
48341
+ case "em": {
48342
+ n += t.em(o);
48343
+ break;
48344
+ }
48345
+ case "codespan": {
48346
+ n += t.codespan(o);
48347
+ break;
48348
+ }
48349
+ case "br": {
48350
+ n += t.br(o);
48351
+ break;
48352
+ }
48353
+ case "del": {
48354
+ n += t.del(o);
48355
+ break;
48356
+ }
48357
+ case "text": {
48358
+ n += t.text(o);
48359
+ break;
48360
+ }
48361
+ default: {
48362
+ let s = 'Token with "' + o.type + '" type was not found.';
48363
+ if (this.options.silent)
48364
+ return console.error(s), "";
48365
+ throw new Error(s);
48366
+ }
48367
+ }
48368
+ }
48369
+ return n;
48370
+ }
48371
+ };
48372
+ var L = class {
48373
+ options;
48374
+ block;
48375
+ constructor(e) {
48376
+ this.options = e || y;
48377
+ }
48378
+ static passThroughHooks = new Set(["preprocess", "postprocess", "processAllTokens", "emStrongMask"]);
48379
+ static passThroughHooksRespectAsync = new Set(["preprocess", "postprocess", "processAllTokens"]);
48380
+ preprocess(e) {
48381
+ return e;
48382
+ }
48383
+ postprocess(e) {
48384
+ return e;
48385
+ }
48386
+ processAllTokens(e) {
48387
+ return e;
48388
+ }
48389
+ emStrongMask(e) {
48390
+ return e;
48391
+ }
48392
+ provideLexer(e = this.block) {
48393
+ return e ? T.lex : T.lexInline;
48394
+ }
48395
+ provideParser(e = this.block) {
48396
+ return e ? O.parse : O.parseInline;
48397
+ }
48398
+ };
48399
+ function C(a3, e) {
48400
+ if (Array.isArray(e))
48401
+ for (let t = 0;t < e.length; t++)
48402
+ a3.push(e[t]);
48403
+ else
48404
+ a3.push(e);
48405
+ }
48406
+ var U = class {
48407
+ defaults = B();
48408
+ options = this.setOptions;
48409
+ parse = this.parseMarkdown(true);
48410
+ parseInline = this.parseMarkdown(false);
48411
+ Parser = O;
48412
+ Renderer = $;
48413
+ TextRenderer = z;
48414
+ Lexer = T;
48415
+ Tokenizer = _;
48416
+ Hooks = L;
48417
+ constructor(...e) {
48418
+ this.use(...e);
48419
+ }
48420
+ walkTokens(e, t) {
48421
+ let n = [];
48422
+ for (let i of e)
48423
+ switch (C(n, t.call(this, i)), i.type) {
48424
+ case "table": {
48425
+ let r = i;
48426
+ for (let o of r.header)
48427
+ C(n, this.walkTokens(o.tokens, t));
48428
+ for (let o of r.rows)
48429
+ for (let s of o)
48430
+ C(n, this.walkTokens(s.tokens, t));
48431
+ break;
48432
+ }
48433
+ case "list": {
48434
+ let r = i;
48435
+ C(n, this.walkTokens(r.items, t));
48436
+ break;
48437
+ }
48438
+ default: {
48439
+ let r = i;
48440
+ this.defaults.extensions?.childTokens?.[r.type] ? this.defaults.extensions.childTokens[r.type].forEach((o) => {
48441
+ let s = r[o].flat(1 / 0);
48442
+ C(n, this.walkTokens(s, t));
48443
+ }) : r.tokens && C(n, this.walkTokens(r.tokens, t));
48444
+ }
48445
+ }
48446
+ return n;
48447
+ }
48448
+ use(...e) {
48449
+ let t = this.defaults.extensions || { renderers: {}, childTokens: {} };
48450
+ return e.forEach((n) => {
48451
+ let i = { ...n };
48452
+ if (i.async = this.defaults.async || i.async || false, n.extensions && (n.extensions.forEach((r) => {
48453
+ if (!r.name)
48454
+ throw new Error("extension name required");
48455
+ if ("renderer" in r) {
48456
+ let o = t.renderers[r.name];
48457
+ o ? t.renderers[r.name] = function(...s) {
48458
+ let l = r.renderer.apply(this, s);
48459
+ return l === false && (l = o.apply(this, s)), l;
48460
+ } : t.renderers[r.name] = r.renderer;
48461
+ }
48462
+ if ("tokenizer" in r) {
48463
+ if (!r.level || r.level !== "block" && r.level !== "inline")
48464
+ throw new Error("extension level must be 'block' or 'inline'");
48465
+ let o = t[r.level];
48466
+ o ? o.unshift(r.tokenizer) : t[r.level] = [r.tokenizer], r.start && (r.level === "block" ? t.startBlock ? t.startBlock.push(r.start) : t.startBlock = [r.start] : r.level === "inline" && (t.startInline ? t.startInline.push(r.start) : t.startInline = [r.start]));
48467
+ }
48468
+ "childTokens" in r && r.childTokens && (t.childTokens[r.name] = r.childTokens);
48469
+ }), i.extensions = t), n.renderer) {
48470
+ let r = this.defaults.renderer || new $(this.defaults);
48471
+ for (let o in n.renderer) {
48472
+ if (!(o in r))
48473
+ throw new Error(`renderer '${o}' does not exist`);
48474
+ if (["options", "parser"].includes(o))
48475
+ continue;
48476
+ let s = o, l = n.renderer[s], u = r[s];
48477
+ r[s] = (...c) => {
48478
+ let p = l.apply(r, c);
48479
+ return p === false && (p = u.apply(r, c)), p || "";
48480
+ };
48481
+ }
48482
+ i.renderer = r;
48483
+ }
48484
+ if (n.tokenizer) {
48485
+ let r = this.defaults.tokenizer || new _(this.defaults);
48486
+ for (let o in n.tokenizer) {
48487
+ if (!(o in r))
48488
+ throw new Error(`tokenizer '${o}' does not exist`);
48489
+ if (["options", "rules", "lexer"].includes(o))
48490
+ continue;
48491
+ let s = o, l = n.tokenizer[s], u = r[s];
48492
+ r[s] = (...c) => {
48493
+ let p = l.apply(r, c);
48494
+ return p === false && (p = u.apply(r, c)), p;
48495
+ };
48496
+ }
48497
+ i.tokenizer = r;
48498
+ }
48499
+ if (n.hooks) {
48500
+ let r = this.defaults.hooks || new L;
48501
+ for (let o in n.hooks) {
48502
+ if (!(o in r))
48503
+ throw new Error(`hook '${o}' does not exist`);
48504
+ if (["options", "block"].includes(o))
48505
+ continue;
48506
+ let s = o, l = n.hooks[s], u = r[s];
48507
+ L.passThroughHooks.has(o) ? r[s] = (c) => {
48508
+ if (this.defaults.async && L.passThroughHooksRespectAsync.has(o))
48509
+ return (async () => {
48510
+ let d = await l.call(r, c);
48511
+ return u.call(r, d);
48512
+ })();
48513
+ let p = l.call(r, c);
48514
+ return u.call(r, p);
48515
+ } : r[s] = (...c) => {
48516
+ if (this.defaults.async)
48517
+ return (async () => {
48518
+ let d = await l.apply(r, c);
48519
+ return d === false && (d = await u.apply(r, c)), d;
48520
+ })();
48521
+ let p = l.apply(r, c);
48522
+ return p === false && (p = u.apply(r, c)), p;
48523
+ };
48524
+ }
48525
+ i.hooks = r;
48526
+ }
48527
+ if (n.walkTokens) {
48528
+ let r = this.defaults.walkTokens, o = n.walkTokens;
48529
+ i.walkTokens = function(s) {
48530
+ let l = [];
48531
+ return l.push(o.call(this, s)), r && C(l, r.call(this, s)), l;
48532
+ };
48533
+ }
48534
+ this.defaults = { ...this.defaults, ...i };
48535
+ }), this;
48536
+ }
48537
+ setOptions(e) {
48538
+ return this.defaults = { ...this.defaults, ...e }, this;
48539
+ }
48540
+ lexer(e, t) {
48541
+ return T.lex(e, t ?? this.defaults);
48542
+ }
48543
+ parser(e, t) {
48544
+ return O.parse(e, t ?? this.defaults);
48545
+ }
48546
+ parseMarkdown(e) {
48547
+ return (n, i) => {
48548
+ let r = { ...i }, o = { ...this.defaults, ...r }, s = this.onError(!!o.silent, !!o.async);
48549
+ if (this.defaults.async === true && r.async === false)
48550
+ return s(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));
48551
+ if (typeof n > "u" || n === null)
48552
+ return s(new Error("marked(): input parameter is undefined or null"));
48553
+ if (typeof n != "string")
48554
+ return s(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(n) + ", string expected"));
48555
+ if (o.hooks && (o.hooks.options = o, o.hooks.block = e), o.async)
48556
+ return (async () => {
48557
+ let l = o.hooks ? await o.hooks.preprocess(n) : n, c = await (o.hooks ? await o.hooks.provideLexer(e) : e ? T.lex : T.lexInline)(l, o), p = o.hooks ? await o.hooks.processAllTokens(c) : c;
48558
+ o.walkTokens && await Promise.all(this.walkTokens(p, o.walkTokens));
48559
+ let g = await (o.hooks ? await o.hooks.provideParser(e) : e ? O.parse : O.parseInline)(p, o);
48560
+ return o.hooks ? await o.hooks.postprocess(g) : g;
48561
+ })().catch(s);
48562
+ try {
48563
+ o.hooks && (n = o.hooks.preprocess(n));
48564
+ let u = (o.hooks ? o.hooks.provideLexer(e) : e ? T.lex : T.lexInline)(n, o);
48565
+ o.hooks && (u = o.hooks.processAllTokens(u)), o.walkTokens && this.walkTokens(u, o.walkTokens);
48566
+ let p = (o.hooks ? o.hooks.provideParser(e) : e ? O.parse : O.parseInline)(u, o);
48567
+ return o.hooks && (p = o.hooks.postprocess(p)), p;
48568
+ } catch (l) {
48569
+ return s(l);
48570
+ }
48571
+ };
48572
+ }
48573
+ onError(e, t) {
48574
+ return (n) => {
48575
+ if (n.message += `
48576
+ Please report this to https://github.com/markedjs/marked.`, e) {
48577
+ let i = "<p>An error occurred:</p><pre>" + w(n.message + "", true) + "</pre>";
48578
+ return t ? Promise.resolve(i) : i;
48579
+ }
48580
+ if (t)
48581
+ return Promise.reject(n);
48582
+ throw n;
48583
+ };
48584
+ }
48585
+ };
48586
+ var I = new U;
48587
+ function f(a3, e) {
48588
+ return I.parse(a3, e);
48589
+ }
48590
+ f.options = f.setOptions = function(a3) {
48591
+ return I.setOptions(a3), f.defaults = I.defaults, V(f.defaults), f;
48592
+ };
48593
+ f.getDefaults = B;
48594
+ f.defaults = y;
48595
+ function At(...a3) {
48596
+ return I.use(...a3), f.defaults = I.defaults, V(f.defaults), f;
48597
+ }
48598
+ f.use = At;
48599
+ f.walkTokens = function(a3, e) {
48600
+ return I.walkTokens(a3, e);
48601
+ };
48602
+ f.parseInline = I.parseInline;
48603
+ f.Parser = O;
48604
+ f.parser = O.parse;
48605
+ f.Renderer = $;
48606
+ f.TextRenderer = z;
48607
+ f.Lexer = T;
48608
+ f.lexer = T.lex;
48609
+ f.Tokenizer = _;
48610
+ f.Hooks = L;
48611
+ f.parse = f;
48612
+ var Rn = f.options;
48613
+ var Tn = f.setOptions;
48614
+ var On = f.walkTokens;
48615
+ var wn = f.parseInline;
48616
+ var yn = O.parse;
48617
+ var Sn = T.lex;
48618
+
48619
+ // src/core/asset/markdown-link-targets.ts
48620
+ var markdown = new U({ gfm: true });
48621
+ function markdownLinkTargets(body, references) {
48622
+ const tokens = markdown.lexer(body);
48623
+ const definitions = new Map;
48624
+ if (references) {
48625
+ markdown.walkTokens(tokens, (token) => {
48626
+ if (token.type !== "def")
48627
+ return;
48628
+ const definition = /^\s*\[([^\]]+)\]:\s*(\S+)/.exec(token.raw);
48629
+ if (definition)
48630
+ definitions.set(definition[1].trim().toLowerCase(), definition[2]);
48631
+ });
48632
+ }
48633
+ const targets = [];
48634
+ markdown.walkTokens(tokens, (token) => {
48635
+ if (token.type !== "link" && token.type !== "image")
48636
+ return;
48637
+ const inline = /^!?\[[\s\S]*\]\(/.test(token.raw);
48638
+ if (inline) {
48639
+ const angled = /\]\(\s*<[^>]*>(?:\s+["'(][\s\S]*["')])?\s*\)$/.test(token.raw);
48640
+ if (!angled)
48641
+ targets.push(token.href);
48642
+ return;
48643
+ }
48644
+ const reference = references && token.type === "link" ? /^\[[\s\S]*\]\[([^\]]+)\]$/.exec(token.raw) : null;
48645
+ const target = reference ? definitions.get(reference[1].trim().toLowerCase()) : undefined;
48646
+ if (target)
48647
+ targets.push(target);
48648
+ });
48649
+ return targets;
48650
+ }
48651
+
48652
+ // src/core/adapter/adapters/llm-wiki-adapter.ts
47137
48653
  var WIKI_COMPONENT_ID = "main";
47138
48654
  var WIKI_SOURCE_TYPE = "wiki-source";
47139
48655
  var DEFAULT_PAGE_KIND = "note";
@@ -47165,7 +48681,7 @@ function parseWikiFrontmatter(raw) {
47165
48681
  out.pageKind = nonEmptyString2(data.pageKind);
47166
48682
  out.wikiRole = nonEmptyString2(data.wikiRole);
47167
48683
  if (Array.isArray(data.xrefs)) {
47168
- out.xrefs = data.xrefs.filter((x) => typeof x === "string" && x.trim().length > 0).map((x) => x.trim());
48684
+ out.xrefs = data.xrefs.filter((x2) => typeof x2 === "string" && x2.trim().length > 0).map((x2) => x2.trim());
47169
48685
  }
47170
48686
  if (Array.isArray(data.sources)) {
47171
48687
  out.sources = data.sources.filter((s) => typeof s === "string" && s.trim().length > 0).map((s) => s.trim());
@@ -47192,12 +48708,10 @@ function resolveXref(xref, bundleId) {
47192
48708
  }
47193
48709
  function resolveBodyLinks(body, fileRelPath) {
47194
48710
  const dir = path37.posix.dirname(toPosix(fileRelPath));
47195
- const linkRe = /\[[^\]]*\]\(([^)]+)\)/g;
47196
48711
  const out = [];
47197
48712
  const seen = new Set;
47198
- let match;
47199
- while ((match = linkRe.exec(body)) !== null) {
47200
- let target = match[1].trim();
48713
+ for (const link of markdownLinkTargets(body, false)) {
48714
+ let target = link.trim();
47201
48715
  const wsIdx = target.search(/\s/);
47202
48716
  if (wsIdx >= 0)
47203
48717
  target = target.slice(0, wsIdx);
@@ -47440,8 +48954,8 @@ function parseActorMapping(value) {
47440
48954
  const by = nonEmptyString2(value.by);
47441
48955
  if (by === undefined)
47442
48956
  return;
47443
- const at = nonEmptyString2(value.at);
47444
- return at !== undefined ? { by, at } : { by };
48957
+ const at2 = nonEmptyString2(value.at);
48958
+ return at2 !== undefined ? { by, at: at2 } : { by };
47445
48959
  }
47446
48960
  function parseVerified(value) {
47447
48961
  if (value === undefined || value === null)
@@ -47493,24 +49007,10 @@ function isReservedFileName2(name) {
47493
49007
  }
47494
49008
  function resolveOkfLinks(body, fileRelPath) {
47495
49009
  const dir = path38.posix.dirname(toPosix(fileRelPath));
47496
- const definitions = new Map;
47497
- for (const match of body.matchAll(/^\s*\[([^\]]+)\]:\s*(\S+)/gm)) {
47498
- definitions.set(match[1].trim().toLowerCase(), match[2]);
47499
- }
47500
- const candidates = [];
47501
- for (const match of body.matchAll(/\[[^\]]*\]\(([^)]+)\)/g)) {
47502
- candidates.push({ index: match.index, target: match[1] });
47503
- }
47504
- for (const match of body.matchAll(/(?<!!)\[[^\]]*\]\[([^\]]+)\]/g)) {
47505
- const target = definitions.get(match[1].trim().toLowerCase());
47506
- if (target)
47507
- candidates.push({ index: match.index, target });
47508
- }
47509
- candidates.sort((a, b) => a.index - b.index);
47510
49010
  const out = [];
47511
49011
  const seen = new Set;
47512
- for (const candidate of candidates) {
47513
- let target = candidate.target.trim();
49012
+ for (const link of markdownLinkTargets(body, true)) {
49013
+ let target = link.trim();
47514
49014
  const wsIdx = target.search(/\s/);
47515
49015
  if (wsIdx >= 0)
47516
49016
  target = target.slice(0, wsIdx);
@@ -47728,7 +49228,7 @@ function dirExists2(p) {
47728
49228
  }
47729
49229
  }
47730
49230
  function opencodeLooksLikeRoot(root) {
47731
- if (CONFIG_FILES.some((f) => fileExists(path39.join(root, f))))
49231
+ if (CONFIG_FILES.some((f2) => fileExists(path39.join(root, f2))))
47732
49232
  return true;
47733
49233
  if (!fileExists(path39.join(root, "AGENTS.md")))
47734
49234
  return false;
@@ -47859,7 +49359,7 @@ var BUILTIN_ADAPTERS = Object.freeze([
47859
49359
  genericFilesAdapter
47860
49360
  ]);
47861
49361
  {
47862
- const actualIds = BUILTIN_ADAPTERS.map((a) => a.id);
49362
+ const actualIds = BUILTIN_ADAPTERS.map((a3) => a3.id);
47863
49363
  const expectedIds = [...ADAPTER_ID_TABLE];
47864
49364
  if (actualIds.length !== expectedIds.length || actualIds.some((id, i) => id !== expectedIds[i])) {
47865
49365
  throw new Error(`adapter-ids.ts ADAPTER_ID_TABLE (${expectedIds.join(", ")}) does not match ` + `BUILTIN_ADAPTERS (${actualIds.join(", ")}) — update adapter-ids.ts to match.`);
@@ -47867,7 +49367,7 @@ var BUILTIN_ADAPTERS = Object.freeze([
47867
49367
  }
47868
49368
 
47869
49369
  // src/core/adapter/registry.ts
47870
- var BY_ID = new Map(BUILTIN_ADAPTERS.map((a) => [a.id, a]));
49370
+ var BY_ID = new Map(BUILTIN_ADAPTERS.map((a3) => [a3.id, a3]));
47871
49371
  function getAdapters() {
47872
49372
  return [...BUILTIN_ADAPTERS];
47873
49373
  }
@@ -47901,7 +49401,7 @@ function extractIncludeList(pkg) {
47901
49401
  const { include } = config;
47902
49402
  if (!Array.isArray(include))
47903
49403
  continue;
47904
- const list = include.filter((v) => typeof v === "string").map((v) => v.trim()).filter(Boolean);
49404
+ const list = include.filter((v2) => typeof v2 === "string").map((v2) => v2.trim()).filter(Boolean);
47905
49405
  if (list.length > 0)
47906
49406
  return list;
47907
49407
  }
@@ -48548,8 +50048,8 @@ var WINDOWS_RESERVED_DEVICE_NAMES = new Set([
48548
50048
  "prn",
48549
50049
  "aux",
48550
50050
  "nul",
48551
- ...Array.from({ length: 9 }, (_, i) => `com${i + 1}`),
48552
- ...Array.from({ length: 9 }, (_, i) => `lpt${i + 1}`)
50051
+ ...Array.from({ length: 9 }, (_2, i) => `com${i + 1}`),
50052
+ ...Array.from({ length: 9 }, (_2, i) => `lpt${i + 1}`)
48553
50053
  ]);
48554
50054
  var pendingGitPaths = new Map;
48555
50055
 
@@ -48855,8 +50355,8 @@ var isName = function(string) {
48855
50355
  const match = regexName.exec(string);
48856
50356
  return !(match === null || typeof match === "undefined");
48857
50357
  };
48858
- function isExist(v) {
48859
- return typeof v !== "undefined";
50358
+ function isExist(v2) {
50359
+ return typeof v2 !== "undefined";
48860
50360
  }
48861
50361
  var DANGEROUS_PROPERTY_NAMES = [
48862
50362
  "hasOwnProperty",
@@ -49113,15 +50613,15 @@ function validateAttributeString(attrStr, options) {
49113
50613
  return true;
49114
50614
  }
49115
50615
  function validateNumberAmpersand(xmlData, i) {
49116
- let re = /\d/;
50616
+ let re2 = /\d/;
49117
50617
  if (xmlData[i] === "x") {
49118
50618
  i++;
49119
- re = /[\da-fA-F]/;
50619
+ re2 = /[\da-fA-F]/;
49120
50620
  }
49121
50621
  for (;i < xmlData.length; i++) {
49122
50622
  if (xmlData[i] === ";")
49123
50623
  return i;
49124
- if (!xmlData[i].match(re))
50624
+ if (!xmlData[i].match(re2))
49125
50625
  break;
49126
50626
  }
49127
50627
  return -1;
@@ -49386,14 +50886,14 @@ class EntityDecoder {
49386
50886
  i++;
49387
50887
  continue;
49388
50888
  }
49389
- let j = i + 1;
49390
- while (j < len && str2.charCodeAt(j) !== 59 && j - i <= 32)
49391
- j++;
49392
- if (j >= len || str2.charCodeAt(j) !== 59) {
50889
+ let j2 = i + 1;
50890
+ while (j2 < len && str2.charCodeAt(j2) !== 59 && j2 - i <= 32)
50891
+ j2++;
50892
+ if (j2 >= len || str2.charCodeAt(j2) !== 59) {
49393
50893
  i++;
49394
50894
  continue;
49395
50895
  }
49396
- const token = str2.slice(i + 1, j);
50896
+ const token = str2.slice(i + 1, j2);
49397
50897
  if (token.length === 0) {
49398
50898
  i++;
49399
50899
  continue;
@@ -49428,7 +50928,7 @@ class EntityDecoder {
49428
50928
  if (i > last)
49429
50929
  chunks.push(str2.slice(last, i));
49430
50930
  chunks.push(replacement);
49431
- last = j + 1;
50931
+ last = j2 + 1;
49432
50932
  i = last;
49433
50933
  if (checkLimits && this._tierCounts(tier)) {
49434
50934
  if (limitExpansions) {
@@ -49965,8 +51465,8 @@ var skipWhitespace = (data, index) => {
49965
51465
  return index;
49966
51466
  };
49967
51467
  function hasSeq(data, seq, i) {
49968
- for (let j = 0;j < seq.length; j++) {
49969
- if (seq[j] !== data[i + j + 1])
51468
+ for (let j2 = 0;j2 < seq.length; j2++) {
51469
+ if (seq[j2] !== data[i + j2 + 1])
49970
51470
  return false;
49971
51471
  }
49972
51472
  return true;
@@ -52532,7 +54032,7 @@ var listFormatters = [{ command: "list", handler: (r) => formatListPlain(r) }];
52532
54032
  var flat = (s) => s.replace(/\s*\r?\n\s*/g, " ");
52533
54033
  function renderTable2(table) {
52534
54034
  const all = [table.headers, ...table.rows].map((r) => r.map(flat));
52535
- const widths = table.headers.map((_, i) => Math.max(...all.map((r) => (r[i] ?? "").length)));
54035
+ const widths = table.headers.map((_2, i) => Math.max(...all.map((r) => (r[i] ?? "").length)));
52536
54036
  const line = (r) => ` ${r.map((c, i) => c.padEnd(widths[i] ?? 0)).join(" ")}`.trimEnd();
52537
54037
  return [`${table.title}:`, ...all.map(line)];
52538
54038
  }
@@ -52879,8 +54379,8 @@ function dirSizeBytes(target) {
52879
54379
  return total;
52880
54380
  }
52881
54381
  function sizeOf(target) {
52882
- const st = fs42.statSync(target);
52883
- return st.isDirectory() ? dirSizeBytes(target) : st.size;
54382
+ const st2 = fs42.statSync(target);
54383
+ return st2.isDirectory() ? dirSizeBytes(target) : st2.size;
52884
54384
  }
52885
54385
  function hostResidue() {
52886
54386
  const data = getDataDir();
@@ -53153,10 +54653,10 @@ function classifyTaskV3Uses(value) {
53153
54653
  if (error2 instanceof UsageError && /agent ref|task ref/i.test(error2.message))
53154
54654
  throw error2;
53155
54655
  }
53156
- const at = value.lastIndexOf("@");
53157
- if (at > 0 && at === value.indexOf("@")) {
53158
- const locator = value.slice(0, at);
53159
- const revision = value.slice(at + 1);
54656
+ const at2 = value.lastIndexOf("@");
54657
+ if (at2 > 0 && at2 === value.indexOf("@")) {
54658
+ const locator = value.slice(0, at2);
54659
+ const revision = value.slice(at2 + 1);
53160
54660
  const segments = locator.split("/");
53161
54661
  const [owner, repository, ...actionPath] = segments;
53162
54662
  if (owner && repository && GITHUB_OWNER.test(owner) && GITHUB_REPOSITORY.test(repository) && repository !== "." && repository !== ".." && actionPath.every((segment) => GITHUB_ACTION_PATH_SEGMENT.test(segment) && segment !== "." && segment !== "..") && validGithubRevision(revision)) {
@@ -54061,7 +55561,7 @@ function walkTasks(root, tasksDir, out) {
54061
55561
  if (!contained2(physicalRoot, physicalDirectory)) {
54062
55562
  throw migrationError(`${directory} resolves outside bundle ${root.bundleId}.`);
54063
55563
  }
54064
- for (const entry of fs43.readdirSync(directory, { withFileTypes: true }).sort((a, b) => a.name.localeCompare(b.name))) {
55564
+ for (const entry of fs43.readdirSync(directory, { withFileTypes: true }).sort((a3, b) => a3.name.localeCompare(b.name))) {
54065
55565
  const candidate = path51.join(directory, entry.name);
54066
55566
  if (entry.isSymbolicLink())
54067
55567
  throw migrationError(`task migration does not follow symbolic link ${candidate}.`);
@@ -54087,7 +55587,7 @@ function walkTasks(root, tasksDir, out) {
54087
55587
  }
54088
55588
  function inspectTaskFiles(roots) {
54089
55589
  const files = [];
54090
- for (const root of [...roots].sort((a, b) => a.bundleId.localeCompare(b.bundleId))) {
55590
+ for (const root of [...roots].sort((a3, b) => a3.bundleId.localeCompare(b.bundleId))) {
54091
55591
  const tasksDir = root.layout === "akm-task" ? root.root : path51.join(root.root, "tasks");
54092
55592
  try {
54093
55593
  const stat = fs43.lstatSync(tasksDir);
@@ -54102,7 +55602,7 @@ function inspectTaskFiles(roots) {
54102
55602
  }
54103
55603
  walkTasks(root, tasksDir, files);
54104
55604
  }
54105
- return files.sort((a, b) => a.filePath.localeCompare(b.filePath));
55605
+ return files.sort((a3, b) => a3.filePath.localeCompare(b.filePath));
54106
55606
  }
54107
55607
  function planTaskFilesMigration(inputs) {
54108
55608
  return taskToV4PlanFromOutcomes(inputs.map(planTaskToV4File));