@clevertask/scribe 0.0.9 → 0.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/README.md +23 -0
  2. package/dist/browser-BJWkU9cc.js +2106 -0
  3. package/dist/clsx-OuTLNxxd.js +16 -0
  4. package/dist/components/Menu/BarMenu.d.ts +1 -0
  5. package/dist/components/Menu/BarMenu.js +38 -36
  6. package/dist/components/Menu/BubbleMenu.js +1 -1
  7. package/dist/components/Scribe/extension/emoji/EmojiList.d.ts +1 -0
  8. package/dist/components/Scribe/extension/emoji/EmojiList.js +35 -0
  9. package/dist/components/Scribe/extension/emoji/suggest.d.ts +16 -0
  10. package/dist/components/Scribe/extension/emoji/suggest.js +40 -0
  11. package/dist/components/Scribe/extension/extension-link.js +208 -200
  12. package/dist/components/Scribe/extension/extension-selectedText.js +1 -1
  13. package/dist/components/Scribe/extension/index.js +30 -24
  14. package/dist/components/Scribe/extension/math-extension.js +1 -1
  15. package/dist/components/Scribe/extension/slashCommand/SlashCommandList.js +7 -5
  16. package/dist/components/Scribe/extension/slashCommand/index.js +4 -153
  17. package/dist/components/Scribe/extension/slashCommand/renderItems.d.ts +1 -1
  18. package/dist/components/Scribe/extension/slashCommand/renderItems.js +14 -14
  19. package/dist/components/Scribe/index.d.ts +1 -0
  20. package/dist/components/Scribe/index.js +69 -75
  21. package/dist/index-BqFHWqw6.js +156 -0
  22. package/dist/{index-C3_lI_rP.js → index-C_aWB8qt.js} +449 -427
  23. package/dist/index-CasgquAq.js +39381 -0
  24. package/dist/{index-Gm-3o3nq.js → index-DeZ8laak.js} +1124 -1083
  25. package/dist/main.css +95 -5
  26. package/dist/{turndown.browser.es-BSoGafvq.js → turndown.browser.es-C1wFFc_i.js} +342 -334
  27. package/dist/utils/create-scribe-editor.js +2 -2
  28. package/dist/utils/html-to-markdown.js +1 -1
  29. package/dist/utils/markdown-to-html.js +1 -1
  30. package/package.json +33 -31
  31. package/dist/browser-DEobZXxB.js +0 -2099
  32. package/dist/index-NRgJVTH-.js +0 -7576
@@ -1,18 +1,18 @@
1
- /*! @license DOMPurify 3.2.5 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.5/LICENSE */
1
+ /*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */
2
2
  const {
3
- entries: Lt,
4
- setPrototypeOf: Tt,
5
- isFrozen: sn,
6
- getPrototypeOf: cn,
7
- getOwnPropertyDescriptor: fn
3
+ entries: Dt,
4
+ setPrototypeOf: Et,
5
+ isFrozen: cn,
6
+ getPrototypeOf: fn,
7
+ getOwnPropertyDescriptor: un
8
8
  } = Object;
9
9
  let {
10
10
  freeze: v,
11
11
  seal: C,
12
- create: Dt
12
+ create: Ct
13
13
  } = Object, {
14
- apply: He,
15
- construct: Be
14
+ apply: Be,
15
+ construct: ze
16
16
  } = typeof Reflect < "u" && Reflect;
