keycloakify 11.5.1 → 11.5.3
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/bin/40.index.js +85 -0
- package/bin/490.index.js +85 -0
- package/bin/573.index.js +85 -0
- package/bin/653.index.js +85 -0
- package/bin/658.index.js +85 -0
- package/bin/682.index.js +120 -15
- package/bin/735.index.js +85 -0
- package/bin/main.js +1 -118
- package/bin/start-keycloak/getSupportedDockerImageTags.d.ts +4 -1
- package/package.json +1 -1
- package/src/bin/main.ts +2 -41
- package/src/bin/start-keycloak/getSupportedDockerImageTags.ts +51 -14
- package/src/bin/start-keycloak/realmConfig/dumpContainerConfig.ts +1 -1
- package/src/bin/start-keycloak/start-keycloak.ts +3 -3
- package/tools/vendor/dompurify.js +1 -1
package/bin/735.index.js
CHANGED
@@ -402,6 +402,91 @@ async function getLatestsSemVersionedTag(_a) {
|
|
402
402
|
|
403
403
|
/***/ }),
|
404
404
|
|
405
|
+
/***/ 12171:
|
406
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
407
|
+
|
408
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
409
|
+
/* harmony export */ "h": () => (/* binding */ SemVer)
|
410
|
+
/* harmony export */ });
|
411
|
+
var SemVer;
|
412
|
+
(function (SemVer) {
|
413
|
+
const bumpTypes = ["major", "minor", "patch", "rc", "no bump"];
|
414
|
+
function parse(versionStr) {
|
415
|
+
const match = versionStr.match(/^v?([0-9]+)\.([0-9]+)(?:\.([0-9]+))?(?:-rc.([0-9]+))?$/);
|
416
|
+
if (!match) {
|
417
|
+
throw new Error(`${versionStr} is not a valid semantic version`);
|
418
|
+
}
|
419
|
+
const semVer = Object.assign({ major: parseInt(match[1]), minor: parseInt(match[2]), patch: (() => {
|
420
|
+
const str = match[3];
|
421
|
+
return str === undefined ? 0 : parseInt(str);
|
422
|
+
})() }, (() => {
|
423
|
+
const str = match[4];
|
424
|
+
return str === undefined ? {} : { rc: parseInt(str) };
|
425
|
+
})());
|
426
|
+
const initialStr = stringify(semVer);
|
427
|
+
Object.defineProperty(semVer, "parsedFrom", {
|
428
|
+
enumerable: true,
|
429
|
+
get: function () {
|
430
|
+
const currentStr = stringify(this);
|
431
|
+
if (currentStr !== initialStr) {
|
432
|
+
throw new Error(`SemVer.parsedFrom can't be read anymore, the version have been modified from ${initialStr} to ${currentStr}`);
|
433
|
+
}
|
434
|
+
return versionStr;
|
435
|
+
}
|
436
|
+
});
|
437
|
+
return semVer;
|
438
|
+
}
|
439
|
+
SemVer.parse = parse;
|
440
|
+
function stringify(v) {
|
441
|
+
return `${v.major}.${v.minor}.${v.patch}${v.rc === undefined ? "" : `-rc.${v.rc}`}`;
|
442
|
+
}
|
443
|
+
SemVer.stringify = stringify;
|
444
|
+
/**
|
445
|
+
*
|
446
|
+
* v1 < v2 => -1
|
447
|
+
* v1 === v2 => 0
|
448
|
+
* v1 > v2 => 1
|
449
|
+
*
|
450
|
+
*/
|
451
|
+
function compare(v1, v2) {
|
452
|
+
const sign = (diff) => (diff === 0 ? 0 : diff < 0 ? -1 : 1);
|
453
|
+
const noUndefined = (n) => n !== null && n !== void 0 ? n : Infinity;
|
454
|
+
for (const level of ["major", "minor", "patch", "rc"]) {
|
455
|
+
if (noUndefined(v1[level]) !== noUndefined(v2[level])) {
|
456
|
+
return sign(noUndefined(v1[level]) - noUndefined(v2[level]));
|
457
|
+
}
|
458
|
+
}
|
459
|
+
return 0;
|
460
|
+
}
|
461
|
+
SemVer.compare = compare;
|
462
|
+
/*
|
463
|
+
console.log(compare(parse("3.0.0-rc.3"), parse("3.0.0")) === -1 )
|
464
|
+
console.log(compare(parse("3.0.0-rc.3"), parse("3.0.0-rc.4")) === -1 )
|
465
|
+
console.log(compare(parse("3.0.0-rc.3"), parse("4.0.0")) === -1 )
|
466
|
+
*/
|
467
|
+
function bumpType(params) {
|
468
|
+
const versionAhead = typeof params.versionAhead === "string"
|
469
|
+
? parse(params.versionAhead)
|
470
|
+
: params.versionAhead;
|
471
|
+
const versionBehind = typeof params.versionBehind === "string"
|
472
|
+
? parse(params.versionBehind)
|
473
|
+
: params.versionBehind;
|
474
|
+
if (compare(versionBehind, versionAhead) === 1) {
|
475
|
+
throw new Error(`Version regression ${stringify(versionBehind)} -> ${stringify(versionAhead)}`);
|
476
|
+
}
|
477
|
+
for (const level of ["major", "minor", "patch", "rc"]) {
|
478
|
+
if (versionBehind[level] !== versionAhead[level]) {
|
479
|
+
return level;
|
480
|
+
}
|
481
|
+
}
|
482
|
+
return "no bump";
|
483
|
+
}
|
484
|
+
SemVer.bumpType = bumpType;
|
485
|
+
})(SemVer || (SemVer = {}));
|
486
|
+
//# sourceMappingURL=SemVer.js.map
|
487
|
+
|
488
|
+
/***/ }),
|
489
|
+
|
405
490
|
/***/ 89693:
|
406
491
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
407
492
|
|
package/bin/main.js
CHANGED
@@ -96,92 +96,6 @@ const TEST_APP_URL = "https://my-theme.keycloakify.dev";
|
|
96
96
|
|
97
97
|
/***/ }),
|
98
98
|
|
99
|
-
/***/ 12171:
|
100
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __nccwpck_require__) => {
|
101
|
-
|
102
|
-
"use strict";
|
103
|
-
/* harmony export */ __nccwpck_require__.d(__webpack_exports__, {
|
104
|
-
/* harmony export */ "h": () => (/* binding */ SemVer)
|
105
|
-
/* harmony export */ });
|
106
|
-
var SemVer;
|
107
|
-
(function (SemVer) {
|
108
|
-
const bumpTypes = ["major", "minor", "patch", "rc", "no bump"];
|
109
|
-
function parse(versionStr) {
|
110
|
-
const match = versionStr.match(/^v?([0-9]+)\.([0-9]+)(?:\.([0-9]+))?(?:-rc.([0-9]+))?$/);
|
111
|
-
if (!match) {
|
112
|
-
throw new Error(`${versionStr} is not a valid semantic version`);
|
113
|
-
}
|
114
|
-
const semVer = Object.assign({ major: parseInt(match[1]), minor: parseInt(match[2]), patch: (() => {
|
115
|
-
const str = match[3];
|
116
|
-
return str === undefined ? 0 : parseInt(str);
|
117
|
-
})() }, (() => {
|
118
|
-
const str = match[4];
|
119
|
-
return str === undefined ? {} : { rc: parseInt(str) };
|
120
|
-
})());
|
121
|
-
const initialStr = stringify(semVer);
|
122
|
-
Object.defineProperty(semVer, "parsedFrom", {
|
123
|
-
enumerable: true,
|
124
|
-
get: function () {
|
125
|
-
const currentStr = stringify(this);
|
126
|
-
if (currentStr !== initialStr) {
|
127
|
-
throw new Error(`SemVer.parsedFrom can't be read anymore, the version have been modified from ${initialStr} to ${currentStr}`);
|
128
|
-
}
|
129
|
-
return versionStr;
|
130
|
-
}
|
131
|
-
});
|
132
|
-
return semVer;
|
133
|
-
}
|
134
|
-
SemVer.parse = parse;
|
135
|
-
function stringify(v) {
|
136
|
-
return `${v.major}.${v.minor}.${v.patch}${v.rc === undefined ? "" : `-rc.${v.rc}`}`;
|
137
|
-
}
|
138
|
-
SemVer.stringify = stringify;
|
139
|
-
/**
|
140
|
-
*
|
141
|
-
* v1 < v2 => -1
|
142
|
-
* v1 === v2 => 0
|
143
|
-
* v1 > v2 => 1
|
144
|
-
*
|
145
|
-
*/
|
146
|
-
function compare(v1, v2) {
|
147
|
-
const sign = (diff) => (diff === 0 ? 0 : diff < 0 ? -1 : 1);
|
148
|
-
const noUndefined = (n) => n !== null && n !== void 0 ? n : Infinity;
|
149
|
-
for (const level of ["major", "minor", "patch", "rc"]) {
|
150
|
-
if (noUndefined(v1[level]) !== noUndefined(v2[level])) {
|
151
|
-
return sign(noUndefined(v1[level]) - noUndefined(v2[level]));
|
152
|
-
}
|
153
|
-
}
|
154
|
-
return 0;
|
155
|
-
}
|
156
|
-
SemVer.compare = compare;
|
157
|
-
/*
|
158
|
-
console.log(compare(parse("3.0.0-rc.3"), parse("3.0.0")) === -1 )
|
159
|
-
console.log(compare(parse("3.0.0-rc.3"), parse("3.0.0-rc.4")) === -1 )
|
160
|
-
console.log(compare(parse("3.0.0-rc.3"), parse("4.0.0")) === -1 )
|
161
|
-
*/
|
162
|
-
function bumpType(params) {
|
163
|
-
const versionAhead = typeof params.versionAhead === "string"
|
164
|
-
? parse(params.versionAhead)
|
165
|
-
: params.versionAhead;
|
166
|
-
const versionBehind = typeof params.versionBehind === "string"
|
167
|
-
? parse(params.versionBehind)
|
168
|
-
: params.versionBehind;
|
169
|
-
if (compare(versionBehind, versionAhead) === 1) {
|
170
|
-
throw new Error(`Version regression ${stringify(versionBehind)} -> ${stringify(versionAhead)}`);
|
171
|
-
}
|
172
|
-
for (const level of ["major", "minor", "patch", "rc"]) {
|
173
|
-
if (versionBehind[level] !== versionAhead[level]) {
|
174
|
-
return level;
|
175
|
-
}
|
176
|
-
}
|
177
|
-
return "no bump";
|
178
|
-
}
|
179
|
-
SemVer.bumpType = bumpType;
|
180
|
-
})(SemVer || (SemVer = {}));
|
181
|
-
//# sourceMappingURL=SemVer.js.map
|
182
|
-
|
183
|
-
/***/ }),
|
184
|
-
|
185
99
|
/***/ 73036:
|
186
100
|
/***/ ((__unused_webpack_module, __webpack_exports__, __nccwpck_require__) => {
|
187
101
|
|
@@ -16190,17 +16104,12 @@ function getBuildContext(params) {
|
|
16190
16104
|
};
|
16191
16105
|
}
|
16192
16106
|
//# sourceMappingURL=buildContext.js.map
|
16193
|
-
// EXTERNAL MODULE: ./dist/bin/tools/SemVer.js
|
16194
|
-
var SemVer = __nccwpck_require__(12171);
|
16195
16107
|
;// CONCATENATED MODULE: ./dist/bin/main.js
|
16196
16108
|
|
16197
16109
|
|
16198
16110
|
|
16199
16111
|
|
16200
16112
|
|
16201
|
-
|
16202
|
-
|
16203
|
-
|
16204
16113
|
assertNoPnpmDlx();
|
16205
16114
|
const program = Z({
|
16206
16115
|
name: "keycloakify",
|
@@ -16293,36 +16202,10 @@ program
|
|
16293
16202
|
skip,
|
16294
16203
|
handler: async ({ projectDirPath, keycloakVersion, port, realmJsonFilePath }) => {
|
16295
16204
|
const { command } = await Promise.all(/* import() */[__nccwpck_require__.e(805), __nccwpck_require__.e(525), __nccwpck_require__.e(33), __nccwpck_require__.e(503), __nccwpck_require__.e(682)]).then(__nccwpck_require__.bind(__nccwpck_require__, 6682));
|
16296
|
-
validate_keycloak_version: {
|
16297
|
-
if (keycloakVersion === undefined) {
|
16298
|
-
break validate_keycloak_version;
|
16299
|
-
}
|
16300
|
-
const isValidVersion = (() => {
|
16301
|
-
if (typeof keycloakVersion === "number") {
|
16302
|
-
return false;
|
16303
|
-
}
|
16304
|
-
try {
|
16305
|
-
SemVer/* SemVer.parse */.h.parse(keycloakVersion);
|
16306
|
-
}
|
16307
|
-
catch (_a) {
|
16308
|
-
return false;
|
16309
|
-
}
|
16310
|
-
return;
|
16311
|
-
})();
|
16312
|
-
if (isValidVersion) {
|
16313
|
-
break validate_keycloak_version;
|
16314
|
-
}
|
16315
|
-
console.log(source_default().red([
|
16316
|
-
`Invalid Keycloak version: ${keycloakVersion}`,
|
16317
|
-
"It should be a valid semver version example: 26.0.4"
|
16318
|
-
].join(" ")));
|
16319
|
-
process.exit(1);
|
16320
|
-
}
|
16321
|
-
(0,assert/* assert */.h)((0,assert.is)(keycloakVersion));
|
16322
16205
|
await command({
|
16323
16206
|
buildContext: getBuildContext({ projectDirPath }),
|
16324
16207
|
cliCommandOptions: {
|
16325
|
-
keycloakVersion
|
16208
|
+
keycloakVersion: keycloakVersion === undefined ? undefined : `${keycloakVersion}`,
|
16326
16209
|
port,
|
16327
16210
|
realmJsonFilePath
|
16328
16211
|
}
|
package/package.json
CHANGED
package/src/bin/main.ts
CHANGED
@@ -5,9 +5,6 @@ import { readThisNpmPackageVersion } from "./tools/readThisNpmPackageVersion";
|
|
5
5
|
import * as child_process from "child_process";
|
6
6
|
import { assertNoPnpmDlx } from "./tools/assertNoPnpmDlx";
|
7
7
|
import { getBuildContext } from "./shared/buildContext";
|
8
|
-
import { SemVer } from "./tools/SemVer";
|
9
|
-
import { assert, is } from "tsafe/assert";
|
10
|
-
import chalk from "chalk";
|
11
8
|
|
12
9
|
type CliCommandOptions = {
|
13
10
|
projectDirPath: string | undefined;
|
@@ -137,47 +134,11 @@ program
|
|
137
134
|
handler: async ({ projectDirPath, keycloakVersion, port, realmJsonFilePath }) => {
|
138
135
|
const { command } = await import("./start-keycloak");
|
139
136
|
|
140
|
-
validate_keycloak_version: {
|
141
|
-
if (keycloakVersion === undefined) {
|
142
|
-
break validate_keycloak_version;
|
143
|
-
}
|
144
|
-
|
145
|
-
const isValidVersion = (() => {
|
146
|
-
if (typeof keycloakVersion === "number") {
|
147
|
-
return false;
|
148
|
-
}
|
149
|
-
|
150
|
-
try {
|
151
|
-
SemVer.parse(keycloakVersion);
|
152
|
-
} catch {
|
153
|
-
return false;
|
154
|
-
}
|
155
|
-
|
156
|
-
return;
|
157
|
-
})();
|
158
|
-
|
159
|
-
if (isValidVersion) {
|
160
|
-
break validate_keycloak_version;
|
161
|
-
}
|
162
|
-
|
163
|
-
console.log(
|
164
|
-
chalk.red(
|
165
|
-
[
|
166
|
-
`Invalid Keycloak version: ${keycloakVersion}`,
|
167
|
-
"It should be a valid semver version example: 26.0.4"
|
168
|
-
].join(" ")
|
169
|
-
)
|
170
|
-
);
|
171
|
-
|
172
|
-
process.exit(1);
|
173
|
-
}
|
174
|
-
|
175
|
-
assert(is<string | undefined>(keycloakVersion));
|
176
|
-
|
177
137
|
await command({
|
178
138
|
buildContext: getBuildContext({ projectDirPath }),
|
179
139
|
cliCommandOptions: {
|
180
|
-
keycloakVersion
|
140
|
+
keycloakVersion:
|
141
|
+
keycloakVersion === undefined ? undefined : `${keycloakVersion}`,
|
181
142
|
port,
|
182
143
|
realmJsonFilePath
|
183
144
|
}
|
@@ -10,6 +10,7 @@ import { join as pathJoin, dirname as pathDirname } from "path";
|
|
10
10
|
import * as fs from "fs/promises";
|
11
11
|
import { existsAsync } from "../tools/fs.existsAsync";
|
12
12
|
import { readThisNpmPackageVersion } from "../tools/readThisNpmPackageVersion";
|
13
|
+
import type { ReturnType } from "tsafe";
|
13
14
|
|
14
15
|
export type BuildContextLike = {
|
15
16
|
fetchOptions: BuildContext["fetchOptions"];
|
@@ -20,7 +21,10 @@ assert<BuildContext extends BuildContextLike ? true : false>;
|
|
20
21
|
|
21
22
|
export async function getSupportedDockerImageTags(params: {
|
22
23
|
buildContext: BuildContextLike;
|
23
|
-
}) {
|
24
|
+
}): Promise<{
|
25
|
+
allSupportedTags: string[];
|
26
|
+
latestMajorTags: string[];
|
27
|
+
}> {
|
24
28
|
const { buildContext } = params;
|
25
29
|
|
26
30
|
{
|
@@ -31,14 +35,14 @@ export async function getSupportedDockerImageTags(params: {
|
|
31
35
|
}
|
32
36
|
}
|
33
37
|
|
34
|
-
const
|
38
|
+
const tags_queryResponse: string[] = [];
|
35
39
|
|
36
40
|
await (async function callee(url: string) {
|
37
41
|
const r = await fetch(url, buildContext.fetchOptions);
|
38
42
|
|
39
43
|
await Promise.all([
|
40
44
|
(async () => {
|
41
|
-
|
45
|
+
tags_queryResponse.push(
|
42
46
|
...z
|
43
47
|
.object({
|
44
48
|
tags: z.array(z.string())
|
@@ -70,7 +74,9 @@ export async function getSupportedDockerImageTags(params: {
|
|
70
74
|
]);
|
71
75
|
})("https://quay.io/v2/keycloak/keycloak/tags/list");
|
72
76
|
|
73
|
-
const
|
77
|
+
const supportedKeycloakMajorVersions = getSupportedKeycloakMajorVersions();
|
78
|
+
|
79
|
+
const allSupportedTags_withVersion = tags_queryResponse
|
74
80
|
.map(tag => ({
|
75
81
|
tag,
|
76
82
|
version: (() => {
|
@@ -86,28 +92,35 @@ export async function getSupportedDockerImageTags(params: {
|
|
86
92
|
return undefined;
|
87
93
|
}
|
88
94
|
|
95
|
+
if (tag.split(".").length !== 3) {
|
96
|
+
return undefined;
|
97
|
+
}
|
98
|
+
|
99
|
+
if (!supportedKeycloakMajorVersions.includes(version.major)) {
|
100
|
+
return undefined;
|
101
|
+
}
|
102
|
+
|
89
103
|
return version;
|
90
104
|
})()
|
91
105
|
}))
|
92
106
|
.map(({ tag, version }) => (version === undefined ? undefined : { tag, version }))
|
93
|
-
.filter(exclude(undefined))
|
107
|
+
.filter(exclude(undefined))
|
108
|
+
.sort(({ version: a }, { version: b }) => SemVer.compare(b, a));
|
94
109
|
|
95
|
-
const
|
110
|
+
const latestTagByMajor: Record<number, SemVer | undefined> = {};
|
96
111
|
|
97
|
-
for (const { version } of
|
98
|
-
const version_current =
|
112
|
+
for (const { version } of allSupportedTags_withVersion) {
|
113
|
+
const version_current = latestTagByMajor[version.major];
|
99
114
|
|
100
115
|
if (
|
101
116
|
version_current === undefined ||
|
102
117
|
SemVer.compare(version_current, version) === -1
|
103
118
|
) {
|
104
|
-
|
119
|
+
latestTagByMajor[version.major] = version;
|
105
120
|
}
|
106
121
|
}
|
107
122
|
|
108
|
-
const
|
109
|
-
|
110
|
-
const result = Object.entries(versionByMajor)
|
123
|
+
const latestMajorTags = Object.entries(latestTagByMajor)
|
111
124
|
.sort(([a], [b]) => parseInt(b) - parseInt(a))
|
112
125
|
.map(([, version]) => version)
|
113
126
|
.map(version => {
|
@@ -121,16 +134,40 @@ export async function getSupportedDockerImageTags(params: {
|
|
121
134
|
})
|
122
135
|
.filter(exclude(undefined));
|
123
136
|
|
137
|
+
const allSupportedTags = allSupportedTags_withVersion.map(({ tag }) => tag);
|
138
|
+
|
139
|
+
const result = {
|
140
|
+
latestMajorTags,
|
141
|
+
allSupportedTags
|
142
|
+
};
|
143
|
+
|
124
144
|
await setCachedValue({ cacheDirPath: buildContext.cacheDirPath, result });
|
125
145
|
|
126
146
|
return result;
|
127
147
|
}
|
128
148
|
|
129
149
|
const { getCachedValue, setCachedValue } = (() => {
|
150
|
+
type Result = ReturnType<typeof getSupportedDockerImageTags>;
|
151
|
+
|
152
|
+
const zResult = (() => {
|
153
|
+
type TargetType = Result;
|
154
|
+
|
155
|
+
const zTargetType = z.object({
|
156
|
+
allSupportedTags: z.array(z.string()),
|
157
|
+
latestMajorTags: z.array(z.string())
|
158
|
+
});
|
159
|
+
|
160
|
+
type InferredType = z.infer<typeof zTargetType>;
|
161
|
+
|
162
|
+
assert<Equals<TargetType, InferredType>>;
|
163
|
+
|
164
|
+
return id<z.ZodType<TargetType>>(zTargetType);
|
165
|
+
})();
|
166
|
+
|
130
167
|
type Cache = {
|
131
168
|
keycloakifyVersion: string;
|
132
169
|
time: number;
|
133
|
-
result:
|
170
|
+
result: Result;
|
134
171
|
};
|
135
172
|
|
136
173
|
const zCache = (() => {
|
@@ -139,7 +176,7 @@ const { getCachedValue, setCachedValue } = (() => {
|
|
139
176
|
const zTargetType = z.object({
|
140
177
|
keycloakifyVersion: z.string(),
|
141
178
|
time: z.number(),
|
142
|
-
result:
|
179
|
+
result: zResult
|
143
180
|
});
|
144
181
|
|
145
182
|
type InferredType = z.infer<typeof zTargetType>;
|
@@ -97,7 +97,7 @@ export async function command(params: {
|
|
97
97
|
|
98
98
|
const { cliCommandOptions, buildContext } = params;
|
99
99
|
|
100
|
-
const
|
100
|
+
const { allSupportedTags, latestMajorTags } = await getSupportedDockerImageTags({
|
101
101
|
buildContext
|
102
102
|
});
|
103
103
|
|
@@ -105,7 +105,7 @@ export async function command(params: {
|
|
105
105
|
if (cliCommandOptions.keycloakVersion !== undefined) {
|
106
106
|
const cliCommandOptions_keycloakVersion = cliCommandOptions.keycloakVersion;
|
107
107
|
|
108
|
-
const tag =
|
108
|
+
const tag = allSupportedTags.find(tag =>
|
109
109
|
tag.startsWith(cliCommandOptions_keycloakVersion)
|
110
110
|
);
|
111
111
|
|
@@ -143,7 +143,7 @@ export async function command(params: {
|
|
143
143
|
);
|
144
144
|
|
145
145
|
const { value: tag } = await cliSelect<string>({
|
146
|
-
values:
|
146
|
+
values: latestMajorTags
|
147
147
|
}).catch(() => {
|
148
148
|
process.exit(-1);
|
149
149
|
});
|
@@ -1,2 +1,2 @@
|
|
1
1
|
/*! For license information please see index.js.LICENSE.txt */
|
2
|
-
var e={836:function(e,t,n){var r,o,a;function i(e,t){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},i(e,t)}function l(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(l=function(){return!!e})()}function c(e){return function(e){if(Array.isArray(e))return s(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||u(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e,t){if(e){if("string"==typeof e)return s(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function f(e){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},f(e)}a=function(){var e=Object.entries,t=Object.setPrototypeOf,n=Object.isFrozen,r=Object.getPrototypeOf,o=Object.getOwnPropertyDescriptor,a=Object.freeze,s=Object.seal,m=Object.create,p="undefined"!=typeof Reflect&&Reflect,d=p.apply,h=p.construct;a||(a=function(e){return e}),s||(s=function(e){return e}),d||(d=function(e,t,n){return e.apply(t,n)}),h||(h=function(e,t){return function(e,t,n){if(l())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var o=new(e.bind.apply(e,r));return n&&i(o,n.prototype),o}(e,c(t))});var y,g=x(Array.prototype.forEach),T=x(Array.prototype.pop),b=x(Array.prototype.push),v=x(String.prototype.toLowerCase),E=x(String.prototype.toString),A=x(String.prototype.match),_=x(String.prototype.replace),S=x(String.prototype.indexOf),N=x(String.prototype.trim),w=x(Object.prototype.hasOwnProperty),O=x(RegExp.prototype.test),R=(y=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return h(y,t)});function x(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return d(e,t,r)}}function C(e,r){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:v;t&&t(e,null);for(var a=r.length;a--;){var i=r[a];if("string"==typeof i){var l=o(i);l!==i&&(n(r)||(r[a]=l),i=l)}e[i]=!0}return e}function L(e){for(var t=0;t<e.length;t++)w(e,t)||(e[t]=null);return e}function D(t){var n,r,o,a=m(null),i=function(e){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=u(e))){t&&(e=t);var n=0,r=function(){};return{s:r,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,i=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return a=e.done,e},e:function(e){i=!0,o=e},f:function(){try{a||null==t.return||t.return()}finally{if(i)throw o}}}}(e(t));try{for(i.s();!(n=i.n()).done;){var l=(r=n.value,o=2,function(e){if(Array.isArray(e))return e}(r)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(e){u=!0,o=e}finally{try{if(!c&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(u)throw o}}return l}}(r,o)||u(r,o)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),c=l[0],s=l[1];w(t,c)&&(Array.isArray(s)?a[c]=L(s):s&&"object"===f(s)&&s.constructor===Object?a[c]=D(s):a[c]=s)}}catch(e){i.e(e)}finally{i.f()}return a}function k(e,t){for(;null!==e;){var n=o(e,t);if(n){if(n.get)return x(n.get);if("function"==typeof n.value)return x(n.value)}e=r(e)}return function(){return null}}var I=a(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),M=a(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),U=a(["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"]),P=a(["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"]),F=a(["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"]),H=a(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),z=a(["#text"]),j=a(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),B=a(["accent-height","accumulate","additive","alignment-baseline","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","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","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","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","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"]),W=a(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),G=a(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Y=s(/\{\{[\w\W]*|[\w\W]*\}\}/gm),X=s(/<%[\w\W]*|[\w\W]*%>/gm),q=s(/\${[\w\W]*}/gm),$=s(/^data-[\-\w.\u00B7-\uFFFF]/),K=s(/^aria-[\-\w]+$/),V=s(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Z=s(/^(?:\w+script|data):/i),J=s(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Q=s(/^html$/i),ee=s(/^[a-z][.\w]*(-[.\w]+)+$/i),te=Object.freeze({__proto__:null,MUSTACHE_EXPR:Y,ERB_EXPR:X,TMPLIT_EXPR:q,DATA_ATTR:$,ARIA_ATTR:K,IS_ALLOWED_URI:V,IS_SCRIPT_OR_DATA:Z,ATTR_WHITESPACE:J,DOCTYPE_NAME:Q,CUSTOM_ELEMENT:ee}),ne=function(){return"undefined"==typeof window?null:window},re=function t(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ne(),r=function(e){return t(e)};if(r.version="3.1.6",r.removed=[],!n||!n.document||9!==n.document.nodeType)return r.isSupported=!1,r;var o,i=n.document,l=i,u=l.currentScript,s=n.DocumentFragment,p=n.HTMLTemplateElement,d=n.Node,h=n.Element,y=n.NodeFilter,x=n.NamedNodeMap,L=void 0===x?n.NamedNodeMap||n.MozNamedAttrMap:x,Y=n.HTMLFormElement,X=n.DOMParser,q=n.trustedTypes,$=h.prototype,K=k($,"cloneNode"),Z=k($,"remove"),J=k($,"nextSibling"),ee=k($,"childNodes"),re=k($,"parentNode");if("function"==typeof p){var oe=i.createElement("template");oe.content&&oe.content.ownerDocument&&(i=oe.content.ownerDocument)}var ae="",ie=i,le=ie.implementation,ce=ie.createNodeIterator,ue=ie.createDocumentFragment,se=ie.getElementsByTagName,fe=l.importNode,me={};r.isSupported="function"==typeof e&&"function"==typeof re&&le&&void 0!==le.createHTMLDocument;var pe=te.MUSTACHE_EXPR,de=te.ERB_EXPR,he=te.TMPLIT_EXPR,ye=te.DATA_ATTR,ge=te.ARIA_ATTR,Te=te.IS_SCRIPT_OR_DATA,be=te.ATTR_WHITESPACE,ve=te.CUSTOM_ELEMENT,Ee=te.IS_ALLOWED_URI,Ae=null,_e=C({},[].concat(c(I),c(M),c(U),c(F),c(z))),Se=null,Ne=C({},[].concat(c(j),c(B),c(W),c(G))),we=Object.seal(m(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Oe=null,Re=null,xe=!0,Ce=!0,Le=!1,De=!0,ke=!1,Ie=!0,Me=!1,Ue=!1,Pe=!1,Fe=!1,He=!1,ze=!1,je=!0,Be=!1,We=!0,Ge=!1,Ye={},Xe=null,qe=C({},["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"]),$e=null,Ke=C({},["audio","video","img","source","image","track"]),Ve=null,Ze=C({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Je="http://www.w3.org/1998/Math/MathML",Qe="http://www.w3.org/2000/svg",et="http://www.w3.org/1999/xhtml",tt=et,nt=!1,rt=null,ot=C({},[Je,Qe,et],E),at=null,it=["application/xhtml+xml","text/html"],lt=null,ct=null,ut=i.createElement("form"),st=function(e){return e instanceof RegExp||e instanceof Function},ft=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!ct||ct!==e){if(e&&"object"===f(e)||(e={}),e=D(e),at=-1===it.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,lt="application/xhtml+xml"===at?E:v,Ae=w(e,"ALLOWED_TAGS")?C({},e.ALLOWED_TAGS,lt):_e,Se=w(e,"ALLOWED_ATTR")?C({},e.ALLOWED_ATTR,lt):Ne,rt=w(e,"ALLOWED_NAMESPACES")?C({},e.ALLOWED_NAMESPACES,E):ot,Ve=w(e,"ADD_URI_SAFE_ATTR")?C(D(Ze),e.ADD_URI_SAFE_ATTR,lt):Ze,$e=w(e,"ADD_DATA_URI_TAGS")?C(D(Ke),e.ADD_DATA_URI_TAGS,lt):Ke,Xe=w(e,"FORBID_CONTENTS")?C({},e.FORBID_CONTENTS,lt):qe,Oe=w(e,"FORBID_TAGS")?C({},e.FORBID_TAGS,lt):{},Re=w(e,"FORBID_ATTR")?C({},e.FORBID_ATTR,lt):{},Ye=!!w(e,"USE_PROFILES")&&e.USE_PROFILES,xe=!1!==e.ALLOW_ARIA_ATTR,Ce=!1!==e.ALLOW_DATA_ATTR,Le=e.ALLOW_UNKNOWN_PROTOCOLS||!1,De=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,ke=e.SAFE_FOR_TEMPLATES||!1,Ie=!1!==e.SAFE_FOR_XML,Me=e.WHOLE_DOCUMENT||!1,Fe=e.RETURN_DOM||!1,He=e.RETURN_DOM_FRAGMENT||!1,ze=e.RETURN_TRUSTED_TYPE||!1,Pe=e.FORCE_BODY||!1,je=!1!==e.SANITIZE_DOM,Be=e.SANITIZE_NAMED_PROPS||!1,We=!1!==e.KEEP_CONTENT,Ge=e.IN_PLACE||!1,Ee=e.ALLOWED_URI_REGEXP||V,tt=e.NAMESPACE||et,we=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&st(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(we.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&st(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(we.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(we.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),ke&&(Ce=!1),He&&(Fe=!0),Ye&&(Ae=C({},z),Se=[],!0===Ye.html&&(C(Ae,I),C(Se,j)),!0===Ye.svg&&(C(Ae,M),C(Se,B),C(Se,G)),!0===Ye.svgFilters&&(C(Ae,U),C(Se,B),C(Se,G)),!0===Ye.mathMl&&(C(Ae,F),C(Se,W),C(Se,G))),e.ADD_TAGS&&(Ae===_e&&(Ae=D(Ae)),C(Ae,e.ADD_TAGS,lt)),e.ADD_ATTR&&(Se===Ne&&(Se=D(Se)),C(Se,e.ADD_ATTR,lt)),e.ADD_URI_SAFE_ATTR&&C(Ve,e.ADD_URI_SAFE_ATTR,lt),e.FORBID_CONTENTS&&(Xe===qe&&(Xe=D(Xe)),C(Xe,e.FORBID_CONTENTS,lt)),We&&(Ae["#text"]=!0),Me&&C(Ae,["html","head","body"]),Ae.table&&(C(Ae,["tbody"]),delete Oe.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw R('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw R('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');o=e.TRUSTED_TYPES_POLICY,ae=o.createHTML("")}else void 0===o&&(o=function(e,t){if("object"!==f(e)||"function"!=typeof e.createPolicy)return null;var n=null,r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));var o="dompurify"+(n?"#"+n:"");try{return e.createPolicy(o,{createHTML:function(e){return e},createScriptURL:function(e){return e}})}catch(e){return console.warn("TrustedTypes policy "+o+" could not be created."),null}}(q,u)),null!==o&&"string"==typeof ae&&(ae=o.createHTML(""));a&&a(e),ct=e}},mt=C({},["mi","mo","mn","ms","mtext"]),pt=C({},["foreignobject","annotation-xml"]),dt=C({},["title","style","font","a","script"]),ht=C({},[].concat(c(M),c(U),c(P))),yt=C({},[].concat(c(F),c(H))),gt=function(e){b(r.removed,{element:e});try{re(e).removeChild(e)}catch(t){Z(e)}},Tt=function(e,t){try{b(r.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){b(r.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!Se[e])if(Fe||He)try{gt(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},bt=function(e){var t=null,n=null;if(Pe)e="<remove></remove>"+e;else{var r=A(e,/^[\r\n\t ]+/);n=r&&r[0]}"application/xhtml+xml"===at&&tt===et&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");var a=o?o.createHTML(e):e;if(tt===et)try{t=(new X).parseFromString(a,at)}catch(e){}if(!t||!t.documentElement){t=le.createDocument(tt,"template",null);try{t.documentElement.innerHTML=nt?ae:a}catch(e){}}var l=t.body||t.documentElement;return e&&n&&l.insertBefore(i.createTextNode(n),l.childNodes[0]||null),tt===et?se.call(t,Me?"html":"body")[0]:Me?t.documentElement:l},vt=function(e){return ce.call(e.ownerDocument||e,e,y.SHOW_ELEMENT|y.SHOW_COMMENT|y.SHOW_TEXT|y.SHOW_PROCESSING_INSTRUCTION|y.SHOW_CDATA_SECTION,null)},Et=function(e){return e instanceof Y&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof L)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},At=function(e){return"function"==typeof d&&e instanceof d},_t=function(e,t,n){me[e]&&g(me[e],(function(e){e.call(r,t,n,ct)}))},St=function(e){var t=null;if(_t("beforeSanitizeElements",e,null),Et(e))return gt(e),!0;var n=lt(e.nodeName);if(_t("uponSanitizeElement",e,{tagName:n,allowedTags:Ae}),e.hasChildNodes()&&!At(e.firstElementChild)&&O(/<[/\w]/g,e.innerHTML)&&O(/<[/\w]/g,e.textContent))return gt(e),!0;if(7===e.nodeType)return gt(e),!0;if(Ie&&8===e.nodeType&&O(/<[/\w]/g,e.data))return gt(e),!0;if(!Ae[n]||Oe[n]){if(!Oe[n]&&wt(n)){if(we.tagNameCheck instanceof RegExp&&O(we.tagNameCheck,n))return!1;if(we.tagNameCheck instanceof Function&&we.tagNameCheck(n))return!1}if(We&&!Xe[n]){var o=re(e)||e.parentNode,a=ee(e)||e.childNodes;if(a&&o)for(var i=a.length-1;i>=0;--i){var l=K(a[i],!0);l.__removalCount=(e.__removalCount||0)+1,o.insertBefore(l,J(e))}}return gt(e),!0}return e instanceof h&&!function(e){var t=re(e);t&&t.tagName||(t={namespaceURI:tt,tagName:"template"});var n=v(e.tagName),r=v(t.tagName);return!!rt[e.namespaceURI]&&(e.namespaceURI===Qe?t.namespaceURI===et?"svg"===n:t.namespaceURI===Je?"svg"===n&&("annotation-xml"===r||mt[r]):Boolean(ht[n]):e.namespaceURI===Je?t.namespaceURI===et?"math"===n:t.namespaceURI===Qe?"math"===n&&pt[r]:Boolean(yt[n]):e.namespaceURI===et?!(t.namespaceURI===Qe&&!pt[r])&&!(t.namespaceURI===Je&&!mt[r])&&!yt[n]&&(dt[n]||!ht[n]):!("application/xhtml+xml"!==at||!rt[e.namespaceURI]))}(e)?(gt(e),!0):"noscript"!==n&&"noembed"!==n&&"noframes"!==n||!O(/<\/no(script|embed|frames)/i,e.innerHTML)?(ke&&3===e.nodeType&&(t=e.textContent,g([pe,de,he],(function(e){t=_(t,e," ")})),e.textContent!==t&&(b(r.removed,{element:e.cloneNode()}),e.textContent=t)),_t("afterSanitizeElements",e,null),!1):(gt(e),!0)},Nt=function(e,t,n){if(je&&("id"===t||"name"===t)&&(n in i||n in ut))return!1;if(Ce&&!Re[t]&&O(ye,t));else if(xe&&O(ge,t));else if(!Se[t]||Re[t]){if(!(wt(e)&&(we.tagNameCheck instanceof RegExp&&O(we.tagNameCheck,e)||we.tagNameCheck instanceof Function&&we.tagNameCheck(e))&&(we.attributeNameCheck instanceof RegExp&&O(we.attributeNameCheck,t)||we.attributeNameCheck instanceof Function&&we.attributeNameCheck(t))||"is"===t&&we.allowCustomizedBuiltInElements&&(we.tagNameCheck instanceof RegExp&&O(we.tagNameCheck,n)||we.tagNameCheck instanceof Function&&we.tagNameCheck(n))))return!1}else if(Ve[t]);else if(O(Ee,_(n,be,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==S(n,"data:")||!$e[e])if(Le&&!O(Te,_(n,be,"")));else if(n)return!1;return!0},wt=function(e){return"annotation-xml"!==e&&A(e,ve)},Ot=function(e){_t("beforeSanitizeAttributes",e,null);var t=e.attributes;if(t){for(var n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Se},a=t.length,i=function(){var i=t[a],l=i.name,c=i.namespaceURI,u=i.value,s=lt(l),m="value"===l?u:N(u);if(n.attrName=s,n.attrValue=m,n.keepAttr=!0,n.forceKeepAttr=void 0,_t("uponSanitizeAttribute",e,n),m=n.attrValue,Ie&&O(/((--!?|])>)|<\/(style|title)/i,m))return Tt(l,e),0;if(n.forceKeepAttr)return 0;if(Tt(l,e),!n.keepAttr)return 0;if(!De&&O(/\/>/i,m))return Tt(l,e),0;ke&&g([pe,de,he],(function(e){m=_(m,e," ")}));var p=lt(e.nodeName);if(!Nt(p,s,m))return 0;if(!Be||"id"!==s&&"name"!==s||(Tt(l,e),m="user-content-"+m),o&&"object"===f(q)&&"function"==typeof q.getAttributeType)if(c);else switch(q.getAttributeType(p,s)){case"TrustedHTML":m=o.createHTML(m);break;case"TrustedScriptURL":m=o.createScriptURL(m)}try{c?e.setAttributeNS(c,l,m):e.setAttribute(l,m),Et(e)?gt(e):T(r.removed)}catch(e){}};a--;)i();_t("afterSanitizeAttributes",e,null)}},Rt=function e(t){var n=null,r=vt(t);for(_t("beforeSanitizeShadowDOM",t,null);n=r.nextNode();)_t("uponSanitizeShadowNode",n,null),St(n)||(n.content instanceof s&&e(n.content),Ot(n));_t("afterSanitizeShadowDOM",t,null)};return r.sanitize=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=null,a=null,i=null,c=null;if((nt=!e)&&(e="\x3c!--\x3e"),"string"!=typeof e&&!At(e)){if("function"!=typeof e.toString)throw R("toString is not a function");if("string"!=typeof(e=e.toString()))throw R("dirty is not a string, aborting")}if(!r.isSupported)return e;if(Ue||ft(t),r.removed=[],"string"==typeof e&&(Ge=!1),Ge){if(e.nodeName){var u=lt(e.nodeName);if(!Ae[u]||Oe[u])throw R("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof d)1===(a=(n=bt("\x3c!----\x3e")).ownerDocument.importNode(e,!0)).nodeType&&"BODY"===a.nodeName||"HTML"===a.nodeName?n=a:n.appendChild(a);else{if(!Fe&&!ke&&!Me&&-1===e.indexOf("<"))return o&&ze?o.createHTML(e):e;if(!(n=bt(e)))return Fe?null:ze?ae:""}n&&Pe&>(n.firstChild);for(var f=vt(Ge?e:n);i=f.nextNode();)St(i)||(i.content instanceof s&&Rt(i.content),Ot(i));if(Ge)return e;if(Fe){if(He)for(c=ue.call(n.ownerDocument);n.firstChild;)c.appendChild(n.firstChild);else c=n;return(Se.shadowroot||Se.shadowrootmode)&&(c=fe.call(l,c,!0)),c}var m=Me?n.outerHTML:n.innerHTML;return Me&&Ae["!doctype"]&&n.ownerDocument&&n.ownerDocument.doctype&&n.ownerDocument.doctype.name&&O(Q,n.ownerDocument.doctype.name)&&(m="<!DOCTYPE "+n.ownerDocument.doctype.name+">\n"+m),ke&&g([pe,de,he],(function(e){m=_(m,e," ")})),o&&ze?o.createHTML(m):m},r.setConfig=function(){ft(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Ue=!0},r.clearConfig=function(){ct=null,Ue=!1},r.isValidAttribute=function(e,t,n){ct||ft({});var r=lt(e),o=lt(t);return Nt(r,o,n)},r.addHook=function(e,t){"function"==typeof t&&(me[e]=me[e]||[],b(me[e],t))},r.removeHook=function(e){if(me[e])return T(me[e])},r.removeHooks=function(e){me[e]&&(me[e]=[])},r.removeAllHooks=function(){me={}},r}();return re},"object"===f(t)?e.exports=a():void 0===(o="function"==typeof(r=a)?r.call(t,n,t,e):r)||(e.exports=o)}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var a=t[r]={exports:{}};return e[r].call(a.exports,a,a.exports,n),a.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var r={};n.d(r,{W:()=>a.a});var o=n(836),a=n.n(o),i=r.W;export{i as DOMPurify};
|
2
|
+
var e={8:function(e,t,n){var r,o,a;function i(e,t){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},i(e,t)}function l(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(l=function(){return!!e})()}function c(e){return function(e){if(Array.isArray(e))return s(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||u(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e,t){if(e){if("string"==typeof e)return s(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function f(e){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},f(e)}a=function(){var e=Object.entries,t=Object.setPrototypeOf,n=Object.isFrozen,r=Object.getPrototypeOf,o=Object.getOwnPropertyDescriptor,a=Object.freeze,s=Object.seal,m=Object.create,p="undefined"!=typeof Reflect&&Reflect,d=p.apply,h=p.construct;a||(a=function(e){return e}),s||(s=function(e){return e}),d||(d=function(e,t,n){return e.apply(t,n)}),h||(h=function(e,t){return function(e,t,n){if(l())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var o=new(e.bind.apply(e,r));return n&&i(o,n.prototype),o}(e,c(t))});var y,g=x(Array.prototype.forEach),T=x(Array.prototype.pop),b=x(Array.prototype.push),v=x(String.prototype.toLowerCase),E=x(String.prototype.toString),A=x(String.prototype.match),_=x(String.prototype.replace),S=x(String.prototype.indexOf),N=x(String.prototype.trim),w=x(Object.prototype.hasOwnProperty),O=x(RegExp.prototype.test),R=(y=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return h(y,t)});function x(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return d(e,t,r)}}function C(e,r){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:v;t&&t(e,null);for(var a=r.length;a--;){var i=r[a];if("string"==typeof i){var l=o(i);l!==i&&(n(r)||(r[a]=l),i=l)}e[i]=!0}return e}function L(e){for(var t=0;t<e.length;t++)w(e,t)||(e[t]=null);return e}function D(t){var n,r,o,a=m(null),i=function(e){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=u(e))){t&&(e=t);var n=0,r=function(){};return{s:r,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,i=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return a=e.done,e},e:function(e){i=!0,o=e},f:function(){try{a||null==t.return||t.return()}finally{if(i)throw o}}}}(e(t));try{for(i.s();!(n=i.n()).done;){var l=(r=n.value,o=2,function(e){if(Array.isArray(e))return e}(r)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(e){u=!0,o=e}finally{try{if(!c&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(u)throw o}}return l}}(r,o)||u(r,o)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),c=l[0],s=l[1];w(t,c)&&(Array.isArray(s)?a[c]=L(s):s&&"object"===f(s)&&s.constructor===Object?a[c]=D(s):a[c]=s)}}catch(e){i.e(e)}finally{i.f()}return a}function k(e,t){for(;null!==e;){var n=o(e,t);if(n){if(n.get)return x(n.get);if("function"==typeof n.value)return x(n.value)}e=r(e)}return function(){return null}}var I=a(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),M=a(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),U=a(["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"]),P=a(["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"]),F=a(["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"]),H=a(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),z=a(["#text"]),j=a(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),B=a(["accent-height","accumulate","additive","alignment-baseline","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","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","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","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","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"]),W=a(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),G=a(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Y=s(/\{\{[\w\W]*|[\w\W]*\}\}/gm),X=s(/<%[\w\W]*|[\w\W]*%>/gm),q=s(/\${[\w\W]*}/gm),$=s(/^data-[\-\w.\u00B7-\uFFFF]/),K=s(/^aria-[\-\w]+$/),V=s(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Z=s(/^(?:\w+script|data):/i),J=s(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Q=s(/^html$/i),ee=s(/^[a-z][.\w]*(-[.\w]+)+$/i),te=Object.freeze({__proto__:null,MUSTACHE_EXPR:Y,ERB_EXPR:X,TMPLIT_EXPR:q,DATA_ATTR:$,ARIA_ATTR:K,IS_ALLOWED_URI:V,IS_SCRIPT_OR_DATA:Z,ATTR_WHITESPACE:J,DOCTYPE_NAME:Q,CUSTOM_ELEMENT:ee}),ne=function(){return"undefined"==typeof window?null:window},re=function t(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ne(),r=function(e){return t(e)};if(r.version="3.1.6",r.removed=[],!n||!n.document||9!==n.document.nodeType)return r.isSupported=!1,r;var o,i=n.document,l=i,u=l.currentScript,s=n.DocumentFragment,p=n.HTMLTemplateElement,d=n.Node,h=n.Element,y=n.NodeFilter,x=n.NamedNodeMap,L=void 0===x?n.NamedNodeMap||n.MozNamedAttrMap:x,Y=n.HTMLFormElement,X=n.DOMParser,q=n.trustedTypes,$=h.prototype,K=k($,"cloneNode"),Z=k($,"remove"),J=k($,"nextSibling"),ee=k($,"childNodes"),re=k($,"parentNode");if("function"==typeof p){var oe=i.createElement("template");oe.content&&oe.content.ownerDocument&&(i=oe.content.ownerDocument)}var ae="",ie=i,le=ie.implementation,ce=ie.createNodeIterator,ue=ie.createDocumentFragment,se=ie.getElementsByTagName,fe=l.importNode,me={};r.isSupported="function"==typeof e&&"function"==typeof re&&le&&void 0!==le.createHTMLDocument;var pe=te.MUSTACHE_EXPR,de=te.ERB_EXPR,he=te.TMPLIT_EXPR,ye=te.DATA_ATTR,ge=te.ARIA_ATTR,Te=te.IS_SCRIPT_OR_DATA,be=te.ATTR_WHITESPACE,ve=te.CUSTOM_ELEMENT,Ee=te.IS_ALLOWED_URI,Ae=null,_e=C({},[].concat(c(I),c(M),c(U),c(F),c(z))),Se=null,Ne=C({},[].concat(c(j),c(B),c(W),c(G))),we=Object.seal(m(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Oe=null,Re=null,xe=!0,Ce=!0,Le=!1,De=!0,ke=!1,Ie=!0,Me=!1,Ue=!1,Pe=!1,Fe=!1,He=!1,ze=!1,je=!0,Be=!1,We=!0,Ge=!1,Ye={},Xe=null,qe=C({},["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"]),$e=null,Ke=C({},["audio","video","img","source","image","track"]),Ve=null,Ze=C({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Je="http://www.w3.org/1998/Math/MathML",Qe="http://www.w3.org/2000/svg",et="http://www.w3.org/1999/xhtml",tt=et,nt=!1,rt=null,ot=C({},[Je,Qe,et],E),at=null,it=["application/xhtml+xml","text/html"],lt=null,ct=null,ut=i.createElement("form"),st=function(e){return e instanceof RegExp||e instanceof Function},ft=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!ct||ct!==e){if(e&&"object"===f(e)||(e={}),e=D(e),at=-1===it.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,lt="application/xhtml+xml"===at?E:v,Ae=w(e,"ALLOWED_TAGS")?C({},e.ALLOWED_TAGS,lt):_e,Se=w(e,"ALLOWED_ATTR")?C({},e.ALLOWED_ATTR,lt):Ne,rt=w(e,"ALLOWED_NAMESPACES")?C({},e.ALLOWED_NAMESPACES,E):ot,Ve=w(e,"ADD_URI_SAFE_ATTR")?C(D(Ze),e.ADD_URI_SAFE_ATTR,lt):Ze,$e=w(e,"ADD_DATA_URI_TAGS")?C(D(Ke),e.ADD_DATA_URI_TAGS,lt):Ke,Xe=w(e,"FORBID_CONTENTS")?C({},e.FORBID_CONTENTS,lt):qe,Oe=w(e,"FORBID_TAGS")?C({},e.FORBID_TAGS,lt):{},Re=w(e,"FORBID_ATTR")?C({},e.FORBID_ATTR,lt):{},Ye=!!w(e,"USE_PROFILES")&&e.USE_PROFILES,xe=!1!==e.ALLOW_ARIA_ATTR,Ce=!1!==e.ALLOW_DATA_ATTR,Le=e.ALLOW_UNKNOWN_PROTOCOLS||!1,De=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,ke=e.SAFE_FOR_TEMPLATES||!1,Ie=!1!==e.SAFE_FOR_XML,Me=e.WHOLE_DOCUMENT||!1,Fe=e.RETURN_DOM||!1,He=e.RETURN_DOM_FRAGMENT||!1,ze=e.RETURN_TRUSTED_TYPE||!1,Pe=e.FORCE_BODY||!1,je=!1!==e.SANITIZE_DOM,Be=e.SANITIZE_NAMED_PROPS||!1,We=!1!==e.KEEP_CONTENT,Ge=e.IN_PLACE||!1,Ee=e.ALLOWED_URI_REGEXP||V,tt=e.NAMESPACE||et,we=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&st(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(we.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&st(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(we.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(we.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),ke&&(Ce=!1),He&&(Fe=!0),Ye&&(Ae=C({},z),Se=[],!0===Ye.html&&(C(Ae,I),C(Se,j)),!0===Ye.svg&&(C(Ae,M),C(Se,B),C(Se,G)),!0===Ye.svgFilters&&(C(Ae,U),C(Se,B),C(Se,G)),!0===Ye.mathMl&&(C(Ae,F),C(Se,W),C(Se,G))),e.ADD_TAGS&&(Ae===_e&&(Ae=D(Ae)),C(Ae,e.ADD_TAGS,lt)),e.ADD_ATTR&&(Se===Ne&&(Se=D(Se)),C(Se,e.ADD_ATTR,lt)),e.ADD_URI_SAFE_ATTR&&C(Ve,e.ADD_URI_SAFE_ATTR,lt),e.FORBID_CONTENTS&&(Xe===qe&&(Xe=D(Xe)),C(Xe,e.FORBID_CONTENTS,lt)),We&&(Ae["#text"]=!0),Me&&C(Ae,["html","head","body"]),Ae.table&&(C(Ae,["tbody"]),delete Oe.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw R('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw R('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');o=e.TRUSTED_TYPES_POLICY,ae=o.createHTML("")}else void 0===o&&(o=function(e,t){if("object"!==f(e)||"function"!=typeof e.createPolicy)return null;var n=null,r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));var o="dompurify"+(n?"#"+n:"");try{return e.createPolicy(o,{createHTML:function(e){return e},createScriptURL:function(e){return e}})}catch(e){return console.warn("TrustedTypes policy "+o+" could not be created."),null}}(q,u)),null!==o&&"string"==typeof ae&&(ae=o.createHTML(""));a&&a(e),ct=e}},mt=C({},["mi","mo","mn","ms","mtext"]),pt=C({},["foreignobject","annotation-xml"]),dt=C({},["title","style","font","a","script"]),ht=C({},[].concat(c(M),c(U),c(P))),yt=C({},[].concat(c(F),c(H))),gt=function(e){b(r.removed,{element:e});try{re(e).removeChild(e)}catch(t){Z(e)}},Tt=function(e,t){try{b(r.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){b(r.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!Se[e])if(Fe||He)try{gt(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},bt=function(e){var t=null,n=null;if(Pe)e="<remove></remove>"+e;else{var r=A(e,/^[\r\n\t ]+/);n=r&&r[0]}"application/xhtml+xml"===at&&tt===et&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");var a=o?o.createHTML(e):e;if(tt===et)try{t=(new X).parseFromString(a,at)}catch(e){}if(!t||!t.documentElement){t=le.createDocument(tt,"template",null);try{t.documentElement.innerHTML=nt?ae:a}catch(e){}}var l=t.body||t.documentElement;return e&&n&&l.insertBefore(i.createTextNode(n),l.childNodes[0]||null),tt===et?se.call(t,Me?"html":"body")[0]:Me?t.documentElement:l},vt=function(e){return ce.call(e.ownerDocument||e,e,y.SHOW_ELEMENT|y.SHOW_COMMENT|y.SHOW_TEXT|y.SHOW_PROCESSING_INSTRUCTION|y.SHOW_CDATA_SECTION,null)},Et=function(e){return e instanceof Y&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof L)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},At=function(e){return"function"==typeof d&&e instanceof d},_t=function(e,t,n){me[e]&&g(me[e],(function(e){e.call(r,t,n,ct)}))},St=function(e){var t=null;if(_t("beforeSanitizeElements",e,null),Et(e))return gt(e),!0;var n=lt(e.nodeName);if(_t("uponSanitizeElement",e,{tagName:n,allowedTags:Ae}),e.hasChildNodes()&&!At(e.firstElementChild)&&O(/<[/\w]/g,e.innerHTML)&&O(/<[/\w]/g,e.textContent))return gt(e),!0;if(7===e.nodeType)return gt(e),!0;if(Ie&&8===e.nodeType&&O(/<[/\w]/g,e.data))return gt(e),!0;if(!Ae[n]||Oe[n]){if(!Oe[n]&&wt(n)){if(we.tagNameCheck instanceof RegExp&&O(we.tagNameCheck,n))return!1;if(we.tagNameCheck instanceof Function&&we.tagNameCheck(n))return!1}if(We&&!Xe[n]){var o=re(e)||e.parentNode,a=ee(e)||e.childNodes;if(a&&o)for(var i=a.length-1;i>=0;--i){var l=K(a[i],!0);l.__removalCount=(e.__removalCount||0)+1,o.insertBefore(l,J(e))}}return gt(e),!0}return e instanceof h&&!function(e){var t=re(e);t&&t.tagName||(t={namespaceURI:tt,tagName:"template"});var n=v(e.tagName),r=v(t.tagName);return!!rt[e.namespaceURI]&&(e.namespaceURI===Qe?t.namespaceURI===et?"svg"===n:t.namespaceURI===Je?"svg"===n&&("annotation-xml"===r||mt[r]):Boolean(ht[n]):e.namespaceURI===Je?t.namespaceURI===et?"math"===n:t.namespaceURI===Qe?"math"===n&&pt[r]:Boolean(yt[n]):e.namespaceURI===et?!(t.namespaceURI===Qe&&!pt[r])&&!(t.namespaceURI===Je&&!mt[r])&&!yt[n]&&(dt[n]||!ht[n]):!("application/xhtml+xml"!==at||!rt[e.namespaceURI]))}(e)?(gt(e),!0):"noscript"!==n&&"noembed"!==n&&"noframes"!==n||!O(/<\/no(script|embed|frames)/i,e.innerHTML)?(ke&&3===e.nodeType&&(t=e.textContent,g([pe,de,he],(function(e){t=_(t,e," ")})),e.textContent!==t&&(b(r.removed,{element:e.cloneNode()}),e.textContent=t)),_t("afterSanitizeElements",e,null),!1):(gt(e),!0)},Nt=function(e,t,n){if(je&&("id"===t||"name"===t)&&(n in i||n in ut))return!1;if(Ce&&!Re[t]&&O(ye,t));else if(xe&&O(ge,t));else if(!Se[t]||Re[t]){if(!(wt(e)&&(we.tagNameCheck instanceof RegExp&&O(we.tagNameCheck,e)||we.tagNameCheck instanceof Function&&we.tagNameCheck(e))&&(we.attributeNameCheck instanceof RegExp&&O(we.attributeNameCheck,t)||we.attributeNameCheck instanceof Function&&we.attributeNameCheck(t))||"is"===t&&we.allowCustomizedBuiltInElements&&(we.tagNameCheck instanceof RegExp&&O(we.tagNameCheck,n)||we.tagNameCheck instanceof Function&&we.tagNameCheck(n))))return!1}else if(Ve[t]);else if(O(Ee,_(n,be,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==S(n,"data:")||!$e[e])if(Le&&!O(Te,_(n,be,"")));else if(n)return!1;return!0},wt=function(e){return"annotation-xml"!==e&&A(e,ve)},Ot=function(e){_t("beforeSanitizeAttributes",e,null);var t=e.attributes;if(t){for(var n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Se},a=t.length,i=function(){var i=t[a],l=i.name,c=i.namespaceURI,u=i.value,s=lt(l),m="value"===l?u:N(u);if(n.attrName=s,n.attrValue=m,n.keepAttr=!0,n.forceKeepAttr=void 0,_t("uponSanitizeAttribute",e,n),m=n.attrValue,Ie&&O(/((--!?|])>)|<\/(style|title)/i,m))return Tt(l,e),0;if(n.forceKeepAttr)return 0;if(Tt(l,e),!n.keepAttr)return 0;if(!De&&O(/\/>/i,m))return Tt(l,e),0;ke&&g([pe,de,he],(function(e){m=_(m,e," ")}));var p=lt(e.nodeName);if(!Nt(p,s,m))return 0;if(!Be||"id"!==s&&"name"!==s||(Tt(l,e),m="user-content-"+m),o&&"object"===f(q)&&"function"==typeof q.getAttributeType)if(c);else switch(q.getAttributeType(p,s)){case"TrustedHTML":m=o.createHTML(m);break;case"TrustedScriptURL":m=o.createScriptURL(m)}try{c?e.setAttributeNS(c,l,m):e.setAttribute(l,m),Et(e)?gt(e):T(r.removed)}catch(e){}};a--;)i();_t("afterSanitizeAttributes",e,null)}},Rt=function e(t){var n=null,r=vt(t);for(_t("beforeSanitizeShadowDOM",t,null);n=r.nextNode();)_t("uponSanitizeShadowNode",n,null),St(n)||(n.content instanceof s&&e(n.content),Ot(n));_t("afterSanitizeShadowDOM",t,null)};return r.sanitize=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=null,a=null,i=null,c=null;if((nt=!e)&&(e="\x3c!--\x3e"),"string"!=typeof e&&!At(e)){if("function"!=typeof e.toString)throw R("toString is not a function");if("string"!=typeof(e=e.toString()))throw R("dirty is not a string, aborting")}if(!r.isSupported)return e;if(Ue||ft(t),r.removed=[],"string"==typeof e&&(Ge=!1),Ge){if(e.nodeName){var u=lt(e.nodeName);if(!Ae[u]||Oe[u])throw R("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof d)1===(a=(n=bt("\x3c!----\x3e")).ownerDocument.importNode(e,!0)).nodeType&&"BODY"===a.nodeName||"HTML"===a.nodeName?n=a:n.appendChild(a);else{if(!Fe&&!ke&&!Me&&-1===e.indexOf("<"))return o&&ze?o.createHTML(e):e;if(!(n=bt(e)))return Fe?null:ze?ae:""}n&&Pe&>(n.firstChild);for(var f=vt(Ge?e:n);i=f.nextNode();)St(i)||(i.content instanceof s&&Rt(i.content),Ot(i));if(Ge)return e;if(Fe){if(He)for(c=ue.call(n.ownerDocument);n.firstChild;)c.appendChild(n.firstChild);else c=n;return(Se.shadowroot||Se.shadowrootmode)&&(c=fe.call(l,c,!0)),c}var m=Me?n.outerHTML:n.innerHTML;return Me&&Ae["!doctype"]&&n.ownerDocument&&n.ownerDocument.doctype&&n.ownerDocument.doctype.name&&O(Q,n.ownerDocument.doctype.name)&&(m="<!DOCTYPE "+n.ownerDocument.doctype.name+">\n"+m),ke&&g([pe,de,he],(function(e){m=_(m,e," ")})),o&&ze?o.createHTML(m):m},r.setConfig=function(){ft(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Ue=!0},r.clearConfig=function(){ct=null,Ue=!1},r.isValidAttribute=function(e,t,n){ct||ft({});var r=lt(e),o=lt(t);return Nt(r,o,n)},r.addHook=function(e,t){"function"==typeof t&&(me[e]=me[e]||[],b(me[e],t))},r.removeHook=function(e){if(me[e])return T(me[e])},r.removeHooks=function(e){me[e]&&(me[e]=[])},r.removeAllHooks=function(){me={}},r}();return re},"object"===f(t)?e.exports=a():void 0===(o="function"==typeof(r=a)?r.call(t,n,t,e):r)||(e.exports=o)}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var a=t[r]={exports:{}};return e[r].call(a.exports,a,a.exports,n),a.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var r={};n.d(r,{W:()=>a.a});var o=n(8),a=n.n(o),i=r.W;export{i as DOMPurify};
|