@justeattakeaway/pie-cookie-banner 1.8.3 → 1.9.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/cdn_dist/index.js +62 -49
- package/custom-elements.json +30 -0
- package/dist/index.js +905 -203
- package/package.json +11 -10
- package/src/index.ts +3 -2
- package/src/localisation-utils.ts +56 -0
package/dist/index.js
CHANGED
|
@@ -1,34 +1,35 @@
|
|
|
1
|
-
import { LitElement as
|
|
2
|
-
import { state as
|
|
3
|
-
import { repeat as
|
|
1
|
+
import { LitElement as yn, unsafeCSS as Sn, html as F, nothing as Bt } from "lit";
|
|
2
|
+
import { state as dt, property as te, queryAll as Rn } from "lit/decorators.js";
|
|
3
|
+
import { repeat as Nn } from "lit/directives/repeat.js";
|
|
4
|
+
import { unsafeHTML as On } from "lit/directives/unsafe-html.js";
|
|
4
5
|
import "@justeattakeaway/pie-button";
|
|
5
6
|
import "@justeattakeaway/pie-divider";
|
|
6
7
|
import "@justeattakeaway/pie-icon-button";
|
|
7
8
|
import "@justeattakeaway/pie-link";
|
|
8
9
|
import "@justeattakeaway/pie-modal";
|
|
9
10
|
import "@justeattakeaway/pie-switch";
|
|
10
|
-
import { safeCustomElement as
|
|
11
|
-
import
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
return
|
|
11
|
+
import { safeCustomElement as kn, dispatchCustomEvent as Be } from "@justeattakeaway/pie-webc-core";
|
|
12
|
+
import $t from "@justeattakeaway/pie-cookie-banner/locales/en.js";
|
|
13
|
+
const Ln = (t, i, o) => {
|
|
14
|
+
const r = t[i];
|
|
15
|
+
return r ? typeof r == "function" ? r() : Promise.resolve(r) : new Promise((s, c) => {
|
|
15
16
|
(typeof queueMicrotask == "function" ? queueMicrotask : setTimeout)(
|
|
16
|
-
|
|
17
|
+
c.bind(
|
|
17
18
|
null,
|
|
18
19
|
new Error(
|
|
19
|
-
"Unknown variable dynamic import: " +
|
|
20
|
+
"Unknown variable dynamic import: " + i + (i.split("/").length !== o ? ". Note that variables only represent file names one level deep." : "")
|
|
20
21
|
)
|
|
21
22
|
)
|
|
22
23
|
);
|
|
23
24
|
});
|
|
24
|
-
},
|
|
25
|
+
}, He = class He extends yn {
|
|
25
26
|
willUpdate() {
|
|
26
|
-
this.getAttribute("v") || this.setAttribute("v",
|
|
27
|
+
this.getAttribute("v") || this.setAttribute("v", He.v);
|
|
27
28
|
}
|
|
28
29
|
};
|
|
29
|
-
|
|
30
|
-
let
|
|
31
|
-
const
|
|
30
|
+
He.v = "1.9.0";
|
|
31
|
+
let ft = He;
|
|
32
|
+
const In = "*,*:after,*:before{box-sizing:inherit}*{margin:0}.c-cookieBanner{--cb-font-family: var(--dt-font-interactive-l-family);--cb-font-size: calc(var(--dt-font-body-l-size) * 1px);--cb-line-height: calc(var(--dt-font-body-l-line-height) * 1px);--cb-font-weight: var(--dt-font-body-l-weight);--cb-padding-inline: var(--dt-spacing-d);--cb-padding-block: var(--dt-spacing-d);--cb-offset: 0;color-scheme:only dark;background-color:var(--dt-color-background-dark);color:var(--dt-color-content-inverse);font-family:var(--cb-font-family);font-size:var(--cb-font-size);line-height:var(--cb-line-height);font-weight:var(--cb-font-weight);padding-block-start:var(--cb-padding-block);padding-block-end:var(--cb-padding-block);max-height:432px;position:fixed;bottom:var(--cb-offset);left:var(--cb-offset);right:var(--cb-offset);border-top-left-radius:var(--dt-radius-rounded-c);border-top-right-radius:var(--dt-radius-rounded-c);z-index:var(--dt-z-index-cookie-banner)}@media(min-width:700px)and (orientation:landscape){.c-cookieBanner{--cb-padding-inline: var(--dt-spacing-f);--cb-offset: var(--dt-spacing-d);max-height:90%;border-bottom-left-radius:var(--dt-radius-rounded-c);border-bottom-right-radius:var(--dt-radius-rounded-c)}}.c-cookieBanner[isCookieBannerHidden]{display:none}@media(prefers-reduced-motion:no-preference){@keyframes animate-enter{0%{transform:translate3d(0,75%,0)}to{transform:translateZ(0)}}.c-cookieBanner{animation:.5s animate-enter ease-out}}.c-cookieBanner-title,.c-cookieBanner-body,.c-cookieBanner-actions{padding-inline-start:var(--cb-padding-inline);padding-inline-end:var(--cb-padding-inline)}.c-cookieBanner-title{--cb-title-font-size: var(--dt-font-heading-s-size--narrow);--cb-title-line-height: var(--dt-font-heading-s-line-height--narrow);font-size:calc(var(--cb-title-font-size) * 1px);font-weight:var(--dt-font-heading-s-weight);line-height:calc(var(--cb-title-line-height) * 1px)}@media(min-width:700px)and (orientation:landscape){.c-cookieBanner-title{--cb-title-font-size: var(--dt-font-heading-s-size--wide);--cb-title-line-height: var(--dt-font-heading-s-line-height--wide)}}.c-cookieBanner-body{--cb-scroll-shadow-color: var(--dt-color-black);margin-block-start:var(--dt-spacing-a);max-height:200px;overflow-y:auto;background:linear-gradient(to bottom,transparent,var(--dt-color-background-dark) 75%) center bottom,linear-gradient(transparent,var(--cb-scroll-shadow-color)) center bottom;background-repeat:no-repeat;background-size:100% 48px,100% 8px;background-attachment:local,scroll}@media(min-width:700px)and (orientation:landscape){.c-cookieBanner-body{max-height:150px}}.c-cookieBanner-actions{--cb-actions-flex-dir: column;margin-block-start:var(--dt-spacing-d);display:flex;gap:var(--dt-spacing-d);flex-direction:var(--cb-actions-flex-dir)}.c-cookieBanner-actions>pie-link{text-align:center;align-self:center}@media(min-width:700px)and (orientation:landscape){.c-cookieBanner-actions{--cb-actions-flex-dir: row-reverse;justify-content:flex-start;align-items:center}.c-cookieBanner-actions>pie-button{width:auto}}.c-cookieBanner-subheading{--cb-subheading-font-size: var(--dt-font-heading-s-size--narrow);--cb-subheading-line-height: var(--dt-font-heading-s-line-height--narrow);font-size:calc(var(--cb-subheading-font-size) * 1px);font-weight:var(--dt-font-heading-s-weight);line-height:calc(var(--cb-subheading-line-height) * 1px)}@media(min-width:700px)and (orientation:landscape){.c-cookieBanner-subheading{--cb-subheading-font-size: var(--dt-font-heading-s-size--wide);--cb-subheading-line-height: var(--dt-font-heading-s-line-height--wide)}}.c-cookieBanner-description{font-size:calc(var(--dt-font-body-s-size) * 1px);line-height:calc(var(--dt-font-body-s-line-height) * 1px)}.c-cookieBanner-preference{display:flex;gap:var(--dt-spacing-d);justify-content:space-between;margin-block-start:var(--dt-spacing-e);margin-block-end:var(--dt-spacing-e)}.c-cookieBanner-preference p{margin-block-start:var(--dt-spacing-b)}.c-cookieBanner-preference:last-child{margin-block-end:0}", p = {
|
|
32
33
|
BULGARIAN: "bg",
|
|
33
34
|
CATALAN: "ca",
|
|
34
35
|
DANISH: "da",
|
|
@@ -41,7 +42,7 @@ const O = "*,*:after,*:before{box-sizing:inherit}*{margin:0}.c-cookieBanner{--cb
|
|
|
41
42
|
POLISH: "pl",
|
|
42
43
|
SLOVAK: "sk",
|
|
43
44
|
SPANISH: "es"
|
|
44
|
-
},
|
|
45
|
+
}, g = {
|
|
45
46
|
AUSTRALIA: "au",
|
|
46
47
|
AUSTRIA: "at",
|
|
47
48
|
BELGIUM: "be",
|
|
@@ -60,7 +61,7 @@ const O = "*,*:after,*:before{box-sizing:inherit}*{margin:0}.c-cookieBanner{--cb
|
|
|
60
61
|
SLOVAKIA: "sk",
|
|
61
62
|
SPAIN: "es",
|
|
62
63
|
SWITZERLAND: "ch"
|
|
63
|
-
},
|
|
64
|
+
}, Dn = "pie-cookie-banner-accept-all", Cn = "pie-cookie-banner-necessary-only", wn = "pie-cookie-banner-manage-prefs", vn = "pie-cookie-banner-prefs-saved", Mn = [
|
|
64
65
|
{
|
|
65
66
|
id: "all",
|
|
66
67
|
hasDivider: !0,
|
|
@@ -84,126 +85,827 @@ const O = "*,*:after,*:before{box-sizing:inherit}*{margin:0}.c-cookieBanner{--cb
|
|
|
84
85
|
id: "personalized",
|
|
85
86
|
hasDescription: !0
|
|
86
87
|
}
|
|
87
|
-
],
|
|
88
|
+
], Z = {
|
|
88
89
|
hasPrimaryActionsOnly: !1,
|
|
89
90
|
defaultPreferences: {},
|
|
90
|
-
country:
|
|
91
|
-
language:
|
|
91
|
+
country: g.GREAT_BRITAIN,
|
|
92
|
+
language: p.ENGLISH,
|
|
92
93
|
cookieStatementLink: "",
|
|
93
94
|
cookieTechnologiesLink: "",
|
|
94
95
|
openLinksInSameTab: !1
|
|
95
|
-
},
|
|
96
|
-
`${
|
|
97
|
-
`${
|
|
98
|
-
`${
|
|
99
|
-
`${
|
|
100
|
-
`${
|
|
101
|
-
`${
|
|
102
|
-
`${
|
|
103
|
-
`${
|
|
104
|
-
`${
|
|
105
|
-
`${
|
|
106
|
-
`${
|
|
107
|
-
`${
|
|
108
|
-
`${
|
|
109
|
-
`${
|
|
110
|
-
`${
|
|
111
|
-
`${
|
|
112
|
-
]),
|
|
113
|
-
[
|
|
114
|
-
[
|
|
115
|
-
[
|
|
116
|
-
[
|
|
117
|
-
[
|
|
118
|
-
[
|
|
119
|
-
[
|
|
120
|
-
[
|
|
121
|
-
[
|
|
122
|
-
[
|
|
123
|
-
[
|
|
124
|
-
[
|
|
125
|
-
[
|
|
126
|
-
[
|
|
127
|
-
[
|
|
128
|
-
[
|
|
129
|
-
[
|
|
130
|
-
[
|
|
96
|
+
}, it = /* @__PURE__ */ new Set([
|
|
97
|
+
`${p.BULGARIAN}`,
|
|
98
|
+
`${p.ENGLISH}-${g.CANADA}`,
|
|
99
|
+
`${p.FRENCH}-${g.CANADA}`,
|
|
100
|
+
`${p.DANISH}`,
|
|
101
|
+
`${p.ENGLISH}-${g.FRANCE}`,
|
|
102
|
+
`${p.FRENCH}-${g.FRANCE}`,
|
|
103
|
+
`${p.FRENCH}`,
|
|
104
|
+
`${p.GERMAN}`,
|
|
105
|
+
`${p.ENGLISH}`,
|
|
106
|
+
`${p.HEBREW}`,
|
|
107
|
+
`${p.ITALIAN}`,
|
|
108
|
+
`${p.DUTCH}`,
|
|
109
|
+
`${p.POLISH}`,
|
|
110
|
+
`${p.SLOVAK}`,
|
|
111
|
+
`${p.CATALAN}`,
|
|
112
|
+
`${p.SPANISH}`
|
|
113
|
+
]), xn = /* @__PURE__ */ new Map([
|
|
114
|
+
[g.AUSTRALIA, `${p.ENGLISH}`],
|
|
115
|
+
[g.AUSTRIA, `${p.GERMAN}`],
|
|
116
|
+
[g.BELGIUM, `${p.DUTCH}`],
|
|
117
|
+
[g.BULGARIA, `${p.BULGARIAN}`],
|
|
118
|
+
[g.CANADA, `${p.ENGLISH}`],
|
|
119
|
+
[g.DENMARK, `${p.DANISH}`],
|
|
120
|
+
[g.FRANCE, `${p.FRENCH}-${g.FRANCE}`],
|
|
121
|
+
[g.GERMANY, `${p.GERMAN}`],
|
|
122
|
+
[g.GREAT_BRITAIN, `${p.ENGLISH}`],
|
|
123
|
+
[g.IRELAND, `${p.ENGLISH}`],
|
|
124
|
+
[g.ISRAEL, `${p.HEBREW}`],
|
|
125
|
+
[g.ITALY, `${p.ITALIAN}`],
|
|
126
|
+
[g.LUXEMBOURG, `${p.FRENCH}`],
|
|
127
|
+
[g.NETHERLANDS, `${p.DUTCH}`],
|
|
128
|
+
[g.POLAND, `${p.POLISH}`],
|
|
129
|
+
[g.SLOVAKIA, `${p.SLOVAK}`],
|
|
130
|
+
[g.SPAIN, `${p.SPANISH}`],
|
|
131
|
+
[g.SWITZERLAND, `${p.GERMAN}`]
|
|
131
132
|
]);
|
|
132
|
-
|
|
133
|
-
|
|
133
|
+
/*! @license DOMPurify 3.4.8 | (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.8/LICENSE */
|
|
134
|
+
function Ht(t, i) {
|
|
135
|
+
(i == null || i > t.length) && (i = t.length);
|
|
136
|
+
for (var o = 0, r = Array(i); o < i; o++) r[o] = t[o];
|
|
137
|
+
return r;
|
|
134
138
|
}
|
|
135
|
-
function
|
|
136
|
-
|
|
137
|
-
return typeof a != "string" ? "" : a;
|
|
139
|
+
function Pn(t) {
|
|
140
|
+
if (Array.isArray(t)) return t;
|
|
138
141
|
}
|
|
139
|
-
function
|
|
140
|
-
|
|
141
|
-
if (
|
|
142
|
-
|
|
143
|
-
|
|
142
|
+
function Bn(t, i) {
|
|
143
|
+
var o = t == null ? null : typeof Symbol < "u" && t[Symbol.iterator] || t["@@iterator"];
|
|
144
|
+
if (o != null) {
|
|
145
|
+
var r, s, c, m, w = [], b = !0, V = !1;
|
|
146
|
+
try {
|
|
147
|
+
if (c = (o = o.call(t)).next, i !== 0) for (; !(b = (r = c.call(o)).done) && (w.push(r.value), w.length !== i); b = !0) ;
|
|
148
|
+
} catch (ne) {
|
|
149
|
+
V = !0, s = ne;
|
|
150
|
+
} finally {
|
|
151
|
+
try {
|
|
152
|
+
if (!b && o.return != null && (m = o.return(), Object(m) !== m)) return;
|
|
153
|
+
} finally {
|
|
154
|
+
if (V) throw s;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
return w;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
function $n() {
|
|
161
|
+
throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
162
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
163
|
+
}
|
|
164
|
+
function Hn(t, i) {
|
|
165
|
+
return Pn(t) || Bn(t, i) || Fn(t, i) || $n();
|
|
166
|
+
}
|
|
167
|
+
function Fn(t, i) {
|
|
168
|
+
if (t) {
|
|
169
|
+
if (typeof t == "string") return Ht(t, i);
|
|
170
|
+
var o = {}.toString.call(t).slice(8, -1);
|
|
171
|
+
return o === "Object" && t.constructor && (o = t.constructor.name), o === "Map" || o === "Set" ? Array.from(t) : o === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o) ? Ht(t, i) : void 0;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
const Jt = Object.entries, Ft = Object.setPrototypeOf, Un = Object.isFrozen, zn = Object.getPrototypeOf, Gn = Object.getOwnPropertyDescriptor;
|
|
175
|
+
let D = Object.freeze, x = Object.seal, me = Object.create, Qt = typeof Reflect < "u" && Reflect, ut = Qt.apply, pt = Qt.construct;
|
|
176
|
+
D || (D = function(i) {
|
|
177
|
+
return i;
|
|
178
|
+
});
|
|
179
|
+
x || (x = function(i) {
|
|
180
|
+
return i;
|
|
181
|
+
});
|
|
182
|
+
ut || (ut = function(i, o) {
|
|
183
|
+
for (var r = arguments.length, s = new Array(r > 2 ? r - 2 : 0), c = 2; c < r; c++)
|
|
184
|
+
s[c - 2] = arguments[c];
|
|
185
|
+
return i.apply(o, s);
|
|
186
|
+
});
|
|
187
|
+
pt || (pt = function(i) {
|
|
188
|
+
for (var o = arguments.length, r = new Array(o > 1 ? o - 1 : 0), s = 1; s < o; s++)
|
|
189
|
+
r[s - 1] = arguments[s];
|
|
190
|
+
return new i(...r);
|
|
191
|
+
});
|
|
192
|
+
const ee = S(Array.prototype.forEach), jn = S(Array.prototype.lastIndexOf), Ut = S(Array.prototype.pop), ue = S(Array.prototype.push), Wn = S(Array.prototype.splice), I = Array.isArray, be = S(String.prototype.toLowerCase), ot = S(String.prototype.toString), zt = S(String.prototype.match), pe = S(String.prototype.replace), Gt = S(String.prototype.indexOf), Yn = S(String.prototype.trim), Vn = S(Number.prototype.toString), Kn = S(Boolean.prototype.toString), jt = typeof BigInt > "u" ? null : S(BigInt.prototype.toString), Wt = typeof Symbol > "u" ? null : S(Symbol.prototype.toString), T = S(Object.prototype.hasOwnProperty), Ee = S(Object.prototype.toString), k = S(RegExp.prototype.test), de = Xn(TypeError);
|
|
193
|
+
function S(t) {
|
|
194
|
+
return function(i) {
|
|
195
|
+
i instanceof RegExp && (i.lastIndex = 0);
|
|
196
|
+
for (var o = arguments.length, r = new Array(o > 1 ? o - 1 : 0), s = 1; s < o; s++)
|
|
197
|
+
r[s - 1] = arguments[s];
|
|
198
|
+
return ut(t, i, r);
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
function Xn(t) {
|
|
202
|
+
return function() {
|
|
203
|
+
for (var i = arguments.length, o = new Array(i), r = 0; r < i; r++)
|
|
204
|
+
o[r] = arguments[r];
|
|
205
|
+
return pt(t, o);
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
function f(t, i) {
|
|
209
|
+
let o = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : be;
|
|
210
|
+
if (Ft && Ft(t, null), !I(i))
|
|
211
|
+
return t;
|
|
212
|
+
let r = i.length;
|
|
213
|
+
for (; r--; ) {
|
|
214
|
+
let s = i[r];
|
|
215
|
+
if (typeof s == "string") {
|
|
216
|
+
const c = o(s);
|
|
217
|
+
c !== s && (Un(i) || (i[r] = c), s = c);
|
|
218
|
+
}
|
|
219
|
+
t[s] = !0;
|
|
220
|
+
}
|
|
221
|
+
return t;
|
|
222
|
+
}
|
|
223
|
+
function qn(t) {
|
|
224
|
+
for (let i = 0; i < t.length; i++)
|
|
225
|
+
T(t, i) || (t[i] = null);
|
|
226
|
+
return t;
|
|
227
|
+
}
|
|
228
|
+
function L(t) {
|
|
229
|
+
const i = me(null);
|
|
230
|
+
for (const r of Jt(t)) {
|
|
231
|
+
var o = Hn(r, 2);
|
|
232
|
+
const s = o[0], c = o[1];
|
|
233
|
+
T(t, s) && (I(c) ? i[s] = qn(c) : c && typeof c == "object" && c.constructor === Object ? i[s] = L(c) : i[s] = c);
|
|
234
|
+
}
|
|
235
|
+
return i;
|
|
236
|
+
}
|
|
237
|
+
function Zn(t) {
|
|
238
|
+
switch (typeof t) {
|
|
239
|
+
case "string":
|
|
240
|
+
return t;
|
|
241
|
+
case "number":
|
|
242
|
+
return Vn(t);
|
|
243
|
+
case "boolean":
|
|
244
|
+
return Kn(t);
|
|
245
|
+
case "bigint":
|
|
246
|
+
return jt ? jt(t) : "0";
|
|
247
|
+
case "symbol":
|
|
248
|
+
return Wt ? Wt(t) : "Symbol()";
|
|
249
|
+
case "undefined":
|
|
250
|
+
return Ee(t);
|
|
251
|
+
case "function":
|
|
252
|
+
case "object": {
|
|
253
|
+
if (t === null)
|
|
254
|
+
return Ee(t);
|
|
255
|
+
const i = t, o = W(i, "toString");
|
|
256
|
+
if (typeof o == "function") {
|
|
257
|
+
const r = o(i);
|
|
258
|
+
return typeof r == "string" ? r : Ee(r);
|
|
259
|
+
}
|
|
260
|
+
return Ee(t);
|
|
261
|
+
}
|
|
262
|
+
default:
|
|
263
|
+
return Ee(t);
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
function W(t, i) {
|
|
267
|
+
for (; t !== null; ) {
|
|
268
|
+
const r = Gn(t, i);
|
|
269
|
+
if (r) {
|
|
270
|
+
if (r.get)
|
|
271
|
+
return S(r.get);
|
|
272
|
+
if (typeof r.value == "function")
|
|
273
|
+
return S(r.value);
|
|
274
|
+
}
|
|
275
|
+
t = zn(t);
|
|
276
|
+
}
|
|
277
|
+
function o() {
|
|
278
|
+
return null;
|
|
279
|
+
}
|
|
280
|
+
return o;
|
|
281
|
+
}
|
|
282
|
+
function Jn(t) {
|
|
283
|
+
try {
|
|
284
|
+
return k(t, ""), !0;
|
|
285
|
+
} catch {
|
|
286
|
+
return !1;
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
const Yt = D(["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"]), rt = D(["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"]), at = D(["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"]), Qn = D(["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"]), st = D(["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"]), ei = D(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), Vt = D(["#text"]), Kt = D(["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"]), lt = D(["accent-height", "accumulate", "additive", "alignment-baseline", "amplitude", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "exponent", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "intercept", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "mask-type", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "slope", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "tablevalues", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]), Xt = D(["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"]), $e = D(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), ti = x(/{{[\w\W]*|^[\w\W]*}}/g), ni = x(/<%[\w\W]*|^[\w\W]*%>/g), ii = x(/\${[\w\W]*/g), oi = x(/^data-[\-\w.\u00B7-\uFFFF]+$/), ri = x(/^aria-[\-\w]+$/), qt = x(
|
|
290
|
+
/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
|
|
291
|
+
// eslint-disable-line no-useless-escape
|
|
292
|
+
), ai = x(/^(?:\w+script|data):/i), si = x(
|
|
293
|
+
/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
|
|
294
|
+
// eslint-disable-line no-control-regex
|
|
295
|
+
), li = x(/^html$/i), ci = x(/^[a-z][.\w]*(-[.\w]+)+$/i), j = {
|
|
296
|
+
element: 1,
|
|
297
|
+
attribute: 2,
|
|
298
|
+
text: 3,
|
|
299
|
+
cdataSection: 4,
|
|
300
|
+
entityReference: 5,
|
|
301
|
+
// Deprecated
|
|
302
|
+
entityNode: 6,
|
|
303
|
+
// Deprecated
|
|
304
|
+
progressingInstruction: 7,
|
|
305
|
+
comment: 8,
|
|
306
|
+
document: 9,
|
|
307
|
+
documentType: 10,
|
|
308
|
+
documentFragment: 11,
|
|
309
|
+
notation: 12
|
|
310
|
+
// Deprecated
|
|
311
|
+
}, fi = function() {
|
|
312
|
+
return typeof window > "u" ? null : window;
|
|
313
|
+
}, ui = function(i, o) {
|
|
314
|
+
if (typeof i != "object" || typeof i.createPolicy != "function")
|
|
315
|
+
return null;
|
|
316
|
+
let r = null;
|
|
317
|
+
const s = "data-tt-policy-suffix";
|
|
318
|
+
o && o.hasAttribute(s) && (r = o.getAttribute(s));
|
|
319
|
+
const c = "dompurify" + (r ? "#" + r : "");
|
|
320
|
+
try {
|
|
321
|
+
return i.createPolicy(c, {
|
|
322
|
+
createHTML(m) {
|
|
323
|
+
return m;
|
|
324
|
+
},
|
|
325
|
+
createScriptURL(m) {
|
|
326
|
+
return m;
|
|
327
|
+
}
|
|
328
|
+
});
|
|
329
|
+
} catch {
|
|
330
|
+
return console.warn("TrustedTypes policy " + c + " could not be created."), null;
|
|
331
|
+
}
|
|
332
|
+
}, Zt = function() {
|
|
333
|
+
return {
|
|
334
|
+
afterSanitizeAttributes: [],
|
|
335
|
+
afterSanitizeElements: [],
|
|
336
|
+
afterSanitizeShadowDOM: [],
|
|
337
|
+
beforeSanitizeAttributes: [],
|
|
338
|
+
beforeSanitizeElements: [],
|
|
339
|
+
beforeSanitizeShadowDOM: [],
|
|
340
|
+
uponSanitizeAttribute: [],
|
|
341
|
+
uponSanitizeElement: [],
|
|
342
|
+
uponSanitizeShadowNode: []
|
|
343
|
+
};
|
|
344
|
+
};
|
|
345
|
+
function en() {
|
|
346
|
+
let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : fi();
|
|
347
|
+
const i = (l) => en(l);
|
|
348
|
+
if (i.version = "3.4.8", i.removed = [], !t || !t.document || t.document.nodeType !== j.document || !t.Element)
|
|
349
|
+
return i.isSupported = !1, i;
|
|
350
|
+
let o = t.document;
|
|
351
|
+
const r = o, s = r.currentScript;
|
|
352
|
+
t.DocumentFragment;
|
|
353
|
+
const c = t.HTMLTemplateElement, m = t.Node, w = t.Element, b = t.NodeFilter, V = t.NamedNodeMap;
|
|
354
|
+
V === void 0 && (t.NamedNodeMap || t.MozNamedAttrMap), t.HTMLFormElement;
|
|
355
|
+
const ne = t.DOMParser, ie = t.trustedTypes, U = w.prototype, on = W(U, "cloneNode"), rn = W(U, "remove"), an = W(U, "nextSibling"), ye = W(U, "childNodes"), Se = W(U, "parentNode"), Re = W(U, "shadowRoot"), sn = W(U, "attributes"), B = m && m.prototype ? W(m.prototype, "nodeType") : null, K = m && m.prototype ? W(m.prototype, "nodeName") : null;
|
|
356
|
+
if (typeof c == "function") {
|
|
357
|
+
const l = o.createElement("template");
|
|
358
|
+
l.content && l.content.ownerDocument && (o = l.content.ownerDocument);
|
|
359
|
+
}
|
|
360
|
+
let v, he = "", Fe = 0;
|
|
361
|
+
const oe = function(e) {
|
|
362
|
+
if (Fe > 0)
|
|
363
|
+
throw de('The configured TRUSTED_TYPES_POLICY.createHTML must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose createHTML wraps DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.');
|
|
364
|
+
Fe++;
|
|
365
|
+
try {
|
|
366
|
+
return v.createHTML(e);
|
|
367
|
+
} finally {
|
|
368
|
+
Fe--;
|
|
369
|
+
}
|
|
370
|
+
}, Ne = o, Ue = Ne.implementation, mt = Ne.createNodeIterator, ln = Ne.createDocumentFragment, cn = Ne.getElementsByTagName, fn = r.importNode;
|
|
371
|
+
let N = Zt();
|
|
372
|
+
i.isSupported = typeof Jt == "function" && typeof Se == "function" && Ue && Ue.createHTMLDocument !== void 0;
|
|
373
|
+
const Oe = ti, ke = ni, Le = ii, un = oi, pn = ri, dn = ai, ht = si, mn = ci;
|
|
374
|
+
let gt = qt, A = null;
|
|
375
|
+
const ze = f({}, [...Yt, ...rt, ...at, ...st, ...Vt]);
|
|
376
|
+
let y = null;
|
|
377
|
+
const Ge = f({}, [...Kt, ...lt, ...Xt, ...$e]);
|
|
378
|
+
let _ = Object.seal(me(null, {
|
|
379
|
+
tagNameCheck: {
|
|
380
|
+
writable: !0,
|
|
381
|
+
configurable: !1,
|
|
382
|
+
enumerable: !0,
|
|
383
|
+
value: null
|
|
384
|
+
},
|
|
385
|
+
attributeNameCheck: {
|
|
386
|
+
writable: !0,
|
|
387
|
+
configurable: !1,
|
|
388
|
+
enumerable: !0,
|
|
389
|
+
value: null
|
|
390
|
+
},
|
|
391
|
+
allowCustomizedBuiltInElements: {
|
|
392
|
+
writable: !0,
|
|
393
|
+
configurable: !1,
|
|
394
|
+
enumerable: !0,
|
|
395
|
+
value: !1
|
|
396
|
+
}
|
|
397
|
+
})), ge = null, Ie = null;
|
|
398
|
+
const X = Object.seal(me(null, {
|
|
399
|
+
tagCheck: {
|
|
400
|
+
writable: !0,
|
|
401
|
+
configurable: !1,
|
|
402
|
+
enumerable: !0,
|
|
403
|
+
value: null
|
|
404
|
+
},
|
|
405
|
+
attributeCheck: {
|
|
406
|
+
writable: !0,
|
|
407
|
+
configurable: !1,
|
|
408
|
+
enumerable: !0,
|
|
409
|
+
value: null
|
|
410
|
+
}
|
|
411
|
+
}));
|
|
412
|
+
let Tt = !0, je = !0, At = !1, _t = !0, q = !1, Te = !0, J = !1, We = !1, Ye = !1, re = !1, De = !1, Ce = !1, Et = !0, bt = !1;
|
|
413
|
+
const yt = "user-content-";
|
|
414
|
+
let Ve = !0, Ae = !1, ae = {}, z = null;
|
|
415
|
+
const Ke = f({}, ["annotation-xml", "audio", "colgroup", "desc", "foreignobject", "head", "iframe", "math", "mi", "mn", "mo", "ms", "mtext", "noembed", "noframes", "noscript", "plaintext", "script", "style", "svg", "template", "thead", "title", "video", "xmp"]);
|
|
416
|
+
let St = null;
|
|
417
|
+
const Rt = f({}, ["audio", "video", "img", "source", "image", "track"]);
|
|
418
|
+
let Xe = null;
|
|
419
|
+
const Nt = f({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), we = "http://www.w3.org/1998/Math/MathML", ve = "http://www.w3.org/2000/svg", G = "http://www.w3.org/1999/xhtml";
|
|
420
|
+
let se = G, qe = !1, Ze = null;
|
|
421
|
+
const hn = f({}, [we, ve, G], ot);
|
|
422
|
+
let Je = f({}, ["mi", "mo", "mn", "ms", "mtext"]), Qe = f({}, ["annotation-xml"]);
|
|
423
|
+
const gn = f({}, ["title", "style", "font", "a", "script"]);
|
|
424
|
+
let _e = null;
|
|
425
|
+
const Tn = ["application/xhtml+xml", "text/html"], An = "text/html";
|
|
426
|
+
let E = null, le = null;
|
|
427
|
+
const _n = o.createElement("form"), Ot = function(e) {
|
|
428
|
+
return e instanceof RegExp || e instanceof Function;
|
|
429
|
+
}, et = function() {
|
|
430
|
+
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
431
|
+
if (le && le === e)
|
|
432
|
+
return;
|
|
433
|
+
(!e || typeof e != "object") && (e = {}), e = L(e), _e = // eslint-disable-next-line unicorn/prefer-includes
|
|
434
|
+
Tn.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? An : e.PARSER_MEDIA_TYPE, E = _e === "application/xhtml+xml" ? ot : be, A = T(e, "ALLOWED_TAGS") && I(e.ALLOWED_TAGS) ? f({}, e.ALLOWED_TAGS, E) : ze, y = T(e, "ALLOWED_ATTR") && I(e.ALLOWED_ATTR) ? f({}, e.ALLOWED_ATTR, E) : Ge, Ze = T(e, "ALLOWED_NAMESPACES") && I(e.ALLOWED_NAMESPACES) ? f({}, e.ALLOWED_NAMESPACES, ot) : hn, Xe = T(e, "ADD_URI_SAFE_ATTR") && I(e.ADD_URI_SAFE_ATTR) ? f(L(Nt), e.ADD_URI_SAFE_ATTR, E) : Nt, St = T(e, "ADD_DATA_URI_TAGS") && I(e.ADD_DATA_URI_TAGS) ? f(L(Rt), e.ADD_DATA_URI_TAGS, E) : Rt, z = T(e, "FORBID_CONTENTS") && I(e.FORBID_CONTENTS) ? f({}, e.FORBID_CONTENTS, E) : Ke, ge = T(e, "FORBID_TAGS") && I(e.FORBID_TAGS) ? f({}, e.FORBID_TAGS, E) : L({}), Ie = T(e, "FORBID_ATTR") && I(e.FORBID_ATTR) ? f({}, e.FORBID_ATTR, E) : L({}), ae = T(e, "USE_PROFILES") ? e.USE_PROFILES && typeof e.USE_PROFILES == "object" ? L(e.USE_PROFILES) : e.USE_PROFILES : !1, Tt = e.ALLOW_ARIA_ATTR !== !1, je = e.ALLOW_DATA_ATTR !== !1, At = e.ALLOW_UNKNOWN_PROTOCOLS || !1, _t = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, q = e.SAFE_FOR_TEMPLATES || !1, Te = e.SAFE_FOR_XML !== !1, J = e.WHOLE_DOCUMENT || !1, re = e.RETURN_DOM || !1, De = e.RETURN_DOM_FRAGMENT || !1, Ce = e.RETURN_TRUSTED_TYPE || !1, Ye = e.FORCE_BODY || !1, Et = e.SANITIZE_DOM !== !1, bt = e.SANITIZE_NAMED_PROPS || !1, Ve = e.KEEP_CONTENT !== !1, Ae = e.IN_PLACE || !1, gt = Jn(e.ALLOWED_URI_REGEXP) ? e.ALLOWED_URI_REGEXP : qt, se = typeof e.NAMESPACE == "string" ? e.NAMESPACE : G, Je = T(e, "MATHML_TEXT_INTEGRATION_POINTS") && e.MATHML_TEXT_INTEGRATION_POINTS && typeof e.MATHML_TEXT_INTEGRATION_POINTS == "object" ? L(e.MATHML_TEXT_INTEGRATION_POINTS) : f({}, ["mi", "mo", "mn", "ms", "mtext"]), Qe = T(e, "HTML_INTEGRATION_POINTS") && e.HTML_INTEGRATION_POINTS && typeof e.HTML_INTEGRATION_POINTS == "object" ? L(e.HTML_INTEGRATION_POINTS) : f({}, ["annotation-xml"]);
|
|
435
|
+
const n = T(e, "CUSTOM_ELEMENT_HANDLING") && e.CUSTOM_ELEMENT_HANDLING && typeof e.CUSTOM_ELEMENT_HANDLING == "object" ? L(e.CUSTOM_ELEMENT_HANDLING) : me(null);
|
|
436
|
+
if (_ = me(null), T(n, "tagNameCheck") && Ot(n.tagNameCheck) && (_.tagNameCheck = n.tagNameCheck), T(n, "attributeNameCheck") && Ot(n.attributeNameCheck) && (_.attributeNameCheck = n.attributeNameCheck), T(n, "allowCustomizedBuiltInElements") && typeof n.allowCustomizedBuiltInElements == "boolean" && (_.allowCustomizedBuiltInElements = n.allowCustomizedBuiltInElements), q && (je = !1), De && (re = !0), ae && (A = f({}, Vt), y = me(null), ae.html === !0 && (f(A, Yt), f(y, Kt)), ae.svg === !0 && (f(A, rt), f(y, lt), f(y, $e)), ae.svgFilters === !0 && (f(A, at), f(y, lt), f(y, $e)), ae.mathMl === !0 && (f(A, st), f(y, Xt), f(y, $e))), X.tagCheck = null, X.attributeCheck = null, T(e, "ADD_TAGS") && (typeof e.ADD_TAGS == "function" ? X.tagCheck = e.ADD_TAGS : I(e.ADD_TAGS) && (A === ze && (A = L(A)), f(A, e.ADD_TAGS, E))), T(e, "ADD_ATTR") && (typeof e.ADD_ATTR == "function" ? X.attributeCheck = e.ADD_ATTR : I(e.ADD_ATTR) && (y === Ge && (y = L(y)), f(y, e.ADD_ATTR, E))), T(e, "ADD_URI_SAFE_ATTR") && I(e.ADD_URI_SAFE_ATTR) && f(Xe, e.ADD_URI_SAFE_ATTR, E), T(e, "FORBID_CONTENTS") && I(e.FORBID_CONTENTS) && (z === Ke && (z = L(z)), f(z, e.FORBID_CONTENTS, E)), T(e, "ADD_FORBID_CONTENTS") && I(e.ADD_FORBID_CONTENTS) && (z === Ke && (z = L(z)), f(z, e.ADD_FORBID_CONTENTS, E)), Ve && (A["#text"] = !0), J && f(A, ["html", "head", "body"]), A.table && (f(A, ["tbody"]), delete ge.tbody), e.TRUSTED_TYPES_POLICY) {
|
|
437
|
+
if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function")
|
|
438
|
+
throw de('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
|
|
439
|
+
if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function")
|
|
440
|
+
throw de('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
|
|
441
|
+
const a = v;
|
|
442
|
+
v = e.TRUSTED_TYPES_POLICY;
|
|
443
|
+
try {
|
|
444
|
+
he = oe("");
|
|
445
|
+
} catch (d) {
|
|
446
|
+
throw v = a, d;
|
|
447
|
+
}
|
|
448
|
+
} else
|
|
449
|
+
v === void 0 && e.TRUSTED_TYPES_POLICY !== null && (v = ui(ie, s)), v && typeof he == "string" && (he = oe(""));
|
|
450
|
+
(N.uponSanitizeElement.length > 0 || N.uponSanitizeAttribute.length > 0) && A === ze && (A = L(A)), N.uponSanitizeAttribute.length > 0 && y === Ge && (y = L(y)), D && D(e), le = e;
|
|
451
|
+
}, kt = f({}, [...rt, ...at, ...Qn]), Lt = f({}, [...st, ...ei]), En = function(e) {
|
|
452
|
+
let n = Se(e);
|
|
453
|
+
(!n || !n.tagName) && (n = {
|
|
454
|
+
namespaceURI: se,
|
|
455
|
+
tagName: "template"
|
|
456
|
+
});
|
|
457
|
+
const a = be(e.tagName), d = be(n.tagName);
|
|
458
|
+
return Ze[e.namespaceURI] ? e.namespaceURI === ve ? n.namespaceURI === G ? a === "svg" : n.namespaceURI === we ? a === "svg" && (d === "annotation-xml" || Je[d]) : !!kt[a] : e.namespaceURI === we ? n.namespaceURI === G ? a === "math" : n.namespaceURI === ve ? a === "math" && Qe[d] : !!Lt[a] : e.namespaceURI === G ? n.namespaceURI === ve && !Qe[d] || n.namespaceURI === we && !Je[d] ? !1 : !Lt[a] && (gn[a] || !kt[a]) : !!(_e === "application/xhtml+xml" && Ze[e.namespaceURI]) : !1;
|
|
459
|
+
}, $ = function(e) {
|
|
460
|
+
ue(i.removed, {
|
|
461
|
+
element: e
|
|
462
|
+
});
|
|
463
|
+
try {
|
|
464
|
+
Se(e).removeChild(e);
|
|
465
|
+
} catch {
|
|
466
|
+
rn(e);
|
|
467
|
+
}
|
|
468
|
+
}, Q = function(e, n) {
|
|
469
|
+
try {
|
|
470
|
+
ue(i.removed, {
|
|
471
|
+
attribute: n.getAttributeNode(e),
|
|
472
|
+
from: n
|
|
473
|
+
});
|
|
474
|
+
} catch {
|
|
475
|
+
ue(i.removed, {
|
|
476
|
+
attribute: null,
|
|
477
|
+
from: n
|
|
478
|
+
});
|
|
479
|
+
}
|
|
480
|
+
if (n.removeAttribute(e), e === "is")
|
|
481
|
+
if (re || De)
|
|
482
|
+
try {
|
|
483
|
+
$(n);
|
|
484
|
+
} catch {
|
|
485
|
+
}
|
|
486
|
+
else
|
|
487
|
+
try {
|
|
488
|
+
n.setAttribute(e, "");
|
|
489
|
+
} catch {
|
|
490
|
+
}
|
|
491
|
+
}, It = function(e) {
|
|
492
|
+
let n = null, a = null;
|
|
493
|
+
if (Ye)
|
|
494
|
+
e = "<remove></remove>" + e;
|
|
495
|
+
else {
|
|
496
|
+
const h = zt(e, /^[\r\n\t ]+/);
|
|
497
|
+
a = h && h[0];
|
|
498
|
+
}
|
|
499
|
+
_e === "application/xhtml+xml" && se === G && (e = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + e + "</body></html>");
|
|
500
|
+
const d = v ? oe(e) : e;
|
|
501
|
+
if (se === G)
|
|
502
|
+
try {
|
|
503
|
+
n = new ne().parseFromString(d, _e);
|
|
504
|
+
} catch {
|
|
505
|
+
}
|
|
506
|
+
if (!n || !n.documentElement) {
|
|
507
|
+
n = Ue.createDocument(se, "template", null);
|
|
508
|
+
try {
|
|
509
|
+
n.documentElement.innerHTML = qe ? he : d;
|
|
510
|
+
} catch {
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
const u = n.body || n.documentElement;
|
|
514
|
+
return e && a && u.insertBefore(o.createTextNode(a), u.childNodes[0] || null), se === G ? cn.call(n, J ? "html" : "body")[0] : J ? n.documentElement : u;
|
|
515
|
+
}, Dt = function(e) {
|
|
516
|
+
return mt.call(
|
|
517
|
+
e.ownerDocument || e,
|
|
518
|
+
e,
|
|
519
|
+
// eslint-disable-next-line no-bitwise
|
|
520
|
+
b.SHOW_ELEMENT | b.SHOW_COMMENT | b.SHOW_TEXT | b.SHOW_PROCESSING_INSTRUCTION | b.SHOW_CDATA_SECTION,
|
|
521
|
+
null
|
|
522
|
+
);
|
|
523
|
+
}, tt = function(e) {
|
|
524
|
+
var n, a;
|
|
525
|
+
e.normalize();
|
|
526
|
+
const d = mt.call(
|
|
527
|
+
e.ownerDocument || e,
|
|
528
|
+
e,
|
|
529
|
+
// eslint-disable-next-line no-bitwise
|
|
530
|
+
b.SHOW_TEXT | b.SHOW_COMMENT | b.SHOW_CDATA_SECTION | b.SHOW_PROCESSING_INSTRUCTION,
|
|
531
|
+
null
|
|
532
|
+
);
|
|
533
|
+
let u = d.nextNode();
|
|
534
|
+
for (; u; ) {
|
|
535
|
+
let R = u.data;
|
|
536
|
+
ee([Oe, ke, Le], (M) => {
|
|
537
|
+
R = pe(R, M, " ");
|
|
538
|
+
}), u.data = R, u = d.nextNode();
|
|
539
|
+
}
|
|
540
|
+
const h = (n = (a = e.querySelectorAll) === null || a === void 0 ? void 0 : a.call(e, "template")) !== null && n !== void 0 ? n : [];
|
|
541
|
+
ee(Array.from(h), (R) => {
|
|
542
|
+
ce(R.content) && tt(R.content);
|
|
543
|
+
});
|
|
544
|
+
}, Me = function(e) {
|
|
545
|
+
const n = K ? K(e) : null;
|
|
546
|
+
return typeof n != "string" || E(n) !== "form" ? !1 : typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || // Realm-safe NamedNodeMap detection: equality against the cached
|
|
547
|
+
// prototype getter. Clobbered .attributes (e.g. <input name="attributes">)
|
|
548
|
+
// makes the direct read diverge from the cached read; a clean form
|
|
549
|
+
// (same-realm OR foreign-realm) has both reads pointing at the same
|
|
550
|
+
// canonical NamedNodeMap.
|
|
551
|
+
e.attributes !== sn(e) || typeof e.removeAttribute != "function" || typeof e.setAttribute != "function" || typeof e.namespaceURI != "string" || typeof e.insertBefore != "function" || typeof e.hasChildNodes != "function" || // NodeType clobbering probe. Cached Node.prototype.nodeType getter
|
|
552
|
+
// returns the integer 1 for any Element regardless of realm; direct
|
|
553
|
+
// read on a clobbered form (e.g. <input name="nodeType">) returns
|
|
554
|
+
// the named child element. Cheap addition — nodeType is read from
|
|
555
|
+
// an internal slot, no serialization cost — and removes a residual
|
|
556
|
+
// clobbering surface used by several mXSS / PI / comment branches
|
|
557
|
+
// in _sanitizeElements that compare currentNode.nodeType directly.
|
|
558
|
+
e.nodeType !== B(e) || // HTMLFormElement has [LegacyOverrideBuiltIns]: a descendant named
|
|
559
|
+
// "childNodes" shadows the prototype getter. Direct reads of
|
|
560
|
+
// form.childNodes from a clobbered form return the named child
|
|
561
|
+
// instead of the real NodeList, so any walk that reads it directly
|
|
562
|
+
// skips the form's real children. Compare the direct read to the
|
|
563
|
+
// cached Node.prototype getter — when the form's named-property
|
|
564
|
+
// getter intercepts the read, the two values differ and we flag
|
|
565
|
+
// the form. This catches every clobbering child type (input,
|
|
566
|
+
// select, etc.) regardless of whether the named child happens to
|
|
567
|
+
// carry a numeric .length, which a typeof-based probe would miss
|
|
568
|
+
// (e.g. HTMLSelectElement.length is a defined unsigned-long).
|
|
569
|
+
e.childNodes !== ye(e);
|
|
570
|
+
}, ce = function(e) {
|
|
571
|
+
if (!B || typeof e != "object" || e === null)
|
|
572
|
+
return !1;
|
|
573
|
+
try {
|
|
574
|
+
return B(e) === j.documentFragment;
|
|
575
|
+
} catch {
|
|
576
|
+
return !1;
|
|
577
|
+
}
|
|
578
|
+
}, xe = function(e) {
|
|
579
|
+
if (!B || typeof e != "object" || e === null)
|
|
580
|
+
return !1;
|
|
581
|
+
try {
|
|
582
|
+
return typeof B(e) == "number";
|
|
583
|
+
} catch {
|
|
584
|
+
return !1;
|
|
585
|
+
}
|
|
586
|
+
};
|
|
587
|
+
function Y(l, e, n) {
|
|
588
|
+
ee(l, (a) => {
|
|
589
|
+
a.call(i, e, n, le);
|
|
590
|
+
});
|
|
591
|
+
}
|
|
592
|
+
const Ct = function(e) {
|
|
593
|
+
let n = null;
|
|
594
|
+
if (Y(N.beforeSanitizeElements, e, null), Me(e))
|
|
595
|
+
return $(e), !0;
|
|
596
|
+
const a = E(K ? K(e) : e.nodeName);
|
|
597
|
+
if (Y(N.uponSanitizeElement, e, {
|
|
598
|
+
tagName: a,
|
|
599
|
+
allowedTags: A
|
|
600
|
+
}), Te && e.hasChildNodes() && !xe(e.firstElementChild) && k(/<[/\w!]/g, e.innerHTML) && k(/<[/\w!]/g, e.textContent) || Te && e.namespaceURI === G && a === "style" && xe(e.firstElementChild) || e.nodeType === j.progressingInstruction || Te && e.nodeType === j.comment && k(/<[/\w]/g, e.data))
|
|
601
|
+
return $(e), !0;
|
|
602
|
+
if (ge[a] || !(X.tagCheck instanceof Function && X.tagCheck(a)) && !A[a]) {
|
|
603
|
+
if (!ge[a] && vt(a) && (_.tagNameCheck instanceof RegExp && k(_.tagNameCheck, a) || _.tagNameCheck instanceof Function && _.tagNameCheck(a)))
|
|
604
|
+
return !1;
|
|
605
|
+
if (Ve && !z[a]) {
|
|
606
|
+
const u = Se(e), h = ye(e);
|
|
607
|
+
if (h && u) {
|
|
608
|
+
const R = h.length;
|
|
609
|
+
for (let M = R - 1; M >= 0; --M) {
|
|
610
|
+
const H = on(h[M], !0);
|
|
611
|
+
u.insertBefore(H, an(e));
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
}
|
|
615
|
+
return $(e), !0;
|
|
616
|
+
}
|
|
617
|
+
return (B ? B(e) : e.nodeType) === j.element && !En(e) || (a === "noscript" || a === "noembed" || a === "noframes") && k(/<\/no(script|embed|frames)/i, e.innerHTML) ? ($(e), !0) : (q && e.nodeType === j.text && (n = e.textContent, ee([Oe, ke, Le], (u) => {
|
|
618
|
+
n = pe(n, u, " ");
|
|
619
|
+
}), e.textContent !== n && (ue(i.removed, {
|
|
620
|
+
element: e.cloneNode()
|
|
621
|
+
}), e.textContent = n)), Y(N.afterSanitizeElements, e, null), !1);
|
|
622
|
+
}, wt = function(e, n, a) {
|
|
623
|
+
if (Ie[n] || Et && (n === "id" || n === "name") && (a in o || a in _n))
|
|
624
|
+
return !1;
|
|
625
|
+
const d = y[n] || X.attributeCheck instanceof Function && X.attributeCheck(n, e);
|
|
626
|
+
if (!(je && !Ie[n] && k(un, n))) {
|
|
627
|
+
if (!(Tt && k(pn, n))) {
|
|
628
|
+
if (!d || Ie[n]) {
|
|
629
|
+
if (
|
|
630
|
+
// First condition does a very basic check if a) it's basically a valid custom element tagname AND
|
|
631
|
+
// b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
632
|
+
// and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
|
|
633
|
+
!(vt(e) && (_.tagNameCheck instanceof RegExp && k(_.tagNameCheck, e) || _.tagNameCheck instanceof Function && _.tagNameCheck(e)) && (_.attributeNameCheck instanceof RegExp && k(_.attributeNameCheck, n) || _.attributeNameCheck instanceof Function && _.attributeNameCheck(n, e)) || // Alternative, second condition checks if it's an `is`-attribute, AND
|
|
634
|
+
// the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
635
|
+
n === "is" && _.allowCustomizedBuiltInElements && (_.tagNameCheck instanceof RegExp && k(_.tagNameCheck, a) || _.tagNameCheck instanceof Function && _.tagNameCheck(a)))
|
|
636
|
+
) return !1;
|
|
637
|
+
} else if (!Xe[n]) {
|
|
638
|
+
if (!k(gt, pe(a, ht, ""))) {
|
|
639
|
+
if (!((n === "src" || n === "xlink:href" || n === "href") && e !== "script" && Gt(a, "data:") === 0 && St[e])) {
|
|
640
|
+
if (!(At && !k(dn, pe(a, ht, "")))) {
|
|
641
|
+
if (a)
|
|
642
|
+
return !1;
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
return !0;
|
|
650
|
+
}, bn = f({}, ["annotation-xml", "color-profile", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "missing-glyph"]), vt = function(e) {
|
|
651
|
+
return !bn[be(e)] && k(mn, e);
|
|
652
|
+
}, Mt = function(e) {
|
|
653
|
+
Y(N.beforeSanitizeAttributes, e, null);
|
|
654
|
+
const n = e.attributes;
|
|
655
|
+
if (!n || Me(e))
|
|
656
|
+
return;
|
|
657
|
+
const a = {
|
|
658
|
+
attrName: "",
|
|
659
|
+
attrValue: "",
|
|
660
|
+
keepAttr: !0,
|
|
661
|
+
allowedAttributes: y,
|
|
662
|
+
forceKeepAttr: void 0
|
|
663
|
+
};
|
|
664
|
+
let d = n.length;
|
|
665
|
+
for (; d--; ) {
|
|
666
|
+
const u = n[d], h = u.name, R = u.namespaceURI, M = u.value, H = E(h), nt = M;
|
|
667
|
+
let O = h === "value" ? nt : Yn(nt);
|
|
668
|
+
if (a.attrName = H, a.attrValue = O, a.keepAttr = !0, a.forceKeepAttr = void 0, Y(N.uponSanitizeAttribute, e, a), O = a.attrValue, bt && (H === "id" || H === "name") && Gt(O, yt) !== 0 && (Q(h, e), O = yt + O), Te && k(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, O)) {
|
|
669
|
+
Q(h, e);
|
|
670
|
+
continue;
|
|
671
|
+
}
|
|
672
|
+
if (H === "attributename" && zt(O, "href")) {
|
|
673
|
+
Q(h, e);
|
|
674
|
+
continue;
|
|
675
|
+
}
|
|
676
|
+
if (a.forceKeepAttr)
|
|
677
|
+
continue;
|
|
678
|
+
if (!a.keepAttr) {
|
|
679
|
+
Q(h, e);
|
|
680
|
+
continue;
|
|
681
|
+
}
|
|
682
|
+
if (!_t && k(/\/>/i, O)) {
|
|
683
|
+
Q(h, e);
|
|
684
|
+
continue;
|
|
685
|
+
}
|
|
686
|
+
q && ee([Oe, ke, Le], (Pt) => {
|
|
687
|
+
O = pe(O, Pt, " ");
|
|
688
|
+
});
|
|
689
|
+
const xt = E(e.nodeName);
|
|
690
|
+
if (!wt(xt, H, O)) {
|
|
691
|
+
Q(h, e);
|
|
692
|
+
continue;
|
|
693
|
+
}
|
|
694
|
+
if (v && typeof ie == "object" && typeof ie.getAttributeType == "function" && !R)
|
|
695
|
+
switch (ie.getAttributeType(xt, H)) {
|
|
696
|
+
case "TrustedHTML": {
|
|
697
|
+
O = oe(O);
|
|
698
|
+
break;
|
|
699
|
+
}
|
|
700
|
+
case "TrustedScriptURL": {
|
|
701
|
+
O = v.createScriptURL(O);
|
|
702
|
+
break;
|
|
703
|
+
}
|
|
704
|
+
}
|
|
705
|
+
if (O !== nt)
|
|
706
|
+
try {
|
|
707
|
+
R ? e.setAttributeNS(R, h, O) : e.setAttribute(h, O), Me(e) ? $(e) : Ut(i.removed);
|
|
708
|
+
} catch {
|
|
709
|
+
Q(h, e);
|
|
710
|
+
}
|
|
711
|
+
}
|
|
712
|
+
Y(N.afterSanitizeAttributes, e, null);
|
|
713
|
+
}, Pe = function(e) {
|
|
714
|
+
let n = null;
|
|
715
|
+
const a = Dt(e);
|
|
716
|
+
for (Y(N.beforeSanitizeShadowDOM, e, null); n = a.nextNode(); )
|
|
717
|
+
if (Y(N.uponSanitizeShadowNode, n, null), Ct(n), Mt(n), ce(n.content) && Pe(n.content), (B ? B(n) : n.nodeType) === j.element) {
|
|
718
|
+
const u = Re ? Re(n) : n.shadowRoot;
|
|
719
|
+
ce(u) && (fe(u), Pe(u));
|
|
720
|
+
}
|
|
721
|
+
Y(N.afterSanitizeShadowDOM, e, null);
|
|
722
|
+
}, fe = function(e) {
|
|
723
|
+
const n = B ? B(e) : e.nodeType;
|
|
724
|
+
if (n === j.element) {
|
|
725
|
+
const u = Re ? Re(e) : e.shadowRoot;
|
|
726
|
+
ce(u) && (fe(u), Pe(u));
|
|
727
|
+
}
|
|
728
|
+
const a = ye ? ye(e) : e.childNodes;
|
|
729
|
+
if (!a)
|
|
730
|
+
return;
|
|
731
|
+
const d = [];
|
|
732
|
+
ee(a, (u) => {
|
|
733
|
+
ue(d, u);
|
|
734
|
+
});
|
|
735
|
+
for (const u of d)
|
|
736
|
+
fe(u);
|
|
737
|
+
if (n === j.element) {
|
|
738
|
+
const u = K ? K(e) : null;
|
|
739
|
+
if (typeof u == "string" && E(u) === "template") {
|
|
740
|
+
const h = e.content;
|
|
741
|
+
ce(h) && fe(h);
|
|
742
|
+
}
|
|
743
|
+
}
|
|
744
|
+
};
|
|
745
|
+
return i.sanitize = function(l) {
|
|
746
|
+
let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = null, a = null, d = null, u = null;
|
|
747
|
+
if (qe = !l, qe && (l = "<!-->"), typeof l != "string" && !xe(l) && (l = Zn(l), typeof l != "string"))
|
|
748
|
+
throw de("dirty is not a string, aborting");
|
|
749
|
+
if (!i.isSupported)
|
|
750
|
+
return l;
|
|
751
|
+
if (We || et(e), i.removed = [], typeof l == "string" && (Ae = !1), Ae) {
|
|
752
|
+
const M = K ? K(l) : l.nodeName;
|
|
753
|
+
if (typeof M == "string") {
|
|
754
|
+
const H = E(M);
|
|
755
|
+
if (!A[H] || ge[H])
|
|
756
|
+
throw de("root node is forbidden and cannot be sanitized in-place");
|
|
757
|
+
}
|
|
758
|
+
if (Me(l))
|
|
759
|
+
throw de("root node is clobbered and cannot be sanitized in-place");
|
|
760
|
+
fe(l);
|
|
761
|
+
} else if (xe(l))
|
|
762
|
+
n = It("<!---->"), a = n.ownerDocument.importNode(l, !0), a.nodeType === j.element && a.nodeName === "BODY" || a.nodeName === "HTML" ? n = a : n.appendChild(a), fe(a);
|
|
763
|
+
else {
|
|
764
|
+
if (!re && !q && !J && // eslint-disable-next-line unicorn/prefer-includes
|
|
765
|
+
l.indexOf("<") === -1)
|
|
766
|
+
return v && Ce ? oe(l) : l;
|
|
767
|
+
if (n = It(l), !n)
|
|
768
|
+
return re ? null : Ce ? he : "";
|
|
769
|
+
}
|
|
770
|
+
n && Ye && $(n.firstChild);
|
|
771
|
+
const h = Dt(Ae ? l : n);
|
|
772
|
+
for (; d = h.nextNode(); )
|
|
773
|
+
Ct(d), Mt(d), ce(d.content) && Pe(d.content);
|
|
774
|
+
if (Ae)
|
|
775
|
+
return q && tt(l), l;
|
|
776
|
+
if (re) {
|
|
777
|
+
if (q && tt(n), De)
|
|
778
|
+
for (u = ln.call(n.ownerDocument); n.firstChild; )
|
|
779
|
+
u.appendChild(n.firstChild);
|
|
780
|
+
else
|
|
781
|
+
u = n;
|
|
782
|
+
return (y.shadowroot || y.shadowrootmode) && (u = fn.call(r, u, !0)), u;
|
|
783
|
+
}
|
|
784
|
+
let R = J ? n.outerHTML : n.innerHTML;
|
|
785
|
+
return J && A["!doctype"] && n.ownerDocument && n.ownerDocument.doctype && n.ownerDocument.doctype.name && k(li, n.ownerDocument.doctype.name) && (R = "<!DOCTYPE " + n.ownerDocument.doctype.name + `>
|
|
786
|
+
` + R), q && ee([Oe, ke, Le], (M) => {
|
|
787
|
+
R = pe(R, M, " ");
|
|
788
|
+
}), v && Ce ? oe(R) : R;
|
|
789
|
+
}, i.setConfig = function() {
|
|
790
|
+
let l = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
791
|
+
et(l), We = !0;
|
|
792
|
+
}, i.clearConfig = function() {
|
|
793
|
+
le = null, We = !1;
|
|
794
|
+
}, i.isValidAttribute = function(l, e, n) {
|
|
795
|
+
le || et({});
|
|
796
|
+
const a = E(l), d = E(e);
|
|
797
|
+
return wt(a, d, n);
|
|
798
|
+
}, i.addHook = function(l, e) {
|
|
799
|
+
typeof e == "function" && ue(N[l], e);
|
|
800
|
+
}, i.removeHook = function(l, e) {
|
|
801
|
+
if (e !== void 0) {
|
|
802
|
+
const n = jn(N[l], e);
|
|
803
|
+
return n === -1 ? void 0 : Wn(N[l], n, 1)[0];
|
|
804
|
+
}
|
|
805
|
+
return Ut(N[l]);
|
|
806
|
+
}, i.removeHooks = function(l) {
|
|
807
|
+
N[l] = [];
|
|
808
|
+
}, i.removeAllHooks = function() {
|
|
809
|
+
N = Zt();
|
|
810
|
+
}, i;
|
|
811
|
+
}
|
|
812
|
+
var ct = en();
|
|
813
|
+
function tn(t) {
|
|
814
|
+
console.error(`[localisation-utils]: ${t}`);
|
|
815
|
+
}
|
|
816
|
+
function pi(t, i) {
|
|
817
|
+
const o = (s) => String.prototype.split.call(i, s).filter(Boolean).reduce((c, m) => c != null && typeof c == "object" ? c[m] : c, t), r = o(/[,[\]]+?/) || o(/[,[\].]+?/);
|
|
818
|
+
return typeof r != "string" ? "" : r;
|
|
819
|
+
}
|
|
820
|
+
function nn(t, i) {
|
|
821
|
+
if (!t) throw new Error('"locale" parameter cannot be empty');
|
|
822
|
+
if (!i) throw new Error('"key" parameter cannot be empty');
|
|
823
|
+
const o = pi(t, i);
|
|
824
|
+
return o || (tn(`Couldn't find a value for the key "${i}", it will be used as fallback.`), i);
|
|
144
825
|
}
|
|
145
|
-
function
|
|
146
|
-
const
|
|
147
|
-
return new RegExp(
|
|
826
|
+
function di(t) {
|
|
827
|
+
const o = t.map((s) => `(<${s}.*>.*</${s}>)`).join("|");
|
|
828
|
+
return new RegExp(o, "igm");
|
|
148
829
|
}
|
|
149
|
-
function
|
|
150
|
-
const
|
|
151
|
-
if (
|
|
152
|
-
const
|
|
153
|
-
return
|
|
154
|
-
if (!
|
|
155
|
-
const
|
|
156
|
-
if (!
|
|
157
|
-
const [,
|
|
158
|
-
return [
|
|
159
|
-
}).map((
|
|
160
|
-
if (!Array.isArray(
|
|
161
|
-
const [
|
|
162
|
-
return
|
|
830
|
+
function mi(t, i) {
|
|
831
|
+
const o = Object.keys(i);
|
|
832
|
+
if (o.length === 0) return [t];
|
|
833
|
+
const r = di(o);
|
|
834
|
+
return t.split(r).filter((s) => !!s).map((s) => {
|
|
835
|
+
if (!s.match(r)) return s;
|
|
836
|
+
const m = s.match(/<(.*)>(.*)<\/.*>/);
|
|
837
|
+
if (!m) return s;
|
|
838
|
+
const [, w, b] = m;
|
|
839
|
+
return [w, b];
|
|
840
|
+
}).map((s) => {
|
|
841
|
+
if (!Array.isArray(s)) return s;
|
|
842
|
+
const [m, w] = s, b = i[m];
|
|
843
|
+
return b || typeof b == "function" ? b(w) : (tn(`Custom tag "${m}" does not have a matching enhancer function`), w);
|
|
163
844
|
});
|
|
164
845
|
}
|
|
165
|
-
function
|
|
166
|
-
if (
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
846
|
+
function hi(t, i = "_blank") {
|
|
847
|
+
if (typeof window > "u")
|
|
848
|
+
return t.replace(/<[^>]*>/g, "");
|
|
849
|
+
const o = i === "_self" ? "_self" : "_blank", r = (s) => {
|
|
850
|
+
if (s.tagName !== "A") return;
|
|
851
|
+
if (s.setAttribute("target", o), o !== "_blank") {
|
|
852
|
+
s.removeAttribute("rel");
|
|
853
|
+
return;
|
|
854
|
+
}
|
|
855
|
+
const c = new Set((s.getAttribute("rel") ?? "").split(/\s+/).filter(Boolean));
|
|
856
|
+
c.add("noopener"), c.add("noreferrer"), s.setAttribute("rel", Array.from(c).join(" "));
|
|
857
|
+
};
|
|
858
|
+
try {
|
|
859
|
+
return ct.addHook("afterSanitizeAttributes", r), ct.sanitize(t, {
|
|
860
|
+
ALLOWED_TAGS: ["a"],
|
|
861
|
+
ALLOWED_ATTR: ["href", "rel", "target"]
|
|
862
|
+
});
|
|
863
|
+
} finally {
|
|
864
|
+
ct.removeHook("afterSanitizeAttributes");
|
|
865
|
+
}
|
|
866
|
+
}
|
|
867
|
+
function gi(t, i, o) {
|
|
868
|
+
if (!t) throw new Error('"locale" parameter cannot be empty');
|
|
869
|
+
if (!i) throw new Error('"key" parameter cannot be empty');
|
|
870
|
+
if (!o) throw new Error('"customTagEnhancers" parameter cannot be empty');
|
|
871
|
+
const r = nn(t, i);
|
|
872
|
+
return mi(r, o);
|
|
171
873
|
}
|
|
172
|
-
var
|
|
173
|
-
for (var
|
|
174
|
-
(
|
|
175
|
-
return
|
|
874
|
+
var Ti = Object.defineProperty, Ai = Object.getOwnPropertyDescriptor, P = (t, i, o, r) => {
|
|
875
|
+
for (var s = r > 1 ? void 0 : r ? Ai(i, o) : i, c = t.length - 1, m; c >= 0; c--)
|
|
876
|
+
(m = t[c]) && (s = (r ? m(i, o, s) : m(s)) || s);
|
|
877
|
+
return r && s && Ti(i, o, s), s;
|
|
176
878
|
};
|
|
177
|
-
let
|
|
879
|
+
let C = class extends ft {
|
|
178
880
|
constructor() {
|
|
179
|
-
super(...arguments), this._isCookieBannerHidden = !1, this._isModalOpen = !1, this._locale =
|
|
180
|
-
let
|
|
181
|
-
if (
|
|
182
|
-
return
|
|
183
|
-
const
|
|
184
|
-
return
|
|
881
|
+
super(...arguments), this._isCookieBannerHidden = !1, this._isModalOpen = !1, this._locale = $t, this.hasPrimaryActionsOnly = Z.hasPrimaryActionsOnly, this.defaultPreferences = Z.defaultPreferences, this.cookieStatementLink = Z.cookieStatementLink, this.cookieTechnologiesLink = Z.cookieTechnologiesLink, this.country = Z.country, this.language = Z.language, this.openLinksInSameTab = Z.openLinksInSameTab, this._getLocaleString = (t, i) => {
|
|
882
|
+
let o = `${t}-${i}`.toLowerCase();
|
|
883
|
+
if (it.has(o) || (o = `${t}`.toLowerCase(), it.has(o)))
|
|
884
|
+
return o;
|
|
885
|
+
const r = xn.get(i.toLowerCase());
|
|
886
|
+
return r && it.has(r) ? r : `${Z.language}`;
|
|
185
887
|
}, this._customTagEnhancers = {
|
|
186
|
-
linkStatement: (
|
|
187
|
-
linkNecessaryOnly: (
|
|
188
|
-
linkManagePreferences: (
|
|
189
|
-
linkAcceptAll: (
|
|
190
|
-
linkCookieStatement: (
|
|
191
|
-
linkCookieTechList: (
|
|
888
|
+
linkStatement: (t) => F`<pie-link href="${this.cookieStatementLink}" variant="inverse" target="${this._linkTargetAttribute}" data-test-id="cookie-statement-link">${t}</pie-link>`,
|
|
889
|
+
linkNecessaryOnly: (t) => F`<pie-link data-test-id="body-necessary-only" tag="button" variant="inverse" @click="${this._onNecessaryOnly}">${t}</pie-link>`,
|
|
890
|
+
linkManagePreferences: (t) => F`<pie-link data-test-id="body-manage-prefs" tag="button" variant="inverse" @click="${this._openManagePreferencesModal}">${t}</pie-link>`,
|
|
891
|
+
linkAcceptAll: (t) => F`<pie-link data-test-id="body-accept-all" tag="button" variant="inverse" @click="${this._onAcceptAll}">${t}</pie-link>`,
|
|
892
|
+
linkCookieStatement: (t) => F`<pie-link href="${this.cookieStatementLink}" size="small" target="${this._linkTargetAttribute}" data-test-id="cookie-statement-link">${t}</pie-link>`,
|
|
893
|
+
linkCookieTechList: (t) => F`<pie-link href="${this.cookieTechnologiesLink}" size="small" target="${this._linkTargetAttribute}" data-test-id="cookie-technology-link">${t}</pie-link>`
|
|
192
894
|
}, this._onNecessaryOnly = () => {
|
|
193
|
-
|
|
895
|
+
Be(this, Cn), this._isCookieBannerHidden = !0;
|
|
194
896
|
}, this._onAcceptAll = () => {
|
|
195
|
-
|
|
897
|
+
Be(this, Dn), this._isCookieBannerHidden = !0;
|
|
196
898
|
}, this._openManagePreferencesModal = () => {
|
|
197
|
-
this._isCookieBannerHidden = !0,
|
|
198
|
-
}, this._handleSwitchStates = (
|
|
199
|
-
const { id:
|
|
200
|
-
if (
|
|
201
|
-
const { checked:
|
|
202
|
-
this._preferencesNodes.forEach((
|
|
203
|
-
|
|
899
|
+
this._isCookieBannerHidden = !0, Be(this, wn), this._isModalOpen = !0;
|
|
900
|
+
}, this._handleSwitchStates = (t) => {
|
|
901
|
+
const { id: i } = t == null ? void 0 : t.currentTarget, o = [...this._preferencesNodes].find(({ id: r }) => r === "all");
|
|
902
|
+
if (i === o.id) {
|
|
903
|
+
const { checked: r } = t.target;
|
|
904
|
+
this._preferencesNodes.forEach((s) => {
|
|
905
|
+
s.checked = s.disabled ? s.checked : r;
|
|
204
906
|
});
|
|
205
907
|
} else
|
|
206
|
-
|
|
908
|
+
o.checked = [...this._preferencesNodes].filter(({ id: r }) => r !== "all").every(({ checked: r }) => r);
|
|
207
909
|
};
|
|
208
910
|
}
|
|
209
911
|
/**
|
|
@@ -214,23 +916,23 @@ let c = class extends A {
|
|
|
214
916
|
get _linkTargetAttribute() {
|
|
215
917
|
return this.openLinksInSameTab ? "_self" : "_blank";
|
|
216
918
|
}
|
|
217
|
-
async updated(
|
|
218
|
-
(
|
|
919
|
+
async updated(t) {
|
|
920
|
+
(t.has("language") || t.has("country")) && await this._setLocaleBasedOnCountryAndLanguage(this.language, this.country);
|
|
219
921
|
}
|
|
220
922
|
// Dynamically import locale JSON based on country and language
|
|
221
|
-
async _setLocaleBasedOnCountryAndLanguage(
|
|
923
|
+
async _setLocaleBasedOnCountryAndLanguage(t, i) {
|
|
222
924
|
try {
|
|
223
|
-
const
|
|
224
|
-
this._locale = (await
|
|
925
|
+
const o = this._getLocaleString(t, i);
|
|
926
|
+
this._locale = (await Ln(/* @__PURE__ */ Object.assign({ "../locales/bg.js": () => import("./bg-DGJESQ4e.js"), "../locales/ca.js": () => import("./ca-Bcf7sXQS.js"), "../locales/da.js": () => import("./da-zmkmo2qP.js"), "../locales/de.js": () => import("./de-CCDQDaL_.js"), "../locales/en-ca.js": () => import("./en-ca-BWMoXxW2.js"), "../locales/en-fr.js": () => import("./en-fr-B3W1OBz4.js"), "../locales/en.js": () => import("./en-Cg12pw29.js"), "../locales/es.js": () => import("./es-BGd5IeE8.js"), "../locales/fr-ca.js": () => import("./fr-ca-B2Z4Z4i0.js"), "../locales/fr-fr.js": () => import("./fr-fr-Bj0z2tFA.js"), "../locales/fr.js": () => import("./fr-ZJirJTQ1.js"), "../locales/he.js": () => import("./he-CD4nZodw.js"), "../locales/it.js": () => import("./it-C20n5M6-.js"), "../locales/nl.js": () => import("./nl-potC62A2.js"), "../locales/pl.js": () => import("./pl-BZMXvf-W.js"), "../locales/sk.js": () => import("./sk-B2GkzqzB.js") }), `../locales/${o}.js`, 3)).default;
|
|
225
927
|
} catch {
|
|
226
|
-
this._locale =
|
|
928
|
+
this._locale = $t;
|
|
227
929
|
}
|
|
228
930
|
}
|
|
229
|
-
_localiseText(
|
|
230
|
-
return
|
|
931
|
+
_localiseText(t) {
|
|
932
|
+
return nn(this._locale, t);
|
|
231
933
|
}
|
|
232
|
-
_localiseRichText(
|
|
233
|
-
return
|
|
934
|
+
_localiseRichText(t) {
|
|
935
|
+
return gi(this._locale, t, this._customTagEnhancers);
|
|
234
936
|
}
|
|
235
937
|
/**
|
|
236
938
|
* Handles closing the modal and re-displaying the cookie banner
|
|
@@ -249,71 +951,71 @@ let c = class extends A {
|
|
|
249
951
|
* }
|
|
250
952
|
*/
|
|
251
953
|
_handlePreferencesSaved() {
|
|
252
|
-
let
|
|
253
|
-
[...this._preferencesNodes].filter(({ id:
|
|
254
|
-
|
|
255
|
-
}),
|
|
954
|
+
let t = {};
|
|
955
|
+
[...this._preferencesNodes].filter(({ id: i }) => i !== "all").forEach(({ id: i, checked: o }) => {
|
|
956
|
+
t = { ...t, [i]: o };
|
|
957
|
+
}), Be(this, vn, t), this._isModalOpen = !1, this._isCookieBannerHidden = !0;
|
|
256
958
|
}
|
|
257
959
|
/**
|
|
258
960
|
* Renders the content of the preference item.
|
|
259
961
|
* @private
|
|
260
962
|
*/
|
|
261
963
|
renderPreference({
|
|
262
|
-
id:
|
|
263
|
-
checked:
|
|
264
|
-
disabled:
|
|
265
|
-
hasDivider:
|
|
266
|
-
hasDescription:
|
|
964
|
+
id: t,
|
|
965
|
+
checked: i,
|
|
966
|
+
disabled: o,
|
|
967
|
+
hasDivider: r,
|
|
968
|
+
hasDescription: s
|
|
267
969
|
}) {
|
|
268
|
-
var
|
|
269
|
-
const
|
|
270
|
-
var
|
|
271
|
-
return ((
|
|
970
|
+
var ne;
|
|
971
|
+
const c = this._localiseText(`preferencesManagement.${t}.title`), m = `preferencesManagement.${t}.description`, w = s && this._localiseText(m), V = ["functional", "personalized", "analytical"].every((ie) => {
|
|
972
|
+
var U;
|
|
973
|
+
return ((U = this.defaultPreferences) == null ? void 0 : U[ie]) === !0;
|
|
272
974
|
});
|
|
273
|
-
return
|
|
975
|
+
return F`
|
|
274
976
|
<div class="c-cookieBanner-preference">
|
|
275
977
|
<div>
|
|
276
|
-
<h3 class="c-cookieBanner-subheading">${
|
|
277
|
-
${
|
|
978
|
+
<h3 class="c-cookieBanner-subheading">${c}</h3>
|
|
979
|
+
${w ? F`<p class="c-cookieBanner-description">${On(hi(w, this._linkTargetAttribute))}</p>` : Bt}
|
|
278
980
|
</div>
|
|
279
981
|
<pie-switch
|
|
280
|
-
id="${
|
|
281
|
-
.aria="${{ label:
|
|
282
|
-
?checked="${((
|
|
283
|
-
?disabled="${
|
|
982
|
+
id="${t}"
|
|
983
|
+
.aria="${{ label: c }}"
|
|
984
|
+
?checked="${((ne = this.defaultPreferences) == null ? void 0 : ne[t]) || V || i}"
|
|
985
|
+
?disabled="${o}"
|
|
284
986
|
@change="${this._handleSwitchStates}">
|
|
285
987
|
</pie-switch>
|
|
286
988
|
</div>
|
|
287
|
-
${
|
|
989
|
+
${r ? F`<pie-divider></pie-divider>` : Bt}`;
|
|
288
990
|
}
|
|
289
991
|
/**
|
|
290
992
|
* Renders the modal content.
|
|
291
993
|
* @private
|
|
292
994
|
*/
|
|
293
995
|
renderModalContent() {
|
|
294
|
-
return
|
|
996
|
+
return F`
|
|
295
997
|
<p class="c-cookieBanner-description" data-test-id="modal-description">
|
|
296
998
|
${this._localiseRichText("preferencesManagement.description")}
|
|
297
999
|
</p>
|
|
298
|
-
${
|
|
299
|
-
|
|
300
|
-
({ id:
|
|
301
|
-
(
|
|
1000
|
+
${Nn(
|
|
1001
|
+
Mn,
|
|
1002
|
+
({ id: t }) => t,
|
|
1003
|
+
(t) => this.renderPreference(t)
|
|
302
1004
|
)}`;
|
|
303
1005
|
}
|
|
304
1006
|
render() {
|
|
305
|
-
const
|
|
1007
|
+
const t = {
|
|
306
1008
|
text: this._localiseText("preferencesManagement.cta.save.label"),
|
|
307
1009
|
ariaLabel: this._localiseText("preferencesManagement.cta.save.label")
|
|
308
1010
|
};
|
|
309
|
-
return
|
|
1011
|
+
return F`
|
|
310
1012
|
<pie-modal
|
|
311
1013
|
.isOpen="${this._isModalOpen}"
|
|
312
1014
|
hasBackButton
|
|
313
1015
|
hasStackedActions
|
|
314
1016
|
isFullWidthBelowMid
|
|
315
1017
|
heading="${this._localiseText("preferencesManagement.title")}"
|
|
316
|
-
.leadingAction=${
|
|
1018
|
+
.leadingAction=${t}
|
|
317
1019
|
@pie-modal-leading-action-click="${this._handlePreferencesSaved}"
|
|
318
1020
|
@pie-modal-back="${this._displayCookieBanner}">
|
|
319
1021
|
${this.renderModalContent()}
|
|
@@ -353,53 +1055,53 @@ let c = class extends A {
|
|
|
353
1055
|
</aside>`;
|
|
354
1056
|
}
|
|
355
1057
|
};
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
],
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
],
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
],
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
],
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
],
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
],
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
],
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
],
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
],
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
],
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
],
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
],
|
|
1058
|
+
C.styles = Sn(In);
|
|
1059
|
+
P([
|
|
1060
|
+
dt()
|
|
1061
|
+
], C.prototype, "_isCookieBannerHidden", 2);
|
|
1062
|
+
P([
|
|
1063
|
+
dt()
|
|
1064
|
+
], C.prototype, "_isModalOpen", 2);
|
|
1065
|
+
P([
|
|
1066
|
+
dt()
|
|
1067
|
+
], C.prototype, "_locale", 2);
|
|
1068
|
+
P([
|
|
1069
|
+
te({ type: Boolean })
|
|
1070
|
+
], C.prototype, "hasPrimaryActionsOnly", 2);
|
|
1071
|
+
P([
|
|
1072
|
+
te({ type: Object })
|
|
1073
|
+
], C.prototype, "defaultPreferences", 2);
|
|
1074
|
+
P([
|
|
1075
|
+
te({ type: String })
|
|
1076
|
+
], C.prototype, "cookieStatementLink", 2);
|
|
1077
|
+
P([
|
|
1078
|
+
te({ type: String })
|
|
1079
|
+
], C.prototype, "cookieTechnologiesLink", 2);
|
|
1080
|
+
P([
|
|
1081
|
+
te({ type: String })
|
|
1082
|
+
], C.prototype, "country", 2);
|
|
1083
|
+
P([
|
|
1084
|
+
te({ type: String })
|
|
1085
|
+
], C.prototype, "language", 2);
|
|
1086
|
+
P([
|
|
1087
|
+
te({ type: Boolean })
|
|
1088
|
+
], C.prototype, "openLinksInSameTab", 2);
|
|
1089
|
+
P([
|
|
1090
|
+
Rn("pie-switch")
|
|
1091
|
+
], C.prototype, "_preferencesNodes", 2);
|
|
1092
|
+
C = P([
|
|
1093
|
+
kn("pie-cookie-banner")
|
|
1094
|
+
], C);
|
|
393
1095
|
export {
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
1096
|
+
g as Country,
|
|
1097
|
+
p as Language,
|
|
1098
|
+
Dn as ON_COOKIE_BANNER_ACCEPT_ALL,
|
|
1099
|
+
wn as ON_COOKIE_BANNER_MANAGE_PREFS,
|
|
1100
|
+
Cn as ON_COOKIE_BANNER_NECESSARY_ONLY,
|
|
1101
|
+
vn as ON_COOKIE_BANNER_PREFS_SAVED,
|
|
1102
|
+
C as PieCookieBanner,
|
|
1103
|
+
it as availableLocales,
|
|
1104
|
+
xn as defaultLocaleForCountry,
|
|
1105
|
+
Z as defaultProps,
|
|
1106
|
+
Mn as preferences
|
|
405
1107
|
};
|