17
17
  v || (v = function(t) {
18
18
  return t;
@@ -20,99 +20,99 @@ v || (v = function(t) {
20
20
  C || (C = function(t) {
21
21
  return t;
22
22
  });
23
- He || (He = function(t, r, i) {
23
+ Be || (Be = function(t, r, i) {
24
24
  return t.apply(r, i);
25
25
  });
26
- Be || (Be = function(t, r) {
26
+ ze || (ze = function(t, r) {
27
27
  return new t(...r);
28
28
  });
29
- const ue = b(Array.prototype.forEach), un = b(Array.prototype.lastIndexOf), Et = b(Array.prototype.pop), Z = b(Array.prototype.push), mn = b(Array.prototype.splice), pe = b(String.prototype.toLowerCase), Ie = b(String.prototype.toString), At = b(String.prototype.match), Q = b(String.prototype.replace), pn = b(String.prototype.indexOf), dn = b(String.prototype.trim), I = b(Object.prototype.hasOwnProperty), O = b(RegExp.prototype.test), J = hn(TypeError);
29
+ const me = b(Array.prototype.forEach), mn = b(Array.prototype.lastIndexOf), At = b(Array.prototype.pop), Q = b(Array.prototype.push), pn = b(Array.prototype.splice), de = b(String.prototype.toLowerCase), Me = b(String.prototype.toString), _t = b(String.prototype.match), J = b(String.prototype.replace), dn = b(String.prototype.indexOf), hn = b(String.prototype.trim), I = b(Object.prototype.hasOwnProperty), O = b(RegExp.prototype.test), ee = gn(TypeError);
30
30
  function b(e) {
31
31
  return function(t) {
32
32
  t instanceof RegExp && (t.lastIndex = 0);
33
33
  for (var r = arguments.length, i = new Array(r > 1 ? r - 1 : 0), s = 1; s < r; s++)
34
34
  i[s - 1] = arguments[s];
35
- return He(e, t, i);
35
+ return Be(e, t, i);
36
36
  };
37
37
  }
38
- function hn(e) {
38
+ function gn(e) {
39
39
  return function() {
40
40
  for (var t = arguments.length, r = new Array(t), i = 0; i < t; i++)
41
41
  r[i] = arguments[i];
42
- return Be(e, r);
42
+ return ze(e, r);
43
43
  };
44
44
  }
45
45
  function f(e, t) {
46
- let r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : pe;
47
- Tt && Tt(e, null);
46
+ let r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : de;
47
+ Et && Et(e, null);
48
48
  let i = t.length;
49
49
  for (; i--; ) {
50
50
  let s = t[i];
51
51
  if (typeof s == "string") {
52
52
  const c = r(s);
53
- c !== s && (sn(t) || (t[i] = c), s = c);
53
+ c !== s && (cn(t) || (t[i] = c), s = c);
54
54
  }
55
55
  e[s] = !0;
56
56
  }
57
57
  return e;
58
58
  }
59
- function gn(e) {
59
+ function Tn(e) {
60
60
  for (let t = 0; t < e.length; t++)
61
61
  I(e, t) || (e[t] = null);
62
62
  return e;
63
63
  }
64
- function U(e) {
65
- const t = Dt(null);
66
- for (const [r, i] of Lt(e))
67
- I(e, r) && (Array.isArray(i) ? t[r] = gn(i) : i && typeof i == "object" && i.constructor === Object ? t[r] = U(i) : t[r] = i);
64
+ function P(e) {
65
+ const t = Ct(null);
66
+ for (const [r, i] of Dt(e))
67
+ I(e, r) && (Array.isArray(i) ? t[r] = Tn(i) : i && typeof i == "object" && i.constructor === Object ? t[r] = P(i) : t[r] = i);
68
68
  return t;
69
69
  }
70
- function ee(e, t) {
70
+ function te(e, t) {
71
71
  for (; e !== null; ) {
72
- const i = fn(e, t);
72
+ const i = un(e, t);
73
73
  if (i) {
74
74
  if (i.get)
75
75
  return b(i.get);
76
76
  if (typeof i.value == "function")
77
77
  return b(i.value);
78
78
  }
79
- e = cn(e);
79
+ e = fn(e);
80
80
  }
81
81
  function r() {
82
82
  return null;
83
83
  }
84
84
  return r;
85
85
  }
86
- const _t = v(["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", "section", "select", "shadow", "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"]), Me = v(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]), we = v(["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"]), Tn = v(["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"]), ke = v(["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"]), En = v(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), St = v(["#text"]), Rt = v(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "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", "pattern", "placeholder", "playsinline", "popover", "popovertarget", "popovertargetaction", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "wrap", "xmlns", "slot"]), xe = v(["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", "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", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "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-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "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"]), yt = v(["accent", "accentunder", "align", "bevelled", "close", "columnsalign", "columnlines", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lspace", "lquote", "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"]), me = v(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), An = C(/\{\{[\w\W]*|[\w\W]*\}\}/gm), _n = C(/<%[\w\W]*|[\w\W]*%>/gm), Sn = C(/\$\{[\w\W]*/gm), Rn = C(/^data-[\-\w.\u00B7-\uFFFF]+$/), yn = C(/^aria-[\-\w]+$/), Ct = C(
87
- /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
86
+ const St = v(["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", "section", "select", "shadow", "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"]), we = v(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]), ke = v(["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"]), En = v(["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"]), xe = v(["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"]), An = v(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), Rt = v(["#text"]), yt = v(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "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", "pattern", "placeholder", "playsinline", "popover", "popovertarget", "popovertargetaction", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "wrap", "xmlns", "slot"]), Pe = v(["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", "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", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "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-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "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"]), Nt = v(["accent", "accentunder", "align", "bevelled", "close", "columnsalign", "columnlines", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lspace", "lquote", "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"]), pe = v(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), _n = C(/\{\{[\w\W]*|[\w\W]*\}\}/gm), Sn = C(/<%[\w\W]*|[\w\W]*%>/gm), Rn = C(/\$\{[\w\W]*/gm), yn = C(/^data-[\-\w.\u00B7-\uFFFF]+$/), Nn = C(/^aria-[\-\w]+$/), It = C(
87
+ /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
88
88
  // eslint-disable-line no-useless-escape
89
- ), Nn = C(/^(?:\w+script|data):/i), On = C(
89
+ ), On = C(/^(?:\w+script|data):/i), vn = C(
90
90
  /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
91
91
  // eslint-disable-line no-control-regex
92
- ), It = C(/^html$/i), vn = C(/^[a-z][.\w]*(-[.\w]+)+$/i);
93
- var Nt = /* @__PURE__ */ Object.freeze({
92
+ ), Mt = C(/^html$/i), bn = C(/^[a-z][.\w]*(-[.\w]+)+$/i);
93
+ var Ot = /* @__PURE__ */ Object.freeze({
94
94
  __proto__: null,
95
- ARIA_ATTR: yn,
96
- ATTR_WHITESPACE: On,
97
- CUSTOM_ELEMENT: vn,
98
- DATA_ATTR: Rn,
99
- DOCTYPE_NAME: It,
100
- ERB_EXPR: _n,
101
- IS_ALLOWED_URI: Ct,
102
- IS_SCRIPT_OR_DATA: Nn,
103
- MUSTACHE_EXPR: An,
104
- TMPLIT_EXPR: Sn
95
+ ARIA_ATTR: Nn,
96
+ ATTR_WHITESPACE: vn,
97
+ CUSTOM_ELEMENT: bn,
98
+ DATA_ATTR: yn,
99
+ DOCTYPE_NAME: Mt,
100
+ ERB_EXPR: Sn,
101
+ IS_ALLOWED_URI: It,
102
+ IS_SCRIPT_OR_DATA: On,
103
+ MUSTACHE_EXPR: _n,
104
+ TMPLIT_EXPR: Rn
105
105
  });
106
- const te = {
106
+ const ne = {
107
107
  element: 1,
108
108
  text: 3,
109
109
  // Deprecated
110
110
  progressingInstruction: 7,
111
111
  comment: 8,
112
112
  document: 9
113
- }, bn = function() {
113
+ }, Ln = function() {
114
114
  return typeof window > "u" ? null : window;
115
- }, Ln = function(t, r) {
115
+ }, Dn = function(t, r) {
116
116
  if (typeof t != "object" || typeof t.createPolicy != "function")
117
117
  return null;
118
118
  let i = null;
@@ -131,7 +131,7 @@ const te = {
131
131
  } catch {
132
132
  return console.warn("TrustedTypes policy " + c + " could not be created."), null;
133
133
  }
134
- }, Ot = function() {
134
+ }, vt = function() {
135
135
  return {
136
136
  afterSanitizeAttributes: [],
137
137
  afterSanitizeElements: [],
@@ -144,10 +144,10 @@ const te = {
144
144
  uponSanitizeShadowNode: []
145
145
  };
146
146
  };
147
- function Mt() {
148
- let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : bn();
149
- const t = (l) => Mt(l);
150
- if (t.version = "3.2.5", t.removed = [], !e || !e.document || e.document.nodeType !== te.document || !e.Element)
147
+ function wt() {
148
+ let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Ln();
149
+ const t = (l) => wt(l);
150
+ if (t.version = "3.2.6", t.removed = [], !e || !e.document || e.document.nodeType !== ne.document || !e.Element)
151
151
  return t.isSupported = !1, t;
152
152
  let {
153
153
  document: r
@@ -157,44 +157,44 @@ function Mt() {
157
157
  HTMLTemplateElement: p,
158
158
  Node: L,
159
159
  Element: m,
160
- NodeFilter: S,
160
+ NodeFilter: R,
161
161
  NamedNodeMap: F = e.NamedNodeMap || e.MozNamedAttrMap,
162
- HTMLFormElement: he,
163
- DOMParser: Bt,
164
- trustedTypes: ne
165
- } = e, $ = m.prototype, zt = ee($, "cloneNode"), Wt = ee($, "remove"), Gt = ee($, "nextSibling"), Yt = ee($, "childNodes"), re = ee($, "parentNode");
162
+ HTMLFormElement: ge,
163
+ DOMParser: zt,
164
+ trustedTypes: re
165
+ } = e, V = m.prototype, Wt = te(V, "cloneNode"), Gt = te(V, "remove"), Yt = te(V, "nextSibling"), $t = te(V, "childNodes"), ie = te(V, "parentNode");
166
166
  if (typeof p == "function") {
167
167
  const l = r.createElement("template");
168
168
  l.content && l.content.ownerDocument && (r = l.content.ownerDocument);
169
169
  }
170
- let R, V = "";
170
+ let y, X = "";
171
171
  const {
172
- implementation: ge,
173
- createNodeIterator: $t,
174
- createDocumentFragment: Vt,
175
- getElementsByTagName: Xt
172
+ implementation: Te,
173
+ createNodeIterator: Vt,
174
+ createDocumentFragment: Xt,
175
+ getElementsByTagName: jt
176
176
  } = r, {
177
- importNode: jt
177
+ importNode: Kt
178
178
  } = i;
179
- let y = Ot();
180
- t.isSupported = typeof Lt == "function" && typeof re == "function" && ge && ge.createHTMLDocument !== void 0;
179
+ let N = vt();
180
+ t.isSupported = typeof Dt == "function" && typeof ie == "function" && Te && Te.createHTMLDocument !== void 0;
181
181
  const {
182
- MUSTACHE_EXPR: Te,
183
- ERB_EXPR: Ee,
184
- TMPLIT_EXPR: Ae,
185
- DATA_ATTR: Kt,
186
- ARIA_ATTR: qt,
187
- IS_SCRIPT_OR_DATA: Zt,
188
- ATTR_WHITESPACE: Ve,
189
- CUSTOM_ELEMENT: Qt
190
- } = Nt;
182
+ MUSTACHE_EXPR: Ee,
183
+ ERB_EXPR: Ae,
184
+ TMPLIT_EXPR: _e,
185
+ DATA_ATTR: qt,
186
+ ARIA_ATTR: Zt,
187
+ IS_SCRIPT_OR_DATA: Qt,
188
+ ATTR_WHITESPACE: Xe,
189
+ CUSTOM_ELEMENT: Jt
190
+ } = Ot;
191
191
  let {
192
- IS_ALLOWED_URI: Xe
193
- } = Nt, h = null;
194
- const je = f({}, [..._t, ...Me, ...we, ...ke, ...St]);
195
- let T = null;
196
- const Ke = f({}, [...Rt, ...xe, ...yt, ...me]);
197
- let d = Object.seal(Dt(null, {
192
+ IS_ALLOWED_URI: je
193
+ } = Ot, g = null;
194
+ const Ke = f({}, [...St, ...we, ...ke, ...xe, ...Rt]);
195
+ let E = null;
196
+ const qe = f({}, [...yt, ...Pe, ...Nt, ...pe]);
197
+ let d = Object.seal(Ct(null, {
198
198
  tagNameCheck: {
199
199
  writable: !0,
200
200
  configurable: !1,
@@ -213,68 +213,68 @@ function Mt() {
213
213
  enumerable: !0,
214
214
  value: !1
215
215
  }
216
- })), X = null, _e = null, qe = !0, Se = !0, Ze = !1, Qe = !0, H = !1, Re = !0, P = !1, ye = !1, Ne = !1, B = !1, ie = !1, ae = !1, Je = !0, et = !1;
217
- const Jt = "user-content-";
218
- let Oe = !0, j = !1, z = {}, W = null;
219
- const tt = f({}, ["annotation-xml", "audio", "colgroup", "desc", "foreignobject", "head", "iframe", "math", "mi", "mn", "mo", "ms", "mtext", "noembed", "noframes", "noscript", "plaintext", "script", "style", "svg", "template", "thead", "title", "video", "xmp"]);
220
- let nt = null;
221
- const rt = f({}, ["audio", "video", "img", "source", "image", "track"]);
216
+ })), j = null, Se = null, Ze = !0, Re = !0, Qe = !1, Je = !0, H = !1, ae = !0, U = !1, ye = !1, Ne = !1, B = !1, oe = !1, le = !1, et = !0, tt = !1;
217
+ const en = "user-content-";
218
+ let Oe = !0, K = !1, z = {}, W = null;
219
+ const nt = f({}, ["annotation-xml", "audio", "colgroup", "desc", "foreignobject", "head", "iframe", "math", "mi", "mn", "mo", "ms", "mtext", "noembed", "noframes", "noscript", "plaintext", "script", "style", "svg", "template", "thead", "title", "video", "xmp"]);
220
+ let rt = null;
221
+ const it = f({}, ["audio", "video", "img", "source", "image", "track"]);
222
222
  let ve = null;
223
- const it = f({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), oe = "http://www.w3.org/1998/Math/MathML", le = "http://www.w3.org/2000/svg", k = "http://www.w3.org/1999/xhtml";
224
- let G = k, be = !1, Le = null;
225
- const en = f({}, [oe, le, k], Ie);
226
- let se = f({}, ["mi", "mo", "mn", "ms", "mtext"]), ce = f({}, ["annotation-xml"]);
227
- const tn = f({}, ["title", "style", "font", "a", "script"]);
228
- let K = null;
229
- const nn = ["application/xhtml+xml", "text/html"], rn = "text/html";
230
- let g = null, Y = null;
231
- const an = r.createElement("form"), at = function(n) {
223
+ const at = f({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), se = "http://www.w3.org/1998/Math/MathML", ce = "http://www.w3.org/2000/svg", w = "http://www.w3.org/1999/xhtml";
224
+ let G = w, be = !1, Le = null;
225
+ const tn = f({}, [se, ce, w], Me);
226
+ let fe = f({}, ["mi", "mo", "mn", "ms", "mtext"]), ue = f({}, ["annotation-xml"]);
227
+ const nn = f({}, ["title", "style", "font", "a", "script"]);
228
+ let q = null;
229
+ const rn = ["application/xhtml+xml", "text/html"], an = "text/html";
230
+ let T = null, Y = null;
231
+ const on = r.createElement("form"), ot = function(n) {
232
232
  return n instanceof RegExp || n instanceof Function;
233
233
  }, De = function() {
234
234
  let n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
235
235
  if (!(Y && Y === n)) {
236
- if ((!n || typeof n != "object") && (n = {}), n = U(n), K = // eslint-disable-next-line unicorn/prefer-includes
237
- nn.indexOf(n.PARSER_MEDIA_TYPE) === -1 ? rn : n.PARSER_MEDIA_TYPE, g = K === "application/xhtml+xml" ? Ie : pe, h = I(n, "ALLOWED_TAGS") ? f({}, n.ALLOWED_TAGS, g) : je, T = I(n, "ALLOWED_ATTR") ? f({}, n.ALLOWED_ATTR, g) : Ke, Le = I(n, "ALLOWED_NAMESPACES") ? f({}, n.ALLOWED_NAMESPACES, Ie) : en, ve = I(n, "ADD_URI_SAFE_ATTR") ? f(U(it), n.ADD_URI_SAFE_ATTR, g) : it, nt = I(n, "ADD_DATA_URI_TAGS") ? f(U(rt), n.ADD_DATA_URI_TAGS, g) : rt, W = I(n, "FORBID_CONTENTS") ? f({}, n.FORBID_CONTENTS, g) : tt, X = I(n, "FORBID_TAGS") ? f({}, n.FORBID_TAGS, g) : {}, _e = I(n, "FORBID_ATTR") ? f({}, n.FORBID_ATTR, g) : {}, z = I(n, "USE_PROFILES") ? n.USE_PROFILES : !1, qe = n.ALLOW_ARIA_ATTR !== !1, Se = n.ALLOW_DATA_ATTR !== !1, Ze = n.ALLOW_UNKNOWN_PROTOCOLS || !1, Qe = n.ALLOW_SELF_CLOSE_IN_ATTR !== !1, H = n.SAFE_FOR_TEMPLATES || !1, Re = n.SAFE_FOR_XML !== !1, P = n.WHOLE_DOCUMENT || !1, B = n.RETURN_DOM || !1, ie = n.RETURN_DOM_FRAGMENT || !1, ae = n.RETURN_TRUSTED_TYPE || !1, Ne = n.FORCE_BODY || !1, Je = n.SANITIZE_DOM !== !1, et = n.SANITIZE_NAMED_PROPS || !1, Oe = n.KEEP_CONTENT !== !1, j = n.IN_PLACE || !1, Xe = n.ALLOWED_URI_REGEXP || Ct, G = n.NAMESPACE || k, se = n.MATHML_TEXT_INTEGRATION_POINTS || se, ce = n.HTML_INTEGRATION_POINTS || ce, d = n.CUSTOM_ELEMENT_HANDLING || {}, n.CUSTOM_ELEMENT_HANDLING && at(n.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (d.tagNameCheck = n.CUSTOM_ELEMENT_HANDLING.tagNameCheck), n.CUSTOM_ELEMENT_HANDLING && at(n.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (d.attributeNameCheck = n.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), n.CUSTOM_ELEMENT_HANDLING && typeof n.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (d.allowCustomizedBuiltInElements = n.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), H && (Se = !1), ie && (B = !0), z && (h = f({}, St), T = [], z.html === !0 && (f(h, _t), f(T, Rt)), z.svg === !0 && (f(h, Me), f(T, xe), f(T, me)), z.svgFilters === !0 && (f(h, we), f(T, xe), f(T, me)), z.mathMl === !0 && (f(h, ke), f(T, yt), f(T, me))), n.ADD_TAGS && (h === je && (h = U(h)), f(h, n.ADD_TAGS, g)), n.ADD_ATTR && (T === Ke && (T = U(T)), f(T, n.ADD_ATTR, g)), n.ADD_URI_SAFE_ATTR && f(ve, n.ADD_URI_SAFE_ATTR, g), n.FORBID_CONTENTS && (W === tt && (W = U(W)), f(W, n.FORBID_CONTENTS, g)), Oe && (h["#text"] = !0), P && f(h, ["html", "head", "body"]), h.table && (f(h, ["tbody"]), delete X.tbody), n.TRUSTED_TYPES_POLICY) {
236
+ if ((!n || typeof n != "object") && (n = {}), n = P(n), q = // eslint-disable-next-line unicorn/prefer-includes
237
+ rn.indexOf(n.PARSER_MEDIA_TYPE) === -1 ? an : n.PARSER_MEDIA_TYPE, T = q === "application/xhtml+xml" ? Me : de, g = I(n, "ALLOWED_TAGS") ? f({}, n.ALLOWED_TAGS, T) : Ke, E = I(n, "ALLOWED_ATTR") ? f({}, n.ALLOWED_ATTR, T) : qe, Le = I(n, "ALLOWED_NAMESPACES") ? f({}, n.ALLOWED_NAMESPACES, Me) : tn, ve = I(n, "ADD_URI_SAFE_ATTR") ? f(P(at), n.ADD_URI_SAFE_ATTR, T) : at, rt = I(n, "ADD_DATA_URI_TAGS") ? f(P(it), n.ADD_DATA_URI_TAGS, T) : it, W = I(n, "FORBID_CONTENTS") ? f({}, n.FORBID_CONTENTS, T) : nt, j = I(n, "FORBID_TAGS") ? f({}, n.FORBID_TAGS, T) : P({}), Se = I(n, "FORBID_ATTR") ? f({}, n.FORBID_ATTR, T) : P({}), z = I(n, "USE_PROFILES") ? n.USE_PROFILES : !1, Ze = n.ALLOW_ARIA_ATTR !== !1, Re = n.ALLOW_DATA_ATTR !== !1, Qe = n.ALLOW_UNKNOWN_PROTOCOLS || !1, Je = n.ALLOW_SELF_CLOSE_IN_ATTR !== !1, H = n.SAFE_FOR_TEMPLATES || !1, ae = n.SAFE_FOR_XML !== !1, U = n.WHOLE_DOCUMENT || !1, B = n.RETURN_DOM || !1, oe = n.RETURN_DOM_FRAGMENT || !1, le = n.RETURN_TRUSTED_TYPE || !1, Ne = n.FORCE_BODY || !1, et = n.SANITIZE_DOM !== !1, tt = n.SANITIZE_NAMED_PROPS || !1, Oe = n.KEEP_CONTENT !== !1, K = n.IN_PLACE || !1, je = n.ALLOWED_URI_REGEXP || It, G = n.NAMESPACE || w, fe = n.MATHML_TEXT_INTEGRATION_POINTS || fe, ue = n.HTML_INTEGRATION_POINTS || ue, d = n.CUSTOM_ELEMENT_HANDLING || {}, n.CUSTOM_ELEMENT_HANDLING && ot(n.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (d.tagNameCheck = n.CUSTOM_ELEMENT_HANDLING.tagNameCheck), n.CUSTOM_ELEMENT_HANDLING && ot(n.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (d.attributeNameCheck = n.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), n.CUSTOM_ELEMENT_HANDLING && typeof n.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (d.allowCustomizedBuiltInElements = n.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), H && (Re = !1), oe && (B = !0), z && (g = f({}, Rt), E = [], z.html === !0 && (f(g, St), f(E, yt)), z.svg === !0 && (f(g, we), f(E, Pe), f(E, pe)), z.svgFilters === !0 && (f(g, ke), f(E, Pe), f(E, pe)), z.mathMl === !0 && (f(g, xe), f(E, Nt), f(E, pe))), n.ADD_TAGS && (g === Ke && (g = P(g)), f(g, n.ADD_TAGS, T)), n.ADD_ATTR && (E === qe && (E = P(E)), f(E, n.ADD_ATTR, T)), n.ADD_URI_SAFE_ATTR && f(ve, n.ADD_URI_SAFE_ATTR, T), n.FORBID_CONTENTS && (W === nt && (W = P(W)), f(W, n.FORBID_CONTENTS, T)), Oe && (g["#text"] = !0), U && f(g, ["html", "head", "body"]), g.table && (f(g, ["tbody"]), delete j.tbody), n.TRUSTED_TYPES_POLICY) {
238
238
  if (typeof n.TRUSTED_TYPES_POLICY.createHTML != "function")
239
- throw J('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
239
+ throw ee('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
240
240
  if (typeof n.TRUSTED_TYPES_POLICY.createScriptURL != "function")
241
- throw J('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
242
- R = n.TRUSTED_TYPES_POLICY, V = R.createHTML("");
241
+ throw ee('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
242
+ y = n.TRUSTED_TYPES_POLICY, X = y.createHTML("");
243
243
  } else
244
- R === void 0 && (R = Ln(ne, s)), R !== null && typeof V == "string" && (V = R.createHTML(""));
244
+ y === void 0 && (y = Dn(re, s)), y !== null && typeof X == "string" && (X = y.createHTML(""));
245
245
  v && v(n), Y = n;
246
246
  }
247
- }, ot = f({}, [...Me, ...we, ...Tn]), lt = f({}, [...ke, ...En]), on = function(n) {
248
- let a = re(n);
247
+ }, lt = f({}, [...we, ...ke, ...En]), st = f({}, [...xe, ...An]), ln = function(n) {
248
+ let a = ie(n);
249
249
  (!a || !a.tagName) && (a = {
250
250
  namespaceURI: G,
251
251
  tagName: "template"
252
252
  });
253
- const o = pe(n.tagName), u = pe(a.tagName);
254
- return Le[n.namespaceURI] ? n.namespaceURI === le ? a.namespaceURI === k ? o === "svg" : a.namespaceURI === oe ? o === "svg" && (u === "annotation-xml" || se[u]) : !!ot[o] : n.namespaceURI === oe ? a.namespaceURI === k ? o === "math" : a.namespaceURI === le ? o === "math" && ce[u] : !!lt[o] : n.namespaceURI === k ? a.namespaceURI === le && !ce[u] || a.namespaceURI === oe && !se[u] ? !1 : !lt[o] && (tn[o] || !ot[o]) : !!(K === "application/xhtml+xml" && Le[n.namespaceURI]) : !1;
253
+ const o = de(n.tagName), u = de(a.tagName);
254
+ return Le[n.namespaceURI] ? n.namespaceURI === ce ? a.namespaceURI === w ? o === "svg" : a.namespaceURI === se ? o === "svg" && (u === "annotation-xml" || fe[u]) : !!lt[o] : n.namespaceURI === se ? a.namespaceURI === w ? o === "math" : a.namespaceURI === ce ? o === "math" && ue[u] : !!st[o] : n.namespaceURI === w ? a.namespaceURI === ce && !ue[u] || a.namespaceURI === se && !fe[u] ? !1 : !st[o] && (nn[o] || !lt[o]) : !!(q === "application/xhtml+xml" && Le[n.namespaceURI]) : !1;
255
255
  }, M = function(n) {
256
- Z(t.removed, {
256
+ Q(t.removed, {
257
257
  element: n
258
258
  });
259
259
  try {
260
- re(n).removeChild(n);
260
+ ie(n).removeChild(n);
261
261
  } catch {
262
- Wt(n);
262
+ Gt(n);
263
263
  }
264
- }, fe = function(n, a) {
264
+ }, $ = function(n, a) {
265
265
  try {
266
- Z(t.removed, {
266
+ Q(t.removed, {
267
267
  attribute: a.getAttributeNode(n),
268
268
  from: a
269
269
  });
270
270
  } catch {
271
- Z(t.removed, {
271
+ Q(t.removed, {
272
272
  attribute: null,
273
273
  from: a
274
274
  });
275
275
  }
276
276
  if (a.removeAttribute(n), n === "is")
277
- if (B || ie)
277
+ if (B || oe)
278
278
  try {
279
279
  M(a);
280
280
  } catch {
@@ -284,96 +284,96 @@ function Mt() {
284
284
  a.setAttribute(n, "");
285
285
  } catch {
286
286
  }
287
- }, st = function(n) {
287
+ }, ct = function(n) {
288
288
  let a = null, o = null;
289
289
  if (Ne)
290
290
  n = "<remove></remove>" + n;
291
291
  else {
292
- const E = At(n, /^[\r\n\t ]+/);
293
- o = E && E[0];
292
+ const h = _t(n, /^[\r\n\t ]+/);
293
+ o = h && h[0];
294
294
  }
295
- K === "application/xhtml+xml" && G === k && (n = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + n + "</body></html>");
296
- const u = R ? R.createHTML(n) : n;
297
- if (G === k)
295
+ q === "application/xhtml+xml" && G === w && (n = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + n + "</body></html>");
296
+ const u = y ? y.createHTML(n) : n;
297
+ if (G === w)
298
298
  try {
299
- a = new Bt().parseFromString(u, K);
299
+ a = new zt().parseFromString(u, q);
300
300
  } catch {
301
301
  }
302
302
  if (!a || !a.documentElement) {
303
- a = ge.createDocument(G, "template", null);
303
+ a = Te.createDocument(G, "template", null);
304
304
  try {
305
- a.documentElement.innerHTML = be ? V : u;
305
+ a.documentElement.innerHTML = be ? X : u;
306
306
  } catch {
307
307
  }
308
308
  }
309
309
  const A = a.body || a.documentElement;
310
- return n && o && A.insertBefore(r.createTextNode(o), A.childNodes[0] || null), G === k ? Xt.call(a, P ? "html" : "body")[0] : P ? a.documentElement : A;
311
- }, ct = function(n) {
312
- return $t.call(
310
+ return n && o && A.insertBefore(r.createTextNode(o), A.childNodes[0] || null), G === w ? jt.call(a, U ? "html" : "body")[0] : U ? a.documentElement : A;
311
+ }, ft = function(n) {
312
+ return Vt.call(
313
313
  n.ownerDocument || n,
314
314
  n,
315
315
  // eslint-disable-next-line no-bitwise
316
- S.SHOW_ELEMENT | S.SHOW_COMMENT | S.SHOW_TEXT | S.SHOW_PROCESSING_INSTRUCTION | S.SHOW_CDATA_SECTION,
316
+ R.SHOW_ELEMENT | R.SHOW_COMMENT | R.SHOW_TEXT | R.SHOW_PROCESSING_INSTRUCTION | R.SHOW_CDATA_SECTION,
317
317
  null
318
318
  );
319
319
  }, Ce = function(n) {
320
- return n instanceof he && (typeof n.nodeName != "string" || typeof n.textContent != "string" || typeof n.removeChild != "function" || !(n.attributes instanceof F) || typeof n.removeAttribute != "function" || typeof n.setAttribute != "function" || typeof n.namespaceURI != "string" || typeof n.insertBefore != "function" || typeof n.hasChildNodes != "function");
321
- }, ft = function(n) {
320
+ return n instanceof ge && (typeof n.nodeName != "string" || typeof n.textContent != "string" || typeof n.removeChild != "function" || !(n.attributes instanceof F) || typeof n.removeAttribute != "function" || typeof n.setAttribute != "function" || typeof n.namespaceURI != "string" || typeof n.insertBefore != "function" || typeof n.hasChildNodes != "function");
321
+ }, ut = function(n) {
322
322
  return typeof L == "function" && n instanceof L;
323
323
  };
324
- function x(l, n, a) {
325
- ue(l, (o) => {
324
+ function k(l, n, a) {
325
+ me(l, (o) => {
326
326
  o.call(t, n, a, Y);
327
327
  });
328
328
  }
329
- const ut = function(n) {
329
+ const mt = function(n) {
330
330
  let a = null;
331
- if (x(y.beforeSanitizeElements, n, null), Ce(n))
331
+ if (k(N.beforeSanitizeElements, n, null), Ce(n))
332
332
  return M(n), !0;
333
- const o = g(n.nodeName);
334
- if (x(y.uponSanitizeElement, n, {
333
+ const o = T(n.nodeName);
334
+ if (k(N.uponSanitizeElement, n, {
335
335
  tagName: o,
336
- allowedTags: h
337
- }), n.hasChildNodes() && !ft(n.firstElementChild) && O(/<[/\w!]/g, n.innerHTML) && O(/<[/\w!]/g, n.textContent) || n.nodeType === te.progressingInstruction || Re && n.nodeType === te.comment && O(/<[/\w]/g, n.data))
336
+ allowedTags: g
337
+ }), ae && n.hasChildNodes() && !ut(n.firstElementChild) && O(/<[/\w!]/g, n.innerHTML) && O(/<[/\w!]/g, n.textContent) || n.nodeType === ne.progressingInstruction || ae && n.nodeType === ne.comment && O(/<[/\w]/g, n.data))
338
338
  return M(n), !0;
339
- if (!h[o] || X[o]) {
340
- if (!X[o] && pt(o) && (d.tagNameCheck instanceof RegExp && O(d.tagNameCheck, o) || d.tagNameCheck instanceof Function && d.tagNameCheck(o)))
339
+ if (!g[o] || j[o]) {
340
+ if (!j[o] && dt(o) && (d.tagNameCheck instanceof RegExp && O(d.tagNameCheck, o) || d.tagNameCheck instanceof Function && d.tagNameCheck(o)))
341
341
  return !1;
342
342
  if (Oe && !W[o]) {
343
- const u = re(n) || n.parentNode, A = Yt(n) || n.childNodes;
343
+ const u = ie(n) || n.parentNode, A = $t(n) || n.childNodes;
344
344
  if (A && u) {
345
- const E = A.length;
346
- for (let D = E - 1; D >= 0; --D) {
347
- const w = zt(A[D], !0);
348
- w.__removalCount = (n.__removalCount || 0) + 1, u.insertBefore(w, Gt(n));
345
+ const h = A.length;
346
+ for (let D = h - 1; D >= 0; --D) {
347
+ const x = Wt(A[D], !0);
348
+ x.__removalCount = (n.__removalCount || 0) + 1, u.insertBefore(x, Yt(n));
349
349
  }
350
350
  }
351
351
  }
352
352
  return M(n), !0;
353
353
  }
354
- return n instanceof m && !on(n) || (o === "noscript" || o === "noembed" || o === "noframes") && O(/<\/no(script|embed|frames)/i, n.innerHTML) ? (M(n), !0) : (H && n.nodeType === te.text && (a = n.textContent, ue([Te, Ee, Ae], (u) => {
355
- a = Q(a, u, " ");
356
- }), n.textContent !== a && (Z(t.removed, {
354
+ return n instanceof m && !ln(n) || (o === "noscript" || o === "noembed" || o === "noframes") && O(/<\/no(script|embed|frames)/i, n.innerHTML) ? (M(n), !0) : (H && n.nodeType === ne.text && (a = n.textContent, me([Ee, Ae, _e], (u) => {
355
+ a = J(a, u, " ");
356
+ }), n.textContent !== a && (Q(t.removed, {
357
357
  element: n.cloneNode()
358
- }), n.textContent = a)), x(y.afterSanitizeElements, n, null), !1);
359
- }, mt = function(n, a, o) {
360
- if (Je && (a === "id" || a === "name") && (o in r || o in an))
358
+ }), n.textContent = a)), k(N.afterSanitizeElements, n, null), !1);
359
+ }, pt = function(n, a, o) {
360
+ if (et && (a === "id" || a === "name") && (o in r || o in on))
361
361
  return !1;
362
- if (!(Se && !_e[a] && O(Kt, a))) {
363
- if (!(qe && O(qt, a))) {
364
- if (!T[a] || _e[a]) {
362
+ if (!(Re && !Se[a] && O(qt, a))) {
363
+ if (!(Ze && O(Zt, a))) {
364
+ if (!E[a] || Se[a]) {
365
365
  if (
366
366
  // First condition does a very basic check if a) it's basically a valid custom element tagname AND
367
367
  // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
368
368
  // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
369
- !(pt(n) && (d.tagNameCheck instanceof RegExp && O(d.tagNameCheck, n) || d.tagNameCheck instanceof Function && d.tagNameCheck(n)) && (d.attributeNameCheck instanceof RegExp && O(d.attributeNameCheck, a) || d.attributeNameCheck instanceof Function && d.attributeNameCheck(a)) || // Alternative, second condition checks if it's an `is`-attribute, AND
369
+ !(dt(n) && (d.tagNameCheck instanceof RegExp && O(d.tagNameCheck, n) || d.tagNameCheck instanceof Function && d.tagNameCheck(n)) && (d.attributeNameCheck instanceof RegExp && O(d.attributeNameCheck, a) || d.attributeNameCheck instanceof Function && d.attributeNameCheck(a)) || // Alternative, second condition checks if it's an `is`-attribute, AND
370
370
  // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
371
371
  a === "is" && d.allowCustomizedBuiltInElements && (d.tagNameCheck instanceof RegExp && O(d.tagNameCheck, o) || d.tagNameCheck instanceof Function && d.tagNameCheck(o)))
372
372
  ) return !1;
373
373
  } else if (!ve[a]) {
374
- if (!O(Xe, Q(o, Ve, ""))) {
375
- if (!((a === "src" || a === "xlink:href" || a === "href") && n !== "script" && pn(o, "data:") === 0 && nt[n])) {
376
- if (!(Ze && !O(Zt, Q(o, Ve, "")))) {
374
+ if (!O(je, J(o, Xe, ""))) {
375
+ if (!((a === "src" || a === "xlink:href" || a === "href") && n !== "script" && dn(o, "data:") === 0 && rt[n])) {
376
+ if (!(Qe && !O(Qt, J(o, Xe, "")))) {
377
377
  if (o)
378
378
  return !1;
379
379
  }
@@ -383,10 +383,10 @@ function Mt() {
383
383
  }
384
384
  }
385
385
  return !0;
386
- }, pt = function(n) {
387
- return n !== "annotation-xml" && At(n, Qt);
388
386
  }, dt = function(n) {
389
- x(y.beforeSanitizeAttributes, n, null);
387
+ return n !== "annotation-xml" && _t(n, Jt);
388
+ }, ht = function(n) {
389
+ k(N.beforeSanitizeAttributes, n, null);
390
390
  const {
391
391
  attributes: a
392
392
  } = n;
@@ -396,101 +396,109 @@ function Mt() {
396
396
  attrName: "",
397
397
  attrValue: "",
398
398
  keepAttr: !0,
399
- allowedAttributes: T,
399
+ allowedAttributes: E,
400
400
  forceKeepAttr: void 0
401
401
  };
402
402
  let u = a.length;
403
403
  for (; u--; ) {
404
404
  const A = a[u], {
405
- name: E,
405
+ name: h,
406
406
  namespaceURI: D,
407
- value: w
408
- } = A, q = g(E);
409
- let N = E === "value" ? w : dn(w);
410
- if (o.attrName = q, o.attrValue = N, o.keepAttr = !0, o.forceKeepAttr = void 0, x(y.uponSanitizeAttribute, n, o), N = o.attrValue, et && (q === "id" || q === "name") && (fe(E, n), N = Jt + N), Re && O(/((--!?|])>)|<\/(style|title)/i, N)) {
411
- fe(E, n);
407
+ value: x
408
+ } = A, Z = T(h), Ie = x;
409
+ let _ = h === "value" ? Ie : hn(Ie);
410
+ if (o.attrName = Z, o.attrValue = _, o.keepAttr = !0, o.forceKeepAttr = void 0, k(N.uponSanitizeAttribute, n, o), _ = o.attrValue, tt && (Z === "id" || Z === "name") && ($(h, n), _ = en + _), ae && O(/((--!?|])>)|<\/(style|title)/i, _)) {
411
+ $(h, n);
412
412
  continue;
413
413
  }
414
- if (o.forceKeepAttr || (fe(E, n), !o.keepAttr))
414
+ if (o.forceKeepAttr)
415
+ continue;
416
+ if (!o.keepAttr) {
417
+ $(h, n);
415
418
  continue;
416
- if (!Qe && O(/\/>/i, N)) {
417
- fe(E, n);
419
+ }
420
+ if (!Je && O(/\/>/i, _)) {
421
+ $(h, n);
418
422
  continue;
419
423
  }
420
- H && ue([Te, Ee, Ae], (gt) => {
421
- N = Q(N, gt, " ");
424
+ H && me([Ee, Ae, _e], (Tt) => {
425
+ _ = J(_, Tt, " ");
422
426
  });
423
- const ht = g(n.nodeName);
424
- if (mt(ht, q, N)) {
425
- if (R && typeof ne == "object" && typeof ne.getAttributeType == "function" && !D)
426
- switch (ne.getAttributeType(ht, q)) {
427
- case "TrustedHTML": {
428
- N = R.createHTML(N);
429
- break;
430
- }
431
- case "TrustedScriptURL": {
432
- N = R.createScriptURL(N);
433
- break;
434
- }
427
+ const gt = T(n.nodeName);
428
+ if (!pt(gt, Z, _)) {
429
+ $(h, n);
430
+ continue;
431
+ }
432
+ if (y && typeof re == "object" && typeof re.getAttributeType == "function" && !D)
433
+ switch (re.getAttributeType(gt, Z)) {
434
+ case "TrustedHTML": {
435
+ _ = y.createHTML(_);
436
+ break;
437
+ }
438
+ case "TrustedScriptURL": {
439
+ _ = y.createScriptURL(_);
440
+ break;
435
441
  }
442
+ }
443
+ if (_ !== Ie)
436
444
  try {
437
- D ? n.setAttributeNS(D, E, N) : n.setAttribute(E, N), Ce(n) ? M(n) : Et(t.removed);
445
+ D ? n.setAttributeNS(D, h, _) : n.setAttribute(h, _), Ce(n) ? M(n) : At(t.removed);
438
446
  } catch {
447
+ $(h, n);
439
448
  }
440
- }
441
449
  }
442
- x(y.afterSanitizeAttributes, n, null);
443
- }, ln = function l(n) {
450
+ k(N.afterSanitizeAttributes, n, null);
451
+ }, sn = function l(n) {
444
452
  let a = null;
445
- const o = ct(n);
446
- for (x(y.beforeSanitizeShadowDOM, n, null); a = o.nextNode(); )
447
- x(y.uponSanitizeShadowNode, a, null), ut(a), dt(a), a.content instanceof c && l(a.content);
448
- x(y.afterSanitizeShadowDOM, n, null);
453
+ const o = ft(n);
454
+ for (k(N.beforeSanitizeShadowDOM, n, null); a = o.nextNode(); )
455
+ k(N.uponSanitizeShadowNode, a, null), mt(a), ht(a), a.content instanceof c && l(a.content);
456
+ k(N.afterSanitizeShadowDOM, n, null);
449
457
  };
450
458
  return t.sanitize = function(l) {
451
459
  let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, a = null, o = null, u = null, A = null;
452
- if (be = !l, be && (l = "<!-->"), typeof l != "string" && !ft(l))
460
+ if (be = !l, be && (l = "<!-->"), typeof l != "string" && !ut(l))
453
461
  if (typeof l.toString == "function") {
454
462
  if (l = l.toString(), typeof l != "string")
455
- throw J("dirty is not a string, aborting");
463
+ throw ee("dirty is not a string, aborting");
456
464
  } else
457
- throw J("toString is not a function");
465
+ throw ee("toString is not a function");
458
466
  if (!t.isSupported)
459
467
  return l;
460
- if (ye || De(n), t.removed = [], typeof l == "string" && (j = !1), j) {
468
+ if (ye || De(n), t.removed = [], typeof l == "string" && (K = !1), K) {
461
469
  if (l.nodeName) {
462
- const w = g(l.nodeName);
463
- if (!h[w] || X[w])
464
- throw J("root node is forbidden and cannot be sanitized in-place");
470
+ const x = T(l.nodeName);
471
+ if (!g[x] || j[x])
472
+ throw ee("root node is forbidden and cannot be sanitized in-place");
465
473
  }
466
474
  } else if (l instanceof L)
467
- a = st("<!---->"), o = a.ownerDocument.importNode(l, !0), o.nodeType === te.element && o.nodeName === "BODY" || o.nodeName === "HTML" ? a = o : a.appendChild(o);
475
+ a = ct("<!---->"), o = a.ownerDocument.importNode(l, !0), o.nodeType === ne.element && o.nodeName === "BODY" || o.nodeName === "HTML" ? a = o : a.appendChild(o);
468
476
  else {
469
- if (!B && !H && !P && // eslint-disable-next-line unicorn/prefer-includes
477
+ if (!B && !H && !U && // eslint-disable-next-line unicorn/prefer-includes
470
478
  l.indexOf("<") === -1)
471
- return R && ae ? R.createHTML(l) : l;
472
- if (a = st(l), !a)
473
- return B ? null : ae ? V : "";
479
+ return y && le ? y.createHTML(l) : l;
480
+ if (a = ct(l), !a)
481
+ return B ? null : le ? X : "";
474
482
  }
475
483
  a && Ne && M(a.firstChild);
476
- const E = ct(j ? l : a);
477
- for (; u = E.nextNode(); )
478
- ut(u), dt(u), u.content instanceof c && ln(u.content);
479
- if (j)
484
+ const h = ft(K ? l : a);
485
+ for (; u = h.nextNode(); )
486
+ mt(u), ht(u), u.content instanceof c && sn(u.content);
487
+ if (K)
480
488
  return l;
481
489
  if (B) {
482
- if (ie)
483
- for (A = Vt.call(a.ownerDocument); a.firstChild; )
490
+ if (oe)
491
+ for (A = Xt.call(a.ownerDocument); a.firstChild; )
484
492
  A.appendChild(a.firstChild);
485
493
  else
486
494
  A = a;
487
- return (T.shadowroot || T.shadowrootmode) && (A = jt.call(i, A, !0)), A;
495
+ return (E.shadowroot || E.shadowrootmode) && (A = Kt.call(i, A, !0)), A;
488
496
  }
489
- let D = P ? a.outerHTML : a.innerHTML;
490
- return P && h["!doctype"] && a.ownerDocument && a.ownerDocument.doctype && a.ownerDocument.doctype.name && O(It, a.ownerDocument.doctype.name) && (D = "<!DOCTYPE " + a.ownerDocument.doctype.name + `>
491
- ` + D), H && ue([Te, Ee, Ae], (w) => {
492
- D = Q(D, w, " ");
493
- }), R && ae ? R.createHTML(D) : D;
497
+ let D = U ? a.outerHTML : a.innerHTML;
498
+ return U && g["!doctype"] && a.ownerDocument && a.ownerDocument.doctype && a.ownerDocument.doctype.name && O(Mt, a.ownerDocument.doctype.name) && (D = "<!DOCTYPE " + a.ownerDocument.doctype.name + `>
499
+ ` + D), H && me([Ee, Ae, _e], (x) => {
500
+ D = J(D, x, " ");
501
+ }), y && le ? y.createHTML(D) : D;
494
502
  }, t.setConfig = function() {
495
503
  let l = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
496
504
  De(l), ye = !0;
@@ -498,24 +506,24 @@ function Mt() {
498
506
  Y = null, ye = !1;
499
507
  }, t.isValidAttribute = function(l, n, a) {
500
508
  Y || De({});
501
- const o = g(l), u = g(n);
502
- return mt(o, u, a);
509
+ const o = T(l), u = T(n);
510
+ return pt(o, u, a);
503
511
  }, t.addHook = function(l, n) {
504
- typeof n == "function" && Z(y[l], n);
512
+ typeof n == "function" && Q(N[l], n);
505
513
  }, t.removeHook = function(l, n) {
506
514
  if (n !== void 0) {
507
- const a = un(y[l], n);
508
- return a === -1 ? void 0 : mn(y[l], a, 1)[0];
515
+ const a = mn(N[l], n);
516
+ return a === -1 ? void 0 : pn(N[l], a, 1)[0];
509
517
  }
510
- return Et(y[l]);
518
+ return At(N[l]);
511
519
  }, t.removeHooks = function(l) {
512
- y[l] = [];
520
+ N[l] = [];
513
521
  }, t.removeAllHooks = function() {
514
- y = Ot();
522
+ N = vt();
515
523
  }, t;
516
524
  }
517
- var er = Mt();
518
- function Dn(e) {
525
+ var tr = wt();
526
+ function Cn(e) {
519
527
  for (var t = 1; t < arguments.length; t++) {
520
528
  var r = arguments[t];
521
529
  for (var i in r)
@@ -523,18 +531,18 @@ function Dn(e) {
523
531
  }
524
532
  return e;
525
533
  }
526
- function ze(e, t) {
534
+ function We(e, t) {
527
535
  return Array(t + 1).join(e);
528
536
  }
529
- function Cn(e) {
537
+ function In(e) {
530
538
  return e.replace(/^\n*/, "");
531
539
  }
532
- function In(e) {
540
+ function Mn(e) {
533
541
  for (var t = e.length; t > 0 && e[t - 1] === `
534
542
  `; ) t--;
535
543
  return e.substring(0, t);
536
544
  }
537
- var Mn = [
545
+ var wn = [
538
546
  "ADDRESS",
539
547
  "ARTICLE",
540
548
  "ASIDE",
@@ -585,10 +593,10 @@ var Mn = [
585
593
  "TR",
586
594
  "UL"
587
595
  ];
588
- function Ge(e) {
589
- return Ye(e, Mn);
596
+ function Ye(e) {
597
+ return $e(e, wn);
590
598
  }
591
- var wt = [
599
+ var kt = [
592
600
  "AREA",
593
601
  "BASE",
594
602
  "BR",
@@ -606,13 +614,13 @@ var wt = [
606
614
  "TRACK",
607
615
  "WBR"
608
616
  ];
609
- function kt(e) {
610
- return Ye(e, wt);
617
+ function xt(e) {
618
+ return $e(e, kt);
611
619
  }
612
- function wn(e) {
613
- return Pt(e, wt);
620
+ function kn(e) {
621
+ return Ut(e, kt);
614
622
  }
615
- var xt = [
623
+ var Pt = [
616
624
  "A",
617
625
  "TABLE",
618
626
  "THEAD",
@@ -625,22 +633,22 @@ var xt = [
625
633
  "AUDIO",
626
634
  "VIDEO"
627
635
  ];
628
- function kn(e) {
629
- return Ye(e, xt);
630
- }
631
636
  function xn(e) {
632
- return Pt(e, xt);
637
+ return $e(e, Pt);
638
+ }
639
+ function Pn(e) {
640
+ return Ut(e, Pt);
633
641
  }
634
- function Ye(e, t) {
642
+ function $e(e, t) {
635
643
  return t.indexOf(e.nodeName) >= 0;
636
644
  }
637
- function Pt(e, t) {
645
+ function Ut(e, t) {
638
646
  return e.getElementsByTagName && t.some(function(r) {
639
647
  return e.getElementsByTagName(r).length;
640
648
  });
641
649
  }
642
- var _ = {};
643
- _.paragraph = {
650
+ var S = {};
651
+ S.paragraph = {
644
652
  filter: "p",
645
653
  replacement: function(e) {
646
654
  return `
@@ -650,19 +658,19 @@ _.paragraph = {
650
658
  `;
651
659
  }
652
660
  };
653
- _.lineBreak = {
661
+ S.lineBreak = {
654
662
  filter: "br",
655
663
  replacement: function(e, t, r) {
656
664
  return r.br + `
657
665
  `;
658
666
  }
659
667
  };
660
- _.heading = {
668
+ S.heading = {
661
669
  filter: ["h1", "h2", "h3", "h4", "h5", "h6"],
662
670
  replacement: function(e, t, r) {
663
671
  var i = Number(t.nodeName.charAt(1));
664
672
  if (r.headingStyle === "setext" && i < 3) {
665
- var s = ze(i === 1 ? "=" : "-", e.length);
673
+ var s = We(i === 1 ? "=" : "-", e.length);
666
674
  return `
667
675
 
668
676
  ` + e + `
@@ -672,12 +680,12 @@ _.heading = {
672
680
  } else
673
681
  return `
674
682
 
675
- ` + ze("#", i) + " " + e + `
683
+ ` + We("#", i) + " " + e + `
676
684
 
677
685
  `;
678
686
  }
679
687
  };
680
- _.blockquote = {
688
+ S.blockquote = {
681
689
  filter: "blockquote",
682
690
  replacement: function(e) {
683
691
  return e = e.replace(/^\n+|\n+$/g, ""), e = e.replace(/^/gm, "> "), `
@@ -687,7 +695,7 @@ _.blockquote = {
687
695
  `;
688
696
  }
689
697
  };
690
- _.list = {
698
+ S.list = {
691
699
  filter: ["ul", "ol"],
692
700
  replacement: function(e, t) {
693
701
  var r = t.parentNode;
@@ -699,7 +707,7 @@ _.list = {
699
707
  `;
700
708
  }
701
709
  };
702
- _.listItem = {
710
+ S.listItem = {
703
711
  filter: "li",
704
712
  replacement: function(e, t, r) {
705
713
  e = e.replace(/^\n+/, "").replace(/\n+$/, `
@@ -714,7 +722,7 @@ _.listItem = {
714
722
  ` : "");
715
723
  }
716
724
  };
717
- _.indentedCodeBlock = {
725
+ S.indentedCodeBlock = {
718
726
  filter: function(e, t) {
719
727
  return t.codeBlockStyle === "indented" && e.nodeName === "PRE" && e.firstChild && e.firstChild.nodeName === "CODE";
720
728
  },
@@ -727,14 +735,14 @@ _.indentedCodeBlock = {
727
735
  `;
728
736
  }
729
737
  };
730
- _.fencedCodeBlock = {
738
+ S.fencedCodeBlock = {
731
739
  filter: function(e, t) {
732
740
  return t.codeBlockStyle === "fenced" && e.nodeName === "PRE" && e.firstChild && e.firstChild.nodeName === "CODE";
733
741
  },
734
742
  replacement: function(e, t, r) {
735
- for (var i = t.firstChild.getAttribute("class") || "", s = (i.match(/language-(\S+)/) || [null, ""])[1], c = t.firstChild.textContent, p = r.fence.charAt(0), L = 3, m = new RegExp("^" + p + "{3,}", "gm"), S; S = m.exec(c); )
736
- S[0].length >= L && (L = S[0].length + 1);
737
- var F = ze(p, L);
743
+ for (var i = t.firstChild.getAttribute("class") || "", s = (i.match(/language-(\S+)/) || [null, ""])[1], c = t.firstChild.textContent, p = r.fence.charAt(0), L = 3, m = new RegExp("^" + p + "{3,}", "gm"), R; R = m.exec(c); )
744
+ R[0].length >= L && (L = R[0].length + 1);
745
+ var F = We(p, L);
738
746
  return `
739
747
 
740
748
  ` + F + s + `
@@ -744,7 +752,7 @@ _.fencedCodeBlock = {
744
752
  `;
745
753
  }
746
754
  };
747
- _.horizontalRule = {
755
+ S.horizontalRule = {
748
756
  filter: "hr",
749
757
  replacement: function(e, t, r) {
750
758
  return `
@@ -754,23 +762,23 @@ _.horizontalRule = {
754
762
  `;
755
763
  }
756
764
  };
757
- _.inlineLink = {
765
+ S.inlineLink = {
758
766
  filter: function(e, t) {
759
767
  return t.linkStyle === "inlined" && e.nodeName === "A" && e.getAttribute("href");
760
768
  },
761
769
  replacement: function(e, t) {
762
770
  var r = t.getAttribute("href");
763
771
  r && (r = r.replace(/([()])/g, "\\$1"));
764
- var i = de(t.getAttribute("title"));
772
+ var i = he(t.getAttribute("title"));
765
773
  return i && (i = ' "' + i.replace(/"/g, '\\"') + '"'), "[" + e + "](" + r + i + ")";
766
774
  }
767
775
  };
768
- _.referenceLink = {
776
+ S.referenceLink = {
769
777
  filter: function(e, t) {
770
778
  return t.linkStyle === "referenced" && e.nodeName === "A" && e.getAttribute("href");
771
779
  },
772
780
  replacement: function(e, t, r) {
773
- var i = t.getAttribute("href"), s = de(t.getAttribute("title"));
781
+ var i = t.getAttribute("href"), s = he(t.getAttribute("title"));
774
782
  s && (s = ' "' + s + '"');
775
783
  var c, p;
776
784
  switch (r.linkReferenceStyle) {
@@ -797,19 +805,19 @@ _.referenceLink = {
797
805
  `, this.references = []), t;
798
806
  }
799
807
  };
800
- _.emphasis = {
808
+ S.emphasis = {
801
809
  filter: ["em", "i"],
802
810
  replacement: function(e, t, r) {
803
811
  return e.trim() ? r.emDelimiter + e + r.emDelimiter : "";
804
812
  }
805
813
  };
806
- _.strong = {
814
+ S.strong = {
807
815
  filter: ["strong", "b"],
808
816
  replacement: function(e, t, r) {
809
817
  return e.trim() ? r.strongDelimiter + e + r.strongDelimiter : "";
810
818
  }
811
819
  };
812
- _.code = {
820
+ S.code = {
813
821
  filter: function(e) {
814
822
  var t = e.previousSibling || e.nextSibling, r = e.parentNode.nodeName === "PRE" && !t;
815
823
  return e.nodeName === "CODE" && !r;
@@ -821,18 +829,18 @@ _.code = {
821
829
  return r + t + e + t + r;
822
830
  }
823
831
  };
824
- _.image = {
832
+ S.image = {
825
833
  filter: "img",
826
834
  replacement: function(e, t) {
827
- var r = de(t.getAttribute("alt")), i = t.getAttribute("src") || "", s = de(t.getAttribute("title")), c = s ? ' "' + s + '"' : "";
835
+ var r = he(t.getAttribute("alt")), i = t.getAttribute("src") || "", s = he(t.getAttribute("title")), c = s ? ' "' + s + '"' : "";
828
836
  return i ? "![" + r + "](" + i + c + ")" : "";
829
837
  }
830
838
  };
831
- function de(e) {
839
+ function he(e) {
832
840
  return e ? e.replace(/(\n+\s*)+/g, `
833
841
  `) : "";
834
842
  }
835
- function Ut(e) {
843
+ function Ft(e) {
836
844
  this.options = e, this._keep = [], this._remove = [], this.blankRule = {
837
845
  replacement: e.blankReplacement
838
846
  }, this.keepReplacement = e.keepReplacement, this.defaultRule = {
@@ -840,7 +848,7 @@ function Ut(e) {
840
848
  }, this.array = [];
841
849
  for (var t in e.rules) this.array.push(e.rules[t]);
842
850
  }
843
- Ut.prototype = {
851
+ Ft.prototype = {
844
852
  add: function(e, t) {
845
853
  this.array.unshift(t);
846
854
  },
@@ -861,19 +869,19 @@ Ut.prototype = {
861
869
  forNode: function(e) {
862
870
  if (e.isBlank) return this.blankRule;
863
871
  var t;
864
- return (t = Pe(this.array, e, this.options)) || (t = Pe(this._keep, e, this.options)) || (t = Pe(this._remove, e, this.options)) ? t : this.defaultRule;
872
+ return (t = Ue(this.array, e, this.options)) || (t = Ue(this._keep, e, this.options)) || (t = Ue(this._remove, e, this.options)) ? t : this.defaultRule;
865
873
  },
866
874
  forEach: function(e) {
867
875
  for (var t = 0; t < this.array.length; t++) e(this.array[t], t);
868
876
  }
869
877
  };
870
- function Pe(e, t, r) {
878
+ function Ue(e, t, r) {
871
879
  for (var i = 0; i < e.length; i++) {
872
880
  var s = e[i];
873
- if (Pn(s, t, r)) return s;
881
+ if (Un(s, t, r)) return s;
874
882
  }
875
883
  }
876
- function Pn(e, t, r) {
884
+ function Un(e, t, r) {
877
885
  var i = e.filter;
878
886
  if (typeof i == "string") {
879
887
  if (i === t.nodeName.toLowerCase()) return !0;
@@ -884,51 +892,51 @@ function Pn(e, t, r) {
884
892
  } else
885
893
  throw new TypeError("`filter` needs to be a string, array, or function");
886
894
  }
887
- function Un(e) {
888
- var t = e.element, r = e.isBlock, i = e.isVoid, s = e.isPre || function(he) {
889
- return he.nodeName === "PRE";
895
+ function Fn(e) {
896
+ var t = e.element, r = e.isBlock, i = e.isVoid, s = e.isPre || function(ge) {
897
+ return ge.nodeName === "PRE";
890
898
  };
891
899
  if (!(!t.firstChild || s(t))) {
892
- for (var c = null, p = !1, L = null, m = vt(L, t, s); m !== t; ) {
900
+ for (var c = null, p = !1, L = null, m = bt(L, t, s); m !== t; ) {
893
901
  if (m.nodeType === 3 || m.nodeType === 4) {
894
- var S = m.data.replace(/[ \r\n\t]+/g, " ");
895
- if ((!c || / $/.test(c.data)) && !p && S[0] === " " && (S = S.substr(1)), !S) {
896
- m = Ue(m);
902
+ var R = m.data.replace(/[ \r\n\t]+/g, " ");
903
+ if ((!c || / $/.test(c.data)) && !p && R[0] === " " && (R = R.substr(1)), !R) {
904
+ m = Fe(m);
897
905
  continue;
898
906
  }
899
- m.data = S, c = m;
907
+ m.data = R, c = m;
900
908
  } else if (m.nodeType === 1)
901
909
  r(m) || m.nodeName === "BR" ? (c && (c.data = c.data.replace(/ $/, "")), c = null, p = !1) : i(m) || s(m) ? (c = null, p = !0) : c && (p = !1);
902
910
  else {
903
- m = Ue(m);
911
+ m = Fe(m);
904
912
  continue;
905
913
  }
906
- var F = vt(L, m, s);
914
+ var F = bt(L, m, s);
907
915
  L = m, m = F;
908
916
  }
909
- c && (c.data = c.data.replace(/ $/, ""), c.data || Ue(c));
917
+ c && (c.data = c.data.replace(/ $/, ""), c.data || Fe(c));
910
918
  }
911
919
  }
912
- function Ue(e) {
920
+ function Fe(e) {
913
921
  var t = e.nextSibling || e.parentNode;
914
922
  return e.parentNode.removeChild(e), t;
915
923
  }
916
- function vt(e, t, r) {
924
+ function bt(e, t, r) {
917
925
  return e && e.parentNode === t || r(t) ? t.nextSibling || t.parentNode : t.firstChild || t.nextSibling || t.parentNode;
918
926
  }
919
- var $e = typeof window < "u" ? window : {};
920
- function Fn() {
921
- var e = $e.DOMParser, t = !1;
927
+ var Ve = typeof window < "u" ? window : {};
928
+ function Hn() {
929
+ var e = Ve.DOMParser, t = !1;
922
930
  try {
923
931
  new e().parseFromString("", "text/html") && (t = !0);
924
932
  } catch {
925
933
  }
926
934
  return t;
927
935
  }
928
- function Hn() {
936
+ function Bn() {
929
937
  var e = function() {
930
938
  };
931
- return Bn() ? e.prototype.parseFromString = function(t) {
939
+ return zn() ? e.prototype.parseFromString = function(t) {
932
940
  var r = new window.ActiveXObject("htmlfile");
933
941
  return r.designMode = "on", r.open(), r.write(t), r.close(), r;
934
942
  } : e.prototype.parseFromString = function(t) {
@@ -936,20 +944,20 @@ function Hn() {
936
944
  return r.open(), r.write(t), r.close(), r;
937
945
  }, e;
938
946
  }
939
- function Bn() {
947
+ function zn() {
940
948
  var e = !1;
941
949
  try {
942
950
  document.implementation.createHTMLDocument("").open();
943
951
  } catch {
944
- $e.ActiveXObject && (e = !0);
952
+ Ve.ActiveXObject && (e = !0);
945
953
  }
946
954
  return e;
947
955
  }
948
- var zn = Fn() ? $e.DOMParser : Hn();
949
- function Wn(e, t) {
956
+ var Wn = Hn() ? Ve.DOMParser : Bn();
957
+ function Gn(e, t) {
950
958
  var r;
951
959
  if (typeof e == "string") {
952
- var i = Gn().parseFromString(
960
+ var i = Yn().parseFromString(
953
961
  // DOM parsers arrange elements in the <head> and <body>.
954
962
  // Wrapping in a custom element ensures elements are reliably arranged in
955
963
  // a single element.
@@ -959,33 +967,33 @@ function Wn(e, t) {
959
967
  r = i.getElementById("turndown-root");
960
968
  } else
961
969
  r = e.cloneNode(!0);
962
- return Un({
970
+ return Fn({
963
971
  element: r,
964
- isBlock: Ge,
965
- isVoid: kt,
966
- isPre: t.preformattedCode ? Yn : null
972
+ isBlock: Ye,
973
+ isVoid: xt,
974
+ isPre: t.preformattedCode ? $n : null
967
975
  }), r;
968
976
  }
969
- var Fe;
970
- function Gn() {
971
- return Fe = Fe || new zn(), Fe;
977
+ var He;
978
+ function Yn() {
979
+ return He = He || new Wn(), He;
972
980
  }
973
- function Yn(e) {
981
+ function $n(e) {
974
982
  return e.nodeName === "PRE" || e.nodeName === "CODE";
975
983
  }
976
- function $n(e, t) {
977
- return e.isBlock = Ge(e), e.isCode = e.nodeName === "CODE" || e.parentNode.isCode, e.isBlank = Vn(e), e.flankingWhitespace = Xn(e, t), e;
984
+ function Vn(e, t) {
985
+ return e.isBlock = Ye(e), e.isCode = e.nodeName === "CODE" || e.parentNode.isCode, e.isBlank = Xn(e), e.flankingWhitespace = jn(e, t), e;
978
986
  }
979
- function Vn(e) {
980
- return !kt(e) && !kn(e) && /^\s*$/i.test(e.textContent) && !wn(e) && !xn(e);
987
+ function Xn(e) {
988
+ return !xt(e) && !xn(e) && /^\s*$/i.test(e.textContent) && !kn(e) && !Pn(e);
981
989
  }
982
- function Xn(e, t) {
990
+ function jn(e, t) {
983
991
  if (e.isBlock || t.preformattedCode && e.isCode)
984
992
  return { leading: "", trailing: "" };
985
- var r = jn(e.textContent);
986
- return r.leadingAscii && bt("left", e, t) && (r.leading = r.leadingNonAscii), r.trailingAscii && bt("right", e, t) && (r.trailing = r.trailingNonAscii), { leading: r.leading, trailing: r.trailing };
993
+ var r = Kn(e.textContent);
994
+ return r.leadingAscii && Lt("left", e, t) && (r.leading = r.leadingNonAscii), r.trailingAscii && Lt("right", e, t) && (r.trailing = r.trailingNonAscii), { leading: r.leading, trailing: r.trailing };
987
995
  }
988
- function jn(e) {
996
+ function Kn(e) {
989
997
  var t = e.match(/^(([ \t\r\n]*)(\s*))(?:(?=\S)[\s\S]*\S)?((\s*?)([ \t\r\n]*))$/);
990
998
  return {
991
999
  leading: t[1],
@@ -998,11 +1006,11 @@ function jn(e) {
998
1006
  trailingAscii: t[6]
999
1007
  };
1000
1008
  }
1001
- function bt(e, t, r) {
1009
+ function Lt(e, t, r) {
1002
1010
  var i, s, c;
1003
- return e === "left" ? (i = t.previousSibling, s = / $/) : (i = t.nextSibling, s = /^ /), i && (i.nodeType === 3 ? c = s.test(i.nodeValue) : r.preformattedCode && i.nodeName === "CODE" ? c = !1 : i.nodeType === 1 && !Ge(i) && (c = s.test(i.textContent))), c;
1011
+ return e === "left" ? (i = t.previousSibling, s = / $/) : (i = t.nextSibling, s = /^ /), i && (i.nodeType === 3 ? c = s.test(i.nodeValue) : r.preformattedCode && i.nodeName === "CODE" ? c = !1 : i.nodeType === 1 && !Ye(i) && (c = s.test(i.textContent))), c;
1004
1012
  }
1005
- var Kn = Array.prototype.reduce, qn = [
1013
+ var qn = Array.prototype.reduce, Zn = [
1006
1014
  [/\\/g, "\\\\"],
1007
1015
  [/\*/g, "\\*"],
1008
1016
  [/^-/g, "\\-"],
@@ -1017,10 +1025,10 @@ var Kn = Array.prototype.reduce, qn = [
1017
1025
  [/_/g, "\\_"],
1018
1026
  [/^(\d+)\. /g, "$1\\. "]
1019
1027
  ];
1020
- function We(e) {
1021
- if (!(this instanceof We)) return new We(e);
1028
+ function Ge(e) {
1029
+ if (!(this instanceof Ge)) return new Ge(e);
1022
1030
  var t = {
1023
- rules: _,
1031
+ rules: S,
1024
1032
  headingStyle: "setext",
1025
1033
  hr: "* * *",
1026
1034
  bulletListMarker: "*",
@@ -1052,9 +1060,9 @@ function We(e) {
1052
1060
  ` : r;
1053
1061
  }
1054
1062
  };
1055
- this.options = Dn({}, t, e), this.rules = new Ut(this.options);
1063
+ this.options = Cn({}, t, e), this.rules = new Ft(this.options);
1056
1064
  }
1057
- We.prototype = {
1065
+ Ge.prototype = {
1058
1066
  /**
1059
1067
  * The entry point for converting a string or DOM node to Markdown
1060
1068
  * @public
@@ -1063,13 +1071,13 @@ We.prototype = {
1063
1071
  * @type String
1064
1072
  */
1065
1073
  turndown: function(e) {
1066
- if (!Jn(e))
1074
+ if (!er(e))
1067
1075
  throw new TypeError(
1068
1076
  e + " is not a string, or an element/document/fragment node."
1069
1077
  );
1070
1078
  if (e === "") return "";
1071
- var t = Ft.call(this, new Wn(e, this.options));
1072
- return Zn.call(this, t);
1079
+ var t = Ht.call(this, new Gn(e, this.options));
1080
+ return Qn.call(this, t);
1073
1081
  },
1074
1082
  /**
1075
1083
  * Add one or more plugins
@@ -1126,39 +1134,39 @@ We.prototype = {
1126
1134
  * @type String
1127
1135
  */
1128
1136
  escape: function(e) {
1129
- return qn.reduce(function(t, r) {
1137
+ return Zn.reduce(function(t, r) {
1130
1138
  return t.replace(r[0], r[1]);
1131
1139
  }, e);
1132
1140
  }
1133
1141
  };
1134
- function Ft(e) {
1142
+ function Ht(e) {
1135
1143
  var t = this;
1136
- return Kn.call(e.childNodes, function(r, i) {
1137
- i = new $n(i, t.options);
1144
+ return qn.call(e.childNodes, function(r, i) {
1145
+ i = new Vn(i, t.options);
1138
1146
  var s = "";
1139
- return i.nodeType === 3 ? s = i.isCode ? i.nodeValue : t.escape(i.nodeValue) : i.nodeType === 1 && (s = Qn.call(t, i)), Ht(r, s);
1147
+ return i.nodeType === 3 ? s = i.isCode ? i.nodeValue : t.escape(i.nodeValue) : i.nodeType === 1 && (s = Jn.call(t, i)), Bt(r, s);
1140
1148
  }, "");
1141
1149
  }
1142
- function Zn(e) {
1150
+ function Qn(e) {
1143
1151
  var t = this;
1144
1152
  return this.rules.forEach(function(r) {
1145
- typeof r.append == "function" && (e = Ht(e, r.append(t.options)));
1153
+ typeof r.append == "function" && (e = Bt(e, r.append(t.options)));
1146
1154
  }), e.replace(/^[\t\r\n]+/, "").replace(/[\t\r\n\s]+$/, "");
1147
1155
  }
1148
- function Qn(e) {
1149
- var t = this.rules.forNode(e), r = Ft.call(this, e), i = e.flankingWhitespace;
1156
+ function Jn(e) {
1157
+ var t = this.rules.forNode(e), r = Ht.call(this, e), i = e.flankingWhitespace;
1150
1158
  return (i.leading || i.trailing) && (r = r.trim()), i.leading + t.replacement(r, e, this.options) + i.trailing;
1151
1159
  }
1152
- function Ht(e, t) {
1153
- var r = In(e), i = Cn(t), s = Math.max(e.length - r.length, t.length - i.length), c = `
1160
+ function Bt(e, t) {
1161
+ var r = Mn(e), i = In(t), s = Math.max(e.length - r.length, t.length - i.length), c = `
1154
1162
 
1155
1163
  `.substring(0, s);
1156
1164
  return r + c + i;
1157
1165
  }
1158
- function Jn(e) {
1166
+ function er(e) {
1159
1167
  return e != null && (typeof e == "string" || e.nodeType && (e.nodeType === 1 || e.nodeType === 9 || e.nodeType === 11));
1160
1168
  }
1161
1169
  export {
1162
- We as T,
1163
- er as p
1170
+ Ge as T,
1171
+ tr as p
1164
1172
  };