ooxml-excel-editor 1.3.1 → 1.3.2

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