@forsakringskassan/docs-generator 3.12.1 → 3.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1344,6 +1344,9 @@ var init_dist = __esm({
1344
1344
  });
1345
1345
 
1346
1346
  // node_modules/dompurify/dist/purify.es.mjs
1347
+ function _OverloadYield(e3, d3) {
1348
+ this.v = e3, this.k = d3;
1349
+ }
1347
1350
  function _arrayLikeToArray(r2, a2) {
1348
1351
  (null == a2 || a2 > r2.length) && (a2 = r2.length);
1349
1352
  for (var e3 = 0, n2 = Array(a2); e3 < a2; e3++) n2[e3] = r2[e3];
@@ -1357,8 +1360,10 @@ function _iterableToArrayLimit(r2, l4) {
1357
1360
  if (null != t4) {
1358
1361
  var e3, n2, i4, u2, a2 = [], f2 = true, o2 = false;
1359
1362
  try {
1360
- if (i4 = (t4 = t4.call(r2)).next, 0 === l4) ;
1361
- else for (; !(f2 = (e3 = i4.call(t4)).done) && (a2.push(e3.value), a2.length !== l4); f2 = true) ;
1363
+ if (i4 = (t4 = t4.call(r2)).next, 0 === l4) {
1364
+ if (Object(t4) !== t4) return;
1365
+ f2 = false;
1366
+ } else for (; !(f2 = (e3 = i4.call(t4)).done) && (a2.push(e3.value), a2.length !== l4); f2 = true) ;
1362
1367
  } catch (r3) {
1363
1368
  o2 = true, n2 = r3;
1364
1369
  } finally {
@@ -1384,42 +1389,68 @@ function _unsupportedIterableToArray(r2, a2) {
1384
1389
  return "Object" === t4 && r2.constructor && (t4 = r2.constructor.name), "Map" === t4 || "Set" === t4 ? Array.from(r2) : "Arguments" === t4 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t4) ? _arrayLikeToArray(r2, a2) : void 0;
1385
1390
  }
1386
1391
  }
1392
+ function AsyncGenerator(e3) {
1393
+ var t4, n2;
1394
+ function resume(t5, n3) {
1395
+ try {
1396
+ var r2 = e3[t5](n3), o2 = r2.value, u2 = o2 instanceof _OverloadYield;
1397
+ Promise.resolve(u2 ? o2.v : o2).then(function(n4) {
1398
+ if (u2) {
1399
+ var i4 = "return" === t5 && o2.k ? t5 : "next";
1400
+ if (!o2.k || n4.done) return resume(i4, n4);
1401
+ n4 = e3[i4](n4).value;
1402
+ }
1403
+ settle(!!r2.done, n4);
1404
+ }, function(e4) {
1405
+ resume("throw", e4);
1406
+ });
1407
+ } catch (e4) {
1408
+ settle(2, e4);
1409
+ }
1410
+ }
1411
+ function settle(e4, r2) {
1412
+ 2 === e4 ? t4.reject(r2) : t4.resolve({
1413
+ value: r2,
1414
+ done: e4
1415
+ }), (t4 = t4.next) ? resume(t4.key, t4.arg) : n2 = null;
1416
+ }
1417
+ this._invoke = function(e4, r2) {
1418
+ return new Promise(function(o2, u2) {
1419
+ var i4 = {
1420
+ key: e4,
1421
+ arg: r2,
1422
+ resolve: o2,
1423
+ reject: u2,
1424
+ next: null
1425
+ };
1426
+ n2 ? n2 = n2.next = i4 : (t4 = n2 = i4, resume(e4, r2));
1427
+ });
1428
+ }, "function" != typeof e3.return && (this.return = void 0);
1429
+ }
1387
1430
  function unapply(func) {
1388
1431
  return function(thisArg) {
1389
- if (thisArg instanceof RegExp) {
1390
- thisArg.lastIndex = 0;
1391
- }
1392
- for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
1393
- args[_key3 - 1] = arguments[_key3];
1394
- }
1432
+ if (thisArg instanceof RegExp) thisArg.lastIndex = 0;
1433
+ for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) args[_key3 - 1] = arguments[_key3];
1395
1434
  return apply(func, thisArg, args);
1396
1435
  };
1397
1436
  }
1398
1437
  function unconstruct(Func) {
1399
1438
  return function() {
1400
- for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
1401
- args[_key4] = arguments[_key4];
1402
- }
1439
+ for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) args[_key4] = arguments[_key4];
1403
1440
  return construct(Func, args);
1404
1441
  };
1405
1442
  }
