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