wrec 0.20.2 → 0.20.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/wrec.es.js CHANGED
@@ -1,131 +1,126 @@
1
- var Ue = (i) => {
2
- throw TypeError(i);
3
- };
4
- var Zt = (i, t, e) => t.has(i) || Ue("Cannot " + e);
5
- var R = (i, t, e) => (Zt(i, t, "read from private field"), e ? e.call(i) : t.get(i)), j = (i, t, e) => t.has(i) ? Ue("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(i) : t.set(i, e), ot = (i, t, e, n) => (Zt(i, t, "write to private field"), n ? n.call(i, e) : t.set(i, e), e), He = (i, t, e) => (Zt(i, t, "access private method"), e);
6
1
  const {
7
- entries: Ke,
8
- setPrototypeOf: ze,
9
- isFrozen: Dn,
10
- getPrototypeOf: In,
11
- getOwnPropertyDescriptor: Pn
2
+ entries: Pe,
3
+ setPrototypeOf: Re,
4
+ isFrozen: un,
5
+ getPrototypeOf: pn,
6
+ getOwnPropertyDescriptor: mn
12
7
  } = Object;
13
8
  let {
14
- freeze: L,
15
- seal: I,
16
- create: ce
9
+ freeze: N,
10
+ seal: D,
11
+ create: qt
17
12
  } = Object, {
18
- apply: le,
19
- construct: fe
13
+ apply: Kt,
14
+ construct: Zt
20
15
  } = typeof Reflect < "u" && Reflect;
21
- L || (L = function(t) {
16
+ N || (N = function(t) {
22
17
  return t;
23
18
  });
24
- I || (I = function(t) {
19
+ D || (D = function(t) {
25
20
  return t;
26
21
  });
27
- le || (le = function(t, e) {
28
- for (var n = arguments.length, s = new Array(n > 2 ? n - 2 : 0), r = 2; r < n; r++)
29
- s[r - 2] = arguments[r];
30
- return t.apply(e, s);
22
+ Kt || (Kt = function(t, e) {
23
+ for (var n = arguments.length, i = new Array(n > 2 ? n - 2 : 0), r = 2; r < n; r++)
24
+ i[r - 2] = arguments[r];
25
+ return t.apply(e, i);
31
26
  });
32
- fe || (fe = function(t) {
33
- for (var e = arguments.length, n = new Array(e > 1 ? e - 1 : 0), s = 1; s < e; s++)
34
- n[s - 1] = arguments[s];
27
+ Zt || (Zt = function(t) {
28
+ for (var e = arguments.length, n = new Array(e > 1 ? e - 1 : 0), i = 1; i < e; i++)
29
+ n[i - 1] = arguments[i];
35
30
  return new t(...n);
36
31
  });
37
- const Ct = N(Array.prototype.forEach), vn = N(Array.prototype.lastIndexOf), $e = N(Array.prototype.pop), ft = N(Array.prototype.push), xn = N(Array.prototype.splice), Nt = N(String.prototype.toLowerCase), Jt = N(String.prototype.toString), Qt = N(String.prototype.match), ut = N(String.prototype.replace), kn = N(String.prototype.indexOf), Fn = N(String.prototype.trim), P = N(Object.prototype.hasOwnProperty), M = N(RegExp.prototype.test), pt = Un(TypeError);
38
- function N(i) {
32
+ const gt = w(Array.prototype.forEach), hn = w(Array.prototype.lastIndexOf), Ce = w(Array.prototype.pop), ot = w(Array.prototype.push), dn = w(Array.prototype.splice), bt = w(String.prototype.toLowerCase), Ht = w(String.prototype.toString), zt = w(String.prototype.match), it = w(String.prototype.replace), Tn = w(String.prototype.indexOf), En = w(String.prototype.trim), I = w(Object.prototype.hasOwnProperty), O = w(RegExp.prototype.test), st = gn(TypeError);
33
+ function w(s) {
39
34
  return function(t) {
40
35
  t instanceof RegExp && (t.lastIndex = 0);
41
- for (var e = arguments.length, n = new Array(e > 1 ? e - 1 : 0), s = 1; s < e; s++)
42
- n[s - 1] = arguments[s];
43
- return le(i, t, n);
36
+ for (var e = arguments.length, n = new Array(e > 1 ? e - 1 : 0), i = 1; i < e; i++)
37
+ n[i - 1] = arguments[i];
38
+ return Kt(s, t, n);
44
39
  };
45
40
  }
46
- function Un(i) {
41
+ function gn(s) {
47
42
  return function() {
48
43
  for (var t = arguments.length, e = new Array(t), n = 0; n < t; n++)
49
44
  e[n] = arguments[n];
50
- return fe(i, e);
45
+ return Zt(s, e);
51
46
  };
52
47
  }
53
- function d(i, t) {
54
- let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : Nt;
55
- ze && ze(i, null);
48
+ function m(s, t) {
49
+ let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : bt;
50
+ Re && Re(s, null);
56
51
  let n = t.length;
57
52
  for (; n--; ) {
58
- let s = t[n];
59
- if (typeof s == "string") {
60
- const r = e(s);
61
- r !== s && (Dn(t) || (t[n] = r), s = r);
53
+ let i = t[n];
54
+ if (typeof i == "string") {
55
+ const r = e(i);
56
+ r !== i && (un(t) || (t[n] = r), i = r);
62
57
  }
63
- i[s] = !0;
58
+ s[i] = !0;
64
59
  }
65
- return i;
60
+ return s;
66
61
  }
67
- function Hn(i) {
68
- for (let t = 0; t < i.length; t++)
69
- P(i, t) || (i[t] = null);
70
- return i;
62
+ function An(s) {
63
+ for (let t = 0; t < s.length; t++)
64
+ I(s, t) || (s[t] = null);
65
+ return s;
71
66
  }
72
- function k(i) {
73
- const t = ce(null);
74
- for (const [e, n] of Ke(i))
75
- P(i, e) && (Array.isArray(n) ? t[e] = Hn(n) : n && typeof n == "object" && n.constructor === Object ? t[e] = k(n) : t[e] = n);
67
+ function v(s) {
68
+ const t = qt(null);
69
+ for (const [e, n] of Pe(s))
70
+ I(s, e) && (Array.isArray(n) ? t[e] = An(n) : n && typeof n == "object" && n.constructor === Object ? t[e] = v(n) : t[e] = n);
76
71
  return t;
77
72
  }
78
- function ht(i, t) {
79
- for (; i !== null; ) {
80
- const n = Pn(i, t);
73
+ function rt(s, t) {
74
+ for (; s !== null; ) {
75
+ const n = mn(s, t);
81
76
  if (n) {
82
77
  if (n.get)
83
- return N(n.get);
78
+ return w(n.get);
84
79
  if (typeof n.value == "function")
85
- return N(n.value);
80
+ return w(n.value);
86
81
  }
87
- i = In(i);
82
+ s = pn(s);
88
83
  }
89
84
  function e() {
90
85
  return null;
91
86
  }
92
87
  return e;
93
88
  }
94
- const We = L(["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"]), te = L(["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"]), ee = L(["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"]), zn = L(["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"]), ne = L(["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"]), $n = L(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), Ge = L(["#text"]), Be = L(["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", "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", "slot"]), oe = L(["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", "mask-type", "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"]), je = L(["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"]), Mt = L(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), Wn = I(/\{\{[\w\W]*|[\w\W]*\}\}/gm), Gn = I(/<%[\w\W]*|[\w\W]*%>/gm), Bn = I(/\$\{[\w\W]*/gm), jn = I(/^data-[\-\w.\u00B7-\uFFFF]+$/), Yn = I(/^aria-[\-\w]+$/), Ze = I(
89
+ const Me = N(["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"]), Gt = N(["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"]), $t = N(["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"]), _n = N(["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"]), Wt = N(["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"]), bn = N(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), Oe = N(["#text"]), Ne = N(["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", "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", "slot"]), Bt = N(["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", "mask-type", "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"]), we = N(["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"]), At = N(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), Sn = D(/\{\{[\w\W]*|[\w\W]*\}\}/gm), yn = D(/<%[\w\W]*|[\w\W]*%>/gm), Rn = D(/\$\{[\w\W]*/gm), Cn = D(/^data-[\-\w.\u00B7-\uFFFF]+$/), Mn = D(/^aria-[\-\w]+$/), xe = D(
95
90
  /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
96
91
  // eslint-disable-line no-useless-escape
97
- ), Vn = I(/^(?:\w+script|data):/i), Xn = I(
92
+ ), On = D(/^(?:\w+script|data):/i), Nn = D(
98
93
  /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
99
94
  // eslint-disable-line no-control-regex
100
- ), Je = I(/^html$/i), qn = I(/^[a-z][.\w]*(-[.\w]+)+$/i);
101
- var Ye = /* @__PURE__ */ Object.freeze({
95
+ ), ve = D(/^html$/i), wn = D(/^[a-z][.\w]*(-[.\w]+)+$/i);
96
+ var Le = /* @__PURE__ */ Object.freeze({
102
97
  __proto__: null,
103
- ARIA_ATTR: Yn,
104
- ATTR_WHITESPACE: Xn,
105
- CUSTOM_ELEMENT: qn,
106
- DATA_ATTR: jn,
107
- DOCTYPE_NAME: Je,
108
- ERB_EXPR: Gn,
109
- IS_ALLOWED_URI: Ze,
110
- IS_SCRIPT_OR_DATA: Vn,
111
- MUSTACHE_EXPR: Wn,
112
- TMPLIT_EXPR: Bn
98
+ ARIA_ATTR: Mn,
99
+ ATTR_WHITESPACE: Nn,
100
+ CUSTOM_ELEMENT: wn,
101
+ DATA_ATTR: Cn,
102
+ DOCTYPE_NAME: ve,
103
+ ERB_EXPR: yn,
104
+ IS_ALLOWED_URI: xe,
105
+ IS_SCRIPT_OR_DATA: On,
106
+ MUSTACHE_EXPR: Sn,
107
+ TMPLIT_EXPR: Rn
113
108
  });
114
- const mt = {
109
+ const at = {
115
110
  element: 1,
116
111
  text: 3,
117
112
  // Deprecated
118
113
  progressingInstruction: 7,
119
114
  comment: 8,
120
115
  document: 9
121
- }, Kn = function() {
116
+ }, Ln = function() {
122
117
  return typeof window > "u" ? null : window;
123
- }, Zn = function(t, e) {
118
+ }, Dn = function(t, e) {
124
119
  if (typeof t != "object" || typeof t.createPolicy != "function")
125
120
  return null;
126
121
  let n = null;
127
- const s = "data-tt-policy-suffix";
128
- e && e.hasAttribute(s) && (n = e.getAttribute(s));
122
+ const i = "data-tt-policy-suffix";
123
+ e && e.hasAttribute(i) && (n = e.getAttribute(i));
129
124
  const r = "dompurify" + (n ? "#" + n : "");
130
125
  try {
131
126
  return t.createPolicy(r, {
@@ -139,7 +134,7 @@ const mt = {
139
134
  } catch {
140
135
  return console.warn("TrustedTypes policy " + r + " could not be created."), null;
141
136
  }
142
- }, Ve = function() {
137
+ }, De = function() {
143
138
  return {
144
139
  afterSanitizeAttributes: [],
145
140
  afterSanitizeElements: [],
@@ -152,57 +147,57 @@ const mt = {
152
147
  uponSanitizeShadowNode: []
153
148
  };
154
149
  };
155
- function Qe() {
156
- let i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Kn();
157
- const t = (f) => Qe(f);
158
- if (t.version = "3.3.1", t.removed = [], !i || !i.document || i.document.nodeType !== mt.document || !i.Element)
150
+ function ke() {
151
+ let s = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Ln();
152
+ const t = (f) => ke(f);
153
+ if (t.version = "3.3.1", t.removed = [], !s || !s.document || s.document.nodeType !== at.document || !s.Element)
159
154
  return t.isSupported = !1, t;
160
155
  let {
161
156
  document: e
162
- } = i;
163
- const n = e, s = n.currentScript, {
157
+ } = s;
158
+ const n = e, i = n.currentScript, {
164
159
  DocumentFragment: r,
165
160
  HTMLTemplateElement: c,
166
- Node: u,
167
- Element: p,
168
- NodeFilter: h,
169
- NamedNodeMap: m = i.NamedNodeMap || i.MozNamedAttrMap,
161
+ Node: h,
162
+ Element: u,
163
+ NodeFilter: p,
164
+ NamedNodeMap: d = s.NamedNodeMap || s.MozNamedAttrMap,
170
165
  HTMLFormElement: b,
171
166
  DOMParser: G,
172
- trustedTypes: H
173
- } = i, B = p.prototype, un = ht(B, "cloneNode"), pn = ht(B, "remove"), hn = ht(B, "nextSibling"), mn = ht(B, "childNodes"), At = ht(B, "parentNode");
167
+ trustedTypes: F
168
+ } = s, $ = u.prototype, Be = rt($, "cloneNode"), je = rt($, "remove"), Ye = rt($, "nextSibling"), Ve = rt($, "childNodes"), ft = rt($, "parentNode");
174
169
  if (typeof c == "function") {
175
170
  const f = e.createElement("template");
176
171
  f.content && f.content.ownerDocument && (e = f.content.ownerDocument);
177
172
  }
178
- let O, rt = "";
173
+ let C, Q = "";
179
174
  const {
180
- implementation: xt,
181
- createNodeIterator: dn,
182
- createDocumentFragment: Tn,
183
- getElementsByTagName: En
175
+ implementation: yt,
176
+ createNodeIterator: Xe,
177
+ createDocumentFragment: qe,
178
+ getElementsByTagName: Ke
184
179
  } = e, {
185
- importNode: gn
180
+ importNode: Ze
186
181
  } = n;
187
- let C = Ve();
188
- t.isSupported = typeof Ke == "function" && typeof At == "function" && xt && xt.createHTMLDocument !== void 0;
182
+ let M = De();
183
+ t.isSupported = typeof Pe == "function" && typeof ft == "function" && yt && yt.createHTMLDocument !== void 0;
189
184
  const {
190
- MUSTACHE_EXPR: kt,
191
- ERB_EXPR: Ft,
192
- TMPLIT_EXPR: Ut,
193
- DATA_ATTR: An,
194
- ARIA_ATTR: _n,
195
- IS_SCRIPT_OR_DATA: bn,
196
- ATTR_WHITESPACE: me,
197
- CUSTOM_ELEMENT: Sn
198
- } = Ye;
185
+ MUSTACHE_EXPR: Rt,
186
+ ERB_EXPR: Ct,
187
+ TMPLIT_EXPR: Mt,
188
+ DATA_ATTR: Je,
189
+ ARIA_ATTR: Qe,
190
+ IS_SCRIPT_OR_DATA: tn,
191
+ ATTR_WHITESPACE: te,
192
+ CUSTOM_ELEMENT: en
193
+ } = Le;
199
194
  let {
200
- IS_ALLOWED_URI: de
201
- } = Ye, _ = null;
202
- const Te = d({}, [...We, ...te, ...ee, ...ne, ...Ge]);
195
+ IS_ALLOWED_URI: ee
196
+ } = Le, _ = null;
197
+ const ne = m({}, [...Me, ...Gt, ...$t, ...Wt, ...Oe]);
203
198
  let S = null;
204
- const Ee = d({}, [...Be, ...oe, ...je, ...Mt]);
205
- let E = Object.seal(ce(null, {
199
+ const oe = m({}, [...Ne, ...Bt, ...we, ...At]);
200
+ let E = Object.seal(qt(null, {
206
201
  tagNameCheck: {
207
202
  writable: !0,
208
203
  configurable: !1,
@@ -221,8 +216,8 @@ function Qe() {
221
216
  enumerable: !0,
222
217
  value: !1
223
218
  }
224
- })), at = null, Ht = null;
225
- const K = Object.seal(ce(null, {
219
+ })), tt = null, Ot = null;
220
+ const j = Object.seal(qt(null, {
226
221
  tagCheck: {
227
222
  writable: !0,
228
223
  configurable: !1,
@@ -236,68 +231,68 @@ function Qe() {
236
231
  value: null
237
232
  }
238
233
  }));
239
- let ge = !0, zt = !0, Ae = !1, _e = !0, Z = !1, _t = !0, V = !1, $t = !1, Wt = !1, J = !1, bt = !1, St = !1, be = !0, Se = !1;
240
- const yn = "user-content-";
241
- let Gt = !0, ct = !1, Q = {}, v = null;
242
- const Bt = d({}, ["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"]);
243
- let ye = null;
244
- const Re = d({}, ["audio", "video", "img", "source", "image", "track"]);
245
- let jt = null;
246
- const we = d({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), yt = "http://www.w3.org/1998/Math/MathML", Rt = "http://www.w3.org/2000/svg", z = "http://www.w3.org/1999/xhtml";
247
- let tt = z, Yt = !1, Vt = null;
248
- const Rn = d({}, [yt, Rt, z], Jt);
249
- let wt = d({}, ["mi", "mo", "mn", "ms", "mtext"]), Ot = d({}, ["annotation-xml"]);
250
- const wn = d({}, ["title", "style", "font", "a", "script"]);
251
- let lt = null;
252
- const On = ["application/xhtml+xml", "text/html"], Cn = "text/html";
253
- let A = null, et = null;
254
- const Mn = e.createElement("form"), Oe = function(o) {
234
+ let ie = !0, Nt = !0, se = !1, re = !0, Y = !1, ut = !0, W = !1, wt = !1, Lt = !1, V = !1, pt = !1, mt = !1, ae = !0, ce = !1;
235
+ const nn = "user-content-";
236
+ let Dt = !0, et = !1, X = {}, P = null;
237
+ const It = m({}, ["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"]);
238
+ let le = null;
239
+ const fe = m({}, ["audio", "video", "img", "source", "image", "track"]);
240
+ let Pt = null;
241
+ const ue = m({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), ht = "http://www.w3.org/1998/Math/MathML", dt = "http://www.w3.org/2000/svg", U = "http://www.w3.org/1999/xhtml";
242
+ let q = U, xt = !1, vt = null;
243
+ const on = m({}, [ht, dt, U], Ht);
244
+ let Tt = m({}, ["mi", "mo", "mn", "ms", "mtext"]), Et = m({}, ["annotation-xml"]);
245
+ const sn = m({}, ["title", "style", "font", "a", "script"]);
246
+ let nt = null;
247
+ const rn = ["application/xhtml+xml", "text/html"], an = "text/html";
248
+ let A = null, K = null;
249
+ const cn = e.createElement("form"), pe = function(o) {
255
250
  return o instanceof RegExp || o instanceof Function;
256
- }, Xt = function() {
251
+ }, kt = function() {
257
252
  let o = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
258
- if (!(et && et === o)) {
259
- if ((!o || typeof o != "object") && (o = {}), o = k(o), lt = // eslint-disable-next-line unicorn/prefer-includes
260
- On.indexOf(o.PARSER_MEDIA_TYPE) === -1 ? Cn : o.PARSER_MEDIA_TYPE, A = lt === "application/xhtml+xml" ? Jt : Nt, _ = P(o, "ALLOWED_TAGS") ? d({}, o.ALLOWED_TAGS, A) : Te, S = P(o, "ALLOWED_ATTR") ? d({}, o.ALLOWED_ATTR, A) : Ee, Vt = P(o, "ALLOWED_NAMESPACES") ? d({}, o.ALLOWED_NAMESPACES, Jt) : Rn, jt = P(o, "ADD_URI_SAFE_ATTR") ? d(k(we), o.ADD_URI_SAFE_ATTR, A) : we, ye = P(o, "ADD_DATA_URI_TAGS") ? d(k(Re), o.ADD_DATA_URI_TAGS, A) : Re, v = P(o, "FORBID_CONTENTS") ? d({}, o.FORBID_CONTENTS, A) : Bt, at = P(o, "FORBID_TAGS") ? d({}, o.FORBID_TAGS, A) : k({}), Ht = P(o, "FORBID_ATTR") ? d({}, o.FORBID_ATTR, A) : k({}), Q = P(o, "USE_PROFILES") ? o.USE_PROFILES : !1, ge = o.ALLOW_ARIA_ATTR !== !1, zt = o.ALLOW_DATA_ATTR !== !1, Ae = o.ALLOW_UNKNOWN_PROTOCOLS || !1, _e = o.ALLOW_SELF_CLOSE_IN_ATTR !== !1, Z = o.SAFE_FOR_TEMPLATES || !1, _t = o.SAFE_FOR_XML !== !1, V = o.WHOLE_DOCUMENT || !1, J = o.RETURN_DOM || !1, bt = o.RETURN_DOM_FRAGMENT || !1, St = o.RETURN_TRUSTED_TYPE || !1, Wt = o.FORCE_BODY || !1, be = o.SANITIZE_DOM !== !1, Se = o.SANITIZE_NAMED_PROPS || !1, Gt = o.KEEP_CONTENT !== !1, ct = o.IN_PLACE || !1, de = o.ALLOWED_URI_REGEXP || Ze, tt = o.NAMESPACE || z, wt = o.MATHML_TEXT_INTEGRATION_POINTS || wt, Ot = o.HTML_INTEGRATION_POINTS || Ot, E = o.CUSTOM_ELEMENT_HANDLING || {}, o.CUSTOM_ELEMENT_HANDLING && Oe(o.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (E.tagNameCheck = o.CUSTOM_ELEMENT_HANDLING.tagNameCheck), o.CUSTOM_ELEMENT_HANDLING && Oe(o.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (E.attributeNameCheck = o.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), o.CUSTOM_ELEMENT_HANDLING && typeof o.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (E.allowCustomizedBuiltInElements = o.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), Z && (zt = !1), bt && (J = !0), Q && (_ = d({}, Ge), S = [], Q.html === !0 && (d(_, We), d(S, Be)), Q.svg === !0 && (d(_, te), d(S, oe), d(S, Mt)), Q.svgFilters === !0 && (d(_, ee), d(S, oe), d(S, Mt)), Q.mathMl === !0 && (d(_, ne), d(S, je), d(S, Mt))), o.ADD_TAGS && (typeof o.ADD_TAGS == "function" ? K.tagCheck = o.ADD_TAGS : (_ === Te && (_ = k(_)), d(_, o.ADD_TAGS, A))), o.ADD_ATTR && (typeof o.ADD_ATTR == "function" ? K.attributeCheck = o.ADD_ATTR : (S === Ee && (S = k(S)), d(S, o.ADD_ATTR, A))), o.ADD_URI_SAFE_ATTR && d(jt, o.ADD_URI_SAFE_ATTR, A), o.FORBID_CONTENTS && (v === Bt && (v = k(v)), d(v, o.FORBID_CONTENTS, A)), o.ADD_FORBID_CONTENTS && (v === Bt && (v = k(v)), d(v, o.ADD_FORBID_CONTENTS, A)), Gt && (_["#text"] = !0), V && d(_, ["html", "head", "body"]), _.table && (d(_, ["tbody"]), delete at.tbody), o.TRUSTED_TYPES_POLICY) {
253
+ if (!(K && K === o)) {
254
+ if ((!o || typeof o != "object") && (o = {}), o = v(o), nt = // eslint-disable-next-line unicorn/prefer-includes
255
+ rn.indexOf(o.PARSER_MEDIA_TYPE) === -1 ? an : o.PARSER_MEDIA_TYPE, A = nt === "application/xhtml+xml" ? Ht : bt, _ = I(o, "ALLOWED_TAGS") ? m({}, o.ALLOWED_TAGS, A) : ne, S = I(o, "ALLOWED_ATTR") ? m({}, o.ALLOWED_ATTR, A) : oe, vt = I(o, "ALLOWED_NAMESPACES") ? m({}, o.ALLOWED_NAMESPACES, Ht) : on, Pt = I(o, "ADD_URI_SAFE_ATTR") ? m(v(ue), o.ADD_URI_SAFE_ATTR, A) : ue, le = I(o, "ADD_DATA_URI_TAGS") ? m(v(fe), o.ADD_DATA_URI_TAGS, A) : fe, P = I(o, "FORBID_CONTENTS") ? m({}, o.FORBID_CONTENTS, A) : It, tt = I(o, "FORBID_TAGS") ? m({}, o.FORBID_TAGS, A) : v({}), Ot = I(o, "FORBID_ATTR") ? m({}, o.FORBID_ATTR, A) : v({}), X = I(o, "USE_PROFILES") ? o.USE_PROFILES : !1, ie = o.ALLOW_ARIA_ATTR !== !1, Nt = o.ALLOW_DATA_ATTR !== !1, se = o.ALLOW_UNKNOWN_PROTOCOLS || !1, re = o.ALLOW_SELF_CLOSE_IN_ATTR !== !1, Y = o.SAFE_FOR_TEMPLATES || !1, ut = o.SAFE_FOR_XML !== !1, W = o.WHOLE_DOCUMENT || !1, V = o.RETURN_DOM || !1, pt = o.RETURN_DOM_FRAGMENT || !1, mt = o.RETURN_TRUSTED_TYPE || !1, Lt = o.FORCE_BODY || !1, ae = o.SANITIZE_DOM !== !1, ce = o.SANITIZE_NAMED_PROPS || !1, Dt = o.KEEP_CONTENT !== !1, et = o.IN_PLACE || !1, ee = o.ALLOWED_URI_REGEXP || xe, q = o.NAMESPACE || U, Tt = o.MATHML_TEXT_INTEGRATION_POINTS || Tt, Et = o.HTML_INTEGRATION_POINTS || Et, E = o.CUSTOM_ELEMENT_HANDLING || {}, o.CUSTOM_ELEMENT_HANDLING && pe(o.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (E.tagNameCheck = o.CUSTOM_ELEMENT_HANDLING.tagNameCheck), o.CUSTOM_ELEMENT_HANDLING && pe(o.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (E.attributeNameCheck = o.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), o.CUSTOM_ELEMENT_HANDLING && typeof o.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (E.allowCustomizedBuiltInElements = o.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), Y && (Nt = !1), pt && (V = !0), X && (_ = m({}, Oe), S = [], X.html === !0 && (m(_, Me), m(S, Ne)), X.svg === !0 && (m(_, Gt), m(S, Bt), m(S, At)), X.svgFilters === !0 && (m(_, $t), m(S, Bt), m(S, At)), X.mathMl === !0 && (m(_, Wt), m(S, we), m(S, At))), o.ADD_TAGS && (typeof o.ADD_TAGS == "function" ? j.tagCheck = o.ADD_TAGS : (_ === ne && (_ = v(_)), m(_, o.ADD_TAGS, A))), o.ADD_ATTR && (typeof o.ADD_ATTR == "function" ? j.attributeCheck = o.ADD_ATTR : (S === oe && (S = v(S)), m(S, o.ADD_ATTR, A))), o.ADD_URI_SAFE_ATTR && m(Pt, o.ADD_URI_SAFE_ATTR, A), o.FORBID_CONTENTS && (P === It && (P = v(P)), m(P, o.FORBID_CONTENTS, A)), o.ADD_FORBID_CONTENTS && (P === It && (P = v(P)), m(P, o.ADD_FORBID_CONTENTS, A)), Dt && (_["#text"] = !0), W && m(_, ["html", "head", "body"]), _.table && (m(_, ["tbody"]), delete tt.tbody), o.TRUSTED_TYPES_POLICY) {
261
256
  if (typeof o.TRUSTED_TYPES_POLICY.createHTML != "function")
262
- throw pt('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
257
+ throw st('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
263
258
  if (typeof o.TRUSTED_TYPES_POLICY.createScriptURL != "function")
264
- throw pt('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
265
- O = o.TRUSTED_TYPES_POLICY, rt = O.createHTML("");
259
+ throw st('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
260
+ C = o.TRUSTED_TYPES_POLICY, Q = C.createHTML("");
266
261
  } else
267
- O === void 0 && (O = Zn(H, s)), O !== null && typeof rt == "string" && (rt = O.createHTML(""));
268
- L && L(o), et = o;
262
+ C === void 0 && (C = Dn(F, i)), C !== null && typeof Q == "string" && (Q = C.createHTML(""));
263
+ N && N(o), K = o;
269
264
  }
270
- }, Ce = d({}, [...te, ...ee, ...zn]), Me = d({}, [...ne, ...$n]), Ln = function(o) {
271
- let a = At(o);
265
+ }, me = m({}, [...Gt, ...$t, ..._n]), he = m({}, [...Wt, ...bn]), ln = function(o) {
266
+ let a = ft(o);
272
267
  (!a || !a.tagName) && (a = {
273
- namespaceURI: tt,
268
+ namespaceURI: q,
274
269
  tagName: "template"
275
270
  });
276
- const l = Nt(o.tagName), T = Nt(a.tagName);
277
- return Vt[o.namespaceURI] ? o.namespaceURI === Rt ? a.namespaceURI === z ? l === "svg" : a.namespaceURI === yt ? l === "svg" && (T === "annotation-xml" || wt[T]) : !!Ce[l] : o.namespaceURI === yt ? a.namespaceURI === z ? l === "math" : a.namespaceURI === Rt ? l === "math" && Ot[T] : !!Me[l] : o.namespaceURI === z ? a.namespaceURI === Rt && !Ot[T] || a.namespaceURI === yt && !wt[T] ? !1 : !Me[l] && (wn[l] || !Ce[l]) : !!(lt === "application/xhtml+xml" && Vt[o.namespaceURI]) : !1;
271
+ const l = bt(o.tagName), T = bt(a.tagName);
272
+ return vt[o.namespaceURI] ? o.namespaceURI === dt ? a.namespaceURI === U ? l === "svg" : a.namespaceURI === ht ? l === "svg" && (T === "annotation-xml" || Tt[T]) : !!me[l] : o.namespaceURI === ht ? a.namespaceURI === U ? l === "math" : a.namespaceURI === dt ? l === "math" && Et[T] : !!he[l] : o.namespaceURI === U ? a.namespaceURI === dt && !Et[T] || a.namespaceURI === ht && !Tt[T] ? !1 : !he[l] && (sn[l] || !me[l]) : !!(nt === "application/xhtml+xml" && vt[o.namespaceURI]) : !1;
278
273
  }, x = function(o) {
279
- ft(t.removed, {
274
+ ot(t.removed, {
280
275
  element: o
281
276
  });
282
277
  try {
283
- At(o).removeChild(o);
278
+ ft(o).removeChild(o);
284
279
  } catch {
285
- pn(o);
280
+ je(o);
286
281
  }
287
- }, X = function(o, a) {
282
+ }, B = function(o, a) {
288
283
  try {
289
- ft(t.removed, {
284
+ ot(t.removed, {
290
285
  attribute: a.getAttributeNode(o),
291
286
  from: a
292
287
  });
293
288
  } catch {
294
- ft(t.removed, {
289
+ ot(t.removed, {
295
290
  attribute: null,
296
291
  from: a
297
292
  });
298
293
  }
299
294
  if (a.removeAttribute(o), o === "is")
300
- if (J || bt)
295
+ if (V || pt)
301
296
  try {
302
297
  x(a);
303
298
  } catch {
@@ -307,97 +302,97 @@ function Qe() {
307
302
  a.setAttribute(o, "");
308
303
  } catch {
309
304
  }
310
- }, Le = function(o) {
305
+ }, de = function(o) {
311
306
  let a = null, l = null;
312
- if (Wt)
307
+ if (Lt)
313
308
  o = "<remove></remove>" + o;
314
309
  else {
315
- const g = Qt(o, /^[\r\n\t ]+/);
310
+ const g = zt(o, /^[\r\n\t ]+/);
316
311
  l = g && g[0];
317
312
  }
318
- lt === "application/xhtml+xml" && tt === z && (o = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + o + "</body></html>");
319
- const T = O ? O.createHTML(o) : o;
320
- if (tt === z)
313
+ nt === "application/xhtml+xml" && q === U && (o = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + o + "</body></html>");
314
+ const T = C ? C.createHTML(o) : o;
315
+ if (q === U)
321
316
  try {
322
- a = new G().parseFromString(T, lt);
317
+ a = new G().parseFromString(T, nt);
323
318
  } catch {
324
319
  }
325
320
  if (!a || !a.documentElement) {
326
- a = xt.createDocument(tt, "template", null);
321
+ a = yt.createDocument(q, "template", null);
327
322
  try {
328
- a.documentElement.innerHTML = Yt ? rt : T;
323
+ a.documentElement.innerHTML = xt ? Q : T;
329
324
  } catch {
330
325
  }
331
326
  }
332
- const w = a.body || a.documentElement;
333
- return o && l && w.insertBefore(e.createTextNode(l), w.childNodes[0] || null), tt === z ? En.call(a, V ? "html" : "body")[0] : V ? a.documentElement : w;
334
- }, Ne = function(o) {
335
- return dn.call(
327
+ const R = a.body || a.documentElement;
328
+ return o && l && R.insertBefore(e.createTextNode(l), R.childNodes[0] || null), q === U ? Ke.call(a, W ? "html" : "body")[0] : W ? a.documentElement : R;
329
+ }, Te = function(o) {
330
+ return Xe.call(
336
331
  o.ownerDocument || o,
337
332
  o,
338
333
  // eslint-disable-next-line no-bitwise
339
- h.SHOW_ELEMENT | h.SHOW_COMMENT | h.SHOW_TEXT | h.SHOW_PROCESSING_INSTRUCTION | h.SHOW_CDATA_SECTION,
334
+ p.SHOW_ELEMENT | p.SHOW_COMMENT | p.SHOW_TEXT | p.SHOW_PROCESSING_INSTRUCTION | p.SHOW_CDATA_SECTION,
340
335
  null
341
336
  );
342
- }, qt = function(o) {
343
- return o instanceof b && (typeof o.nodeName != "string" || typeof o.textContent != "string" || typeof o.removeChild != "function" || !(o.attributes instanceof m) || typeof o.removeAttribute != "function" || typeof o.setAttribute != "function" || typeof o.namespaceURI != "string" || typeof o.insertBefore != "function" || typeof o.hasChildNodes != "function");
344
- }, De = function(o) {
345
- return typeof u == "function" && o instanceof u;
337
+ }, Ft = function(o) {
338
+ return o instanceof b && (typeof o.nodeName != "string" || typeof o.textContent != "string" || typeof o.removeChild != "function" || !(o.attributes instanceof d) || typeof o.removeAttribute != "function" || typeof o.setAttribute != "function" || typeof o.namespaceURI != "string" || typeof o.insertBefore != "function" || typeof o.hasChildNodes != "function");
339
+ }, Ee = function(o) {
340
+ return typeof h == "function" && o instanceof h;
346
341
  };
347
- function $(f, o, a) {
348
- Ct(f, (l) => {
349
- l.call(t, o, a, et);
342
+ function H(f, o, a) {
343
+ gt(f, (l) => {
344
+ l.call(t, o, a, K);
350
345
  });
351
346
  }
352
- const Ie = function(o) {
347
+ const ge = function(o) {
353
348
  let a = null;
354
- if ($(C.beforeSanitizeElements, o, null), qt(o))
349
+ if (H(M.beforeSanitizeElements, o, null), Ft(o))
355
350
  return x(o), !0;
356
351
  const l = A(o.nodeName);
357
- if ($(C.uponSanitizeElement, o, {
352
+ if (H(M.uponSanitizeElement, o, {
358
353
  tagName: l,
359
354
  allowedTags: _
360
- }), _t && o.hasChildNodes() && !De(o.firstElementChild) && M(/<[/\w!]/g, o.innerHTML) && M(/<[/\w!]/g, o.textContent) || o.nodeType === mt.progressingInstruction || _t && o.nodeType === mt.comment && M(/<[/\w]/g, o.data))
355
+ }), ut && o.hasChildNodes() && !Ee(o.firstElementChild) && O(/<[/\w!]/g, o.innerHTML) && O(/<[/\w!]/g, o.textContent) || o.nodeType === at.progressingInstruction || ut && o.nodeType === at.comment && O(/<[/\w]/g, o.data))
361
356
  return x(o), !0;
362
- if (!(K.tagCheck instanceof Function && K.tagCheck(l)) && (!_[l] || at[l])) {
363
- if (!at[l] && ve(l) && (E.tagNameCheck instanceof RegExp && M(E.tagNameCheck, l) || E.tagNameCheck instanceof Function && E.tagNameCheck(l)))
357
+ if (!(j.tagCheck instanceof Function && j.tagCheck(l)) && (!_[l] || tt[l])) {
358
+ if (!tt[l] && _e(l) && (E.tagNameCheck instanceof RegExp && O(E.tagNameCheck, l) || E.tagNameCheck instanceof Function && E.tagNameCheck(l)))
364
359
  return !1;
365
- if (Gt && !v[l]) {
366
- const T = At(o) || o.parentNode, w = mn(o) || o.childNodes;
367
- if (w && T) {
368
- const g = w.length;
369
- for (let D = g - 1; D >= 0; --D) {
370
- const W = un(w[D], !0);
371
- W.__removalCount = (o.__removalCount || 0) + 1, T.insertBefore(W, hn(o));
360
+ if (Dt && !P[l]) {
361
+ const T = ft(o) || o.parentNode, R = Ve(o) || o.childNodes;
362
+ if (R && T) {
363
+ const g = R.length;
364
+ for (let L = g - 1; L >= 0; --L) {
365
+ const z = Be(R[L], !0);
366
+ z.__removalCount = (o.__removalCount || 0) + 1, T.insertBefore(z, Ye(o));
372
367
  }
373
368
  }
374
369
  }
375
370
  return x(o), !0;
376
371
  }
377
- return o instanceof p && !Ln(o) || (l === "noscript" || l === "noembed" || l === "noframes") && M(/<\/no(script|embed|frames)/i, o.innerHTML) ? (x(o), !0) : (Z && o.nodeType === mt.text && (a = o.textContent, Ct([kt, Ft, Ut], (T) => {
378
- a = ut(a, T, " ");
379
- }), o.textContent !== a && (ft(t.removed, {
372
+ return o instanceof u && !ln(o) || (l === "noscript" || l === "noembed" || l === "noframes") && O(/<\/no(script|embed|frames)/i, o.innerHTML) ? (x(o), !0) : (Y && o.nodeType === at.text && (a = o.textContent, gt([Rt, Ct, Mt], (T) => {
373
+ a = it(a, T, " ");
374
+ }), o.textContent !== a && (ot(t.removed, {
380
375
  element: o.cloneNode()
381
- }), o.textContent = a)), $(C.afterSanitizeElements, o, null), !1);
382
- }, Pe = function(o, a, l) {
383
- if (be && (a === "id" || a === "name") && (l in e || l in Mn))
376
+ }), o.textContent = a)), H(M.afterSanitizeElements, o, null), !1);
377
+ }, Ae = function(o, a, l) {
378
+ if (ae && (a === "id" || a === "name") && (l in e || l in cn))
384
379
  return !1;
385
- if (!(zt && !Ht[a] && M(An, a))) {
386
- if (!(ge && M(_n, a))) {
387
- if (!(K.attributeCheck instanceof Function && K.attributeCheck(a, o))) {
388
- if (!S[a] || Ht[a]) {
380
+ if (!(Nt && !Ot[a] && O(Je, a))) {
381
+ if (!(ie && O(Qe, a))) {
382
+ if (!(j.attributeCheck instanceof Function && j.attributeCheck(a, o))) {
383
+ if (!S[a] || Ot[a]) {
389
384
  if (
390
385
  // First condition does a very basic check if a) it's basically a valid custom element tagname AND
391
386
  // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
392
387
  // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
393
- !(ve(o) && (E.tagNameCheck instanceof RegExp && M(E.tagNameCheck, o) || E.tagNameCheck instanceof Function && E.tagNameCheck(o)) && (E.attributeNameCheck instanceof RegExp && M(E.attributeNameCheck, a) || E.attributeNameCheck instanceof Function && E.attributeNameCheck(a, o)) || // Alternative, second condition checks if it's an `is`-attribute, AND
388
+ !(_e(o) && (E.tagNameCheck instanceof RegExp && O(E.tagNameCheck, o) || E.tagNameCheck instanceof Function && E.tagNameCheck(o)) && (E.attributeNameCheck instanceof RegExp && O(E.attributeNameCheck, a) || E.attributeNameCheck instanceof Function && E.attributeNameCheck(a, o)) || // Alternative, second condition checks if it's an `is`-attribute, AND
394
389
  // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
395
- a === "is" && E.allowCustomizedBuiltInElements && (E.tagNameCheck instanceof RegExp && M(E.tagNameCheck, l) || E.tagNameCheck instanceof Function && E.tagNameCheck(l)))
390
+ a === "is" && E.allowCustomizedBuiltInElements && (E.tagNameCheck instanceof RegExp && O(E.tagNameCheck, l) || E.tagNameCheck instanceof Function && E.tagNameCheck(l)))
396
391
  ) return !1;
397
- } else if (!jt[a]) {
398
- if (!M(de, ut(l, me, ""))) {
399
- if (!((a === "src" || a === "xlink:href" || a === "href") && o !== "script" && kn(l, "data:") === 0 && ye[o])) {
400
- if (!(Ae && !M(bn, ut(l, me, "")))) {
392
+ } else if (!Pt[a]) {
393
+ if (!O(ee, it(l, te, ""))) {
394
+ if (!((a === "src" || a === "xlink:href" || a === "href") && o !== "script" && Tn(l, "data:") === 0 && le[o])) {
395
+ if (!(se && !O(tn, it(l, te, "")))) {
401
396
  if (l)
402
397
  return !1;
403
398
  }
@@ -408,14 +403,14 @@ function Qe() {
408
403
  }
409
404
  }
410
405
  return !0;
411
- }, ve = function(o) {
412
- return o !== "annotation-xml" && Qt(o, Sn);
413
- }, xe = function(o) {
414
- $(C.beforeSanitizeAttributes, o, null);
406
+ }, _e = function(o) {
407
+ return o !== "annotation-xml" && zt(o, en);
408
+ }, be = function(o) {
409
+ H(M.beforeSanitizeAttributes, o, null);
415
410
  const {
416
411
  attributes: a
417
412
  } = o;
418
- if (!a || qt(o))
413
+ if (!a || Ft(o))
419
414
  return;
420
415
  const l = {
421
416
  attrName: "",
@@ -426,292 +421,146 @@ function Qe() {
426
421
  };
427
422
  let T = a.length;
428
423
  for (; T--; ) {
429
- const w = a[T], {
424
+ const R = a[T], {
430
425
  name: g,
431
- namespaceURI: D,
432
- value: W
433
- } = w, nt = A(g), Kt = W;
434
- let y = g === "value" ? Kt : Fn(Kt);
435
- if (l.attrName = nt, l.attrValue = y, l.keepAttr = !0, l.forceKeepAttr = void 0, $(C.uponSanitizeAttribute, o, l), y = l.attrValue, Se && (nt === "id" || nt === "name") && (X(g, o), y = yn + y), _t && M(/((--!?|])>)|<\/(style|title|textarea)/i, y)) {
436
- X(g, o);
426
+ namespaceURI: L,
427
+ value: z
428
+ } = R, Z = A(g), Ut = z;
429
+ let y = g === "value" ? Ut : En(Ut);
430
+ if (l.attrName = Z, l.attrValue = y, l.keepAttr = !0, l.forceKeepAttr = void 0, H(M.uponSanitizeAttribute, o, l), y = l.attrValue, ce && (Z === "id" || Z === "name") && (B(g, o), y = nn + y), ut && O(/((--!?|])>)|<\/(style|title|textarea)/i, y)) {
431
+ B(g, o);
437
432
  continue;
438
433
  }
439
- if (nt === "attributename" && Qt(y, "href")) {
440
- X(g, o);
434
+ if (Z === "attributename" && zt(y, "href")) {
435
+ B(g, o);
441
436
  continue;
442
437
  }
443
438
  if (l.forceKeepAttr)
444
439
  continue;
445
440
  if (!l.keepAttr) {
446
- X(g, o);
441
+ B(g, o);
447
442
  continue;
448
443
  }
449
- if (!_e && M(/\/>/i, y)) {
450
- X(g, o);
444
+ if (!re && O(/\/>/i, y)) {
445
+ B(g, o);
451
446
  continue;
452
447
  }
453
- Z && Ct([kt, Ft, Ut], (Fe) => {
454
- y = ut(y, Fe, " ");
448
+ Y && gt([Rt, Ct, Mt], (ye) => {
449
+ y = it(y, ye, " ");
455
450
  });
456
- const ke = A(o.nodeName);
457
- if (!Pe(ke, nt, y)) {
458
- X(g, o);
451
+ const Se = A(o.nodeName);
452
+ if (!Ae(Se, Z, y)) {
453
+ B(g, o);
459
454
  continue;
460
455
  }
461
- if (O && typeof H == "object" && typeof H.getAttributeType == "function" && !D)
462
- switch (H.getAttributeType(ke, nt)) {
456
+ if (C && typeof F == "object" && typeof F.getAttributeType == "function" && !L)
457
+ switch (F.getAttributeType(Se, Z)) {
463
458
  case "TrustedHTML": {
464
- y = O.createHTML(y);
459
+ y = C.createHTML(y);
465
460
  break;
466
461
  }
467
462
  case "TrustedScriptURL": {
468
- y = O.createScriptURL(y);
463
+ y = C.createScriptURL(y);
469
464
  break;
470
465
  }
471
466
  }
472
- if (y !== Kt)
467
+ if (y !== Ut)
473
468
  try {
474
- D ? o.setAttributeNS(D, g, y) : o.setAttribute(g, y), qt(o) ? x(o) : $e(t.removed);
469
+ L ? o.setAttributeNS(L, g, y) : o.setAttribute(g, y), Ft(o) ? x(o) : Ce(t.removed);
475
470
  } catch {
476
- X(g, o);
471
+ B(g, o);
477
472
  }
478
473
  }
479
- $(C.afterSanitizeAttributes, o, null);
480
- }, Nn = function f(o) {
474
+ H(M.afterSanitizeAttributes, o, null);
475
+ }, fn = function f(o) {
481
476
  let a = null;
482
- const l = Ne(o);
483
- for ($(C.beforeSanitizeShadowDOM, o, null); a = l.nextNode(); )
484
- $(C.uponSanitizeShadowNode, a, null), Ie(a), xe(a), a.content instanceof r && f(a.content);
485
- $(C.afterSanitizeShadowDOM, o, null);
477
+ const l = Te(o);
478
+ for (H(M.beforeSanitizeShadowDOM, o, null); a = l.nextNode(); )
479
+ H(M.uponSanitizeShadowNode, a, null), ge(a), be(a), a.content instanceof r && f(a.content);
480
+ H(M.afterSanitizeShadowDOM, o, null);
486
481
  };
487
482
  return t.sanitize = function(f) {
488
- let o = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, a = null, l = null, T = null, w = null;
489
- if (Yt = !f, Yt && (f = "<!-->"), typeof f != "string" && !De(f))
483
+ let o = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, a = null, l = null, T = null, R = null;
484
+ if (xt = !f, xt && (f = "<!-->"), typeof f != "string" && !Ee(f))
490
485
  if (typeof f.toString == "function") {
491
486
  if (f = f.toString(), typeof f != "string")
492
- throw pt("dirty is not a string, aborting");
487
+ throw st("dirty is not a string, aborting");
493
488
  } else
494
- throw pt("toString is not a function");
489
+ throw st("toString is not a function");
495
490
  if (!t.isSupported)
496
491
  return f;
497
- if ($t || Xt(o), t.removed = [], typeof f == "string" && (ct = !1), ct) {
492
+ if (wt || kt(o), t.removed = [], typeof f == "string" && (et = !1), et) {
498
493
  if (f.nodeName) {
499
- const W = A(f.nodeName);
500
- if (!_[W] || at[W])
501
- throw pt("root node is forbidden and cannot be sanitized in-place");
494
+ const z = A(f.nodeName);
495
+ if (!_[z] || tt[z])
496
+ throw st("root node is forbidden and cannot be sanitized in-place");
502
497
  }
503
- } else if (f instanceof u)
504
- a = Le("<!---->"), l = a.ownerDocument.importNode(f, !0), l.nodeType === mt.element && l.nodeName === "BODY" || l.nodeName === "HTML" ? a = l : a.appendChild(l);
498
+ } else if (f instanceof h)
499
+ a = de("<!---->"), l = a.ownerDocument.importNode(f, !0), l.nodeType === at.element && l.nodeName === "BODY" || l.nodeName === "HTML" ? a = l : a.appendChild(l);
505
500
  else {
506
- if (!J && !Z && !V && // eslint-disable-next-line unicorn/prefer-includes
501
+ if (!V && !Y && !W && // eslint-disable-next-line unicorn/prefer-includes
507
502
  f.indexOf("<") === -1)
508
- return O && St ? O.createHTML(f) : f;
509
- if (a = Le(f), !a)
510
- return J ? null : St ? rt : "";
503
+ return C && mt ? C.createHTML(f) : f;
504
+ if (a = de(f), !a)
505
+ return V ? null : mt ? Q : "";
511
506
  }
512
- a && Wt && x(a.firstChild);
513
- const g = Ne(ct ? f : a);
507
+ a && Lt && x(a.firstChild);
508
+ const g = Te(et ? f : a);
514
509
  for (; T = g.nextNode(); )
515
- Ie(T), xe(T), T.content instanceof r && Nn(T.content);
516
- if (ct)
510
+ ge(T), be(T), T.content instanceof r && fn(T.content);
511
+ if (et)
517
512
  return f;
518
- if (J) {
519
- if (bt)
520
- for (w = Tn.call(a.ownerDocument); a.firstChild; )
521
- w.appendChild(a.firstChild);
513
+ if (V) {
514
+ if (pt)
515
+ for (R = qe.call(a.ownerDocument); a.firstChild; )
516
+ R.appendChild(a.firstChild);
522
517
  else
523
- w = a;
524
- return (S.shadowroot || S.shadowrootmode) && (w = gn.call(n, w, !0)), w;
518
+ R = a;
519
+ return (S.shadowroot || S.shadowrootmode) && (R = Ze.call(n, R, !0)), R;
525
520
  }
526
- let D = V ? a.outerHTML : a.innerHTML;
527
- return V && _["!doctype"] && a.ownerDocument && a.ownerDocument.doctype && a.ownerDocument.doctype.name && M(Je, a.ownerDocument.doctype.name) && (D = "<!DOCTYPE " + a.ownerDocument.doctype.name + `>
528
- ` + D), Z && Ct([kt, Ft, Ut], (W) => {
529
- D = ut(D, W, " ");
530
- }), O && St ? O.createHTML(D) : D;
521
+ let L = W ? a.outerHTML : a.innerHTML;
522
+ return W && _["!doctype"] && a.ownerDocument && a.ownerDocument.doctype && a.ownerDocument.doctype.name && O(ve, a.ownerDocument.doctype.name) && (L = "<!DOCTYPE " + a.ownerDocument.doctype.name + `>
523
+ ` + L), Y && gt([Rt, Ct, Mt], (z) => {
524
+ L = it(L, z, " ");
525
+ }), C && mt ? C.createHTML(L) : L;
531
526
  }, t.setConfig = function() {
532
527
  let f = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
533
- Xt(f), $t = !0;
528
+ kt(f), wt = !0;
534
529
  }, t.clearConfig = function() {
535
- et = null, $t = !1;
530
+ K = null, wt = !1;
536
531
  }, t.isValidAttribute = function(f, o, a) {
537
- et || Xt({});
532
+ K || kt({});
538
533
  const l = A(f), T = A(o);
539
- return Pe(l, T, a);
534
+ return Ae(l, T, a);
540
535
  }, t.addHook = function(f, o) {
541
- typeof o == "function" && ft(C[f], o);
536
+ typeof o == "function" && ot(M[f], o);
542
537
  }, t.removeHook = function(f, o) {
543
538
  if (o !== void 0) {
544
- const a = vn(C[f], o);
545
- return a === -1 ? void 0 : xn(C[f], a, 1)[0];
539
+ const a = hn(M[f], o);
540
+ return a === -1 ? void 0 : dn(M[f], a, 1)[0];
546
541
  }
547
- return $e(C[f]);
542
+ return Ce(M[f]);
548
543
  }, t.removeHooks = function(f) {
549
- C[f] = [];
544
+ M[f] = [];
550
545
  }, t.removeAllHooks = function() {
551
- C = Ve();
546
+ M = De();
552
547
  }, t;
553
548
  }
554
- var tn = Qe();
555
- function Xe(i, t) {
556
- let e = i;
549
+ var Fe = ke();
550
+ function Ie(s, t) {
551
+ let e = s;
557
552
  for (const n of t.split("."))
558
553
  e = e[n];
559
554
  return e;
560
555
  }
561
- function Jn(i, t, e) {
562
- const n = t.split("."), s = n.length - 1;
563
- let r = i;
564
- n.forEach((c, u) => {
565
- u === s ? r[c] = e : r = r[c];
556
+ function In(s, t, e) {
557
+ const n = t.split("."), i = n.length - 1;
558
+ let r = s;
559
+ n.forEach((c, h) => {
560
+ h === i ? r[c] = e : r = r[c];
566
561
  });
567
562
  }
568
- function en(i, t, e = "") {
569
- const n = /* @__PURE__ */ new WeakMap(), s = {
570
- // Intercept property reads.
571
- // This creates nested proxies lazily.
572
- get(r, c) {
573
- const u = Reflect.get(r, c);
574
- if (u === null || typeof u != "object") return u;
575
- const p = n.get(u);
576
- if (p) return p;
577
- const h = e ? `${e}.${c}` : c, m = en(u, t, h);
578
- return n.set(u, m), m;
579
- },
580
- // Intercept property writes.
581
- set(r, c, u) {
582
- const p = Reflect.get(r, c);
583
- if (p !== u) {
584
- Reflect.set(r, c, u);
585
- const h = e ? `${e}.${c}` : c;
586
- t(h, p, u);
587
- }
588
- return !0;
589
- }
590
- };
591
- return new Proxy(i, s);
592
- }
593
- function nn(i) {
594
- const t = {};
595
- for (const [e, n] of Object.entries(i)) {
596
- const s = typeof n == "object" && n !== null;
597
- t[e] = s ? nn(n) : n;
598
- }
599
- return t;
600
- }
601
- const Dt = typeof window < "u" && typeof window.document < "u";
602
- let qe = class extends Error {
603
- };
604
- var q, Pt, F, Et, gt, Y, vt, on;
605
- const it = class it {
606
- constructor(t, e, n) {
607
- j(this, vt);
608
- j(this, Pt, /* @__PURE__ */ Symbol("objectId"));
609
- // This cannot be replaced by a WeakMap<ChangeListener, Set<string>>
610
- // because there is no way to iterate over the keys of a WeakMap.
611
- j(this, F, []);
612
- j(this, Et);
613
- j(this, gt);
614
- j(this, Y);
615
- if (!t) throw new qe("name cannot be empty");
616
- if (R(it, q).has(t))
617
- throw new qe(`WrecState with name "${t}" already exists`);
618
- if (ot(this, Et, t), ot(this, gt, e), ot(this, Y, en({}, He(this, vt, on).bind(this))), e && Dt) {
619
- const s = sessionStorage.getItem("wrec-state-" + t), r = s ? JSON.parse(s) : void 0;
620
- r && (n = r);
621
- }
622
- if (n)
623
- for (const [s, r] of Object.entries(n))
624
- this.addProperty(s, r);
625
- R(it, q).set(t, this);
626
- }
627
- // This static method is useful for accessing a specific WrecState object
628
- // from the DevTools console. For example:
629
- // state = WrecState.get('vault');
630
- //
631
- // WrecState object properties are accessed via nested Proxy objects
632
- // so all changes can be monitored.
633
- //
634
- // Properties can be directly modified as follows:
635
- // state.color = 'blue';
636
- // state.team.leader.name = 'Mark';
637
- static get(t) {
638
- return R(this, q).get(t);
639
- }
640
- /**
641
- * @param listener - object that has a "changed" method
642
- * @param map - map from state property paths to component properties
643
- */
644
- addListener(t, e = {}) {
645
- const n = R(this, F).find(
646
- (s) => s.listenerRef.deref() === t
647
- );
648
- if (n) {
649
- const { propertyMap: s } = n;
650
- for (const [r, c] of Object.entries(e))
651
- s[r] = c;
652
- } else
653
- R(this, F).push({
654
- listenerRef: new WeakRef(t),
655
- propertyMap: e
656
- });
657
- }
658
- addProperty(t, e) {
659
- Object.defineProperty(this, t, {
660
- enumerable: !0,
661
- get() {
662
- return R(this, Y)[t];
663
- },
664
- set(n) {
665
- R(this, Y)[t] = n;
666
- }
667
- }), R(this, Y)[t] = e;
668
- }
669
- get id() {
670
- return R(this, Pt);
671
- }
672
- // This is useful for debugging from the DevTools console.
673
- // For example: state.log()
674
- log() {
675
- console.log("WrecState:", R(this, Et));
676
- for (const [t, e] of Object.entries(R(this, Y)))
677
- console.log(` ${t} = ${JSON.stringify(e)}`);
678
- }
679
- removeListener(t) {
680
- ot(this, F, R(this, F).filter((e) => e.listenerRef.deref() !== t));
681
- }
682
- };
683
- q = new WeakMap(), Pt = new WeakMap(), F = new WeakMap(), Et = new WeakMap(), gt = new WeakMap(), Y = new WeakMap(), vt = new WeakSet(), on = function(t, e, n) {
684
- const s = /* @__PURE__ */ new Set();
685
- for (const r of R(this, F)) {
686
- const c = r.listenerRef.deref();
687
- if (!c)
688
- s.add(r);
689
- else if (Dt && c instanceof HTMLElement && !c.isConnected)
690
- s.add(r);
691
- else {
692
- const { propertyMap: u } = r, p = Object.keys(u);
693
- (p.length === 0 || p.includes(t)) && c.changed(
694
- t,
695
- u[t],
696
- n,
697
- e,
698
- this
699
- );
700
- }
701
- }
702
- ot(this, F, R(this, F).filter(
703
- (r) => !s.has(r)
704
- ));
705
- }, j(it, q, /* @__PURE__ */ new Map()), Dt && window.addEventListener("beforeunload", () => {
706
- for (const [t, e] of R(it, q).entries())
707
- if (R(e, gt)) {
708
- const n = nn(e);
709
- sessionStorage.setItem("wrec-state-" + t, JSON.stringify(n));
710
- }
711
- });
712
- let ue = it;
713
- Dt && process.env.NODE_ENV === "development" && (window.WrecState = ue);
714
- const Qn = /* @__PURE__ */ new Set([
563
+ const Pn = /* @__PURE__ */ new Set([
715
564
  "onblur",
716
565
  "onchange",
717
566
  "onclick",
@@ -721,100 +570,100 @@ const Qn = /* @__PURE__ */ new Set([
721
570
  "onreset",
722
571
  "onsubmit"
723
572
  ]);
724
- tn.addHook("uponSanitizeAttribute", (i, t) => {
573
+ Fe.addHook("uponSanitizeAttribute", (s, t) => {
725
574
  const { attrName: e } = t, n = e.toLowerCase();
726
- Qn.has(n) && (t.forceKeepAttr = !0);
575
+ Pn.has(n) && (t.forceKeepAttr = !0);
727
576
  });
728
- class st extends Error {
577
+ class J extends Error {
729
578
  }
730
- const to = /([a-zA-Z-]+)\s*:\s*([^;}]+)/g, sn = "a-zA-Z_$", eo = sn + "0-9", Tt = `[${sn}][${eo}]*`, no = /<!--\s*(.*?)\s*-->/, oo = /<(\w+)(?:\s[^>]*)?>((?:[^<]|<(?!\w))*?)<\/\1>/g, se = new RegExp(`^this\\.${Tt}$`), ie = new RegExp(`this\\.${Tt}(\\.${Tt})*`, "g"), rn = new RegExp(`this\\.${Tt}(\\.${Tt})*`), so = /* @__PURE__ */ new Set(["class", "style"]), an = 5;
731
- function io(i) {
732
- return i instanceof HTMLButtonElement || i instanceof HTMLFieldSetElement || i instanceof HTMLInputElement || i instanceof HTMLSelectElement || i instanceof HTMLTextAreaElement || i instanceof U;
579
+ const xn = /([a-zA-Z-]+)\s*:\s*([^;}]+)/g, Ue = "a-zA-Z_$", vn = Ue + "0-9", lt = `[${Ue}][${vn}]*`, kn = /<!--\s*(.*?)\s*-->/, Fn = /<(\w+)(?:\s[^>]*)?>((?:[^<]|<(?!\w))*?)<\/\1>/g, jt = new RegExp(`^this\\.${lt}$`), Yt = new RegExp(`this\\.${lt}(\\.${lt})*`, "g"), He = new RegExp(`this\\.${lt}(\\.${lt})*`), Un = /* @__PURE__ */ new Set(["class", "style"]), ze = 5;
580
+ function Hn(s) {
581
+ return s instanceof HTMLButtonElement || s instanceof HTMLFieldSetElement || s instanceof HTMLInputElement || s instanceof HTMLSelectElement || s instanceof HTMLTextAreaElement || s instanceof k;
733
582
  }
734
- function po(i, t, e) {
735
- const n = document.createElement(i);
583
+ function Bn(s, t, e) {
584
+ const n = document.createElement(s);
736
585
  if (t)
737
- for (const [s, r] of Object.entries(t))
738
- n.setAttribute(s, r);
586
+ for (const [i, r] of Object.entries(t))
587
+ n.setAttribute(i, r);
739
588
  return e && (n.innerHTML = e), n;
740
589
  }
741
- const ro = (i) => i === String ? "" : i === Number ? 0 : i === Boolean ? !1 : i === Array ? [] : i === Object ? {} : void 0;
742
- function It(i) {
590
+ const zn = (s) => s === String ? "" : s === Number ? 0 : s === Boolean ? !1 : s === Array ? [] : s === Object ? {} : void 0;
591
+ function St(s) {
743
592
  const t = [];
744
- let e = i.firstElementChild;
593
+ let e = s.firstElementChild;
745
594
  for (; e; )
746
- t.push(e), e.shadowRoot && t.push(...It(e.shadowRoot)), e.firstElementChild && t.push(...It(e)), e = e.nextElementSibling;
595
+ t.push(e), e.shadowRoot && t.push(...St(e.shadowRoot)), e.firstElementChild && t.push(...St(e)), e = e.nextElementSibling;
747
596
  return t;
748
597
  }
749
- const Lt = (i) => i.substring(an).split(".")[0];
750
- function cn(i, t) {
751
- let e = i[0];
752
- return t.forEach((n, s) => {
753
- e += n + i[s + 1];
598
+ const _t = (s) => s.substring(ze).split(".")[0];
599
+ function Ge(s, t) {
600
+ let e = s[0];
601
+ return t.forEach((n, i) => {
602
+ e += n + s[i + 1];
754
603
  }), e;
755
604
  }
756
- function pe(i) {
757
- const t = typeof i;
605
+ function Jt(s) {
606
+ const t = typeof s;
758
607
  return t === "string" || t === "number" || t === "boolean";
759
608
  }
760
- function dt(i) {
761
- return i.localName === "textarea";
609
+ function ct(s) {
610
+ return s.localName === "textarea";
762
611
  }
763
- function he(i) {
764
- const { localName: t } = i;
612
+ function Qt(s) {
613
+ const { localName: t } = s;
765
614
  return t === "input" || t === "select";
766
615
  }
767
- const ao = (i) => i.replace(/<!--[\s\S]*?-->/g, "");
768
- function ln(i, t, e, n) {
769
- return i.slice(0, t) + n + i.slice(t + e);
616
+ const Gn = (s) => s.replace(/<!--[\s\S]*?-->/g, "");
617
+ function $e(s, t, e, n) {
618
+ return s.slice(0, t) + n + s.slice(t + e);
770
619
  }
771
- function co(i) {
772
- let t = i.trim(), e = null;
620
+ function $n(s) {
621
+ let t = s.trim(), e = null;
773
622
  /^\s*<tr[\s>]/i.test(t) ? (t = `<table><tbody>${t}</tbody></table>`, e = "tbody") : /^\s*<(td|th)[\s>]/i.test(t) ? (t = `<table><tbody><tr>${t}</tr></tbody></table>`, e = "tr") : /^\s*<option[\s>]/i.test(t) ? (t = `<select>${t}</select>`, e = "select") : /^\s*<col[\s>]/i.test(t) && (t = `<table><colgroup>${t}</colgroup></table>`, e = "colgroup");
774
- const n = tn.sanitize(t, {
623
+ const n = Fe.sanitize(t, {
775
624
  ADD_TAGS: ["#comment"],
776
625
  ALLOW_UNKNOWN_PROTOCOLS: !0,
777
626
  RETURN_DOM_FRAGMENT: !0
778
627
  });
779
628
  if (e) {
780
- const s = n.querySelector(e);
781
- if (s) return s.childNodes;
629
+ const i = n.querySelector(e);
630
+ if (i) return i.childNodes;
782
631
  }
783
632
  return n.childNodes;
784
633
  }
785
- function re(i) {
786
- const t = Number(i);
787
- if (isNaN(t)) throw new st(`can't convert "${i}" to a number`);
634
+ function Vt(s) {
635
+ const t = Number(s);
636
+ if (isNaN(t)) throw new J(`can't convert "${s}" to a number`);
788
637
  return t;
789
638
  }
790
- function fn(i, t, e) {
791
- const [n, s] = t.split(":");
792
- if (pe(e))
639
+ function We(s, t, e) {
640
+ const [n, i] = t.split(":");
641
+ if (Jt(e))
793
642
  if (typeof e == "boolean") {
794
- e ? i.setAttribute(n, n) : i.removeAttribute(n);
795
- const r = U.getPropName(n);
796
- i[r] = e;
643
+ e ? s.setAttribute(n, n) : s.removeAttribute(n);
644
+ const r = k.getPropName(n);
645
+ s[r] = e;
797
646
  } else {
798
- const r = i.getAttribute(t), c = String(e);
799
- r !== c && (i.setAttribute(n, c), n === "value" && he(i) && (i.value = c));
647
+ const r = s.getAttribute(t), c = String(e);
648
+ r !== c && (s.setAttribute(n, c), n === "value" && Qt(s) && (s.value = c));
800
649
  }
801
650
  else {
802
- const r = U.getPropName(t);
803
- i[r] = e;
651
+ const r = k.getPropName(t);
652
+ s[r] = e;
804
653
  }
805
654
  }
806
- function ae(i, t, e) {
807
- const [n, s] = t.split(":");
808
- i instanceof CSSStyleRule ? i.style.setProperty(n, e) : (fn(i, n, e), n === "value" && he(i) && (i.value = e));
655
+ function Xt(s, t, e) {
656
+ const [n, i] = t.split(":");
657
+ s instanceof CSSStyleRule ? s.style.setProperty(n, e) : (We(s, n, e), n === "value" && Qt(s) && (s.value = e));
809
658
  }
810
- async function lo(i) {
659
+ async function Wn(s) {
811
660
  const t = /* @__PURE__ */ new Set();
812
- for (const n of It(i.content)) {
813
- const { localName: s } = n;
814
- s.includes("-") && t.add(s);
661
+ for (const n of St(s.content)) {
662
+ const { localName: i } = n;
663
+ i.includes("-") && t.add(i);
815
664
  }
816
665
  function e(n) {
817
- return new Promise((s, r) => {
666
+ return new Promise((i, r) => {
818
667
  setTimeout(() => {
819
668
  const c = `custom element <${n}> not defined`;
820
669
  r(new Error(c));
@@ -827,7 +676,7 @@ async function lo(i) {
827
676
  )
828
677
  );
829
678
  }
830
- class U extends HTMLElement {
679
+ class k extends HTMLElement {
831
680
  // There is one instance of `attrToPropMap`, `properties`, `propToAttrMap`,
832
681
  // `propToComputedMap`, and `propToExprsMap` per Wrec subclass,
833
682
  // not one for only the Wrec class.
@@ -871,7 +720,7 @@ class U extends HTMLElement {
871
720
  // Each component instance needs its own map.
872
721
  #n = /* @__PURE__ */ new Map();
873
722
  #c = {};
874
- #s;
723
+ #i;
875
724
  // For components that set `formAssociated` to true,
876
725
  // this stores in the initial value of each property
877
726
  // in the formAssociatedCallback method
@@ -888,7 +737,7 @@ class U extends HTMLElement {
888
737
  #u = /* @__PURE__ */ new Map();
889
738
  static define(t) {
890
739
  if (this.elementName = t, customElements.get(t))
891
- throw new st(`custom element ${t} is already defined`);
740
+ throw new J(`custom element ${t} is already defined`);
892
741
  customElements.define(t, this);
893
742
  }
894
743
  constructor() {
@@ -897,13 +746,13 @@ class U extends HTMLElement {
897
746
  t.attrToPropMap || (t.attrToPropMap = /* @__PURE__ */ new Map()), t.properties || (t.properties = {}), t.propToAttrMap || (t.propToExprsMap = /* @__PURE__ */ new Map()), t.propToComputedMap || (t.propToComputedMap = /* @__PURE__ */ new Map()), t.propToExprsMap || (t.propToExprsMap = /* @__PURE__ */ new Map());
898
747
  }
899
748
  attributeChangedCallback(t, e, n) {
900
- t === "disabled" && this.#h();
901
- const s = U.getPropName(t);
902
- if (this.#i(s)) {
903
- const r = this.#A(s, String(n));
904
- this[s] = r;
905
- const c = this.#c[s];
906
- c && this.setFormValue(c, String(r)), this.propertyChangedCallback(s, e, n);
749
+ t === "disabled" && this.#m();
750
+ const i = k.getPropName(t);
751
+ if (this.#s(i)) {
752
+ const r = this.#A(i, String(n));
753
+ this[i] = r;
754
+ const c = this.#c[i];
755
+ c && this.setFormValue(c, String(r)), this.propertyChangedCallback(i, e, n);
907
756
  }
908
757
  }
909
758
  async #S() {
@@ -915,62 +764,62 @@ class U extends HTMLElement {
915
764
  :host([hidden]) { display: none; }`;
916
765
  t.css && (n += t.css), n += `</style>
917
766
  `;
918
- let s = t.html.trim();
919
- if (!s) throw new st("static property html must be set");
920
- s.startsWith("<") || (s = `<span><!--${s}--></span>`), e.innerHTML = n + s;
767
+ let i = t.html.trim();
768
+ if (!i) throw new J("static property html must be set");
769
+ i.startsWith("<") || (i = `<span><!--${i}--></span>`), e.innerHTML = n + i;
921
770
  }
922
- await lo(e), this.shadowRoot.replaceChildren(e.content.cloneNode(!0));
771
+ await Wn(e), this.shadowRoot.replaceChildren(e.content.cloneNode(!0));
923
772
  }
924
773
  changed(t, e, n) {
925
774
  this[e] = n;
926
775
  }
927
776
  connectedCallback() {
928
777
  this.#P(), this.#R(), this.#S().then(() => {
929
- this.hasAttribute("disabled") && this.#h(), this.#b(this.shadowRoot), this.#m(this.shadowRoot), this.#y();
778
+ this.hasAttribute("disabled") && this.#m(), this.#b(this.shadowRoot), this.#h(this.shadowRoot), this.#y();
930
779
  });
931
780
  }
932
781
  #y() {
933
782
  const t = this.#t, { properties: e } = t;
934
- for (const [n, { computed: s }] of Object.entries(e))
935
- s && (this[n] = this.#o(s));
783
+ for (const [n, { computed: i }] of Object.entries(e))
784
+ i && (this[n] = this.#o(i));
936
785
  }
937
786
  #R() {
938
787
  const t = this.#t, { observedAttributes: e, properties: n } = t;
939
- for (const [s, r] of Object.entries(n))
940
- this.#w(s, r, e);
788
+ for (const [i, r] of Object.entries(n))
789
+ this.#C(i, r, e);
941
790
  }
942
- #w(t, e, n) {
943
- const s = U.getAttrName(t), r = this.hasAttribute(s);
791
+ #C(t, e, n) {
792
+ const i = k.getAttrName(t), r = this.hasAttribute(i);
944
793
  e.required && !r && this.#e(this, t, "is a required attribute");
945
794
  let c = e.value;
946
795
  this.hasOwnProperty(t) && (c = this[t], delete this[t]);
947
- const { type: u } = e, p = u === Boolean ? c || r : n.includes(s) && r ? this.#g(t, s) : c || ro(u), h = "#" + t;
948
- this[h] = p, e.computed && this.#L(t, e), Object.defineProperty(this, t, {
796
+ const { type: h } = e, u = h === Boolean ? c || r : n.includes(i) && r ? this.#g(t, i) : c || zn(h), p = "#" + t;
797
+ this[p] = u, e.computed && this.#w(t, e), Object.defineProperty(this, t, {
949
798
  enumerable: !0,
950
799
  get() {
951
- return this[h];
800
+ return this[p];
952
801
  },
953
- set(m) {
954
- u === Number && typeof m == "string" && (m = re(m));
955
- const b = this[h];
956
- if (m === b) return;
957
- this.#x(t, u, m), this[h] = m;
958
- const { state: G, stateProp: H } = this.#t.properties[t];
959
- H && Jn(G, H, m), this.#D(t), this.#N(t, u, m, s), this.#E(t), this.#I(t, m);
960
- const B = this.#c[t];
961
- B && this.setFormValue(B, String(m)), this.propertyChangedCallback(t, b, m), e.dispatch && this.dispatch("change", {
802
+ set(d) {
803
+ h === Number && typeof d == "string" && (d = Vt(d));
804
+ const b = this[p];
805
+ if (d === b) return;
806
+ this.#v(t, h, d), this[p] = d;
807
+ const { state: G, stateProp: F } = this.#t.properties[t];
808
+ F && In(G, F, d), this.#D(t), this.#L(t, h, d, i), this.#E(t), this.#I(t, d);
809
+ const $ = this.#c[t];
810
+ $ && this.setFormValue($, String(d)), this.propertyChangedCallback(t, b, d), e.dispatch && this.dispatch("change", {
962
811
  tagName: this.localName,
963
812
  property: t,
964
813
  oldValue: b,
965
- value: m
814
+ value: d
966
815
  });
967
816
  }
968
817
  });
969
818
  }
970
- #h() {
971
- const t = this.hasAttribute("disabled"), e = It(this.shadowRoot);
819
+ #m() {
820
+ const t = this.hasAttribute("disabled"), e = St(this.shadowRoot);
972
821
  for (const n of e)
973
- io(n) && (n.disabled = t);
822
+ Hn(n) && (n.disabled = t);
974
823
  }
975
824
  disconnectedCallback() {
976
825
  this.#n.clear(), this.#l.clear(), this.#u.clear();
@@ -989,54 +838,54 @@ class U extends HTMLElement {
989
838
  displayIfSet(t, e = "block") {
990
839
  return `display: ${t ? e : "none"}`;
991
840
  }
992
- #O(t) {
993
- const e = t instanceof U;
841
+ #M(t) {
842
+ const e = t instanceof k;
994
843
  for (const n of t.getAttributeNames()) {
995
- const s = t.getAttribute(n), r = this.#T(t, s);
844
+ const i = t.getAttribute(n), r = this.#T(t, i);
996
845
  if (r) {
997
846
  const c = this[r];
998
847
  c === void 0 && this.#a(t, n, r), t[r] = c;
999
- let [u, p] = n.split(":");
1000
- u === "value" && (p ? (t["on" + p] === void 0 && this.#e(t, n, "refers to an unsupported event name"), t.setAttribute(u, this[r])) : p = "change"), e && t.#u.set(
1001
- U.getPropName(u),
848
+ let [h, u] = n.split(":");
849
+ h === "value" && (u ? (t["on" + u] === void 0 && this.#e(t, n, "refers to an unsupported event name"), t.setAttribute(h, this[r])) : u = "change"), e && t.#u.set(
850
+ k.getPropName(h),
1002
851
  r
1003
852
  );
1004
853
  }
1005
- this.#r(s, t, n);
854
+ this.#r(i, t, n);
1006
855
  }
1007
856
  }
1008
857
  #o(t) {
1009
858
  const e = new Function("return " + t).call(this);
1010
859
  return Array.isArray(e) ? e.join("") : e;
1011
860
  }
1012
- #C(t) {
861
+ #O(t) {
1013
862
  const { localName: e } = t;
1014
863
  if (e === "style") {
1015
- const { sheet: n } = t, s = n?.cssRules ?? [], r = Array.from(s);
864
+ const { sheet: n } = t, i = n?.cssRules ?? [], r = Array.from(i);
1016
865
  for (const c of r)
1017
866
  if (c.constructor === CSSStyleRule) {
1018
- const u = Array.from(c.style);
1019
- for (const p of u)
1020
- if (p.startsWith("--")) {
1021
- const h = c.style.getPropertyValue(p);
1022
- this.#r(h, c, p);
867
+ const h = Array.from(c.style);
868
+ for (const u of h)
869
+ if (u.startsWith("--")) {
870
+ const p = c.style.getPropertyValue(u);
871
+ this.#r(p, c, u);
1023
872
  }
1024
873
  }
1025
874
  } else {
1026
875
  let n = "";
1027
- if (dt(t)) {
876
+ if (ct(t)) {
1028
877
  this.#r(t.textContent, t);
1029
- const s = t.textContent?.match(no);
1030
- s && (n = s[1]);
878
+ const i = t.textContent?.match(kn);
879
+ i && (n = i[1]);
1031
880
  } else {
1032
- const s = Array.from(t.childNodes).find(
881
+ const i = Array.from(t.childNodes).find(
1033
882
  (r) => r.nodeType === Node.COMMENT_NODE
1034
883
  );
1035
- s && (n = s.textContent?.trim() ?? "");
884
+ i && (n = i.textContent?.trim() ?? "");
1036
885
  }
1037
886
  if (n) {
1038
- const s = this.#T(t, n);
1039
- s && dt(t) ? t.textContent = this[s] : this.#r(n, t);
887
+ const i = this.#T(t, n);
888
+ i && ct(t) ? t.textContent = this[i] : this.#r(n, t);
1040
889
  }
1041
890
  }
1042
891
  }
@@ -1049,7 +898,7 @@ class U extends HTMLElement {
1049
898
  if (!t) {
1050
899
  const c = this.getAttribute("name");
1051
900
  if (c)
1052
- if (this.#i("value"))
901
+ if (this.#s("value"))
1053
902
  t = `value:${c}`;
1054
903
  else
1055
904
  return;
@@ -1058,19 +907,19 @@ class U extends HTMLElement {
1058
907
  }
1059
908
  const e = {}, n = t.split(",");
1060
909
  for (const c of n) {
1061
- const [u, p] = c.split(":");
1062
- e[u.trim()] = p.trim();
910
+ const [h, u] = c.split(":");
911
+ e[h.trim()] = u.trim();
1063
912
  }
1064
- this.#c = e, this.#s = new FormData(), this.#f = this.attachInternals(), this.#f.setFormValue(this.#s);
1065
- const s = Object.keys(this.#t.properties), r = this.#l;
1066
- for (const c of s)
913
+ this.#c = e, this.#i = new FormData(), this.#f = this.attachInternals(), this.#f.setFormValue(this.#i);
914
+ const i = Object.keys(this.#t.properties), r = this.#l;
915
+ for (const c of i)
1067
916
  r[c] = this[c];
1068
917
  }
1069
918
  formResetCallback() {
1070
919
  const t = this.#l;
1071
920
  for (const e of Object.keys(t)) {
1072
921
  let n = t[e];
1073
- se.test(n) && (n = this.#o(n)), this[e] = n;
922
+ jt.test(n) && (n = this.#o(n)), this[e] = n;
1074
923
  }
1075
924
  }
1076
925
  static getAttrName(t) {
@@ -1079,43 +928,43 @@ class U extends HTMLElement {
1079
928
  }
1080
929
  static getPropName(t) {
1081
930
  let e = this.attrToPropMap.get(t);
1082
- return e || (e = t.replace(/-([a-z])/g, (n, s) => s.toUpperCase()), this.attrToPropMap.set(t, e)), e;
931
+ return e || (e = t.replace(/-([a-z])/g, (n, i) => i.toUpperCase()), this.attrToPropMap.set(t, e)), e;
1083
932
  }
1084
- #M(t, e, n) {
933
+ #N(t, e, n) {
1085
934
  if (n.length !== 1) return;
1086
- const [s] = n;
1087
- if (!se.test(s)) return;
1088
- const r = he(t) || dt(t);
1089
- let [c, u] = (e ?? "").split(":");
1090
- if (!(r && c === "value" || dt(t))) return;
1091
- u ? t["on" + u] === void 0 && this.#e(t, e, "refers to an unsupported event name") : u = "change";
1092
- const h = Lt(s);
1093
- t.addEventListener(u, (m) => {
1094
- const { target: b } = m;
935
+ const [i] = n;
936
+ if (!jt.test(i)) return;
937
+ const r = Qt(t) || ct(t);
938
+ let [c, h] = (e ?? "").split(":");
939
+ if (!(r && c === "value" || ct(t))) return;
940
+ h ? t["on" + h] === void 0 && this.#e(t, e, "refers to an unsupported event name") : h = "change";
941
+ const p = _t(i);
942
+ t.addEventListener(h, (d) => {
943
+ const { target: b } = d;
1095
944
  if (!b) return;
1096
- const G = b.value, { type: H } = this.#t.properties[h];
1097
- this[h] = H === Number ? re(G) : G, this.#E(h);
945
+ const G = b.value, { type: F } = this.#t.properties[p];
946
+ this[p] = F === Number ? Vt(G) : G, this.#E(p);
1098
947
  });
1099
948
  }
1100
- #i(t) {
949
+ #s(t) {
1101
950
  return !!this.#t.properties[t];
1102
951
  }
1103
- #m(t) {
952
+ #h(t) {
1104
953
  const e = Array.from(t.querySelectorAll("*"));
1105
954
  for (const n of e)
1106
- this.#O(n), n.firstElementChild || this.#C(n);
955
+ this.#M(n), n.firstElementChild || this.#O(n);
1107
956
  }
1108
957
  // formAssociated is only needed when the component is inside a form.
1109
958
  #d() {
1110
959
  if (this.#t.formAssociated || this.closest("form") === null) return;
1111
960
  const t = this.#t.name;
1112
- throw new st(
961
+ throw new J(
1113
962
  `inside form, class ${t} requires "static formAssociated = true;"`
1114
963
  );
1115
964
  }
1116
965
  static get observedAttributes() {
1117
966
  const t = Object.keys(this.properties || {}).map(
1118
- (e) => U.getAttrName(e)
967
+ (e) => k.getAttrName(e)
1119
968
  );
1120
969
  return t.includes("disabled") || t.push("disabled"), t;
1121
970
  }
@@ -1123,69 +972,69 @@ class U extends HTMLElement {
1123
972
  propertyChangedCallback(t, e, n) {
1124
973
  }
1125
974
  #T(t, e) {
1126
- if (!e || !se.test(e)) return;
1127
- const n = Lt(e);
975
+ if (!e || !jt.test(e)) return;
976
+ const n = _t(e);
1128
977
  return this[n] === void 0 && this.#a(t, "", n), n;
1129
978
  }
1130
979
  #E(t) {
1131
- const s = this.#t.propToExprsMap.get(t) || [];
1132
- for (const r of s) {
980
+ const i = this.#t.propToExprsMap.get(t) || [];
981
+ for (const r of i) {
1133
982
  let c = this.#o(r);
1134
- const u = this.#n.get(r) ?? [];
1135
- for (const p of u)
1136
- if (p instanceof HTMLElement)
1137
- this.#_(p, c);
1138
- else if (!(p instanceof CSSStyleRule)) {
1139
- const { element: h, attrName: m } = p;
1140
- h instanceof CSSStyleRule ? h.style.setProperty(m, c) : ae(h, m, c);
983
+ const h = this.#n.get(r) ?? [];
984
+ for (const u of h)
985
+ if (u instanceof HTMLElement)
986
+ this.#_(u, c);
987
+ else if (!(u instanceof CSSStyleRule)) {
988
+ const { element: p, attrName: d } = u;
989
+ p instanceof CSSStyleRule ? p.style.setProperty(d, c) : Xt(p, d, c);
1141
990
  }
1142
991
  }
1143
992
  }
1144
- #L(t, e) {
1145
- const { computed: n, uses: s } = e, r = this.#t.propToComputedMap;
1146
- function c(p, h) {
1147
- let m = r.get(p);
1148
- m || (m = [], r.set(p, m)), m.push([t, h]);
993
+ #w(t, e) {
994
+ const { computed: n, uses: i } = e, r = this.#t.propToComputedMap;
995
+ function c(u, p) {
996
+ let d = r.get(u);
997
+ d || (d = [], r.set(u, d)), d.push([t, p]);
1149
998
  }
1150
- const u = n.match(ie) || [];
1151
- for (const p of u) {
1152
- const h = p.substring(an);
1153
- this[h] === void 0 && this.#a(null, t, h), typeof this[h] != "function" && c(h, n);
999
+ const h = n.match(Yt) || [];
1000
+ for (const u of h) {
1001
+ const p = u.substring(ze);
1002
+ this[p] === void 0 && this.#a(null, t, p), typeof this[p] != "function" && c(p, n);
1154
1003
  }
1155
- if (s)
1156
- for (const p of s.split(","))
1157
- c(p, n);
1004
+ if (i)
1005
+ for (const u of i.split(","))
1006
+ c(u, n);
1158
1007
  }
1159
1008
  // WARNING: Do not place untrusted JavaScript expressions
1160
1009
  // in attribute values or the text content of elements!
1161
1010
  #r(t, e, n = void 0) {
1162
1011
  if (!t) return;
1163
- const s = this.#p(e, n, t);
1164
- if (!s) {
1165
- const p = t.replaceAll("this..", "this.");
1166
- n ? ae(e, n, p) : "textContent" in e && (e.textContent = p);
1012
+ const i = this.#p(e, n, t);
1013
+ if (!i) {
1014
+ const u = t.replaceAll("this..", "this.");
1015
+ n ? Xt(e, n, u) : "textContent" in e && (e.textContent = u);
1167
1016
  return;
1168
1017
  }
1169
1018
  const r = this.#t;
1170
- s.forEach((p) => {
1171
- const h = Lt(p);
1172
- if (typeof this[h] == "function") return;
1173
- const m = r.propToExprsMap;
1174
- let b = m.get(h);
1175
- b || (b = [], m.set(h, b)), b.includes(t) || b.push(t);
1019
+ i.forEach((u) => {
1020
+ const p = _t(u);
1021
+ if (typeof this[p] == "function") return;
1022
+ const d = r.propToExprsMap;
1023
+ let b = d.get(p);
1024
+ b || (b = [], d.set(p, b)), b.includes(t) || b.push(t);
1176
1025
  });
1177
- for (const [p, h] of this.#n.entries())
1178
- for (const m of h) {
1179
- const b = m instanceof HTMLElement || m instanceof CSSStyleRule ? m : m.element;
1026
+ for (const [u, p] of this.#n.entries())
1027
+ for (const d of p) {
1028
+ const b = d instanceof HTMLElement || d instanceof CSSStyleRule ? d : d.element;
1180
1029
  b instanceof CSSStyleRule || b.isConnected || this.#n.set(
1181
- p,
1182
- h.filter((G) => G !== m)
1030
+ u,
1031
+ p.filter((G) => G !== d)
1183
1032
  );
1184
1033
  }
1185
1034
  let c = this.#n.get(t);
1186
- c || (c = [], this.#n.set(t, c)), c.push(n ? { element: e, attrName: n } : e), e instanceof HTMLElement && this.#M(e, n, s);
1187
- const u = this.#o(t);
1188
- n ? ae(e, n, u) : this.#_(e, u);
1035
+ c || (c = [], this.#n.set(t, c)), c.push(n ? { element: e, attrName: n } : e), e instanceof HTMLElement && this.#N(e, n, i);
1036
+ const h = this.#o(t);
1037
+ n ? Xt(e, n, h) : this.#_(e, h);
1189
1038
  }
1190
1039
  // This follows the best practice
1191
1040
  // "Do not override author-set, global attributes."
@@ -1193,12 +1042,12 @@ class U extends HTMLElement {
1193
1042
  this.hasAttribute(t) || this.setAttribute(t, e);
1194
1043
  }
1195
1044
  setFormValue(t, e) {
1196
- !this.#s || !pe(e) || (this.#s.set(t, e), this.#f?.setFormValue(this.#s));
1045
+ !this.#i || !Jt(e) || (this.#i.set(t, e), this.#f?.setFormValue(this.#i));
1197
1046
  }
1198
1047
  #e(t, e, n) {
1199
- const s = t instanceof HTMLElement ? t.localName : "CSS rule";
1200
- throw new st(
1201
- `component ${this.#t.elementName}` + (t ? `, element "${s}"` : "") + (e ? `, attribute "${e}"` : "") + ` ${n}`
1048
+ const i = t instanceof HTMLElement ? t.localName : "CSS rule";
1049
+ throw new J(
1050
+ `component ${this.#t.elementName}` + (t ? `, element "${i}"` : "") + (e ? `, attribute "${e}"` : "") + ` ${n}`
1202
1051
  );
1203
1052
  }
1204
1053
  #a(t, e, n) {
@@ -1208,11 +1057,11 @@ class U extends HTMLElement {
1208
1057
  return this.#A(t, this.getAttribute(e));
1209
1058
  }
1210
1059
  #A(t, e) {
1211
- if (e?.match(ie)) return e;
1212
- const n = this.#t, { type: s } = n.properties[t];
1213
- if (s || this.#e(null, t, "does not specify its type"), s === String) return e;
1214
- if (s === Number) return re(e);
1215
- if (s === Boolean)
1060
+ if (e?.match(Yt)) return e;
1061
+ const n = this.#t, { type: i } = n.properties[t];
1062
+ if (i || this.#e(null, t, "does not specify its type"), i === String) return e;
1063
+ if (i === Number) return Vt(e);
1064
+ if (i === Boolean)
1216
1065
  return e === "true" ? !0 : e === "false" || e === "null" ? !1 : (e && e !== t && this.#e(
1217
1066
  null,
1218
1067
  t,
@@ -1221,31 +1070,31 @@ class U extends HTMLElement {
1221
1070
  }
1222
1071
  // Updates the matching attribute for a property if there is one.
1223
1072
  // VS Code thinks this is never called, but it is called by #defineProp.
1224
- #N(t, e, n, s) {
1225
- if (pe(n) && this.hasAttribute(s)) {
1226
- const r = e === Boolean ? this.hasAttribute(s) : this.#g(t, s);
1227
- n !== r && fn(this, t, n);
1073
+ #L(t, e, n, i) {
1074
+ if (Jt(n) && this.hasAttribute(i)) {
1075
+ const r = e === Boolean ? this.hasAttribute(i) : this.#g(t, i);
1076
+ n !== r && We(this, t, n);
1228
1077
  }
1229
1078
  }
1230
1079
  // Updates all computed properties that reference this property.
1231
1080
  // VS Code thinks this is never called, but it is called by #defineProp.
1232
1081
  #D(t) {
1233
1082
  const n = this.#t.propToComputedMap.get(t) || [];
1234
- for (const [s, r] of n)
1235
- this[s] = this.#o(r);
1083
+ for (const [i, r] of n)
1084
+ this[i] = this.#o(r);
1236
1085
  }
1237
1086
  #_(t, e) {
1238
1087
  if (e === void 0) return;
1239
- const n = t instanceof HTMLElement, s = typeof e;
1240
- if (s !== "string" && s !== "number" && this.#e(
1088
+ const n = t instanceof HTMLElement, i = typeof e;
1089
+ if (i !== "string" && i !== "number" && this.#e(
1241
1090
  t,
1242
1091
  void 0,
1243
1092
  " computed content is not a string or number"
1244
- ), t instanceof HTMLElement && dt(t))
1093
+ ), t instanceof HTMLElement && ct(t))
1245
1094
  t.value = e;
1246
- else if (n && s === "string" && e.trim().startsWith("<")) {
1247
- const r = co(e);
1248
- t.replaceChildren(...r), this.#b(t), this.#m(t);
1095
+ else if (n && i === "string" && e.trim().startsWith("<")) {
1096
+ const r = $n(e);
1097
+ t.replaceChildren(...r), this.#b(t), this.#h(t);
1249
1098
  } else n && (t.textContent = e);
1250
1099
  }
1251
1100
  // Update corresponding parent web component property if bound to one.
@@ -1253,9 +1102,9 @@ class U extends HTMLElement {
1253
1102
  #I(t, e) {
1254
1103
  const n = this.#u.get(t);
1255
1104
  if (!n) return;
1256
- const s = this.getRootNode();
1257
- if (!(s instanceof ShadowRoot)) return;
1258
- const { host: r } = s;
1105
+ const i = this.getRootNode();
1106
+ if (!(i instanceof ShadowRoot)) return;
1107
+ const { host: r } = i;
1259
1108
  if (!r) return;
1260
1109
  const c = r;
1261
1110
  c[n] = e;
@@ -1271,12 +1120,12 @@ class U extends HTMLElement {
1271
1120
  for (const n of Object.keys(t))
1272
1121
  e[n] = n;
1273
1122
  }
1274
- this.#v(t, e);
1275
- for (const [n, s] of Object.entries(e))
1276
- if (this.#i(s)) {
1277
- const r = Xe(t, n);
1278
- r !== void 0 && (this[s] = r);
1279
- const c = this.#t.properties[s];
1123
+ this.#x(t, e);
1124
+ for (const [n, i] of Object.entries(e))
1125
+ if (this.#s(i)) {
1126
+ const r = Ie(t, n);
1127
+ r !== void 0 && (this[i] = r);
1128
+ const c = this.#t.properties[i];
1280
1129
  c.state = t, c.stateProp = n;
1281
1130
  }
1282
1131
  t.addListener(this, e);
@@ -1284,7 +1133,7 @@ class U extends HTMLElement {
1284
1133
  #P() {
1285
1134
  const t = this.#t, e = new Set(Object.keys(t.properties));
1286
1135
  for (const n of e)
1287
- so.has(n) && this.#e(
1136
+ Un.has(n) && this.#e(
1288
1137
  null,
1289
1138
  "",
1290
1139
  `property "${n}" is not allowed because it is a reserved attribute`
@@ -1295,7 +1144,7 @@ class U extends HTMLElement {
1295
1144
  this.#d();
1296
1145
  continue;
1297
1146
  }
1298
- if (!e.has(U.getPropName(n))) {
1147
+ if (!e.has(k.getPropName(n))) {
1299
1148
  if (n === "name") {
1300
1149
  this.#d();
1301
1150
  continue;
@@ -1305,98 +1154,97 @@ class U extends HTMLElement {
1305
1154
  }
1306
1155
  }
1307
1156
  #p(t, e, n) {
1308
- const s = n.match(ie);
1309
- if (s)
1310
- return s.forEach((r) => {
1311
- const c = Lt(r);
1157
+ const i = n.match(Yt);
1158
+ if (i)
1159
+ return i.forEach((r) => {
1160
+ const c = _t(r);
1312
1161
  this[c] === void 0 && this.#a(t, e, c);
1313
- }), s;
1162
+ }), i;
1314
1163
  }
1315
- #v(t, e) {
1316
- for (const [n, s] of Object.entries(e)) {
1317
- let r = Xe(t, n);
1164
+ #x(t, e) {
1165
+ for (const [n, i] of Object.entries(e)) {
1166
+ let r = Ie(t, n);
1318
1167
  if (r === void 0)
1319
- throw new st(`invalid state path "${n}"`);
1320
- r = this[s], this.#i(s) || this.#e(
1168
+ throw new J(`invalid state path "${n}"`);
1169
+ r = this[i], this.#s(i) || this.#e(
1321
1170
  null,
1322
- s,
1171
+ i,
1323
1172
  "refers to missing property in useState map"
1324
1173
  );
1325
1174
  }
1326
1175
  }
1327
1176
  // When type is an array, this can't validate the type of the array elements.
1328
1177
  // This is called by #defineProp.
1329
- #x(t, e, n) {
1178
+ #v(t, e, n) {
1330
1179
  if (n instanceof e) return;
1331
- let s = typeof n;
1332
- if (s === "object") {
1180
+ let i = typeof n;
1181
+ if (i === "object") {
1333
1182
  const { constructor: r } = n;
1334
- s = r.name, r !== e && this.#e(
1183
+ i = r.name, r !== e && this.#e(
1335
1184
  null,
1336
1185
  t,
1337
- `was set to a ${s}, but must be a ${e.name}`
1186
+ `was set to a ${i}, but must be a ${e.name}`
1338
1187
  );
1339
1188
  }
1340
- s !== e.name.toLowerCase() && this.#e(
1189
+ i !== e.name.toLowerCase() && this.#e(
1341
1190
  null,
1342
1191
  t,
1343
- `was set to a ${s}, but must be a ${e.name}`
1192
+ `was set to a ${i}, but must be a ${e.name}`
1344
1193
  );
1345
1194
  }
1346
1195
  #b(t) {
1347
1196
  const e = Array.from(t.querySelectorAll("*"));
1348
1197
  for (const n of e) {
1349
- const s = [];
1198
+ const i = [];
1350
1199
  for (const r of Array.from(n.attributes)) {
1351
1200
  const c = r.name;
1352
1201
  if (c.startsWith("on")) {
1353
- let u = c.slice(2);
1354
- u = u[0].toLowerCase() + u.slice(1).toLowerCase();
1355
- const p = r.value;
1356
- this.#p(n, c, p);
1357
- let h;
1358
- typeof this[p] == "function" ? h = (m) => this[p](m) : (this.#p(n, c, p), h = () => this.#o(p)), n.addEventListener(u, h), s.push(c);
1202
+ let h = c.slice(2);
1203
+ h = h[0].toLowerCase() + h.slice(1).toLowerCase();
1204
+ const u = r.value;
1205
+ this.#p(n, c, u);
1206
+ let p;
1207
+ typeof this[u] == "function" ? p = (d) => this[u](d) : (this.#p(n, c, u), p = () => this.#o(u)), n.addEventListener(h, p), i.push(c);
1359
1208
  }
1360
1209
  }
1361
- for (const r of s)
1210
+ for (const r of i)
1362
1211
  n.removeAttribute(r);
1363
1212
  }
1364
1213
  }
1365
1214
  }
1366
- function ho(i, ...t) {
1367
- let e = cn(i, t);
1215
+ function jn(s, ...t) {
1216
+ let e = Ge(s, t);
1368
1217
  for (; ; ) {
1369
- const n = to.exec(e);
1218
+ const n = xn.exec(e);
1370
1219
  if (!n) break;
1371
- const s = n[2];
1372
- if (rn.test(s)) {
1220
+ const i = n[2];
1221
+ if (He.test(i)) {
1373
1222
  const r = n[1];
1374
1223
  if (!r.startsWith("--")) {
1375
- const c = `--${r}: ${s};
1224
+ const c = `--${r}: ${i};
1376
1225
  ${r}: var(--${r})`;
1377
- e = ln(e, n.index, n[0].length, c);
1226
+ e = $e(e, n.index, n[0].length, c);
1378
1227
  }
1379
1228
  }
1380
1229
  }
1381
1230
  return e;
1382
1231
  }
1383
- function mo(i, ...t) {
1384
- let e = cn(i, t);
1232
+ function Yn(s, ...t) {
1233
+ let e = Ge(s, t);
1385
1234
  for (; ; ) {
1386
- const n = oo.exec(e);
1235
+ const n = Fn.exec(e);
1387
1236
  if (!n || n[1] === "style") break;
1388
- const s = ao(n[2]);
1389
- if (rn.test(s)) {
1390
- const r = `<!-- ${s.trim()} -->`, c = n.index + n[0].indexOf(">") + 1;
1391
- e = ln(e, c, s.length, r);
1237
+ const i = Gn(n[2]);
1238
+ if (He.test(i)) {
1239
+ const r = `<!-- ${i.trim()} -->`, c = n.index + n[0].indexOf(">") + 1;
1240
+ e = $e(e, c, i.length, r);
1392
1241
  }
1393
1242
  }
1394
1243
  return e;
1395
1244
  }
1396
1245
  export {
1397
- U as Wrec,
1398
- ue as WrecState,
1399
- po as createElement,
1400
- ho as css,
1401
- mo as html
1246
+ k as Wrec,
1247
+ Bn as createElement,
1248
+ jn as css,
1249
+ Yn as html
1402
1250
  };