@ranty/ranty-sdk 3.30.0 → 3.31.2-beta.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.
@@ -0,0 +1,671 @@
1
+ /*! @license DOMPurify 3.4.7 | (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.7/LICENSE */
2
+ function yt(n, o) {
3
+ (o == null || o > n.length) && (o = n.length);
4
+ for (var a = 0, s = Array(o); a < o; a++)
5
+ s[a] = n[a];
6
+ return s;
7
+ }
8
+ function nn(n) {
9
+ if (Array.isArray(n))
10
+ return n;
11
+ }
12
+ function on(n, o) {
13
+ var a = n == null ? null : typeof Symbol != "undefined" && n[Symbol.iterator] || n["@@iterator"];
14
+ if (a != null) {
15
+ var s, f, p, b, te = [], I = !0, ne = !1;
16
+ try {
17
+ if (p = (a = a.call(n)).next, o !== 0)
18
+ for (; !(I = (s = p.call(a)).done) && (te.push(s.value), te.length !== o); I = !0)
19
+ ;
20
+ } catch (Le) {
21
+ ne = !0, f = Le;
22
+ } finally {
23
+ try {
24
+ if (!I && a.return != null && (b = a.return(), Object(b) !== b))
25
+ return;
26
+ } finally {
27
+ if (ne)
28
+ throw f;
29
+ }
30
+ }
31
+ return te;
32
+ }
33
+ }
34
+ function rn() {
35
+ throw new TypeError(`Invalid attempt to destructure non-iterable instance.
36
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
37
+ }
38
+ function an(n, o) {
39
+ return nn(n) || on(n, o) || sn(n, o) || rn();
40
+ }
41
+ function sn(n, o) {
42
+ if (n) {
43
+ if (typeof n == "string")
44
+ return yt(n, o);
45
+ var a = {}.toString.call(n).slice(8, -1);
46
+ return a === "Object" && n.constructor && (a = n.constructor.name), a === "Map" || a === "Set" ? Array.from(n) : a === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a) ? yt(n, o) : void 0;
47
+ }
48
+ }
49
+ const kt = Object.entries, bt = Object.setPrototypeOf, ln = Object.isFrozen, cn = Object.getPrototypeOf, fn = Object.getOwnPropertyDescriptor;
50
+ let D = Object.freeze, C = Object.seal, ee = Object.create, Ft = typeof Reflect != "undefined" && Reflect, Ke = Ft.apply, Ze = Ft.construct;
51
+ D || (D = function(o) {
52
+ return o;
53
+ });
54
+ C || (C = function(o) {
55
+ return o;
56
+ });
57
+ Ke || (Ke = function(o, a) {
58
+ for (var s = arguments.length, f = new Array(s > 2 ? s - 2 : 0), p = 2; p < s; p++)
59
+ f[p - 2] = arguments[p];
60
+ return o.apply(a, f);
61
+ });
62
+ Ze || (Ze = function(o) {
63
+ for (var a = arguments.length, s = new Array(a > 1 ? a - 1 : 0), f = 1; f < a; f++)
64
+ s[f - 1] = arguments[f];
65
+ return new o(...s);
66
+ });
67
+ const Z = A(Array.prototype.forEach), un = A(Array.prototype.lastIndexOf), Rt = A(Array.prototype.pop), J = A(Array.prototype.push), mn = A(Array.prototype.splice), N = Array.isArray, ue = A(String.prototype.toLowerCase), Ye = A(String.prototype.toString), Ot = A(String.prototype.match), Q = A(String.prototype.replace), Nt = A(String.prototype.indexOf), pn = A(String.prototype.trim), dn = A(Number.prototype.toString), Tn = A(Boolean.prototype.toString), Dt = typeof BigInt == "undefined" ? null : A(BigInt.prototype.toString), It = typeof Symbol == "undefined" ? null : A(Symbol.prototype.toString), d = A(Object.prototype.hasOwnProperty), ce = A(Object.prototype.toString), y = A(RegExp.prototype.test), fe = gn(TypeError);
68
+ function A(n) {
69
+ return function(o) {
70
+ o instanceof RegExp && (o.lastIndex = 0);
71
+ for (var a = arguments.length, s = new Array(a > 1 ? a - 1 : 0), f = 1; f < a; f++)
72
+ s[f - 1] = arguments[f];
73
+ return Ke(n, o, s);
74
+ };
75
+ }
76
+ function gn(n) {
77
+ return function() {
78
+ for (var o = arguments.length, a = new Array(o), s = 0; s < o; s++)
79
+ a[s] = arguments[s];
80
+ return Ze(n, a);
81
+ };
82
+ }
83
+ function l(n, o) {
84
+ let a = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : ue;
85
+ if (bt && bt(n, null), !N(o))
86
+ return n;
87
+ let s = o.length;
88
+ for (; s--; ) {
89
+ let f = o[s];
90
+ if (typeof f == "string") {
91
+ const p = a(f);
92
+ p !== f && (ln(o) || (o[s] = p), f = p);
93
+ }
94
+ n[f] = !0;
95
+ }
96
+ return n;
97
+ }
98
+ function _n(n) {
99
+ for (let o = 0; o < n.length; o++)
100
+ d(n, o) || (n[o] = null);
101
+ return n;
102
+ }
103
+ function R(n) {
104
+ const o = ee(null);
105
+ for (const s of kt(n)) {
106
+ var a = an(s, 2);
107
+ const f = a[0], p = a[1];
108
+ d(n, f) && (N(p) ? o[f] = _n(p) : p && typeof p == "object" && p.constructor === Object ? o[f] = R(p) : o[f] = p);
109
+ }
110
+ return o;
111
+ }
112
+ function hn(n) {
113
+ switch (typeof n) {
114
+ case "string":
115
+ return n;
116
+ case "number":
117
+ return dn(n);
118
+ case "boolean":
119
+ return Tn(n);
120
+ case "bigint":
121
+ return Dt ? Dt(n) : "0";
122
+ case "symbol":
123
+ return It ? It(n) : "Symbol()";
124
+ case "undefined":
125
+ return ce(n);
126
+ case "function":
127
+ case "object": {
128
+ if (n === null)
129
+ return ce(n);
130
+ const o = n, a = U(o, "toString");
131
+ if (typeof a == "function") {
132
+ const s = a(o);
133
+ return typeof s == "string" ? s : ce(s);
134
+ }
135
+ return ce(n);
136
+ }
137
+ default:
138
+ return ce(n);
139
+ }
140
+ }
141
+ function U(n, o) {
142
+ for (; n !== null; ) {
143
+ const s = fn(n, o);
144
+ if (s) {
145
+ if (s.get)
146
+ return A(s.get);
147
+ if (typeof s.value == "function")
148
+ return A(s.value);
149
+ }
150
+ n = cn(n);
151
+ }
152
+ function a() {
153
+ return null;
154
+ }
155
+ return a;
156
+ }
157
+ function An(n) {
158
+ try {
159
+ return y(n, ""), !0;
160
+ } catch (o) {
161
+ return !1;
162
+ }
163
+ }
164
+ const Lt = 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"]), $e = 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"]), Xe = 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"]), En = 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"]), Ve = 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"]), Sn = D(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), Ct = D(["#text"]), wt = 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"]), qe = 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"]), Mt = 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"]), Ie = D(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), yn = C(/{{[\w\W]*|^[\w\W]*}}/g), bn = C(/<%[\w\W]*|^[\w\W]*%>/g), Rn = C(/\${[\w\W]*/g), On = C(/^data-[\-\w.\u00B7-\uFFFF]+$/), Nn = C(/^aria-[\-\w]+$/), xt = C(
165
+ /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
166
+ // eslint-disable-line no-useless-escape
167
+ ), Dn = C(/^(?:\w+script|data):/i), In = C(
168
+ /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
169
+ // eslint-disable-line no-control-regex
170
+ ), Ln = C(/^html$/i), Cn = C(/^[a-z][.\w]*(-[.\w]+)+$/i), v = {
171
+ element: 1,
172
+ attribute: 2,
173
+ text: 3,
174
+ cdataSection: 4,
175
+ entityReference: 5,
176
+ // Deprecated
177
+ entityNode: 6,
178
+ // Deprecated
179
+ progressingInstruction: 7,
180
+ comment: 8,
181
+ document: 9,
182
+ documentType: 10,
183
+ documentFragment: 11,
184
+ notation: 12
185
+ // Deprecated
186
+ }, wn = function() {
187
+ return typeof window == "undefined" ? null : window;
188
+ }, Mn = function(o, a) {
189
+ if (typeof o != "object" || typeof o.createPolicy != "function")
190
+ return null;
191
+ let s = null;
192
+ const f = "data-tt-policy-suffix";
193
+ a && a.hasAttribute(f) && (s = a.getAttribute(f));
194
+ const p = "dompurify" + (s ? "#" + s : "");
195
+ try {
196
+ return o.createPolicy(p, {
197
+ createHTML(b) {
198
+ return b;
199
+ },
200
+ createScriptURL(b) {
201
+ return b;
202
+ }
203
+ });
204
+ } catch (b) {
205
+ return console.warn("TrustedTypes policy " + p + " could not be created."), null;
206
+ }
207
+ }, Pt = function() {
208
+ return {
209
+ afterSanitizeAttributes: [],
210
+ afterSanitizeElements: [],
211
+ afterSanitizeShadowDOM: [],
212
+ beforeSanitizeAttributes: [],
213
+ beforeSanitizeElements: [],
214
+ beforeSanitizeShadowDOM: [],
215
+ uponSanitizeAttribute: [],
216
+ uponSanitizeElement: [],
217
+ uponSanitizeShadowNode: []
218
+ };
219
+ };
220
+ function vt() {
221
+ let n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : wn();
222
+ const o = (i) => vt(i);
223
+ if (o.version = "3.4.7", o.removed = [], !n || !n.document || n.document.nodeType !== v.document || !n.Element)
224
+ return o.isSupported = !1, o;
225
+ let a = n.document;
226
+ const s = a, f = s.currentScript;
227
+ n.DocumentFragment;
228
+ const p = n.HTMLTemplateElement, b = n.Node, te = n.Element, I = n.NodeFilter, ne = n.NamedNodeMap;
229
+ ne === void 0 && (n.NamedNodeMap || n.MozNamedAttrMap), n.HTMLFormElement;
230
+ const Le = n.DOMParser, me = n.trustedTypes, W = te.prototype, Ut = U(W, "cloneNode"), Ht = U(W, "remove"), zt = U(W, "nextSibling"), pe = U(W, "childNodes"), de = U(W, "parentNode"), Te = U(W, "shadowRoot"), Gt = U(W, "attributes"), w = b && b.prototype ? U(b.prototype, "nodeType") : null, Y = b && b.prototype ? U(b.prototype, "nodeName") : null;
231
+ if (typeof p == "function") {
232
+ const i = a.createElement("template");
233
+ i.content && i.content.ownerDocument && (a = i.content.ownerDocument);
234
+ }
235
+ let O, oe = "";
236
+ const ge = a, Ce = ge.implementation, Je = ge.createNodeIterator, Wt = ge.createDocumentFragment, Bt = ge.getElementsByTagName, jt = s.importNode;
237
+ let E = Pt();
238
+ o.isSupported = typeof kt == "function" && typeof de == "function" && Ce && Ce.createHTMLDocument !== void 0;
239
+ const _e = yn, he = bn, Ae = Rn, Yt = On, $t = Nn, Xt = Dn, Qe = In, Vt = Cn;
240
+ let et = xt, T = null;
241
+ const we = l({}, [...Lt, ...$e, ...Xe, ...Ve, ...Ct]);
242
+ let h = null;
243
+ const Me = l({}, [...wt, ...qe, ...Mt, ...Ie]);
244
+ let g = Object.seal(ee(null, {
245
+ tagNameCheck: {
246
+ writable: !0,
247
+ configurable: !1,
248
+ enumerable: !0,
249
+ value: null
250
+ },
251
+ attributeNameCheck: {
252
+ writable: !0,
253
+ configurable: !1,
254
+ enumerable: !0,
255
+ value: null
256
+ },
257
+ allowCustomizedBuiltInElements: {
258
+ writable: !0,
259
+ configurable: !1,
260
+ enumerable: !0,
261
+ value: !1
262
+ }
263
+ })), re = null, Ee = null;
264
+ const z = Object.seal(ee(null, {
265
+ tagCheck: {
266
+ writable: !0,
267
+ configurable: !1,
268
+ enumerable: !0,
269
+ value: null
270
+ },
271
+ attributeCheck: {
272
+ writable: !0,
273
+ configurable: !1,
274
+ enumerable: !0,
275
+ value: null
276
+ }
277
+ }));
278
+ let tt = !0, xe = !0, nt = !1, ot = !0, G = !1, ie = !0, B = !1, Pe = !1, ke = !1, $ = !1, Se = !1, ye = !1, rt = !0, it = !1;
279
+ const at = "user-content-";
280
+ let Fe = !0, ae = !1, X = {}, P = null;
281
+ const ve = l({}, ["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"]);
282
+ let st = null;
283
+ const lt = l({}, ["audio", "video", "img", "source", "image", "track"]);
284
+ let Ue = null;
285
+ const ct = l({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), be = "http://www.w3.org/1998/Math/MathML", Re = "http://www.w3.org/2000/svg", k = "http://www.w3.org/1999/xhtml";
286
+ let V = k, He = !1, ze = null;
287
+ const qt = l({}, [be, Re, k], Ye);
288
+ let Ge = l({}, ["mi", "mo", "mn", "ms", "mtext"]), We = l({}, ["annotation-xml"]);
289
+ const Kt = l({}, ["title", "style", "font", "a", "script"]);
290
+ let se = null;
291
+ const Zt = ["application/xhtml+xml", "text/html"], Jt = "text/html";
292
+ let _ = null, q = null;
293
+ const Qt = a.createElement("form"), ft = function(e) {
294
+ return e instanceof RegExp || e instanceof Function;
295
+ }, Be = function() {
296
+ let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
297
+ if (q && q === e)
298
+ return;
299
+ (!e || typeof e != "object") && (e = {}), e = R(e), se = // eslint-disable-next-line unicorn/prefer-includes
300
+ Zt.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? Jt : e.PARSER_MEDIA_TYPE, _ = se === "application/xhtml+xml" ? Ye : ue, T = d(e, "ALLOWED_TAGS") && N(e.ALLOWED_TAGS) ? l({}, e.ALLOWED_TAGS, _) : we, h = d(e, "ALLOWED_ATTR") && N(e.ALLOWED_ATTR) ? l({}, e.ALLOWED_ATTR, _) : Me, ze = d(e, "ALLOWED_NAMESPACES") && N(e.ALLOWED_NAMESPACES) ? l({}, e.ALLOWED_NAMESPACES, Ye) : qt, Ue = d(e, "ADD_URI_SAFE_ATTR") && N(e.ADD_URI_SAFE_ATTR) ? l(R(ct), e.ADD_URI_SAFE_ATTR, _) : ct, st = d(e, "ADD_DATA_URI_TAGS") && N(e.ADD_DATA_URI_TAGS) ? l(R(lt), e.ADD_DATA_URI_TAGS, _) : lt, P = d(e, "FORBID_CONTENTS") && N(e.FORBID_CONTENTS) ? l({}, e.FORBID_CONTENTS, _) : ve, re = d(e, "FORBID_TAGS") && N(e.FORBID_TAGS) ? l({}, e.FORBID_TAGS, _) : R({}), Ee = d(e, "FORBID_ATTR") && N(e.FORBID_ATTR) ? l({}, e.FORBID_ATTR, _) : R({}), X = d(e, "USE_PROFILES") ? e.USE_PROFILES && typeof e.USE_PROFILES == "object" ? R(e.USE_PROFILES) : e.USE_PROFILES : !1, tt = e.ALLOW_ARIA_ATTR !== !1, xe = e.ALLOW_DATA_ATTR !== !1, nt = e.ALLOW_UNKNOWN_PROTOCOLS || !1, ot = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, G = e.SAFE_FOR_TEMPLATES || !1, ie = e.SAFE_FOR_XML !== !1, B = e.WHOLE_DOCUMENT || !1, $ = e.RETURN_DOM || !1, Se = e.RETURN_DOM_FRAGMENT || !1, ye = e.RETURN_TRUSTED_TYPE || !1, ke = e.FORCE_BODY || !1, rt = e.SANITIZE_DOM !== !1, it = e.SANITIZE_NAMED_PROPS || !1, Fe = e.KEEP_CONTENT !== !1, ae = e.IN_PLACE || !1, et = An(e.ALLOWED_URI_REGEXP) ? e.ALLOWED_URI_REGEXP : xt, V = typeof e.NAMESPACE == "string" ? e.NAMESPACE : k, Ge = d(e, "MATHML_TEXT_INTEGRATION_POINTS") && e.MATHML_TEXT_INTEGRATION_POINTS && typeof e.MATHML_TEXT_INTEGRATION_POINTS == "object" ? R(e.MATHML_TEXT_INTEGRATION_POINTS) : l({}, ["mi", "mo", "mn", "ms", "mtext"]), We = d(e, "HTML_INTEGRATION_POINTS") && e.HTML_INTEGRATION_POINTS && typeof e.HTML_INTEGRATION_POINTS == "object" ? R(e.HTML_INTEGRATION_POINTS) : l({}, ["annotation-xml"]);
301
+ const t = d(e, "CUSTOM_ELEMENT_HANDLING") && e.CUSTOM_ELEMENT_HANDLING && typeof e.CUSTOM_ELEMENT_HANDLING == "object" ? R(e.CUSTOM_ELEMENT_HANDLING) : ee(null);
302
+ if (g = ee(null), d(t, "tagNameCheck") && ft(t.tagNameCheck) && (g.tagNameCheck = t.tagNameCheck), d(t, "attributeNameCheck") && ft(t.attributeNameCheck) && (g.attributeNameCheck = t.attributeNameCheck), d(t, "allowCustomizedBuiltInElements") && typeof t.allowCustomizedBuiltInElements == "boolean" && (g.allowCustomizedBuiltInElements = t.allowCustomizedBuiltInElements), G && (xe = !1), Se && ($ = !0), X && (T = l({}, Ct), h = ee(null), X.html === !0 && (l(T, Lt), l(h, wt)), X.svg === !0 && (l(T, $e), l(h, qe), l(h, Ie)), X.svgFilters === !0 && (l(T, Xe), l(h, qe), l(h, Ie)), X.mathMl === !0 && (l(T, Ve), l(h, Mt), l(h, Ie))), z.tagCheck = null, z.attributeCheck = null, d(e, "ADD_TAGS") && (typeof e.ADD_TAGS == "function" ? z.tagCheck = e.ADD_TAGS : N(e.ADD_TAGS) && (T === we && (T = R(T)), l(T, e.ADD_TAGS, _))), d(e, "ADD_ATTR") && (typeof e.ADD_ATTR == "function" ? z.attributeCheck = e.ADD_ATTR : N(e.ADD_ATTR) && (h === Me && (h = R(h)), l(h, e.ADD_ATTR, _))), d(e, "ADD_URI_SAFE_ATTR") && N(e.ADD_URI_SAFE_ATTR) && l(Ue, e.ADD_URI_SAFE_ATTR, _), d(e, "FORBID_CONTENTS") && N(e.FORBID_CONTENTS) && (P === ve && (P = R(P)), l(P, e.FORBID_CONTENTS, _)), d(e, "ADD_FORBID_CONTENTS") && N(e.ADD_FORBID_CONTENTS) && (P === ve && (P = R(P)), l(P, e.ADD_FORBID_CONTENTS, _)), Fe && (T["#text"] = !0), B && l(T, ["html", "head", "body"]), T.table && (l(T, ["tbody"]), delete re.tbody), e.TRUSTED_TYPES_POLICY) {
303
+ if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function")
304
+ throw fe('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
305
+ if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function")
306
+ throw fe('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
307
+ O = e.TRUSTED_TYPES_POLICY, oe = O.createHTML("");
308
+ } else
309
+ O === void 0 && (O = Mn(me, f)), O !== null && typeof oe == "string" && (oe = O.createHTML(""));
310
+ (E.uponSanitizeElement.length > 0 || E.uponSanitizeAttribute.length > 0) && T === we && (T = R(T)), E.uponSanitizeAttribute.length > 0 && h === Me && (h = R(h)), D && D(e), q = e;
311
+ }, ut = l({}, [...$e, ...Xe, ...En]), mt = l({}, [...Ve, ...Sn]), en = function(e) {
312
+ let t = de(e);
313
+ (!t || !t.tagName) && (t = {
314
+ namespaceURI: V,
315
+ tagName: "template"
316
+ });
317
+ const r = ue(e.tagName), u = ue(t.tagName);
318
+ return ze[e.namespaceURI] ? e.namespaceURI === Re ? t.namespaceURI === k ? r === "svg" : t.namespaceURI === be ? r === "svg" && (u === "annotation-xml" || Ge[u]) : !!ut[r] : e.namespaceURI === be ? t.namespaceURI === k ? r === "math" : t.namespaceURI === Re ? r === "math" && We[u] : !!mt[r] : e.namespaceURI === k ? t.namespaceURI === Re && !We[u] || t.namespaceURI === be && !Ge[u] ? !1 : !mt[r] && (Kt[r] || !ut[r]) : !!(se === "application/xhtml+xml" && ze[e.namespaceURI]) : !1;
319
+ }, M = function(e) {
320
+ J(o.removed, {
321
+ element: e
322
+ });
323
+ try {
324
+ de(e).removeChild(e);
325
+ } catch (t) {
326
+ Ht(e);
327
+ }
328
+ }, j = function(e, t) {
329
+ try {
330
+ J(o.removed, {
331
+ attribute: t.getAttributeNode(e),
332
+ from: t
333
+ });
334
+ } catch (r) {
335
+ J(o.removed, {
336
+ attribute: null,
337
+ from: t
338
+ });
339
+ }
340
+ if (t.removeAttribute(e), e === "is")
341
+ if ($ || Se)
342
+ try {
343
+ M(t);
344
+ } catch (r) {
345
+ }
346
+ else
347
+ try {
348
+ t.setAttribute(e, "");
349
+ } catch (r) {
350
+ }
351
+ }, pt = function(e) {
352
+ let t = null, r = null;
353
+ if (ke)
354
+ e = "<remove></remove>" + e;
355
+ else {
356
+ const m = Ot(e, /^[\r\n\t ]+/);
357
+ r = m && m[0];
358
+ }
359
+ se === "application/xhtml+xml" && V === k && (e = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + e + "</body></html>");
360
+ const u = O ? O.createHTML(e) : e;
361
+ if (V === k)
362
+ try {
363
+ t = new Le().parseFromString(u, se);
364
+ } catch (m) {
365
+ }
366
+ if (!t || !t.documentElement) {
367
+ t = Ce.createDocument(V, "template", null);
368
+ try {
369
+ t.documentElement.innerHTML = He ? oe : u;
370
+ } catch (m) {
371
+ }
372
+ }
373
+ const c = t.body || t.documentElement;
374
+ return e && r && c.insertBefore(a.createTextNode(r), c.childNodes[0] || null), V === k ? Bt.call(t, B ? "html" : "body")[0] : B ? t.documentElement : c;
375
+ }, dt = function(e) {
376
+ return Je.call(
377
+ e.ownerDocument || e,
378
+ e,
379
+ // eslint-disable-next-line no-bitwise
380
+ I.SHOW_ELEMENT | I.SHOW_COMMENT | I.SHOW_TEXT | I.SHOW_PROCESSING_INSTRUCTION | I.SHOW_CDATA_SECTION,
381
+ null
382
+ );
383
+ }, Tt = function(e) {
384
+ e.normalize();
385
+ const t = Je.call(
386
+ e.ownerDocument || e,
387
+ e,
388
+ // eslint-disable-next-line no-bitwise
389
+ I.SHOW_TEXT | I.SHOW_COMMENT | I.SHOW_CDATA_SECTION | I.SHOW_PROCESSING_INSTRUCTION,
390
+ null
391
+ );
392
+ let r = t.nextNode();
393
+ for (; r; ) {
394
+ let u = r.data;
395
+ Z([_e, he, Ae], (c) => {
396
+ u = Q(u, c, " ");
397
+ }), r.data = u, r = t.nextNode();
398
+ }
399
+ }, Oe = function(e) {
400
+ const t = Y ? Y(e) : null;
401
+ return typeof t != "string" || _(t) !== "form" ? !1 : typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || // Realm-safe NamedNodeMap detection: equality against the cached
402
+ // prototype getter. Clobbered .attributes (e.g. <input name="attributes">)
403
+ // makes the direct read diverge from the cached read; a clean form
404
+ // (same-realm OR foreign-realm) has both reads pointing at the same
405
+ // canonical NamedNodeMap.
406
+ e.attributes !== Gt(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
407
+ // returns the integer 1 for any Element regardless of realm; direct
408
+ // read on a clobbered form (e.g. <input name="nodeType">) returns
409
+ // the named child element. Cheap addition — nodeType is read from
410
+ // an internal slot, no serialization cost — and removes a residual
411
+ // clobbering surface used by several mXSS / PI / comment branches
412
+ // in _sanitizeElements that compare currentNode.nodeType directly.
413
+ e.nodeType !== w(e) || // HTMLFormElement has [LegacyOverrideBuiltIns]: a descendant named
414
+ // "childNodes" shadows the prototype getter. Direct reads of
415
+ // form.childNodes from a clobbered form return the named child
416
+ // instead of the real NodeList, so any walk that reads it directly
417
+ // skips the form's real children. Compare the direct read to the
418
+ // cached Node.prototype getter — when the form's named-property
419
+ // getter intercepts the read, the two values differ and we flag
420
+ // the form. This catches every clobbering child type (input,
421
+ // select, etc.) regardless of whether the named child happens to
422
+ // carry a numeric .length, which a typeof-based probe would miss
423
+ // (e.g. HTMLSelectElement.length is a defined unsigned-long).
424
+ e.childNodes !== pe(e);
425
+ }, le = function(e) {
426
+ if (!w || typeof e != "object" || e === null)
427
+ return !1;
428
+ try {
429
+ return w(e) === v.documentFragment;
430
+ } catch (t) {
431
+ return !1;
432
+ }
433
+ }, Ne = function(e) {
434
+ if (!w || typeof e != "object" || e === null)
435
+ return !1;
436
+ try {
437
+ return typeof w(e) == "number";
438
+ } catch (t) {
439
+ return !1;
440
+ }
441
+ };
442
+ function H(i, e, t) {
443
+ Z(i, (r) => {
444
+ r.call(o, e, t, q);
445
+ });
446
+ }
447
+ const gt = function(e) {
448
+ let t = null;
449
+ if (H(E.beforeSanitizeElements, e, null), Oe(e))
450
+ return M(e), !0;
451
+ const r = _(e.nodeName);
452
+ if (H(E.uponSanitizeElement, e, {
453
+ tagName: r,
454
+ allowedTags: T
455
+ }), ie && e.hasChildNodes() && !Ne(e.firstElementChild) && y(/<[/\w!]/g, e.innerHTML) && y(/<[/\w!]/g, e.textContent) || ie && e.namespaceURI === k && r === "style" && Ne(e.firstElementChild) || e.nodeType === v.progressingInstruction || ie && e.nodeType === v.comment && y(/<[/\w]/g, e.data))
456
+ return M(e), !0;
457
+ if (re[r] || !(z.tagCheck instanceof Function && z.tagCheck(r)) && !T[r]) {
458
+ if (!re[r] && ht(r) && (g.tagNameCheck instanceof RegExp && y(g.tagNameCheck, r) || g.tagNameCheck instanceof Function && g.tagNameCheck(r)))
459
+ return !1;
460
+ if (Fe && !P[r]) {
461
+ const c = de(e), m = pe(e);
462
+ if (m && c) {
463
+ const L = m.length;
464
+ for (let F = L - 1; F >= 0; --F) {
465
+ const x = Ut(m[F], !0);
466
+ c.insertBefore(x, zt(e));
467
+ }
468
+ }
469
+ }
470
+ return M(e), !0;
471
+ }
472
+ return (w ? w(e) : e.nodeType) === v.element && !en(e) || (r === "noscript" || r === "noembed" || r === "noframes") && y(/<\/no(script|embed|frames)/i, e.innerHTML) ? (M(e), !0) : (G && e.nodeType === v.text && (t = e.textContent, Z([_e, he, Ae], (c) => {
473
+ t = Q(t, c, " ");
474
+ }), e.textContent !== t && (J(o.removed, {
475
+ element: e.cloneNode()
476
+ }), e.textContent = t)), H(E.afterSanitizeElements, e, null), !1);
477
+ }, _t = function(e, t, r) {
478
+ if (Ee[t] || rt && (t === "id" || t === "name") && (r in a || r in Qt))
479
+ return !1;
480
+ const u = h[t] || z.attributeCheck instanceof Function && z.attributeCheck(t, e);
481
+ if (!(xe && !Ee[t] && y(Yt, t))) {
482
+ if (!(tt && y($t, t))) {
483
+ if (!u || Ee[t]) {
484
+ if (
485
+ // First condition does a very basic check if a) it's basically a valid custom element tagname AND
486
+ // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
487
+ // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
488
+ !(ht(e) && (g.tagNameCheck instanceof RegExp && y(g.tagNameCheck, e) || g.tagNameCheck instanceof Function && g.tagNameCheck(e)) && (g.attributeNameCheck instanceof RegExp && y(g.attributeNameCheck, t) || g.attributeNameCheck instanceof Function && g.attributeNameCheck(t, e)) || // Alternative, second condition checks if it's an `is`-attribute, AND
489
+ // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
490
+ t === "is" && g.allowCustomizedBuiltInElements && (g.tagNameCheck instanceof RegExp && y(g.tagNameCheck, r) || g.tagNameCheck instanceof Function && g.tagNameCheck(r)))
491
+ )
492
+ return !1;
493
+ } else if (!Ue[t]) {
494
+ if (!y(et, Q(r, Qe, ""))) {
495
+ if (!((t === "src" || t === "xlink:href" || t === "href") && e !== "script" && Nt(r, "data:") === 0 && st[e])) {
496
+ if (!(nt && !y(Xt, Q(r, Qe, "")))) {
497
+ if (r)
498
+ return !1;
499
+ }
500
+ }
501
+ }
502
+ }
503
+ }
504
+ }
505
+ return !0;
506
+ }, tn = l({}, ["annotation-xml", "color-profile", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "missing-glyph"]), ht = function(e) {
507
+ return !tn[ue(e)] && y(Vt, e);
508
+ }, At = function(e) {
509
+ H(E.beforeSanitizeAttributes, e, null);
510
+ const t = e.attributes;
511
+ if (!t || Oe(e))
512
+ return;
513
+ const r = {
514
+ attrName: "",
515
+ attrValue: "",
516
+ keepAttr: !0,
517
+ allowedAttributes: h,
518
+ forceKeepAttr: void 0
519
+ };
520
+ let u = t.length;
521
+ for (; u--; ) {
522
+ const c = t[u], m = c.name, L = c.namespaceURI, F = c.value, x = _(m), je = F;
523
+ let S = m === "value" ? je : pn(je);
524
+ if (r.attrName = x, r.attrValue = S, r.keepAttr = !0, r.forceKeepAttr = void 0, H(E.uponSanitizeAttribute, e, r), S = r.attrValue, it && (x === "id" || x === "name") && Nt(S, at) !== 0 && (j(m, e), S = at + S), ie && y(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, S)) {
525
+ j(m, e);
526
+ continue;
527
+ }
528
+ if (x === "attributename" && Ot(S, "href")) {
529
+ j(m, e);
530
+ continue;
531
+ }
532
+ if (r.forceKeepAttr)
533
+ continue;
534
+ if (!r.keepAttr) {
535
+ j(m, e);
536
+ continue;
537
+ }
538
+ if (!ot && y(/\/>/i, S)) {
539
+ j(m, e);
540
+ continue;
541
+ }
542
+ G && Z([_e, he, Ae], (St) => {
543
+ S = Q(S, St, " ");
544
+ });
545
+ const Et = _(e.nodeName);
546
+ if (!_t(Et, x, S)) {
547
+ j(m, e);
548
+ continue;
549
+ }
550
+ if (O && typeof me == "object" && typeof me.getAttributeType == "function" && !L)
551
+ switch (me.getAttributeType(Et, x)) {
552
+ case "TrustedHTML": {
553
+ S = O.createHTML(S);
554
+ break;
555
+ }
556
+ case "TrustedScriptURL": {
557
+ S = O.createScriptURL(S);
558
+ break;
559
+ }
560
+ }
561
+ if (S !== je)
562
+ try {
563
+ L ? e.setAttributeNS(L, m, S) : e.setAttribute(m, S), Oe(e) ? M(e) : Rt(o.removed);
564
+ } catch (St) {
565
+ j(m, e);
566
+ }
567
+ }
568
+ H(E.afterSanitizeAttributes, e, null);
569
+ }, De = function(e) {
570
+ let t = null;
571
+ const r = dt(e);
572
+ for (H(E.beforeSanitizeShadowDOM, e, null); t = r.nextNode(); )
573
+ if (H(E.uponSanitizeShadowNode, t, null), gt(t), At(t), le(t.content) && De(t.content), (w ? w(t) : t.nodeType) === v.element) {
574
+ const c = Te ? Te(t) : t.shadowRoot;
575
+ le(c) && (K(c), De(c));
576
+ }
577
+ H(E.afterSanitizeShadowDOM, e, null);
578
+ }, K = function(e) {
579
+ const t = w ? w(e) : e.nodeType;
580
+ if (t === v.element) {
581
+ const c = Te ? Te(e) : e.shadowRoot;
582
+ le(c) && (K(c), De(c));
583
+ }
584
+ const r = pe ? pe(e) : e.childNodes;
585
+ if (!r)
586
+ return;
587
+ const u = [];
588
+ Z(r, (c) => {
589
+ J(u, c);
590
+ });
591
+ for (const c of u)
592
+ K(c);
593
+ if (t === v.element) {
594
+ const c = Y ? Y(e) : null;
595
+ if (typeof c == "string" && _(c) === "template") {
596
+ const m = e.content;
597
+ le(m) && K(m);
598
+ }
599
+ }
600
+ };
601
+ return o.sanitize = function(i) {
602
+ let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, t = null, r = null, u = null, c = null;
603
+ if (He = !i, He && (i = "<!-->"), typeof i != "string" && !Ne(i) && (i = hn(i), typeof i != "string"))
604
+ throw fe("dirty is not a string, aborting");
605
+ if (!o.isSupported)
606
+ return i;
607
+ if (Pe || Be(e), o.removed = [], typeof i == "string" && (ae = !1), ae) {
608
+ const F = Y ? Y(i) : i.nodeName;
609
+ if (typeof F == "string") {
610
+ const x = _(F);
611
+ if (!T[x] || re[x])
612
+ throw fe("root node is forbidden and cannot be sanitized in-place");
613
+ }
614
+ if (Oe(i))
615
+ throw fe("root node is clobbered and cannot be sanitized in-place");
616
+ K(i);
617
+ } else if (Ne(i))
618
+ t = pt("<!---->"), r = t.ownerDocument.importNode(i, !0), r.nodeType === v.element && r.nodeName === "BODY" || r.nodeName === "HTML" ? t = r : t.appendChild(r), K(r);
619
+ else {
620
+ if (!$ && !G && !B && // eslint-disable-next-line unicorn/prefer-includes
621
+ i.indexOf("<") === -1)
622
+ return O && ye ? O.createHTML(i) : i;
623
+ if (t = pt(i), !t)
624
+ return $ ? null : ye ? oe : "";
625
+ }
626
+ t && ke && M(t.firstChild);
627
+ const m = dt(ae ? i : t);
628
+ for (; u = m.nextNode(); )
629
+ gt(u), At(u), le(u.content) && De(u.content);
630
+ if (ae)
631
+ return G && Tt(i), i;
632
+ if ($) {
633
+ if (G && Tt(t), Se)
634
+ for (c = Wt.call(t.ownerDocument); t.firstChild; )
635
+ c.appendChild(t.firstChild);
636
+ else
637
+ c = t;
638
+ return (h.shadowroot || h.shadowrootmode) && (c = jt.call(s, c, !0)), c;
639
+ }
640
+ let L = B ? t.outerHTML : t.innerHTML;
641
+ return B && T["!doctype"] && t.ownerDocument && t.ownerDocument.doctype && t.ownerDocument.doctype.name && y(Ln, t.ownerDocument.doctype.name) && (L = "<!DOCTYPE " + t.ownerDocument.doctype.name + `>
642
+ ` + L), G && Z([_e, he, Ae], (F) => {
643
+ L = Q(L, F, " ");
644
+ }), O && ye ? O.createHTML(L) : L;
645
+ }, o.setConfig = function() {
646
+ let i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
647
+ Be(i), Pe = !0;
648
+ }, o.clearConfig = function() {
649
+ q = null, Pe = !1;
650
+ }, o.isValidAttribute = function(i, e, t) {
651
+ q || Be({});
652
+ const r = _(i), u = _(e);
653
+ return _t(r, u, t);
654
+ }, o.addHook = function(i, e) {
655
+ typeof e == "function" && J(E[i], e);
656
+ }, o.removeHook = function(i, e) {
657
+ if (e !== void 0) {
658
+ const t = un(E[i], e);
659
+ return t === -1 ? void 0 : mn(E[i], t, 1)[0];
660
+ }
661
+ return Rt(E[i]);
662
+ }, o.removeHooks = function(i) {
663
+ E[i] = [];
664
+ }, o.removeAllHooks = function() {
665
+ E = Pt();
666
+ }, o;
667
+ }
668
+ var xn = vt();
669
+ export {
670
+ xn as default
671
+ };