1406
1443
  function addToSet(set5, array4) {
1407
1444
  let transformCaseFunc = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : stringToLowerCase;
1408
- if (setPrototypeOf) {
1409
- setPrototypeOf(set5, null);
1410
- }
1411
- if (!arrayIsArray(array4)) {
1412
- return set5;
1413
- }
1445
+ if (setPrototypeOf) setPrototypeOf(set5, null);
1446
+ if (!arrayIsArray(array4)) return set5;
1414
1447
  let l4 = array4.length;
1415
1448
  while (l4--) {
1416
1449
  let element3 = array4[l4];
1417
1450
  if (typeof element3 === "string") {
1418
1451
  const lcElement = transformCaseFunc(element3);
1419
1452
  if (lcElement !== element3) {
1420
- if (!isFrozen(array4)) {
1421
- array4[l4] = lcElement;
1422
- }
1453
+ if (!isFrozen(array4)) array4[l4] = lcElement;
1423
1454
  element3 = lcElement;
1424
1455
  }
1425
1456
  }
@@ -1428,12 +1459,7 @@ function addToSet(set5, array4) {
1428
1459
  return set5;
1429
1460
  }
1430
1461
  function cleanArray(array4) {
1431
- for (let index = 0; index < array4.length; index++) {
1432
- const isPropertyExist = objectHasOwnProperty(array4, index);
1433
- if (!isPropertyExist) {
1434
- array4[index] = null;
1435
- }
1436
- }
1462
+ for (let index = 0; index < array4.length; index++) if (!objectHasOwnProperty(array4, index)) array4[index] = null;
1437
1463
  return array4;
1438
1464
  }
1439
1465
  function clone(object3) {
@@ -1442,44 +1468,31 @@ function clone(object3) {
1442
1468
  var _ref3 = _slicedToArray(_ref2, 2);
1443
1469
  const property3 = _ref3[0];
1444
1470
  const value2 = _ref3[1];
1445
- const isPropertyExist = objectHasOwnProperty(object3, property3);
1446
- if (isPropertyExist) {
1447
- if (arrayIsArray(value2)) {
1448
- newObject[property3] = cleanArray(value2);
1449
- } else if (value2 && typeof value2 === "object" && value2.constructor === Object) {
1450
- newObject[property3] = clone(value2);
1451
- } else {
1452
- newObject[property3] = value2;
1453
- }
1471
+ if (objectHasOwnProperty(object3, property3)) {
1472
+ if (arrayIsArray(value2)) newObject[property3] = cleanArray(value2);
1473
+ else if (value2 && typeof value2 === "object" && value2.constructor === Object) newObject[property3] = clone(value2);
1474
+ else newObject[property3] = value2;
1454
1475
  }
1455
1476
  }
1456
1477
  return newObject;
1457
1478
  }
1458
1479
  function stringifyValue(value2) {
1459
1480
  switch (typeof value2) {
1460
- case "string": {
1481
+ case "string":
1461
1482
  return value2;
1462
- }
1463
- case "number": {
1483
+ case "number":
1464
1484
  return numberToString(value2);
1465
- }
1466
- case "boolean": {
1485
+ case "boolean":
1467
1486
  return booleanToString(value2);
1468
- }
1469
- case "bigint": {
1487
+ case "bigint":
1470
1488
  return bigintToString ? bigintToString(value2) : "0";
1471
- }
1472
- case "symbol": {
1489
+ case "symbol":
1473
1490
  return symbolToString ? symbolToString(value2) : "Symbol()";
1474
- }
1475
- case "undefined": {
1491
+ case "undefined":
1476
1492
  return objectToString(value2);
1477
- }
1478
1493
  case "function":
1479
1494
  case "object": {
1480
- if (value2 === null) {
1481
- return objectToString(value2);
1482
- }
1495
+ if (value2 === null) return objectToString(value2);
1483
1496
  const valueAsRecord = value2;
1484
1497
  const valueToString = lookupGetter(valueAsRecord, "toString");
1485
1498
  if (typeof valueToString === "function") {
@@ -1488,21 +1501,16 @@ function stringifyValue(value2) {
1488
1501
  }
1489
1502
  return objectToString(value2);
1490
1503
  }
1491
- default: {
1504
+ default:
1492
1505
  return objectToString(value2);
1493
- }
1494
1506
  }
1495
1507
  }
1496
1508
  function lookupGetter(object3, prop) {
1497
1509
  while (object3 !== null) {
1498
1510
  const desc = getOwnPropertyDescriptor(object3, prop);
1499
1511
  if (desc) {
1500
- if (desc.get) {
1501
- return unapply(desc.get);
1502
- }
1503
- if (typeof desc.value === "function") {
1504
- return unapply(desc.value);
1505
- }
1512
+ if (desc.get) return unapply(desc.get);
1513
+ if (typeof desc.value === "function") return unapply(desc.value);
1506
1514
  }
1507
1515
  object3 = getPrototypeOf(object3);
1508
1516
  }
@@ -1522,7 +1530,7 @@ function isRegex(value2) {
1522
1530
  function createDOMPurify() {
1523
1531
  let window3 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : getGlobal();
1524
1532
  const DOMPurify = (root4) => createDOMPurify(root4);
1525
- DOMPurify.version = "3.4.15";
1533
+ DOMPurify.version = "3.4.16";
1526
1534
  DOMPurify.removed = [];
1527
1535
  if (!window3 || !window3.document || window3.document.nodeType !== NODE_TYPE.document || !window3.Element) {
1528
1536
  DOMPurify.isSupported = false;
@@ -1532,8 +1540,8 @@ function createDOMPurify() {
1532
1540
  const originalDocument = document2;
1533
1541
  const currentScript = originalDocument.currentScript;
1534
1542
  window3.DocumentFragment;
1535
- const HTMLTemplateElement = window3.HTMLTemplateElement, Node2 = window3.Node, Element3 = window3.Element, NodeFilter = window3.NodeFilter, _window$NamedNodeMap = window3.NamedNodeMap;
1536
- _window$NamedNodeMap === void 0 ? window3.NamedNodeMap || window3.MozNamedAttrMap : _window$NamedNodeMap;
1543
+ const HTMLTemplateElement = window3.HTMLTemplateElement, Node2 = window3.Node, Element3 = window3.Element, NodeFilter = window3.NodeFilter;
1544
+ window3.NamedNodeMap === void 0 && (window3.NamedNodeMap || window3.MozNamedAttrMap);
1537
1545
  window3.HTMLFormElement;
1538
1546
  const DOMParser2 = window3.DOMParser, trustedTypes = window3.trustedTypes;
1539
1547
  const ElementPrototype = Element3.prototype;
@@ -1556,9 +1564,7 @@ function createDOMPurify() {
1556
1564
  };
1557
1565
  if (typeof HTMLTemplateElement === "function") {
1558
1566
  const template = document2.createElement("template");
1559
- if (template.content && template.content.ownerDocument) {
1560
- document2 = template.content.ownerDocument;
1561
- }
1567
+ if (template.content && template.content.ownerDocument) document2 = template.content.ownerDocument;
1562
1568
  }
1563
1569
  let trustedTypesPolicy;
1564
1570
  let emptyHTML = "";
@@ -1566,9 +1572,7 @@ function createDOMPurify() {
1566
1572
  let defaultTrustedTypesPolicyResolved = false;
1567
1573
  let IN_TRUSTED_TYPES_POLICY = 0;
1568
1574
  const _assertNotInTrustedTypesPolicy = function _assertNotInTrustedTypesPolicy2() {
1569
- if (IN_TRUSTED_TYPES_POLICY > 0) {
1570
- throw typeErrorCreate('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.');
1571
- }
1575
+ if (IN_TRUSTED_TYPES_POLICY > 0) throw typeErrorCreate('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.');
1572
1576
  };
1573
1577
  const _createTrustedHTML = function _createTrustedHTML2(html2) {
1574
1578
  _assertNotInTrustedTypesPolicy();
@@ -1602,9 +1606,20 @@ function createDOMPurify() {
1602
1606
  const MUSTACHE_EXPR$1 = MUSTACHE_EXPR, ERB_EXPR$1 = ERB_EXPR, TMPLIT_EXPR$1 = TMPLIT_EXPR, DATA_ATTR$1 = DATA_ATTR, ARIA_ATTR$1 = ARIA_ATTR, IS_SCRIPT_OR_DATA$1 = IS_SCRIPT_OR_DATA, ATTR_WHITESPACE$1 = ATTR_WHITESPACE, CUSTOM_ELEMENT$1 = CUSTOM_ELEMENT;
1603
1607
  let IS_ALLOWED_URI$1 = IS_ALLOWED_URI;
1604
1608
  let ALLOWED_TAGS = null;
1605
- const DEFAULT_ALLOWED_TAGS = addToSet({}, [...html$1, ...svg$1, ...svgFilters, ...mathMl$1, ...text]);
1609
+ const DEFAULT_ALLOWED_TAGS = addToSet({}, [
1610
+ ...html$1,
1611
+ ...svg$1,
1612
+ ...svgFilters,
1613
+ ...mathMl$1,
1614
+ ...text
1615
+ ]);
1606
1616
  let ALLOWED_ATTR = null;
1607
- const DEFAULT_ALLOWED_ATTR = addToSet({}, [...html, ...svg, ...mathMl, ...xml]);
1617
+ const DEFAULT_ALLOWED_ATTR = addToSet({}, [
1618
+ ...html,
1619
+ ...svg,
1620
+ ...mathMl,
1621
+ ...xml
1622
+ ]);
1608
1623
  let CUSTOM_ELEMENT_HANDLING = Object.seal(create(null, {
1609
1624
  tagNameCheck: {
1610
1625
  writable: true,
@@ -1681,15 +1696,6 @@ function createDOMPurify() {
1681
1696
  "noscript",
1682
1697
  "plaintext",
1683
1698
  "script",
1684
- // <selectedcontent> mirrors the selected <option>'s subtree, cloned by
1685
- // the UA (customizable <select>) — including any on* handlers — and the
1686
- // engine re-mirrors synchronously whenever a removal changes which
1687
- // option/selectedcontent is current, even inside DOMPurify's inert
1688
- // DOMParser document. Hoisting its children on removal re-inserts a fresh
1689
- // mirror target ahead of the walk, which the engine refills, looping
1690
- // forever (DoS) and amplifying output. Dropping its content on removal
1691
- // (rather than hoisting) breaks that cascade; the content is a duplicate
1692
- // of the option, which is sanitized on its own. See campaign-3 F1/F6.
1693
1699
  "selectedcontent",
1694
1700
  "style",
1695
1701
  "svg",
@@ -1700,21 +1706,59 @@ function createDOMPurify() {
1700
1706
  "xmp"
1701
1707
  ]);
1702
1708
  let DATA_URI_TAGS = null;
1703
- const DEFAULT_DATA_URI_TAGS = addToSet({}, ["audio", "video", "img", "source", "image", "track"]);
1709
+ const DEFAULT_DATA_URI_TAGS = addToSet({}, [
1710
+ "audio",
1711
+ "video",
1712
+ "img",
1713
+ "source",
1714
+ "image",
1715
+ "track"
1716
+ ]);
1704
1717
  let URI_SAFE_ATTRIBUTES = null;
1705
- const DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]);
1718
+ const DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, [
1719
+ "alt",
1720
+ "class",
1721
+ "for",
1722
+ "id",
1723
+ "label",
1724
+ "name",
1725
+ "pattern",
1726
+ "placeholder",
1727
+ "role",
1728
+ "summary",
1729
+ "title",
1730
+ "value",
1731
+ "style",
1732
+ "xmlns"
1733
+ ]);
1706
1734
  const MATHML_NAMESPACE = "http://www.w3.org/1998/Math/MathML";
1707
1735
  const SVG_NAMESPACE = "http://www.w3.org/2000/svg";
1708
1736
  const HTML_NAMESPACE = "http://www.w3.org/1999/xhtml";
1709
1737
  let NAMESPACE2 = HTML_NAMESPACE;
1710
1738
  let IS_EMPTY_INPUT = false;
1711
1739
  let ALLOWED_NAMESPACES = null;
1712
- const DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE], stringToString);
1713
- const DEFAULT_MATHML_TEXT_INTEGRATION_POINTS = freeze(["mi", "mo", "mn", "ms", "mtext"]);
1740
+ const DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [
1741
+ MATHML_NAMESPACE,
1742
+ SVG_NAMESPACE,
1743
+ HTML_NAMESPACE
1744
+ ], stringToString);
1745
+ const DEFAULT_MATHML_TEXT_INTEGRATION_POINTS = freeze([
1746
+ "mi",
1747
+ "mo",
1748
+ "mn",
1749
+ "ms",
1750
+ "mtext"
1751
+ ]);
1714
1752
  let MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, DEFAULT_MATHML_TEXT_INTEGRATION_POINTS);
1715
1753
  const DEFAULT_HTML_INTEGRATION_POINTS = freeze(["annotation-xml"]);
1716
1754
  let HTML_INTEGRATION_POINTS = addToSet({}, DEFAULT_HTML_INTEGRATION_POINTS);
1717
- const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, ["title", "style", "font", "a", "script"]);
1755
+ const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, [
1756
+ "title",
1757
+ "style",
1758
+ "font",
1759
+ "a",
1760
+ "script"
1761
+ ]);
1718
1762
  let PARSER_MEDIA_TYPE = null;
1719
1763
  const SUPPORTED_PARSER_MEDIA_TYPES = ["application/xhtml+xml", "text/html"];
1720
1764
  const DEFAULT_PARSER_MEDIA_TYPE = "text/html";
@@ -1726,25 +1770,14 @@ function createDOMPurify() {
1726
1770
  };
1727
1771
  const _parseConfig = function _parseConfig2() {
1728
1772
  let cfg = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
1729
- if (CONFIG && CONFIG === cfg) {
1730
- return;
1731
- }
1732
- if (!cfg || typeof cfg !== "object") {
1733
- cfg = {};
1734
- }
1773
+ if (CONFIG && CONFIG === cfg) return;
1774
+ if (!cfg || typeof cfg !== "object") cfg = {};
1735
1775
  cfg = clone(cfg);
1736
- PARSER_MEDIA_TYPE = // eslint-disable-next-line unicorn/prefer-includes
1737
- SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? DEFAULT_PARSER_MEDIA_TYPE : cfg.PARSER_MEDIA_TYPE;
1776
+ PARSER_MEDIA_TYPE = SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? DEFAULT_PARSER_MEDIA_TYPE : cfg.PARSER_MEDIA_TYPE;
1738
1777
  transformCaseFunc = PARSER_MEDIA_TYPE === "application/xhtml+xml" ? stringToString : stringToLowerCase;
1739
- ALLOWED_TAGS = _resolveSetOption(cfg, "ALLOWED_TAGS", DEFAULT_ALLOWED_TAGS, {
1740
- transform: transformCaseFunc
1741
- });
1742
- ALLOWED_ATTR = _resolveSetOption(cfg, "ALLOWED_ATTR", DEFAULT_ALLOWED_ATTR, {
1743
- transform: transformCaseFunc
1744
- });
1745
- ALLOWED_NAMESPACES = _resolveSetOption(cfg, "ALLOWED_NAMESPACES", DEFAULT_ALLOWED_NAMESPACES, {
1746
- transform: stringToString
1747
- });
1778
+ ALLOWED_TAGS = _resolveSetOption(cfg, "ALLOWED_TAGS", DEFAULT_ALLOWED_TAGS, { transform: transformCaseFunc });
1779
+ ALLOWED_ATTR = _resolveSetOption(cfg, "ALLOWED_ATTR", DEFAULT_ALLOWED_ATTR, { transform: transformCaseFunc });
1780
+ ALLOWED_NAMESPACES = _resolveSetOption(cfg, "ALLOWED_NAMESPACES", DEFAULT_ALLOWED_NAMESPACES, { transform: stringToString });
1748
1781
  URI_SAFE_ATTRIBUTES = _resolveSetOption(cfg, "ADD_URI_SAFE_ATTR", DEFAULT_URI_SAFE_ATTRIBUTES, {
1749
1782
  transform: transformCaseFunc,
1750
1783
  base: DEFAULT_URI_SAFE_ATTRIBUTES
@@ -1753,15 +1786,9 @@ function createDOMPurify() {
1753
1786
  transform: transformCaseFunc,
1754
1787
  base: DEFAULT_DATA_URI_TAGS
1755
1788
  });
1756
- FORBID_CONTENTS = _resolveSetOption(cfg, "FORBID_CONTENTS", DEFAULT_FORBID_CONTENTS, {
1757
- transform: transformCaseFunc
1758
- });
1759
- FORBID_TAGS = _resolveSetOption(cfg, "FORBID_TAGS", clone({}), {
1760
- transform: transformCaseFunc
1761
- });
1762
- FORBID_ATTR = _resolveSetOption(cfg, "FORBID_ATTR", clone({}), {
1763
- transform: transformCaseFunc
1764
- });
1789
+ FORBID_CONTENTS = _resolveSetOption(cfg, "FORBID_CONTENTS", DEFAULT_FORBID_CONTENTS, { transform: transformCaseFunc });
1790
+ FORBID_TAGS = _resolveSetOption(cfg, "FORBID_TAGS", clone({}), { transform: transformCaseFunc });
1791
+ FORBID_ATTR = _resolveSetOption(cfg, "FORBID_ATTR", clone({}), { transform: transformCaseFunc });
1765
1792
  USE_PROFILES = objectHasOwnProperty(cfg, "USE_PROFILES") ? cfg.USE_PROFILES && typeof cfg.USE_PROFILES === "object" ? clone(cfg.USE_PROFILES) : cfg.USE_PROFILES : false;
1766
1793
  ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false;
1767
1794
  ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false;
@@ -1780,36 +1807,16 @@ function createDOMPurify() {
1780
1807
  IN_PLACE = cfg.IN_PLACE || false;
1781
1808
  IS_ALLOWED_URI$1 = isRegex(cfg.ALLOWED_URI_REGEXP) ? cfg.ALLOWED_URI_REGEXP : IS_ALLOWED_URI;
1782
1809
  NAMESPACE2 = typeof cfg.NAMESPACE === "string" ? cfg.NAMESPACE : HTML_NAMESPACE;
1783
- MATHML_TEXT_INTEGRATION_POINTS = _resolveObjectOption(
1784
- cfg,
1785
- "MATHML_TEXT_INTEGRATION_POINTS",
1786
- () => addToSet({}, DEFAULT_MATHML_TEXT_INTEGRATION_POINTS)
1787
- // Default built-in map
1788
- );
1789
- HTML_INTEGRATION_POINTS = _resolveObjectOption(
1790
- cfg,
1791
- "HTML_INTEGRATION_POINTS",
1792
- () => addToSet({}, DEFAULT_HTML_INTEGRATION_POINTS)
1793
- // Default built-in map
1794
- );
1810
+ MATHML_TEXT_INTEGRATION_POINTS = _resolveObjectOption(cfg, "MATHML_TEXT_INTEGRATION_POINTS", () => addToSet({}, DEFAULT_MATHML_TEXT_INTEGRATION_POINTS));
1811
+ HTML_INTEGRATION_POINTS = _resolveObjectOption(cfg, "HTML_INTEGRATION_POINTS", () => addToSet({}, DEFAULT_HTML_INTEGRATION_POINTS));
1795
1812
  const customElementHandling = _resolveObjectOption(cfg, "CUSTOM_ELEMENT_HANDLING", () => create(null));
1796
1813
  CUSTOM_ELEMENT_HANDLING = create(null);
1797
- if (objectHasOwnProperty(customElementHandling, "tagNameCheck") && isRegexOrFunction(customElementHandling.tagNameCheck)) {
1798
- CUSTOM_ELEMENT_HANDLING.tagNameCheck = customElementHandling.tagNameCheck;
1799
- }
1800
- if (objectHasOwnProperty(customElementHandling, "attributeNameCheck") && isRegexOrFunction(customElementHandling.attributeNameCheck)) {
1801
- CUSTOM_ELEMENT_HANDLING.attributeNameCheck = customElementHandling.attributeNameCheck;
1802
- }
1803
- if (objectHasOwnProperty(customElementHandling, "allowCustomizedBuiltInElements") && typeof customElementHandling.allowCustomizedBuiltInElements === "boolean") {
1804
- CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = customElementHandling.allowCustomizedBuiltInElements;
1805
- }
1814
+ if (objectHasOwnProperty(customElementHandling, "tagNameCheck") && isRegexOrFunction(customElementHandling.tagNameCheck)) CUSTOM_ELEMENT_HANDLING.tagNameCheck = customElementHandling.tagNameCheck;
1815
+ if (objectHasOwnProperty(customElementHandling, "attributeNameCheck") && isRegexOrFunction(customElementHandling.attributeNameCheck)) CUSTOM_ELEMENT_HANDLING.attributeNameCheck = customElementHandling.attributeNameCheck;
1816
+ if (objectHasOwnProperty(customElementHandling, "allowCustomizedBuiltInElements") && typeof customElementHandling.allowCustomizedBuiltInElements === "boolean") CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = customElementHandling.allowCustomizedBuiltInElements;
1806
1817
  seal(CUSTOM_ELEMENT_HANDLING);
1807
- if (SAFE_FOR_TEMPLATES) {
1808
- ALLOW_DATA_ATTR = false;
1809
- }
1810
- if (RETURN_DOM_FRAGMENT) {
1811
- RETURN_DOM = true;
1812
- }
1818
+ if (SAFE_FOR_TEMPLATES) ALLOW_DATA_ATTR = false;
1819
+ if (RETURN_DOM_FRAGMENT) RETURN_DOM = true;
1813
1820
  if (USE_PROFILES) {
1814
1821
  ALLOWED_TAGS = addToSet({}, text);
1815
1822
  ALLOWED_ATTR = create(null);
@@ -1836,48 +1843,36 @@ function createDOMPurify() {
1836
1843
  EXTRA_ELEMENT_HANDLING.tagCheck = null;
1837
1844
  EXTRA_ELEMENT_HANDLING.attributeCheck = null;
1838
1845
  if (objectHasOwnProperty(cfg, "ADD_TAGS")) {
1839
- if (typeof cfg.ADD_TAGS === "function") {
1840
- EXTRA_ELEMENT_HANDLING.tagCheck = cfg.ADD_TAGS;
1841
- } else if (arrayIsArray(cfg.ADD_TAGS)) {
1842
- if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {
1843
- ALLOWED_TAGS = clone(ALLOWED_TAGS);
1844
- }
1846
+ if (typeof cfg.ADD_TAGS === "function") EXTRA_ELEMENT_HANDLING.tagCheck = cfg.ADD_TAGS;
1847
+ else if (arrayIsArray(cfg.ADD_TAGS)) {
1848
+ if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) ALLOWED_TAGS = clone(ALLOWED_TAGS);
1845
1849
  addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);
1846
1850
  }
1847
1851
  }
1848
1852
  if (objectHasOwnProperty(cfg, "ADD_ATTR")) {
1849
- if (typeof cfg.ADD_ATTR === "function") {
1850
- EXTRA_ELEMENT_HANDLING.attributeCheck = cfg.ADD_ATTR;
1851
- } else if (arrayIsArray(cfg.ADD_ATTR)) {
1852
- if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) {
1853
- ALLOWED_ATTR = clone(ALLOWED_ATTR);
1854
- }
1853
+ if (typeof cfg.ADD_ATTR === "function") EXTRA_ELEMENT_HANDLING.attributeCheck = cfg.ADD_ATTR;
1854
+ else if (arrayIsArray(cfg.ADD_ATTR)) {
1855
+ if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) ALLOWED_ATTR = clone(ALLOWED_ATTR);
1855
1856
  addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);
1856
1857
  }
1857
1858
  }
1858
1859
  if (objectHasOwnProperty(cfg, "ADD_FORBID_CONTENTS") && arrayIsArray(cfg.ADD_FORBID_CONTENTS)) {
1859
- if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) {
1860
- FORBID_CONTENTS = clone(FORBID_CONTENTS);
1861
- }
1860
+ if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) FORBID_CONTENTS = clone(FORBID_CONTENTS);
1862
1861
  addToSet(FORBID_CONTENTS, cfg.ADD_FORBID_CONTENTS, transformCaseFunc);
1863
1862
  }
1864
- if (KEEP_CONTENT) {
1865
- ALLOWED_TAGS["#text"] = true;
1866
- }
1867
- if (WHOLE_DOCUMENT) {
1868
- addToSet(ALLOWED_TAGS, ["html", "head", "body"]);
1869
- }
1863
+ if (KEEP_CONTENT) ALLOWED_TAGS["#text"] = true;
1864
+ if (WHOLE_DOCUMENT) addToSet(ALLOWED_TAGS, [
1865
+ "html",
1866
+ "head",
1867
+ "body"
1868
+ ]);
1870
1869
  if (ALLOWED_TAGS.table) {
1871
1870
  addToSet(ALLOWED_TAGS, ["tbody"]);
1872
1871
  delete FORBID_TAGS.tbody;
1873
1872
  }
1874
1873
  if (cfg.TRUSTED_TYPES_POLICY) {
1875
- if (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== "function") {
1876
- throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
1877
- }
1878
- if (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== "function") {
1879
- throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
1880
- }
1874
+ if (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== "function") throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
1875
+ if (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== "function") throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
1881
1876
  const previousTrustedTypesPolicy = trustedTypesPolicy;
1882
1877
  trustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY;
1883
1878
  try {
@@ -1890,85 +1885,55 @@ function createDOMPurify() {
1890
1885
  trustedTypesPolicy = void 0;
1891
1886
  emptyHTML = "";
1892
1887
  } else {
1893
- if (trustedTypesPolicy === void 0) {
1894
- trustedTypesPolicy = _getDefaultTrustedTypesPolicy();
1895
- }
1896
- if (trustedTypesPolicy && typeof emptyHTML === "string") {
1897
- emptyHTML = _createTrustedHTML("");
1898
- }
1899
- }
1900
- if (freeze) {
1901
- freeze(cfg);
1888
+ if (trustedTypesPolicy === void 0) trustedTypesPolicy = _getDefaultTrustedTypesPolicy();
1889
+ if (trustedTypesPolicy && typeof emptyHTML === "string") emptyHTML = _createTrustedHTML("");
1902
1890
  }
1891
+ if (freeze) freeze(cfg);
1903
1892
  CONFIG = cfg;
1904
1893
  };
1905
- const ALL_SVG_TAGS = addToSet({}, [...svg$1, ...svgFilters, ...svgDisallowed]);
1894
+ const ALL_SVG_TAGS = addToSet({}, [
1895
+ ...svg$1,
1896
+ ...svgFilters,
1897
+ ...svgDisallowed
1898
+ ]);
1906
1899
  const ALL_MATHML_TAGS = addToSet({}, [...mathMl$1, ...mathMlDisallowed]);
1907
1900
  const _checkSvgNamespace = function _checkSvgNamespace2(tagName, parent4, parentTagName) {
1908
- if (parent4.namespaceURI === HTML_NAMESPACE) {
1909
- return tagName === "svg";
1910
- }
1911
- if (parent4.namespaceURI === MATHML_NAMESPACE) {
1912
- return tagName === "svg" && (parentTagName === "annotation-xml" || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);
1913
- }
1901
+ if (parent4.namespaceURI === HTML_NAMESPACE) return tagName === "svg";
1902
+ if (parent4.namespaceURI === MATHML_NAMESPACE) return tagName === "svg" && (parentTagName === "annotation-xml" || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);
1914
1903
  return Boolean(ALL_SVG_TAGS[tagName]);
1915
1904
  };
1916
1905
  const _checkMathMlNamespace = function _checkMathMlNamespace2(tagName, parent4, parentTagName) {
1917
- if (parent4.namespaceURI === HTML_NAMESPACE) {
1918
- return tagName === "math";
1919
- }
1920
- if (parent4.namespaceURI === SVG_NAMESPACE) {
1921
- return tagName === "math" && HTML_INTEGRATION_POINTS[parentTagName];
1922
- }
1906
+ if (parent4.namespaceURI === HTML_NAMESPACE) return tagName === "math";
1907
+ if (parent4.namespaceURI === SVG_NAMESPACE) return tagName === "math" && HTML_INTEGRATION_POINTS[parentTagName];
1923
1908
  return Boolean(ALL_MATHML_TAGS[tagName]);
1924
1909
  };
1925
1910
  const _checkHtmlNamespace = function _checkHtmlNamespace2(tagName, parent4, parentTagName) {
1926
- if (parent4.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) {
1927
- return false;
1928
- }
1929
- if (parent4.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) {
1930
- return false;
1931
- }
1911
+ if (parent4.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) return false;
1912
+ if (parent4.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) return false;
1932
1913
  return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]);
1933
1914
  };
1934
1915
  const _checkValidNamespace = function _checkValidNamespace2(element3) {
1935
1916
  let parent4 = getParentNode(element3);
1936
- if (!parent4 || !parent4.tagName) {
1937
- parent4 = {
1938
- namespaceURI: NAMESPACE2,
1939
- tagName: "template"
1940
- };
1941
- }
1917
+ if (!parent4 || !parent4.tagName) parent4 = {
1918
+ namespaceURI: NAMESPACE2,
1919
+ tagName: "template"
1920
+ };
1942
1921
  const tagName = stringToLowerCase(element3.tagName);
1943
1922
  const parentTagName = stringToLowerCase(parent4.tagName);
1944
- if (!ALLOWED_NAMESPACES[element3.namespaceURI]) {
1945
- return false;
1946
- }
1947
- if (element3.namespaceURI === SVG_NAMESPACE) {
1948
- return _checkSvgNamespace(tagName, parent4, parentTagName);
1949
- }
1950
- if (element3.namespaceURI === MATHML_NAMESPACE) {
1951
- return _checkMathMlNamespace(tagName, parent4, parentTagName);
1952
- }
1953
- if (element3.namespaceURI === HTML_NAMESPACE) {
1954
- return _checkHtmlNamespace(tagName, parent4, parentTagName);
1955
- }
1956
- if (PARSER_MEDIA_TYPE === "application/xhtml+xml" && ALLOWED_NAMESPACES[element3.namespaceURI]) {
1957
- return true;
1958
- }
1923
+ if (!ALLOWED_NAMESPACES[element3.namespaceURI]) return false;
1924
+ if (element3.namespaceURI === SVG_NAMESPACE) return _checkSvgNamespace(tagName, parent4, parentTagName);
1925
+ if (element3.namespaceURI === MATHML_NAMESPACE) return _checkMathMlNamespace(tagName, parent4, parentTagName);
1926
+ if (element3.namespaceURI === HTML_NAMESPACE) return _checkHtmlNamespace(tagName, parent4, parentTagName);
1927
+ if (PARSER_MEDIA_TYPE === "application/xhtml+xml" && ALLOWED_NAMESPACES[element3.namespaceURI]) return true;
1959
1928
  return false;
1960
1929
  };
1961
1930
  const _forceRemove = function _forceRemove2(node2) {
1962
- arrayPush(DOMPurify.removed, {
1963
- element: node2
1964
- });
1931
+ arrayPush(DOMPurify.removed, { element: node2 });
1965
1932
  try {
1966
1933
  getParentNode(node2).removeChild(node2);
1967
1934
  } catch (_3) {
1968
1935
  remove3(node2);
1969
- if (!getParentNode(node2)) {
1970
- throw typeErrorCreate("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place");
1971
- }
1936
+ if (!getParentNode(node2)) throw typeErrorCreate("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place");
1972
1937
  }
1973
1938
  };
1974
1939
  const _stripAttributeNode = function _stripAttributeNode2(element3, attribute, name) {
@@ -1997,34 +1962,25 @@ function createDOMPurify() {
1997
1962
  });
1998
1963
  }
1999
1964
  const attributes = getAttributes(root4);
2000
- if (attributes) {
2001
- for (let i4 = attributes.length - 1; i4 >= 0; --i4) {
2002
- const attribute = attributes[i4];
2003
- const name = attribute && attribute.name;
2004
- if (typeof name === "string") {
2005
- _stripAttributeNode(root4, attribute, name);
2006
- }
2007
- }
1965
+ if (attributes) for (let i4 = attributes.length - 1; i4 >= 0; --i4) {
1966
+ const attribute = attributes[i4];
1967
+ const name = attribute && attribute.name;
1968
+ if (typeof name === "string") _stripAttributeNode(root4, attribute, name);
2008
1969
  }
2009
1970
  };
2010
1971
  const _removeAttribute = function _removeAttribute2(name, element3, attr) {
2011
- if (!attr) {
2012
- try {
2013
- attr = element3.getAttributeNode(name);
2014
- } catch (_3) {
2015
- attr = null;
2016
- }
1972
+ if (!attr) try {
1973
+ attr = element3.getAttributeNode(name);
1974
+ } catch (_3) {
1975
+ attr = null;
2017
1976
  }
2018
1977
  arrayPush(DOMPurify.removed, {
2019
1978
  attribute: attr || null,
2020
1979
  from: element3
2021
1980
  });
2022
1981
  try {
2023
- if (attr) {
2024
- removeAttributeNode(element3, attr);
2025
- } else {
2026
- element3.removeAttribute(name);
2027
- }
1982
+ if (attr) removeAttributeNode(element3, attr);
1983
+ else element3.removeAttribute(name);
2028
1984
  } catch (_3) {
2029
1985
  try {
2030
1986
  element3.removeAttribute(name);
@@ -2032,30 +1988,23 @@ function createDOMPurify() {
2032
1988
  }
2033
1989
  }
2034
1990
  if (name === "is") {
2035
- if (RETURN_DOM || RETURN_DOM_FRAGMENT) {
2036
- try {
2037
- _forceRemove(element3);
2038
- } catch (_3) {
2039
- }
2040
- } else {
2041
- try {
2042
- element3.setAttribute(name, "");
2043
- } catch (_3) {
2044
- }
1991
+ if (RETURN_DOM || RETURN_DOM_FRAGMENT) try {
1992
+ _forceRemove(element3);
1993
+ } catch (_3) {
1994
+ }
1995
+ else try {
1996
+ element3.setAttribute(name, "");
1997
+ } catch (_3) {
2045
1998
  }
2046
1999
  }
2047
2000
  };
2048
2001
  const _stripDisallowedAttributes = function _stripDisallowedAttributes2(element3) {
2049
2002
  const attributes = getAttributes(element3);
2050
- if (!attributes) {
2051
- return;
2052
- }
2003
+ if (!attributes) return;
2053
2004
  for (let i4 = attributes.length - 1; i4 >= 0; --i4) {
2054
2005
  const attribute = attributes[i4];
2055
2006
  const name = attribute && attribute.name;
2056
- if (typeof name !== "string" || ALLOWED_ATTR[transformCaseFunc(name)]) {
2057
- continue;
2058
- }
2007
+ if (typeof name !== "string" || ALLOWED_ATTR[transformCaseFunc(name)]) continue;
2059
2008
  _stripAttributeNode(element3, attribute, name);
2060
2009
  }
2061
2010
  };
@@ -2063,31 +2012,18 @@ function createDOMPurify() {
2063
2012
  const stack = [root4];
2064
2013
  while (stack.length > 0) {
2065
2014
  const node2 = stack.pop();
2066
- const nodeType3 = _readNodeType(node2);
2067
- if (nodeType3 === NODE_TYPE.element) {
2068
- _stripDisallowedAttributes(node2);
2069
- }
2015
+ if (_readNodeType(node2) === NODE_TYPE.element) _stripDisallowedAttributes(node2);
2070
2016
  const childNodes = getChildNodes(node2);
2071
- if (childNodes) {
2072
- for (let i4 = childNodes.length - 1; i4 >= 0; --i4) {
2073
- stack.push(childNodes[i4]);
2074
- }
2075
- }
2017
+ if (childNodes) for (let i4 = childNodes.length - 1; i4 >= 0; --i4) stack.push(childNodes[i4]);
2076
2018
  }
2077
2019
  };
2078
2020
  const _isPatchLinkageAttribute = function _isPatchLinkageAttribute2(lcName, lcTag) {
2079
- if (!SAFE_FOR_XML) {
2080
- return false;
2081
- }
2082
- if (lcName === "patchsrc") {
2083
- return true;
2084
- }
2021
+ if (!SAFE_FOR_XML) return false;
2022
+ if (lcName === "patchsrc") return true;
2085
2023
  return lcName === "for" && lcTag !== "label" && lcTag !== "output";
2086
2024
  };
2087
2025
  const _neutralizePatchLinkage = function _neutralizePatchLinkage2(root4) {
2088
- if (!SAFE_FOR_XML) {
2089
- return;
2090
- }
2026
+ if (!SAFE_FOR_XML) return;
2091
2027
  const stack = [root4];
2092
2028
  while (stack.length > 0) {
2093
2029
  const node2 = stack.pop();
@@ -2103,41 +2039,28 @@ function createDOMPurify() {
2103
2039
  const element3 = node2;
2104
2040
  const lcTag = transformCaseFunc(_readNodeName(node2));
2105
2041
  try {
2106
- if (element3.hasAttribute && element3.hasAttribute("patchsrc")) {
2107
- element3.removeAttribute("patchsrc");
2108
- }
2109
- if (element3.hasAttribute && element3.hasAttribute("for") && _isPatchLinkageAttribute("for", lcTag)) {
2110
- element3.removeAttribute("for");
2111
- }
2042
+ if (element3.hasAttribute && element3.hasAttribute("patchsrc")) element3.removeAttribute("patchsrc");
2043
+ if (element3.hasAttribute && element3.hasAttribute("for") && _isPatchLinkageAttribute("for", lcTag)) element3.removeAttribute("for");
2112
2044
  } catch (_3) {
2113
2045
  }
2114
2046
  }
2115
2047
  const childNodes = getChildNodes(node2);
2116
- if (childNodes) {
2117
- for (let i4 = childNodes.length - 1; i4 >= 0; --i4) {
2118
- stack.push(childNodes[i4]);
2119
- }
2120
- }
2048
+ if (childNodes) for (let i4 = childNodes.length - 1; i4 >= 0; --i4) stack.push(childNodes[i4]);
2121
2049
  }
2122
2050
  };
2123
2051
  const _initDocument = function _initDocument2(dirty) {
2124
2052
  let doc = null;
2125
2053
  let leadingWhitespace = null;
2126
- if (FORCE_BODY) {
2127
- dirty = "<remove></remove>" + dirty;
2128
- } else {
2054
+ if (FORCE_BODY) dirty = "<remove></remove>" + dirty;
2055
+ else {
2129
2056
  const matches33 = stringMatch(dirty, /^[\r\n\t ]+/);
2130
2057
  leadingWhitespace = matches33 && matches33[0];
2131
2058
  }
2132
- if (PARSER_MEDIA_TYPE === "application/xhtml+xml" && NAMESPACE2 === HTML_NAMESPACE) {
2133
- dirty = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + dirty + "</body></html>";
2134
- }
2059
+ if (PARSER_MEDIA_TYPE === "application/xhtml+xml" && NAMESPACE2 === HTML_NAMESPACE) dirty = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + dirty + "</body></html>";
2135
2060
  const dirtyPayload = trustedTypesPolicy ? _createTrustedHTML(dirty) : dirty;
2136
- if (NAMESPACE2 === HTML_NAMESPACE) {
2137
- try {
2138
- doc = new DOMParser2().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE);
2139
- } catch (_3) {
2140
- }
2061
+ if (NAMESPACE2 === HTML_NAMESPACE) try {
2062
+ doc = new DOMParser2().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE);
2063
+ } catch (_3) {
2141
2064
  }
2142
2065
  if (!doc || !doc.documentElement) {
2143
2066
  doc = implementation.createDocument(NAMESPACE2, "template", null);
@@ -2147,23 +2070,13 @@ function createDOMPurify() {
2147
2070
  }
2148
2071
  }
2149
2072
  const body = doc.body || doc.documentElement;
2150
- if (dirty && leadingWhitespace) {
2151
- body.insertBefore(document2.createTextNode(leadingWhitespace), body.childNodes[0] || null);
2152
- }
2153
- if (NAMESPACE2 === HTML_NAMESPACE) {
2154
- return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? "html" : "body")[0];
2155
- }
2073
+ if (dirty && leadingWhitespace) body.insertBefore(document2.createTextNode(leadingWhitespace), body.childNodes[0] || null);
2074
+ if (NAMESPACE2 === HTML_NAMESPACE) return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? "html" : "body")[0];
2156
2075
  return WHOLE_DOCUMENT ? doc.documentElement : body;
2157
2076
  };
2158
2077
  const _createNodeIterator = function _createNodeIterator2(root4) {
2159
2078
  const doc = getOwnerDocument ? getOwnerDocument(root4) : root4.ownerDocument;
2160
- return createNodeIterator.call(
2161
- doc || root4,
2162
- root4,
2163
- // eslint-disable-next-line no-bitwise
2164
- NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT | NodeFilter.SHOW_PROCESSING_INSTRUCTION | NodeFilter.SHOW_CDATA_SECTION,
2165
- null
2166
- );
2079
+ return createNodeIterator.call(doc || root4, root4, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT | NodeFilter.SHOW_PROCESSING_INSTRUCTION | NodeFilter.SHOW_CDATA_SECTION, null);
2167
2080
  };
2168
2081
  const _stripTemplateExpressions = function _stripTemplateExpressions2(value2) {
2169
2082
  value2 = stringReplace(value2, MUSTACHE_EXPR$1, " ");
@@ -2175,73 +2088,25 @@ function createDOMPurify() {
2175
2088
  var _node$querySelectorAl;
2176
2089
  node2.normalize();
2177
2090
  const doc = getOwnerDocument ? getOwnerDocument(node2) : node2.ownerDocument;
2178
- const walker = createNodeIterator.call(
2179
- doc || node2,
2180
- node2,
2181
- // eslint-disable-next-line no-bitwise
2182
- NodeFilter.SHOW_TEXT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_CDATA_SECTION | NodeFilter.SHOW_PROCESSING_INSTRUCTION,
2183
- null
2184
- );
2091
+ const walker = createNodeIterator.call(doc || node2, node2, NodeFilter.SHOW_TEXT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_CDATA_SECTION | NodeFilter.SHOW_PROCESSING_INSTRUCTION, null);
2185
2092
  let currentNode = walker.nextNode();
2186
2093
  while (currentNode) {
2187
2094
  currentNode.data = _stripTemplateExpressions(currentNode.data);
2188
2095
  currentNode = walker.nextNode();
2189
2096
  }
2190
2097
  const templates = (_node$querySelectorAl = node2.querySelectorAll) === null || _node$querySelectorAl === void 0 ? void 0 : _node$querySelectorAl.call(node2, "template");
2191
- if (templates) {
2192
- arrayForEach(templates, (tmpl) => {
2193
- if (_isDocumentFragment(tmpl.content)) {
2194
- _scrubTemplateExpressions2(tmpl.content);
2195
- }
2196
- });
2197
- }
2098
+ if (templates) arrayForEach(templates, (tmpl) => {
2099
+ if (_isDocumentFragment(tmpl.content)) _scrubTemplateExpressions2(tmpl.content);
2100
+ });
2198
2101
  };
2199
2102
  const _isClobbered = function _isClobbered2(element3) {
2200
2103
  const realTagName = getNodeName ? getNodeName(element3) : null;
2201
- if (typeof realTagName !== "string") {
2202
- return false;
2203
- }
2204
- if (transformCaseFunc(realTagName) !== "form") {
2205
- return false;
2206
- }
2207
- return typeof element3.nodeName !== "string" || typeof element3.textContent !== "string" || typeof element3.removeChild !== "function" || // Realm-safe NamedNodeMap detection: equality against the cached
2208
- // prototype getter. Clobbered .attributes (e.g. <input name="attributes">)
2209
- // makes the direct read diverge from the cached read; a clean form
2210
- // (same-realm OR foreign-realm) has both reads pointing at the same
2211
- // canonical NamedNodeMap.
2212
- element3.attributes !== getAttributes(element3) || typeof element3.removeAttribute !== "function" || // A form descendant named "removeAttributeNode" or "getAttributeNode"
2213
- // shadows these Attr-node methods via [LegacyOverrideBuiltIns].
2214
- // _removeAttribute() / _stripAttributeNode() reach for
2215
- // element.removeAttributeNode(attr) first; when it is shadowed the call
2216
- // throws and the name-based fallback element.removeAttribute(name)
2217
- // ASCII-lowercases its lookup key in an HTML document, silently missing
2218
- // a case-preserved event-handler attribute (e.g. an ONANIMATIONSTART
2219
- // that reached the sanitizer through an XML/XHTML parse). Flag the form
2220
- // so it is removed wholesale, exactly as for the other shadowed methods.
2221
- typeof element3.removeAttributeNode !== "function" || typeof element3.getAttributeNode !== "function" || typeof element3.setAttribute !== "function" || typeof element3.namespaceURI !== "string" || typeof element3.insertBefore !== "function" || typeof element3.hasChildNodes !== "function" || // NodeType clobbering probe. Cached Node.prototype.nodeType getter
2222
- // returns the integer 1 for any Element regardless of realm; direct
2223
- // read on a clobbered form (e.g. <input name="nodeType">) returns
2224
- // the named child element. Cheap addition — nodeType is read from
2225
- // an internal slot, no serialization cost — and removes a residual
2226
- // clobbering surface used by several mXSS / PI / comment branches
2227
- // in _sanitizeElements that compare currentNode.nodeType directly.
2228
- element3.nodeType !== getNodeType(element3) || // HTMLFormElement has [LegacyOverrideBuiltIns]: a descendant named
2229
- // "childNodes" shadows the prototype getter. Direct reads of
2230
- // form.childNodes from a clobbered form return the named child
2231
- // instead of the real NodeList, so any walk that reads it directly
2232
- // skips the form's real children. Compare the direct read to the
2233
- // cached Node.prototype getter — when the form's named-property
2234
- // getter intercepts the read, the two values differ and we flag
2235
- // the form. This catches every clobbering child type (input,
2236
- // select, etc.) regardless of whether the named child happens to
2237
- // carry a numeric .length, which a typeof-based probe would miss
2238
- // (e.g. HTMLSelectElement.length is a defined unsigned-long).
2239
- element3.childNodes !== getChildNodes(element3);
2104
+ if (typeof realTagName !== "string") return false;
2105
+ if (transformCaseFunc(realTagName) !== "form") return false;
2106
+ return typeof element3.nodeName !== "string" || typeof element3.textContent !== "string" || typeof element3.removeChild !== "function" || element3.attributes !== getAttributes(element3) || typeof element3.removeAttribute !== "function" || typeof element3.removeAttributeNode !== "function" || typeof element3.getAttributeNode !== "function" || typeof element3.setAttribute !== "function" || typeof element3.namespaceURI !== "string" || typeof element3.insertBefore !== "function" || typeof element3.hasChildNodes !== "function" || element3.nodeType !== getNodeType(element3) || element3.childNodes !== getChildNodes(element3);
2240
2107
  };
2241
2108
  const _isDocumentFragment = function _isDocumentFragment2(value2) {
2242
- if (!getNodeType || typeof value2 !== "object" || value2 === null) {
2243
- return false;
2244
- }
2109
+ if (!getNodeType || typeof value2 !== "object" || value2 === null) return false;
2245
2110
  try {
2246
2111
  return getNodeType(value2) === NODE_TYPE.documentFragment;
2247
2112
  } catch (_3) {
@@ -2249,9 +2114,7 @@ function createDOMPurify() {
2249
2114
  }
2250
2115
  };
2251
2116
  const _isNode = function _isNode2(value2) {
2252
- if (!getNodeType || typeof value2 !== "object" || value2 === null) {
2253
- return false;
2254
- }
2117
+ if (!getNodeType || typeof value2 !== "object" || value2 === null) return false;
2255
2118
  try {
2256
2119
  return typeof getNodeType(value2) === "number";
2257
2120
  } catch (_3) {
@@ -2259,44 +2122,28 @@ function createDOMPurify() {
2259
2122
  }
2260
2123
  };
2261
2124
  function _executeHooks(hooks2, currentNode, data6) {
2262
- if (hooks2.length === 0) {
2263
- return;
2264
- }
2125
+ if (hooks2.length === 0) return;
2265
2126
  arrayForEach(hooks2, (hook2) => {
2266
2127
  hook2.call(DOMPurify, currentNode, data6, CONFIG);
2267
2128
  });
2268
2129
  }
2269
2130
  const _isUnsafeNode = function _isUnsafeNode2(currentNode, tagName) {
2270
- if (SAFE_FOR_XML && currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(ELEMENT_MARKUP_PROBE, currentNode.textContent) && regExpTest(ELEMENT_MARKUP_PROBE, currentNode.innerHTML)) {
2271
- return true;
2272
- }
2273
- if (SAFE_FOR_XML && currentNode.namespaceURI === HTML_NAMESPACE && LITERAL_TEXT_ELEMENTS[tagName] && (_isNode(currentNode.firstElementChild) || typeof currentNode.textContent === "string" && regExpTest(LITERAL_TEXT_CLOSE[tagName], currentNode.textContent))) {
2274
- return true;
2275
- }
2276
- if (currentNode.nodeType === NODE_TYPE.processingInstruction) {
2277
- return true;
2278
- }
2279
- if (SAFE_FOR_XML && currentNode.nodeType === NODE_TYPE.comment && regExpTest(COMMENT_MARKUP_PROBE, currentNode.data)) {
2280
- return true;
2281
- }
2131
+ if (SAFE_FOR_XML && currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(ELEMENT_MARKUP_PROBE, currentNode.textContent) && regExpTest(ELEMENT_MARKUP_PROBE, currentNode.innerHTML)) return true;
2132
+ if (SAFE_FOR_XML && currentNode.namespaceURI === HTML_NAMESPACE && LITERAL_TEXT_ELEMENTS[tagName] && (_isNode(currentNode.firstElementChild) || typeof currentNode.textContent === "string" && regExpTest(LITERAL_TEXT_CLOSE[tagName], currentNode.textContent))) return true;
2133
+ if (currentNode.nodeType === NODE_TYPE.processingInstruction) return true;
2134
+ if (SAFE_FOR_XML && currentNode.nodeType === NODE_TYPE.comment && regExpTest(COMMENT_MARKUP_PROBE, currentNode.data)) return true;
2282
2135
  return false;
2283
2136
  };
2284
2137
  const _matchesNameCheck = function _matchesNameCheck2(check, name) {
2285
- if (check instanceof RegExp) {
2286
- return regExpTest(check, name);
2287
- }
2138
+ if (check instanceof RegExp) return regExpTest(check, name);
2288
2139
  if (check instanceof Function) {
2289
- for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
2290
- args[_key - 2] = arguments[_key];
2291
- }
2140
+ for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) args[_key - 2] = arguments[_key];
2292
2141
  return Boolean(check(name, ...args));
2293
2142
  }
2294
2143
  return false;
2295
2144
  };
2296
2145
  const _sanitizeDisallowedNode = function _sanitizeDisallowedNode2(currentNode, tagName, root4) {
2297
- if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName) && _matchesNameCheck(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) {
2298
- return false;
2299
- }
2146
+ if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName) && _matchesNameCheck(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) return false;
2300
2147
  if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {
2301
2148
  const parentNode = getParentNode(currentNode);
2302
2149
  const childNodes = getChildNodes(currentNode);
@@ -2312,25 +2159,17 @@ function createDOMPurify() {
2312
2159
  return true;
2313
2160
  };
2314
2161
  const _forkSharedAllowlist = function _forkSharedAllowlist2(hookList, set5, defaultSet, setConfigSet) {
2315
- if (hookList.length === 0) {
2316
- return set5;
2317
- }
2162
+ if (hookList.length === 0) return set5;
2318
2163
  return set5 === defaultSet || set5 === setConfigSet ? clone(set5) : set5;
2319
2164
  };
2320
2165
  const _handleHookDetachedNode = function _handleHookDetachedNode2(currentNode, root4) {
2321
- if (currentNode === root4 || getParentNode(currentNode) !== null) {
2322
- return false;
2323
- }
2324
- if (IN_PLACE) {
2325
- _neutralizeSubtree(currentNode);
2326
- }
2166
+ if (currentNode === root4 || getParentNode(currentNode) !== null) return false;
2167
+ if (IN_PLACE) _neutralizeSubtree(currentNode);
2327
2168
  return true;
2328
2169
  };
2329
2170
  const _sanitizeElements = function _sanitizeElements2(currentNode, root4) {
2330
2171
  _executeHooks(hooks.beforeSanitizeElements, currentNode, null);
2331
- if (_handleHookDetachedNode(currentNode, root4)) {
2332
- return true;
2333
- }
2172
+ if (_handleHookDetachedNode(currentNode, root4)) return true;
2334
2173
  if (_isClobbered(currentNode)) {
2335
2174
  _forceRemove(currentNode);
2336
2175
  return true;
@@ -2341,9 +2180,7 @@ function createDOMPurify() {
2341
2180
  tagName,
2342
2181
  allowedTags: ALLOWED_TAGS
2343
2182
  });
2344
- if (_handleHookDetachedNode(currentNode, root4)) {
2345
- return true;
2346
- }
2183
+ if (_handleHookDetachedNode(currentNode, root4)) return true;
2347
2184
  if (_isUnsafeNode(currentNode, tagName)) {
2348
2185
  _forceRemove(currentNode);
2349
2186
  return true;
@@ -2352,11 +2189,11 @@ function createDOMPurify() {
2352
2189
  const removed = _sanitizeDisallowedNode(currentNode, tagName, root4);
2353
2190
  if (removed === false) {
2354
2191
  _executeHooks(hooks.afterSanitizeElements, currentNode, null);
2192
+ if (_handleHookDetachedNode(currentNode, root4)) return true;
2355
2193
  }
2356
2194
  return removed;
2357
2195
  }
2358
- const nt2 = _readNodeType(currentNode);
2359
- if (nt2 === NODE_TYPE.element && !_checkValidNamespace(currentNode)) {
2196
+ if (_readNodeType(currentNode) === NODE_TYPE.element && !_checkValidNamespace(currentNode)) {
2360
2197
  _forceRemove(currentNode);
2361
2198
  return true;
2362
2199
  }
@@ -2367,81 +2204,53 @@ function createDOMPurify() {
2367
2204
  if (SAFE_FOR_TEMPLATES && currentNode.nodeType === NODE_TYPE.text) {
2368
2205
  const content = _stripTemplateExpressions(currentNode.textContent);
2369
2206
  if (currentNode.textContent !== content) {
2370
- arrayPush(DOMPurify.removed, {
2371
- element: currentNode.cloneNode()
2372
- });
2207
+ arrayPush(DOMPurify.removed, { element: currentNode.cloneNode() });
2373
2208
  currentNode.textContent = content;
2374
2209
  }
2375
2210
  }
2376
2211
  _executeHooks(hooks.afterSanitizeElements, currentNode, null);
2377
- return false;
2212
+ return _handleHookDetachedNode(currentNode, root4);
2378
2213
  };
2379
2214
  const _isValidAttribute = function _isValidAttribute2(lcTag, lcName, value2) {
2380
- if (FORBID_ATTR[lcName]) {
2381
- return false;
2382
- }
2383
- if (_isPatchLinkageAttribute(lcName, lcTag)) {
2384
- return false;
2385
- }
2386
- if (SANITIZE_DOM && (lcName === "id" || lcName === "name") && (value2 in document2 || value2 in formElement)) {
2387
- return false;
2388
- }
2215
+ if (FORBID_ATTR[lcName]) return false;
2216
+ if (_isPatchLinkageAttribute(lcName, lcTag)) return false;
2217
+ if (SANITIZE_DOM && (lcName === "id" || lcName === "name") && (value2 in document2 || value2 in formElement)) return false;
2389
2218
  const nameIsPermitted = ALLOWED_ATTR[lcName] || EXTRA_ELEMENT_HANDLING.attributeCheck instanceof Function && EXTRA_ELEMENT_HANDLING.attributeCheck(lcName, lcTag);
2390
- if (ALLOW_DATA_ATTR && regExpTest(DATA_ATTR$1, lcName)) {
2391
- return true;
2392
- }
2393
- if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR$1, lcName)) {
2394
- return true;
2395
- }
2396
- if (!nameIsPermitted) {
2397
- return (
2398
- // Condition a) covers a basically valid custom element tag name whose
2399
- // tag passes the configured tagNameCheck and whose attribute name
2400
- // passes the configured attributeNameCheck ...
2401
- _isBasicCustomElement(lcTag) && _matchesNameCheck(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag) && _matchesNameCheck(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName, lcTag) || // Condition b) covers an `is` attribute whose value passes the
2402
- // configured tagNameCheck while customized built-in elements are
2403
- // allowed.
2404
- lcName === "is" && CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements && _matchesNameCheck(CUSTOM_ELEMENT_HANDLING.tagNameCheck, value2)
2405
- );
2406
- }
2407
- if (URI_SAFE_ATTRIBUTES[lcName]) {
2408
- return true;
2409
- }
2410
- if (regExpTest(IS_ALLOWED_URI$1, stringReplace(value2, ATTR_WHITESPACE$1, ""))) {
2411
- return true;
2412
- }
2413
- if ((lcName === "src" || lcName === "xlink:href" || lcName === "href") && lcTag !== "script" && stringIndexOf(value2, "data:") === 0 && DATA_URI_TAGS[lcTag]) {
2414
- return true;
2415
- }
2416
- if (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA$1, stringReplace(value2, ATTR_WHITESPACE$1, ""))) {
2417
- return true;
2418
- }
2219
+ if (ALLOW_DATA_ATTR && regExpTest(DATA_ATTR$1, lcName)) return true;
2220
+ if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR$1, lcName)) return true;
2221
+ if (!nameIsPermitted) return _isBasicCustomElement(lcTag) && _matchesNameCheck(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag) && _matchesNameCheck(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName, lcTag) || lcName === "is" && CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements && _matchesNameCheck(CUSTOM_ELEMENT_HANDLING.tagNameCheck, value2);
2222
+ if (URI_SAFE_ATTRIBUTES[lcName]) return true;
2223
+ if (regExpTest(IS_ALLOWED_URI$1, stringReplace(value2, ATTR_WHITESPACE$1, ""))) return true;
2224
+ if ((lcName === "src" || lcName === "xlink:href" || lcName === "href") && lcTag !== "script" && stringIndexOf(value2, "data:") === 0 && DATA_URI_TAGS[lcTag]) return true;
2225
+ if (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA$1, stringReplace(value2, ATTR_WHITESPACE$1, ""))) return true;
2419
2226
  return !value2;
2420
2227
  };
2421
- const RESERVED_CUSTOM_ELEMENT_NAMES = addToSet({}, ["annotation-xml", "color-profile", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "missing-glyph"]);
2228
+ const RESERVED_CUSTOM_ELEMENT_NAMES = addToSet({}, [
2229
+ "annotation-xml",
2230
+ "color-profile",
2231
+ "font-face",
2232
+ "font-face-format",
2233
+ "font-face-name",
2234
+ "font-face-src",
2235
+ "font-face-uri",
2236
+ "missing-glyph"
2237
+ ]);
2422
2238
  const _isBasicCustomElement = function _isBasicCustomElement2(tagName) {
2423
2239
  return !RESERVED_CUSTOM_ELEMENT_NAMES[stringToLowerCase(tagName)] && regExpTest(CUSTOM_ELEMENT$1, tagName);
2424
2240
  };
2425
2241
  const _applyTrustedTypesToAttribute = function _applyTrustedTypesToAttribute2(lcTag, lcName, namespaceURI, value2) {
2426
- if (trustedTypesPolicy && typeof trustedTypes === "object" && typeof trustedTypes.getAttributeType === "function" && !namespaceURI) {
2427
- switch (trustedTypes.getAttributeType(lcTag, lcName)) {
2428
- case "TrustedHTML": {
2429
- return _createTrustedHTML(value2);
2430
- }
2431
- case "TrustedScriptURL": {
2432
- return _createTrustedScriptURL(value2);
2433
- }
2434
- }
2242
+ if (trustedTypesPolicy && typeof trustedTypes === "object" && typeof trustedTypes.getAttributeType === "function" && !namespaceURI) switch (trustedTypes.getAttributeType(lcTag, lcName)) {
2243
+ case "TrustedHTML":
2244
+ return _createTrustedHTML(value2);
2245
+ case "TrustedScriptURL":
2246
+ return _createTrustedScriptURL(value2);
2435
2247
  }
2436
2248
  return value2;
2437
2249
  };
2438
2250
  const _setAttributeValue = function _setAttributeValue2(currentNode, name, namespaceURI, value2) {
2439
2251
  try {
2440
- if (namespaceURI) {
2441
- currentNode.setAttributeNS(namespaceURI, name, value2);
2442
- } else {
2443
- currentNode.setAttribute(name, value2);
2444
- }
2252
+ if (namespaceURI) currentNode.setAttributeNS(namespaceURI, name, value2);
2253
+ else currentNode.setAttribute(name, value2);
2445
2254
  if (_isClobbered(currentNode)) {
2446
2255
  _forceRemove(currentNode);
2447
2256
  return false;
@@ -2452,12 +2261,11 @@ function createDOMPurify() {
2452
2261
  return false;
2453
2262
  }
2454
2263
  };
2455
- const _sanitizeAttributes = function _sanitizeAttributes2(currentNode) {
2264
+ const _sanitizeAttributes = function _sanitizeAttributes2(currentNode, root4) {
2456
2265
  _executeHooks(hooks.beforeSanitizeAttributes, currentNode, null);
2266
+ if (_handleHookDetachedNode(currentNode, root4)) return;
2457
2267
  const attributes = currentNode.attributes;
2458
- if (!attributes || _isClobbered(currentNode)) {
2459
- return;
2460
- }
2268
+ if (!attributes || _isClobbered(currentNode)) return;
2461
2269
  ALLOWED_ATTR = _forkSharedAllowlist(hooks.uponSanitizeAttribute, ALLOWED_ATTR, DEFAULT_ALLOWED_ATTR, SET_CONFIG_ALLOWED_ATTR);
2462
2270
  const hookEvent = {
2463
2271
  attrName: "",
@@ -2494,9 +2302,7 @@ function createDOMPurify() {
2494
2302
  _removeAttribute(name, currentNode, attr);
2495
2303
  continue;
2496
2304
  }
2497
- if (hookEvent.forceKeepAttr) {
2498
- continue;
2499
- }
2305
+ if (hookEvent.forceKeepAttr) continue;
2500
2306
  if (!hookEvent.keepAttr) {
2501
2307
  _removeAttribute(name, currentNode, attr);
2502
2308
  continue;
@@ -2505,22 +2311,18 @@ function createDOMPurify() {
2505
2311
  _removeAttribute(name, currentNode, attr);
2506
2312
  continue;
2507
2313
  }
2508
- if (SAFE_FOR_TEMPLATES) {
2509
- value2 = _stripTemplateExpressions(value2);
2510
- }
2314
+ if (SAFE_FOR_TEMPLATES) value2 = _stripTemplateExpressions(value2);
2511
2315
  if (!_isValidAttribute(lcTag, lcName, value2)) {
2512
2316
  _removeAttribute(name, currentNode, attr);
2513
2317
  continue;
2514
2318
  }
2515
2319
  value2 = _applyTrustedTypesToAttribute(lcTag, lcName, namespaceURI, value2);
2516
2320
  if (value2 !== initValue) {
2517
- const cleanWrite = _setAttributeValue(currentNode, name, namespaceURI, value2);
2518
- if (cleanWrite && recreatedNamedProp) {
2519
- arrayPop(DOMPurify.removed);
2520
- }
2321
+ if (_setAttributeValue(currentNode, name, namespaceURI, value2) && recreatedNamedProp) arrayPop(DOMPurify.removed);
2521
2322
  }
2522
2323
  }
2523
2324
  _executeHooks(hooks.afterSanitizeAttributes, currentNode, null);
2325
+ _handleHookDetachedNode(currentNode, root4);
2524
2326
  };
2525
2327
  const _sanitizeShadowDOM2 = function _sanitizeShadowDOM(fragment) {
2526
2328
  let shadowNode = null;
@@ -2529,10 +2331,8 @@ function createDOMPurify() {
2529
2331
  while (shadowNode = shadowIterator.nextNode()) {
2530
2332
  _executeHooks(hooks.uponSanitizeShadowNode, shadowNode, null);
2531
2333
  _sanitizeElements(shadowNode, fragment);
2532
- _sanitizeAttributes(shadowNode);
2533
- if (_isDocumentFragment(shadowNode.content)) {
2534
- _sanitizeShadowDOM2(shadowNode.content);
2535
- }
2334
+ _sanitizeAttributes(shadowNode, fragment);
2335
+ if (_isDocumentFragment(shadowNode.content)) _sanitizeShadowDOM2(shadowNode.content);
2536
2336
  if (_readNodeType(shadowNode) === NODE_TYPE.element) {
2537
2337
  const innerSr = getShadowRoot(shadowNode);
2538
2338
  if (_isDocumentFragment(innerSr)) {
@@ -2555,40 +2355,31 @@ function createDOMPurify() {
2555
2355
  continue;
2556
2356
  }
2557
2357
  const node2 = item.node;
2558
- const nodeType3 = _readNodeType(node2);
2559
- const isElement = nodeType3 === NODE_TYPE.element;
2358
+ const isElement = _readNodeType(node2) === NODE_TYPE.element;
2560
2359
  const childNodes = getChildNodes(node2);
2561
- if (childNodes) {
2562
- for (let i4 = childNodes.length - 1; i4 >= 0; --i4) {
2563
- stack.push({
2564
- node: childNodes[i4],
2565
- shadow: null
2566
- });
2567
- }
2568
- }
2360
+ if (childNodes) for (let i4 = childNodes.length - 1; i4 >= 0; --i4) stack.push({
2361
+ node: childNodes[i4],
2362
+ shadow: null
2363
+ });
2569
2364
  if (isElement) {
2570
2365
  const rootName = getNodeName ? getNodeName(node2) : null;
2571
2366
  if (typeof rootName === "string" && transformCaseFunc(rootName) === "template") {
2572
2367
  const content = node2.content;
2573
- if (_isDocumentFragment(content)) {
2574
- stack.push({
2575
- node: content,
2576
- shadow: null
2577
- });
2578
- }
2368
+ if (_isDocumentFragment(content)) stack.push({
2369
+ node: content,
2370
+ shadow: null
2371
+ });
2579
2372
  }
2580
2373
  }
2581
2374
  if (isElement) {
2582
2375
  const sr = getShadowRoot(node2);
2583
- if (_isDocumentFragment(sr)) {
2584
- stack.push({
2585
- node: null,
2586
- shadow: sr
2587
- }, {
2588
- node: sr,
2589
- shadow: null
2590
- });
2591
- }
2376
+ if (_isDocumentFragment(sr)) stack.push({
2377
+ node: null,
2378
+ shadow: sr
2379
+ }, {
2380
+ node: sr,
2381
+ shadow: null
2382
+ });
2592
2383
  }
2593
2384
  }
2594
2385
  };
@@ -2599,30 +2390,18 @@ function createDOMPurify() {
2599
2390
  let currentNode = null;
2600
2391
  let returnNode = null;
2601
2392
  IS_EMPTY_INPUT = !dirty;
2602
- if (IS_EMPTY_INPUT) {
2603
- dirty = "<!-->";
2604
- }
2393
+ if (IS_EMPTY_INPUT) dirty = "<!-->";
2605
2394
  if (typeof dirty !== "string" && !_isNode(dirty)) {
2606
2395
  dirty = stringifyValue(dirty);
2607
- if (typeof dirty !== "string") {
2608
- throw typeErrorCreate("dirty is not a string, aborting");
2609
- }
2610
- }
2611
- if (!DOMPurify.isSupported) {
2612
- return dirty;
2396
+ if (typeof dirty !== "string") throw typeErrorCreate("dirty is not a string, aborting");
2613
2397
  }
2398
+ if (!DOMPurify.isSupported) return dirty;
2614
2399
  if (SET_CONFIG) {
2615
2400
  ALLOWED_TAGS = SET_CONFIG_ALLOWED_TAGS;
2616
2401
  ALLOWED_ATTR = SET_CONFIG_ALLOWED_ATTR;
2617
- } else {
2618
- _parseConfig(cfg);
2619
- }
2620
- if (hooks.uponSanitizeElement.length > 0 || hooks.uponSanitizeAttribute.length > 0) {
2621
- ALLOWED_TAGS = clone(ALLOWED_TAGS);
2622
- }
2623
- if (hooks.uponSanitizeAttribute.length > 0) {
2624
- ALLOWED_ATTR = clone(ALLOWED_ATTR);
2625
- }
2402
+ } else _parseConfig(cfg);
2403
+ if (hooks.uponSanitizeElement.length > 0 || hooks.uponSanitizeAttribute.length > 0) ALLOWED_TAGS = clone(ALLOWED_TAGS);
2404
+ if (hooks.uponSanitizeAttribute.length > 0) ALLOWED_ATTR = clone(ALLOWED_ATTR);
2626
2405
  DOMPurify.removed = [];
2627
2406
  const inPlace = IN_PLACE && typeof dirty !== "string" && _isNode(dirty);
2628
2407
  if (inPlace) {
@@ -2648,83 +2427,57 @@ function createDOMPurify() {
2648
2427
  } else if (_isNode(dirty)) {
2649
2428
  body = _initDocument("<!---->");
2650
2429
  importedNode = body.ownerDocument.importNode(dirty, true);
2651
- if (importedNode.nodeType === NODE_TYPE.element && importedNode.nodeName === "BODY") {
2652
- body = importedNode;
2653
- } else if (importedNode.nodeName === "HTML") {
2654
- body = importedNode;
2655
- } else {
2656
- body.appendChild(importedNode);
2657
- }
2430
+ if (importedNode.nodeType === NODE_TYPE.element && importedNode.nodeName === "BODY") body = importedNode;
2431
+ else if (importedNode.nodeName === "HTML") body = importedNode;
2432
+ else body.appendChild(importedNode);
2658
2433
  _sanitizeAttachedShadowRoots(body);
2659
2434
  } else {
2660
- if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT && // eslint-disable-next-line unicorn/prefer-includes
2661
- dirty.indexOf("<") === -1) {
2662
- return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? _createTrustedHTML(dirty) : dirty;
2663
- }
2435
+ if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT && dirty.indexOf("<") === -1) return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? _createTrustedHTML(dirty) : dirty;
2664
2436
  body = _initDocument(dirty);
2665
- if (!body) {
2666
- return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : "";
2667
- }
2668
- }
2669
- if (body && FORCE_BODY) {
2670
- _forceRemove(body.firstChild);
2437
+ if (!body) return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : "";
2671
2438
  }
2439
+ if (body && FORCE_BODY) _forceRemove(body.firstChild);
2672
2440
  const walkRoot = inPlace ? dirty : body;
2673
2441
  try {
2674
2442
  const nodeIterator = _createNodeIterator(walkRoot);
2675
2443
  while (currentNode = nodeIterator.nextNode()) {
2676
2444
  _sanitizeElements(currentNode, walkRoot);
2677
- _sanitizeAttributes(currentNode);
2678
- if (_isDocumentFragment(currentNode.content)) {
2679
- _sanitizeShadowDOM2(currentNode.content);
2680
- }
2445
+ _sanitizeAttributes(currentNode, walkRoot);
2446
+ if (_isDocumentFragment(currentNode.content)) _sanitizeShadowDOM2(currentNode.content);
2681
2447
  }
2682
2448
  } catch (error3) {
2683
2449
  if (inPlace) {
2684
2450
  _neutralizeRoot(dirty);
2685
2451
  arrayForEach(DOMPurify.removed, (entry) => {
2686
- if (entry.element) {
2687
- _neutralizeSubtree(entry.element);
2688
- }
2452
+ if (entry.element) _neutralizeSubtree(entry.element);
2689
2453
  });
2690
2454
  }
2691
2455
  throw error3;
2692
2456
  }
2693
2457
  if (inPlace) {
2458
+ let rootWasRemoved = false;
2694
2459
  arrayForEach(DOMPurify.removed, (entry) => {
2695
2460
  if (entry.element) {
2461
+ if (entry.element === dirty) rootWasRemoved = true;
2696
2462
  _neutralizeSubtree(entry.element);
2697
2463
  }
2698
2464
  });
2699
- if (SAFE_FOR_TEMPLATES) {
2700
- _scrubTemplateExpressions2(dirty);
2701
- }
2465
+ if (rootWasRemoved) throw typeErrorCreate("a node selected for removal could not be safely returned; refusing to sanitize in place");
2466
+ if (SAFE_FOR_TEMPLATES) _scrubTemplateExpressions2(dirty);
2702
2467
  return dirty;
2703
2468
  }
2704
2469
  if (RETURN_DOM) {
2705
- if (SAFE_FOR_TEMPLATES) {
2706
- _scrubTemplateExpressions2(body);
2707
- }
2470
+ if (SAFE_FOR_TEMPLATES) _scrubTemplateExpressions2(body);
2708
2471
  if (RETURN_DOM_FRAGMENT) {
2709
2472
  returnNode = createDocumentFragment.call(body.ownerDocument);
2710
- while (body.firstChild) {
2711
- returnNode.appendChild(body.firstChild);
2712
- }
2713
- } else {
2714
- returnNode = body;
2715
- }
2716
- if (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmode) {
2717
- returnNode = importNode.call(originalDocument, returnNode, true);
2718
- }
2473
+ while (body.firstChild) returnNode.appendChild(body.firstChild);
2474
+ } else returnNode = body;
2475
+ if (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmode) returnNode = importNode.call(originalDocument, returnNode, true);
2719
2476
  return returnNode;
2720
2477
  }
2721
2478
  let serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;
2722
- if (WHOLE_DOCUMENT && ALLOWED_TAGS["!doctype"] && body.ownerDocument && body.ownerDocument.doctype && body.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, body.ownerDocument.doctype.name)) {
2723
- serializedHTML = "<!DOCTYPE " + body.ownerDocument.doctype.name + ">\n" + serializedHTML;
2724
- }
2725
- if (SAFE_FOR_TEMPLATES) {
2726
- serializedHTML = _stripTemplateExpressions(serializedHTML);
2727
- }
2479
+ if (WHOLE_DOCUMENT && ALLOWED_TAGS["!doctype"] && body.ownerDocument && body.ownerDocument.doctype && body.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, body.ownerDocument.doctype.name)) serializedHTML = "<!DOCTYPE " + body.ownerDocument.doctype.name + ">\n" + serializedHTML;
2480
+ if (SAFE_FOR_TEMPLATES) serializedHTML = _stripTemplateExpressions(serializedHTML);
2728
2481
  return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? _createTrustedHTML(serializedHTML) : serializedHTML;
2729
2482
  };
2730
2483
  DOMPurify.setConfig = function() {
@@ -2743,26 +2496,18 @@ function createDOMPurify() {
2743
2496
  emptyHTML = "";
2744
2497
  };
2745
2498
  DOMPurify.isValidAttribute = function(tag, attr, value2) {
2746
- if (!CONFIG) {
2747
- _parseConfig({});
2748
- }
2499
+ if (!CONFIG) _parseConfig({});
2749
2500
  const lcTag = transformCaseFunc(tag);
2750
2501
  const lcName = transformCaseFunc(attr);
2751
2502
  return _isValidAttribute(lcTag, lcName, value2);
2752
2503
  };
2753
2504
  DOMPurify.addHook = function(entryPoint, hookFunction) {
2754
- if (typeof hookFunction !== "function") {
2755
- return;
2756
- }
2757
- if (!objectHasOwnProperty(hooks, entryPoint)) {
2758
- return;
2759
- }
2505
+ if (typeof hookFunction !== "function") return;
2506
+ if (!objectHasOwnProperty(hooks, entryPoint)) return;
2760
2507
  arrayPush(hooks[entryPoint], hookFunction);
2761
2508
  };
2762
2509
  DOMPurify.removeHook = function(entryPoint, hookFunction) {
2763
- if (!objectHasOwnProperty(hooks, entryPoint)) {
2764
- return void 0;
2765
- }
2510
+ if (!objectHasOwnProperty(hooks, entryPoint)) return;
2766
2511
  if (hookFunction !== void 0) {
2767
2512
  const index = arrayLastIndexOf(hooks[entryPoint], hookFunction);
2768
2513
  return index === -1 ? void 0 : arraySplice(hooks[entryPoint], index, 1)[0];
@@ -2770,9 +2515,7 @@ function createDOMPurify() {
2770
2515
  return arrayPop(hooks[entryPoint]);
2771
2516
  };
2772
2517
  DOMPurify.removeHooks = function(entryPoint) {
2773
- if (!objectHasOwnProperty(hooks, entryPoint)) {
2774
- return;
2775
- }
2518
+ if (!objectHasOwnProperty(hooks, entryPoint)) return;
2776
2519
  hooks[entryPoint] = [];
2777
2520
  };
2778
2521
  DOMPurify.removeAllHooks = function() {
@@ -2780,9 +2523,18 @@ function createDOMPurify() {
2780
2523
  };
2781
2524
  return DOMPurify;
2782
2525
  }
2783
- var entries, setPrototypeOf, isFrozen, getPrototypeOf, getOwnPropertyDescriptor, freeze, seal, create, _ref, apply, construct, arrayForEach, arrayLastIndexOf, arrayPop, arrayPush, arraySplice, arrayIsArray, stringToLowerCase, stringToString, stringMatch, stringReplace, stringIndexOf, stringTrim, numberToString, booleanToString, bigintToString, symbolToString, objectHasOwnProperty, objectToString, regExpTest, typeErrorCreate, html$1, svg$1, svgFilters, svgDisallowed, mathMl$1, mathMlDisallowed, text, html, svg, mathMl, xml, MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR, DATA_ATTR, ARIA_ATTR, IS_ALLOWED_URI, IS_SCRIPT_OR_DATA, ATTR_WHITESPACE, DOCTYPE_NAME, CUSTOM_ELEMENT, ELEMENT_MARKUP_PROBE, COMMENT_MARKUP_PROBE, FALLBACK_TAG_CLOSE, SELF_CLOSING_TAG, NODE_TYPE, LITERAL_TEXT_ELEMENT_NAMES, LITERAL_TEXT_ELEMENTS, LITERAL_TEXT_CLOSE, getGlobal, _createTrustedTypesPolicy, _createHooksMap, _resolveSetOption, _resolveObjectOption, purify;
2526
+ var entries, setPrototypeOf, isFrozen, getPrototypeOf, getOwnPropertyDescriptor, freeze, seal, create, _ref, apply, construct, arrayForEach, arrayLastIndexOf, arrayPop, arrayPush, arraySplice, arrayIsArray, stringToLowerCase, stringToString, stringMatch, stringReplace, stringIndexOf, stringTrim, numberToString, booleanToString, bigintToString, symbolToString, objectHasOwnProperty, objectToString, regExpTest, typeErrorCreate, html$1, svg$1, svgFilters, svgDisallowed, mathMl$1, mathMlDisallowed, text, html, svg, mathMl, xml, MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR, DATA_ATTR, ARIA_ATTR, IS_ALLOWED_URI, IS_SCRIPT_OR_DATA, ATTR_WHITESPACE, DOCTYPE_NAME, CUSTOM_ELEMENT, ELEMENT_MARKUP_PROBE, COMMENT_MARKUP_PROBE, FALLBACK_TAG_CLOSE, SELF_CLOSING_TAG, NODE_TYPE, LITERAL_TEXT_ELEMENT_NAMES, LITERAL_TEXT_ELEMENTS, LITERAL_TEXT_CLOSE, getGlobal, _createTrustedTypesPolicy, _createHooksMap, _resolveSetOption, _resolveObjectOption, purify_default;
2784
2527
  var init_purify_es = __esm({
2785
2528
  "node_modules/dompurify/dist/purify.es.mjs"() {
2529
+ AsyncGenerator.prototype["function" == typeof Symbol && Symbol.asyncIterator || "@@asyncIterator"] = function() {
2530
+ return this;
2531
+ }, AsyncGenerator.prototype.next = function(e3) {
2532
+ return this._invoke("next", e3);
2533
+ }, AsyncGenerator.prototype.throw = function(e3) {
2534
+ return this._invoke("throw", e3);
2535
+ }, AsyncGenerator.prototype.return = function(e3) {
2536
+ return this._invoke("return", e3);
2537
+ };
2786
2538
  entries = Object.entries;
2787
2539
  setPrototypeOf = Object.setPrototypeOf;
2788
2540
  isFrozen = Object.isFrozen;
@@ -2794,36 +2546,26 @@ var init_purify_es = __esm({
2794
2546
  _ref = typeof Reflect !== "undefined" && Reflect;
2795
2547
  apply = _ref.apply;
2796
2548
  construct = _ref.construct;
2797
- if (!freeze) {
2798
- freeze = function freeze2(x6) {
2799
- return x6;
2800
- };
2801
- }
2802
- if (!seal) {
2803
- seal = function seal2(x6) {
2804
- return x6;
2805
- };
2806
- }
2807
- if (!apply) {
2808
- apply = function apply5(func, thisArg) {
2809
- for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
2810
- args[_key - 2] = arguments[_key];
2811
- }
2812
- return func.apply(thisArg, args);
2813
- };
2814
- }
2815
- if (!construct) {
2816
- construct = function construct2(Func) {
2817
- for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
2818
- args[_key2 - 1] = arguments[_key2];
2819
- }
2820
- return new Func(...args);
2821
- };
2822
- }
2549
+ if (!freeze) freeze = function freeze2(x6) {
2550
+ return x6;
2551
+ };
2552
+ if (!seal) seal = function seal2(x6) {
2553
+ return x6;
2554
+ };
2555
+ if (!apply) apply = function apply2(func, thisArg) {
2556
+ for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) args[_key - 2] = arguments[_key];
2557
+ return func.apply(thisArg, args);
2558
+ };
2559
+ if (!construct) construct = function construct2(Func) {
2560
+ for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) args[_key2 - 1] = arguments[_key2];
2561
+ return new Func(...args);
2562
+ };
2823
2563
  arrayForEach = unapply(Array.prototype.forEach);
2564
+ Array.prototype.indexOf;
2824
2565
  arrayLastIndexOf = unapply(Array.prototype.lastIndexOf);
2825
2566
  arrayPop = unapply(Array.prototype.pop);
2826
2567
  arrayPush = unapply(Array.prototype.push);
2568
+ Array.prototype.slice;
2827
2569
  arraySplice = unapply(Array.prototype.splice);
2828
2570
  arrayIsArray = Array.isArray;
2829
2571
  stringToLowerCase = unapply(String.prototype.toLowerCase);
@@ -2840,31 +2582,662 @@ var init_purify_es = __esm({
2840
2582
  objectToString = unapply(Object.prototype.toString);
2841
2583
  regExpTest = unapply(RegExp.prototype.test);
2842
2584
  typeErrorCreate = unconstruct(TypeError);
2843
- html$1 = freeze(["a", "abbr", "acronym", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "decorator", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "element", "em", "fieldset", "figcaption", "figure", "font", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "marquee", "menu", "menuitem", "meter", "nav", "nobr", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "search", "section", "select", "shadow", "slot", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"]);
2844
- svg$1 = freeze(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "enterkeyhint", "exportparts", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "inputmode", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "part", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]);
2845
- svgFilters = freeze(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence"]);
2846
- svgDisallowed = freeze(["animate", "color-profile", "cursor", "discard", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignobject", "hatch", "hatchpath", "mesh", "meshgradient", "meshpatch", "meshrow", "missing-glyph", "script", "set", "solidcolor", "unknown", "use"]);
2847
- mathMl$1 = freeze(["math", "menclose", "merror", "mfenced", "mfrac", "mglyph", "mi", "mlabeledtr", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mphantom", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msup", "msubsup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover", "mprescripts"]);
2848
- mathMlDisallowed = freeze(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]);
2585
+ html$1 = freeze([
2586
+ "a",
2587
+ "abbr",
2588
+ "acronym",
2589
+ "address",
2590
+ "area",
2591
+ "article",
2592
+ "aside",
2593
+ "audio",
2594
+ "b",
2595
+ "bdi",
2596
+ "bdo",
2597
+ "big",
2598
+ "blink",
2599
+ "blockquote",
2600
+ "body",
2601
+ "br",
2602
+ "button",
2603
+ "canvas",
2604
+ "caption",
2605
+ "center",
2606
+ "cite",
2607
+ "code",
2608
+ "col",
2609
+ "colgroup",
2610
+ "content",
2611
+ "data",
2612
+ "datalist",
2613
+ "dd",
2614
+ "decorator",
2615
+ "del",
2616
+ "details",
2617
+ "dfn",
2618
+ "dialog",
2619
+ "dir",
2620
+ "div",
2621
+ "dl",
2622
+ "dt",
2623
+ "element",
2624
+ "em",
2625
+ "fieldset",
2626
+ "figcaption",
2627
+ "figure",
2628
+ "font",
2629
+ "footer",
2630
+ "form",
2631
+ "h1",
2632
+ "h2",
2633
+ "h3",
2634
+ "h4",
2635
+ "h5",
2636
+ "h6",
2637
+ "head",
2638
+ "header",
2639
+ "hgroup",
2640
+ "hr",
2641
+ "html",
2642
+ "i",
2643
+ "img",
2644
+ "input",
2645
+ "ins",
2646
+ "kbd",
2647
+ "label",
2648
+ "legend",
2649
+ "li",
2650
+ "main",
2651
+ "map",
2652
+ "mark",
2653
+ "marquee",
2654
+ "menu",
2655
+ "menuitem",
2656
+ "meter",
2657
+ "nav",
2658
+ "nobr",
2659
+ "ol",
2660
+ "optgroup",
2661
+ "option",
2662
+ "output",
2663
+ "p",
2664
+ "picture",
2665
+ "pre",
2666
+ "progress",
2667
+ "q",
2668
+ "rp",
2669
+ "rt",
2670
+ "ruby",
2671
+ "s",
2672
+ "samp",
2673
+ "search",
2674
+ "section",
2675
+ "select",
2676
+ "shadow",
2677
+ "slot",
2678
+ "small",
2679
+ "source",
2680
+ "spacer",
2681
+ "span",
2682
+ "strike",
2683
+ "strong",
2684
+ "style",
2685
+ "sub",
2686
+ "summary",
2687
+ "sup",
2688
+ "table",
2689
+ "tbody",
2690
+ "td",
2691
+ "template",
2692
+ "textarea",
2693
+ "tfoot",
2694
+ "th",
2695
+ "thead",
2696
+ "time",
2697
+ "tr",
2698
+ "track",
2699
+ "tt",
2700
+ "u",
2701
+ "ul",
2702
+ "var",
2703
+ "video",
2704
+ "wbr"
2705
+ ]);
2706
+ svg$1 = freeze([
2707
+ "svg",
2708
+ "a",
2709
+ "altglyph",
2710
+ "altglyphdef",
2711
+ "altglyphitem",
2712
+ "animatecolor",
2713
+ "animatemotion",
2714
+ "animatetransform",
2715
+ "circle",
2716
+ "clippath",
2717
+ "defs",
2718
+ "desc",
2719
+ "ellipse",
2720
+ "enterkeyhint",
2721
+ "exportparts",
2722
+ "filter",
2723
+ "font",
2724
+ "g",
2725
+ "glyph",
2726
+ "glyphref",
2727
+ "hkern",
2728
+ "image",
2729
+ "inputmode",
2730
+ "line",
2731
+ "lineargradient",
2732
+ "marker",
2733
+ "mask",
2734
+ "metadata",
2735
+ "mpath",
2736
+ "part",
2737
+ "path",
2738
+ "pattern",
2739
+ "polygon",
2740
+ "polyline",
2741
+ "radialgradient",
2742
+ "rect",
2743
+ "stop",
2744
+ "style",
2745
+ "switch",
2746
+ "symbol",
2747
+ "text",
2748
+ "textpath",
2749
+ "title",
2750
+ "tref",
2751
+ "tspan",
2752
+ "view",
2753
+ "vkern"
2754
+ ]);
2755
+ svgFilters = freeze([
2756
+ "feBlend",
2757
+ "feColorMatrix",
2758
+ "feComponentTransfer",
2759
+ "feComposite",
2760
+ "feConvolveMatrix",
2761
+ "feDiffuseLighting",
2762
+ "feDisplacementMap",
2763
+ "feDistantLight",
2764
+ "feDropShadow",
2765
+ "feFlood",
2766
+ "feFuncA",
2767
+ "feFuncB",
2768
+ "feFuncG",
2769
+ "feFuncR",
2770
+ "feGaussianBlur",
2771
+ "feImage",
2772
+ "feMerge",
2773
+ "feMergeNode",
2774
+ "feMorphology",
2775
+ "feOffset",
2776
+ "fePointLight",
2777
+ "feSpecularLighting",
2778
+ "feSpotLight",
2779
+ "feTile",
2780
+ "feTurbulence"
2781
+ ]);
2782
+ svgDisallowed = freeze([
2783
+ "animate",
2784
+ "color-profile",
2785
+ "cursor",
2786
+ "discard",
2787
+ "font-face",
2788
+ "font-face-format",
2789
+ "font-face-name",
2790
+ "font-face-src",
2791
+ "font-face-uri",
2792
+ "foreignobject",
2793
+ "hatch",
2794
+ "hatchpath",
2795
+ "mesh",
2796
+ "meshgradient",
2797
+ "meshpatch",
2798
+ "meshrow",
2799
+ "missing-glyph",
2800
+ "script",
2801
+ "set",
2802
+ "solidcolor",
2803
+ "unknown",
2804
+ "use"
2805
+ ]);
2806
+ mathMl$1 = freeze([
2807
+ "math",
2808
+ "menclose",
2809
+ "merror",
2810
+ "mfenced",
2811
+ "mfrac",
2812
+ "mglyph",
2813
+ "mi",
2814
+ "mlabeledtr",
2815
+ "mmultiscripts",
2816
+ "mn",
2817
+ "mo",
2818
+ "mover",
2819
+ "mpadded",
2820
+ "mphantom",
2821
+ "mroot",
2822
+ "mrow",
2823
+ "ms",
2824
+ "mspace",
2825
+ "msqrt",
2826
+ "mstyle",
2827
+ "msub",
2828
+ "msup",
2829
+ "msubsup",
2830
+ "mtable",
2831
+ "mtd",
2832
+ "mtext",
2833
+ "mtr",
2834
+ "munder",
2835
+ "munderover",
2836
+ "mprescripts"
2837
+ ]);
2838
+ mathMlDisallowed = freeze([
2839
+ "maction",
2840
+ "maligngroup",
2841
+ "malignmark",
2842
+ "mlongdiv",
2843
+ "mscarries",
2844
+ "mscarry",
2845
+ "msgroup",
2846
+ "mstack",
2847
+ "msline",
2848
+ "msrow",
2849
+ "semantics",
2850
+ "annotation",
2851
+ "annotation-xml",
2852
+ "mprescripts",
2853
+ "none"
2854
+ ]);
2849
2855
  text = freeze(["#text"]);
2850
- html = freeze(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "command", "commandfor", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "exportparts", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inert", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "part", "pattern", "placeholder", "playsinline", "popover", "popovertarget", "popovertargetaction", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "slot", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "wrap", "xmlns"]);
2851
- svg = freeze(["accent-height", "accumulate", "additive", "alignment-baseline", "amplitude", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dominant-baseline", "dur", "edgemode", "elevation", "end", "exponent", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "intercept", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "mask-type", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "pointer-events", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "slope", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "tablevalues", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-orientation", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "vector-effect", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]);
2852
- mathMl = freeze(["accent", "accentunder", "align", "bevelled", "close", "columnalign", "columnlines", "columnspacing", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lquote", "lspace", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns"]);
2853
- xml = freeze(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]);
2856
+ html = freeze([
2857
+ "accept",
2858
+ "action",
2859
+ "align",
2860
+ "alt",
2861
+ "autocapitalize",
2862
+ "autocomplete",
2863
+ "autopictureinpicture",
2864
+ "autoplay",
2865
+ "background",
2866
+ "bgcolor",
2867
+ "border",
2868
+ "capture",
2869
+ "cellpadding",
2870
+ "cellspacing",
2871
+ "checked",
2872
+ "cite",
2873
+ "class",
2874
+ "clear",
2875
+ "color",
2876
+ "cols",
2877
+ "colspan",
2878
+ "command",
2879
+ "commandfor",
2880
+ "controls",
2881
+ "controlslist",
2882
+ "coords",
2883
+ "crossorigin",
2884
+ "datetime",
2885
+ "decoding",
2886
+ "default",
2887
+ "dir",
2888
+ "disabled",
2889
+ "disablepictureinpicture",
2890
+ "disableremoteplayback",
2891
+ "download",
2892
+ "draggable",
2893
+ "enctype",
2894
+ "enterkeyhint",
2895
+ "exportparts",
2896
+ "face",
2897
+ "for",
2898
+ "headers",
2899
+ "height",
2900
+ "hidden",
2901
+ "high",
2902
+ "href",
2903
+ "hreflang",
2904
+ "id",
2905
+ "inert",
2906
+ "inputmode",
2907
+ "integrity",
2908
+ "ismap",
2909
+ "kind",
2910
+ "label",
2911
+ "lang",
2912
+ "list",
2913
+ "loading",
2914
+ "loop",
2915
+ "low",
2916
+ "max",
2917
+ "maxlength",
2918
+ "media",
2919
+ "method",
2920
+ "min",
2921
+ "minlength",
2922
+ "multiple",
2923
+ "muted",
2924
+ "name",
2925
+ "nonce",
2926
+ "noshade",
2927
+ "novalidate",
2928
+ "nowrap",
2929
+ "open",
2930
+ "optimum",
2931
+ "part",
2932
+ "pattern",
2933
+ "placeholder",
2934
+ "playsinline",
2935
+ "popover",
2936
+ "popovertarget",
2937
+ "popovertargetaction",
2938
+ "poster",
2939
+ "preload",
2940
+ "pubdate",
2941
+ "radiogroup",
2942
+ "readonly",
2943
+ "rel",
2944
+ "required",
2945
+ "rev",
2946
+ "reversed",
2947
+ "role",
2948
+ "rows",
2949
+ "rowspan",
2950
+ "spellcheck",
2951
+ "scope",
2952
+ "selected",
2953
+ "shape",
2954
+ "size",
2955
+ "sizes",
2956
+ "slot",
2957
+ "span",
2958
+ "srclang",
2959
+ "start",
2960
+ "src",
2961
+ "srcset",
2962
+ "step",
2963
+ "style",
2964
+ "summary",
2965
+ "tabindex",
2966
+ "title",
2967
+ "translate",
2968
+ "type",
2969
+ "usemap",
2970
+ "valign",
2971
+ "value",
2972
+ "width",
2973
+ "wrap",
2974
+ "xmlns"
2975
+ ]);
2976
+ svg = freeze([
2977
+ "accent-height",
2978
+ "accumulate",
2979
+ "additive",
2980
+ "alignment-baseline",
2981
+ "amplitude",
2982
+ "ascent",
2983
+ "attributename",
2984
+ "attributetype",
2985
+ "azimuth",
2986
+ "basefrequency",
2987
+ "baseline-shift",
2988
+ "begin",
2989
+ "bias",
2990
+ "by",
2991
+ "class",
2992
+ "clip",
2993
+ "clippathunits",
2994
+ "clip-path",
2995
+ "clip-rule",
2996
+ "color",
2997
+ "color-interpolation",
2998
+ "color-interpolation-filters",
2999
+ "color-profile",
3000
+ "color-rendering",
3001
+ "cx",
3002
+ "cy",
3003
+ "d",
3004
+ "dx",
3005
+ "dy",
3006
+ "diffuseconstant",
3007
+ "direction",
3008
+ "display",
3009
+ "divisor",
3010
+ "dominant-baseline",
3011
+ "dur",
3012
+ "edgemode",
3013
+ "elevation",
3014
+ "end",
3015
+ "exponent",
3016
+ "fill",
3017
+ "fill-opacity",
3018
+ "fill-rule",
3019
+ "filter",
3020
+ "filterunits",
3021
+ "flood-color",
3022
+ "flood-opacity",
3023
+ "font-family",
3024
+ "font-size",
3025
+ "font-size-adjust",
3026
+ "font-stretch",
3027
+ "font-style",
3028
+ "font-variant",
3029
+ "font-weight",
3030
+ "fx",
3031
+ "fy",
3032
+ "g1",
3033
+ "g2",
3034
+ "glyph-name",
3035
+ "glyphref",
3036
+ "gradientunits",
3037
+ "gradienttransform",
3038
+ "height",
3039
+ "href",
3040
+ "id",
3041
+ "image-rendering",
3042
+ "in",
3043
+ "in2",
3044
+ "intercept",
3045
+ "k",
3046
+ "k1",
3047
+ "k2",
3048
+ "k3",
3049
+ "k4",
3050
+ "kerning",
3051
+ "keypoints",
3052
+ "keysplines",
3053
+ "keytimes",
3054
+ "lang",
3055
+ "lengthadjust",
3056
+ "letter-spacing",
3057
+ "kernelmatrix",
3058
+ "kernelunitlength",
3059
+ "lighting-color",
3060
+ "local",
3061
+ "marker-end",
3062
+ "marker-mid",
3063
+ "marker-start",
3064
+ "markerheight",
3065
+ "markerunits",
3066
+ "markerwidth",
3067
+ "maskcontentunits",
3068
+ "maskunits",
3069
+ "max",
3070
+ "mask",
3071
+ "mask-type",
3072
+ "media",
3073
+ "method",
3074
+ "mode",
3075
+ "min",
3076
+ "name",
3077
+ "numoctaves",
3078
+ "offset",
3079
+ "operator",
3080
+ "opacity",
3081
+ "order",
3082
+ "orient",
3083
+ "orientation",
3084
+ "origin",
3085
+ "overflow",
3086
+ "paint-order",
3087
+ "path",
3088
+ "pathlength",
3089
+ "patterncontentunits",
3090
+ "patterntransform",
3091
+ "patternunits",
3092
+ "pointer-events",
3093
+ "points",
3094
+ "preservealpha",
3095
+ "preserveaspectratio",
3096
+ "primitiveunits",
3097
+ "r",
3098
+ "rx",
3099
+ "ry",
3100
+ "radius",
3101
+ "refx",
3102
+ "refy",
3103
+ "repeatcount",
3104
+ "repeatdur",
3105
+ "restart",
3106
+ "result",
3107
+ "rotate",
3108
+ "scale",
3109
+ "seed",
3110
+ "shape-rendering",
3111
+ "slope",
3112
+ "specularconstant",
3113
+ "specularexponent",
3114
+ "spreadmethod",
3115
+ "startoffset",
3116
+ "stddeviation",
3117
+ "stitchtiles",
3118
+ "stop-color",
3119
+ "stop-opacity",
3120
+ "stroke-dasharray",
3121
+ "stroke-dashoffset",
3122
+ "stroke-linecap",
3123
+ "stroke-linejoin",
3124
+ "stroke-miterlimit",
3125
+ "stroke-opacity",
3126
+ "stroke",
3127
+ "stroke-width",
3128
+ "style",
3129
+ "surfacescale",
3130
+ "systemlanguage",
3131
+ "tabindex",
3132
+ "tablevalues",
3133
+ "targetx",
3134
+ "targety",
3135
+ "transform",
3136
+ "transform-origin",
3137
+ "text-anchor",
3138
+ "text-decoration",
3139
+ "text-orientation",
3140
+ "text-rendering",
3141
+ "textlength",
3142
+ "type",
3143
+ "u1",
3144
+ "u2",
3145
+ "unicode",
3146
+ "values",
3147
+ "vector-effect",
3148
+ "viewbox",
3149
+ "visibility",
3150
+ "version",
3151
+ "vert-adv-y",
3152
+ "vert-origin-x",
3153
+ "vert-origin-y",
3154
+ "width",
3155
+ "word-spacing",
3156
+ "wrap",
3157
+ "writing-mode",
3158
+ "xchannelselector",
3159
+ "ychannelselector",
3160
+ "x",
3161
+ "x1",
3162
+ "x2",
3163
+ "xmlns",
3164
+ "y",
3165
+ "y1",
3166
+ "y2",
3167
+ "z",
3168
+ "zoomandpan"
3169
+ ]);
3170
+ mathMl = freeze([
3171
+ "accent",
3172
+ "accentunder",
3173
+ "align",
3174
+ "bevelled",
3175
+ "close",
3176
+ "columnalign",
3177
+ "columnlines",
3178
+ "columnspacing",
3179
+ "columnspan",
3180
+ "denomalign",
3181
+ "depth",
3182
+ "dir",
3183
+ "display",
3184
+ "displaystyle",
3185
+ "encoding",
3186
+ "fence",
3187
+ "frame",
3188
+ "height",
3189
+ "href",
3190
+ "id",
3191
+ "largeop",
3192
+ "length",
3193
+ "linethickness",
3194
+ "lquote",
3195
+ "lspace",
3196
+ "mathbackground",
3197
+ "mathcolor",
3198
+ "mathsize",
3199
+ "mathvariant",
3200
+ "maxsize",
3201
+ "minsize",
3202
+ "movablelimits",
3203
+ "notation",
3204
+ "numalign",
3205
+ "open",
3206
+ "rowalign",
3207
+ "rowlines",
3208
+ "rowspacing",
3209
+ "rowspan",
3210
+ "rspace",
3211
+ "rquote",
3212
+ "scriptlevel",
3213
+ "scriptminsize",
3214
+ "scriptsizemultiplier",
3215
+ "selection",
3216
+ "separator",
3217
+ "separators",
3218
+ "stretchy",
3219
+ "subscriptshift",
3220
+ "supscriptshift",
3221
+ "symmetric",
3222
+ "voffset",
3223
+ "width",
3224
+ "xmlns"
3225
+ ]);
3226
+ xml = freeze([
3227
+ "xlink:href",
3228
+ "xml:id",
3229
+ "xlink:title",
3230
+ "xml:space",
3231
+ "xmlns:xlink"
3232
+ ]);
2854
3233
  MUSTACHE_EXPR = seal(/{{[\w\W]*|^[\w\W]*}}/g);
2855
3234
  ERB_EXPR = seal(/<%[\w\W]*|^[\w\W]*%>/g);
2856
3235
  TMPLIT_EXPR = seal(/\${[\w\W]*/g);
2857
3236
  DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]+$/);
2858
3237
  ARIA_ATTR = seal(/^aria-[\-\w]+$/);
2859
- IS_ALLOWED_URI = seal(
2860
- /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
2861
- // eslint-disable-line no-useless-escape
2862
- );
3238
+ IS_ALLOWED_URI = seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i);
2863
3239
  IS_SCRIPT_OR_DATA = seal(/^(?:\w+script|data):/i);
2864
- ATTR_WHITESPACE = seal(
2865
- /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
2866
- // eslint-disable-line no-control-regex
2867
- );
3240
+ ATTR_WHITESPACE = seal(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g);
2868
3241
  DOCTYPE_NAME = seal(/^html$/i);
2869
3242
  CUSTOM_ELEMENT = seal(/^[a-z][.\w]*(-[.\w]+)+$/i);
2870
3243
  ELEMENT_MARKUP_PROBE = seal(/<[/\w!]/g);
@@ -2877,18 +3250,24 @@ var init_purify_es = __esm({
2877
3250
  text: 3,
2878
3251
  cdataSection: 4,
2879
3252
  entityReference: 5,
2880
- // Deprecated
2881
3253
  entityNode: 6,
2882
- // Deprecated
2883
3254
  processingInstruction: 7,
2884
3255
  comment: 8,
2885
3256
  document: 9,
2886
3257
  documentType: 10,
2887
3258
  documentFragment: 11,
2888
3259
  notation: 12
2889
- // Deprecated
2890
3260
  };
2891
- LITERAL_TEXT_ELEMENT_NAMES = ["style", "script", "xmp", "iframe", "noembed", "noframes", "plaintext", "noscript"];
3261
+ LITERAL_TEXT_ELEMENT_NAMES = [
3262
+ "style",
3263
+ "script",
3264
+ "xmp",
3265
+ "iframe",
3266
+ "noembed",
3267
+ "noframes",
3268
+ "plaintext",
3269
+ "noscript"
3270
+ ];
2892
3271
  LITERAL_TEXT_ELEMENTS = freeze(addToSet({}, LITERAL_TEXT_ELEMENT_NAMES));
2893
3272
  LITERAL_TEXT_CLOSE = (function() {
2894
3273
  const map6 = {};
@@ -2901,14 +3280,10 @@ var init_purify_es = __esm({
2901
3280
  return typeof window === "undefined" ? null : window;
2902
3281
  };
2903
3282
  _createTrustedTypesPolicy = function _createTrustedTypesPolicy2(trustedTypes, purifyHostElement) {
2904
- if (typeof trustedTypes !== "object" || typeof trustedTypes.createPolicy !== "function") {
2905
- return null;
2906
- }
3283
+ if (typeof trustedTypes !== "object" || typeof trustedTypes.createPolicy !== "function") return null;
2907
3284
  let suffix = null;
2908
3285
  const ATTR_NAME = "data-tt-policy-suffix";
2909
- if (purifyHostElement && purifyHostElement.hasAttribute(ATTR_NAME)) {
2910
- suffix = purifyHostElement.getAttribute(ATTR_NAME);
2911
- }
3286
+ if (purifyHostElement && purifyHostElement.hasAttribute(ATTR_NAME)) suffix = purifyHostElement.getAttribute(ATTR_NAME);
2912
3287
  const policyName = "dompurify" + (suffix ? "#" + suffix : "");
2913
3288
  try {
2914
3289
  return trustedTypes.createPolicy(policyName, {
@@ -2944,7 +3319,7 @@ var init_purify_es = __esm({
2944
3319
  const value2 = objectHasOwnProperty(cfg, key) ? cfg[key] : void 0;
2945
3320
  return value2 && typeof value2 === "object" ? clone(value2) : makeFallback();
2946
3321
  };
2947
- purify = createDOMPurify();
3322
+ purify_default = createDOMPurify();
2948
3323
  }
2949
3324
  });
2950
3325
 
@@ -17458,12 +17833,12 @@ var init_katex = __esm({
17458
17833
  // node_modules/mermaid/dist/chunks/mermaid.core/chunk-O7XYJQB3.mjs
17459
17834
  function setupDompurifyHooks() {
17460
17835
  const TEMPORARY_ATTRIBUTE = "data-temp-href-target";
17461
- purify.addHook("beforeSanitizeAttributes", (node2) => {
17836
+ purify_default.addHook("beforeSanitizeAttributes", (node2) => {
17462
17837
  if (node2.tagName === "A" && node2.hasAttribute("target")) {
17463
17838
  node2.setAttribute(TEMPORARY_ATTRIBUTE, node2.getAttribute("target") ?? "");
17464
17839
  }
17465
17840
  });
17466
- purify.addHook("afterSanitizeAttributes", (node2) => {
17841
+ purify_default.addHook("afterSanitizeAttributes", (node2) => {
17467
17842
  if (node2.tagName === "A" && node2.hasAttribute(TEMPORARY_ATTRIBUTE)) {
17468
17843
  node2.setAttribute("target", node2.getAttribute(TEMPORARY_ATTRIBUTE) ?? "");
17469
17844
  node2.removeAttribute(TEMPORARY_ATTRIBUTE);
@@ -22679,7 +23054,7 @@ var init_chunk_O7XYJQB3 = __esm({
22679
23054
  __name(setupDompurifyHooks, "setupDompurifyHooks");
22680
23055
  removeScript = /* @__PURE__ */ __name((txt) => {
22681
23056
  setupDompurifyHooksIfNotSetup();
22682
- const sanitizedText = purify.sanitize(txt);
23057
+ const sanitizedText = purify_default.sanitize(txt);
22683
23058
  return sanitizedText;
22684
23059
  }, "removeScript");
22685
23060
  sanitizeMore = /* @__PURE__ */ __name((text4, config22) => {
@@ -22701,9 +23076,9 @@ var init_chunk_O7XYJQB3 = __esm({
22701
23076
  return text4;
22702
23077
  }
22703
23078
  if (config22.dompurifyConfig) {
22704
- text4 = purify.sanitize(sanitizeMore(text4, config22), config22.dompurifyConfig).toString();
23079
+ text4 = purify_default.sanitize(sanitizeMore(text4, config22), config22.dompurifyConfig).toString();
22705
23080
  } else {
22706
- text4 = purify.sanitize(sanitizeMore(text4, config22), {
23081
+ text4 = purify_default.sanitize(sanitizeMore(text4, config22), {
22707
23082
  FORBID_TAGS: ["style"]
22708
23083
  }).toString();
22709
23084
  }
@@ -48126,7 +48501,7 @@ var init_baseCreate = __esm({
48126
48501
  });
48127
48502
 
48128
48503
  // node_modules/lodash-es/_apply.js
48129
- function apply2(func, thisArg, args) {
48504
+ function apply3(func, thisArg, args) {
48130
48505
  switch (args.length) {
48131
48506
  case 0:
48132
48507
  return func.call(thisArg);
@@ -48142,7 +48517,7 @@ function apply2(func, thisArg, args) {
48142
48517
  var apply_default;
48143
48518
  var init_apply = __esm({
48144
48519
  "node_modules/lodash-es/_apply.js"() {
48145
- apply_default = apply2;
48520
+ apply_default = apply3;
48146
48521
  }
48147
48522
  });
48148
48523
 
@@ -167970,7 +168345,7 @@ var init_cytoscape_esm = __esm({
167970
168345
  playing: function playing() {
167971
168346
  return this._private.playing;
167972
168347
  },
167973
- apply: function apply3() {
168348
+ apply: function apply4() {
167974
168349
  var _p = this._private;
167975
168350
  _p.applying = true;
167976
168351
  _p.started = false;
@@ -198138,7 +198513,7 @@ You have to call mermaid.initialize.`
198138
198513
  const rect2 = e3.currentTarget?.getBoundingClientRect();
198139
198514
  tooltipElem.transition().duration(200).style("opacity", ".9");
198140
198515
  tooltipElem.text(el.attr("title")).style("left", window.scrollX + rect2.left + (rect2.right - rect2.left) / 2 + "px").style("top", window.scrollY + rect2.bottom + "px");
198141
- tooltipElem.html(purify.sanitize(title2));
198516
+ tooltipElem.html(purify_default.sanitize(title2));
198142
198517
  el.classed("hover", true);
198143
198518
  }).on("mouseout", (e3) => {
198144
198519
  tooltipElem.transition().duration(500).style("opacity", 0);
@@ -201351,7 +201726,7 @@ You have to call mermaid.initialize.`
201351
201726
  const rect2 = e3.currentTarget?.getBoundingClientRect();
201352
201727
  tooltipElem.transition().duration(200).style("opacity", ".9");
201353
201728
  tooltipElem.text(el.attr("title")).style("left", window.scrollX + rect2.left + (rect2.right - rect2.left) / 2 + "px").style("top", window.scrollY + rect2.bottom + "px");
201354
- tooltipElem.html(purify.sanitize(title2));
201729
+ tooltipElem.html(purify_default.sanitize(title2));
201355
201730
  el.classed("hover", true);
201356
201731
  }).on("mouseout", (e3) => {
201357
201732
  tooltipElem.transition().duration(500).style("opacity", 0);
@@ -207238,7 +207613,7 @@ function getNative2(object3, key) {
207238
207613
  var value2 = getValue_default2(object3, key);
207239
207614
  return baseIsNative_default2(value2) ? value2 : void 0;
207240
207615
  }
207241
- function apply4(func, thisArg, args) {
207616
+ function apply5(func, thisArg, args) {
207242
207617
  switch (args.length) {
207243
207618
  case 0:
207244
207619
  return func.call(thisArg);
@@ -223316,8 +223691,8 @@ ${JSON.stringify(message, null, 4)}`);
223316
223691
  };
223317
223692
  })();
223318
223693
  baseCreate_default2 = baseCreate2;
223319
- __name2(apply4, "apply");
223320
- apply_default2 = apply4;
223694
+ __name2(apply5, "apply");
223695
+ apply_default2 = apply5;
223321
223696
  __name2(noop7, "noop");
223322
223697
  noop_default3 = noop7;
223323
223698
  __name2(copyArray4, "copyArray");
@@ -253686,7 +254061,7 @@ var init_classDiagram_v2_NBCMYWYE = __esm({
253686
254061
  }
253687
254062
  const rect2 = event3.currentTarget.getBoundingClientRect();
253688
254063
  tooltipElem.transition().duration(200).style("opacity", ".9");
253689
- tooltipElem.html(purify.sanitize(title2)).style("left", `${window.scrollX + rect2.left + rect2.width / 2}px`).style("top", `${window.scrollY + rect2.bottom + 4}px`);
254064
+ tooltipElem.html(purify_default.sanitize(title2)).style("left", `${window.scrollX + rect2.left + rect2.width / 2}px`).style("top", `${window.scrollY + rect2.bottom + 4}px`);
253690
254065
  el.classed("hover", true);
253691
254066
  }).on("mouseout", (event3) => {
253692
254067
  tooltipElem.transition().duration(500).style("opacity", 0);
@@ -256456,7 +256831,7 @@ var init_stateDiagram_v2_GCMORJYK = __esm({
256456
256831
  const rect2 = e3.currentTarget?.getBoundingClientRect();
256457
256832
  tooltipElem.transition().duration(200).style("opacity", ".9");
256458
256833
  tooltipElem.style("left", window.scrollX + rect2.left + (rect2.right - rect2.left) / 2 + "px").style("top", window.scrollY + rect2.bottom + "px");
256459
- tooltipElem.html(purify.sanitize(title2));
256834
+ tooltipElem.html(purify_default.sanitize(title2));
256460
256835
  el.classed("hover", true);
256461
256836
  }).on("mouseout", (e3) => {
256462
256837
  tooltipElem.transition().duration(500).style("opacity", 0);
@@ -295773,7 +296148,7 @@ var renderDiagram = /* @__PURE__ */ __name(async function(id38, text4, svgContai
295773
296148
  const svgEl = root4.select(enclosingDivID_selector + " svg").node();
295774
296149
  code2 = putIntoIFrame(code2, svgEl);
295775
296150
  } else if (!isLooseSecurityLevel) {
295776
- code2 = purify.sanitize(code2, {
296151
+ code2 = purify_default.sanitize(code2, {
295777
296152
  ADD_TAGS: DOMPURIFY_TAGS,
295778
296153
  ADD_ATTR: DOMPURIFY_ATTR,
295779
296154
  HTML_INTEGRATION_POINTS: { foreignobject: true }
@@ -296514,7 +296889,8 @@ export {
296514
296889
  /*! Bundled license information:
296515
296890
 
296516
296891
  dompurify/dist/purify.es.mjs:
296517
- (*! @license DOMPurify 3.4.15 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.15/LICENSE *)
296892
+ (*! @license DOMPurify 3.4.16 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.16/LICENSE *)
296893
+ (*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE *)
296518
296894
 
296519
296895
  lodash-es/lodash.js:
296520
296896
  (**