@nysds/nys-icon 1.19.3 → 1.19.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/nys-icon.js
CHANGED
|
@@ -1,213 +1,213 @@
|
|
|
1
|
-
import { LitElement as
|
|
2
|
-
import { property as
|
|
1
|
+
import { LitElement as Bn, unsafeCSS as Wn, html as Yn } from "lit";
|
|
2
|
+
import { property as nt, state as jn } from "lit/decorators.js";
|
|
3
3
|
/*!
|
|
4
4
|
* █▄ █ █ █ █▀▀▀█ █▀▀▄ █▀▀▀█
|
|
5
5
|
* █ █ █ █▄▄▄█ ▀▀▀▄▄ █ █ ▀▀▀▄▄
|
|
6
6
|
* █ ▀█ █ █▄▄▄█ █▄▄▀ █▄▄▄█
|
|
7
7
|
*
|
|
8
|
-
* Icon Component v1.19.
|
|
8
|
+
* Icon Component v1.19.4
|
|
9
9
|
* Part of the New York State Design System
|
|
10
10
|
* Repository: https://github.com/its-hcd/nysds
|
|
11
11
|
* License: MIT
|
|
12
12
|
*/
|
|
13
|
-
const
|
|
14
|
-
let
|
|
15
|
-
async function
|
|
16
|
-
return
|
|
17
|
-
(o) =>
|
|
18
|
-
),
|
|
13
|
+
const Ot = globalThis.__nysIconRegistry ??= /* @__PURE__ */ new Map(), mt = globalThis.__nysIconWatchers ??= /* @__PURE__ */ new Map();
|
|
14
|
+
let ie = null, Be = null;
|
|
15
|
+
async function $n() {
|
|
16
|
+
return ie || (Be ??= import("./nys-icon.library-3w_7rLli.js").then(
|
|
17
|
+
(o) => ie = o.default
|
|
18
|
+
), Be);
|
|
19
19
|
}
|
|
20
|
-
function
|
|
21
|
-
if (globalThis.__nysIconDefaultRegistered ||
|
|
20
|
+
function Xn() {
|
|
21
|
+
if (globalThis.__nysIconDefaultRegistered || Ot.has("default")) {
|
|
22
22
|
globalThis.__nysIconDefaultRegistered = !0;
|
|
23
23
|
return;
|
|
24
24
|
}
|
|
25
|
-
globalThis.__nysIconDefaultRegistered = !0,
|
|
25
|
+
globalThis.__nysIconDefaultRegistered = !0, Ot.set("default", {
|
|
26
26
|
resolver: async (o) => {
|
|
27
27
|
if (!o) return;
|
|
28
|
-
const s = (await
|
|
28
|
+
const s = (await $n())[o];
|
|
29
29
|
return s ? { type: "svg", content: s } : void 0;
|
|
30
30
|
}
|
|
31
31
|
});
|
|
32
32
|
}
|
|
33
|
-
function
|
|
34
|
-
|
|
33
|
+
function ko(o, n) {
|
|
34
|
+
Ot.set(o, n), mt.get(o)?.forEach((s) => s.redraw());
|
|
35
35
|
}
|
|
36
|
-
function
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
function $n(o) {
|
|
40
|
-
return jn(), bt.get(o);
|
|
36
|
+
function zo(o) {
|
|
37
|
+
Ot.delete(o), mt.get(o)?.forEach((n) => n.redraw());
|
|
41
38
|
}
|
|
42
|
-
function
|
|
43
|
-
|
|
39
|
+
function Vn(o) {
|
|
40
|
+
return Xn(), Ot.get(o);
|
|
44
41
|
}
|
|
45
42
|
function We(o, n) {
|
|
46
|
-
|
|
43
|
+
mt.has(o) || mt.set(o, /* @__PURE__ */ new Set()), mt.get(o).add(n);
|
|
47
44
|
}
|
|
48
|
-
/*! @license DOMPurify 3.4.11 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.11/LICENSE */
|
|
49
45
|
function Ye(o, n) {
|
|
46
|
+
mt.get(o)?.delete(n);
|
|
47
|
+
}
|
|
48
|
+
/*! @license DOMPurify 3.4.12 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.12/LICENSE */
|
|
49
|
+
function je(o, n) {
|
|
50
50
|
(n == null || n > o.length) && (n = o.length);
|
|
51
51
|
for (var s = 0, l = Array(n); s < n; s++) l[s] = o[s];
|
|
52
52
|
return l;
|
|
53
53
|
}
|
|
54
|
-
function
|
|
54
|
+
function qn(o) {
|
|
55
55
|
if (Array.isArray(o)) return o;
|
|
56
56
|
}
|
|
57
|
-
function
|
|
57
|
+
function Kn(o, n) {
|
|
58
58
|
var s = o == null ? null : typeof Symbol < "u" && o[Symbol.iterator] || o["@@iterator"];
|
|
59
59
|
if (s != null) {
|
|
60
|
-
var l,
|
|
60
|
+
var l, u, m, A, dt = [], M = !0, ht = !1;
|
|
61
61
|
try {
|
|
62
|
-
if (m = (s = s.call(o)).next, n !== 0) for (; !(
|
|
63
|
-
} catch (
|
|
64
|
-
|
|
62
|
+
if (m = (s = s.call(o)).next, n !== 0) for (; !(M = (l = m.call(s)).done) && (dt.push(l.value), dt.length !== n); M = !0) ;
|
|
63
|
+
} catch (kt) {
|
|
64
|
+
ht = !0, u = kt;
|
|
65
65
|
} finally {
|
|
66
66
|
try {
|
|
67
|
-
if (!
|
|
67
|
+
if (!M && s.return != null && (A = s.return(), Object(A) !== A)) return;
|
|
68
68
|
} finally {
|
|
69
|
-
if (
|
|
69
|
+
if (ht) throw u;
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
|
-
return
|
|
72
|
+
return dt;
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
|
-
function
|
|
75
|
+
function Zn() {
|
|
76
76
|
throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
77
77
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
78
78
|
}
|
|
79
|
-
function
|
|
80
|
-
return
|
|
79
|
+
function Jn(o, n) {
|
|
80
|
+
return qn(o) || Kn(o, n) || Qn(o, n) || Zn();
|
|
81
81
|
}
|
|
82
|
-
function
|
|
82
|
+
function Qn(o, n) {
|
|
83
83
|
if (o) {
|
|
84
|
-
if (typeof o == "string") return
|
|
84
|
+
if (typeof o == "string") return je(o, n);
|
|
85
85
|
var s = {}.toString.call(o).slice(8, -1);
|
|
86
|
-
return s === "Object" && o.constructor && (s = o.constructor.name), s === "Map" || s === "Set" ? Array.from(o) : s === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s) ?
|
|
86
|
+
return s === "Object" && o.constructor && (s = o.constructor.name), s === "Map" || s === "Set" ? Array.from(o) : s === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s) ? je(o, n) : void 0;
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
|
-
const
|
|
90
|
-
let
|
|
91
|
-
|
|
89
|
+
const ln = Object.entries, $e = Object.setPrototypeOf, to = Object.isFrozen, eo = Object.getPrototypeOf, no = Object.getOwnPropertyDescriptor;
|
|
90
|
+
let O = Object.freeze, w = Object.seal, pt = Object.create, cn = typeof Reflect < "u" && Reflect, ue = cn.apply, fe = cn.construct;
|
|
91
|
+
O || (O = function(n) {
|
|
92
92
|
return n;
|
|
93
93
|
});
|
|
94
|
-
|
|
94
|
+
w || (w = function(n) {
|
|
95
95
|
return n;
|
|
96
96
|
});
|
|
97
|
-
|
|
98
|
-
for (var l = arguments.length,
|
|
99
|
-
|
|
100
|
-
return n.apply(s,
|
|
97
|
+
ue || (ue = function(n, s) {
|
|
98
|
+
for (var l = arguments.length, u = new Array(l > 2 ? l - 2 : 0), m = 2; m < l; m++)
|
|
99
|
+
u[m - 2] = arguments[m];
|
|
100
|
+
return n.apply(s, u);
|
|
101
101
|
});
|
|
102
|
-
|
|
103
|
-
for (var s = arguments.length, l = new Array(s > 1 ? s - 1 : 0),
|
|
104
|
-
l[
|
|
102
|
+
fe || (fe = function(n) {
|
|
103
|
+
for (var s = arguments.length, l = new Array(s > 1 ? s - 1 : 0), u = 1; u < s; u++)
|
|
104
|
+
l[u - 1] = arguments[u];
|
|
105
105
|
return new n(...l);
|
|
106
106
|
});
|
|
107
|
-
const
|
|
107
|
+
const ut = E(Array.prototype.forEach), oo = E(Array.prototype.lastIndexOf), Xe = E(Array.prototype.pop), ft = E(Array.prototype.push), io = E(Array.prototype.splice), X = Array.isArray, bt = E(String.prototype.toLowerCase), re = E(String.prototype.toString), Ve = E(String.prototype.match), Et = E(String.prototype.replace), qe = E(String.prototype.indexOf), ro = E(String.prototype.trim), so = E(Number.prototype.toString), ao = E(Boolean.prototype.toString), Ke = typeof BigInt > "u" ? null : E(BigInt.prototype.toString), Ze = typeof Symbol > "u" ? null : E(Symbol.prototype.toString), S = E(Object.prototype.hasOwnProperty), At = E(Object.prototype.toString), b = E(RegExp.prototype.test), et = lo(TypeError);
|
|
108
108
|
function E(o) {
|
|
109
109
|
return function(n) {
|
|
110
110
|
n instanceof RegExp && (n.lastIndex = 0);
|
|
111
|
-
for (var s = arguments.length, l = new Array(s > 1 ? s - 1 : 0),
|
|
112
|
-
l[
|
|
113
|
-
return
|
|
111
|
+
for (var s = arguments.length, l = new Array(s > 1 ? s - 1 : 0), u = 1; u < s; u++)
|
|
112
|
+
l[u - 1] = arguments[u];
|
|
113
|
+
return ue(o, n, l);
|
|
114
114
|
};
|
|
115
115
|
}
|
|
116
|
-
function
|
|
116
|
+
function lo(o) {
|
|
117
117
|
return function() {
|
|
118
118
|
for (var n = arguments.length, s = new Array(n), l = 0; l < n; l++)
|
|
119
119
|
s[l] = arguments[l];
|
|
120
|
-
return
|
|
120
|
+
return fe(o, s);
|
|
121
121
|
};
|
|
122
122
|
}
|
|
123
|
-
function
|
|
124
|
-
let s = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] :
|
|
125
|
-
if (
|
|
123
|
+
function p(o, n) {
|
|
124
|
+
let s = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : bt;
|
|
125
|
+
if ($e && $e(o, null), !X(n))
|
|
126
126
|
return o;
|
|
127
127
|
let l = n.length;
|
|
128
128
|
for (; l--; ) {
|
|
129
|
-
let
|
|
130
|
-
if (typeof
|
|
131
|
-
const m = s(
|
|
132
|
-
m !==
|
|
129
|
+
let u = n[l];
|
|
130
|
+
if (typeof u == "string") {
|
|
131
|
+
const m = s(u);
|
|
132
|
+
m !== u && (to(n) || (n[l] = m), u = m);
|
|
133
133
|
}
|
|
134
|
-
o[
|
|
134
|
+
o[u] = !0;
|
|
135
135
|
}
|
|
136
136
|
return o;
|
|
137
137
|
}
|
|
138
|
-
function
|
|
138
|
+
function co(o) {
|
|
139
139
|
for (let n = 0; n < o.length; n++)
|
|
140
|
-
|
|
140
|
+
S(o, n) || (o[n] = null);
|
|
141
141
|
return o;
|
|
142
142
|
}
|
|
143
|
-
function
|
|
144
|
-
const n =
|
|
145
|
-
for (const l of
|
|
146
|
-
var s =
|
|
147
|
-
const
|
|
148
|
-
|
|
143
|
+
function L(o) {
|
|
144
|
+
const n = pt(null);
|
|
145
|
+
for (const l of ln(o)) {
|
|
146
|
+
var s = Jn(l, 2);
|
|
147
|
+
const u = s[0], m = s[1];
|
|
148
|
+
S(o, u) && (X(m) ? n[u] = co(m) : m && typeof m == "object" && m.constructor === Object ? n[u] = L(m) : n[u] = m);
|
|
149
149
|
}
|
|
150
150
|
return n;
|
|
151
151
|
}
|
|
152
|
-
function
|
|
152
|
+
function uo(o) {
|
|
153
153
|
switch (typeof o) {
|
|
154
154
|
case "string":
|
|
155
155
|
return o;
|
|
156
156
|
case "number":
|
|
157
|
-
return
|
|
157
|
+
return so(o);
|
|
158
158
|
case "boolean":
|
|
159
|
-
return
|
|
159
|
+
return ao(o);
|
|
160
160
|
case "bigint":
|
|
161
|
-
return
|
|
161
|
+
return Ke ? Ke(o) : "0";
|
|
162
162
|
case "symbol":
|
|
163
|
-
return
|
|
163
|
+
return Ze ? Ze(o) : "Symbol()";
|
|
164
164
|
case "undefined":
|
|
165
|
-
return
|
|
165
|
+
return At(o);
|
|
166
166
|
case "function":
|
|
167
167
|
case "object": {
|
|
168
168
|
if (o === null)
|
|
169
|
-
return
|
|
170
|
-
const n = o, s =
|
|
169
|
+
return At(o);
|
|
170
|
+
const n = o, s = H(n, "toString");
|
|
171
171
|
if (typeof s == "function") {
|
|
172
172
|
const l = s(n);
|
|
173
|
-
return typeof l == "string" ? l :
|
|
173
|
+
return typeof l == "string" ? l : At(l);
|
|
174
174
|
}
|
|
175
|
-
return
|
|
175
|
+
return At(o);
|
|
176
176
|
}
|
|
177
177
|
default:
|
|
178
|
-
return
|
|
178
|
+
return At(o);
|
|
179
179
|
}
|
|
180
180
|
}
|
|
181
|
-
function
|
|
181
|
+
function H(o, n) {
|
|
182
182
|
for (; o !== null; ) {
|
|
183
|
-
const l =
|
|
183
|
+
const l = no(o, n);
|
|
184
184
|
if (l) {
|
|
185
185
|
if (l.get)
|
|
186
186
|
return E(l.get);
|
|
187
187
|
if (typeof l.value == "function")
|
|
188
188
|
return E(l.value);
|
|
189
189
|
}
|
|
190
|
-
o =
|
|
190
|
+
o = eo(o);
|
|
191
191
|
}
|
|
192
192
|
function s() {
|
|
193
193
|
return null;
|
|
194
194
|
}
|
|
195
195
|
return s;
|
|
196
196
|
}
|
|
197
|
-
function
|
|
197
|
+
function fo(o) {
|
|
198
198
|
try {
|
|
199
|
-
return
|
|
199
|
+
return b(o, ""), !0;
|
|
200
200
|
} catch {
|
|
201
201
|
return !1;
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
|
-
const
|
|
204
|
+
const Je = O(["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"]), se = O(["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"]), ae = O(["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"]), po = O(["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"]), le = O(["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"]), mo = O(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), Qe = O(["#text"]), tn = O(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "command", "commandfor", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "exportparts", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inert", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "part", "pattern", "placeholder", "playsinline", "popover", "popovertarget", "popovertargetaction", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "slot", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "wrap", "xmlns"]), ce = O(["accent-height", "accumulate", "additive", "alignment-baseline", "amplitude", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dominant-baseline", "dur", "edgemode", "elevation", "end", "exponent", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "intercept", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "mask-type", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "slope", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "tablevalues", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-orientation", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "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"]), en = O(["accent", "accentunder", "align", "bevelled", "close", "columnalign", "columnlines", "columnspacing", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lquote", "lspace", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns"]), xt = O(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), ho = w(/{{[\w\W]*|^[\w\W]*}}/g), _o = w(/<%[\w\W]*|^[\w\W]*%>/g), To = w(/\${[\w\W]*/g), go = w(/^data-[\-\w.\u00B7-\uFFFF]+$/), yo = w(/^aria-[\-\w]+$/), nn = w(
|
|
205
205
|
/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
|
|
206
206
|
// eslint-disable-line no-useless-escape
|
|
207
|
-
),
|
|
207
|
+
), Eo = w(/^(?:\w+script|data):/i), Ao = w(
|
|
208
208
|
/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
|
|
209
209
|
// eslint-disable-line no-control-regex
|
|
210
|
-
),
|
|
210
|
+
), bo = w(/^html$/i), So = w(/^[a-z][.\w]*(-[.\w]+)+$/i), on = w(/<[/\w!]/g), rn = w(/<[/\w]/g), Oo = w(/<\/no(script|embed|frames)/i), wo = w(/\/>/i), v = {
|
|
211
211
|
element: 1,
|
|
212
212
|
attribute: 2,
|
|
213
213
|
text: 3,
|
|
@@ -223,14 +223,14 @@ const Ze = w(["a", "abbr", "acronym", "address", "area", "article", "aside", "au
|
|
|
223
223
|
documentFragment: 11,
|
|
224
224
|
notation: 12
|
|
225
225
|
// Deprecated
|
|
226
|
-
},
|
|
226
|
+
}, Ro = function() {
|
|
227
227
|
return typeof window > "u" ? null : window;
|
|
228
|
-
},
|
|
228
|
+
}, Io = function(n, s) {
|
|
229
229
|
if (typeof n != "object" || typeof n.createPolicy != "function")
|
|
230
230
|
return null;
|
|
231
231
|
let l = null;
|
|
232
|
-
const
|
|
233
|
-
s && s.hasAttribute(
|
|
232
|
+
const u = "data-tt-policy-suffix";
|
|
233
|
+
s && s.hasAttribute(u) && (l = s.getAttribute(u));
|
|
234
234
|
const m = "dompurify" + (l ? "#" + l : "");
|
|
235
235
|
try {
|
|
236
236
|
return n.createPolicy(m, {
|
|
@@ -244,7 +244,7 @@ const Ze = w(["a", "abbr", "acronym", "address", "area", "article", "aside", "au
|
|
|
244
244
|
} catch {
|
|
245
245
|
return console.warn("TrustedTypes policy " + m + " could not be created."), null;
|
|
246
246
|
}
|
|
247
|
-
},
|
|
247
|
+
}, sn = function() {
|
|
248
248
|
return {
|
|
249
249
|
afterSanitizeAttributes: [],
|
|
250
250
|
afterSanitizeElements: [],
|
|
@@ -256,53 +256,53 @@ const Ze = w(["a", "abbr", "acronym", "address", "area", "article", "aside", "au
|
|
|
256
256
|
uponSanitizeElement: [],
|
|
257
257
|
uponSanitizeShadowNode: []
|
|
258
258
|
};
|
|
259
|
-
},
|
|
260
|
-
return
|
|
259
|
+
}, $ = function(n, s, l, u) {
|
|
260
|
+
return S(n, s) && X(n[s]) ? p(u.base ? L(u.base) : {}, n[s], u.transform) : l;
|
|
261
261
|
};
|
|
262
|
-
function
|
|
263
|
-
let o = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] :
|
|
264
|
-
const n = (r) =>
|
|
265
|
-
if (n.version = "3.4.
|
|
262
|
+
function un() {
|
|
263
|
+
let o = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Ro();
|
|
264
|
+
const n = (r) => un(r);
|
|
265
|
+
if (n.version = "3.4.12", n.removed = [], !o || !o.document || o.document.nodeType !== v.document || !o.Element)
|
|
266
266
|
return n.isSupported = !1, n;
|
|
267
267
|
let s = o.document;
|
|
268
|
-
const l = s,
|
|
268
|
+
const l = s, u = l.currentScript;
|
|
269
269
|
o.DocumentFragment;
|
|
270
|
-
const m = o.HTMLTemplateElement, A = o.Node,
|
|
271
|
-
|
|
272
|
-
const
|
|
270
|
+
const m = o.HTMLTemplateElement, A = o.Node, dt = o.Element, M = o.NodeFilter, ht = o.NamedNodeMap;
|
|
271
|
+
ht === void 0 && (o.NamedNodeMap || o.MozNamedAttrMap), o.HTMLFormElement;
|
|
272
|
+
const kt = o.DOMParser, wt = o.trustedTypes, K = dt.prototype, pn = H(K, "cloneNode"), zt = H(K, "remove"), mn = H(K, "nextSibling"), ot = H(K, "childNodes"), Z = H(K, "parentNode"), me = H(K, "shadowRoot"), Ft = H(K, "attributes"), I = A && A.prototype ? H(A.prototype, "nodeType") : null, k = A && A.prototype ? H(A.prototype, "nodeName") : null;
|
|
273
273
|
if (typeof m == "function") {
|
|
274
274
|
const r = s.createElement("template");
|
|
275
275
|
r.content && r.content.ownerDocument && (s = r.content.ownerDocument);
|
|
276
276
|
}
|
|
277
|
-
let
|
|
278
|
-
const
|
|
279
|
-
if (
|
|
280
|
-
throw
|
|
281
|
-
},
|
|
282
|
-
|
|
277
|
+
let D, J = "", Ut, de = !1, _t = 0;
|
|
278
|
+
const he = function() {
|
|
279
|
+
if (_t > 0)
|
|
280
|
+
throw et('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.');
|
|
281
|
+
}, it = function(t) {
|
|
282
|
+
he(), _t++;
|
|
283
283
|
try {
|
|
284
|
-
return
|
|
284
|
+
return D.createHTML(t);
|
|
285
285
|
} finally {
|
|
286
|
-
|
|
286
|
+
_t--;
|
|
287
287
|
}
|
|
288
|
-
},
|
|
289
|
-
|
|
288
|
+
}, dn = function(t) {
|
|
289
|
+
he(), _t++;
|
|
290
290
|
try {
|
|
291
|
-
return
|
|
291
|
+
return D.createScriptURL(t);
|
|
292
292
|
} finally {
|
|
293
|
-
|
|
293
|
+
_t--;
|
|
294
294
|
}
|
|
295
|
-
},
|
|
296
|
-
return
|
|
297
|
-
},
|
|
298
|
-
let
|
|
299
|
-
n.isSupported = typeof
|
|
300
|
-
const
|
|
301
|
-
let
|
|
302
|
-
const
|
|
303
|
-
let
|
|
304
|
-
const
|
|
305
|
-
let
|
|
295
|
+
}, hn = function() {
|
|
296
|
+
return de || (Ut = Io(wt, u), de = !0), Ut;
|
|
297
|
+
}, Rt = s, Ht = Rt.implementation, _e = Rt.createNodeIterator, _n = Rt.createDocumentFragment, Tn = Rt.getElementsByTagName, gn = l.importNode;
|
|
298
|
+
let h = sn();
|
|
299
|
+
n.isSupported = typeof ln == "function" && typeof Z == "function" && Ht && Ht.createHTMLDocument !== void 0;
|
|
300
|
+
const yn = ho, En = _o, An = To, bn = go, Sn = yo, On = Eo, Te = Ao, wn = So;
|
|
301
|
+
let ge = nn, _ = null;
|
|
302
|
+
const ye = p({}, [...Je, ...se, ...ae, ...le, ...Qe]);
|
|
303
|
+
let T = null;
|
|
304
|
+
const Ee = p({}, [...tn, ...ce, ...en, ...xt]);
|
|
305
|
+
let g = Object.seal(pt(null, {
|
|
306
306
|
tagNameCheck: {
|
|
307
307
|
writable: !0,
|
|
308
308
|
configurable: !1,
|
|
@@ -321,8 +321,8 @@ function ln() {
|
|
|
321
321
|
enumerable: !0,
|
|
322
322
|
value: !1
|
|
323
323
|
}
|
|
324
|
-
})),
|
|
325
|
-
const
|
|
324
|
+
})), Tt = null, Ae = null;
|
|
325
|
+
const B = Object.seal(pt(null, {
|
|
326
326
|
tagCheck: {
|
|
327
327
|
writable: !0,
|
|
328
328
|
configurable: !1,
|
|
@@ -336,10 +336,10 @@ function ln() {
|
|
|
336
336
|
value: null
|
|
337
337
|
}
|
|
338
338
|
}));
|
|
339
|
-
let
|
|
340
|
-
const
|
|
341
|
-
let
|
|
342
|
-
const
|
|
339
|
+
let be = !0, Gt = !0, Se = !1, Oe = !0, W = !1, Y = !0, Q = !1, Bt = !1, Wt = null, Yt = null, jt = !1, rt = !1, It = !1, Nt = !1, we = !0, Re = !1;
|
|
340
|
+
const Ie = "user-content-";
|
|
341
|
+
let $t = !0, Xt = !1, st = {}, z = null;
|
|
342
|
+
const Vt = p({}, [
|
|
343
343
|
"annotation-xml",
|
|
344
344
|
"audio",
|
|
345
345
|
"colgroup",
|
|
@@ -376,123 +376,124 @@ function ln() {
|
|
|
376
376
|
"video",
|
|
377
377
|
"xmp"
|
|
378
378
|
]);
|
|
379
|
-
let
|
|
380
|
-
const
|
|
381
|
-
let
|
|
382
|
-
const
|
|
383
|
-
let
|
|
384
|
-
const
|
|
385
|
-
let
|
|
386
|
-
const
|
|
387
|
-
let
|
|
388
|
-
const
|
|
389
|
-
let
|
|
390
|
-
const
|
|
391
|
-
let
|
|
392
|
-
const
|
|
379
|
+
let Ne = null;
|
|
380
|
+
const Le = p({}, ["audio", "video", "img", "source", "image", "track"]);
|
|
381
|
+
let qt = null;
|
|
382
|
+
const De = p({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), Lt = "http://www.w3.org/1998/Math/MathML", Dt = "http://www.w3.org/2000/svg", F = "http://www.w3.org/1999/xhtml";
|
|
383
|
+
let at = F, Kt = !1, Zt = null;
|
|
384
|
+
const Rn = p({}, [Lt, Dt, F], re), Ce = O(["mi", "mo", "mn", "ms", "mtext"]);
|
|
385
|
+
let Jt = p({}, Ce);
|
|
386
|
+
const Me = O(["annotation-xml"]);
|
|
387
|
+
let Qt = p({}, Me);
|
|
388
|
+
const In = p({}, ["title", "style", "font", "a", "script"]);
|
|
389
|
+
let gt = null;
|
|
390
|
+
const Nn = ["application/xhtml+xml", "text/html"], Ln = "text/html";
|
|
391
|
+
let d = null, lt = null;
|
|
392
|
+
const Dn = s.createElement("form"), ve = function(t) {
|
|
393
393
|
return t instanceof RegExp || t instanceof Function;
|
|
394
|
-
},
|
|
394
|
+
}, te = function() {
|
|
395
395
|
let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
396
|
-
if (
|
|
396
|
+
if (lt && lt === t)
|
|
397
397
|
return;
|
|
398
|
-
(!t || typeof t != "object") && (t = {}), t =
|
|
399
|
-
|
|
400
|
-
transform:
|
|
401
|
-
}),
|
|
402
|
-
transform:
|
|
403
|
-
}),
|
|
404
|
-
transform:
|
|
405
|
-
}),
|
|
406
|
-
transform:
|
|
407
|
-
base:
|
|
408
|
-
}),
|
|
409
|
-
transform:
|
|
410
|
-
base:
|
|
411
|
-
}),
|
|
412
|
-
transform:
|
|
413
|
-
}),
|
|
414
|
-
transform:
|
|
415
|
-
}),
|
|
416
|
-
transform:
|
|
417
|
-
}),
|
|
418
|
-
const e =
|
|
419
|
-
if (
|
|
398
|
+
(!t || typeof t != "object") && (t = {}), t = L(t), gt = // eslint-disable-next-line unicorn/prefer-includes
|
|
399
|
+
Nn.indexOf(t.PARSER_MEDIA_TYPE) === -1 ? Ln : t.PARSER_MEDIA_TYPE, d = gt === "application/xhtml+xml" ? re : bt, _ = $(t, "ALLOWED_TAGS", ye, {
|
|
400
|
+
transform: d
|
|
401
|
+
}), T = $(t, "ALLOWED_ATTR", Ee, {
|
|
402
|
+
transform: d
|
|
403
|
+
}), Zt = $(t, "ALLOWED_NAMESPACES", Rn, {
|
|
404
|
+
transform: re
|
|
405
|
+
}), qt = $(t, "ADD_URI_SAFE_ATTR", De, {
|
|
406
|
+
transform: d,
|
|
407
|
+
base: De
|
|
408
|
+
}), Ne = $(t, "ADD_DATA_URI_TAGS", Le, {
|
|
409
|
+
transform: d,
|
|
410
|
+
base: Le
|
|
411
|
+
}), z = $(t, "FORBID_CONTENTS", Vt, {
|
|
412
|
+
transform: d
|
|
413
|
+
}), Tt = $(t, "FORBID_TAGS", L({}), {
|
|
414
|
+
transform: d
|
|
415
|
+
}), Ae = $(t, "FORBID_ATTR", L({}), {
|
|
416
|
+
transform: d
|
|
417
|
+
}), st = S(t, "USE_PROFILES") ? t.USE_PROFILES && typeof t.USE_PROFILES == "object" ? L(t.USE_PROFILES) : t.USE_PROFILES : !1, be = t.ALLOW_ARIA_ATTR !== !1, Gt = t.ALLOW_DATA_ATTR !== !1, Se = t.ALLOW_UNKNOWN_PROTOCOLS || !1, Oe = t.ALLOW_SELF_CLOSE_IN_ATTR !== !1, W = t.SAFE_FOR_TEMPLATES || !1, Y = t.SAFE_FOR_XML !== !1, Q = t.WHOLE_DOCUMENT || !1, rt = t.RETURN_DOM || !1, It = t.RETURN_DOM_FRAGMENT || !1, Nt = t.RETURN_TRUSTED_TYPE || !1, jt = t.FORCE_BODY || !1, we = t.SANITIZE_DOM !== !1, Re = t.SANITIZE_NAMED_PROPS || !1, $t = t.KEEP_CONTENT !== !1, Xt = t.IN_PLACE || !1, ge = fo(t.ALLOWED_URI_REGEXP) ? t.ALLOWED_URI_REGEXP : nn, at = typeof t.NAMESPACE == "string" ? t.NAMESPACE : F, Jt = S(t, "MATHML_TEXT_INTEGRATION_POINTS") && t.MATHML_TEXT_INTEGRATION_POINTS && typeof t.MATHML_TEXT_INTEGRATION_POINTS == "object" ? L(t.MATHML_TEXT_INTEGRATION_POINTS) : p({}, Ce), Qt = S(t, "HTML_INTEGRATION_POINTS") && t.HTML_INTEGRATION_POINTS && typeof t.HTML_INTEGRATION_POINTS == "object" ? L(t.HTML_INTEGRATION_POINTS) : p({}, Me);
|
|
418
|
+
const e = S(t, "CUSTOM_ELEMENT_HANDLING") && t.CUSTOM_ELEMENT_HANDLING && typeof t.CUSTOM_ELEMENT_HANDLING == "object" ? L(t.CUSTOM_ELEMENT_HANDLING) : pt(null);
|
|
419
|
+
if (g = pt(null), S(e, "tagNameCheck") && ve(e.tagNameCheck) && (g.tagNameCheck = e.tagNameCheck), S(e, "attributeNameCheck") && ve(e.attributeNameCheck) && (g.attributeNameCheck = e.attributeNameCheck), S(e, "allowCustomizedBuiltInElements") && typeof e.allowCustomizedBuiltInElements == "boolean" && (g.allowCustomizedBuiltInElements = e.allowCustomizedBuiltInElements), w(g), W && (Gt = !1), It && (rt = !0), st && (_ = p({}, Qe), T = pt(null), st.html === !0 && (p(_, Je), p(T, tn)), st.svg === !0 && (p(_, se), p(T, ce), p(T, xt)), st.svgFilters === !0 && (p(_, ae), p(T, ce), p(T, xt)), st.mathMl === !0 && (p(_, le), p(T, en), p(T, xt))), B.tagCheck = null, B.attributeCheck = null, S(t, "ADD_TAGS") && (typeof t.ADD_TAGS == "function" ? B.tagCheck = t.ADD_TAGS : X(t.ADD_TAGS) && (_ === ye && (_ = L(_)), p(_, t.ADD_TAGS, d))), S(t, "ADD_ATTR") && (typeof t.ADD_ATTR == "function" ? B.attributeCheck = t.ADD_ATTR : X(t.ADD_ATTR) && (T === Ee && (T = L(T)), p(T, t.ADD_ATTR, d))), S(t, "ADD_URI_SAFE_ATTR") && X(t.ADD_URI_SAFE_ATTR) && p(qt, t.ADD_URI_SAFE_ATTR, d), S(t, "FORBID_CONTENTS") && X(t.FORBID_CONTENTS) && (z === Vt && (z = L(z)), p(z, t.FORBID_CONTENTS, d)), S(t, "ADD_FORBID_CONTENTS") && X(t.ADD_FORBID_CONTENTS) && (z === Vt && (z = L(z)), p(z, t.ADD_FORBID_CONTENTS, d)), $t && (_["#text"] = !0), Q && p(_, ["html", "head", "body"]), _.table && (p(_, ["tbody"]), delete Tt.tbody), t.TRUSTED_TYPES_POLICY) {
|
|
420
420
|
if (typeof t.TRUSTED_TYPES_POLICY.createHTML != "function")
|
|
421
|
-
throw
|
|
421
|
+
throw et('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
|
|
422
422
|
if (typeof t.TRUSTED_TYPES_POLICY.createScriptURL != "function")
|
|
423
|
-
throw
|
|
424
|
-
const i =
|
|
425
|
-
|
|
423
|
+
throw et('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
|
|
424
|
+
const i = D;
|
|
425
|
+
D = t.TRUSTED_TYPES_POLICY;
|
|
426
426
|
try {
|
|
427
|
-
|
|
427
|
+
J = it("");
|
|
428
428
|
} catch (a) {
|
|
429
|
-
throw
|
|
429
|
+
throw D = i, a;
|
|
430
430
|
}
|
|
431
|
-
} else t.TRUSTED_TYPES_POLICY === null ? (
|
|
432
|
-
|
|
433
|
-
},
|
|
434
|
-
return e.namespaceURI ===
|
|
435
|
-
},
|
|
436
|
-
return e.namespaceURI ===
|
|
437
|
-
},
|
|
438
|
-
return e.namespaceURI ===
|
|
439
|
-
},
|
|
440
|
-
let e =
|
|
431
|
+
} else t.TRUSTED_TYPES_POLICY === null ? (D = void 0, J = "") : (D === void 0 && (D = hn()), D && typeof J == "string" && (J = it("")));
|
|
432
|
+
O && O(t), lt = t;
|
|
433
|
+
}, Pe = p({}, [...se, ...ae, ...po]), xe = p({}, [...le, ...mo]), Cn = function(t, e, i) {
|
|
434
|
+
return e.namespaceURI === F ? t === "svg" : e.namespaceURI === Lt ? t === "svg" && (i === "annotation-xml" || Jt[i]) : !!Pe[t];
|
|
435
|
+
}, Mn = function(t, e, i) {
|
|
436
|
+
return e.namespaceURI === F ? t === "math" : e.namespaceURI === Dt ? t === "math" && Qt[i] : !!xe[t];
|
|
437
|
+
}, vn = function(t, e, i) {
|
|
438
|
+
return e.namespaceURI === Dt && !Qt[i] || e.namespaceURI === Lt && !Jt[i] ? !1 : !xe[t] && (In[t] || !Pe[t]);
|
|
439
|
+
}, Pn = function(t) {
|
|
440
|
+
let e = Z(t);
|
|
441
441
|
(!e || !e.tagName) && (e = {
|
|
442
|
-
namespaceURI:
|
|
442
|
+
namespaceURI: at,
|
|
443
443
|
tagName: "template"
|
|
444
444
|
});
|
|
445
|
-
const i =
|
|
446
|
-
return
|
|
447
|
-
},
|
|
448
|
-
|
|
445
|
+
const i = bt(t.tagName), a = bt(e.tagName);
|
|
446
|
+
return Zt[t.namespaceURI] ? t.namespaceURI === Dt ? Cn(i, e, a) : t.namespaceURI === Lt ? Mn(i, e, a) : t.namespaceURI === F ? vn(i, e, a) : !!(gt === "application/xhtml+xml" && Zt[t.namespaceURI]) : !1;
|
|
447
|
+
}, j = function(t) {
|
|
448
|
+
ft(n.removed, {
|
|
449
449
|
element: t
|
|
450
450
|
});
|
|
451
451
|
try {
|
|
452
|
-
|
|
452
|
+
Z(t).removeChild(t);
|
|
453
453
|
} catch {
|
|
454
|
-
if (
|
|
455
|
-
throw
|
|
454
|
+
if (zt(t), !Z(t))
|
|
455
|
+
throw et("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place");
|
|
456
456
|
}
|
|
457
|
-
},
|
|
458
|
-
|
|
457
|
+
}, Ct = function(t) {
|
|
458
|
+
ee(t);
|
|
459
|
+
const e = ot(t);
|
|
459
460
|
if (e) {
|
|
460
461
|
const a = [];
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
}),
|
|
462
|
+
ut(e, (c) => {
|
|
463
|
+
ft(a, c);
|
|
464
|
+
}), ut(a, (c) => {
|
|
464
465
|
try {
|
|
465
|
-
|
|
466
|
+
zt(c);
|
|
466
467
|
} catch {
|
|
467
468
|
}
|
|
468
469
|
});
|
|
469
470
|
}
|
|
470
|
-
const i =
|
|
471
|
+
const i = Ft(t);
|
|
471
472
|
if (i)
|
|
472
473
|
for (let a = i.length - 1; a >= 0; --a) {
|
|
473
|
-
const
|
|
474
|
-
if (typeof
|
|
474
|
+
const c = i[a], f = c && c.name;
|
|
475
|
+
if (typeof f == "string")
|
|
475
476
|
try {
|
|
476
|
-
t.removeAttribute(
|
|
477
|
+
t.removeAttribute(f);
|
|
477
478
|
} catch {
|
|
478
479
|
}
|
|
479
480
|
}
|
|
480
|
-
},
|
|
481
|
+
}, tt = function(t, e) {
|
|
481
482
|
try {
|
|
482
|
-
|
|
483
|
+
ft(n.removed, {
|
|
483
484
|
attribute: e.getAttributeNode(t),
|
|
484
485
|
from: e
|
|
485
486
|
});
|
|
486
487
|
} catch {
|
|
487
|
-
|
|
488
|
+
ft(n.removed, {
|
|
488
489
|
attribute: null,
|
|
489
490
|
from: e
|
|
490
491
|
});
|
|
491
492
|
}
|
|
492
493
|
if (e.removeAttribute(t), t === "is")
|
|
493
|
-
if (
|
|
494
|
+
if (rt || It)
|
|
494
495
|
try {
|
|
495
|
-
|
|
496
|
+
j(e);
|
|
496
497
|
} catch {
|
|
497
498
|
}
|
|
498
499
|
else
|
|
@@ -500,93 +501,118 @@ function ln() {
|
|
|
500
501
|
e.setAttribute(t, "");
|
|
501
502
|
} catch {
|
|
502
503
|
}
|
|
503
|
-
},
|
|
504
|
-
const e =
|
|
504
|
+
}, xn = function(t) {
|
|
505
|
+
const e = Ft(t);
|
|
505
506
|
if (e)
|
|
506
507
|
for (let i = e.length - 1; i >= 0; --i) {
|
|
507
|
-
const a = e[i],
|
|
508
|
-
if (!(typeof
|
|
508
|
+
const a = e[i], c = a && a.name;
|
|
509
|
+
if (!(typeof c != "string" || T[d(c)]))
|
|
509
510
|
try {
|
|
510
|
-
t.removeAttribute(
|
|
511
|
+
t.removeAttribute(c);
|
|
511
512
|
} catch {
|
|
512
513
|
}
|
|
513
514
|
}
|
|
514
|
-
},
|
|
515
|
+
}, ee = function(t) {
|
|
515
516
|
const e = [t];
|
|
516
517
|
for (; e.length > 0; ) {
|
|
517
518
|
const i = e.pop();
|
|
518
|
-
(
|
|
519
|
-
const
|
|
520
|
-
if (
|
|
521
|
-
for (let
|
|
522
|
-
e.push(
|
|
519
|
+
(I ? I(i) : i.nodeType) === v.element && xn(i);
|
|
520
|
+
const c = ot(i);
|
|
521
|
+
if (c)
|
|
522
|
+
for (let f = c.length - 1; f >= 0; --f)
|
|
523
|
+
e.push(c[f]);
|
|
524
|
+
}
|
|
525
|
+
}, kn = function(t) {
|
|
526
|
+
if (!Y)
|
|
527
|
+
return;
|
|
528
|
+
const e = [t];
|
|
529
|
+
for (; e.length > 0; ) {
|
|
530
|
+
const i = e.pop(), a = I ? I(i) : i.nodeType;
|
|
531
|
+
if (a === v.processingInstruction || a === v.comment && b(rn, i.data)) {
|
|
532
|
+
try {
|
|
533
|
+
zt(i);
|
|
534
|
+
} catch {
|
|
535
|
+
}
|
|
536
|
+
continue;
|
|
537
|
+
}
|
|
538
|
+
if (a === v.element) {
|
|
539
|
+
const f = i, y = d(k ? k(i) : i.nodeName);
|
|
540
|
+
try {
|
|
541
|
+
f.hasAttribute && f.hasAttribute("patchsrc") && f.removeAttribute("patchsrc"), f.hasAttribute && f.hasAttribute("for") && y !== "label" && y !== "output" && f.removeAttribute("for");
|
|
542
|
+
} catch {
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
const c = ot(i);
|
|
546
|
+
if (c)
|
|
547
|
+
for (let f = c.length - 1; f >= 0; --f)
|
|
548
|
+
e.push(c[f]);
|
|
523
549
|
}
|
|
524
|
-
},
|
|
550
|
+
}, ke = function(t) {
|
|
525
551
|
let e = null, i = null;
|
|
526
|
-
if (
|
|
552
|
+
if (jt)
|
|
527
553
|
t = "<remove></remove>" + t;
|
|
528
554
|
else {
|
|
529
|
-
const
|
|
530
|
-
i =
|
|
555
|
+
const f = Ve(t, /^[\r\n\t ]+/);
|
|
556
|
+
i = f && f[0];
|
|
531
557
|
}
|
|
532
|
-
|
|
533
|
-
const a =
|
|
534
|
-
if (
|
|
558
|
+
gt === "application/xhtml+xml" && at === F && (t = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + t + "</body></html>");
|
|
559
|
+
const a = D ? it(t) : t;
|
|
560
|
+
if (at === F)
|
|
535
561
|
try {
|
|
536
|
-
e = new
|
|
562
|
+
e = new kt().parseFromString(a, gt);
|
|
537
563
|
} catch {
|
|
538
564
|
}
|
|
539
565
|
if (!e || !e.documentElement) {
|
|
540
|
-
e =
|
|
566
|
+
e = Ht.createDocument(at, "template", null);
|
|
541
567
|
try {
|
|
542
|
-
e.documentElement.innerHTML =
|
|
568
|
+
e.documentElement.innerHTML = Kt ? J : a;
|
|
543
569
|
} catch {
|
|
544
570
|
}
|
|
545
571
|
}
|
|
546
|
-
const
|
|
547
|
-
return t && i &&
|
|
548
|
-
},
|
|
549
|
-
return
|
|
572
|
+
const c = e.body || e.documentElement;
|
|
573
|
+
return t && i && c.insertBefore(s.createTextNode(i), c.childNodes[0] || null), at === F ? Tn.call(e, Q ? "html" : "body")[0] : Q ? e.documentElement : c;
|
|
574
|
+
}, ze = function(t) {
|
|
575
|
+
return _e.call(
|
|
550
576
|
t.ownerDocument || t,
|
|
551
577
|
t,
|
|
552
578
|
// eslint-disable-next-line no-bitwise
|
|
553
|
-
|
|
579
|
+
M.SHOW_ELEMENT | M.SHOW_COMMENT | M.SHOW_TEXT | M.SHOW_PROCESSING_INSTRUCTION | M.SHOW_CDATA_SECTION,
|
|
554
580
|
null
|
|
555
581
|
);
|
|
556
|
-
},
|
|
557
|
-
return t =
|
|
558
|
-
},
|
|
582
|
+
}, Mt = function(t) {
|
|
583
|
+
return t = Et(t, yn, " "), t = Et(t, En, " "), t = Et(t, An, " "), t;
|
|
584
|
+
}, ne = function(t) {
|
|
559
585
|
var e;
|
|
560
586
|
t.normalize();
|
|
561
|
-
const i =
|
|
587
|
+
const i = _e.call(
|
|
562
588
|
t.ownerDocument || t,
|
|
563
589
|
t,
|
|
564
590
|
// eslint-disable-next-line no-bitwise
|
|
565
|
-
|
|
591
|
+
M.SHOW_TEXT | M.SHOW_COMMENT | M.SHOW_CDATA_SECTION | M.SHOW_PROCESSING_INSTRUCTION,
|
|
566
592
|
null
|
|
567
593
|
);
|
|
568
594
|
let a = i.nextNode();
|
|
569
595
|
for (; a; )
|
|
570
|
-
a.data =
|
|
571
|
-
const
|
|
572
|
-
|
|
573
|
-
|
|
596
|
+
a.data = Mt(a.data), a = i.nextNode();
|
|
597
|
+
const c = (e = t.querySelectorAll) === null || e === void 0 ? void 0 : e.call(t, "template");
|
|
598
|
+
c && ut(c, (f) => {
|
|
599
|
+
ct(f.content) && ne(f.content);
|
|
574
600
|
});
|
|
575
|
-
},
|
|
576
|
-
const e =
|
|
577
|
-
return typeof e != "string" ||
|
|
601
|
+
}, vt = function(t) {
|
|
602
|
+
const e = k ? k(t) : null;
|
|
603
|
+
return typeof e != "string" || d(e) !== "form" ? !1 : typeof t.nodeName != "string" || typeof t.textContent != "string" || typeof t.removeChild != "function" || // Realm-safe NamedNodeMap detection: equality against the cached
|
|
578
604
|
// prototype getter. Clobbered .attributes (e.g. <input name="attributes">)
|
|
579
605
|
// makes the direct read diverge from the cached read; a clean form
|
|
580
606
|
// (same-realm OR foreign-realm) has both reads pointing at the same
|
|
581
607
|
// canonical NamedNodeMap.
|
|
582
|
-
t.attributes !==
|
|
608
|
+
t.attributes !== Ft(t) || typeof t.removeAttribute != "function" || typeof t.setAttribute != "function" || typeof t.namespaceURI != "string" || typeof t.insertBefore != "function" || typeof t.hasChildNodes != "function" || // NodeType clobbering probe. Cached Node.prototype.nodeType getter
|
|
583
609
|
// returns the integer 1 for any Element regardless of realm; direct
|
|
584
610
|
// read on a clobbered form (e.g. <input name="nodeType">) returns
|
|
585
611
|
// the named child element. Cheap addition — nodeType is read from
|
|
586
612
|
// an internal slot, no serialization cost — and removes a residual
|
|
587
613
|
// clobbering surface used by several mXSS / PI / comment branches
|
|
588
614
|
// in _sanitizeElements that compare currentNode.nodeType directly.
|
|
589
|
-
t.nodeType !==
|
|
615
|
+
t.nodeType !== I(t) || // HTMLFormElement has [LegacyOverrideBuiltIns]: a descendant named
|
|
590
616
|
// "childNodes" shadows the prototype getter. Direct reads of
|
|
591
617
|
// form.childNodes from a clobbered form return the named child
|
|
592
618
|
// instead of the real NodeList, so any walk that reads it directly
|
|
@@ -597,76 +623,82 @@ function ln() {
|
|
|
597
623
|
// select, etc.) regardless of whether the named child happens to
|
|
598
624
|
// carry a numeric .length, which a typeof-based probe would miss
|
|
599
625
|
// (e.g. HTMLSelectElement.length is a defined unsigned-long).
|
|
600
|
-
t.childNodes !==
|
|
601
|
-
},
|
|
602
|
-
if (!
|
|
626
|
+
t.childNodes !== ot(t);
|
|
627
|
+
}, ct = function(t) {
|
|
628
|
+
if (!I || typeof t != "object" || t === null)
|
|
603
629
|
return !1;
|
|
604
630
|
try {
|
|
605
|
-
return
|
|
631
|
+
return I(t) === v.documentFragment;
|
|
606
632
|
} catch {
|
|
607
633
|
return !1;
|
|
608
634
|
}
|
|
609
|
-
},
|
|
610
|
-
if (!
|
|
635
|
+
}, yt = function(t) {
|
|
636
|
+
if (!I || typeof t != "object" || t === null)
|
|
611
637
|
return !1;
|
|
612
638
|
try {
|
|
613
|
-
return typeof
|
|
639
|
+
return typeof I(t) == "number";
|
|
614
640
|
} catch {
|
|
615
641
|
return !1;
|
|
616
642
|
}
|
|
617
643
|
};
|
|
618
|
-
function
|
|
619
|
-
r.length !== 0 &&
|
|
620
|
-
i.call(n, t, e,
|
|
644
|
+
function U(r, t, e) {
|
|
645
|
+
r.length !== 0 && ut(r, (i) => {
|
|
646
|
+
i.call(n, t, e, lt);
|
|
621
647
|
});
|
|
622
648
|
}
|
|
623
|
-
const
|
|
624
|
-
return !!(
|
|
625
|
-
},
|
|
626
|
-
if (!
|
|
649
|
+
const zn = function(t, e) {
|
|
650
|
+
return !!(Y && t.hasChildNodes() && !yt(t.firstElementChild) && b(on, t.textContent) && b(on, t.innerHTML) || Y && t.namespaceURI === F && e === "style" && yt(t.firstElementChild) || t.nodeType === v.processingInstruction || Y && t.nodeType === v.comment && b(rn, t.data));
|
|
651
|
+
}, Fn = function(t, e) {
|
|
652
|
+
if (!Tt[e] && He(e) && (g.tagNameCheck instanceof RegExp && b(g.tagNameCheck, e) || g.tagNameCheck instanceof Function && g.tagNameCheck(e)))
|
|
627
653
|
return !1;
|
|
628
|
-
if (
|
|
629
|
-
const i =
|
|
654
|
+
if ($t && !z[e]) {
|
|
655
|
+
const i = Z(t), a = ot(t);
|
|
630
656
|
if (a && i) {
|
|
631
|
-
const
|
|
632
|
-
for (let
|
|
633
|
-
const
|
|
634
|
-
i.insertBefore(
|
|
657
|
+
const c = a.length;
|
|
658
|
+
for (let f = c - 1; f >= 0; --f) {
|
|
659
|
+
const y = Xt ? a[f] : pn(a[f], !0);
|
|
660
|
+
i.insertBefore(y, mn(t));
|
|
635
661
|
}
|
|
636
662
|
}
|
|
637
663
|
}
|
|
638
|
-
return
|
|
639
|
-
},
|
|
640
|
-
if (
|
|
641
|
-
return
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
return
|
|
650
|
-
if ((
|
|
651
|
-
return
|
|
652
|
-
if (B &&
|
|
653
|
-
const
|
|
654
|
-
|
|
664
|
+
return j(t), !0;
|
|
665
|
+
}, Fe = function(t, e) {
|
|
666
|
+
if (U(h.beforeSanitizeElements, t, null), t !== e && Z(t) === null)
|
|
667
|
+
return !0;
|
|
668
|
+
if (vt(t))
|
|
669
|
+
return j(t), !0;
|
|
670
|
+
const i = d(k ? k(t) : t.nodeName);
|
|
671
|
+
if (U(h.uponSanitizeElement, t, {
|
|
672
|
+
tagName: i,
|
|
673
|
+
allowedTags: _
|
|
674
|
+
}), t !== e && Z(t) === null)
|
|
675
|
+
return !0;
|
|
676
|
+
if (zn(t, i))
|
|
677
|
+
return j(t), !0;
|
|
678
|
+
if (Tt[i] || !(B.tagCheck instanceof Function && B.tagCheck(i)) && !_[i]) {
|
|
679
|
+
const c = Fn(t, i);
|
|
680
|
+
return c === !1 && U(h.afterSanitizeElements, t, null), c;
|
|
681
|
+
}
|
|
682
|
+
if ((I ? I(t) : t.nodeType) === v.element && !Pn(t) || (i === "noscript" || i === "noembed" || i === "noframes") && b(Oo, t.innerHTML))
|
|
683
|
+
return j(t), !0;
|
|
684
|
+
if (W && t.nodeType === v.text) {
|
|
685
|
+
const c = Mt(t.textContent);
|
|
686
|
+
t.textContent !== c && (ft(n.removed, {
|
|
655
687
|
element: t.cloneNode()
|
|
656
|
-
}), t.textContent =
|
|
688
|
+
}), t.textContent = c);
|
|
657
689
|
}
|
|
658
|
-
return
|
|
659
|
-
},
|
|
660
|
-
if (
|
|
690
|
+
return U(h.afterSanitizeElements, t, null), !1;
|
|
691
|
+
}, Ue = function(t, e, i) {
|
|
692
|
+
if (Ae[e] || Y && e === "patchsrc" || Y && e === "for" && t !== "label" && t !== "output" || we && (e === "id" || e === "name") && (i in s || i in Dn))
|
|
661
693
|
return !1;
|
|
662
|
-
const a =
|
|
663
|
-
if (!(
|
|
664
|
-
if (!(
|
|
694
|
+
const a = T[e] || B.attributeCheck instanceof Function && B.attributeCheck(e, t);
|
|
695
|
+
if (!(Gt && b(bn, e))) {
|
|
696
|
+
if (!(be && b(Sn, e))) {
|
|
665
697
|
if (a) {
|
|
666
|
-
if (
|
|
667
|
-
if (!
|
|
668
|
-
if (!((e === "src" || e === "xlink:href" || e === "href") && t !== "script" &&
|
|
669
|
-
if (!(
|
|
698
|
+
if (!qt[e]) {
|
|
699
|
+
if (!b(ge, Et(i, Te, ""))) {
|
|
700
|
+
if (!((e === "src" || e === "xlink:href" || e === "href") && t !== "script" && qe(i, "data:") === 0 && Ne[t])) {
|
|
701
|
+
if (!(Se && !b(On, Et(i, Te, "")))) {
|
|
670
702
|
if (i)
|
|
671
703
|
return !1;
|
|
672
704
|
}
|
|
@@ -677,82 +709,82 @@ function ln() {
|
|
|
677
709
|
// First condition does a very basic check if a) it's basically a valid custom element tagname AND
|
|
678
710
|
// b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
679
711
|
// and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
|
|
680
|
-
!(
|
|
712
|
+
!(He(t) && (g.tagNameCheck instanceof RegExp && b(g.tagNameCheck, t) || g.tagNameCheck instanceof Function && g.tagNameCheck(t)) && (g.attributeNameCheck instanceof RegExp && b(g.attributeNameCheck, e) || g.attributeNameCheck instanceof Function && g.attributeNameCheck(e, t)) || // Alternative, second condition checks if it's an `is`-attribute, AND
|
|
681
713
|
// the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
682
|
-
e === "is" &&
|
|
714
|
+
e === "is" && g.allowCustomizedBuiltInElements && (g.tagNameCheck instanceof RegExp && b(g.tagNameCheck, i) || g.tagNameCheck instanceof Function && g.tagNameCheck(i)))
|
|
683
715
|
) return !1;
|
|
684
716
|
}
|
|
685
717
|
}
|
|
686
718
|
return !0;
|
|
687
|
-
},
|
|
688
|
-
return !
|
|
689
|
-
},
|
|
690
|
-
if (
|
|
691
|
-
switch (
|
|
719
|
+
}, Un = p({}, ["annotation-xml", "color-profile", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "missing-glyph"]), He = function(t) {
|
|
720
|
+
return !Un[bt(t)] && b(wn, t);
|
|
721
|
+
}, Hn = function(t, e, i, a) {
|
|
722
|
+
if (D && typeof wt == "object" && typeof wt.getAttributeType == "function" && !i)
|
|
723
|
+
switch (wt.getAttributeType(t, e)) {
|
|
692
724
|
case "TrustedHTML":
|
|
693
|
-
return
|
|
725
|
+
return it(a);
|
|
694
726
|
case "TrustedScriptURL":
|
|
695
|
-
return
|
|
727
|
+
return dn(a);
|
|
696
728
|
}
|
|
697
729
|
return a;
|
|
698
|
-
},
|
|
730
|
+
}, Gn = function(t, e, i, a) {
|
|
699
731
|
try {
|
|
700
|
-
i ? t.setAttributeNS(i, e, a) : t.setAttribute(e, a),
|
|
732
|
+
i ? t.setAttributeNS(i, e, a) : t.setAttribute(e, a), vt(t) ? j(t) : Xe(n.removed);
|
|
701
733
|
} catch {
|
|
702
|
-
|
|
734
|
+
tt(e, t);
|
|
703
735
|
}
|
|
704
|
-
},
|
|
705
|
-
|
|
736
|
+
}, Ge = function(t) {
|
|
737
|
+
U(h.beforeSanitizeAttributes, t, null);
|
|
706
738
|
const e = t.attributes;
|
|
707
|
-
if (!e ||
|
|
739
|
+
if (!e || vt(t))
|
|
708
740
|
return;
|
|
709
741
|
const i = {
|
|
710
742
|
attrName: "",
|
|
711
743
|
attrValue: "",
|
|
712
744
|
keepAttr: !0,
|
|
713
|
-
allowedAttributes:
|
|
745
|
+
allowedAttributes: T,
|
|
714
746
|
forceKeepAttr: void 0
|
|
715
747
|
};
|
|
716
748
|
let a = e.length;
|
|
717
|
-
const
|
|
749
|
+
const c = d(t.nodeName);
|
|
718
750
|
for (; a--; ) {
|
|
719
|
-
const
|
|
720
|
-
let
|
|
721
|
-
if (i.attrName =
|
|
722
|
-
|
|
751
|
+
const f = e[a], y = f.name, R = f.namespaceURI, P = f.value, C = d(y), x = P;
|
|
752
|
+
let N = y === "value" ? x : ro(x);
|
|
753
|
+
if (i.attrName = C, i.attrValue = N, i.keepAttr = !0, i.forceKeepAttr = void 0, U(h.uponSanitizeAttribute, t, i), N = i.attrValue, Re && (C === "id" || C === "name") && qe(N, Ie) !== 0 && (tt(y, t), N = Ie + N), Y && b(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, N)) {
|
|
754
|
+
tt(y, t);
|
|
723
755
|
continue;
|
|
724
756
|
}
|
|
725
|
-
if (
|
|
726
|
-
|
|
757
|
+
if (C === "attributename" && Ve(N, "href")) {
|
|
758
|
+
tt(y, t);
|
|
727
759
|
continue;
|
|
728
760
|
}
|
|
729
761
|
if (!i.forceKeepAttr) {
|
|
730
762
|
if (!i.keepAttr) {
|
|
731
|
-
|
|
763
|
+
tt(y, t);
|
|
732
764
|
continue;
|
|
733
765
|
}
|
|
734
|
-
if (!
|
|
735
|
-
|
|
766
|
+
if (!Oe && b(wo, N)) {
|
|
767
|
+
tt(y, t);
|
|
736
768
|
continue;
|
|
737
769
|
}
|
|
738
|
-
if (
|
|
739
|
-
|
|
770
|
+
if (W && (N = Mt(N)), !Ue(c, C, N)) {
|
|
771
|
+
tt(y, t);
|
|
740
772
|
continue;
|
|
741
773
|
}
|
|
742
|
-
|
|
774
|
+
N = Hn(c, C, R, N), N !== x && Gn(t, y, R, N);
|
|
743
775
|
}
|
|
744
776
|
}
|
|
745
|
-
|
|
746
|
-
},
|
|
777
|
+
U(h.afterSanitizeAttributes, t, null);
|
|
778
|
+
}, Pt = function(t) {
|
|
747
779
|
let e = null;
|
|
748
|
-
const i =
|
|
749
|
-
for (
|
|
750
|
-
if (
|
|
751
|
-
const
|
|
752
|
-
|
|
780
|
+
const i = ze(t);
|
|
781
|
+
for (U(h.beforeSanitizeShadowDOM, t, null); e = i.nextNode(); )
|
|
782
|
+
if (U(h.uponSanitizeShadowNode, e, null), Fe(e, t), Ge(e), ct(e.content) && Pt(e.content), (I ? I(e) : e.nodeType) === v.element) {
|
|
783
|
+
const c = me(e);
|
|
784
|
+
ct(c) && (oe(c), Pt(c));
|
|
753
785
|
}
|
|
754
|
-
|
|
755
|
-
},
|
|
786
|
+
U(h.afterSanitizeShadowDOM, t, null);
|
|
787
|
+
}, oe = function(t) {
|
|
756
788
|
const e = [{
|
|
757
789
|
node: t,
|
|
758
790
|
shadow: null
|
|
@@ -760,121 +792,124 @@ function ln() {
|
|
|
760
792
|
for (; e.length > 0; ) {
|
|
761
793
|
const i = e.pop();
|
|
762
794
|
if (i.shadow) {
|
|
763
|
-
|
|
795
|
+
Pt(i.shadow);
|
|
764
796
|
continue;
|
|
765
797
|
}
|
|
766
|
-
const a = i.node,
|
|
767
|
-
if (
|
|
768
|
-
for (let
|
|
798
|
+
const a = i.node, f = (I ? I(a) : a.nodeType) === v.element, y = ot(a);
|
|
799
|
+
if (y)
|
|
800
|
+
for (let R = y.length - 1; R >= 0; --R)
|
|
769
801
|
e.push({
|
|
770
|
-
node:
|
|
802
|
+
node: y[R],
|
|
771
803
|
shadow: null
|
|
772
804
|
});
|
|
773
|
-
if (
|
|
774
|
-
const
|
|
775
|
-
if (typeof
|
|
776
|
-
const
|
|
777
|
-
|
|
778
|
-
node:
|
|
805
|
+
if (f) {
|
|
806
|
+
const R = k ? k(a) : null;
|
|
807
|
+
if (typeof R == "string" && d(R) === "template") {
|
|
808
|
+
const P = a.content;
|
|
809
|
+
ct(P) && e.push({
|
|
810
|
+
node: P,
|
|
779
811
|
shadow: null
|
|
780
812
|
});
|
|
781
813
|
}
|
|
782
814
|
}
|
|
783
|
-
if (
|
|
784
|
-
const
|
|
785
|
-
|
|
815
|
+
if (f) {
|
|
816
|
+
const R = me(a);
|
|
817
|
+
ct(R) && e.push({
|
|
786
818
|
node: null,
|
|
787
|
-
shadow:
|
|
819
|
+
shadow: R
|
|
788
820
|
}, {
|
|
789
|
-
node:
|
|
821
|
+
node: R,
|
|
790
822
|
shadow: null
|
|
791
823
|
});
|
|
792
824
|
}
|
|
793
825
|
}
|
|
794
826
|
};
|
|
795
827
|
return n.sanitize = function(r) {
|
|
796
|
-
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, e = null, i = null, a = null,
|
|
797
|
-
if (
|
|
798
|
-
throw
|
|
828
|
+
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, e = null, i = null, a = null, c = null;
|
|
829
|
+
if (Kt = !r, Kt && (r = "<!-->"), typeof r != "string" && !yt(r) && (r = uo(r), typeof r != "string"))
|
|
830
|
+
throw et("dirty is not a string, aborting");
|
|
799
831
|
if (!n.isSupported)
|
|
800
832
|
return r;
|
|
801
|
-
|
|
802
|
-
const
|
|
803
|
-
if (
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
833
|
+
Bt ? (_ = Wt, T = Yt) : te(t), (h.uponSanitizeElement.length > 0 || h.uponSanitizeAttribute.length > 0) && (_ = L(_)), h.uponSanitizeAttribute.length > 0 && (T = L(T)), n.removed = [];
|
|
834
|
+
const f = Xt && typeof r != "string" && yt(r);
|
|
835
|
+
if (f) {
|
|
836
|
+
kn(r);
|
|
837
|
+
const C = k ? k(r) : r.nodeName;
|
|
838
|
+
if (typeof C == "string") {
|
|
839
|
+
const x = d(C);
|
|
840
|
+
if (!_[x] || Tt[x])
|
|
841
|
+
throw Ct(r), et("root node is forbidden and cannot be sanitized in-place");
|
|
809
842
|
}
|
|
810
|
-
if (
|
|
811
|
-
throw
|
|
843
|
+
if (vt(r))
|
|
844
|
+
throw Ct(r), et("root node is clobbered and cannot be sanitized in-place");
|
|
812
845
|
try {
|
|
813
|
-
|
|
814
|
-
} catch (
|
|
815
|
-
throw
|
|
846
|
+
oe(r);
|
|
847
|
+
} catch (x) {
|
|
848
|
+
throw Ct(r), x;
|
|
816
849
|
}
|
|
817
|
-
} else if (
|
|
818
|
-
e =
|
|
850
|
+
} else if (yt(r))
|
|
851
|
+
e = ke("<!---->"), i = e.ownerDocument.importNode(r, !0), i.nodeType === v.element && i.nodeName === "BODY" || i.nodeName === "HTML" ? e = i : e.appendChild(i), oe(i);
|
|
819
852
|
else {
|
|
820
|
-
if (!
|
|
853
|
+
if (!rt && !W && !Q && // eslint-disable-next-line unicorn/prefer-includes
|
|
821
854
|
r.indexOf("<") === -1)
|
|
822
|
-
return
|
|
823
|
-
if (e =
|
|
824
|
-
return
|
|
855
|
+
return D && Nt ? it(r) : r;
|
|
856
|
+
if (e = ke(r), !e)
|
|
857
|
+
return rt ? null : Nt ? J : "";
|
|
825
858
|
}
|
|
826
|
-
e &&
|
|
827
|
-
const
|
|
859
|
+
e && jt && j(e.firstChild);
|
|
860
|
+
const y = f ? r : e, R = ze(y);
|
|
828
861
|
try {
|
|
829
|
-
for (; a =
|
|
830
|
-
|
|
831
|
-
} catch (
|
|
832
|
-
throw
|
|
862
|
+
for (; a = R.nextNode(); )
|
|
863
|
+
Fe(a, y), Ge(a), ct(a.content) && Pt(a.content);
|
|
864
|
+
} catch (C) {
|
|
865
|
+
throw f && (Ct(r), ut(n.removed, (x) => {
|
|
866
|
+
x.element && ee(x.element);
|
|
867
|
+
})), C;
|
|
833
868
|
}
|
|
834
|
-
if (
|
|
835
|
-
return
|
|
836
|
-
|
|
837
|
-
}),
|
|
838
|
-
if (
|
|
839
|
-
if (
|
|
840
|
-
for (
|
|
841
|
-
|
|
869
|
+
if (f)
|
|
870
|
+
return ut(n.removed, (C) => {
|
|
871
|
+
C.element && ee(C.element);
|
|
872
|
+
}), W && ne(r), r;
|
|
873
|
+
if (rt) {
|
|
874
|
+
if (W && ne(e), It)
|
|
875
|
+
for (c = _n.call(e.ownerDocument); e.firstChild; )
|
|
876
|
+
c.appendChild(e.firstChild);
|
|
842
877
|
else
|
|
843
|
-
|
|
844
|
-
return (
|
|
878
|
+
c = e;
|
|
879
|
+
return (T.shadowroot || T.shadowrootmode) && (c = gn.call(l, c, !0)), c;
|
|
845
880
|
}
|
|
846
|
-
let
|
|
847
|
-
return
|
|
848
|
-
` +
|
|
881
|
+
let P = Q ? e.outerHTML : e.innerHTML;
|
|
882
|
+
return Q && _["!doctype"] && e.ownerDocument && e.ownerDocument.doctype && e.ownerDocument.doctype.name && b(bo, e.ownerDocument.doctype.name) && (P = "<!DOCTYPE " + e.ownerDocument.doctype.name + `>
|
|
883
|
+
` + P), W && (P = Mt(P)), D && Nt ? it(P) : P;
|
|
849
884
|
}, n.setConfig = function() {
|
|
850
885
|
let r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
851
|
-
|
|
886
|
+
te(r), Bt = !0, Wt = _, Yt = T;
|
|
852
887
|
}, n.clearConfig = function() {
|
|
853
|
-
|
|
888
|
+
lt = null, Bt = !1, Wt = null, Yt = null, D = Ut, J = "";
|
|
854
889
|
}, n.isValidAttribute = function(r, t, e) {
|
|
855
|
-
|
|
856
|
-
const i =
|
|
857
|
-
return
|
|
890
|
+
lt || te({});
|
|
891
|
+
const i = d(r), a = d(t);
|
|
892
|
+
return Ue(i, a, e);
|
|
858
893
|
}, n.addHook = function(r, t) {
|
|
859
|
-
typeof t == "function" &&
|
|
894
|
+
typeof t == "function" && S(h, r) && ft(h[r], t);
|
|
860
895
|
}, n.removeHook = function(r, t) {
|
|
861
|
-
if (
|
|
896
|
+
if (S(h, r)) {
|
|
862
897
|
if (t !== void 0) {
|
|
863
|
-
const e =
|
|
864
|
-
return e === -1 ? void 0 :
|
|
898
|
+
const e = oo(h[r], t);
|
|
899
|
+
return e === -1 ? void 0 : io(h[r], e, 1)[0];
|
|
865
900
|
}
|
|
866
|
-
return
|
|
901
|
+
return Xe(h[r]);
|
|
867
902
|
}
|
|
868
903
|
}, n.removeHooks = function(r) {
|
|
869
|
-
|
|
904
|
+
S(h, r) && (h[r] = []);
|
|
870
905
|
}, n.removeAllHooks = function() {
|
|
871
|
-
|
|
906
|
+
h = sn();
|
|
872
907
|
}, n;
|
|
873
908
|
}
|
|
874
|
-
var
|
|
875
|
-
const St = /* @__PURE__ */ new Map(),
|
|
876
|
-
function
|
|
877
|
-
const s =
|
|
909
|
+
var No = un();
|
|
910
|
+
const St = /* @__PURE__ */ new Map(), pe = /* @__PURE__ */ new Map();
|
|
911
|
+
function fn(o, n) {
|
|
912
|
+
const s = No.sanitize(o, {
|
|
878
913
|
USE_PROFILES: { svg: !0, svgFilters: !0 },
|
|
879
914
|
FORBID_TAGS: ["script", "use"],
|
|
880
915
|
// <use> can SSRF to external hrefs
|
|
@@ -884,29 +919,29 @@ function cn(o, n) {
|
|
|
884
919
|
throw new Error(`Invalid SVG from ${n}`);
|
|
885
920
|
return m;
|
|
886
921
|
}
|
|
887
|
-
async function
|
|
922
|
+
async function Lo(o) {
|
|
888
923
|
const n = await fetch(o);
|
|
889
924
|
if (!n.ok)
|
|
890
925
|
throw new Error(`Failed to load icon: ${n.status}`);
|
|
891
|
-
return
|
|
926
|
+
return fn(await n.text(), o);
|
|
892
927
|
}
|
|
893
|
-
async function
|
|
894
|
-
return St.has(o) || St.set(o,
|
|
928
|
+
async function an(o) {
|
|
929
|
+
return St.has(o) || St.set(o, Lo(o)), (await St.get(o)).cloneNode(!0);
|
|
895
930
|
}
|
|
896
|
-
function
|
|
897
|
-
let n =
|
|
898
|
-
return n || (n =
|
|
931
|
+
function Do(o) {
|
|
932
|
+
let n = pe.get(o);
|
|
933
|
+
return n || (n = fn(o, "inline SVG source"), pe.set(o, n)), n.cloneNode(!0);
|
|
899
934
|
}
|
|
900
|
-
function
|
|
901
|
-
o ? St.delete(o) : (St.clear(),
|
|
935
|
+
function Fo(o) {
|
|
936
|
+
o ? St.delete(o) : (St.clear(), pe.clear());
|
|
902
937
|
}
|
|
903
|
-
const
|
|
904
|
-
var
|
|
905
|
-
for (var
|
|
906
|
-
(A = o[m]) && (
|
|
907
|
-
return
|
|
908
|
-
},
|
|
909
|
-
const
|
|
938
|
+
const Co = ":host{display:inline-block;width:fit-content;height:fit-content;--_nys-icon-size: var( --nys-icon-size, .7em );box-sizing:content-box!important;vertical-align:middle}@supports (font-size: 1cap){:host{--_nys-icon-size: var(--nys-icon-size, 1cap)}}.nys-icon--svg{width:var(--_nys-icon-size, 1em);height:var(--_nys-icon-size, 1em);display:block;white-space:nowrap}.nys-icon--xs{width:calc(var(--_nys-icon-size) * .75);height:calc(var(--_nys-icon-size) * .75)}.nys-icon--sm{width:calc(var(--_nys-icon-size) * .875);height:calc(var(--_nys-icon-size) * .875)}.nys-icon--md{width:var(--_nys-icon-size);height:var(--_nys-icon-size)}.nys-icon--lg{width:calc(var(--_nys-icon-size) * 1.125);height:calc(var(--_nys-icon-size) * 1.125)}.nys-icon--xl{width:calc(var(--_nys-icon-size) * 1.25);height:calc(var(--_nys-icon-size) * 1.25)}.nys-icon--2xl{width:calc(var(--_nys-icon-size) * 1.5);height:calc(var(--_nys-icon-size) * 1.5)}.nys-icon--3xl{width:calc(var(--_nys-icon-size) * 1.875);height:calc(var(--_nys-icon-size) * 1.875)}.nys-icon--4xl{width:calc(var(--_nys-icon-size) * 2.25);height:calc(var(--_nys-icon-size) * 2.25)}.nys-icon--5xl{width:calc(var(--_nys-icon-size) * 3);height:calc(var(--_nys-icon-size) * 3)}.nys-icon--12{width:.75rem;height:.75rem}.nys-icon--14{width:.875rem;height:.875rem}.nys-icon--16{width:1rem;height:1rem}.nys-icon--18{width:1.125rem;height:1.125rem}.nys-icon--20{width:1.25rem;height:1.25rem}.nys-icon--24{width:1.5rem;height:1.5rem}.nys-icon--32{width:2rem;height:2rem}.nys-icon--40{width:2.5rem;height:2.5rem}.nys-icon--50{width:3.125rem;height:3.125rem}.nys-icon--flip-horizontal{transform:scaleX(-1)}.nys-icon--flip-vertical{transform:scaleY(-1)}.nys-icon--flip-both{transform:scale(-1)}";
|
|
939
|
+
var Mo = Object.defineProperty, q = (o, n, s, l) => {
|
|
940
|
+
for (var u = void 0, m = o.length - 1, A; m >= 0; m--)
|
|
941
|
+
(A = o[m]) && (u = A(n, s, u) || u);
|
|
942
|
+
return u && Mo(n, s, u), u;
|
|
943
|
+
}, V;
|
|
944
|
+
const G = (V = class extends Bn {
|
|
910
945
|
constructor() {
|
|
911
946
|
super(...arguments), this.name = "", this.library = "default", this.ariaLabel = "", this.rotate = "0", this.flip = "", this.color = "", this.size = "md", this._svg = null, this._loadSeq = 0, this._loadPromise = null;
|
|
912
947
|
}
|
|
@@ -918,10 +953,10 @@ const U = ($ = class extends Hn {
|
|
|
918
953
|
})();
|
|
919
954
|
}
|
|
920
955
|
connectedCallback() {
|
|
921
|
-
super.connectedCallback(),
|
|
956
|
+
super.connectedCallback(), We(this.library, this);
|
|
922
957
|
}
|
|
923
958
|
disconnectedCallback() {
|
|
924
|
-
super.disconnectedCallback(),
|
|
959
|
+
super.disconnectedCallback(), Ye(this.library, this);
|
|
925
960
|
}
|
|
926
961
|
/** Called by the icon library registry when the current library changes. */
|
|
927
962
|
redraw() {
|
|
@@ -938,14 +973,14 @@ const U = ($ = class extends Hn {
|
|
|
938
973
|
this._loadIcon();
|
|
939
974
|
}
|
|
940
975
|
updated(n) {
|
|
941
|
-
if (n.has("name") &&
|
|
976
|
+
if (n.has("name") && !V._validName.test(this.name)) {
|
|
942
977
|
console.warn(`nys-icon: invalid name "${this.name}" — ignored`), this._svg = null;
|
|
943
978
|
return;
|
|
944
979
|
}
|
|
945
980
|
if (n.has("name") || n.has("library")) {
|
|
946
981
|
if (n.has("library")) {
|
|
947
982
|
const s = n.get("library");
|
|
948
|
-
s &&
|
|
983
|
+
s && Ye(s, this), We(this.library, this);
|
|
949
984
|
}
|
|
950
985
|
this._loadIcon();
|
|
951
986
|
}
|
|
@@ -954,7 +989,7 @@ const U = ($ = class extends Hn {
|
|
|
954
989
|
_loadIcon() {
|
|
955
990
|
const n = ++this._loadSeq;
|
|
956
991
|
this._loadPromise = (async () => {
|
|
957
|
-
const s =
|
|
992
|
+
const s = Vn(this.library);
|
|
958
993
|
if (!s || !this.name) {
|
|
959
994
|
this._svg = null;
|
|
960
995
|
return;
|
|
@@ -966,9 +1001,9 @@ const U = ($ = class extends Hn {
|
|
|
966
1001
|
this._svg = null;
|
|
967
1002
|
return;
|
|
968
1003
|
}
|
|
969
|
-
const
|
|
1004
|
+
const u = typeof l == "string" ? await an(l) : l.type === "url" ? await an(l.href) : Do(l.content);
|
|
970
1005
|
if (n !== this._loadSeq) return;
|
|
971
|
-
s.mutator?.(
|
|
1006
|
+
s.mutator?.(u), this._applyAttributes(u), this._svg = u;
|
|
972
1007
|
} catch {
|
|
973
1008
|
n === this._loadSeq && (this._svg = null);
|
|
974
1009
|
}
|
|
@@ -978,40 +1013,40 @@ const U = ($ = class extends Hn {
|
|
|
978
1013
|
n.setAttribute("role", "img"), this.ariaLabel ? (n.setAttribute("aria-label", this.ariaLabel), n.removeAttribute("aria-hidden")) : (n.setAttribute("aria-hidden", "true"), n.removeAttribute("aria-label")), this.rotate && this.rotate !== "0" ? n.style.rotate = `${this.rotate}deg` : n.style.removeProperty("rotate"), n.style.color = this.color || "currentcolor", n.classList.add(`nys-icon--${this.size}`), n.classList.add("nys-icon--svg"), this.flip && n.classList.add(`nys-icon--flip-${this.flip}`);
|
|
979
1014
|
}
|
|
980
1015
|
render() {
|
|
981
|
-
return this._svg ?
|
|
1016
|
+
return this._svg ? Yn`${this._svg}` : null;
|
|
982
1017
|
}
|
|
983
|
-
},
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
],
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
],
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
],
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
],
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
],
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
],
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
],
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
],
|
|
1008
|
-
let
|
|
1009
|
-
customElements.get("nys-icon") || customElements.define("nys-icon",
|
|
1018
|
+
}, V.styles = Wn(Co), V._validName = /^[a-zA-Z0-9_-]+$/, V);
|
|
1019
|
+
q([
|
|
1020
|
+
nt({ type: String, reflect: !0 })
|
|
1021
|
+
], G.prototype, "name");
|
|
1022
|
+
q([
|
|
1023
|
+
nt({ type: String, reflect: !0 })
|
|
1024
|
+
], G.prototype, "library");
|
|
1025
|
+
q([
|
|
1026
|
+
nt({ type: String })
|
|
1027
|
+
], G.prototype, "ariaLabel");
|
|
1028
|
+
q([
|
|
1029
|
+
nt({ type: String })
|
|
1030
|
+
], G.prototype, "rotate");
|
|
1031
|
+
q([
|
|
1032
|
+
nt({ type: String })
|
|
1033
|
+
], G.prototype, "flip");
|
|
1034
|
+
q([
|
|
1035
|
+
nt({ type: String })
|
|
1036
|
+
], G.prototype, "color");
|
|
1037
|
+
q([
|
|
1038
|
+
nt({ type: String })
|
|
1039
|
+
], G.prototype, "size");
|
|
1040
|
+
q([
|
|
1041
|
+
jn()
|
|
1042
|
+
], G.prototype, "_svg");
|
|
1043
|
+
let vo = G;
|
|
1044
|
+
customElements.get("nys-icon") || customElements.define("nys-icon", vo);
|
|
1010
1045
|
export {
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1046
|
+
vo as NysIcon,
|
|
1047
|
+
Fo as clearIconCache,
|
|
1048
|
+
Vn as getIconLibrary,
|
|
1049
|
+
ko as registerIconLibrary,
|
|
1050
|
+
zo as unregisterIconLibrary
|
|
1016
1051
|
};
|
|
1017
1052
|
//# sourceMappingURL=nys-icon.js.map
|