@nysds/nys-icon 1.19.3 → 1.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/icon-cache.d.ts +18 -0
- package/dist/icon-library-registry.d.ts +64 -0
- package/dist/index.d.ts +4 -0
- package/dist/nys-icon.d.ts +164 -0
- package/dist/nys-icon.figma.d.ts +1 -0
- package/dist/nys-icon.js +579 -506
- package/dist/nys-icon.js.map +1 -1
- package/dist/{nys-icon.library-BwGLLd_g.js → nys-icon.library-Bu3noJqZ.js} +2 -2
- package/dist/{nys-icon.library-BwGLLd_g.js.map → nys-icon.library-Bu3noJqZ.js.map} +1 -1
- package/dist/nys-icon.library.d.ts +2 -0
- package/package.json +2 -1
package/dist/nys-icon.js
CHANGED
|
@@ -1,213 +1,236 @@
|
|
|
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 $n } from "lit/decorators.js";
|
|
3
3
|
/*!
|
|
4
4
|
* █▄ █ █ █ █▀▀▀█ █▀▀▄ █▀▀▀█
|
|
5
5
|
* █ █ █ █▄▄▄█ ▀▀▀▄▄ █ █ ▀▀▀▄▄
|
|
6
6
|
* █ ▀█ █ █▄▄▄█ █▄▄▀ █▄▄▄█
|
|
7
7
|
*
|
|
8
|
-
* Icon Component v1.
|
|
8
|
+
* Icon Component v1.20.0
|
|
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
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
/*!
|
|
14
|
+
* New York State Design System v1.20.0
|
|
15
|
+
* Description: A design system for New York State's digital products.
|
|
16
|
+
* Repository: https://github.com/its-hcd/nysds
|
|
17
|
+
* License: MIT
|
|
18
|
+
*/
|
|
19
|
+
let jn = 0;
|
|
20
|
+
function Xn(i) {
|
|
21
|
+
return `${i}-${Date.now()}-${jn++}`;
|
|
19
22
|
}
|
|
20
|
-
|
|
21
|
-
|
|
23
|
+
const Vn = (i) => {
|
|
24
|
+
class n extends i {
|
|
25
|
+
get idPrefix() {
|
|
26
|
+
return this.localName || "nys-element";
|
|
27
|
+
}
|
|
28
|
+
ensureId() {
|
|
29
|
+
this.id || (this.id = Xn(this.idPrefix));
|
|
30
|
+
}
|
|
31
|
+
connectedCallback() {
|
|
32
|
+
super.connectedCallback(), this.ensureId();
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return n;
|
|
36
|
+
}, qn = /* @__PURE__ */ Vn(Bn), Ot = globalThis.__nysIconRegistry ??= /* @__PURE__ */ new Map(), mt = globalThis.__nysIconWatchers ??= /* @__PURE__ */ new Map();
|
|
37
|
+
let oe = null, Be = null;
|
|
38
|
+
async function Kn() {
|
|
39
|
+
return oe || (Be ??= import("./nys-icon.library-Bu3noJqZ.js").then(
|
|
40
|
+
(i) => oe = i.default
|
|
41
|
+
), Be);
|
|
42
|
+
}
|
|
43
|
+
function Zn() {
|
|
44
|
+
if (globalThis.__nysIconDefaultRegistered || Ot.has("default")) {
|
|
22
45
|
globalThis.__nysIconDefaultRegistered = !0;
|
|
23
46
|
return;
|
|
24
47
|
}
|
|
25
|
-
globalThis.__nysIconDefaultRegistered = !0,
|
|
26
|
-
resolver: async (
|
|
27
|
-
if (!
|
|
28
|
-
const s = (await
|
|
48
|
+
globalThis.__nysIconDefaultRegistered = !0, Ot.set("default", {
|
|
49
|
+
resolver: async (i) => {
|
|
50
|
+
if (!i) return;
|
|
51
|
+
const s = (await Kn())[i];
|
|
29
52
|
return s ? { type: "svg", content: s } : void 0;
|
|
30
53
|
}
|
|
31
54
|
});
|
|
32
55
|
}
|
|
33
|
-
function
|
|
34
|
-
|
|
56
|
+
function Ui(i, n) {
|
|
57
|
+
Ot.set(i, n), mt.get(i)?.forEach((s) => s.redraw());
|
|
35
58
|
}
|
|
36
|
-
function
|
|
37
|
-
|
|
59
|
+
function Hi(i) {
|
|
60
|
+
Ot.delete(i), mt.get(i)?.forEach((n) => n.redraw());
|
|
38
61
|
}
|
|
39
|
-
function
|
|
40
|
-
return
|
|
62
|
+
function Jn(i) {
|
|
63
|
+
return Zn(), Ot.get(i);
|
|
41
64
|
}
|
|
42
|
-
function
|
|
43
|
-
|
|
65
|
+
function We(i, n) {
|
|
66
|
+
mt.has(i) || mt.set(i, /* @__PURE__ */ new Set()), mt.get(i).add(n);
|
|
44
67
|
}
|
|
45
|
-
function
|
|
46
|
-
|
|
68
|
+
function Ye(i, n) {
|
|
69
|
+
mt.get(i)?.delete(n);
|
|
47
70
|
}
|
|
48
|
-
/*! @license DOMPurify 3.4.
|
|
49
|
-
function
|
|
50
|
-
(n == null || n >
|
|
51
|
-
for (var s = 0, l = Array(n); s < n; s++) l[s] =
|
|
71
|
+
/*! @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 */
|
|
72
|
+
function $e(i, n) {
|
|
73
|
+
(n == null || n > i.length) && (n = i.length);
|
|
74
|
+
for (var s = 0, l = Array(n); s < n; s++) l[s] = i[s];
|
|
52
75
|
return l;
|
|
53
76
|
}
|
|
54
|
-
function
|
|
55
|
-
if (Array.isArray(
|
|
77
|
+
function Qn(i) {
|
|
78
|
+
if (Array.isArray(i)) return i;
|
|
56
79
|
}
|
|
57
|
-
function
|
|
58
|
-
var s =
|
|
80
|
+
function ti(i, n) {
|
|
81
|
+
var s = i == null ? null : typeof Symbol < "u" && i[Symbol.iterator] || i["@@iterator"];
|
|
59
82
|
if (s != null) {
|
|
60
|
-
var l,
|
|
83
|
+
var l, u, m, A, dt = [], M = !0, ht = !1;
|
|
61
84
|
try {
|
|
62
|
-
if (m = (s = s.call(
|
|
63
|
-
} catch (
|
|
64
|
-
|
|
85
|
+
if (m = (s = s.call(i)).next, n !== 0) for (; !(M = (l = m.call(s)).done) && (dt.push(l.value), dt.length !== n); M = !0) ;
|
|
86
|
+
} catch (kt) {
|
|
87
|
+
ht = !0, u = kt;
|
|
65
88
|
} finally {
|
|
66
89
|
try {
|
|
67
|
-
if (!
|
|
90
|
+
if (!M && s.return != null && (A = s.return(), Object(A) !== A)) return;
|
|
68
91
|
} finally {
|
|
69
|
-
if (
|
|
92
|
+
if (ht) throw u;
|
|
70
93
|
}
|
|
71
94
|
}
|
|
72
|
-
return
|
|
95
|
+
return dt;
|
|
73
96
|
}
|
|
74
97
|
}
|
|
75
|
-
function
|
|
98
|
+
function ei() {
|
|
76
99
|
throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
77
100
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
78
101
|
}
|
|
79
|
-
function
|
|
80
|
-
return
|
|
102
|
+
function ni(i, n) {
|
|
103
|
+
return Qn(i) || ti(i, n) || ii(i, n) || ei();
|
|
81
104
|
}
|
|
82
|
-
function
|
|
83
|
-
if (
|
|
84
|
-
if (typeof
|
|
85
|
-
var s = {}.toString.call(
|
|
86
|
-
return s === "Object" &&
|
|
105
|
+
function ii(i, n) {
|
|
106
|
+
if (i) {
|
|
107
|
+
if (typeof i == "string") return $e(i, n);
|
|
108
|
+
var s = {}.toString.call(i).slice(8, -1);
|
|
109
|
+
return s === "Object" && i.constructor && (s = i.constructor.name), s === "Map" || s === "Set" ? Array.from(i) : s === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s) ? $e(i, n) : void 0;
|
|
87
110
|
}
|
|
88
111
|
}
|
|
89
|
-
const
|
|
90
|
-
let
|
|
91
|
-
|
|
112
|
+
const ln = Object.entries, je = Object.setPrototypeOf, oi = Object.isFrozen, ri = Object.getPrototypeOf, si = Object.getOwnPropertyDescriptor;
|
|
113
|
+
let O = Object.freeze, w = Object.seal, pt = Object.create, cn = typeof Reflect < "u" && Reflect, ue = cn.apply, fe = cn.construct;
|
|
114
|
+
O || (O = function(n) {
|
|
92
115
|
return n;
|
|
93
116
|
});
|
|
94
|
-
|
|
117
|
+
w || (w = function(n) {
|
|
95
118
|
return n;
|
|
96
119
|
});
|
|
97
|
-
|
|
98
|
-
for (var l = arguments.length,
|
|
99
|
-
|
|
100
|
-
return n.apply(s,
|
|
120
|
+
ue || (ue = function(n, s) {
|
|
121
|
+
for (var l = arguments.length, u = new Array(l > 2 ? l - 2 : 0), m = 2; m < l; m++)
|
|
122
|
+
u[m - 2] = arguments[m];
|
|
123
|
+
return n.apply(s, u);
|
|
101
124
|
});
|
|
102
|
-
|
|
103
|
-
for (var s = arguments.length, l = new Array(s > 1 ? s - 1 : 0),
|
|
104
|
-
l[
|
|
125
|
+
fe || (fe = function(n) {
|
|
126
|
+
for (var s = arguments.length, l = new Array(s > 1 ? s - 1 : 0), u = 1; u < s; u++)
|
|
127
|
+
l[u - 1] = arguments[u];
|
|
105
128
|
return new n(...l);
|
|
106
129
|
});
|
|
107
|
-
const
|
|
108
|
-
function E(
|
|
130
|
+
const ut = E(Array.prototype.forEach), ai = E(Array.prototype.lastIndexOf), Xe = E(Array.prototype.pop), ft = E(Array.prototype.push), li = 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), ci = E(String.prototype.trim), ui = E(Number.prototype.toString), fi = 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 = pi(TypeError);
|
|
131
|
+
function E(i) {
|
|
109
132
|
return function(n) {
|
|
110
133
|
n instanceof RegExp && (n.lastIndex = 0);
|
|
111
|
-
for (var s = arguments.length, l = new Array(s > 1 ? s - 1 : 0),
|
|
112
|
-
l[
|
|
113
|
-
return
|
|
134
|
+
for (var s = arguments.length, l = new Array(s > 1 ? s - 1 : 0), u = 1; u < s; u++)
|
|
135
|
+
l[u - 1] = arguments[u];
|
|
136
|
+
return ue(i, n, l);
|
|
114
137
|
};
|
|
115
138
|
}
|
|
116
|
-
function
|
|
139
|
+
function pi(i) {
|
|
117
140
|
return function() {
|
|
118
141
|
for (var n = arguments.length, s = new Array(n), l = 0; l < n; l++)
|
|
119
142
|
s[l] = arguments[l];
|
|
120
|
-
return
|
|
143
|
+
return fe(i, s);
|
|
121
144
|
};
|
|
122
145
|
}
|
|
123
|
-
function
|
|
124
|
-
let s = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] :
|
|
125
|
-
if (je && je(
|
|
126
|
-
return
|
|
146
|
+
function p(i, n) {
|
|
147
|
+
let s = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : bt;
|
|
148
|
+
if (je && je(i, null), !X(n))
|
|
149
|
+
return i;
|
|
127
150
|
let l = n.length;
|
|
128
151
|
for (; l--; ) {
|
|
129
|
-
let
|
|
130
|
-
if (typeof
|
|
131
|
-
const m = s(
|
|
132
|
-
m !==
|
|
152
|
+
let u = n[l];
|
|
153
|
+
if (typeof u == "string") {
|
|
154
|
+
const m = s(u);
|
|
155
|
+
m !== u && (oi(n) || (n[l] = m), u = m);
|
|
133
156
|
}
|
|
134
|
-
|
|
157
|
+
i[u] = !0;
|
|
135
158
|
}
|
|
136
|
-
return
|
|
159
|
+
return i;
|
|
137
160
|
}
|
|
138
|
-
function
|
|
139
|
-
for (let n = 0; n <
|
|
140
|
-
|
|
141
|
-
return
|
|
161
|
+
function mi(i) {
|
|
162
|
+
for (let n = 0; n < i.length; n++)
|
|
163
|
+
S(i, n) || (i[n] = null);
|
|
164
|
+
return i;
|
|
142
165
|
}
|
|
143
|
-
function
|
|
144
|
-
const n =
|
|
145
|
-
for (const l of
|
|
146
|
-
var s =
|
|
147
|
-
const
|
|
148
|
-
|
|
166
|
+
function L(i) {
|
|
167
|
+
const n = pt(null);
|
|
168
|
+
for (const l of ln(i)) {
|
|
169
|
+
var s = ni(l, 2);
|
|
170
|
+
const u = s[0], m = s[1];
|
|
171
|
+
S(i, u) && (X(m) ? n[u] = mi(m) : m && typeof m == "object" && m.constructor === Object ? n[u] = L(m) : n[u] = m);
|
|
149
172
|
}
|
|
150
173
|
return n;
|
|
151
174
|
}
|
|
152
|
-
function
|
|
153
|
-
switch (typeof
|
|
175
|
+
function di(i) {
|
|
176
|
+
switch (typeof i) {
|
|
154
177
|
case "string":
|
|
155
|
-
return
|
|
178
|
+
return i;
|
|
156
179
|
case "number":
|
|
157
|
-
return
|
|
180
|
+
return ui(i);
|
|
158
181
|
case "boolean":
|
|
159
|
-
return
|
|
182
|
+
return fi(i);
|
|
160
183
|
case "bigint":
|
|
161
|
-
return
|
|
184
|
+
return Ke ? Ke(i) : "0";
|
|
162
185
|
case "symbol":
|
|
163
|
-
return
|
|
186
|
+
return Ze ? Ze(i) : "Symbol()";
|
|
164
187
|
case "undefined":
|
|
165
|
-
return
|
|
188
|
+
return At(i);
|
|
166
189
|
case "function":
|
|
167
190
|
case "object": {
|
|
168
|
-
if (
|
|
169
|
-
return
|
|
170
|
-
const n =
|
|
191
|
+
if (i === null)
|
|
192
|
+
return At(i);
|
|
193
|
+
const n = i, s = H(n, "toString");
|
|
171
194
|
if (typeof s == "function") {
|
|
172
195
|
const l = s(n);
|
|
173
|
-
return typeof l == "string" ? l :
|
|
196
|
+
return typeof l == "string" ? l : At(l);
|
|
174
197
|
}
|
|
175
|
-
return
|
|
198
|
+
return At(i);
|
|
176
199
|
}
|
|
177
200
|
default:
|
|
178
|
-
return
|
|
201
|
+
return At(i);
|
|
179
202
|
}
|
|
180
203
|
}
|
|
181
|
-
function
|
|
182
|
-
for (;
|
|
183
|
-
const l =
|
|
204
|
+
function H(i, n) {
|
|
205
|
+
for (; i !== null; ) {
|
|
206
|
+
const l = si(i, n);
|
|
184
207
|
if (l) {
|
|
185
208
|
if (l.get)
|
|
186
209
|
return E(l.get);
|
|
187
210
|
if (typeof l.value == "function")
|
|
188
211
|
return E(l.value);
|
|
189
212
|
}
|
|
190
|
-
|
|
213
|
+
i = ri(i);
|
|
191
214
|
}
|
|
192
215
|
function s() {
|
|
193
216
|
return null;
|
|
194
217
|
}
|
|
195
218
|
return s;
|
|
196
219
|
}
|
|
197
|
-
function
|
|
220
|
+
function hi(i) {
|
|
198
221
|
try {
|
|
199
|
-
return
|
|
222
|
+
return b(i, ""), !0;
|
|
200
223
|
} catch {
|
|
201
224
|
return !1;
|
|
202
225
|
}
|
|
203
226
|
}
|
|
204
|
-
const
|
|
227
|
+
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"]), _i = 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"]), Ti = 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"]), gi = w(/{{[\w\W]*|^[\w\W]*}}/g), yi = w(/<%[\w\W]*|^[\w\W]*%>/g), Ei = w(/\${[\w\W]*/g), Ai = w(/^data-[\-\w.\u00B7-\uFFFF]+$/), bi = w(/^aria-[\-\w]+$/), nn = w(
|
|
205
228
|
/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
|
|
206
229
|
// eslint-disable-line no-useless-escape
|
|
207
|
-
),
|
|
230
|
+
), Si = w(/^(?:\w+script|data):/i), Oi = w(
|
|
208
231
|
/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
|
|
209
232
|
// eslint-disable-line no-control-regex
|
|
210
|
-
),
|
|
233
|
+
), wi = w(/^html$/i), Ri = w(/^[a-z][.\w]*(-[.\w]+)+$/i), on = w(/<[/\w!]/g), rn = w(/<[/\w]/g), Ii = w(/<\/no(script|embed|frames)/i), Ni = w(/\/>/i), v = {
|
|
211
234
|
element: 1,
|
|
212
235
|
attribute: 2,
|
|
213
236
|
text: 3,
|
|
@@ -223,14 +246,14 @@ const Ze = w(["a", "abbr", "acronym", "address", "area", "article", "aside", "au
|
|
|
223
246
|
documentFragment: 11,
|
|
224
247
|
notation: 12
|
|
225
248
|
// Deprecated
|
|
226
|
-
},
|
|
249
|
+
}, Li = function() {
|
|
227
250
|
return typeof window > "u" ? null : window;
|
|
228
|
-
},
|
|
251
|
+
}, Di = function(n, s) {
|
|
229
252
|
if (typeof n != "object" || typeof n.createPolicy != "function")
|
|
230
253
|
return null;
|
|
231
254
|
let l = null;
|
|
232
|
-
const
|
|
233
|
-
s && s.hasAttribute(
|
|
255
|
+
const u = "data-tt-policy-suffix";
|
|
256
|
+
s && s.hasAttribute(u) && (l = s.getAttribute(u));
|
|
234
257
|
const m = "dompurify" + (l ? "#" + l : "");
|
|
235
258
|
try {
|
|
236
259
|
return n.createPolicy(m, {
|
|
@@ -244,7 +267,7 @@ const Ze = w(["a", "abbr", "acronym", "address", "area", "article", "aside", "au
|
|
|
244
267
|
} catch {
|
|
245
268
|
return console.warn("TrustedTypes policy " + m + " could not be created."), null;
|
|
246
269
|
}
|
|
247
|
-
},
|
|
270
|
+
}, sn = function() {
|
|
248
271
|
return {
|
|
249
272
|
afterSanitizeAttributes: [],
|
|
250
273
|
afterSanitizeElements: [],
|
|
@@ -256,53 +279,53 @@ const Ze = w(["a", "abbr", "acronym", "address", "area", "article", "aside", "au
|
|
|
256
279
|
uponSanitizeElement: [],
|
|
257
280
|
uponSanitizeShadowNode: []
|
|
258
281
|
};
|
|
259
|
-
},
|
|
260
|
-
return
|
|
282
|
+
}, j = function(n, s, l, u) {
|
|
283
|
+
return S(n, s) && X(n[s]) ? p(u.base ? L(u.base) : {}, n[s], u.transform) : l;
|
|
261
284
|
};
|
|
262
|
-
function
|
|
263
|
-
let
|
|
264
|
-
const n = (r) =>
|
|
265
|
-
if (n.version = "3.4.
|
|
285
|
+
function un() {
|
|
286
|
+
let i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Li();
|
|
287
|
+
const n = (r) => un(r);
|
|
288
|
+
if (n.version = "3.4.12", n.removed = [], !i || !i.document || i.document.nodeType !== v.document || !i.Element)
|
|
266
289
|
return n.isSupported = !1, n;
|
|
267
|
-
let s =
|
|
268
|
-
const l = s,
|
|
269
|
-
|
|
270
|
-
const m =
|
|
271
|
-
|
|
272
|
-
const
|
|
290
|
+
let s = i.document;
|
|
291
|
+
const l = s, u = l.currentScript;
|
|
292
|
+
i.DocumentFragment;
|
|
293
|
+
const m = i.HTMLTemplateElement, A = i.Node, dt = i.Element, M = i.NodeFilter, ht = i.NamedNodeMap;
|
|
294
|
+
ht === void 0 && (i.NamedNodeMap || i.MozNamedAttrMap), i.HTMLFormElement;
|
|
295
|
+
const kt = i.DOMParser, wt = i.trustedTypes, K = dt.prototype, pn = H(K, "cloneNode"), zt = H(K, "remove"), mn = H(K, "nextSibling"), it = 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
296
|
if (typeof m == "function") {
|
|
274
297
|
const r = s.createElement("template");
|
|
275
298
|
r.content && r.content.ownerDocument && (s = r.content.ownerDocument);
|
|
276
299
|
}
|
|
277
|
-
let
|
|
278
|
-
const
|
|
279
|
-
if (
|
|
280
|
-
throw
|
|
281
|
-
},
|
|
282
|
-
|
|
300
|
+
let D, J = "", Ut, de = !1, _t = 0;
|
|
301
|
+
const he = function() {
|
|
302
|
+
if (_t > 0)
|
|
303
|
+
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.');
|
|
304
|
+
}, ot = function(t) {
|
|
305
|
+
he(), _t++;
|
|
283
306
|
try {
|
|
284
|
-
return
|
|
307
|
+
return D.createHTML(t);
|
|
285
308
|
} finally {
|
|
286
|
-
|
|
309
|
+
_t--;
|
|
287
310
|
}
|
|
288
|
-
},
|
|
289
|
-
|
|
311
|
+
}, dn = function(t) {
|
|
312
|
+
he(), _t++;
|
|
290
313
|
try {
|
|
291
|
-
return
|
|
314
|
+
return D.createScriptURL(t);
|
|
292
315
|
} finally {
|
|
293
|
-
|
|
294
|
-
}
|
|
295
|
-
},
|
|
296
|
-
return
|
|
297
|
-
},
|
|
298
|
-
let
|
|
299
|
-
n.isSupported = typeof
|
|
300
|
-
const
|
|
301
|
-
let
|
|
302
|
-
const
|
|
303
|
-
let
|
|
304
|
-
const
|
|
305
|
-
let
|
|
316
|
+
_t--;
|
|
317
|
+
}
|
|
318
|
+
}, hn = function() {
|
|
319
|
+
return de || (Ut = Di(wt, u), de = !0), Ut;
|
|
320
|
+
}, Rt = s, Ht = Rt.implementation, _e = Rt.createNodeIterator, _n = Rt.createDocumentFragment, Tn = Rt.getElementsByTagName, gn = l.importNode;
|
|
321
|
+
let h = sn();
|
|
322
|
+
n.isSupported = typeof ln == "function" && typeof Z == "function" && Ht && Ht.createHTMLDocument !== void 0;
|
|
323
|
+
const yn = gi, En = yi, An = Ei, bn = Ai, Sn = bi, On = Si, Te = Oi, wn = Ri;
|
|
324
|
+
let ge = nn, _ = null;
|
|
325
|
+
const ye = p({}, [...Je, ...se, ...ae, ...le, ...Qe]);
|
|
326
|
+
let T = null;
|
|
327
|
+
const Ee = p({}, [...tn, ...ce, ...en, ...xt]);
|
|
328
|
+
let g = Object.seal(pt(null, {
|
|
306
329
|
tagNameCheck: {
|
|
307
330
|
writable: !0,
|
|
308
331
|
configurable: !1,
|
|
@@ -321,8 +344,8 @@ function ln() {
|
|
|
321
344
|
enumerable: !0,
|
|
322
345
|
value: !1
|
|
323
346
|
}
|
|
324
|
-
})),
|
|
325
|
-
const
|
|
347
|
+
})), Tt = null, Ae = null;
|
|
348
|
+
const B = Object.seal(pt(null, {
|
|
326
349
|
tagCheck: {
|
|
327
350
|
writable: !0,
|
|
328
351
|
configurable: !1,
|
|
@@ -336,10 +359,10 @@ function ln() {
|
|
|
336
359
|
value: null
|
|
337
360
|
}
|
|
338
361
|
}));
|
|
339
|
-
let
|
|
340
|
-
const
|
|
341
|
-
let
|
|
342
|
-
const
|
|
362
|
+
let be = !0, Gt = !0, Se = !1, Oe = !0, W = !1, Y = !0, Q = !1, Bt = !1, Wt = null, Yt = null, $t = !1, rt = !1, It = !1, Nt = !1, we = !0, Re = !1;
|
|
363
|
+
const Ie = "user-content-";
|
|
364
|
+
let jt = !0, Xt = !1, st = {}, z = null;
|
|
365
|
+
const Vt = p({}, [
|
|
343
366
|
"annotation-xml",
|
|
344
367
|
"audio",
|
|
345
368
|
"colgroup",
|
|
@@ -376,123 +399,124 @@ function ln() {
|
|
|
376
399
|
"video",
|
|
377
400
|
"xmp"
|
|
378
401
|
]);
|
|
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
|
|
402
|
+
let Ne = null;
|
|
403
|
+
const Le = p({}, ["audio", "video", "img", "source", "image", "track"]);
|
|
404
|
+
let qt = null;
|
|
405
|
+
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";
|
|
406
|
+
let at = F, Kt = !1, Zt = null;
|
|
407
|
+
const Rn = p({}, [Lt, Dt, F], re), Ce = O(["mi", "mo", "mn", "ms", "mtext"]);
|
|
408
|
+
let Jt = p({}, Ce);
|
|
409
|
+
const Me = O(["annotation-xml"]);
|
|
410
|
+
let Qt = p({}, Me);
|
|
411
|
+
const In = p({}, ["title", "style", "font", "a", "script"]);
|
|
412
|
+
let gt = null;
|
|
413
|
+
const Nn = ["application/xhtml+xml", "text/html"], Ln = "text/html";
|
|
414
|
+
let d = null, lt = null;
|
|
415
|
+
const Dn = s.createElement("form"), ve = function(t) {
|
|
393
416
|
return t instanceof RegExp || t instanceof Function;
|
|
394
|
-
},
|
|
417
|
+
}, te = function() {
|
|
395
418
|
let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
396
|
-
if (
|
|
419
|
+
if (lt && lt === t)
|
|
397
420
|
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 (
|
|
421
|
+
(!t || typeof t != "object") && (t = {}), t = L(t), gt = // eslint-disable-next-line unicorn/prefer-includes
|
|
422
|
+
Nn.indexOf(t.PARSER_MEDIA_TYPE) === -1 ? Ln : t.PARSER_MEDIA_TYPE, d = gt === "application/xhtml+xml" ? re : bt, _ = j(t, "ALLOWED_TAGS", ye, {
|
|
423
|
+
transform: d
|
|
424
|
+
}), T = j(t, "ALLOWED_ATTR", Ee, {
|
|
425
|
+
transform: d
|
|
426
|
+
}), Zt = j(t, "ALLOWED_NAMESPACES", Rn, {
|
|
427
|
+
transform: re
|
|
428
|
+
}), qt = j(t, "ADD_URI_SAFE_ATTR", De, {
|
|
429
|
+
transform: d,
|
|
430
|
+
base: De
|
|
431
|
+
}), Ne = j(t, "ADD_DATA_URI_TAGS", Le, {
|
|
432
|
+
transform: d,
|
|
433
|
+
base: Le
|
|
434
|
+
}), z = j(t, "FORBID_CONTENTS", Vt, {
|
|
435
|
+
transform: d
|
|
436
|
+
}), Tt = j(t, "FORBID_TAGS", L({}), {
|
|
437
|
+
transform: d
|
|
438
|
+
}), Ae = j(t, "FORBID_ATTR", L({}), {
|
|
439
|
+
transform: d
|
|
440
|
+
}), 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, $t = t.FORCE_BODY || !1, we = t.SANITIZE_DOM !== !1, Re = t.SANITIZE_NAMED_PROPS || !1, jt = t.KEEP_CONTENT !== !1, Xt = t.IN_PLACE || !1, ge = hi(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);
|
|
441
|
+
const e = S(t, "CUSTOM_ELEMENT_HANDLING") && t.CUSTOM_ELEMENT_HANDLING && typeof t.CUSTOM_ELEMENT_HANDLING == "object" ? L(t.CUSTOM_ELEMENT_HANDLING) : pt(null);
|
|
442
|
+
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)), jt && (_["#text"] = !0), Q && p(_, ["html", "head", "body"]), _.table && (p(_, ["tbody"]), delete Tt.tbody), t.TRUSTED_TYPES_POLICY) {
|
|
420
443
|
if (typeof t.TRUSTED_TYPES_POLICY.createHTML != "function")
|
|
421
|
-
throw
|
|
444
|
+
throw et('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
|
|
422
445
|
if (typeof t.TRUSTED_TYPES_POLICY.createScriptURL != "function")
|
|
423
|
-
throw
|
|
424
|
-
const
|
|
425
|
-
|
|
446
|
+
throw et('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
|
|
447
|
+
const o = D;
|
|
448
|
+
D = t.TRUSTED_TYPES_POLICY;
|
|
426
449
|
try {
|
|
427
|
-
|
|
450
|
+
J = ot("");
|
|
428
451
|
} catch (a) {
|
|
429
|
-
throw
|
|
452
|
+
throw D = o, a;
|
|
430
453
|
}
|
|
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 =
|
|
454
|
+
} else t.TRUSTED_TYPES_POLICY === null ? (D = void 0, J = "") : (D === void 0 && (D = hn()), D && typeof J == "string" && (J = ot("")));
|
|
455
|
+
O && O(t), lt = t;
|
|
456
|
+
}, Pe = p({}, [...se, ...ae, ..._i]), xe = p({}, [...le, ...Ti]), Cn = function(t, e, o) {
|
|
457
|
+
return e.namespaceURI === F ? t === "svg" : e.namespaceURI === Lt ? t === "svg" && (o === "annotation-xml" || Jt[o]) : !!Pe[t];
|
|
458
|
+
}, Mn = function(t, e, o) {
|
|
459
|
+
return e.namespaceURI === F ? t === "math" : e.namespaceURI === Dt ? t === "math" && Qt[o] : !!xe[t];
|
|
460
|
+
}, vn = function(t, e, o) {
|
|
461
|
+
return e.namespaceURI === Dt && !Qt[o] || e.namespaceURI === Lt && !Jt[o] ? !1 : !xe[t] && (In[t] || !Pe[t]);
|
|
462
|
+
}, Pn = function(t) {
|
|
463
|
+
let e = Z(t);
|
|
441
464
|
(!e || !e.tagName) && (e = {
|
|
442
|
-
namespaceURI:
|
|
465
|
+
namespaceURI: at,
|
|
443
466
|
tagName: "template"
|
|
444
467
|
});
|
|
445
|
-
const
|
|
446
|
-
return
|
|
447
|
-
},
|
|
448
|
-
|
|
468
|
+
const o = bt(t.tagName), a = bt(e.tagName);
|
|
469
|
+
return Zt[t.namespaceURI] ? t.namespaceURI === Dt ? Cn(o, e, a) : t.namespaceURI === Lt ? Mn(o, e, a) : t.namespaceURI === F ? vn(o, e, a) : !!(gt === "application/xhtml+xml" && Zt[t.namespaceURI]) : !1;
|
|
470
|
+
}, $ = function(t) {
|
|
471
|
+
ft(n.removed, {
|
|
449
472
|
element: t
|
|
450
473
|
});
|
|
451
474
|
try {
|
|
452
|
-
|
|
475
|
+
Z(t).removeChild(t);
|
|
453
476
|
} catch {
|
|
454
|
-
if (
|
|
455
|
-
throw
|
|
477
|
+
if (zt(t), !Z(t))
|
|
478
|
+
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
479
|
}
|
|
457
|
-
},
|
|
458
|
-
|
|
480
|
+
}, Ct = function(t) {
|
|
481
|
+
ee(t);
|
|
482
|
+
const e = it(t);
|
|
459
483
|
if (e) {
|
|
460
484
|
const a = [];
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
}),
|
|
485
|
+
ut(e, (c) => {
|
|
486
|
+
ft(a, c);
|
|
487
|
+
}), ut(a, (c) => {
|
|
464
488
|
try {
|
|
465
|
-
|
|
489
|
+
zt(c);
|
|
466
490
|
} catch {
|
|
467
491
|
}
|
|
468
492
|
});
|
|
469
493
|
}
|
|
470
|
-
const
|
|
471
|
-
if (
|
|
472
|
-
for (let a =
|
|
473
|
-
const
|
|
474
|
-
if (typeof
|
|
494
|
+
const o = Ft(t);
|
|
495
|
+
if (o)
|
|
496
|
+
for (let a = o.length - 1; a >= 0; --a) {
|
|
497
|
+
const c = o[a], f = c && c.name;
|
|
498
|
+
if (typeof f == "string")
|
|
475
499
|
try {
|
|
476
|
-
t.removeAttribute(
|
|
500
|
+
t.removeAttribute(f);
|
|
477
501
|
} catch {
|
|
478
502
|
}
|
|
479
503
|
}
|
|
480
|
-
},
|
|
504
|
+
}, tt = function(t, e) {
|
|
481
505
|
try {
|
|
482
|
-
|
|
506
|
+
ft(n.removed, {
|
|
483
507
|
attribute: e.getAttributeNode(t),
|
|
484
508
|
from: e
|
|
485
509
|
});
|
|
486
510
|
} catch {
|
|
487
|
-
|
|
511
|
+
ft(n.removed, {
|
|
488
512
|
attribute: null,
|
|
489
513
|
from: e
|
|
490
514
|
});
|
|
491
515
|
}
|
|
492
516
|
if (e.removeAttribute(t), t === "is")
|
|
493
|
-
if (
|
|
517
|
+
if (rt || It)
|
|
494
518
|
try {
|
|
495
|
-
|
|
519
|
+
$(e);
|
|
496
520
|
} catch {
|
|
497
521
|
}
|
|
498
522
|
else
|
|
@@ -500,93 +524,118 @@ function ln() {
|
|
|
500
524
|
e.setAttribute(t, "");
|
|
501
525
|
} catch {
|
|
502
526
|
}
|
|
503
|
-
},
|
|
504
|
-
const e =
|
|
527
|
+
}, xn = function(t) {
|
|
528
|
+
const e = Ft(t);
|
|
505
529
|
if (e)
|
|
506
|
-
for (let
|
|
507
|
-
const a = e[
|
|
508
|
-
if (!(typeof
|
|
530
|
+
for (let o = e.length - 1; o >= 0; --o) {
|
|
531
|
+
const a = e[o], c = a && a.name;
|
|
532
|
+
if (!(typeof c != "string" || T[d(c)]))
|
|
509
533
|
try {
|
|
510
|
-
t.removeAttribute(
|
|
534
|
+
t.removeAttribute(c);
|
|
511
535
|
} catch {
|
|
512
536
|
}
|
|
513
537
|
}
|
|
514
|
-
},
|
|
538
|
+
}, ee = function(t) {
|
|
539
|
+
const e = [t];
|
|
540
|
+
for (; e.length > 0; ) {
|
|
541
|
+
const o = e.pop();
|
|
542
|
+
(I ? I(o) : o.nodeType) === v.element && xn(o);
|
|
543
|
+
const c = it(o);
|
|
544
|
+
if (c)
|
|
545
|
+
for (let f = c.length - 1; f >= 0; --f)
|
|
546
|
+
e.push(c[f]);
|
|
547
|
+
}
|
|
548
|
+
}, kn = function(t) {
|
|
549
|
+
if (!Y)
|
|
550
|
+
return;
|
|
515
551
|
const e = [t];
|
|
516
552
|
for (; e.length > 0; ) {
|
|
517
|
-
const
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
553
|
+
const o = e.pop(), a = I ? I(o) : o.nodeType;
|
|
554
|
+
if (a === v.processingInstruction || a === v.comment && b(rn, o.data)) {
|
|
555
|
+
try {
|
|
556
|
+
zt(o);
|
|
557
|
+
} catch {
|
|
558
|
+
}
|
|
559
|
+
continue;
|
|
560
|
+
}
|
|
561
|
+
if (a === v.element) {
|
|
562
|
+
const f = o, y = d(k ? k(o) : o.nodeName);
|
|
563
|
+
try {
|
|
564
|
+
f.hasAttribute && f.hasAttribute("patchsrc") && f.removeAttribute("patchsrc"), f.hasAttribute && f.hasAttribute("for") && y !== "label" && y !== "output" && f.removeAttribute("for");
|
|
565
|
+
} catch {
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
const c = it(o);
|
|
569
|
+
if (c)
|
|
570
|
+
for (let f = c.length - 1; f >= 0; --f)
|
|
571
|
+
e.push(c[f]);
|
|
572
|
+
}
|
|
573
|
+
}, ke = function(t) {
|
|
574
|
+
let e = null, o = null;
|
|
575
|
+
if ($t)
|
|
527
576
|
t = "<remove></remove>" + t;
|
|
528
577
|
else {
|
|
529
|
-
const
|
|
530
|
-
|
|
578
|
+
const f = Ve(t, /^[\r\n\t ]+/);
|
|
579
|
+
o = f && f[0];
|
|
531
580
|
}
|
|
532
|
-
|
|
533
|
-
const a =
|
|
534
|
-
if (
|
|
581
|
+
gt === "application/xhtml+xml" && at === F && (t = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + t + "</body></html>");
|
|
582
|
+
const a = D ? ot(t) : t;
|
|
583
|
+
if (at === F)
|
|
535
584
|
try {
|
|
536
|
-
e = new
|
|
585
|
+
e = new kt().parseFromString(a, gt);
|
|
537
586
|
} catch {
|
|
538
587
|
}
|
|
539
588
|
if (!e || !e.documentElement) {
|
|
540
|
-
e =
|
|
589
|
+
e = Ht.createDocument(at, "template", null);
|
|
541
590
|
try {
|
|
542
|
-
e.documentElement.innerHTML =
|
|
591
|
+
e.documentElement.innerHTML = Kt ? J : a;
|
|
543
592
|
} catch {
|
|
544
593
|
}
|
|
545
594
|
}
|
|
546
|
-
const
|
|
547
|
-
return t &&
|
|
548
|
-
},
|
|
549
|
-
return
|
|
595
|
+
const c = e.body || e.documentElement;
|
|
596
|
+
return t && o && c.insertBefore(s.createTextNode(o), c.childNodes[0] || null), at === F ? Tn.call(e, Q ? "html" : "body")[0] : Q ? e.documentElement : c;
|
|
597
|
+
}, ze = function(t) {
|
|
598
|
+
return _e.call(
|
|
550
599
|
t.ownerDocument || t,
|
|
551
600
|
t,
|
|
552
601
|
// eslint-disable-next-line no-bitwise
|
|
553
|
-
|
|
602
|
+
M.SHOW_ELEMENT | M.SHOW_COMMENT | M.SHOW_TEXT | M.SHOW_PROCESSING_INSTRUCTION | M.SHOW_CDATA_SECTION,
|
|
554
603
|
null
|
|
555
604
|
);
|
|
556
|
-
},
|
|
557
|
-
return t =
|
|
558
|
-
},
|
|
605
|
+
}, Mt = function(t) {
|
|
606
|
+
return t = Et(t, yn, " "), t = Et(t, En, " "), t = Et(t, An, " "), t;
|
|
607
|
+
}, ne = function(t) {
|
|
559
608
|
var e;
|
|
560
609
|
t.normalize();
|
|
561
|
-
const
|
|
610
|
+
const o = _e.call(
|
|
562
611
|
t.ownerDocument || t,
|
|
563
612
|
t,
|
|
564
613
|
// eslint-disable-next-line no-bitwise
|
|
565
|
-
|
|
614
|
+
M.SHOW_TEXT | M.SHOW_COMMENT | M.SHOW_CDATA_SECTION | M.SHOW_PROCESSING_INSTRUCTION,
|
|
566
615
|
null
|
|
567
616
|
);
|
|
568
|
-
let a =
|
|
617
|
+
let a = o.nextNode();
|
|
569
618
|
for (; a; )
|
|
570
|
-
a.data =
|
|
571
|
-
const
|
|
572
|
-
|
|
573
|
-
|
|
619
|
+
a.data = Mt(a.data), a = o.nextNode();
|
|
620
|
+
const c = (e = t.querySelectorAll) === null || e === void 0 ? void 0 : e.call(t, "template");
|
|
621
|
+
c && ut(c, (f) => {
|
|
622
|
+
ct(f.content) && ne(f.content);
|
|
574
623
|
});
|
|
575
|
-
},
|
|
576
|
-
const e =
|
|
577
|
-
return typeof e != "string" ||
|
|
624
|
+
}, vt = function(t) {
|
|
625
|
+
const e = k ? k(t) : null;
|
|
626
|
+
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
627
|
// prototype getter. Clobbered .attributes (e.g. <input name="attributes">)
|
|
579
628
|
// makes the direct read diverge from the cached read; a clean form
|
|
580
629
|
// (same-realm OR foreign-realm) has both reads pointing at the same
|
|
581
630
|
// canonical NamedNodeMap.
|
|
582
|
-
t.attributes !==
|
|
631
|
+
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
632
|
// returns the integer 1 for any Element regardless of realm; direct
|
|
584
633
|
// read on a clobbered form (e.g. <input name="nodeType">) returns
|
|
585
634
|
// the named child element. Cheap addition — nodeType is read from
|
|
586
635
|
// an internal slot, no serialization cost — and removes a residual
|
|
587
636
|
// clobbering surface used by several mXSS / PI / comment branches
|
|
588
637
|
// in _sanitizeElements that compare currentNode.nodeType directly.
|
|
589
|
-
t.nodeType !==
|
|
638
|
+
t.nodeType !== I(t) || // HTMLFormElement has [LegacyOverrideBuiltIns]: a descendant named
|
|
590
639
|
// "childNodes" shadows the prototype getter. Direct reads of
|
|
591
640
|
// form.childNodes from a clobbered form return the named child
|
|
592
641
|
// instead of the real NodeList, so any walk that reads it directly
|
|
@@ -597,77 +646,83 @@ function ln() {
|
|
|
597
646
|
// select, etc.) regardless of whether the named child happens to
|
|
598
647
|
// carry a numeric .length, which a typeof-based probe would miss
|
|
599
648
|
// (e.g. HTMLSelectElement.length is a defined unsigned-long).
|
|
600
|
-
t.childNodes !==
|
|
601
|
-
},
|
|
602
|
-
if (!
|
|
649
|
+
t.childNodes !== it(t);
|
|
650
|
+
}, ct = function(t) {
|
|
651
|
+
if (!I || typeof t != "object" || t === null)
|
|
603
652
|
return !1;
|
|
604
653
|
try {
|
|
605
|
-
return
|
|
654
|
+
return I(t) === v.documentFragment;
|
|
606
655
|
} catch {
|
|
607
656
|
return !1;
|
|
608
657
|
}
|
|
609
|
-
},
|
|
610
|
-
if (!
|
|
658
|
+
}, yt = function(t) {
|
|
659
|
+
if (!I || typeof t != "object" || t === null)
|
|
611
660
|
return !1;
|
|
612
661
|
try {
|
|
613
|
-
return typeof
|
|
662
|
+
return typeof I(t) == "number";
|
|
614
663
|
} catch {
|
|
615
664
|
return !1;
|
|
616
665
|
}
|
|
617
666
|
};
|
|
618
|
-
function
|
|
619
|
-
r.length !== 0 &&
|
|
620
|
-
|
|
667
|
+
function U(r, t, e) {
|
|
668
|
+
r.length !== 0 && ut(r, (o) => {
|
|
669
|
+
o.call(n, t, e, lt);
|
|
621
670
|
});
|
|
622
671
|
}
|
|
623
|
-
const
|
|
624
|
-
return !!(
|
|
625
|
-
},
|
|
626
|
-
if (!
|
|
672
|
+
const zn = function(t, e) {
|
|
673
|
+
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));
|
|
674
|
+
}, Fn = function(t, e) {
|
|
675
|
+
if (!Tt[e] && He(e) && (g.tagNameCheck instanceof RegExp && b(g.tagNameCheck, e) || g.tagNameCheck instanceof Function && g.tagNameCheck(e)))
|
|
627
676
|
return !1;
|
|
628
|
-
if (
|
|
629
|
-
const
|
|
630
|
-
if (a &&
|
|
631
|
-
const
|
|
632
|
-
for (let
|
|
633
|
-
const
|
|
634
|
-
|
|
677
|
+
if (jt && !z[e]) {
|
|
678
|
+
const o = Z(t), a = it(t);
|
|
679
|
+
if (a && o) {
|
|
680
|
+
const c = a.length;
|
|
681
|
+
for (let f = c - 1; f >= 0; --f) {
|
|
682
|
+
const y = Xt ? a[f] : pn(a[f], !0);
|
|
683
|
+
o.insertBefore(y, mn(t));
|
|
635
684
|
}
|
|
636
685
|
}
|
|
637
686
|
}
|
|
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
|
-
|
|
687
|
+
return $(t), !0;
|
|
688
|
+
}, Fe = function(t, e) {
|
|
689
|
+
if (U(h.beforeSanitizeElements, t, null), t !== e && Z(t) === null)
|
|
690
|
+
return !0;
|
|
691
|
+
if (vt(t))
|
|
692
|
+
return $(t), !0;
|
|
693
|
+
const o = d(k ? k(t) : t.nodeName);
|
|
694
|
+
if (U(h.uponSanitizeElement, t, {
|
|
695
|
+
tagName: o,
|
|
696
|
+
allowedTags: _
|
|
697
|
+
}), t !== e && Z(t) === null)
|
|
698
|
+
return !0;
|
|
699
|
+
if (zn(t, o))
|
|
700
|
+
return $(t), !0;
|
|
701
|
+
if (Tt[o] || !(B.tagCheck instanceof Function && B.tagCheck(o)) && !_[o]) {
|
|
702
|
+
const c = Fn(t, o);
|
|
703
|
+
return c === !1 && U(h.afterSanitizeElements, t, null), c;
|
|
704
|
+
}
|
|
705
|
+
if ((I ? I(t) : t.nodeType) === v.element && !Pn(t) || (o === "noscript" || o === "noembed" || o === "noframes") && b(Ii, t.innerHTML))
|
|
706
|
+
return $(t), !0;
|
|
707
|
+
if (W && t.nodeType === v.text) {
|
|
708
|
+
const c = Mt(t.textContent);
|
|
709
|
+
t.textContent !== c && (ft(n.removed, {
|
|
655
710
|
element: t.cloneNode()
|
|
656
|
-
}), t.textContent =
|
|
711
|
+
}), t.textContent = c);
|
|
657
712
|
}
|
|
658
|
-
return
|
|
659
|
-
},
|
|
660
|
-
if (
|
|
713
|
+
return U(h.afterSanitizeElements, t, null), !1;
|
|
714
|
+
}, Ue = function(t, e, o) {
|
|
715
|
+
if (Ae[e] || Y && e === "patchsrc" || Y && e === "for" && t !== "label" && t !== "output" || we && (e === "id" || e === "name") && (o in s || o in Dn))
|
|
661
716
|
return !1;
|
|
662
|
-
const a =
|
|
663
|
-
if (!(
|
|
664
|
-
if (!(
|
|
717
|
+
const a = T[e] || B.attributeCheck instanceof Function && B.attributeCheck(e, t);
|
|
718
|
+
if (!(Gt && b(bn, e))) {
|
|
719
|
+
if (!(be && b(Sn, e))) {
|
|
665
720
|
if (a) {
|
|
666
|
-
if (
|
|
667
|
-
if (!
|
|
668
|
-
if (!((e === "src" || e === "xlink:href" || e === "href") && t !== "script" &&
|
|
669
|
-
if (!(
|
|
670
|
-
if (
|
|
721
|
+
if (!qt[e]) {
|
|
722
|
+
if (!b(ge, Et(o, Te, ""))) {
|
|
723
|
+
if (!((e === "src" || e === "xlink:href" || e === "href") && t !== "script" && qe(o, "data:") === 0 && Ne[t])) {
|
|
724
|
+
if (!(Se && !b(On, Et(o, Te, "")))) {
|
|
725
|
+
if (o)
|
|
671
726
|
return !1;
|
|
672
727
|
}
|
|
673
728
|
}
|
|
@@ -677,204 +732,207 @@ function ln() {
|
|
|
677
732
|
// First condition does a very basic check if a) it's basically a valid custom element tagname AND
|
|
678
733
|
// b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
679
734
|
// and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
|
|
680
|
-
!(
|
|
735
|
+
!(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
736
|
// the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
682
|
-
e === "is" &&
|
|
737
|
+
e === "is" && g.allowCustomizedBuiltInElements && (g.tagNameCheck instanceof RegExp && b(g.tagNameCheck, o) || g.tagNameCheck instanceof Function && g.tagNameCheck(o)))
|
|
683
738
|
) return !1;
|
|
684
739
|
}
|
|
685
740
|
}
|
|
686
741
|
return !0;
|
|
687
|
-
},
|
|
688
|
-
return !
|
|
689
|
-
},
|
|
690
|
-
if (
|
|
691
|
-
switch (
|
|
742
|
+
}, 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) {
|
|
743
|
+
return !Un[bt(t)] && b(wn, t);
|
|
744
|
+
}, Hn = function(t, e, o, a) {
|
|
745
|
+
if (D && typeof wt == "object" && typeof wt.getAttributeType == "function" && !o)
|
|
746
|
+
switch (wt.getAttributeType(t, e)) {
|
|
692
747
|
case "TrustedHTML":
|
|
693
|
-
return
|
|
748
|
+
return ot(a);
|
|
694
749
|
case "TrustedScriptURL":
|
|
695
|
-
return
|
|
750
|
+
return dn(a);
|
|
696
751
|
}
|
|
697
752
|
return a;
|
|
698
|
-
},
|
|
753
|
+
}, Gn = function(t, e, o, a) {
|
|
699
754
|
try {
|
|
700
|
-
|
|
755
|
+
o ? t.setAttributeNS(o, e, a) : t.setAttribute(e, a), vt(t) ? $(t) : Xe(n.removed);
|
|
701
756
|
} catch {
|
|
702
|
-
|
|
757
|
+
tt(e, t);
|
|
703
758
|
}
|
|
704
|
-
},
|
|
705
|
-
|
|
759
|
+
}, Ge = function(t) {
|
|
760
|
+
U(h.beforeSanitizeAttributes, t, null);
|
|
706
761
|
const e = t.attributes;
|
|
707
|
-
if (!e ||
|
|
762
|
+
if (!e || vt(t))
|
|
708
763
|
return;
|
|
709
|
-
const
|
|
764
|
+
const o = {
|
|
710
765
|
attrName: "",
|
|
711
766
|
attrValue: "",
|
|
712
767
|
keepAttr: !0,
|
|
713
|
-
allowedAttributes:
|
|
768
|
+
allowedAttributes: T,
|
|
714
769
|
forceKeepAttr: void 0
|
|
715
770
|
};
|
|
716
771
|
let a = e.length;
|
|
717
|
-
const
|
|
772
|
+
const c = d(t.nodeName);
|
|
718
773
|
for (; a--; ) {
|
|
719
|
-
const
|
|
720
|
-
let
|
|
721
|
-
if (
|
|
722
|
-
|
|
774
|
+
const f = e[a], y = f.name, R = f.namespaceURI, P = f.value, C = d(y), x = P;
|
|
775
|
+
let N = y === "value" ? x : ci(x);
|
|
776
|
+
if (o.attrName = C, o.attrValue = N, o.keepAttr = !0, o.forceKeepAttr = void 0, U(h.uponSanitizeAttribute, t, o), N = o.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)) {
|
|
777
|
+
tt(y, t);
|
|
723
778
|
continue;
|
|
724
779
|
}
|
|
725
|
-
if (
|
|
726
|
-
|
|
780
|
+
if (C === "attributename" && Ve(N, "href")) {
|
|
781
|
+
tt(y, t);
|
|
727
782
|
continue;
|
|
728
783
|
}
|
|
729
|
-
if (!
|
|
730
|
-
if (!
|
|
731
|
-
|
|
784
|
+
if (!o.forceKeepAttr) {
|
|
785
|
+
if (!o.keepAttr) {
|
|
786
|
+
tt(y, t);
|
|
732
787
|
continue;
|
|
733
788
|
}
|
|
734
|
-
if (!
|
|
735
|
-
|
|
789
|
+
if (!Oe && b(Ni, N)) {
|
|
790
|
+
tt(y, t);
|
|
736
791
|
continue;
|
|
737
792
|
}
|
|
738
|
-
if (
|
|
739
|
-
|
|
793
|
+
if (W && (N = Mt(N)), !Ue(c, C, N)) {
|
|
794
|
+
tt(y, t);
|
|
740
795
|
continue;
|
|
741
796
|
}
|
|
742
|
-
|
|
797
|
+
N = Hn(c, C, R, N), N !== x && Gn(t, y, R, N);
|
|
743
798
|
}
|
|
744
799
|
}
|
|
745
|
-
|
|
746
|
-
},
|
|
800
|
+
U(h.afterSanitizeAttributes, t, null);
|
|
801
|
+
}, Pt = function(t) {
|
|
747
802
|
let e = null;
|
|
748
|
-
const
|
|
749
|
-
for (
|
|
750
|
-
if (
|
|
751
|
-
const
|
|
752
|
-
|
|
803
|
+
const o = ze(t);
|
|
804
|
+
for (U(h.beforeSanitizeShadowDOM, t, null); e = o.nextNode(); )
|
|
805
|
+
if (U(h.uponSanitizeShadowNode, e, null), Fe(e, t), Ge(e), ct(e.content) && Pt(e.content), (I ? I(e) : e.nodeType) === v.element) {
|
|
806
|
+
const c = me(e);
|
|
807
|
+
ct(c) && (ie(c), Pt(c));
|
|
753
808
|
}
|
|
754
|
-
|
|
755
|
-
},
|
|
809
|
+
U(h.afterSanitizeShadowDOM, t, null);
|
|
810
|
+
}, ie = function(t) {
|
|
756
811
|
const e = [{
|
|
757
812
|
node: t,
|
|
758
813
|
shadow: null
|
|
759
814
|
}];
|
|
760
815
|
for (; e.length > 0; ) {
|
|
761
|
-
const
|
|
762
|
-
if (
|
|
763
|
-
|
|
816
|
+
const o = e.pop();
|
|
817
|
+
if (o.shadow) {
|
|
818
|
+
Pt(o.shadow);
|
|
764
819
|
continue;
|
|
765
820
|
}
|
|
766
|
-
const a =
|
|
767
|
-
if (
|
|
768
|
-
for (let
|
|
821
|
+
const a = o.node, f = (I ? I(a) : a.nodeType) === v.element, y = it(a);
|
|
822
|
+
if (y)
|
|
823
|
+
for (let R = y.length - 1; R >= 0; --R)
|
|
769
824
|
e.push({
|
|
770
|
-
node:
|
|
825
|
+
node: y[R],
|
|
771
826
|
shadow: null
|
|
772
827
|
});
|
|
773
|
-
if (
|
|
774
|
-
const
|
|
775
|
-
if (typeof
|
|
776
|
-
const
|
|
777
|
-
|
|
778
|
-
node:
|
|
828
|
+
if (f) {
|
|
829
|
+
const R = k ? k(a) : null;
|
|
830
|
+
if (typeof R == "string" && d(R) === "template") {
|
|
831
|
+
const P = a.content;
|
|
832
|
+
ct(P) && e.push({
|
|
833
|
+
node: P,
|
|
779
834
|
shadow: null
|
|
780
835
|
});
|
|
781
836
|
}
|
|
782
837
|
}
|
|
783
|
-
if (
|
|
784
|
-
const
|
|
785
|
-
|
|
838
|
+
if (f) {
|
|
839
|
+
const R = me(a);
|
|
840
|
+
ct(R) && e.push({
|
|
786
841
|
node: null,
|
|
787
|
-
shadow:
|
|
842
|
+
shadow: R
|
|
788
843
|
}, {
|
|
789
|
-
node:
|
|
844
|
+
node: R,
|
|
790
845
|
shadow: null
|
|
791
846
|
});
|
|
792
847
|
}
|
|
793
848
|
}
|
|
794
849
|
};
|
|
795
850
|
return n.sanitize = function(r) {
|
|
796
|
-
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, e = null,
|
|
797
|
-
if (
|
|
798
|
-
throw
|
|
851
|
+
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, e = null, o = null, a = null, c = null;
|
|
852
|
+
if (Kt = !r, Kt && (r = "<!-->"), typeof r != "string" && !yt(r) && (r = di(r), typeof r != "string"))
|
|
853
|
+
throw et("dirty is not a string, aborting");
|
|
799
854
|
if (!n.isSupported)
|
|
800
855
|
return r;
|
|
801
|
-
|
|
802
|
-
const
|
|
803
|
-
if (
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
856
|
+
Bt ? (_ = Wt, T = Yt) : te(t), (h.uponSanitizeElement.length > 0 || h.uponSanitizeAttribute.length > 0) && (_ = L(_)), h.uponSanitizeAttribute.length > 0 && (T = L(T)), n.removed = [];
|
|
857
|
+
const f = Xt && typeof r != "string" && yt(r);
|
|
858
|
+
if (f) {
|
|
859
|
+
kn(r);
|
|
860
|
+
const C = k ? k(r) : r.nodeName;
|
|
861
|
+
if (typeof C == "string") {
|
|
862
|
+
const x = d(C);
|
|
863
|
+
if (!_[x] || Tt[x])
|
|
864
|
+
throw Ct(r), et("root node is forbidden and cannot be sanitized in-place");
|
|
809
865
|
}
|
|
810
|
-
if (
|
|
811
|
-
throw
|
|
866
|
+
if (vt(r))
|
|
867
|
+
throw Ct(r), et("root node is clobbered and cannot be sanitized in-place");
|
|
812
868
|
try {
|
|
813
|
-
|
|
814
|
-
} catch (
|
|
815
|
-
throw
|
|
869
|
+
ie(r);
|
|
870
|
+
} catch (x) {
|
|
871
|
+
throw Ct(r), x;
|
|
816
872
|
}
|
|
817
|
-
} else if (
|
|
818
|
-
e =
|
|
873
|
+
} else if (yt(r))
|
|
874
|
+
e = ke("<!---->"), o = e.ownerDocument.importNode(r, !0), o.nodeType === v.element && o.nodeName === "BODY" || o.nodeName === "HTML" ? e = o : e.appendChild(o), ie(o);
|
|
819
875
|
else {
|
|
820
|
-
if (!
|
|
876
|
+
if (!rt && !W && !Q && // eslint-disable-next-line unicorn/prefer-includes
|
|
821
877
|
r.indexOf("<") === -1)
|
|
822
|
-
return
|
|
823
|
-
if (e =
|
|
824
|
-
return
|
|
878
|
+
return D && Nt ? ot(r) : r;
|
|
879
|
+
if (e = ke(r), !e)
|
|
880
|
+
return rt ? null : Nt ? J : "";
|
|
825
881
|
}
|
|
826
|
-
e &&
|
|
827
|
-
const
|
|
882
|
+
e && $t && $(e.firstChild);
|
|
883
|
+
const y = f ? r : e, R = ze(y);
|
|
828
884
|
try {
|
|
829
|
-
for (; a =
|
|
830
|
-
|
|
831
|
-
} catch (
|
|
832
|
-
throw
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
885
|
+
for (; a = R.nextNode(); )
|
|
886
|
+
Fe(a, y), Ge(a), ct(a.content) && Pt(a.content);
|
|
887
|
+
} catch (C) {
|
|
888
|
+
throw f && (Ct(r), ut(n.removed, (x) => {
|
|
889
|
+
x.element && ee(x.element);
|
|
890
|
+
})), C;
|
|
891
|
+
}
|
|
892
|
+
if (f)
|
|
893
|
+
return ut(n.removed, (C) => {
|
|
894
|
+
C.element && ee(C.element);
|
|
895
|
+
}), W && ne(r), r;
|
|
896
|
+
if (rt) {
|
|
897
|
+
if (W && ne(e), It)
|
|
898
|
+
for (c = _n.call(e.ownerDocument); e.firstChild; )
|
|
899
|
+
c.appendChild(e.firstChild);
|
|
842
900
|
else
|
|
843
|
-
|
|
844
|
-
return (
|
|
901
|
+
c = e;
|
|
902
|
+
return (T.shadowroot || T.shadowrootmode) && (c = gn.call(l, c, !0)), c;
|
|
845
903
|
}
|
|
846
|
-
let
|
|
847
|
-
return
|
|
848
|
-
` +
|
|
904
|
+
let P = Q ? e.outerHTML : e.innerHTML;
|
|
905
|
+
return Q && _["!doctype"] && e.ownerDocument && e.ownerDocument.doctype && e.ownerDocument.doctype.name && b(wi, e.ownerDocument.doctype.name) && (P = "<!DOCTYPE " + e.ownerDocument.doctype.name + `>
|
|
906
|
+
` + P), W && (P = Mt(P)), D && Nt ? ot(P) : P;
|
|
849
907
|
}, n.setConfig = function() {
|
|
850
908
|
let r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
851
|
-
|
|
909
|
+
te(r), Bt = !0, Wt = _, Yt = T;
|
|
852
910
|
}, n.clearConfig = function() {
|
|
853
|
-
|
|
911
|
+
lt = null, Bt = !1, Wt = null, Yt = null, D = Ut, J = "";
|
|
854
912
|
}, n.isValidAttribute = function(r, t, e) {
|
|
855
|
-
|
|
856
|
-
const
|
|
857
|
-
return
|
|
913
|
+
lt || te({});
|
|
914
|
+
const o = d(r), a = d(t);
|
|
915
|
+
return Ue(o, a, e);
|
|
858
916
|
}, n.addHook = function(r, t) {
|
|
859
|
-
typeof t == "function" &&
|
|
917
|
+
typeof t == "function" && S(h, r) && ft(h[r], t);
|
|
860
918
|
}, n.removeHook = function(r, t) {
|
|
861
|
-
if (
|
|
919
|
+
if (S(h, r)) {
|
|
862
920
|
if (t !== void 0) {
|
|
863
|
-
const e =
|
|
864
|
-
return e === -1 ? void 0 :
|
|
921
|
+
const e = ai(h[r], t);
|
|
922
|
+
return e === -1 ? void 0 : li(h[r], e, 1)[0];
|
|
865
923
|
}
|
|
866
|
-
return
|
|
924
|
+
return Xe(h[r]);
|
|
867
925
|
}
|
|
868
926
|
}, n.removeHooks = function(r) {
|
|
869
|
-
|
|
927
|
+
S(h, r) && (h[r] = []);
|
|
870
928
|
}, n.removeAllHooks = function() {
|
|
871
|
-
|
|
929
|
+
h = sn();
|
|
872
930
|
}, n;
|
|
873
931
|
}
|
|
874
|
-
var
|
|
875
|
-
const St = /* @__PURE__ */ new Map(),
|
|
876
|
-
function
|
|
877
|
-
const s =
|
|
932
|
+
var Ci = un();
|
|
933
|
+
const St = /* @__PURE__ */ new Map(), pe = /* @__PURE__ */ new Map();
|
|
934
|
+
function fn(i, n) {
|
|
935
|
+
const s = Ci.sanitize(i, {
|
|
878
936
|
USE_PROFILES: { svg: !0, svgFilters: !0 },
|
|
879
937
|
FORBID_TAGS: ["script", "use"],
|
|
880
938
|
// <use> can SSRF to external hrefs
|
|
@@ -884,29 +942,29 @@ function cn(o, n) {
|
|
|
884
942
|
throw new Error(`Invalid SVG from ${n}`);
|
|
885
943
|
return m;
|
|
886
944
|
}
|
|
887
|
-
async function
|
|
888
|
-
const n = await fetch(
|
|
945
|
+
async function Mi(i) {
|
|
946
|
+
const n = await fetch(i);
|
|
889
947
|
if (!n.ok)
|
|
890
948
|
throw new Error(`Failed to load icon: ${n.status}`);
|
|
891
|
-
return
|
|
949
|
+
return fn(await n.text(), i);
|
|
892
950
|
}
|
|
893
|
-
async function
|
|
894
|
-
return St.has(
|
|
951
|
+
async function an(i) {
|
|
952
|
+
return St.has(i) || St.set(i, Mi(i)), (await St.get(i)).cloneNode(!0);
|
|
895
953
|
}
|
|
896
|
-
function
|
|
897
|
-
let n =
|
|
898
|
-
return n || (n =
|
|
954
|
+
function vi(i) {
|
|
955
|
+
let n = pe.get(i);
|
|
956
|
+
return n || (n = fn(i, "inline SVG source"), pe.set(i, n)), n.cloneNode(!0);
|
|
899
957
|
}
|
|
900
|
-
function
|
|
901
|
-
|
|
958
|
+
function Gi(i) {
|
|
959
|
+
i ? St.delete(i) : (St.clear(), pe.clear());
|
|
902
960
|
}
|
|
903
|
-
const
|
|
904
|
-
var
|
|
905
|
-
for (var
|
|
906
|
-
(A =
|
|
907
|
-
return
|
|
908
|
-
},
|
|
909
|
-
const
|
|
961
|
+
const Pi = ":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)}";
|
|
962
|
+
var xi = Object.defineProperty, q = (i, n, s, l) => {
|
|
963
|
+
for (var u = void 0, m = i.length - 1, A; m >= 0; m--)
|
|
964
|
+
(A = i[m]) && (u = A(n, s, u) || u);
|
|
965
|
+
return u && xi(n, s, u), u;
|
|
966
|
+
}, V;
|
|
967
|
+
const G = (V = class extends qn {
|
|
910
968
|
constructor() {
|
|
911
969
|
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
970
|
}
|
|
@@ -918,10 +976,10 @@ const U = ($ = class extends Hn {
|
|
|
918
976
|
})();
|
|
919
977
|
}
|
|
920
978
|
connectedCallback() {
|
|
921
|
-
super.connectedCallback(),
|
|
979
|
+
super.connectedCallback(), this._reflectHostSemantics(), We(this.library, this);
|
|
922
980
|
}
|
|
923
981
|
disconnectedCallback() {
|
|
924
|
-
super.disconnectedCallback(),
|
|
982
|
+
super.disconnectedCallback(), Ye(this.library, this);
|
|
925
983
|
}
|
|
926
984
|
/** Called by the icon library registry when the current library changes. */
|
|
927
985
|
redraw() {
|
|
@@ -938,23 +996,23 @@ const U = ($ = class extends Hn {
|
|
|
938
996
|
this._loadIcon();
|
|
939
997
|
}
|
|
940
998
|
updated(n) {
|
|
941
|
-
if (n.has("name") &&
|
|
999
|
+
if (n.has("name") && !V._validName.test(this.name)) {
|
|
942
1000
|
console.warn(`nys-icon: invalid name "${this.name}" — ignored`), this._svg = null;
|
|
943
1001
|
return;
|
|
944
1002
|
}
|
|
945
1003
|
if (n.has("name") || n.has("library")) {
|
|
946
1004
|
if (n.has("library")) {
|
|
947
1005
|
const s = n.get("library");
|
|
948
|
-
s &&
|
|
1006
|
+
s && Ye(s, this), We(this.library, this);
|
|
949
1007
|
}
|
|
950
1008
|
this._loadIcon();
|
|
951
1009
|
}
|
|
952
|
-
this._svg && (n.has("ariaLabel") || n.has("rotate") || n.has("flip") || n.has("color") || n.has("size"))
|
|
1010
|
+
this._svg && (n.has("ariaLabel") || n.has("rotate") || n.has("flip") || n.has("color") || n.has("size")) ? this._applyAttributes(this._svg) : n.has("ariaLabel") && this._reflectHostSemantics();
|
|
953
1011
|
}
|
|
954
1012
|
_loadIcon() {
|
|
955
1013
|
const n = ++this._loadSeq;
|
|
956
1014
|
this._loadPromise = (async () => {
|
|
957
|
-
const s =
|
|
1015
|
+
const s = Jn(this.library);
|
|
958
1016
|
if (!s || !this.name) {
|
|
959
1017
|
this._svg = null;
|
|
960
1018
|
return;
|
|
@@ -966,52 +1024,67 @@ const U = ($ = class extends Hn {
|
|
|
966
1024
|
this._svg = null;
|
|
967
1025
|
return;
|
|
968
1026
|
}
|
|
969
|
-
const
|
|
1027
|
+
const u = typeof l == "string" ? await an(l) : l.type === "url" ? await an(l.href) : vi(l.content);
|
|
970
1028
|
if (n !== this._loadSeq) return;
|
|
971
|
-
s.mutator?.(
|
|
1029
|
+
s.mutator?.(u), this._applyAttributes(u), this._svg = u;
|
|
972
1030
|
} catch {
|
|
973
1031
|
n === this._loadSeq && (this._svg = null);
|
|
974
1032
|
}
|
|
975
1033
|
})();
|
|
976
1034
|
}
|
|
977
1035
|
_applyAttributes(n) {
|
|
978
|
-
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}`);
|
|
1036
|
+
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}`), this._reflectHostSemantics();
|
|
1037
|
+
}
|
|
1038
|
+
/**
|
|
1039
|
+
* Reflects the icon's accessible state onto the host:
|
|
1040
|
+
* - Labeled icon -> role="img" + aria-label, no aria-hidden.
|
|
1041
|
+
* - Decorative -> aria-hidden="true", no role/label.
|
|
1042
|
+
*
|
|
1043
|
+
* These are reflected as host *attributes* (rather than via
|
|
1044
|
+
* ElementInternals) on purpose: aria-hidden / role / aria-label in
|
|
1045
|
+
* attribute form have universal, consistent assistive-technology support,
|
|
1046
|
+
* whereas AT support for these states set through ElementInternals is still
|
|
1047
|
+
* uneven across browser/screen-reader combinations. The host role/label
|
|
1048
|
+
* therefore depend on runtime state (ariaLabel), so defaultRole stays null.
|
|
1049
|
+
*/
|
|
1050
|
+
_reflectHostSemantics() {
|
|
1051
|
+
this.ariaLabel ? (this.setAttribute("role", "img"), this.setAttribute("aria-label", this.ariaLabel), this.removeAttribute("aria-hidden")) : (this.removeAttribute("role"), this.removeAttribute("aria-label"), this.setAttribute("aria-hidden", "true"));
|
|
979
1052
|
}
|
|
980
1053
|
render() {
|
|
981
|
-
return this._svg ?
|
|
1054
|
+
return this._svg ? Yn`${this._svg}` : null;
|
|
982
1055
|
}
|
|
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",
|
|
1056
|
+
}, V.styles = Wn(Pi), V._validName = /^[a-zA-Z0-9_-]+$/, V);
|
|
1057
|
+
q([
|
|
1058
|
+
nt({ type: String, reflect: !0 })
|
|
1059
|
+
], G.prototype, "name");
|
|
1060
|
+
q([
|
|
1061
|
+
nt({ type: String, reflect: !0 })
|
|
1062
|
+
], G.prototype, "library");
|
|
1063
|
+
q([
|
|
1064
|
+
nt({ type: String })
|
|
1065
|
+
], G.prototype, "ariaLabel");
|
|
1066
|
+
q([
|
|
1067
|
+
nt({ type: String })
|
|
1068
|
+
], G.prototype, "rotate");
|
|
1069
|
+
q([
|
|
1070
|
+
nt({ type: String })
|
|
1071
|
+
], G.prototype, "flip");
|
|
1072
|
+
q([
|
|
1073
|
+
nt({ type: String })
|
|
1074
|
+
], G.prototype, "color");
|
|
1075
|
+
q([
|
|
1076
|
+
nt({ type: String })
|
|
1077
|
+
], G.prototype, "size");
|
|
1078
|
+
q([
|
|
1079
|
+
$n()
|
|
1080
|
+
], G.prototype, "_svg");
|
|
1081
|
+
let ki = G;
|
|
1082
|
+
customElements.get("nys-icon") || customElements.define("nys-icon", ki);
|
|
1010
1083
|
export {
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1084
|
+
ki as NysIcon,
|
|
1085
|
+
Gi as clearIconCache,
|
|
1086
|
+
Jn as getIconLibrary,
|
|
1087
|
+
Ui as registerIconLibrary,
|
|
1088
|
+
Hi as unregisterIconLibrary
|
|
1016
1089
|
};
|
|
1017
1090
|
//# sourceMappingURL=nys-icon.js.map
|